dsh-message-gateway 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -0
- package/README.es.md +4 -0
- package/README.md +4 -0
- package/lib/client.js +18 -0
- package/lib/client.js.map +2 -2
- package/lib/index.js +277 -24
- package/lib/index.js.map +4 -4
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -15,6 +15,10 @@ A message-platform gateway plugin for the DSH Web GUI: a "Message platforms" ent
|
|
|
15
15
|
- **WeChat Official Account**: fill in AppID/Secret plus the callback Token, configure the server URL (`/gateway/wechat-mp/callback`) in the console, and followers who message get auto replies
|
|
16
16
|
- **WhatsApp**: fill in Token + Phone Number ID, configure the webhook (`/gateway/whatsapp/webhook`) in the Meta console, and users who message get auto replies
|
|
17
17
|
- **Email**: fill in IMAP (receiving, 993/143) + SMTP (replying, 465/587/25); messages are grouped into per-thread sessions and replies use Re: original subject
|
|
18
|
+
- **DingTalk Bot**: configure custom bot Webhook & optional HMAC Secret for group notifications
|
|
19
|
+
- **Feishu / Lark Bot**: configure custom bot Webhook & optional Secret signature for message delivery
|
|
20
|
+
- **Bark (iOS)**: fill in Device Key for instant push notifications on Apple devices
|
|
21
|
+
- **ServerChan**: fill in SendKey for push notifications to WeChat / mobile channels
|
|
18
22
|
- **Credential management**: plaintext is persisted only to `~/.dsh/gateway.json` (mode 600, atomic write); `/gateway/list` never returns credential plaintext, only a `configured` flag
|
|
19
23
|
- **Secret redaction**: message content written to logs / console is automatically masked for likely secrets (`sk-` prefixed keys, GitHub tokens, `Bearer`, `password=` assignments, PEM private keys, and other common patterns), so secrets in bot conversations never leak into log files
|
|
20
24
|
- **Connection tests**: real per-platform checks — Telegram/Discord via Bot API, QQ via access_token, WeCom via gettoken, WeChat MP via cgi-bin/token, WhatsApp via Graph API, Email via IMAP TCP banner, WeCom AI bot via the official SDK long connection (authenticated = pass)
|
package/README.es.md
CHANGED
|
@@ -15,6 +15,10 @@ Un plugin de pasarela de mensajería para la GUI web de DSH: una entrada "Plataf
|
|
|
15
15
|
- **Cuenta oficial de WeChat**: rellene AppID/Secret más el Token de callback, configure la URL del servidor (`/gateway/wechat-mp/callback`) en la consola, y los seguidores que escriban reciben respuestas automáticas
|
|
16
16
|
- **WhatsApp**: rellene Token + Phone Number ID, configure el webhook (`/gateway/whatsapp/webhook`) en la consola de Meta, y los usuarios que escriban reciben respuestas automáticas
|
|
17
17
|
- **Email**: rellene IMAP (recepción, 993/143) + SMTP (respuesta, 465/587/25); los mensajes se agrupan en sesiones por hilo y las respuestas usan Re: asunto original
|
|
18
|
+
- **Bot de DingTalk**: configure el Webhook y la clave secreta opcional para notificaciones de grupo
|
|
19
|
+
- **Bot de Feishu / Lark**: configure el Webhook y la firma secreta para el envío de mensajes
|
|
20
|
+
- **Bark (iOS)**: ingrese la Device Key para notificaciones instantáneas en dispositivos Apple
|
|
21
|
+
- **ServerChan**: configure la SendKey para enviar notificaciones a WeChat
|
|
18
22
|
- **Gestión de credenciales**: el texto plano se guarda solo en `~/.dsh/gateway.json` (modo 600, escritura atómica); `/gateway/list` nunca devuelve credenciales, solo un marcador `configured`
|
|
19
23
|
- **Redacción de secretos**: el contenido de los mensajes escrito en registros / consola se enmascara automáticamente ante posibles secretos (claves con prefijo `sk-`, tokens de GitHub, `Bearer`, asignaciones `password=`, claves PEM privadas y otros patrones comunes), de modo que los secretos de las conversaciones del bot nunca se filtran a los archivos de registro
|
|
20
24
|
- **Pruebas de conexión**: comprobaciones reales por plataforma — Telegram/Discord vía Bot API, QQ vía access_token, WeCom vía gettoken, cuenta oficial vía cgi-bin/token, WhatsApp vía Graph API, Email vía banner TCP de IMAP, Bot de IA de WeCom vía la conexión larga del SDK oficial (autenticado = correcto)
|
package/README.md
CHANGED
|
@@ -15,6 +15,10 @@ DSH Web GUI 的消息平台网关插件:在侧边栏「新会话」按钮下
|
|
|
15
15
|
- **微信公众号**:填 AppID/Secret + 回调 Token,后台配置服务器 URL(`/gateway/wechat-mp/callback`)后发消息即自动对话
|
|
16
16
|
- **WhatsApp**:填 Token + Phone Number ID,Meta 后台配置 Webhook(`/gateway/whatsapp/webhook`)后发消息即自动对话
|
|
17
17
|
- **Email**:填 IMAP(收件,993/143)+ SMTP(回复,465/587/25),按邮件线程自动归类会话,回复用 Re: 原主题
|
|
18
|
+
- **钉钉群机器人**:配置自定义机器人 Webhook 与可选加签密钥(Secret),支持实时推送与群消息通知
|
|
19
|
+
- **飞书群机器人**:配置自定义机器人 Webhook 与可选签名密钥(Secret),支持标准文本与卡片推送
|
|
20
|
+
- **Bark (iOS)**:填入 Device Key,实现手机秒级弹窗通知推送
|
|
21
|
+
- **Server酱 (Turbo版)**:填入 SendKey,支持将通知推送至微信 / 手机服务号
|
|
18
22
|
- **凭据管理**:明文只落盘 `~/.dsh/gateway.json`(权限 600,原子写入),`/gateway/list` 永不回传凭据明文,只返回 configured 标记
|
|
19
23
|
- **敏感信息脱敏**:写入日志 / 控制台的消息内容自动遮蔽疑似密钥(`sk-` 前缀、GitHub token、`Bearer`、`password=` 赋值、私钥 PEM 等通用模式),机器人对话里的机密不会泄露到日志文件
|
|
20
24
|
- **连接测试**:每个平台独立的真实连接测试——Telegram/Discord 走 Bot API、QQ 走 access_token、企微走 gettoken、微信公众号走 cgi-bin/token、WhatsApp 走 Graph API、Email 走 IMAP TCP banner、企微智能机器人走官方 SDK 长连接(认证成功即通过)
|
package/lib/client.js
CHANGED
|
@@ -103,6 +103,24 @@ var DICTS = {
|
|
|
103
103
|
"platform.whatsapp.hint": "Webhook \u63A5\u5165\uFF1A\u5728 Meta WhatsApp \u5F00\u53D1\u8005\u540E\u53F0\u628A Webhook \u6307\u5411 /gateway/whatsapp/webhook\uFF0C\u9A8C\u8BC1 Token \u586B\u6B64\u5904\u7684 Token\uFF1B\u7528\u6237\u53D1\u6D88\u606F\u5373\u81EA\u52A8\u5BF9\u8BDD\u3002",
|
|
104
104
|
"platform.email": "Email",
|
|
105
105
|
"platform.email.hint": "IMAP \u8F6E\u8BE2\u6536\u4EF6\uFF08993 \u9690\u5F0F TLS / 143 STARTTLS\uFF09+ SMTP \u56DE\u590D\uFF08465 \u9690\u5F0F TLS / 587\u300125 STARTTLS\uFF09\u3002\u6309\u90AE\u4EF6\u7EBF\u7A0B\u81EA\u52A8\u5F52\u7C7B\u4F1A\u8BDD\uFF0C\u56DE\u590D\u7528 Re: \u539F\u4E3B\u9898\uFF1BSMTP \u7559\u7A7A\u65F6\u590D\u7528 IMAP \u670D\u52A1\u5668\u4E0E\u8D26\u53F7\u3002",
|
|
106
|
+
"platform.dingtalk": "\u9489\u9489\u7FA4\u673A\u5668\u4EBA",
|
|
107
|
+
"platform.dingtalk.hint": "\u5728\u9489\u9489\u7FA4\u8BBE\u7F6E\u4E2D\u6DFB\u52A0\u300C\u81EA\u5B9A\u4E49\u673A\u5668\u4EBA\u300D\uFF0C\u590D\u5236\u5176 Webhook \u5730\u5740\u586B\u5165\uFF1B\u82E5\u5F00\u542F\u4E86\u300C\u52A0\u7B7E\u300D\u5B89\u5168\u8BBE\u7F6E\uFF0C\u8BF7\u540C\u65F6\u586B\u5165\u52A0\u7B7E\u5BC6\u94A5 Secret\u3002",
|
|
108
|
+
"field.dingtalkWebhook.ph": "https://oapi.dingtalk.com/robot/send?access_token=...",
|
|
109
|
+
"field.dingtalkSecret": "\u52A0\u7B7E\u5BC6\u94A5 (Secret\uFF0C\u53EF\u9009)",
|
|
110
|
+
"platform.feishu": "\u98DE\u4E66\u7FA4\u673A\u5668\u4EBA",
|
|
111
|
+
"platform.feishu.hint": "\u5728\u98DE\u4E66\u7FA4\u8BBE\u7F6E\u4E2D\u6DFB\u52A0\u300C\u81EA\u5B9A\u4E49\u673A\u5668\u4EBA\u300D\uFF0C\u590D\u5236\u5176 Webhook \u5730\u5740\u586B\u5165\uFF1B\u82E5\u5F00\u542F\u4E86\u300C\u7B7E\u540D\u6821\u9A8C\u300D\uFF0C\u8BF7\u586B\u5165\u5BF9\u5E94\u7684\u7B7E\u540D\u5BC6\u94A5 Secret\u3002",
|
|
112
|
+
"field.feishuWebhook.ph": "https://open.feishu.cn/open-apis/bot/v2/hook/...",
|
|
113
|
+
"field.feishuSecret": "\u7B7E\u540D\u5BC6\u94A5 (Secret\uFF0C\u53EF\u9009)",
|
|
114
|
+
"platform.bark": "Bark (iOS \u6781\u7B80\u63A8\u9001)",
|
|
115
|
+
"platform.bark.hint": "\u82F9\u679C iOS \u8BBE\u5907\u5B89\u88C5 Bark App\uFF0C\u586B\u5165\u751F\u6210\u7684 Device Key\uFF08\u6216\u81EA\u5EFA\u670D\u52A1\u5668\u5730\u5740\uFF09\uFF0C\u5373\u53EF\u5411\u624B\u673A\u79D2\u7EA7\u63A8\u9001\u5B9E\u65F6\u901A\u77E5\u3002",
|
|
116
|
+
"field.barkServer": "\u81EA\u5EFA\u670D\u52A1\u5668 (\u7559\u7A7A\u9ED8\u8BA4\u5B98\u65B9 https://api.day.app)",
|
|
117
|
+
"field.barkServer.ph": "https://api.day.app",
|
|
118
|
+
"field.barkKey": "Device Key",
|
|
119
|
+
"field.barkKey.ph": "\u7C98\u8D34 Bark \u63D0\u4F9B\u7684\u8BBE\u5907 Key",
|
|
120
|
+
"platform.serverchan": "Server\u9171 (Turbo\u7248)",
|
|
121
|
+
"platform.serverchan.hint": "\u901A\u8FC7 Server\u9171 \u63A8\u9001\u6D88\u606F\u81F3\u5FAE\u4FE1 / \u624B\u673A\u670D\u52A1\u53F7\u3002\u524D\u5F80 sct.ftqq.com \u83B7\u53D6 SendKey \u5373\u53EF\u3002",
|
|
122
|
+
"field.serverchanKey": "SendKey",
|
|
123
|
+
"field.serverchanKey.ph": "SCTxxxxxxxxxxxx",
|
|
106
124
|
"platform.webhooks": "Webhooks",
|
|
107
125
|
"platform.wechat.hint": "\u5FAE\u4FE1\u4E2A\u4EBA\u53F7\u9700\u7B2C\u4E09\u65B9\u6846\u67B6\uFF08\u5982 Wechaty\uFF09\u626B\u7801\u767B\u5F55\uFF0C\u672C\u63D2\u4EF6\u6682\u672A\u5185\u7F6E\u8FDE\u63A5\u5668\u3002",
|
|
108
126
|
"platform.webhooks.hint": 'Webhook \u65E0\u9700\u51ED\u636E\u5373\u53EF\u542F\u7528\uFF1B\u53EF\u8BBE\u7F6E\u7B7E\u540D\u5BC6\u94A5\u7528\u4E8E\u6821\u9A8C\u8BF7\u6C42\u3002\u63A5\u6536\u7AEF\u70B9\uFF1APOST /gateway/webhook/in\uFF0C\u8BF7\u6C42\u4F53 {"text": "..."}\uFF08text / content / message \u4EFB\u4E00\u5B57\u6BB5\uFF09\u3002',
|
package/lib/client.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/client/index.ts", "../src/client/api.ts", "../src/client/i18n.ts", "../src/client/Page.tsx", "../src/client/icons.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * dsh-message-gateway \u2014 \u6D4F\u89C8\u5668\u534A\u533A\uFF1A\u5728\u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\u4E0B\u65B9\u6302\u4E00\u4E2A\n * \u300C\u6D88\u606F\u5E73\u53F0\u300D\u6309\u94AE\uFF0C\u70B9\u51FB\u6253\u5F00\u5168\u5C4F\u5E73\u53F0\u7BA1\u7406\u9875\u9762\uFF08\u914D\u7F6E\u51ED\u636E / \u6D4B\u8BD5\u8FDE\u63A5 / \u67E5\u770B\u72B6\u6001\uFF09\u3002\n * \u6240\u6709\u63A5\u7EBF\u5931\u8D25\u5747\u8BB0\u5F55\u65E5\u5FD7\u800C\u4E0D\u629B\u51FA\u2014\u2014\u63D2\u4EF6 apply \u629B\u9519\u4F1A\u5BFC\u81F4\u6574\u4E2A shell \u542F\u52A8\u5931\u8D25\u3002\n * @module dsh-message-gateway/client\n */\n\nimport { createElement, useCallback, useState } from 'react'\nimport { createRoot, type Root } from 'react-dom/client'\nimport { GatewayApi } from './api.ts'\nimport { initI18n, useT } from './i18n.ts'\nimport { GatewayPage } from './Page.tsx'\nimport { InboxIcon } from './icons.tsx'\n\n/** \u6CE8\u5165\u7684 client runtime \u7ED3\u6784\u9762\u5B54\u3002 */\ninterface GatewayClientContext {\n effect(fn: () => (() => void) | void, name: string): void\n locale: {\n getLocale(): { active: string }\n subscribe(fn: () => void): () => void\n }\n}\n\nexport const inject = ['locale']\n\n/** \u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE CSS-module \u54C8\u5E0C\u7247\u6BB5\uFF08*contains* \u9009\u62E9\u5668\uFF09\u3002 */\nconst NEW_SESSION_SELECTOR = '[class*=\"newSession\"]'\n\nconst BUTTON_STYLE = `\n.dsh-gw-open { display:flex; align-items:center; gap:8px; width:100%; padding:8px 12px;\n border:none; background:transparent; color:var(--dsh-git-panel-fg, #24292f); cursor:pointer;\n font-size:12px; font-weight:500; border-radius:8px; }\n.dsh-gw-open:hover { background:rgba(128,128,128,0.1); }\n.dsh-gw-open .icon { font-size:15px; flex:none; }\n.dsh-gw-open .label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis;\n white-space:nowrap; text-align:left; }\n`\n\nlet styleInjected = false\nfunction ensureButtonStyle(): void {\n if (styleInjected) return\n styleInjected = true\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-message-gateway-btn'\n tag.textContent = BUTTON_STYLE\n document.head.appendChild(tag)\n}\n\n/** \u6309\u94AE + \u9875\u9762\u6839\u7EC4\u4EF6\uFF08\u6302\u5728\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\u4E0B\u65B9\uFF09\u3002 */\nfunction GatewayApp(props: { api: GatewayApi }): React.ReactElement {\n const { api } = props\n const t = useT()\n const [open, setOpen] = useState(false)\n const close = useCallback((): void => setOpen(false), [])\n ensureButtonStyle()\n return createElement(\n 'div',\n null,\n createElement(\n 'button',\n { type: 'button', className: 'dsh-gw-open', title: t('gateway.open'), onClick: () => setOpen(true) },\n createElement('span', { className: 'icon' }, createElement(InboxIcon, { size: 16 })),\n createElement('span', { className: 'label' }, t('gateway.title')),\n ),\n open ? createElement(GatewayPage, { api, onClose: close }) : null,\n )\n}\n\n/** Apply the browser half. */\nexport function apply(ctx: GatewayClientContext): void {\n try {\n initI18n(ctx.locale)\n } catch (error) {\n console.error('dsh-message-gateway: i18n init failed (falling back to Chinese)', error)\n }\n\n ctx.effect(() => {\n const host = document.createElement('div')\n host.dataset.gatewayHost = ''\n const root: Root = createRoot(host)\n const api = new GatewayApi()\n let disposed = false\n\n const render = (): void => {\n if (disposed) return\n root.render(createElement(GatewayApp, { api }))\n }\n\n // \u8F6E\u8BE2\u7B49\u5F85\u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\uFF0C\u628A\u300C\u6D88\u606F\u5E73\u53F0\u300D\u6309\u94AE\u63D2\u5230\u5B83\u4E0B\u65B9\u3002\n // \u6302\u8F7D\u6210\u529F\u540E\u505C\u6B62\u8F6E\u8BE2\uFF0C\u7531\u4F4E\u9891\u515C\u5E95\u5B9A\u65F6\u5668\u8D1F\u8D23\u4FA7\u8FB9\u680F\u91CD\u5EFA\u65F6\u7684\u91CD\u65B0\u6302\u8F7D\u3002\n let raf = 0\n let polling = true\n const poll = (): void => {\n if (disposed || !polling) return\n if (!host.isConnected) {\n const btn = document.querySelector<HTMLElement>(NEW_SESSION_SELECTOR)\n if (btn !== null && btn.parentElement !== null) {\n btn.after(host)\n render()\n polling = false\n console.debug('[dsh-message-gateway] mounted after newSession')\n return\n }\n } else {\n polling = false\n return\n }\n raf = requestAnimationFrame(poll)\n }\n raf = requestAnimationFrame(poll)\n\n const fallback = window.setInterval(() => {\n if (disposed) return\n if (!host.isConnected) {\n polling = true\n raf = requestAnimationFrame(poll)\n }\n }, 5000)\n\n return () => {\n disposed = true\n cancelAnimationFrame(raf)\n window.clearInterval(fallback)\n try {\n root.unmount()\n } catch {\n /* \u5FFD\u7565 */\n }\n host.remove()\n }\n }, 'dsh-message-gateway: mount')\n}\n\n/** Cordis plugin entry \u2014 named + default export so the loader always resolves it. */\nexport default { apply, inject }\n", "/**\n * /gateway/* \u8DEF\u7531\u7684\u6D4F\u89C8\u5668\u4FA7\u5BA2\u6237\u7AEF\u3002\n * @module dsh-message-gateway/client/api\n */\n\nimport type { GatewayView } from '../core/types.ts'\n\nexport type Envelope<T> = { ok: true; value: T } | { ok: false; error: { code: string; message: string } }\n\n/** \u9762\u5411 host /gateway \u8DEF\u7531\u7684 JSON \u5BA2\u6237\u7AEF\u3002 */\nexport class GatewayApi {\n private async post<T>(path: string, payload: unknown): Promise<Envelope<T>> {\n let response: Response\n try {\n response = await fetch(path, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload ?? {}),\n })\n } catch (error) {\n return { ok: false, error: { code: 'network', message: error instanceof Error ? error.message : 'network error' } }\n }\n try {\n return (await response.json()) as Envelope<T>\n } catch {\n return { ok: false, error: { code: 'internal', message: `bad response (${response.status})` } }\n }\n }\n\n list(): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/list', {})\n }\n\n save(platform: string, credentials: Record<string, string>): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/save', { platform, ...credentials })\n }\n\n delete(platform: string): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/delete', { platform })\n }\n\n test(platform: string, credentials?: Record<string, string>): Promise<Envelope<{ ok: boolean; detail: string }>> {\n return this.post('/gateway/test', { platform, ...credentials })\n }\n}\n", "/**\n * \u4E09\u8BED\u6587\u6848\uFF08\u4E2D / \u82F1 / \u897F\uFF09\u3002\u8BED\u8A00\u81EA\u52A8\u68C0\u6D4B\uFF1A\u4F18\u5148\u8DDF\u968F DSH \u5E73\u53F0\u8BED\u8A00\uFF08zh \u2192 \u7B80\u4F53\u4E2D\u6587\uFF09\uFF0C\n * \u5176\u6B21\u6D4F\u89C8\u5668\u8BED\u8A00\uFF08es \u2192 \u897F\u73ED\u7259\u8BED\uFF09\uFF0C\u5176\u4F59\u9ED8\u8BA4\u7B80\u4F53\u4E2D\u6587\u3002\n * @module dsh-message-gateway/client/i18n\n */\n\nimport { useSyncExternalStore } from 'react'\n\nexport type Lang = 'zh' | 'en' | 'es'\n\ntype Dict = Record<string, string>\n\nconst DICTS: Record<Lang, Dict> = {\n zh: {\n 'gateway.title': '\u6D88\u606F\u5E73\u53F0',\n 'gateway.open': '\u6253\u5F00\u6D88\u606F\u5E73\u53F0',\n 'gateway.close': '\u5173\u95ED',\n 'gateway.save': '\u4FDD\u5B58',\n 'gateway.test': '\u6D4B\u8BD5\u8FDE\u63A5',\n 'gateway.testing': '\u6D4B\u8BD5\u4E2D\u2026',\n 'gateway.delete': '\u5220\u9664\u914D\u7F6E',\n 'gateway.saved': '\u5DF2\u4FDD\u5B58',\n 'gateway.deleted': '\u5DF2\u5220\u9664',\n 'gateway.testing.result': '\u6D4B\u8BD5\u7ED3\u679C',\n 'gateway.status.connected': '\u5DF2\u8FDE\u63A5',\n 'gateway.status.error': '\u8FDE\u63A5\u5931\u8D25',\n 'gateway.status.none': '\u672A\u914D\u7F6E',\n 'gateway.status.manual': '\u624B\u52A8\u6A21\u5F0F',\n 'gateway.updatedAt': '\u6700\u8FD1\u6D4B\u8BD5',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'QQ \u673A\u5668\u4EBA',\n 'platform.qq.hint': '\u652F\u6301\u4E24\u79CD\u63A5\u5165\u65B9\u5F0F\uFF08\u63A7\u5236\u53F0\u4E8C\u9009\u4E00\uFF09\uFF1A\u2460 WebSocket \u957F\u8FDE\u63A5\u2014\u2014\u4FDD\u5B58 AppID+Secret \u5373\u81EA\u52A8\u8FDE\u63A5\uFF1B\u2461 Webhook \u56DE\u8C03\u2014\u2014\u9700\u516C\u7F51 HTTPS \u5730\u5740\u6307\u5411 /gateway/qq/callback\uFF08\u63A7\u5236\u53F0\u5141\u8BB8 80/443/8080/8443\uFF09\uFF0C\u5E76\u586B\u56DE\u8C03 Token\u3002\u56DE\u590D\u7ECF\u88AB\u52A8\u6D88\u606F API \u53D1\u9001\u3002',\n 'platform.wecom': '\u4F01\u4E1A\u5FAE\u4FE1',\n 'platform.wecom.hint': '\u56DE\u8C03\u5F0F\u63A5\u5165\uFF1A\u5728\u4F01\u4E1A\u5FAE\u4FE1\u7BA1\u7406\u540E\u53F0\u300C\u5E94\u7528 \u2192 \u63A5\u6536\u6D88\u606F\u300D\u914D\u7F6E\u56DE\u8C03 URL\uFF08\u9700\u516C\u7F51\u53EF\u8BBF\u95EE\uFF0C\u6307\u5411 /gateway/wecom/callback\uFF09\u5E76\u586B\u5165 Token \u4E0E EncodingAESKey\uFF0C\u7528\u6237\u7ED9\u5E94\u7528\u53D1\u6D88\u606F\u5373\u53EF\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.wecomAibot': '\u4F01\u4E1A\u5FAE\u4FE1 \u00B7 \u667A\u80FD\u673A\u5668\u4EBA',\n 'platform.wecomAibot.hint': '\u4F7F\u7528\u5B98\u65B9 SDK \u957F\u8FDE\u63A5\uFF08WebSocket\uFF09\uFF0C\u914D\u7F6E Bot ID \u4E0E Secret \u5373\u53EF\u8FDE\u63A5\u667A\u80FD\u673A\u5668\u4EBA\u3002',\n 'field.botId': 'Bot ID',\n 'platform.wechat': '\u5FAE\u4FE1',\n 'platform.wechatMp': '\u5FAE\u4FE1\u516C\u4F17\u53F7',\n 'platform.wechatMp.hint': '\u56DE\u8C03\u5F0F\u63A5\u5165\uFF1A\u5728\u516C\u4F17\u53F7\u540E\u53F0\u300C\u8BBE\u7F6E\u4E0E\u5F00\u53D1 \u2192 \u57FA\u672C\u914D\u7F6E\u300D\u914D\u7F6E\u670D\u52A1\u5668 URL\uFF08\u9700\u516C\u7F51\u53EF\u8BBF\u95EE\uFF0C\u6307\u5411 /gateway/wechat-mp/callback\uFF09\u5E76\u586B\u5165 Token\uFF0C\u5173\u6CE8\u7528\u6237\u53D1\u6D88\u606F\u5373\u53EF\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Webhook \u63A5\u5165\uFF1A\u5728 Meta WhatsApp \u5F00\u53D1\u8005\u540E\u53F0\u628A Webhook \u6307\u5411 /gateway/whatsapp/webhook\uFF0C\u9A8C\u8BC1 Token \u586B\u6B64\u5904\u7684 Token\uFF1B\u7528\u6237\u53D1\u6D88\u606F\u5373\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.email': 'Email',\n 'platform.email.hint': 'IMAP \u8F6E\u8BE2\u6536\u4EF6\uFF08993 \u9690\u5F0F TLS / 143 STARTTLS\uFF09+ SMTP \u56DE\u590D\uFF08465 \u9690\u5F0F TLS / 587\u300125 STARTTLS\uFF09\u3002\u6309\u90AE\u4EF6\u7EBF\u7A0B\u81EA\u52A8\u5F52\u7C7B\u4F1A\u8BDD\uFF0C\u56DE\u590D\u7528 Re: \u539F\u4E3B\u9898\uFF1BSMTP \u7559\u7A7A\u65F6\u590D\u7528 IMAP \u670D\u52A1\u5668\u4E0E\u8D26\u53F7\u3002',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': '\u5FAE\u4FE1\u4E2A\u4EBA\u53F7\u9700\u7B2C\u4E09\u65B9\u6846\u67B6\uFF08\u5982 Wechaty\uFF09\u626B\u7801\u767B\u5F55\uFF0C\u672C\u63D2\u4EF6\u6682\u672A\u5185\u7F6E\u8FDE\u63A5\u5668\u3002',\n 'platform.webhooks.hint': 'Webhook \u65E0\u9700\u51ED\u636E\u5373\u53EF\u542F\u7528\uFF1B\u53EF\u8BBE\u7F6E\u7B7E\u540D\u5BC6\u94A5\u7528\u4E8E\u6821\u9A8C\u8BF7\u6C42\u3002\u63A5\u6536\u7AEF\u70B9\uFF1APOST /gateway/webhook/in\uFF0C\u8BF7\u6C42\u4F53 {\"text\": \"...\"}\uFF08text / content / message \u4EFB\u4E00\u5B57\u6BB5\uFF09\u3002',\n 'field.token': 'Bot Token',\n 'field.token.ph': '\u7C98\u8D34\u673A\u5668\u4EBA Token',\n 'field.secret': '\u5BC6\u94A5',\n 'field.secret.ph': '\u7C98\u8D34\u5BC6\u94A5',\n 'field.appId': 'App ID',\n 'field.callbackToken': '\u56DE\u8C03 Token',\n 'field.qqCallbackToken': '\u56DE\u8C03 Token\uFF08Webhook \u65B9\u5F0F\uFF09',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': '\u4F01\u4E1A ID (CorpID)',\n 'field.agentId': '\u5E94\u7528 ID (AgentID)',\n 'field.phoneId': 'Phone Number ID',\n 'field.imapHost': 'IMAP \u670D\u52A1\u5668',\n 'field.imapPort': 'IMAP \u7AEF\u53E3',\n 'field.imapUser': '\u90AE\u7BB1\u8D26\u53F7',\n 'field.imapPass': '\u90AE\u7BB1\u5BC6\u7801 / \u6388\u6743\u7801',\n 'field.smtpHost': 'SMTP \u670D\u52A1\u5668\uFF08\u53EF\u7559\u7A7A\u590D\u7528 IMAP\uFF09',\n 'field.smtpPort': 'SMTP \u7AEF\u53E3',\n 'field.smtpUser': 'SMTP \u8D26\u53F7',\n 'field.smtpPass': 'SMTP \u5BC6\u7801 / \u6388\u6743\u7801',\n 'field.webhookSecret': '\u7B7E\u540D\u5BC6\u94A5\uFF08\u53EF\u9009\uFF09',\n },\n en: {\n 'gateway.title': 'Message platforms',\n 'gateway.open': 'Open message platforms',\n 'gateway.close': 'Close',\n 'gateway.save': 'Save',\n 'gateway.test': 'Test connection',\n 'gateway.testing': 'Testing\u2026',\n 'gateway.delete': 'Delete config',\n 'gateway.saved': 'Saved',\n 'gateway.deleted': 'Deleted',\n 'gateway.testing.result': 'Test result',\n 'gateway.status.connected': 'Connected',\n 'gateway.status.error': 'Connection failed',\n 'gateway.status.none': 'Not configured',\n 'gateway.status.manual': 'Manual mode',\n 'gateway.updatedAt': 'Last test',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'QQ Bot',\n 'platform.qq.hint': 'Two delivery modes (pick one in the console): \u2460 WebSocket long-connection \u2014 save AppID+Secret to connect automatically; \u2461 Webhook callback \u2014 needs a public HTTPS URL pointing at /gateway/qq/callback (console allows ports 80/443/8080/8443) plus the callback token. Replies go through the passive message API.',\n 'platform.wecom': 'WeCom',\n 'platform.wecom.hint': 'Callback style: in the WeCom admin console (App \u2192 Receive messages) point the callback URL (publicly reachable) at /gateway/wecom/callback and fill in the Token and EncodingAESKey; users who message the app get auto replies.',\n 'platform.wecomAibot': 'WeCom \u00B7 AI Bot',\n 'platform.wecomAibot.hint': 'Uses the official SDK long connection (WebSocket): configure Bot ID and Secret to connect the AI bot.',\n 'field.botId': 'Bot ID',\n 'platform.wechat': 'WeChat',\n 'platform.wechatMp': 'WeChat Official Account',\n 'platform.wechatMp.hint': 'Callback style: in the Official Account console (Settings & Development \u2192 Basic config) point the server URL (publicly reachable) at /gateway/wechat-mp/callback and fill in the Token; followers who message get auto replies.',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Webhook style: in the Meta WhatsApp developer console point the webhook at /gateway/whatsapp/webhook and use this Token as the verify token; users who message get auto replies.',\n 'platform.email': 'Email',\n 'platform.email.hint': 'Receives via IMAP polling (993 implicit TLS / 143 STARTTLS) and replies via SMTP (465 implicit TLS / 587, 25 STARTTLS). Messages are grouped into per-thread sessions; replies use Re: original subject; leave SMTP empty to reuse the IMAP server and account.',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': 'WeChat personal accounts need a third-party framework (e.g. Wechaty) with QR login; this plugin does not bundle a connector yet.',\n 'platform.webhooks.hint': 'Webhooks work without credentials; an optional signing secret validates incoming requests. Receive endpoint: POST /gateway/webhook/in with body {\"text\": \"...\"} (any of text / content / message).',\n 'field.token': 'Bot token',\n 'field.token.ph': 'Paste the bot token',\n 'field.secret': 'Secret',\n 'field.secret.ph': 'Paste the secret',\n 'field.appId': 'App ID',\n 'field.callbackToken': 'Callback token',\n 'field.qqCallbackToken': 'Callback token (Webhook mode)',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': 'Corp ID',\n 'field.agentId': 'Agent ID',\n 'field.phoneId': 'Phone number ID',\n 'field.imapHost': 'IMAP host',\n 'field.imapPort': 'IMAP port',\n 'field.imapUser': 'Email account',\n 'field.imapPass': 'Email password / app password',\n 'field.smtpHost': 'SMTP host (empty = reuse IMAP)',\n 'field.smtpPort': 'SMTP port',\n 'field.smtpUser': 'SMTP account',\n 'field.smtpPass': 'SMTP password / app password',\n 'field.webhookSecret': 'Signing secret (optional)',\n },\n es: {\n 'gateway.title': 'Plataformas de mensajer\u00EDa',\n 'gateway.open': 'Abrir plataformas de mensajer\u00EDa',\n 'gateway.close': 'Cerrar',\n 'gateway.save': 'Guardar',\n 'gateway.test': 'Probar conexi\u00F3n',\n 'gateway.testing': 'Probando\u2026',\n 'gateway.delete': 'Eliminar configuraci\u00F3n',\n 'gateway.saved': 'Guardado',\n 'gateway.deleted': 'Eliminado',\n 'gateway.testing.result': 'Resultado de la prueba',\n 'gateway.status.connected': 'Conectado',\n 'gateway.status.error': 'Error de conexi\u00F3n',\n 'gateway.status.none': 'No configurado',\n 'gateway.status.manual': 'Modo manual',\n 'gateway.updatedAt': '\u00DAltima prueba',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'Bot de QQ',\n 'platform.wecom': 'WeCom',\n 'platform.wecom.hint': 'Estilo callback: en la consola de WeCom (App \u2192 Recibir mensajes) apunte la URL de callback (accesible p\u00FAblicamente) a /gateway/wecom/callback y rellene el Token y el EncodingAESKey; los usuarios que escriban al app reciben respuestas autom\u00E1ticas.',\n 'platform.wecomAibot': 'WeCom \u00B7 Bot de IA',\n 'platform.wecomAibot.hint': 'Usa la conexi\u00F3n larga del SDK oficial (WebSocket): configura el Bot ID y el Secret para conectar el bot de IA.',\n 'field.botId': 'Bot ID',\n 'platform.wechat': 'WeChat',\n 'platform.wechatMp': 'Cuenta oficial de WeChat',\n 'platform.wechatMp.hint': 'Estilo callback: en la consola de la Cuenta oficial (Configuraci\u00F3n y desarrollo \u2192 Configuraci\u00F3n b\u00E1sica) apunte la URL del servidor (accesible p\u00FAblicamente) a /gateway/wechat-mp/callback y rellene el Token; los seguidores que escriban reciben respuestas autom\u00E1ticas.',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Estilo webhook: en la consola de Meta WhatsApp apunte el webhook a /gateway/whatsapp/webhook y use este Token como token de verificaci\u00F3n; los usuarios que escriban reciben respuestas autom\u00E1ticas.',\n 'platform.email': 'Email',\n 'platform.email.hint': 'Recibe por sondeo IMAP (993 TLS impl\u00EDcito / 143 STARTTLS) y responde por SMTP (465 TLS impl\u00EDcito / 587, 25 STARTTLS). Los mensajes se agrupan en sesiones por hilo; las respuestas usan Re: asunto original; deje SMTP vac\u00EDo para reutilizar el servidor y la cuenta IMAP.',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': 'Las cuentas personales de WeChat necesitan un framework de terceros (p. ej. Wechaty) con inicio de sesi\u00F3n por QR; este plugin a\u00FAn no incluye un conector.',\n 'platform.webhooks.hint': 'Los webhooks funcionan sin credenciales; un secreto de firma opcional valida las peticiones entrantes. Endpoint de recepci\u00F3n: POST /gateway/webhook/in con cuerpo {\"text\": \"...\"} (cualquiera de text / content / message).',\n 'field.token': 'Token del bot',\n 'field.token.ph': 'Pega el token del bot',\n 'field.secret': 'Secreto',\n 'field.secret.ph': 'Pega el secreto',\n 'field.appId': 'App ID',\n 'field.callbackToken': 'Token de callback',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': 'Corp ID',\n 'field.agentId': 'Agent ID',\n 'field.phoneId': 'Phone number ID',\n 'field.imapHost': 'Servidor IMAP',\n 'field.imapPort': 'Puerto IMAP',\n 'field.imapUser': 'Cuenta de correo',\n 'field.imapPass': 'Contrase\u00F1a / contrase\u00F1a de aplicaci\u00F3n',\n 'field.smtpHost': 'Servidor SMTP (vac\u00EDo = reutilizar IMAP)',\n 'field.smtpPort': 'Puerto SMTP',\n 'field.smtpUser': 'Cuenta SMTP',\n 'field.smtpPass': 'Contrase\u00F1a SMTP / contrase\u00F1a de aplicaci\u00F3n',\n 'field.webhookSecret': 'Secreto de firma (opcional)',\n },\n}\n\n/** \u5E73\u53F0 locale \u670D\u52A1\u7684\u7ED3\u6784\u9762\u5B54\uFF08\u89C1 index.ts\uFF09\u3002 */\ninterface LocaleService {\n getLocale(): { active: string }\n subscribe(fn: () => void): () => void\n}\n\nlet locale: LocaleService | null = null\nlet lang: Lang = 'zh'\nlet revision = 0\nconst listeners = new Set<() => void>()\n\nfunction notify(): void {\n revision += 1\n for (const fn of listeners) fn()\n}\n\nfunction detectLang(): Lang {\n const active = locale?.getLocale().active\n if (active === 'zh') return 'zh'\n const nav = (navigator.language || '').toLowerCase()\n if (nav.startsWith('es')) return 'es'\n if (active === 'en') return 'en'\n if (nav.startsWith('zh')) return 'zh'\n return 'zh'\n}\n\n/** \u63A5\u5165\u5E73\u53F0 locale \u670D\u52A1\uFF1B\u4ECE client \u5165\u53E3\u8C03\u7528\u4E00\u6B21\u3002 */\nexport function initI18n(service: LocaleService): void {\n if (locale === service) return\n locale = service\n lang = detectLang()\n service.subscribe(() => {\n const next = detectLang()\n if (next !== lang) {\n lang = next\n notify()\n }\n })\n}\n\nconst subscribe = (fn: () => void): (() => void) => {\n listeners.add(fn)\n return () => {\n listeners.delete(fn)\n }\n}\n\nconst getSnapshot = (): number => revision\n\n/** \u7FFB\u8BD1\uFF1B\u7F3A\u5931\u7684 key \u56DE\u9000\u5230\u4E2D\u6587\u3002 */\nexport function t(key: string): string {\n return DICTS[lang][key] ?? DICTS.zh[key] ?? key\n}\n\n/** React hook\uFF1A\u8BED\u8A00\u5207\u6362\u65F6\u89E6\u53D1\u91CD\u6E32\u67D3\uFF1B\u8FD4\u56DE\u7684 t() \u4E3A\u6A21\u5757\u7EA7\u7A33\u5B9A\u5F15\u7528\u3002 */\nexport function useT(): (key: string) => string {\n useSyncExternalStore(subscribe, getSnapshot)\n return t\n}\n", "/**\n * \u6D88\u606F\u5E73\u53F0\u9875\u9762\uFF1A\u8986\u76D6\u5728\u5BF9\u8BDD\u533A\u4E4B\u4E0A\u7684\u5168\u5C4F\u9875\u9762\u3002\u5DE6\u680F\u4E3A\u5E73\u53F0\u5217\u8868\uFF08\u56FE\u6807 + \u72B6\u6001\uFF09\uFF0C\n * \u53F3\u680F\u4E3A\u9009\u4E2D\u5E73\u53F0\u7684\u51ED\u636E\u8868\u5355\uFF08\u4FDD\u5B58 / \u6D4B\u8BD5\u8FDE\u63A5 / \u5220\u9664 / \u72B6\u6001\u8BE6\u60C5\uFF09\u3002\n * @module dsh-message-gateway/client/Page\n */\n\nimport { createElement, useCallback, useEffect, useState } from 'react'\nimport type { GatewayView, PlatformDef, PlatformStatus } from '../core/types.ts'\nimport type { GatewayApi } from './api.ts'\nimport { useT } from './i18n.ts'\nimport { InboxIcon, PlatformIcon } from './icons.tsx'\n\nconst STYLE = `\n.dsh-gw { --gw-fg:#24292f; --gw-muted:#6e7781; --gw-border:rgba(128,128,128,0.25);\n --gw-hover:rgba(0,0,0,0.06); --gw-bg:#ffffff; --gw-panel:#f6f8fa; --gw-accent:#1976d2;\n --gw-ok:#1a7f37; --gw-err:#cf222e; --gw-warn:#9a6700; position:fixed; inset:0; z-index:1200;\n background:rgba(0,0,0,0.45); display:flex; align-items:center; justify-content:center;\n color:var(--gw-fg); font-size:13px; font-family:-apple-system,BlinkMacSystemFont,\n \"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif; }\n[data-ds-dark-theme] .dsh-gw { --gw-fg:#d1d9e0; --gw-muted:#9198a1; --gw-border:rgba(255,255,255,0.14);\n --gw-hover:rgba(255,255,255,0.08); --gw-bg:#1f2328; --gw-panel:#161b22; --gw-accent:#58a6ff;\n --gw-ok:#3fb950; --gw-err:#f85149; --gw-warn:#d4a72c; }\n.dsh-gw * { box-sizing:border-box; }\n.dsh-gw-page { width:min(1000px, 94vw); height:min(680px, 88vh); background:var(--gw-bg);\n border:1px solid var(--gw-border); border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,0.35);\n display:flex; flex-direction:column; overflow:hidden; }\n.dsh-gw-head { display:flex; align-items:center; gap:8px; padding:14px 18px;\n border-bottom:1px solid var(--gw-border); font-weight:600; font-size:15px; }\n.dsh-gw-head .spacer { flex:1; }\n.dsh-gw-close { border:none; background:transparent; color:var(--gw-muted); cursor:pointer;\n width:30px; height:30px; border-radius:8px; display:flex; align-items:center;\n justify-content:center; padding:0; }\n.dsh-gw-close:hover { background:var(--gw-hover); color:var(--gw-fg); }\n.dsh-gw-body { flex:1; display:flex; min-height:0; }\n.dsh-gw-list { width:230px; flex:none; border-right:1px solid var(--gw-border);\n overflow-y:auto; padding:8px; }\n.dsh-gw-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px;\n cursor:pointer; }\n.dsh-gw-item:hover { background:var(--gw-hover); }\n.dsh-gw-item.active { background:var(--gw-hover); box-shadow:inset 0 0 0 1px var(--gw-border); }\n.dsh-gw-item .icon { font-size:18px; flex:none; }\n.dsh-gw-item .name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis;\n white-space:nowrap; }\n.dsh-gw-item .dot { flex:none; width:8px; height:8px; border-radius:50%; }\n.dsh-gw-item .dot.connected { background:var(--gw-ok); }\n.dsh-gw-item .dot.error { background:var(--gw-err); }\n.dsh-gw-item .dot.none { background:#8b949e; }\n.dsh-gw-item .dot.manual { background:var(--gw-warn); }\n.dsh-gw-item .st { font-size:10px; color:var(--gw-muted); flex:none; width:56px;\n text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.dsh-gw-detail { flex:1; min-width:0; overflow-y:auto; padding:18px 22px; }\n.dsh-gw-detail h3 { margin:0 0 4px; font-size:15px; display:flex; align-items:center; gap:8px; }\n.dsh-gw-detail .hint { color:var(--gw-muted); font-size:12px; line-height:1.6; margin:4px 0 14px; }\n.dsh-gw-status { display:inline-flex; align-items:center; gap:6px; padding:3px 10px;\n border-radius:999px; font-size:11px; margin-bottom:14px; }\n.dsh-gw-status.connected { background:rgba(26,127,55,0.12); color:var(--gw-ok); }\n.dsh-gw-status.error { background:rgba(207,34,46,0.12); color:var(--gw-err); }\n.dsh-gw-status.none { background:var(--gw-panel); color:var(--gw-muted); }\n.dsh-gw-status.manual { background:rgba(154,103,0,0.12); color:var(--gw-warn); }\n.dsh-gw-field { margin-bottom:12px; }\n.dsh-gw-field label { display:block; font-size:12px; color:var(--gw-muted); margin-bottom:4px; }\n.dsh-gw-input { width:100%; padding:8px 10px; font-size:13px; color:var(--gw-fg);\n background:var(--gw-bg); border:1px solid var(--gw-border); border-radius:8px; outline:none; }\n.dsh-gw-input:focus { border-color:var(--gw-accent); }\n.dsh-gw-input.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }\n.dsh-gw-actions { display:flex; gap:8px; margin-top:16px; align-items:center; }\n.dsh-gw-btn { border:1px solid var(--gw-border); background:transparent; color:var(--gw-fg);\n border-radius:8px; padding:7px 14px; font-size:13px; cursor:pointer; }\n.dsh-gw-btn:hover { background:var(--gw-hover); }\n.dsh-gw-btn.primary { background:var(--gw-accent); border-color:var(--gw-accent); color:#fff; }\n.dsh-gw-btn.danger { color:var(--gw-err); }\n.dsh-gw-btn:disabled { opacity:0.5; cursor:default; }\n.dsh-gw-msg { flex:1; font-size:12px; text-align:right; white-space:pre-wrap; word-break:break-all; }\n.dsh-gw-msg.ok { color:var(--gw-ok); }\n.dsh-gw-msg.err { color:var(--gw-err); }\n.dsh-gw-detail-empty { color:var(--gw-muted); padding:40px; text-align:center; }\n`\n\nlet styleInjected = false\nfunction ensureStyle(): void {\n if (styleInjected) return\n styleInjected = true\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-message-gateway'\n tag.textContent = STYLE\n document.head.appendChild(tag)\n}\n\n/** \u9875\u9762 props\u3002 */\nexport function GatewayPage(props: { api: GatewayApi; onClose: () => void }): React.ReactElement {\n const { api, onClose } = props\n const t = useT()\n const [view, setView] = useState<GatewayView | null>(null)\n const [selected, setSelected] = useState<string>('telegram')\n const [form, setForm] = useState<Record<string, string>>({})\n const [busy, setBusy] = useState(false)\n const [message, setMessage] = useState<{ text: string; kind: 'ok' | 'err' } | null>(null)\n const [testing, setTesting] = useState(false)\n const [testResult, setTestResult] = useState<{ ok: boolean; detail: string } | null>(null)\n\n const load = useCallback(async (): Promise<void> => {\n const result = await api.list()\n if (result.ok) {\n setView(result.value)\n // \u9884\u586B\u5F53\u524D\u9009\u4E2D\u5E73\u53F0\u7684\u5DF2\u5B58\u51ED\u636E\uFF08\u8868\u5355\u521D\u59CB\u4E3A\u7A7A\uFF0C\u5360\u4F4D\u663E\u793A\uFF09\u3002\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }, [api])\n\n useEffect(() => {\n void load()\n }, [load])\n\n // ESC \u5173\u95ED\u3002\n useEffect(() => {\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') onClose()\n }\n window.addEventListener('keydown', onKey)\n return () => window.removeEventListener('keydown', onKey)\n }, [onClose])\n\n ensureStyle()\n\n const statusOf = (id: string): PlatformStatus | undefined => view?.status[id]\n const defOf = (id: string): PlatformDef | undefined => view?.platforms.find((p) => p.id === id)\n\n const select = (id: string): void => {\n setSelected(id)\n setForm({})\n setMessage(null)\n setTestResult(null)\n }\n\n const save = async (): Promise<void> => {\n const def = defOf(selected)\n if (def === undefined) return\n if (def.fields.length > 0 && def.fields.every((f) => (form[f.key] ?? '').trim() === '')) {\n setMessage({ text: t('field.token.ph'), kind: 'err' })\n return\n }\n setBusy(true)\n setMessage(null)\n const result = await api.save(selected, form)\n setBusy(false)\n if (result.ok) {\n setView(result.value)\n setMessage({ text: t('gateway.saved'), kind: 'ok' })\n // \u4FDD\u5B58\u6210\u529F\u540E\u7ACB\u5373\u7528\u521A\u4FDD\u5B58\u7684\u51ED\u636E\u6D4B\u4E00\u6B21\u8FDE\u63A5\uFF0C\u72B6\u6001\u5373\u65F6\u5237\u65B0\u3002\n void runTest()\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }\n\n const runTest = async (): Promise<void> => {\n setTesting(true)\n setTestResult(null)\n // \u76F4\u63A5\u7528\u5F53\u524D\u8868\u5355\u503C\u6D4B\u8BD5\uFF08\u53EA\u6D4B\u4E0D\u5B58\uFF09\uFF1B\u4FDD\u5B58\u624D\u662F\u6301\u4E45\u5316\u3002\n const def = defOf(selected)\n const result = await api.test(selected, def !== undefined && def.fields.length > 0 ? form : undefined)\n setTesting(false)\n if (result.ok) {\n setTestResult(result.value)\n void load()\n } else {\n setTestResult({ ok: false, detail: result.error.message })\n }\n }\n\n const remove = async (): Promise<void> => {\n setBusy(true)\n setMessage(null)\n const result = await api.delete(selected)\n setBusy(false)\n if (result.ok) {\n setView(result.value)\n setForm({})\n setTestResult(null)\n setMessage({ text: t('gateway.deleted'), kind: 'ok' })\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }\n\n const selectedDef = defOf(selected)\n const selectedStatus = statusOf(selected)\n\n return (\n <div className=\"dsh-gw\" onClick={onClose}>\n <div className=\"dsh-gw-page\" onClick={(event) => event.stopPropagation()}>\n <div className=\"dsh-gw-head\">\n <span><InboxIcon size={16} /> {t('gateway.title')}</span>\n <span className=\"spacer\" />\n <button type=\"button\" className=\"dsh-gw-close\" title={t('gateway.close')} onClick={onClose}>\n <svg viewBox=\"0 0 16 16\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.6\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" />\n </svg>\n </button>\n </div>\n <div className=\"dsh-gw-body\">\n <div className=\"dsh-gw-list\">\n {view === null\n ? null\n : view.platforms.map((def) => {\n const st = view.status[def.id]\n const state = st?.state ?? 'none'\n return (\n <div key={def.id}\n className={`dsh-gw-item${def.id === selected ? ' active' : ''}`}\n onClick={() => select(def.id)}>\n <span className=\"icon\">{createElement(PlatformIcon, { platform: def.id, size: 18 })}</span>\n <span className=\"name\">{t(def.nameKey)}</span>\n <span className={`dot ${state}`} />\n <span className=\"st\">{t(`gateway.status.${state}`)}</span>\n </div>\n )\n })}\n </div>\n <div className=\"dsh-gw-detail\">\n {selectedDef === undefined ? (\n <div className=\"dsh-gw-detail-empty\">\u2026</div>\n ) : (\n <>\n <h3>{createElement(PlatformIcon, { platform: selectedDef.id, size: 20 })} {t(selectedDef.nameKey)}</h3>\n {selectedDef.hintKey !== undefined ? (\n <div className=\"hint\">{t(selectedDef.hintKey)}</div>\n ) : null}\n {selectedStatus !== undefined ? (\n <span className={`dsh-gw-status ${selectedStatus.state}`}>\n {t(`gateway.status.${selectedStatus.state}`)}\n {selectedStatus.state === 'connected' && selectedStatus.detail !== ''\n ? ` \u00B7 ${selectedStatus.detail}`\n : ''}\n {selectedStatus.state === 'error' && selectedStatus.detail !== ''\n ? ` \u00B7 ${selectedStatus.detail}`\n : ''}\n </span>\n ) : null}\n\n {selectedDef.fields.map((field) => (\n <div key={field.key} className=\"dsh-gw-field\">\n <label>{t(field.labelKey)}</label>\n <input\n className={`dsh-gw-input mono`}\n type={field.kind === 'secret' ? 'password' : field.kind === 'number' ? 'number' : 'text'}\n value={form[field.key] ?? ''}\n placeholder={field.placeholderKey !== undefined ? t(field.placeholderKey) : ''}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={(event) => setForm((prev) => ({ ...prev, [field.key]: event.target.value }))}\n />\n </div>\n ))}\n\n <div className=\"dsh-gw-actions\">\n {selectedDef.fields.length > 0 ? (\n <>\n <button type=\"button\" className=\"dsh-gw-btn primary\" disabled={busy}\n onClick={() => void save()}>{t('gateway.save')}</button>\n {selectedDef.testable ? (\n <button type=\"button\" className=\"dsh-gw-btn\" disabled={busy || testing}\n onClick={() => void runTest()}>\n {testing ? t('gateway.testing') : t('gateway.test')}\n </button>\n ) : null}\n {selectedStatus?.configured === true ? (\n <button type=\"button\" className=\"dsh-gw-btn danger\" disabled={busy}\n onClick={() => void remove()}>{t('gateway.delete')}</button>\n ) : null}\n </>\n ) : (\n <span className=\"hint\">{t(selectedDef.hintKey ?? '')}</span>\n )}\n {message !== null ? <span className={`dsh-gw-msg ${message.kind}`}>{message.text}</span> : null}\n </div>\n\n {testResult !== null ? (\n <div className=\"dsh-gw-field\" style={{ marginTop: 14 }}>\n <label>{t('gateway.testing.result')}</label>\n <div className={`dsh-gw-msg ${testResult.ok ? 'ok' : 'err'}`}\n style={{ textAlign: 'left' }}>{testResult.detail}</div>\n </div>\n ) : null}\n </>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n", "/**\n * \u7EBF\u6027 SVG \u56FE\u6807\u96C6\uFF08iconfont \u98CE\u683C\uFF0C24\u00D724 viewBox\uFF0Cstroke \u7EBF\u6761\uFF09\u3002\n * \u66FF\u4EE3\u5E73\u53F0 emoji \u4E0E\u6587\u672C\u56FE\u6807\uFF0C\u89C6\u89C9\u66F4\u7CBE\u7EC6\u7EDF\u4E00\u3002\n * @module dsh-message-gateway/client/icons\n */\n\nimport { createElement } from 'react'\n\n/** \u901A\u7528\u7EBF\u6027\u56FE\u6807\u9AA8\u67B6\u3002 */\nfunction Icon(props: {\n d: string\n size?: number\n strokeWidth?: number\n fill?: string\n extra?: string\n title?: string\n}): React.ReactElement {\n const { d, size = 18, strokeWidth = 1.6, fill = 'none', extra = '', title } = props\n return createElement(\n 'svg',\n {\n viewBox: '0 0 24 24',\n width: size,\n height: size,\n fill,\n stroke: 'currentColor',\n strokeWidth,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': title === undefined ? true : undefined,\n ...(extra !== '' ? { className: extra } : {}),\n },\n title !== undefined ? createElement('title', null, title) : null,\n createElement('path', { d }),\n )\n}\n\n/** \u6536\u4EF6\u7BB1\uFF08\u4FA7\u8FB9\u680F\u300C\u6D88\u606F\u5E73\u53F0\u300D\u5165\u53E3\uFF09\u3002 */\nexport const InboxIcon = (props: { size?: number; title?: string }): React.ReactElement =>\n Icon({ d: 'M22 12h-6l-2 3h-4l-2-3H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z', ...props })\n\n/** Telegram \u7EB8\u98DE\u673A\u3002 */\nexport const TelegramIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M21.5 4.5l-18 7 5 1.8M21.5 4.5L15 20l-3.5-6.7M8.5 13.3L21.5 4.5', ...props })\n\n/** Discord \u6E38\u620F\u624B\u67C4\u3002 */\nexport const DiscordIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M6 3l-3 4v11a1 1 0 0 0 1 1h3l1-2 2 1 2-1 2 1 2-1 1 2h3a1 1 0 0 0 1-1V7l-3-4H6zM9 12a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm6 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z', ...props })\n\n/** QQ \u804A\u5929\u6C14\u6CE1\u3002 */\nexport const QqIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5c-.9 0-1.8-.1-2.6-.4L5 21l1-3.5A8.5 8.5 0 1 1 21 11.5zM8.5 10.5h.01M15.5 10.5h.01M8.5 14c.7.8 2 1.3 3.5 1.3s2.8-.5 3.5-1.3', ...props })\n\n/** \u4F01\u4E1A\u5FAE\u4FE1\uFF08\u697C\u5B87 + \u6C14\u6CE1\uFF09\u3002 */\nexport const WecomIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M3 21h18M5 21V7l7-4 7 4v14M9 9h.01M9 13h.01M9 17h.01M15 9h.01M15 13h.01M15 17h.01M12 9v.01M12 13v.01M12 17v.01', ...props })\n\n/** \u667A\u80FD\u673A\u5668\u4EBA\u3002 */\nexport const BotIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M12 8V4M8 4h8M12 20c-4 0-6-2-6-5v-3c0-3 2-5 6-5s6 2 6 5v3c0 3-2 5-6 5zM9 13h.01M15 13h.01', ...props })\n\n/** \u5FAE\u4FE1\uFF08\u5BF9\u8BDD\u6C14\u6CE1 + \u5FAE\u4FE1\u7EFF\u70B9\uFF09\u3002 */\nexport const WechatIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M9 4a5 5 0 0 0 0 10 4.6 4.6 0 0 0 2-.5l2 .8-1-1.6a5 5 0 0 0 3-3.2A5 5 0 0 0 9 4zM17 11a5 5 0 0 0-4 2.1A5 5 0 0 1 9 11.6 5 5 0 0 1 14 8a5 5 0 0 1 3 3z', ...props })\n\n/** \u5FAE\u4FE1\u516C\u4F17\u53F7\uFF08\u62A5\u7EB8 + \u9891\u9053\uFF09\u3002 */\nexport const MpIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M4 5h16v14H4zM4 9h16M8 13h5M8 16h8', ...props })\n\n/** WhatsApp \u7535\u8BDD\u6C14\u6CE1\u3002 */\nexport const WhatsappIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M12 3a9 9 0 0 0-7.8 13.5L3 21l4.6-1.2A9 9 0 1 0 12 3zM9 8c.3 1.5 1.5 3 3 4 .5.3 1 .6 1.6.7.4.1.9-.2 1.1-.6l.3-.6c.2-.4.6-.3 1-.1l1 .5c.4.2.6.6.5.9-.1.8-.9 1.5-1.7 1.4-2.4-.2-4.6-1.4-6-3.1A6 6 0 0 1 8 9c0-.8.6-1.5 1.4-1.7.3-.1.6.1.7.4L9 8z', ...props })\n\n/** Email \u4FE1\u5C01\u3002 */\nexport const EmailIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm0 2l8 6 8-6', ...props })\n\n/** Webhook \u6302\u94A9\u3002 */\nexport const WebhookIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M18 8a3 3 0 0 1 3 3c0 1-.5 1.9-1.3 2.4M12 4l3 6M4 14l3-6M6 8a3 3 0 0 1 3 3c0 .8-.3 1.5-.8 2M4 14h8a2 2 0 0 1 2 2 2 2 0 0 1-2 2H4a2 2 0 0 1-2-2 2 2 0 0 1 2-2z', ...props })\n\n/** \u5E73\u53F0 id \u2192 \u7EBF\u6027\u56FE\u6807\u3002 */\nexport const PlatformIcon = (props: { platform: string; size?: number }): React.ReactElement => {\n const { platform, size } = props\n switch (platform) {\n case 'telegram': return createElement(TelegramIcon, { size })\n case 'discord': return createElement(DiscordIcon, { size })\n case 'qq': return createElement(QqIcon, { size })\n case 'wecom': return createElement(WecomIcon, { size })\n case 'wecom-aibot': return createElement(BotIcon, { size })\n case 'wechat': return createElement(WechatIcon, { size })\n case 'wechat-mp': return createElement(MpIcon, { size })\n case 'whatsapp': return createElement(WhatsappIcon, { size })\n case 'email': return createElement(EmailIcon, { size })\n case 'webhooks': return createElement(WebhookIcon, { size })\n default: return createElement(InboxIcon, { size })\n }\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAAA,gBAAqD;AACrD,oBAAsC;;;ACE/B,IAAM,aAAN,MAAiB;AAAA,EACtB,MAAc,KAAQ,MAAc,SAAwC;AAC1E,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM,MAAM,MAAM;AAAA,QAC3B,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,QAC9C,MAAM,KAAK,UAAU,WAAW,CAAC,CAAC;AAAA,MACpC,CAAC;AAAA,IACH,SAAS,OAAO;AACd,aAAO,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,WAAW,SAAS,iBAAiB,QAAQ,MAAM,UAAU,gBAAgB,EAAE;AAAA,IACpH;AACA,QAAI;AACF,aAAQ,MAA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,QAAQ;AAAA,MAER;AACA,WAAK,OAAO;AAAA,IACd;AAAA,EACF,GAAG,4BAA4B;AACjC;AAGA,IAAO,gBAAQ,EAAE,OAAO,OAAO;",
|
|
4
|
+
"sourcesContent": ["/**\n * dsh-message-gateway \u2014 \u6D4F\u89C8\u5668\u534A\u533A\uFF1A\u5728\u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\u4E0B\u65B9\u6302\u4E00\u4E2A\n * \u300C\u6D88\u606F\u5E73\u53F0\u300D\u6309\u94AE\uFF0C\u70B9\u51FB\u6253\u5F00\u5168\u5C4F\u5E73\u53F0\u7BA1\u7406\u9875\u9762\uFF08\u914D\u7F6E\u51ED\u636E / \u6D4B\u8BD5\u8FDE\u63A5 / \u67E5\u770B\u72B6\u6001\uFF09\u3002\n * \u6240\u6709\u63A5\u7EBF\u5931\u8D25\u5747\u8BB0\u5F55\u65E5\u5FD7\u800C\u4E0D\u629B\u51FA\u2014\u2014\u63D2\u4EF6 apply \u629B\u9519\u4F1A\u5BFC\u81F4\u6574\u4E2A shell \u542F\u52A8\u5931\u8D25\u3002\n * @module dsh-message-gateway/client\n */\n\nimport { createElement, useCallback, useState } from 'react'\nimport { createRoot, type Root } from 'react-dom/client'\nimport { GatewayApi } from './api.ts'\nimport { initI18n, useT } from './i18n.ts'\nimport { GatewayPage } from './Page.tsx'\nimport { InboxIcon } from './icons.tsx'\n\n/** \u6CE8\u5165\u7684 client runtime \u7ED3\u6784\u9762\u5B54\u3002 */\ninterface GatewayClientContext {\n effect(fn: () => (() => void) | void, name: string): void\n locale: {\n getLocale(): { active: string }\n subscribe(fn: () => void): () => void\n }\n}\n\nexport const inject = ['locale']\n\n/** \u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE CSS-module \u54C8\u5E0C\u7247\u6BB5\uFF08*contains* \u9009\u62E9\u5668\uFF09\u3002 */\nconst NEW_SESSION_SELECTOR = '[class*=\"newSession\"]'\n\nconst BUTTON_STYLE = `\n.dsh-gw-open { display:flex; align-items:center; gap:8px; width:100%; padding:8px 12px;\n border:none; background:transparent; color:var(--dsh-git-panel-fg, #24292f); cursor:pointer;\n font-size:12px; font-weight:500; border-radius:8px; }\n.dsh-gw-open:hover { background:rgba(128,128,128,0.1); }\n.dsh-gw-open .icon { font-size:15px; flex:none; }\n.dsh-gw-open .label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis;\n white-space:nowrap; text-align:left; }\n`\n\nlet styleInjected = false\nfunction ensureButtonStyle(): void {\n if (styleInjected) return\n styleInjected = true\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-message-gateway-btn'\n tag.textContent = BUTTON_STYLE\n document.head.appendChild(tag)\n}\n\n/** \u6309\u94AE + \u9875\u9762\u6839\u7EC4\u4EF6\uFF08\u6302\u5728\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\u4E0B\u65B9\uFF09\u3002 */\nfunction GatewayApp(props: { api: GatewayApi }): React.ReactElement {\n const { api } = props\n const t = useT()\n const [open, setOpen] = useState(false)\n const close = useCallback((): void => setOpen(false), [])\n ensureButtonStyle()\n return createElement(\n 'div',\n null,\n createElement(\n 'button',\n { type: 'button', className: 'dsh-gw-open', title: t('gateway.open'), onClick: () => setOpen(true) },\n createElement('span', { className: 'icon' }, createElement(InboxIcon, { size: 16 })),\n createElement('span', { className: 'label' }, t('gateway.title')),\n ),\n open ? createElement(GatewayPage, { api, onClose: close }) : null,\n )\n}\n\n/** Apply the browser half. */\nexport function apply(ctx: GatewayClientContext): void {\n try {\n initI18n(ctx.locale)\n } catch (error) {\n console.error('dsh-message-gateway: i18n init failed (falling back to Chinese)', error)\n }\n\n ctx.effect(() => {\n const host = document.createElement('div')\n host.dataset.gatewayHost = ''\n const root: Root = createRoot(host)\n const api = new GatewayApi()\n let disposed = false\n\n const render = (): void => {\n if (disposed) return\n root.render(createElement(GatewayApp, { api }))\n }\n\n // \u8F6E\u8BE2\u7B49\u5F85\u4FA7\u8FB9\u680F\u300C\u65B0\u4F1A\u8BDD\u300D\u6309\u94AE\uFF0C\u628A\u300C\u6D88\u606F\u5E73\u53F0\u300D\u6309\u94AE\u63D2\u5230\u5B83\u4E0B\u65B9\u3002\n // \u6302\u8F7D\u6210\u529F\u540E\u505C\u6B62\u8F6E\u8BE2\uFF0C\u7531\u4F4E\u9891\u515C\u5E95\u5B9A\u65F6\u5668\u8D1F\u8D23\u4FA7\u8FB9\u680F\u91CD\u5EFA\u65F6\u7684\u91CD\u65B0\u6302\u8F7D\u3002\n let raf = 0\n let polling = true\n const poll = (): void => {\n if (disposed || !polling) return\n if (!host.isConnected) {\n const btn = document.querySelector<HTMLElement>(NEW_SESSION_SELECTOR)\n if (btn !== null && btn.parentElement !== null) {\n btn.after(host)\n render()\n polling = false\n console.debug('[dsh-message-gateway] mounted after newSession')\n return\n }\n } else {\n polling = false\n return\n }\n raf = requestAnimationFrame(poll)\n }\n raf = requestAnimationFrame(poll)\n\n const fallback = window.setInterval(() => {\n if (disposed) return\n if (!host.isConnected) {\n polling = true\n raf = requestAnimationFrame(poll)\n }\n }, 5000)\n\n return () => {\n disposed = true\n cancelAnimationFrame(raf)\n window.clearInterval(fallback)\n try {\n root.unmount()\n } catch {\n /* \u5FFD\u7565 */\n }\n host.remove()\n }\n }, 'dsh-message-gateway: mount')\n}\n\n/** Cordis plugin entry \u2014 named + default export so the loader always resolves it. */\nexport default { apply, inject }\n", "/**\n * /gateway/* \u8DEF\u7531\u7684\u6D4F\u89C8\u5668\u4FA7\u5BA2\u6237\u7AEF\u3002\n * @module dsh-message-gateway/client/api\n */\n\nimport type { GatewayView } from '../core/types.ts'\n\nexport type Envelope<T> = { ok: true; value: T } | { ok: false; error: { code: string; message: string } }\n\n/** \u9762\u5411 host /gateway \u8DEF\u7531\u7684 JSON \u5BA2\u6237\u7AEF\u3002 */\nexport class GatewayApi {\n private async post<T>(path: string, payload: unknown): Promise<Envelope<T>> {\n let response: Response\n try {\n response = await fetch(path, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload ?? {}),\n })\n } catch (error) {\n return { ok: false, error: { code: 'network', message: error instanceof Error ? error.message : 'network error' } }\n }\n try {\n return (await response.json()) as Envelope<T>\n } catch {\n return { ok: false, error: { code: 'internal', message: `bad response (${response.status})` } }\n }\n }\n\n list(): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/list', {})\n }\n\n save(platform: string, credentials: Record<string, string>): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/save', { platform, ...credentials })\n }\n\n delete(platform: string): Promise<Envelope<GatewayView>> {\n return this.post('/gateway/delete', { platform })\n }\n\n test(platform: string, credentials?: Record<string, string>): Promise<Envelope<{ ok: boolean; detail: string }>> {\n return this.post('/gateway/test', { platform, ...credentials })\n }\n}\n", "/**\n * \u4E09\u8BED\u6587\u6848\uFF08\u4E2D / \u82F1 / \u897F\uFF09\u3002\u8BED\u8A00\u81EA\u52A8\u68C0\u6D4B\uFF1A\u4F18\u5148\u8DDF\u968F DSH \u5E73\u53F0\u8BED\u8A00\uFF08zh \u2192 \u7B80\u4F53\u4E2D\u6587\uFF09\uFF0C\n * \u5176\u6B21\u6D4F\u89C8\u5668\u8BED\u8A00\uFF08es \u2192 \u897F\u73ED\u7259\u8BED\uFF09\uFF0C\u5176\u4F59\u9ED8\u8BA4\u7B80\u4F53\u4E2D\u6587\u3002\n * @module dsh-message-gateway/client/i18n\n */\n\nimport { useSyncExternalStore } from 'react'\n\nexport type Lang = 'zh' | 'en' | 'es'\n\ntype Dict = Record<string, string>\n\nconst DICTS: Record<Lang, Dict> = {\n zh: {\n 'gateway.title': '\u6D88\u606F\u5E73\u53F0',\n 'gateway.open': '\u6253\u5F00\u6D88\u606F\u5E73\u53F0',\n 'gateway.close': '\u5173\u95ED',\n 'gateway.save': '\u4FDD\u5B58',\n 'gateway.test': '\u6D4B\u8BD5\u8FDE\u63A5',\n 'gateway.testing': '\u6D4B\u8BD5\u4E2D\u2026',\n 'gateway.delete': '\u5220\u9664\u914D\u7F6E',\n 'gateway.saved': '\u5DF2\u4FDD\u5B58',\n 'gateway.deleted': '\u5DF2\u5220\u9664',\n 'gateway.testing.result': '\u6D4B\u8BD5\u7ED3\u679C',\n 'gateway.status.connected': '\u5DF2\u8FDE\u63A5',\n 'gateway.status.error': '\u8FDE\u63A5\u5931\u8D25',\n 'gateway.status.none': '\u672A\u914D\u7F6E',\n 'gateway.status.manual': '\u624B\u52A8\u6A21\u5F0F',\n 'gateway.updatedAt': '\u6700\u8FD1\u6D4B\u8BD5',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'QQ \u673A\u5668\u4EBA',\n 'platform.qq.hint': '\u652F\u6301\u4E24\u79CD\u63A5\u5165\u65B9\u5F0F\uFF08\u63A7\u5236\u53F0\u4E8C\u9009\u4E00\uFF09\uFF1A\u2460 WebSocket \u957F\u8FDE\u63A5\u2014\u2014\u4FDD\u5B58 AppID+Secret \u5373\u81EA\u52A8\u8FDE\u63A5\uFF1B\u2461 Webhook \u56DE\u8C03\u2014\u2014\u9700\u516C\u7F51 HTTPS \u5730\u5740\u6307\u5411 /gateway/qq/callback\uFF08\u63A7\u5236\u53F0\u5141\u8BB8 80/443/8080/8443\uFF09\uFF0C\u5E76\u586B\u56DE\u8C03 Token\u3002\u56DE\u590D\u7ECF\u88AB\u52A8\u6D88\u606F API \u53D1\u9001\u3002',\n 'platform.wecom': '\u4F01\u4E1A\u5FAE\u4FE1',\n 'platform.wecom.hint': '\u56DE\u8C03\u5F0F\u63A5\u5165\uFF1A\u5728\u4F01\u4E1A\u5FAE\u4FE1\u7BA1\u7406\u540E\u53F0\u300C\u5E94\u7528 \u2192 \u63A5\u6536\u6D88\u606F\u300D\u914D\u7F6E\u56DE\u8C03 URL\uFF08\u9700\u516C\u7F51\u53EF\u8BBF\u95EE\uFF0C\u6307\u5411 /gateway/wecom/callback\uFF09\u5E76\u586B\u5165 Token \u4E0E EncodingAESKey\uFF0C\u7528\u6237\u7ED9\u5E94\u7528\u53D1\u6D88\u606F\u5373\u53EF\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.wecomAibot': '\u4F01\u4E1A\u5FAE\u4FE1 \u00B7 \u667A\u80FD\u673A\u5668\u4EBA',\n 'platform.wecomAibot.hint': '\u4F7F\u7528\u5B98\u65B9 SDK \u957F\u8FDE\u63A5\uFF08WebSocket\uFF09\uFF0C\u914D\u7F6E Bot ID \u4E0E Secret \u5373\u53EF\u8FDE\u63A5\u667A\u80FD\u673A\u5668\u4EBA\u3002',\n 'field.botId': 'Bot ID',\n 'platform.wechat': '\u5FAE\u4FE1',\n 'platform.wechatMp': '\u5FAE\u4FE1\u516C\u4F17\u53F7',\n 'platform.wechatMp.hint': '\u56DE\u8C03\u5F0F\u63A5\u5165\uFF1A\u5728\u516C\u4F17\u53F7\u540E\u53F0\u300C\u8BBE\u7F6E\u4E0E\u5F00\u53D1 \u2192 \u57FA\u672C\u914D\u7F6E\u300D\u914D\u7F6E\u670D\u52A1\u5668 URL\uFF08\u9700\u516C\u7F51\u53EF\u8BBF\u95EE\uFF0C\u6307\u5411 /gateway/wechat-mp/callback\uFF09\u5E76\u586B\u5165 Token\uFF0C\u5173\u6CE8\u7528\u6237\u53D1\u6D88\u606F\u5373\u53EF\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Webhook \u63A5\u5165\uFF1A\u5728 Meta WhatsApp \u5F00\u53D1\u8005\u540E\u53F0\u628A Webhook \u6307\u5411 /gateway/whatsapp/webhook\uFF0C\u9A8C\u8BC1 Token \u586B\u6B64\u5904\u7684 Token\uFF1B\u7528\u6237\u53D1\u6D88\u606F\u5373\u81EA\u52A8\u5BF9\u8BDD\u3002',\n 'platform.email': 'Email',\n 'platform.email.hint': 'IMAP \u8F6E\u8BE2\u6536\u4EF6\uFF08993 \u9690\u5F0F TLS / 143 STARTTLS\uFF09+ SMTP \u56DE\u590D\uFF08465 \u9690\u5F0F TLS / 587\u300125 STARTTLS\uFF09\u3002\u6309\u90AE\u4EF6\u7EBF\u7A0B\u81EA\u52A8\u5F52\u7C7B\u4F1A\u8BDD\uFF0C\u56DE\u590D\u7528 Re: \u539F\u4E3B\u9898\uFF1BSMTP \u7559\u7A7A\u65F6\u590D\u7528 IMAP \u670D\u52A1\u5668\u4E0E\u8D26\u53F7\u3002',\n 'platform.dingtalk': '\u9489\u9489\u7FA4\u673A\u5668\u4EBA',\n 'platform.dingtalk.hint': '\u5728\u9489\u9489\u7FA4\u8BBE\u7F6E\u4E2D\u6DFB\u52A0\u300C\u81EA\u5B9A\u4E49\u673A\u5668\u4EBA\u300D\uFF0C\u590D\u5236\u5176 Webhook \u5730\u5740\u586B\u5165\uFF1B\u82E5\u5F00\u542F\u4E86\u300C\u52A0\u7B7E\u300D\u5B89\u5168\u8BBE\u7F6E\uFF0C\u8BF7\u540C\u65F6\u586B\u5165\u52A0\u7B7E\u5BC6\u94A5 Secret\u3002',\n 'field.dingtalkWebhook.ph': 'https://oapi.dingtalk.com/robot/send?access_token=...',\n 'field.dingtalkSecret': '\u52A0\u7B7E\u5BC6\u94A5 (Secret\uFF0C\u53EF\u9009)',\n 'platform.feishu': '\u98DE\u4E66\u7FA4\u673A\u5668\u4EBA',\n 'platform.feishu.hint': '\u5728\u98DE\u4E66\u7FA4\u8BBE\u7F6E\u4E2D\u6DFB\u52A0\u300C\u81EA\u5B9A\u4E49\u673A\u5668\u4EBA\u300D\uFF0C\u590D\u5236\u5176 Webhook \u5730\u5740\u586B\u5165\uFF1B\u82E5\u5F00\u542F\u4E86\u300C\u7B7E\u540D\u6821\u9A8C\u300D\uFF0C\u8BF7\u586B\u5165\u5BF9\u5E94\u7684\u7B7E\u540D\u5BC6\u94A5 Secret\u3002',\n 'field.feishuWebhook.ph': 'https://open.feishu.cn/open-apis/bot/v2/hook/...',\n 'field.feishuSecret': '\u7B7E\u540D\u5BC6\u94A5 (Secret\uFF0C\u53EF\u9009)',\n 'platform.bark': 'Bark (iOS \u6781\u7B80\u63A8\u9001)',\n 'platform.bark.hint': '\u82F9\u679C iOS \u8BBE\u5907\u5B89\u88C5 Bark App\uFF0C\u586B\u5165\u751F\u6210\u7684 Device Key\uFF08\u6216\u81EA\u5EFA\u670D\u52A1\u5668\u5730\u5740\uFF09\uFF0C\u5373\u53EF\u5411\u624B\u673A\u79D2\u7EA7\u63A8\u9001\u5B9E\u65F6\u901A\u77E5\u3002',\n 'field.barkServer': '\u81EA\u5EFA\u670D\u52A1\u5668 (\u7559\u7A7A\u9ED8\u8BA4\u5B98\u65B9 https://api.day.app)',\n 'field.barkServer.ph': 'https://api.day.app',\n 'field.barkKey': 'Device Key',\n 'field.barkKey.ph': '\u7C98\u8D34 Bark \u63D0\u4F9B\u7684\u8BBE\u5907 Key',\n 'platform.serverchan': 'Server\u9171 (Turbo\u7248)',\n 'platform.serverchan.hint': '\u901A\u8FC7 Server\u9171 \u63A8\u9001\u6D88\u606F\u81F3\u5FAE\u4FE1 / \u624B\u673A\u670D\u52A1\u53F7\u3002\u524D\u5F80 sct.ftqq.com \u83B7\u53D6 SendKey \u5373\u53EF\u3002',\n 'field.serverchanKey': 'SendKey',\n 'field.serverchanKey.ph': 'SCTxxxxxxxxxxxx',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': '\u5FAE\u4FE1\u4E2A\u4EBA\u53F7\u9700\u7B2C\u4E09\u65B9\u6846\u67B6\uFF08\u5982 Wechaty\uFF09\u626B\u7801\u767B\u5F55\uFF0C\u672C\u63D2\u4EF6\u6682\u672A\u5185\u7F6E\u8FDE\u63A5\u5668\u3002',\n 'platform.webhooks.hint': 'Webhook \u65E0\u9700\u51ED\u636E\u5373\u53EF\u542F\u7528\uFF1B\u53EF\u8BBE\u7F6E\u7B7E\u540D\u5BC6\u94A5\u7528\u4E8E\u6821\u9A8C\u8BF7\u6C42\u3002\u63A5\u6536\u7AEF\u70B9\uFF1APOST /gateway/webhook/in\uFF0C\u8BF7\u6C42\u4F53 {\"text\": \"...\"}\uFF08text / content / message \u4EFB\u4E00\u5B57\u6BB5\uFF09\u3002',\n 'field.token': 'Bot Token',\n 'field.token.ph': '\u7C98\u8D34\u673A\u5668\u4EBA Token',\n 'field.secret': '\u5BC6\u94A5',\n 'field.secret.ph': '\u7C98\u8D34\u5BC6\u94A5',\n 'field.appId': 'App ID',\n 'field.callbackToken': '\u56DE\u8C03 Token',\n 'field.qqCallbackToken': '\u56DE\u8C03 Token\uFF08Webhook \u65B9\u5F0F\uFF09',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': '\u4F01\u4E1A ID (CorpID)',\n 'field.agentId': '\u5E94\u7528 ID (AgentID)',\n 'field.phoneId': 'Phone Number ID',\n 'field.imapHost': 'IMAP \u670D\u52A1\u5668',\n 'field.imapPort': 'IMAP \u7AEF\u53E3',\n 'field.imapUser': '\u90AE\u7BB1\u8D26\u53F7',\n 'field.imapPass': '\u90AE\u7BB1\u5BC6\u7801 / \u6388\u6743\u7801',\n 'field.smtpHost': 'SMTP \u670D\u52A1\u5668\uFF08\u53EF\u7559\u7A7A\u590D\u7528 IMAP\uFF09',\n 'field.smtpPort': 'SMTP \u7AEF\u53E3',\n 'field.smtpUser': 'SMTP \u8D26\u53F7',\n 'field.smtpPass': 'SMTP \u5BC6\u7801 / \u6388\u6743\u7801',\n 'field.webhookSecret': '\u7B7E\u540D\u5BC6\u94A5\uFF08\u53EF\u9009\uFF09',\n },\n en: {\n 'gateway.title': 'Message platforms',\n 'gateway.open': 'Open message platforms',\n 'gateway.close': 'Close',\n 'gateway.save': 'Save',\n 'gateway.test': 'Test connection',\n 'gateway.testing': 'Testing\u2026',\n 'gateway.delete': 'Delete config',\n 'gateway.saved': 'Saved',\n 'gateway.deleted': 'Deleted',\n 'gateway.testing.result': 'Test result',\n 'gateway.status.connected': 'Connected',\n 'gateway.status.error': 'Connection failed',\n 'gateway.status.none': 'Not configured',\n 'gateway.status.manual': 'Manual mode',\n 'gateway.updatedAt': 'Last test',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'QQ Bot',\n 'platform.qq.hint': 'Two delivery modes (pick one in the console): \u2460 WebSocket long-connection \u2014 save AppID+Secret to connect automatically; \u2461 Webhook callback \u2014 needs a public HTTPS URL pointing at /gateway/qq/callback (console allows ports 80/443/8080/8443) plus the callback token. Replies go through the passive message API.',\n 'platform.wecom': 'WeCom',\n 'platform.wecom.hint': 'Callback style: in the WeCom admin console (App \u2192 Receive messages) point the callback URL (publicly reachable) at /gateway/wecom/callback and fill in the Token and EncodingAESKey; users who message the app get auto replies.',\n 'platform.wecomAibot': 'WeCom \u00B7 AI Bot',\n 'platform.wecomAibot.hint': 'Uses the official SDK long connection (WebSocket): configure Bot ID and Secret to connect the AI bot.',\n 'field.botId': 'Bot ID',\n 'platform.wechat': 'WeChat',\n 'platform.wechatMp': 'WeChat Official Account',\n 'platform.wechatMp.hint': 'Callback style: in the Official Account console (Settings & Development \u2192 Basic config) point the server URL (publicly reachable) at /gateway/wechat-mp/callback and fill in the Token; followers who message get auto replies.',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Webhook style: in the Meta WhatsApp developer console point the webhook at /gateway/whatsapp/webhook and use this Token as the verify token; users who message get auto replies.',\n 'platform.email': 'Email',\n 'platform.email.hint': 'Receives via IMAP polling (993 implicit TLS / 143 STARTTLS) and replies via SMTP (465 implicit TLS / 587, 25 STARTTLS). Messages are grouped into per-thread sessions; replies use Re: original subject; leave SMTP empty to reuse the IMAP server and account.',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': 'WeChat personal accounts need a third-party framework (e.g. Wechaty) with QR login; this plugin does not bundle a connector yet.',\n 'platform.webhooks.hint': 'Webhooks work without credentials; an optional signing secret validates incoming requests. Receive endpoint: POST /gateway/webhook/in with body {\"text\": \"...\"} (any of text / content / message).',\n 'field.token': 'Bot token',\n 'field.token.ph': 'Paste the bot token',\n 'field.secret': 'Secret',\n 'field.secret.ph': 'Paste the secret',\n 'field.appId': 'App ID',\n 'field.callbackToken': 'Callback token',\n 'field.qqCallbackToken': 'Callback token (Webhook mode)',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': 'Corp ID',\n 'field.agentId': 'Agent ID',\n 'field.phoneId': 'Phone number ID',\n 'field.imapHost': 'IMAP host',\n 'field.imapPort': 'IMAP port',\n 'field.imapUser': 'Email account',\n 'field.imapPass': 'Email password / app password',\n 'field.smtpHost': 'SMTP host (empty = reuse IMAP)',\n 'field.smtpPort': 'SMTP port',\n 'field.smtpUser': 'SMTP account',\n 'field.smtpPass': 'SMTP password / app password',\n 'field.webhookSecret': 'Signing secret (optional)',\n },\n es: {\n 'gateway.title': 'Plataformas de mensajer\u00EDa',\n 'gateway.open': 'Abrir plataformas de mensajer\u00EDa',\n 'gateway.close': 'Cerrar',\n 'gateway.save': 'Guardar',\n 'gateway.test': 'Probar conexi\u00F3n',\n 'gateway.testing': 'Probando\u2026',\n 'gateway.delete': 'Eliminar configuraci\u00F3n',\n 'gateway.saved': 'Guardado',\n 'gateway.deleted': 'Eliminado',\n 'gateway.testing.result': 'Resultado de la prueba',\n 'gateway.status.connected': 'Conectado',\n 'gateway.status.error': 'Error de conexi\u00F3n',\n 'gateway.status.none': 'No configurado',\n 'gateway.status.manual': 'Modo manual',\n 'gateway.updatedAt': '\u00DAltima prueba',\n 'platform.telegram': 'Telegram',\n 'platform.discord': 'Discord',\n 'platform.qq': 'Bot de QQ',\n 'platform.wecom': 'WeCom',\n 'platform.wecom.hint': 'Estilo callback: en la consola de WeCom (App \u2192 Recibir mensajes) apunte la URL de callback (accesible p\u00FAblicamente) a /gateway/wecom/callback y rellene el Token y el EncodingAESKey; los usuarios que escriban al app reciben respuestas autom\u00E1ticas.',\n 'platform.wecomAibot': 'WeCom \u00B7 Bot de IA',\n 'platform.wecomAibot.hint': 'Usa la conexi\u00F3n larga del SDK oficial (WebSocket): configura el Bot ID y el Secret para conectar el bot de IA.',\n 'field.botId': 'Bot ID',\n 'platform.wechat': 'WeChat',\n 'platform.wechatMp': 'Cuenta oficial de WeChat',\n 'platform.wechatMp.hint': 'Estilo callback: en la consola de la Cuenta oficial (Configuraci\u00F3n y desarrollo \u2192 Configuraci\u00F3n b\u00E1sica) apunte la URL del servidor (accesible p\u00FAblicamente) a /gateway/wechat-mp/callback y rellene el Token; los seguidores que escriban reciben respuestas autom\u00E1ticas.',\n 'platform.whatsapp': 'WhatsApp',\n 'platform.whatsapp.hint': 'Estilo webhook: en la consola de Meta WhatsApp apunte el webhook a /gateway/whatsapp/webhook y use este Token como token de verificaci\u00F3n; los usuarios que escriban reciben respuestas autom\u00E1ticas.',\n 'platform.email': 'Email',\n 'platform.email.hint': 'Recibe por sondeo IMAP (993 TLS impl\u00EDcito / 143 STARTTLS) y responde por SMTP (465 TLS impl\u00EDcito / 587, 25 STARTTLS). Los mensajes se agrupan en sesiones por hilo; las respuestas usan Re: asunto original; deje SMTP vac\u00EDo para reutilizar el servidor y la cuenta IMAP.',\n 'platform.webhooks': 'Webhooks',\n 'platform.wechat.hint': 'Las cuentas personales de WeChat necesitan un framework de terceros (p. ej. Wechaty) con inicio de sesi\u00F3n por QR; este plugin a\u00FAn no incluye un conector.',\n 'platform.webhooks.hint': 'Los webhooks funcionan sin credenciales; un secreto de firma opcional valida las peticiones entrantes. Endpoint de recepci\u00F3n: POST /gateway/webhook/in con cuerpo {\"text\": \"...\"} (cualquiera de text / content / message).',\n 'field.token': 'Token del bot',\n 'field.token.ph': 'Pega el token del bot',\n 'field.secret': 'Secreto',\n 'field.secret.ph': 'Pega el secreto',\n 'field.appId': 'App ID',\n 'field.callbackToken': 'Token de callback',\n 'field.encodingAESKey': 'EncodingAESKey',\n 'field.corpId': 'Corp ID',\n 'field.agentId': 'Agent ID',\n 'field.phoneId': 'Phone number ID',\n 'field.imapHost': 'Servidor IMAP',\n 'field.imapPort': 'Puerto IMAP',\n 'field.imapUser': 'Cuenta de correo',\n 'field.imapPass': 'Contrase\u00F1a / contrase\u00F1a de aplicaci\u00F3n',\n 'field.smtpHost': 'Servidor SMTP (vac\u00EDo = reutilizar IMAP)',\n 'field.smtpPort': 'Puerto SMTP',\n 'field.smtpUser': 'Cuenta SMTP',\n 'field.smtpPass': 'Contrase\u00F1a SMTP / contrase\u00F1a de aplicaci\u00F3n',\n 'field.webhookSecret': 'Secreto de firma (opcional)',\n },\n}\n\n/** \u5E73\u53F0 locale \u670D\u52A1\u7684\u7ED3\u6784\u9762\u5B54\uFF08\u89C1 index.ts\uFF09\u3002 */\ninterface LocaleService {\n getLocale(): { active: string }\n subscribe(fn: () => void): () => void\n}\n\nlet locale: LocaleService | null = null\nlet lang: Lang = 'zh'\nlet revision = 0\nconst listeners = new Set<() => void>()\n\nfunction notify(): void {\n revision += 1\n for (const fn of listeners) fn()\n}\n\nfunction detectLang(): Lang {\n const active = locale?.getLocale().active\n if (active === 'zh') return 'zh'\n const nav = (navigator.language || '').toLowerCase()\n if (nav.startsWith('es')) return 'es'\n if (active === 'en') return 'en'\n if (nav.startsWith('zh')) return 'zh'\n return 'zh'\n}\n\n/** \u63A5\u5165\u5E73\u53F0 locale \u670D\u52A1\uFF1B\u4ECE client \u5165\u53E3\u8C03\u7528\u4E00\u6B21\u3002 */\nexport function initI18n(service: LocaleService): void {\n if (locale === service) return\n locale = service\n lang = detectLang()\n service.subscribe(() => {\n const next = detectLang()\n if (next !== lang) {\n lang = next\n notify()\n }\n })\n}\n\nconst subscribe = (fn: () => void): (() => void) => {\n listeners.add(fn)\n return () => {\n listeners.delete(fn)\n }\n}\n\nconst getSnapshot = (): number => revision\n\n/** \u7FFB\u8BD1\uFF1B\u7F3A\u5931\u7684 key \u56DE\u9000\u5230\u4E2D\u6587\u3002 */\nexport function t(key: string): string {\n return DICTS[lang][key] ?? DICTS.zh[key] ?? key\n}\n\n/** React hook\uFF1A\u8BED\u8A00\u5207\u6362\u65F6\u89E6\u53D1\u91CD\u6E32\u67D3\uFF1B\u8FD4\u56DE\u7684 t() \u4E3A\u6A21\u5757\u7EA7\u7A33\u5B9A\u5F15\u7528\u3002 */\nexport function useT(): (key: string) => string {\n useSyncExternalStore(subscribe, getSnapshot)\n return t\n}\n", "/**\n * \u6D88\u606F\u5E73\u53F0\u9875\u9762\uFF1A\u8986\u76D6\u5728\u5BF9\u8BDD\u533A\u4E4B\u4E0A\u7684\u5168\u5C4F\u9875\u9762\u3002\u5DE6\u680F\u4E3A\u5E73\u53F0\u5217\u8868\uFF08\u56FE\u6807 + \u72B6\u6001\uFF09\uFF0C\n * \u53F3\u680F\u4E3A\u9009\u4E2D\u5E73\u53F0\u7684\u51ED\u636E\u8868\u5355\uFF08\u4FDD\u5B58 / \u6D4B\u8BD5\u8FDE\u63A5 / \u5220\u9664 / \u72B6\u6001\u8BE6\u60C5\uFF09\u3002\n * @module dsh-message-gateway/client/Page\n */\n\nimport { createElement, useCallback, useEffect, useState } from 'react'\nimport type { GatewayView, PlatformDef, PlatformStatus } from '../core/types.ts'\nimport type { GatewayApi } from './api.ts'\nimport { useT } from './i18n.ts'\nimport { InboxIcon, PlatformIcon } from './icons.tsx'\n\nconst STYLE = `\n.dsh-gw { --gw-fg:#24292f; --gw-muted:#6e7781; --gw-border:rgba(128,128,128,0.25);\n --gw-hover:rgba(0,0,0,0.06); --gw-bg:#ffffff; --gw-panel:#f6f8fa; --gw-accent:#1976d2;\n --gw-ok:#1a7f37; --gw-err:#cf222e; --gw-warn:#9a6700; position:fixed; inset:0; z-index:1200;\n background:rgba(0,0,0,0.45); display:flex; align-items:center; justify-content:center;\n color:var(--gw-fg); font-size:13px; font-family:-apple-system,BlinkMacSystemFont,\n \"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif; }\n[data-ds-dark-theme] .dsh-gw { --gw-fg:#d1d9e0; --gw-muted:#9198a1; --gw-border:rgba(255,255,255,0.14);\n --gw-hover:rgba(255,255,255,0.08); --gw-bg:#1f2328; --gw-panel:#161b22; --gw-accent:#58a6ff;\n --gw-ok:#3fb950; --gw-err:#f85149; --gw-warn:#d4a72c; }\n.dsh-gw * { box-sizing:border-box; }\n.dsh-gw-page { width:min(1000px, 94vw); height:min(680px, 88vh); background:var(--gw-bg);\n border:1px solid var(--gw-border); border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,0.35);\n display:flex; flex-direction:column; overflow:hidden; }\n.dsh-gw-head { display:flex; align-items:center; gap:8px; padding:14px 18px;\n border-bottom:1px solid var(--gw-border); font-weight:600; font-size:15px; }\n.dsh-gw-head .spacer { flex:1; }\n.dsh-gw-close { border:none; background:transparent; color:var(--gw-muted); cursor:pointer;\n width:30px; height:30px; border-radius:8px; display:flex; align-items:center;\n justify-content:center; padding:0; }\n.dsh-gw-close:hover { background:var(--gw-hover); color:var(--gw-fg); }\n.dsh-gw-body { flex:1; display:flex; min-height:0; }\n.dsh-gw-list { width:230px; flex:none; border-right:1px solid var(--gw-border);\n overflow-y:auto; padding:8px; }\n.dsh-gw-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px;\n cursor:pointer; }\n.dsh-gw-item:hover { background:var(--gw-hover); }\n.dsh-gw-item.active { background:var(--gw-hover); box-shadow:inset 0 0 0 1px var(--gw-border); }\n.dsh-gw-item .icon { font-size:18px; flex:none; }\n.dsh-gw-item .name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis;\n white-space:nowrap; }\n.dsh-gw-item .dot { flex:none; width:8px; height:8px; border-radius:50%; }\n.dsh-gw-item .dot.connected { background:var(--gw-ok); }\n.dsh-gw-item .dot.error { background:var(--gw-err); }\n.dsh-gw-item .dot.none { background:#8b949e; }\n.dsh-gw-item .dot.manual { background:var(--gw-warn); }\n.dsh-gw-item .st { font-size:10px; color:var(--gw-muted); flex:none; width:56px;\n text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.dsh-gw-detail { flex:1; min-width:0; overflow-y:auto; padding:18px 22px; }\n.dsh-gw-detail h3 { margin:0 0 4px; font-size:15px; display:flex; align-items:center; gap:8px; }\n.dsh-gw-detail .hint { color:var(--gw-muted); font-size:12px; line-height:1.6; margin:4px 0 14px; }\n.dsh-gw-status { display:inline-flex; align-items:center; gap:6px; padding:3px 10px;\n border-radius:999px; font-size:11px; margin-bottom:14px; }\n.dsh-gw-status.connected { background:rgba(26,127,55,0.12); color:var(--gw-ok); }\n.dsh-gw-status.error { background:rgba(207,34,46,0.12); color:var(--gw-err); }\n.dsh-gw-status.none { background:var(--gw-panel); color:var(--gw-muted); }\n.dsh-gw-status.manual { background:rgba(154,103,0,0.12); color:var(--gw-warn); }\n.dsh-gw-field { margin-bottom:12px; }\n.dsh-gw-field label { display:block; font-size:12px; color:var(--gw-muted); margin-bottom:4px; }\n.dsh-gw-input { width:100%; padding:8px 10px; font-size:13px; color:var(--gw-fg);\n background:var(--gw-bg); border:1px solid var(--gw-border); border-radius:8px; outline:none; }\n.dsh-gw-input:focus { border-color:var(--gw-accent); }\n.dsh-gw-input.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }\n.dsh-gw-actions { display:flex; gap:8px; margin-top:16px; align-items:center; }\n.dsh-gw-btn { border:1px solid var(--gw-border); background:transparent; color:var(--gw-fg);\n border-radius:8px; padding:7px 14px; font-size:13px; cursor:pointer; }\n.dsh-gw-btn:hover { background:var(--gw-hover); }\n.dsh-gw-btn.primary { background:var(--gw-accent); border-color:var(--gw-accent); color:#fff; }\n.dsh-gw-btn.danger { color:var(--gw-err); }\n.dsh-gw-btn:disabled { opacity:0.5; cursor:default; }\n.dsh-gw-msg { flex:1; font-size:12px; text-align:right; white-space:pre-wrap; word-break:break-all; }\n.dsh-gw-msg.ok { color:var(--gw-ok); }\n.dsh-gw-msg.err { color:var(--gw-err); }\n.dsh-gw-detail-empty { color:var(--gw-muted); padding:40px; text-align:center; }\n`\n\nlet styleInjected = false\nfunction ensureStyle(): void {\n if (styleInjected) return\n styleInjected = true\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-message-gateway'\n tag.textContent = STYLE\n document.head.appendChild(tag)\n}\n\n/** \u9875\u9762 props\u3002 */\nexport function GatewayPage(props: { api: GatewayApi; onClose: () => void }): React.ReactElement {\n const { api, onClose } = props\n const t = useT()\n const [view, setView] = useState<GatewayView | null>(null)\n const [selected, setSelected] = useState<string>('telegram')\n const [form, setForm] = useState<Record<string, string>>({})\n const [busy, setBusy] = useState(false)\n const [message, setMessage] = useState<{ text: string; kind: 'ok' | 'err' } | null>(null)\n const [testing, setTesting] = useState(false)\n const [testResult, setTestResult] = useState<{ ok: boolean; detail: string } | null>(null)\n\n const load = useCallback(async (): Promise<void> => {\n const result = await api.list()\n if (result.ok) {\n setView(result.value)\n // \u9884\u586B\u5F53\u524D\u9009\u4E2D\u5E73\u53F0\u7684\u5DF2\u5B58\u51ED\u636E\uFF08\u8868\u5355\u521D\u59CB\u4E3A\u7A7A\uFF0C\u5360\u4F4D\u663E\u793A\uFF09\u3002\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }, [api])\n\n useEffect(() => {\n void load()\n }, [load])\n\n // ESC \u5173\u95ED\u3002\n useEffect(() => {\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') onClose()\n }\n window.addEventListener('keydown', onKey)\n return () => window.removeEventListener('keydown', onKey)\n }, [onClose])\n\n ensureStyle()\n\n const statusOf = (id: string): PlatformStatus | undefined => view?.status[id]\n const defOf = (id: string): PlatformDef | undefined => view?.platforms.find((p) => p.id === id)\n\n const select = (id: string): void => {\n setSelected(id)\n setForm({})\n setMessage(null)\n setTestResult(null)\n }\n\n const save = async (): Promise<void> => {\n const def = defOf(selected)\n if (def === undefined) return\n if (def.fields.length > 0 && def.fields.every((f) => (form[f.key] ?? '').trim() === '')) {\n setMessage({ text: t('field.token.ph'), kind: 'err' })\n return\n }\n setBusy(true)\n setMessage(null)\n const result = await api.save(selected, form)\n setBusy(false)\n if (result.ok) {\n setView(result.value)\n setMessage({ text: t('gateway.saved'), kind: 'ok' })\n // \u4FDD\u5B58\u6210\u529F\u540E\u7ACB\u5373\u7528\u521A\u4FDD\u5B58\u7684\u51ED\u636E\u6D4B\u4E00\u6B21\u8FDE\u63A5\uFF0C\u72B6\u6001\u5373\u65F6\u5237\u65B0\u3002\n void runTest()\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }\n\n const runTest = async (): Promise<void> => {\n setTesting(true)\n setTestResult(null)\n // \u76F4\u63A5\u7528\u5F53\u524D\u8868\u5355\u503C\u6D4B\u8BD5\uFF08\u53EA\u6D4B\u4E0D\u5B58\uFF09\uFF1B\u4FDD\u5B58\u624D\u662F\u6301\u4E45\u5316\u3002\n const def = defOf(selected)\n const result = await api.test(selected, def !== undefined && def.fields.length > 0 ? form : undefined)\n setTesting(false)\n if (result.ok) {\n setTestResult(result.value)\n void load()\n } else {\n setTestResult({ ok: false, detail: result.error.message })\n }\n }\n\n const remove = async (): Promise<void> => {\n setBusy(true)\n setMessage(null)\n const result = await api.delete(selected)\n setBusy(false)\n if (result.ok) {\n setView(result.value)\n setForm({})\n setTestResult(null)\n setMessage({ text: t('gateway.deleted'), kind: 'ok' })\n } else {\n setMessage({ text: result.error.message, kind: 'err' })\n }\n }\n\n const selectedDef = defOf(selected)\n const selectedStatus = statusOf(selected)\n\n return (\n <div className=\"dsh-gw\" onClick={onClose}>\n <div className=\"dsh-gw-page\" onClick={(event) => event.stopPropagation()}>\n <div className=\"dsh-gw-head\">\n <span><InboxIcon size={16} /> {t('gateway.title')}</span>\n <span className=\"spacer\" />\n <button type=\"button\" className=\"dsh-gw-close\" title={t('gateway.close')} onClick={onClose}>\n <svg viewBox=\"0 0 16 16\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.6\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" />\n </svg>\n </button>\n </div>\n <div className=\"dsh-gw-body\">\n <div className=\"dsh-gw-list\">\n {view === null\n ? null\n : view.platforms.map((def) => {\n const st = view.status[def.id]\n const state = st?.state ?? 'none'\n return (\n <div key={def.id}\n className={`dsh-gw-item${def.id === selected ? ' active' : ''}`}\n onClick={() => select(def.id)}>\n <span className=\"icon\">{createElement(PlatformIcon, { platform: def.id, size: 18 })}</span>\n <span className=\"name\">{t(def.nameKey)}</span>\n <span className={`dot ${state}`} />\n <span className=\"st\">{t(`gateway.status.${state}`)}</span>\n </div>\n )\n })}\n </div>\n <div className=\"dsh-gw-detail\">\n {selectedDef === undefined ? (\n <div className=\"dsh-gw-detail-empty\">\u2026</div>\n ) : (\n <>\n <h3>{createElement(PlatformIcon, { platform: selectedDef.id, size: 20 })} {t(selectedDef.nameKey)}</h3>\n {selectedDef.hintKey !== undefined ? (\n <div className=\"hint\">{t(selectedDef.hintKey)}</div>\n ) : null}\n {selectedStatus !== undefined ? (\n <span className={`dsh-gw-status ${selectedStatus.state}`}>\n {t(`gateway.status.${selectedStatus.state}`)}\n {selectedStatus.state === 'connected' && selectedStatus.detail !== ''\n ? ` \u00B7 ${selectedStatus.detail}`\n : ''}\n {selectedStatus.state === 'error' && selectedStatus.detail !== ''\n ? ` \u00B7 ${selectedStatus.detail}`\n : ''}\n </span>\n ) : null}\n\n {selectedDef.fields.map((field) => (\n <div key={field.key} className=\"dsh-gw-field\">\n <label>{t(field.labelKey)}</label>\n <input\n className={`dsh-gw-input mono`}\n type={field.kind === 'secret' ? 'password' : field.kind === 'number' ? 'number' : 'text'}\n value={form[field.key] ?? ''}\n placeholder={field.placeholderKey !== undefined ? t(field.placeholderKey) : ''}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={(event) => setForm((prev) => ({ ...prev, [field.key]: event.target.value }))}\n />\n </div>\n ))}\n\n <div className=\"dsh-gw-actions\">\n {selectedDef.fields.length > 0 ? (\n <>\n <button type=\"button\" className=\"dsh-gw-btn primary\" disabled={busy}\n onClick={() => void save()}>{t('gateway.save')}</button>\n {selectedDef.testable ? (\n <button type=\"button\" className=\"dsh-gw-btn\" disabled={busy || testing}\n onClick={() => void runTest()}>\n {testing ? t('gateway.testing') : t('gateway.test')}\n </button>\n ) : null}\n {selectedStatus?.configured === true ? (\n <button type=\"button\" className=\"dsh-gw-btn danger\" disabled={busy}\n onClick={() => void remove()}>{t('gateway.delete')}</button>\n ) : null}\n </>\n ) : (\n <span className=\"hint\">{t(selectedDef.hintKey ?? '')}</span>\n )}\n {message !== null ? <span className={`dsh-gw-msg ${message.kind}`}>{message.text}</span> : null}\n </div>\n\n {testResult !== null ? (\n <div className=\"dsh-gw-field\" style={{ marginTop: 14 }}>\n <label>{t('gateway.testing.result')}</label>\n <div className={`dsh-gw-msg ${testResult.ok ? 'ok' : 'err'}`}\n style={{ textAlign: 'left' }}>{testResult.detail}</div>\n </div>\n ) : null}\n </>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n", "/**\n * \u7EBF\u6027 SVG \u56FE\u6807\u96C6\uFF08iconfont \u98CE\u683C\uFF0C24\u00D724 viewBox\uFF0Cstroke \u7EBF\u6761\uFF09\u3002\n * \u66FF\u4EE3\u5E73\u53F0 emoji \u4E0E\u6587\u672C\u56FE\u6807\uFF0C\u89C6\u89C9\u66F4\u7CBE\u7EC6\u7EDF\u4E00\u3002\n * @module dsh-message-gateway/client/icons\n */\n\nimport { createElement } from 'react'\n\n/** \u901A\u7528\u7EBF\u6027\u56FE\u6807\u9AA8\u67B6\u3002 */\nfunction Icon(props: {\n d: string\n size?: number\n strokeWidth?: number\n fill?: string\n extra?: string\n title?: string\n}): React.ReactElement {\n const { d, size = 18, strokeWidth = 1.6, fill = 'none', extra = '', title } = props\n return createElement(\n 'svg',\n {\n viewBox: '0 0 24 24',\n width: size,\n height: size,\n fill,\n stroke: 'currentColor',\n strokeWidth,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': title === undefined ? true : undefined,\n ...(extra !== '' ? { className: extra } : {}),\n },\n title !== undefined ? createElement('title', null, title) : null,\n createElement('path', { d }),\n )\n}\n\n/** \u6536\u4EF6\u7BB1\uFF08\u4FA7\u8FB9\u680F\u300C\u6D88\u606F\u5E73\u53F0\u300D\u5165\u53E3\uFF09\u3002 */\nexport const InboxIcon = (props: { size?: number; title?: string }): React.ReactElement =>\n Icon({ d: 'M22 12h-6l-2 3h-4l-2-3H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z', ...props })\n\n/** Telegram \u7EB8\u98DE\u673A\u3002 */\nexport const TelegramIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M21.5 4.5l-18 7 5 1.8M21.5 4.5L15 20l-3.5-6.7M8.5 13.3L21.5 4.5', ...props })\n\n/** Discord \u6E38\u620F\u624B\u67C4\u3002 */\nexport const DiscordIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M6 3l-3 4v11a1 1 0 0 0 1 1h3l1-2 2 1 2-1 2 1 2-1 1 2h3a1 1 0 0 0 1-1V7l-3-4H6zM9 12a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm6 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z', ...props })\n\n/** QQ \u804A\u5929\u6C14\u6CE1\u3002 */\nexport const QqIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5c-.9 0-1.8-.1-2.6-.4L5 21l1-3.5A8.5 8.5 0 1 1 21 11.5zM8.5 10.5h.01M15.5 10.5h.01M8.5 14c.7.8 2 1.3 3.5 1.3s2.8-.5 3.5-1.3', ...props })\n\n/** \u4F01\u4E1A\u5FAE\u4FE1\uFF08\u697C\u5B87 + \u6C14\u6CE1\uFF09\u3002 */\nexport const WecomIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M3 21h18M5 21V7l7-4 7 4v14M9 9h.01M9 13h.01M9 17h.01M15 9h.01M15 13h.01M15 17h.01M12 9v.01M12 13v.01M12 17v.01', ...props })\n\n/** \u667A\u80FD\u673A\u5668\u4EBA\u3002 */\nexport const BotIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M12 8V4M8 4h8M12 20c-4 0-6-2-6-5v-3c0-3 2-5 6-5s6 2 6 5v3c0 3-2 5-6 5zM9 13h.01M15 13h.01', ...props })\n\n/** \u5FAE\u4FE1\uFF08\u5BF9\u8BDD\u6C14\u6CE1 + \u5FAE\u4FE1\u7EFF\u70B9\uFF09\u3002 */\nexport const WechatIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M9 4a5 5 0 0 0 0 10 4.6 4.6 0 0 0 2-.5l2 .8-1-1.6a5 5 0 0 0 3-3.2A5 5 0 0 0 9 4zM17 11a5 5 0 0 0-4 2.1A5 5 0 0 1 9 11.6 5 5 0 0 1 14 8a5 5 0 0 1 3 3z', ...props })\n\n/** \u5FAE\u4FE1\u516C\u4F17\u53F7\uFF08\u62A5\u7EB8 + \u9891\u9053\uFF09\u3002 */\nexport const MpIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M4 5h16v14H4zM4 9h16M8 13h5M8 16h8', ...props })\n\n/** WhatsApp \u7535\u8BDD\u6C14\u6CE1\u3002 */\nexport const WhatsappIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M12 3a9 9 0 0 0-7.8 13.5L3 21l4.6-1.2A9 9 0 1 0 12 3zM9 8c.3 1.5 1.5 3 3 4 .5.3 1 .6 1.6.7.4.1.9-.2 1.1-.6l.3-.6c.2-.4.6-.3 1-.1l1 .5c.4.2.6.6.5.9-.1.8-.9 1.5-1.7 1.4-2.4-.2-4.6-1.4-6-3.1A6 6 0 0 1 8 9c0-.8.6-1.5 1.4-1.7.3-.1.6.1.7.4L9 8z', ...props })\n\n/** Email \u4FE1\u5C01\u3002 */\nexport const EmailIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm0 2l8 6 8-6', ...props })\n\n/** Webhook \u6302\u94A9\u3002 */\nexport const WebhookIcon = (props: { size?: number }): React.ReactElement =>\n Icon({ d: 'M18 8a3 3 0 0 1 3 3c0 1-.5 1.9-1.3 2.4M12 4l3 6M4 14l3-6M6 8a3 3 0 0 1 3 3c0 .8-.3 1.5-.8 2M4 14h8a2 2 0 0 1 2 2 2 2 0 0 1-2 2H4a2 2 0 0 1-2-2 2 2 0 0 1 2-2z', ...props })\n\n/** \u5E73\u53F0 id \u2192 \u7EBF\u6027\u56FE\u6807\u3002 */\nexport const PlatformIcon = (props: { platform: string; size?: number }): React.ReactElement => {\n const { platform, size } = props\n switch (platform) {\n case 'telegram': return createElement(TelegramIcon, { size })\n case 'discord': return createElement(DiscordIcon, { size })\n case 'qq': return createElement(QqIcon, { size })\n case 'wecom': return createElement(WecomIcon, { size })\n case 'wecom-aibot': return createElement(BotIcon, { size })\n case 'wechat': return createElement(WechatIcon, { size })\n case 'wechat-mp': return createElement(MpIcon, { size })\n case 'whatsapp': return createElement(WhatsappIcon, { size })\n case 'email': return createElement(EmailIcon, { size })\n case 'webhooks': return createElement(WebhookIcon, { size })\n default: return createElement(InboxIcon, { size })\n }\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAAA,gBAAqD;AACrD,oBAAsC;;;ACE/B,IAAM,aAAN,MAAiB;AAAA,EACtB,MAAc,KAAQ,MAAc,SAAwC;AAC1E,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM,MAAM,MAAM;AAAA,QAC3B,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,QAC9C,MAAM,KAAK,UAAU,WAAW,CAAC,CAAC;AAAA,MACpC,CAAC;AAAA,IACH,SAAS,OAAO;AACd,aAAO,EAAE,IAAI,OAAO,OAAO,EAAE,MA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