bnpanel 0.6.6 → 0.6.8

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/client.js CHANGED
@@ -43,9 +43,9 @@
43
43
  --bn-toast-bg:#34302c; --bn-toast-fg:#f6f3ec;
44
44
  }
45
45
  }
46
- .bn-root{position:relative;display:grid;grid-template-columns:minmax(0,208px) minmax(0,1fr);height:100%;min-height:520px;width:100%;max-width:100%;min-width:0;overflow:hidden;background:var(--bn-bg);color:var(--bn-ink);font:13px/1.55 var(--bn-font);-webkit-font-smoothing:antialiased}
46
+ .bn-root{position:relative;display:grid;grid-template-columns:minmax(0,208px) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;height:100%;min-height:520px;width:100%;max-width:100%;min-width:0;overflow:hidden;background:var(--bn-bg);color:var(--bn-ink);font:13px/1.55 var(--bn-font);-webkit-font-smoothing:antialiased}
47
47
  .bn-root *{box-sizing:border-box}
48
- .bn-rail{display:flex;flex-direction:column;gap:2px;min-height:0;overflow:auto;padding:16px 10px;border-right:1px solid var(--bn-line);background:var(--bn-surface-2)}
48
+ .bn-rail{grid-column:1;grid-row:1 / span 2;display:flex;flex-direction:column;gap:2px;min-height:0;overflow:auto;padding:16px 10px;border-right:1px solid var(--bn-line);background:var(--bn-surface-2)}
49
49
  .bn-logo{display:flex;align-items:center;gap:9px;padding:2px 8px 16px;font-weight:680;letter-spacing:-.01em}
50
50
  .bn-logo .dot{width:22px;height:22px;border-radius:7px;background:var(--bn-ink);box-shadow:inset 0 0 0 2.5px var(--bn-accent),0 2px 8px rgba(0,0,0,.18);overflow:hidden}
51
51
  .bn-logo .dot img{width:100%;height:100%;object-fit:cover;display:block}
@@ -92,9 +92,8 @@
92
92
  .bn-wx code{display:block;margin-top:2px;font-family:var(--bn-mono);font-size:14px;color:var(--bn-ink);letter-spacing:.01em}
93
93
  .bn-wx .bn-btn{height:30px;padding:0 12px;background:var(--bn-solid);color:var(--bn-on-solid);border-color:var(--bn-solid)}
94
94
  .bn-manual{display:flex;align-items:center;justify-content:center;width:100%;margin-top:14px;height:36px;text-decoration:none;box-sizing:border-box}
95
- .bn-main{overflow:auto;overflow-x:hidden;padding:22px 26px 40px;min-width:0;max-width:100%}
96
- .bn-main.has-note{padding-bottom:108px}
97
- .bn-foot-note{position:absolute;z-index:4;left:208px;bottom:16px;margin:0;padding-left:26px;max-width:min(460px,calc(100% - 208px - 86px));display:flex;flex-direction:column;gap:3px;color:var(--bn-faint);font-size:12px;line-height:1.65;pointer-events:none}
95
+ .bn-main{grid-column:2;grid-row:1;overflow:auto;overflow-x:hidden;padding:22px 26px 40px;min-width:0;max-width:100%}
96
+ .bn-foot-note{grid-column:2;grid-row:2;margin:0;padding:8px 86px 12px 26px;display:flex;flex-direction:column;gap:3px;color:var(--bn-faint);font-size:12px;line-height:1.65;pointer-events:none;background:var(--bn-bg)}
98
97
  .bn-cs{position:absolute;z-index:5;right:18px;bottom:16px;width:46px;height:46px;padding:0;border:0;border-radius:50%;display:grid;place-items:center;cursor:pointer;background:#111;color:#d4f07a;box-shadow:0 10px 24px rgba(0,0,0,.18),inset 0 0 0 2px #d4f07a}
99
98
  .bn-cs svg{animation:bn-cs-breathe 2.2s ease-in-out infinite}
100
99
  .bn-cs:hover{transform:translateY(-1px)}
@@ -206,10 +205,37 @@
206
205
  .bn-docs-tabs{display:flex;gap:6px;overflow:auto;padding:8px 14px;border-bottom:1px solid var(--bn-line);flex:none}
207
206
  .bn-docs-tabs button{border:1px solid var(--bn-line);background:transparent;color:var(--bn-ink);border-radius:99px;padding:4px 10px;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}
208
207
  .bn-docs-tabs button.on{background:#111;color:#d4f07a;border-color:#111}
208
+ .bn-docs-tabs button:disabled{opacity:.4;cursor:default}
209
209
  .bn-docs-frame{position:relative;flex:1;min-height:0;display:flex}
210
210
  .bn-docs iframe{flex:1;width:100%;min-height:0;border:0;background:#fff}
211
211
  .bn-docs-miss{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:28px;text-align:center;color:var(--bn-muted);background:var(--bn-surface)}
212
212
  .bn-docs-miss .bn-btn{text-decoration:none;background:#d4f07a;color:#111;border-color:#d4f07a;font-weight:700}
213
+ .bn-docs-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:28px;text-align:center;color:var(--bn-muted)}
214
+ .bn-docs-md{flex:1;min-height:0;overflow:auto;padding:16px 20px 40px;font-size:13px;line-height:1.75;color:var(--bn-ink)}
215
+ .bn-docs-tag{display:inline-block;margin-left:5px;padding:0 5px;border-radius:4px;background:#f0f7d4;color:#5c6b22;font-size:10px;font-style:normal;line-height:15px;vertical-align:middle}
216
+ .bn-docs-lock{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:40px 24px;text-align:center}
217
+ .bn-docs-lock b{font-size:15px}
218
+ .bn-docs-lock p{margin:0;max-width:360px;color:var(--bn-muted);font-size:12px;line-height:1.7}
219
+ .bn-docs-md h1{font-size:20px;line-height:1.35;margin:0 0 12px}
220
+ .bn-docs-md h2{font-size:16px;margin:22px 0 8px;padding-bottom:6px;border-bottom:1px solid var(--bn-line)}
221
+ .bn-docs-md h3{font-size:14px;margin:16px 0 6px}
222
+ .bn-docs-md h4{font-size:13px;margin:14px 0 6px}
223
+ .bn-docs-md p{margin:0 0 10px}
224
+ .bn-docs-md ul,.bn-docs-md ol{margin:0 0 12px;padding-left:22px}
225
+ .bn-docs-md li{margin:2px 0}
226
+ .bn-docs-md blockquote{margin:0 0 12px;padding:8px 12px;border-left:3px solid #d4f07a;background:rgba(0,0,0,.03);color:var(--bn-muted)}
227
+ .bn-docs-md code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:rgba(0,0,0,.06);padding:1px 5px;border-radius:4px}
228
+ .bn-docs-md pre{margin:0 0 12px;padding:10px 12px;background:#111;color:#e8f3c8;border-radius:8px;overflow:auto}
229
+ .bn-docs-md pre code{background:none;padding:0;color:inherit;font-size:12px;line-height:1.6}
230
+ .bn-docs-md hr{border:0;border-top:1px solid var(--bn-line);margin:18px 0}
231
+ .bn-docs-md a{color:#3e6b00;text-decoration:underline}
232
+ .bn-md-table{overflow:auto;margin:0 0 12px}
233
+ .bn-docs-md table{border-collapse:collapse;width:100%;font-size:12px}
234
+ .bn-docs-md th,.bn-docs-md td{border:1px solid var(--bn-line);padding:6px 8px;text-align:left;vertical-align:top}
235
+ .bn-docs-md th{background:rgba(0,0,0,.04);font-weight:600;white-space:nowrap}
236
+ .bn-docs-md strong{font-weight:700}
237
+ .bn-docs-md img{display:block;max-width:100%;height:auto;margin:6px 0 12px;border:1px solid var(--bn-line);border-radius:8px}
238
+ .bn-docs-md video{display:block;width:100%;max-width:760px;margin:6px 0 12px;border-radius:8px;background:#000}
213
239
  .bn-tutor-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}
214
240
  .bn-tutor-item{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--bn-line)}
215
241
  .bn-card{position:relative;min-width:0;max-width:100%;overflow:hidden;background:var(--bn-surface);border:1px solid var(--bn-line);border-radius:var(--bn-r);padding:16px;box-shadow:var(--bn-shadow);transition:box-shadow .16s,border-color .16s}
@@ -281,8 +307,93 @@
281
307
  .bn-lic .status .bn-btn{height:26px;padding:0 8px;font-size:12px}
282
308
  .bn-lic .bn-desc{min-height:0;margin-top:10px}
283
309
  .bn-activate{display:flex;gap:10px;align-items:center;margin-top:16px;flex-wrap:nowrap}
310
+ .bn-activate.batch{flex-wrap:wrap;align-items:flex-start}
311
+ .bn-activate textarea.bn-input{flex:1 1 280px;width:auto;min-width:220px;max-width:none;min-height:78px;height:auto;padding:8px 10px;resize:vertical;font-family:var(--bn-mono);font-size:12px;line-height:1.65}
312
+ .bn-activate .bn-activate-out{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;margin-top:2px;font-size:12px}
313
+ .bn-activate .bn-activate-out .row{display:flex;align-items:center;gap:8px;min-width:0}
314
+ .bn-upgrade{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:22px;border:1px solid var(--bn-line);border-radius:var(--bn-r-sm);background:radial-gradient(320px 140px at 100% 0%,var(--bn-accent-soft),transparent 70%),var(--bn-surface-2)}
315
+ .bn-upgrade h3{margin:0;font-size:15px}
316
+ .bn-upgrade p{margin:0;color:var(--bn-muted);font-size:12.5px;line-height:1.65;max-width:58ch}
317
+ .bn-diagnose-card{display:flex;flex-direction:column;gap:6px}
318
+ .bn-diagnose-card .bn-desc{margin:0}
319
+ /* 账号增长工作台:号脉、对标、选题与复诊共用本机会话和档案 */
320
+ .bn-growth-tabs{display:flex;width:fit-content;max-width:100%;margin-bottom:16px;overflow:auto}
321
+ .bn-growth-tabs button{white-space:nowrap}
322
+ .bn-growth-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
323
+ .bn-growth-form .bn-field{margin:0;min-width:0}
324
+ .bn-growth-form .full{grid-column:1 / -1}
325
+ .bn-growth-form textarea.bn-input{min-height:78px;resize:vertical;line-height:1.6}
326
+ .bn-growth-source{display:flex;align-items:center;gap:10px;margin-top:12px;padding:10px 12px;border:1px solid var(--bn-line);border-radius:10px;background:var(--bn-accent-soft);color:var(--bn-ink-2);font-size:12px}
327
+ .bn-growth-source span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
328
+ .bn-growth-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
329
+ .bn-growth-compare>div{min-width:0;padding:12px;border:1px solid var(--bn-line);border-radius:12px;background:var(--bn-surface-2)}
330
+ .bn-growth-compare b{display:block;margin-bottom:4px;font-size:12px}
331
+ .bn-growth-compare span{display:block;color:var(--bn-muted);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
332
+ @media (max-width:720px){.bn-growth-form,.bn-growth-compare{grid-template-columns:1fr}.bn-growth-form .full{grid-column:auto}}
333
+ .bn-diag-hero{position:relative;overflow:hidden;border-radius:var(--bn-r);padding:22px 24px;margin-bottom:16px;display:flex;gap:20px;align-items:flex-start;justify-content:space-between;background:radial-gradient(420px 180px at 100% 0%,rgba(212,240,122,.22),transparent 70%),linear-gradient(140deg,#101010 0%,#1d1d1a 55%,#2f3a17 100%);color:#f4f1ea}
334
+ .bn-diag-hero:after{content:'';position:absolute;right:-40px;bottom:-80px;width:240px;height:240px;border-radius:50%;background:radial-gradient(circle,rgba(212,240,122,.16),transparent 65%);pointer-events:none}
335
+ .bn-diag-kicker{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#d4f07a;font-weight:700}
336
+ .bn-diag-hero h2{margin:6px 0 0;font-size:20px;line-height:1.35;letter-spacing:-.02em;font-weight:700;max-width:30em}
337
+ .bn-diag-hero p{margin:7px 0 0;font-size:12.5px;line-height:1.65;color:rgba(244,241,234,.72);max-width:52em}
338
+ .bn-diag-values{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
339
+ .bn-diag-values span{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(212,240,122,.3);background:rgba(212,240,122,.1);color:#e8f7b8;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:600}
340
+ .bn-diag-values b{font-weight:800;color:#d4f07a}
341
+ .bn-diag-hero-side{flex:none;display:flex;flex-direction:column;gap:6px;align-items:flex-end;position:relative;z-index:1}
342
+ .bn-diag-hero-side .bn-chip{border-color:rgba(212,240,122,.4);color:#d4f07a;background:rgba(212,240,122,.12)}
343
+ .bn-diag-work{padding:20px 22px}
344
+ .bn-diag-block-head{display:flex;align-items:baseline;gap:10px;margin-bottom:12px;flex-wrap:wrap}
345
+ .bn-diag-block-head h2{margin:0;font-size:15px}
346
+ .bn-diag-block-head span{font-size:11.5px;color:var(--bn-faint)}
347
+ .bn-drop{border:1.5px dashed var(--bn-line-strong);border-radius:14px;padding:26px 18px;text-align:center;cursor:pointer;background:var(--bn-surface-2);transition:border-color .15s,background .15s,transform .15s}
348
+ .bn-drop:hover,.bn-drop.hot{border-color:var(--bn-accent-deep);background:var(--bn-accent-soft);transform:translateY(-1px)}
349
+ .bn-drop-ico{width:46px;height:46px;border-radius:13px;margin:0 auto 10px;display:grid;place-items:center;background:var(--bn-ink);color:var(--bn-accent);font-size:22px;line-height:1;box-shadow:inset 0 0 0 2px var(--bn-accent)}
350
+ .bn-drop b{display:block;font-size:13.5px}
351
+ .bn-drop small{display:block;margin-top:4px;font-size:11.5px;color:var(--bn-muted);line-height:1.55}
352
+ .bn-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px;margin-top:12px}
353
+ .bn-media{position:relative;border:1px solid var(--bn-line);border-radius:12px;overflow:hidden;background:var(--bn-surface)}
354
+ .bn-media img,.bn-media video{display:block;width:100%;height:82px;object-fit:cover;background:var(--bn-line)}
355
+ .bn-media-ph{display:grid;place-items:center;height:82px;background:linear-gradient(135deg,var(--bn-line),var(--bn-surface-2));color:var(--bn-muted);font-size:11.5px}
356
+ .bn-media-info{padding:7px 9px;display:flex;align-items:center;gap:6px}
357
+ .bn-media-name{min-width:0;flex:1;font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
358
+ .bn-media-size{font-size:10.5px;color:var(--bn-faint);flex:none}
359
+ .bn-media-x{position:absolute;top:6px;right:6px;width:22px;height:22px;border:0;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;font-size:13px;line-height:1;cursor:pointer;display:grid;place-items:center}
360
+ .bn-media-x:hover{background:var(--bn-bad)}
361
+ .bn-diag-label{margin:14px 0 6px;font-size:11.5px;color:var(--bn-muted);font-weight:600}
362
+ .bn-diag-text{width:100%;height:auto;min-height:84px;resize:vertical;font-family:var(--bn-font);line-height:1.65}
363
+ .bn-diag-cta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--bn-line)}
364
+ .bn-diag-cta .bn-btn.primary{height:38px;padding:0 20px;border-radius:10px;font-size:13px;font-weight:650}
365
+ .bn-diag-cta small{font-size:11px;color:var(--bn-faint);line-height:1.5}
366
+ .bn-diag-status{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 9px;font-size:11px;background:var(--bn-surface-2);border:1px solid var(--bn-line);color:var(--bn-muted)}
367
+ .bn-diag-status:before{content:'';width:6px;height:6px;border-radius:50%;background:var(--bn-faint)}
368
+ .bn-diag-status.live{color:var(--bn-warn);border-color:var(--bn-warn);background:var(--bn-warn-soft)}
369
+ .bn-diag-status.live:before{background:var(--bn-warn);animation:bn-pulse 1.2s infinite}
370
+ .bn-diag-status.ok{color:var(--bn-ok);border-color:var(--bn-ok);background:var(--bn-ok-soft)}
371
+ .bn-diag-status.ok:before{background:var(--bn-ok)}
372
+ @keyframes bn-pulse{0%,100%{opacity:1}50%{opacity:.3}}
373
+ .bn-archive{display:grid;grid-template-columns:repeat(auto-fill,minmax(236px,1fr));gap:10px}
374
+ .bn-archive-item{position:relative;border:1px solid var(--bn-line);border-radius:12px;padding:12px 12px 10px;background:var(--bn-surface);cursor:pointer;transition:box-shadow .15s,border-color .15s,transform .1s}
375
+ .bn-archive-item:hover{box-shadow:var(--bn-shadow);border-color:var(--bn-line-strong);transform:translateY(-1px)}
376
+ .bn-archive-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
377
+ .bn-archive-kind{font-size:10.5px;color:var(--bn-faint);letter-spacing:.04em}
378
+ .bn-archive-title{margin-top:6px;font-size:13px;font-weight:650;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
379
+ .bn-archive-meta{margin-top:5px;font-size:11px;color:var(--bn-muted);display:flex;gap:6px;align-items:center;min-width:0}
380
+ .bn-archive-del{position:absolute;right:8px;bottom:8px;opacity:0;transition:opacity .15s}
381
+ .bn-archive-item:hover .bn-archive-del{opacity:1}
382
+ .bn-empty{padding:26px 18px;text-align:center;border:1px dashed var(--bn-line-strong);border-radius:12px;color:var(--bn-faint);font-size:12px;line-height:1.7;white-space:pre-line}
383
+ .bn-diag-upsell{display:flex;gap:24px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:24px;border-radius:var(--bn-r);border:1px solid var(--bn-line);background:radial-gradient(320px 160px at 0% 0%,var(--bn-accent-soft),transparent 70%),var(--bn-surface);box-shadow:var(--bn-shadow)}
384
+ .bn-diag-upsell h2{margin:0;font-size:18px;letter-spacing:-.01em}
385
+ .bn-diag-upsell p{margin:6px 0 0;font-size:12.5px;color:var(--bn-muted);line-height:1.65;max-width:46em}
386
+ .bn-diag-upsell ul{margin:12px 0 0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:8px}
387
+ .bn-diag-upsell li{font-size:11.5px;color:var(--bn-ink-2);background:var(--bn-surface-2);border:1px solid var(--bn-line);border-radius:999px;padding:4px 10px}
388
+ .bn-diag-upsell li:before{content:'✓';color:var(--bn-ok);margin-right:5px;font-weight:700}
389
+ @media (max-width:720px){
390
+ .bn-diag-hero{flex-direction:column;gap:12px;padding:18px}
391
+ .bn-diag-hero h2{font-size:18px}
392
+ .bn-diag-hero-side{align-items:flex-start}
393
+ .bn-diag-work{padding:16px}
394
+ }
284
395
  .bn-activate .bn-dd{flex:0 1 280px;width:280px;min-width:180px;max-width:320px;height:36px}
285
- .bn-activate .bn-input{flex:1 1 220px;width:auto;min-width:160px;max-width:none;height:36px}
396
+ .bn-activate .bn-input:not(textarea){flex:1 1 220px;width:auto;min-width:160px;max-width:none;height:36px}
286
397
  .bn-activate .bn-dd-trigger,.bn-activate .bn-btn{height:36px;max-height:36px;overflow:hidden}
287
398
  @media (max-width:720px){
288
399
  .bn-activate{flex-wrap:wrap}
@@ -345,6 +456,7 @@
345
456
  key: 'M21 2l-2 2m-7.6 7.6a5 5 0 11-7 7 5 5 0 017-7zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3-3.5 3.5z',
346
457
  chat: 'M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z',
347
458
  book: 'M6 3h9l5 5v13H6zM15 3v5h5M9 13h6M9 17h6',
459
+ lock: 'M7 10V7a5 5 0 0110 0v3M5 10h14v10H5z',
348
460
  };
349
461
  return { tag: 'svg', props: { width: s, height: s, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.7, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true }, children: [{ tag: 'path', props: { d: paths[name] || paths.grid }, children: [] }] };
350
462
  }
@@ -360,6 +472,16 @@
360
472
  }
361
473
  }
362
474
 
475
+ const MANUAL_TABS = [
476
+ { key: 'start', label: '安装/激活/升级' },
477
+ { key: 'biutalk', label: 'BiuTalk' },
478
+ { key: 'biureel', label: 'BiuReel' },
479
+ { key: 'biuremo', label: 'BiuRemo' },
480
+ { key: 'biuart', label: 'BiuArt' },
481
+ { key: 'biuvibe', label: 'BiuVibe' },
482
+ { key: 'diagnose', label: '号脉' },
483
+ ];
484
+
363
485
  function docOpenLabel(url) {
364
486
  try {
365
487
  const host = new URL(String(url || '')).hostname;
@@ -389,6 +511,7 @@
389
511
  if (!res.ok) {
390
512
  const err = new Error((data && data.error) || res.statusText);
391
513
  if (data && data.code) err.code = data.code;
514
+ if (data && data.promptText) err.promptText = data.promptText;
392
515
  throw err;
393
516
  }
394
517
  return data;
@@ -645,8 +768,52 @@
645
768
  const confirmLock = useRef(false);
646
769
  const [keyInput, setKeyInput] = useState('');
647
770
  const [productInput, setProductInput] = useState('biutalk');
771
+ const [activateResult, setActivateResult] = useState(null);
648
772
  const [lookupEmail, setLookupEmail] = useState('');
649
773
  const [lookupResult, setLookupResult] = useState(null);
774
+ const [diagText, setDiagText] = useState('');
775
+ const [diagSnap, setDiagSnap] = useState(null);
776
+ const [diagMedia, setDiagMedia] = useState([]);
777
+ const [diagUploading, setDiagUploading] = useState(false);
778
+ const [diagHot, setDiagHot] = useState(false);
779
+ const [diagAnalysis, setDiagAnalysis] = useState('');
780
+ const [diagSession, setDiagSession] = useState('');
781
+ const [diagProject, setDiagProject] = useState('');
782
+ const [diagPrompt, setDiagPrompt] = useState('');
783
+ const [diagBusy, setDiagBusy] = useState('');
784
+ const [diagErr, setDiagErr] = useState('');
785
+ const [diagReports, setDiagReports] = useState([]);
786
+ const diagFileRef = useRef(null);
787
+ const researchFileRef = useRef(null);
788
+ const [diagView, setDiagView] = useState('diagnose');
789
+ const [growth, setGrowth] = useState(() => ({
790
+ research: {
791
+ input: { accounts: '', links: '', positioning: '', notes: '' },
792
+ media: [], reports: [], analysis: '', sessionId: '', projectPath: '', promptText: '', recordId: '',
793
+ busy: '', error: '', uploading: false, hot: false,
794
+ },
795
+ planner: {
796
+ input: {
797
+ diagnosisId: null, positioning: '', frequency: '3', notes: '',
798
+ startDate: new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString().slice(0, 10),
799
+ },
800
+ media: [], reports: [], analysis: '', sessionId: '', projectPath: '', promptText: '', recordId: '',
801
+ busy: '', error: '', uploading: false, hot: false,
802
+ },
803
+ followup: {
804
+ input: { baselineId: null, currentId: null, notes: '' },
805
+ media: [], reports: [], analysis: '', sessionId: '', projectPath: '', promptText: '', recordId: '',
806
+ busy: '', error: '', uploading: false, hot: false,
807
+ },
808
+ }));
809
+ const growthPatch = (kind, patch) => setGrowth((current) => ({
810
+ ...current,
811
+ [kind]: { ...current[kind], ...(typeof patch === 'function' ? patch(current[kind]) : patch) },
812
+ }));
813
+ const growthInput = (kind, key, value) => setGrowth((current) => ({
814
+ ...current,
815
+ [kind]: { ...current[kind], input: { ...current[kind].input, [key]: value } },
816
+ }));
650
817
  const [studioAgentId, setStudioAgentId] = useState(null);
651
818
  const [pendingPerm, setPendingPerm] = useState(null);
652
819
  const [contactOpen, setContactOpen] = useState(false);
@@ -687,6 +854,100 @@
687
854
  return () => clearInterval(timer);
688
855
  }, [campaignCount]);
689
856
  useEffect(() => { if (!toast) return undefined; const t = setTimeout(() => setToast(null), toast.bad ? 12000 : 3200); return () => clearTimeout(t); }, [toast]);
857
+ useEffect(() => {
858
+ if (tab !== 'diagnose') return undefined;
859
+ let alive = true;
860
+ api('/diagnose/reports')
861
+ .then((data) => {
862
+ if (!alive) return;
863
+ const rows = Array.isArray(data.reports) ? data.reports : [];
864
+ setDiagReports(rows);
865
+ })
866
+ .catch(() => { /* 存档读不到不影响抓取 */ });
867
+ return () => { alive = false; };
868
+ }, [tab]);
869
+ useEffect(() => {
870
+ const completed = diagReports.filter((row) => String(row.analysis || '').trim());
871
+ const valid = (id) => completed.some((row) => row.id === id);
872
+ setGrowth((current) => {
873
+ const plannerId = current.planner.input.diagnosisId;
874
+ const baselineId = current.followup.input.baselineId;
875
+ const currentId = current.followup.input.currentId;
876
+ const nextPlanner = plannerId === null ? (completed[0]?.id || null) : (valid(plannerId) ? plannerId : '');
877
+ const nextBaseline = baselineId === null ? (completed[1]?.id || null) : (valid(baselineId) ? baselineId : '');
878
+ const nextCurrent = currentId === null ? (completed[0]?.id || null) : (valid(currentId) ? currentId : '');
879
+ if (nextPlanner === plannerId && nextBaseline === baselineId && nextCurrent === currentId) return current;
880
+ return {
881
+ ...current,
882
+ planner: { ...current.planner, input: { ...current.planner.input, diagnosisId: nextPlanner } },
883
+ followup: {
884
+ ...current.followup,
885
+ input: { ...current.followup.input, baselineId: nextBaseline, currentId: nextCurrent },
886
+ },
887
+ };
888
+ });
889
+ }, [diagReports]);
890
+ useEffect(() => {
891
+ if (tab !== 'diagnose' || diagView === 'diagnose') return undefined;
892
+ const kind = diagView;
893
+ let alive = true;
894
+ api('/growth/reports?kind=' + encodeURIComponent(kind))
895
+ .then((data) => {
896
+ if (alive) growthPatch(kind, { reports: Array.isArray(data.reports) ? data.reports : [] });
897
+ })
898
+ .catch((error) => { if (alive) growthPatch(kind, { error: error.message || '读取本地档案失败' }); });
899
+ return () => { alive = false; };
900
+ }, [tab, diagView]);
901
+ // 分析回填:模型把结论写到会话目录 report.md,面板按 sessionId 取回。
902
+ useEffect(() => {
903
+ if (tab !== 'diagnose' || !diagSession || diagAnalysis) return undefined;
904
+ let alive = true;
905
+ const tick = async () => {
906
+ try {
907
+ const data = await api('/diagnose/session-report?sessionId=' + encodeURIComponent(diagSession));
908
+ if (!alive || !data.report || !data.report.analysis) return;
909
+ setDiagAnalysis(String(data.report.analysis));
910
+ setDiagReports((rows) => rows.map((row) => (row.id === data.report.id ? data.report : row)));
911
+ setToast({ text: '分析已回填到面板' });
912
+ } catch {
913
+ /* 还没写完,下一轮再取 */
914
+ }
915
+ };
916
+ const timer = setInterval(tick, 5000);
917
+ tick();
918
+ return () => { alive = false; clearInterval(timer); };
919
+ }, [tab, diagSession, diagAnalysis]);
920
+ useEffect(() => {
921
+ if (tab !== 'diagnose' || diagView === 'diagnose') return undefined;
922
+ const kind = diagView;
923
+ const current = growth[kind];
924
+ if (!current.sessionId || current.analysis) return undefined;
925
+ let alive = true;
926
+ const tick = async () => {
927
+ try {
928
+ const data = await api('/growth/session-report?sessionId=' + encodeURIComponent(current.sessionId));
929
+ if (!alive || !data.report || !String(data.report.analysis || '').trim()) return;
930
+ setGrowth((all) => {
931
+ const item = all[kind];
932
+ return {
933
+ ...all,
934
+ [kind]: {
935
+ ...item,
936
+ analysis: String(data.report.analysis || ''),
937
+ recordId: String(data.report.id || item.recordId || ''),
938
+ reports: [data.report, ...item.reports.filter((row) => row.id !== data.report.id)].slice(0, 60),
939
+ },
940
+ };
941
+ });
942
+ setToast({ text: '结果已回填到面板' });
943
+ } catch {
944
+ /* 模型尚未写完,下一轮继续读取本机 report.md */
945
+ }
946
+ };
947
+ const timer = setInterval(tick, 5000);
948
+ tick();
949
+ return () => { alive = false; clearInterval(timer); };
950
+ }, [tab, diagView, growth[diagView]?.sessionId, growth[diagView]?.analysis]);
690
951
  useEffect(() => {
691
952
  if (!contactOpen) return;
692
953
  const onKey = (ev) => { if (ev.key === 'Escape') setContactOpen(false); };
@@ -831,6 +1092,377 @@
831
1092
  throw new Error('任务超时,请到「任务」查看');
832
1093
  };
833
1094
 
1095
+ /** 一行一个:优先按「产品 KEY」拆;只有 KEY 时用下拉里选的产品。 */
1096
+ const parseKeys = (text) => String(text || '')
1097
+ .split(/\r?\n/)
1098
+ .map((line) => line.trim())
1099
+ .filter(Boolean)
1100
+ .map((line) => {
1101
+ const pair = line.match(/^([A-Za-z][A-Za-z0-9._-]*)\s+(\S+)$/);
1102
+ if (pair) return { line, product: pair[1].toLowerCase(), key: pair[2].toUpperCase() };
1103
+ return { line, product: productInput, key: line.toUpperCase() };
1104
+ });
1105
+
1106
+ const activateKeys = () => act(async () => {
1107
+ const rows = parseKeys(keyInput);
1108
+ if (!rows.length) throw new Error('请先粘贴激活码');
1109
+ const ok = [];
1110
+ const failed = [];
1111
+ for (const row of rows) {
1112
+ try {
1113
+ await api('/activate', { method: 'POST', body: { key: row.key, product: row.product } });
1114
+ ok.push(row.product);
1115
+ } catch (err) {
1116
+ failed.push({ ...row, error: err.message });
1117
+ }
1118
+ }
1119
+ setActivateResult({ ok, failed });
1120
+ setKeyInput(failed.map((row) => row.line).join('\n'));
1121
+ if (!failed.length) return ok.length > 1 ? '已激活 ' + ok.length + ' 个产品' : '已激活 ' + ok[0];
1122
+ if (!ok.length) throw new Error(failed[0].error);
1123
+ return '成功 ' + ok.length + ' 个,失败 ' + failed.length + ' 个(失败行已保留)';
1124
+ });
1125
+
1126
+ const uploadDiagFiles = async (source, target = 'diagnose') => {
1127
+ const input = source && source.target ? source.target : null;
1128
+ const files = Array.from((input ? input.files : source) || []);
1129
+ if (input) input.value = '';
1130
+ if (!files.length) return;
1131
+ const setUploading = (value) => target === 'research' ? growthPatch('research', { uploading: value }) : setDiagUploading(value);
1132
+ const setUploadError = (value) => target === 'research' ? growthPatch('research', { error: value }) : setDiagErr(value);
1133
+ setUploading(true);
1134
+ setUploadError('');
1135
+ const added = [];
1136
+ for (const file of files) {
1137
+ const video = file.type.indexOf('video/') === 0 || /\.(mp4|mov|m4v|webm|avi|mkv)$/i.test(file.name);
1138
+ const image = file.type.indexOf('image/') === 0 || /\.(jpe?g|png|webp|gif|bmp|heic)$/i.test(file.name);
1139
+ if (!video && !image) {
1140
+ setUploadError('只支持图片或视频:' + file.name);
1141
+ continue;
1142
+ }
1143
+ if (file.size > 300 * 1024 * 1024) {
1144
+ setUploadError(file.name + ' 超过 300MB');
1145
+ continue;
1146
+ }
1147
+ try {
1148
+ const res = await fetch(BASE + '/diagnose/upload?name=' + encodeURIComponent(file.name), {
1149
+ method: 'POST',
1150
+ headers: { 'content-type': file.type || 'application/octet-stream' },
1151
+ body: file,
1152
+ });
1153
+ const data = await res.json().catch(() => ({}));
1154
+ if (!res.ok) throw new Error(data.error || '上传失败');
1155
+ added.push({ ...data.media, previewUrl: image ? URL.createObjectURL(file) : '' });
1156
+ } catch (err) {
1157
+ setUploadError(err.message || ('上传失败:' + file.name));
1158
+ }
1159
+ }
1160
+ if (added.length) {
1161
+ if (target === 'research') {
1162
+ growthPatch('research', (current) => ({ media: [...current.media, ...added].slice(0, 12) }));
1163
+ } else {
1164
+ setDiagMedia((rows) => [...rows, ...added].slice(0, 12));
1165
+ setDiagSnap((prev) => prev || {
1166
+ title: added[0].name,
1167
+ kind: 'upload',
1168
+ media: added.map((item) => item.name),
1169
+ });
1170
+ }
1171
+ }
1172
+ setUploading(false);
1173
+ };
1174
+
1175
+ const removeDiagMedia = (id) => setDiagMedia((rows) => rows.filter((row) => row.id !== id));
1176
+
1177
+ const openDiagSession = () => {
1178
+ if (!diagSession) return;
1179
+ if (!revealCreationSession) {
1180
+ setToast({ text: '请到 DSH 会话列表里找「账号体检」', bad: true });
1181
+ return;
1182
+ }
1183
+ try {
1184
+ revealCreationSession(diagSession);
1185
+ } catch {
1186
+ setToast({ text: '暂时切不过去,请到会话列表里找', bad: true });
1187
+ }
1188
+ };
1189
+
1190
+ const runDiagSession = async () => {
1191
+ if (!diagSnap && !diagMedia.length) {
1192
+ setDiagErr('请先上传后台截图或视频');
1193
+ return;
1194
+ }
1195
+ setDiagBusy('session');
1196
+ setDiagErr('');
1197
+ try {
1198
+ const data = await api('/diagnose/session', {
1199
+ method: 'POST',
1200
+ body: {
1201
+ snapshot: diagSnap || undefined,
1202
+ media: diagMedia.map(({ id, name, kind, size }) => ({ id, name, kind, size })),
1203
+ },
1204
+ });
1205
+ const snapshot = diagSnap || {
1206
+ title: (diagMedia[0] && diagMedia[0].name) || '未命名体检',
1207
+ kind: 'upload',
1208
+ media: diagMedia.map((item) => item.name),
1209
+ };
1210
+ if (!diagSnap) setDiagSnap(snapshot);
1211
+ setDiagSession(String(data.sessionId || ''));
1212
+ setDiagProject(String(data.projectPath || ''));
1213
+ setDiagPrompt(String(data.promptText || ''));
1214
+ // 先存档再切会话:切走后面板可能重挂载,快照和 sessionId 不能只留在内存里。
1215
+ let archived = false;
1216
+ try {
1217
+ const saved = await api('/diagnose/reports', {
1218
+ method: 'POST',
1219
+ body: {
1220
+ snapshot,
1221
+ analysis: diagAnalysis,
1222
+ sessionId: data.sessionId,
1223
+ projectPath: data.projectPath,
1224
+ media: data.media || diagMedia,
1225
+ },
1226
+ });
1227
+ if (saved.report) {
1228
+ setDiagReports((rows) => [saved.report, ...rows].slice(0, 50));
1229
+ archived = true;
1230
+ }
1231
+ } catch {
1232
+ /* 存档失败不影响分析会话语义 */
1233
+ }
1234
+ // 旧分析已入档,清空以允许新一轮 report.md 回填。
1235
+ if (archived) setDiagAnalysis('');
1236
+ if (data.sessionId) {
1237
+ try {
1238
+ if (revealCreationSession) revealCreationSession(data.sessionId);
1239
+ } catch {
1240
+ /* 会话已建好,切不过去也能从列表进入 */
1241
+ }
1242
+ }
1243
+ setToast({ text: '已开分析会话;结果写成 report.md 后会自动回填,也可以手动粘贴' });
1244
+ } catch (err) {
1245
+ if (err.promptText) setDiagPrompt(String(err.promptText));
1246
+ setDiagErr(err.message || '开不了 DSH 会话');
1247
+ } finally {
1248
+ setDiagBusy('');
1249
+ }
1250
+ };
1251
+
1252
+ const saveDiagnose = async () => {
1253
+ if (!diagSnap && !diagMedia.length) return;
1254
+ try {
1255
+ const data = await api('/diagnose/reports', {
1256
+ method: 'POST',
1257
+ body: {
1258
+ snapshot: diagSnap || { title: (diagMedia[0] && diagMedia[0].name) || '未命名体检', kind: 'upload' },
1259
+ analysis: diagAnalysis,
1260
+ sessionId: diagSession,
1261
+ projectPath: diagProject,
1262
+ media: diagMedia,
1263
+ },
1264
+ });
1265
+ if (data.report) setDiagReports((rows) => [data.report, ...rows].slice(0, 50));
1266
+ setToast({ text: '报告已保存到本机' });
1267
+ } catch (err) {
1268
+ setToast({ text: err.message || '保存失败', bad: true });
1269
+ }
1270
+ };
1271
+
1272
+ const openDiagReport = (report) => {
1273
+ if (!report || !report.snapshot) return;
1274
+ setDiagSnap(report.snapshot);
1275
+ setDiagMedia((Array.isArray(report.media) ? report.media : []).map((item) => ({
1276
+ ...item,
1277
+ previewUrl: item.kind === 'image' ? BASE + '/diagnose/media/' + item.id : '',
1278
+ })));
1279
+ setDiagAnalysis(String(report.analysis || ''));
1280
+ setDiagSession(String(report.sessionId || ''));
1281
+ setDiagProject(String(report.projectPath || ''));
1282
+ setDiagPrompt('');
1283
+ setDiagErr('');
1284
+ setDiagText('');
1285
+ };
1286
+
1287
+ const removeDiagReport = (report) => setConfirm({
1288
+ title: '删除这份诊断?',
1289
+ hint: report.title || '已保存的诊断报告',
1290
+ confirmLabel: '删除',
1291
+ run: () => act(async () => {
1292
+ await api('/diagnose/reports/delete', { method: 'POST', body: { id: report.id } });
1293
+ setDiagReports((rows) => rows.filter((row) => row.id !== report.id));
1294
+ }, '已删除'),
1295
+ });
1296
+
1297
+ const growthLabels = { research: '对标调研', planner: '选题规划', followup: '复诊对比' };
1298
+ const growthLinks = (kind, input) => kind === 'planner'
1299
+ ? { diagnosisId: input.diagnosisId || '' }
1300
+ : kind === 'followup'
1301
+ ? { baselineId: input.baselineId || '', currentId: input.currentId || '' }
1302
+ : {};
1303
+
1304
+ const runGrowthSession = async (kind) => {
1305
+ const current = growth[kind];
1306
+ const input = current.input;
1307
+ let validation = '';
1308
+ if (kind === 'research' && !String(input.accounts || '').trim()) validation = '请先填写至少一个对标账号名';
1309
+ if (kind === 'planner' && !input.diagnosisId && !String(input.positioning || '').trim()) validation = '请选择号脉报告,或填写账号定位';
1310
+ if (kind === 'followup' && (!input.baselineId || !input.currentId)) validation = '请选择基线号脉和本次号脉';
1311
+ if (kind === 'followup' && input.baselineId && input.baselineId === input.currentId) validation = '复诊需要选择两份不同的号脉报告';
1312
+ if (validation) {
1313
+ growthPatch(kind, { error: validation });
1314
+ return;
1315
+ }
1316
+ growthPatch(kind, { busy: 'session', error: '' });
1317
+ try {
1318
+ const data = await api('/growth/session', {
1319
+ method: 'POST',
1320
+ body: {
1321
+ kind,
1322
+ input,
1323
+ media: kind === 'research' ? current.media.map(({ id, name, kind: mediaKind, size }) => ({ id, name, kind: mediaKind, size })) : [],
1324
+ },
1325
+ });
1326
+ setGrowth((all) => {
1327
+ const item = all[kind];
1328
+ const record = data.record || null;
1329
+ return {
1330
+ ...all,
1331
+ [kind]: {
1332
+ ...item,
1333
+ sessionId: String(data.sessionId || ''),
1334
+ projectPath: String(data.projectPath || ''),
1335
+ promptText: String(data.promptText || ''),
1336
+ recordId: String(record?.id || ''),
1337
+ analysis: '',
1338
+ reports: record ? [record, ...item.reports.filter((row) => row.id !== record.id)].slice(0, 60) : item.reports,
1339
+ },
1340
+ };
1341
+ });
1342
+ if (data.sessionId && revealCreationSession) {
1343
+ try { revealCreationSession(data.sessionId); } catch { /* 可从 DSH 会话列表进入 */ }
1344
+ }
1345
+ setToast({ text: '已开' + growthLabels[kind] + '会话;report.md 写好后会自动回填' });
1346
+ } catch (error) {
1347
+ growthPatch(kind, {
1348
+ error: error.message || '开不了 DSH 会话',
1349
+ promptText: String(error.promptText || current.promptText || ''),
1350
+ });
1351
+ } finally {
1352
+ growthPatch(kind, { busy: '' });
1353
+ }
1354
+ };
1355
+
1356
+ const saveGrowth = async (kind) => {
1357
+ const current = growth[kind];
1358
+ if (!String(current.analysis || '').trim()) return;
1359
+ try {
1360
+ const data = await api('/growth/reports', {
1361
+ method: 'POST',
1362
+ body: {
1363
+ kind,
1364
+ id: current.recordId || undefined,
1365
+ input: current.input,
1366
+ analysis: current.analysis,
1367
+ sessionId: current.sessionId,
1368
+ projectPath: current.projectPath,
1369
+ media: current.media.map(({ id, name, kind: mediaKind, size }) => ({ id, name, kind: mediaKind, size })),
1370
+ links: growthLinks(kind, current.input),
1371
+ },
1372
+ });
1373
+ if (data.report) {
1374
+ setGrowth((all) => {
1375
+ const item = all[kind];
1376
+ return {
1377
+ ...all,
1378
+ [kind]: {
1379
+ ...item,
1380
+ recordId: String(data.report.id || ''),
1381
+ reports: [data.report, ...item.reports.filter((row) => row.id !== data.report.id)].slice(0, 60),
1382
+ },
1383
+ };
1384
+ });
1385
+ }
1386
+ setToast({ text: growthLabels[kind] + '已保存到本机' });
1387
+ } catch (error) {
1388
+ growthPatch(kind, { error: error.message || '保存失败' });
1389
+ }
1390
+ };
1391
+
1392
+ const openGrowthRecord = (kind, report) => {
1393
+ if (!report) return;
1394
+ growthPatch(kind, (current) => ({
1395
+ input: { ...current.input, ...(report.input || {}) },
1396
+ analysis: String(report.analysis || ''),
1397
+ sessionId: String(report.sessionId || ''),
1398
+ projectPath: String(report.projectPath || ''),
1399
+ recordId: String(report.id || ''),
1400
+ promptText: '',
1401
+ error: '',
1402
+ media: (Array.isArray(report.media) ? report.media : []).map((item) => ({
1403
+ ...item,
1404
+ previewUrl: item.kind === 'image' ? BASE + '/diagnose/media/' + item.id : '',
1405
+ })),
1406
+ }));
1407
+ };
1408
+
1409
+ const removeGrowthRecord = (kind, report) => setConfirm({
1410
+ title: '删除这份' + growthLabels[kind] + '?',
1411
+ hint: report.title || '已保存的本机报告',
1412
+ confirmLabel: '删除',
1413
+ run: () => act(async () => {
1414
+ await api('/growth/reports/delete', { method: 'POST', body: { kind, id: report.id } });
1415
+ setGrowth((all) => {
1416
+ const item = all[kind];
1417
+ const opened = item.recordId === report.id;
1418
+ return {
1419
+ ...all,
1420
+ [kind]: {
1421
+ ...item,
1422
+ reports: item.reports.filter((row) => row.id !== report.id),
1423
+ ...(opened ? { recordId: '', sessionId: '', projectPath: '', analysis: '', promptText: '' } : {}),
1424
+ },
1425
+ };
1426
+ });
1427
+ }, '已删除'),
1428
+ });
1429
+
1430
+ const openGrowthConversation = (kind) => {
1431
+ const sessionId = growth[kind].sessionId;
1432
+ if (!sessionId) return;
1433
+ if (!revealCreationSession) {
1434
+ setToast({ text: '请到 DSH 会话列表里找「' + growthLabels[kind] + '」', bad: true });
1435
+ return;
1436
+ }
1437
+ try { revealCreationSession(sessionId); }
1438
+ catch { setToast({ text: '暂时切不过去,请到会话列表里找', bad: true }); }
1439
+ };
1440
+
1441
+ const planFromDiagnosis = (report) => {
1442
+ if (!report || !String(report.analysis || '').trim()) return;
1443
+ growthInput('planner', 'diagnosisId', report.id);
1444
+ setDiagView('planner');
1445
+ };
1446
+
1447
+ const followupFromDiagnosis = (report) => {
1448
+ if (!report || !String(report.analysis || '').trim()) return;
1449
+ setGrowth((all) => {
1450
+ const other = diagReports.find((row) => row.id !== report.id && String(row.analysis || '').trim());
1451
+ const previousBaseline = all.followup.input.baselineId;
1452
+ const baselineId = previousBaseline && previousBaseline !== report.id
1453
+ ? previousBaseline
1454
+ : (other?.id || '');
1455
+ return {
1456
+ ...all,
1457
+ followup: {
1458
+ ...all.followup,
1459
+ input: { ...all.followup.input, baselineId, currentId: report.id },
1460
+ },
1461
+ };
1462
+ });
1463
+ setDiagView('followup');
1464
+ };
1465
+
834
1466
  const closePlayer = () => {
835
1467
  if (document.fullscreenElement && document.exitFullscreen) document.exitFullscreen().catch(() => {});
836
1468
  setPlayer(null);
@@ -1093,9 +1725,147 @@
1093
1725
  return hit && hit.description ? String(hit.description).trim() : '';
1094
1726
  })();
1095
1727
  const docs = state.docs || [];
1096
- const doc = docs.find((item) => item.id === docId) || docs[0] || null;
1097
- const openDocs = () => { setDocBlocked(false); setDocsOpen(true); };
1728
+ const manualTabs = (() => {
1729
+ const byKey = new Map();
1730
+ docs.forEach((item) => {
1731
+ if (item.manualKey && !byKey.has(item.manualKey)) byKey.set(item.manualKey, item);
1732
+ });
1733
+ const tabs = MANUAL_TABS.map((tab) => ({ key: tab.key, label: tab.label, doc: byKey.get(tab.key) || null }));
1734
+ docs.forEach((item) => { if (!item.manualKey) tabs.push({ key: 'doc:' + item.id, label: item.title, doc: item }); });
1735
+ return tabs;
1736
+ })();
1737
+ const activeTab = manualTabs.find((tab) => tab.key === docId && tab.doc) || null;
1738
+ const doc = activeTab ? activeTab.doc : null;
1739
+ const openDocs = () => {
1740
+ const first = manualTabs.find((tab) => tab.doc && !tab.doc.locked) || manualTabs.find((tab) => tab.doc);
1741
+ setDocId(first ? first.key : '');
1742
+ setDocBlocked(false);
1743
+ setDocsOpen(true);
1744
+ };
1745
+ const mdInline = (text, prefix) => {
1746
+ const nodes = [];
1747
+ const re = /(`[^`]+`)|(\*\*[^*]+\*\*)|!\[([^\]]*)\]\((https?:\/\/[^)\s]+)\)|\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;
1748
+ let last = 0;
1749
+ let match;
1750
+ let index = 0;
1751
+ while ((match = re.exec(text))) {
1752
+ if (match.index > last) nodes.push(text.slice(last, match.index));
1753
+ if (match[1]) nodes.push(h('code', { key: prefix + 'c' + index++ }, match[1].slice(1, -1)));
1754
+ else if (match[2]) nodes.push(h('strong', { key: prefix + 'b' + index++ }, match[2].slice(2, -2)));
1755
+ else if (match[3] !== undefined) {
1756
+ const src = match[4];
1757
+ if (/\.(mp4|webm|mov|m4v)(\?|#|$)/i.test(src)) {
1758
+ nodes.push(h('video', { key: prefix + 'v' + index++, src, controls: true, playsInline: true, preload: 'metadata' }));
1759
+ } else {
1760
+ nodes.push(h('img', { key: prefix + 'i' + index++, src, alt: match[3] }));
1761
+ }
1762
+ } else if (match[5]) nodes.push(h('a', { key: prefix + 'a' + index++, href: match[6], target: '_blank', rel: 'noreferrer' }, match[5]));
1763
+ last = re.lastIndex;
1764
+ }
1765
+ if (last < text.length) nodes.push(text.slice(last));
1766
+ return nodes;
1767
+ };
1768
+ const mdBlocks = (raw) => {
1769
+ const lines = String(raw || '').replace(/\r\n/g, '\n').split('\n');
1770
+ const out = [];
1771
+ let i = 0;
1772
+ let key = 0;
1773
+ let para = [];
1774
+ const flush = () => {
1775
+ if (!para.length) return;
1776
+ const text = para.join(' ');
1777
+ para = [];
1778
+ out.push(h('p', { key: 'p' + key++ }, mdInline(text, 'p' + key + ':')));
1779
+ };
1780
+ while (i < lines.length) {
1781
+ const line = lines[i];
1782
+ const text = line.trim();
1783
+ if (!text) { flush(); i += 1; continue; }
1784
+ if (/^```/.test(text)) {
1785
+ flush();
1786
+ const buf = [];
1787
+ i += 1;
1788
+ while (i < lines.length && !/^```/.test(lines[i].trim())) { buf.push(lines[i]); i += 1; }
1789
+ i += 1;
1790
+ out.push(h('pre', { key: 'pre' + key++ }, h('code', null, buf.join('\n'))));
1791
+ continue;
1792
+ }
1793
+ if (/^(-{3,}|\*{3,})$/.test(text)) { flush(); out.push(h('hr', { key: 'hr' + key++ })); i += 1; continue; }
1794
+ const heading = text.match(/^(#{1,4})\s+(.*)$/);
1795
+ if (heading) {
1796
+ flush();
1797
+ const level = heading[1].length;
1798
+ out.push(h('h' + level, { key: 'h' + key++ }, mdInline(heading[2], 'h' + key + ':')));
1799
+ i += 1;
1800
+ continue;
1801
+ }
1802
+ if (/^>\s?/.test(text)) {
1803
+ flush();
1804
+ const buf = [];
1805
+ while (i < lines.length && /^>\s?/.test(lines[i].trim())) {
1806
+ buf.push(lines[i].trim().replace(/^>\s?/, ''));
1807
+ i += 1;
1808
+ }
1809
+ out.push(h('blockquote', { key: 'q' + key++ }, mdInline(buf.join(' '), 'q' + key + ':')));
1810
+ continue;
1811
+ }
1812
+ if (/^\|.*\|$/.test(text) && /^\|[\s:|-]+\|$/.test((lines[i + 1] || '').trim())) {
1813
+ flush();
1814
+ const cells = (row) => row.trim().replace(/^\||\|$/g, '').split('|').map((cell) => cell.trim());
1815
+ const head = cells(lines[i]);
1816
+ i += 2;
1817
+ const rows = [];
1818
+ while (i < lines.length && /^\|.*\|$/.test(lines[i].trim())) { rows.push(cells(lines[i])); i += 1; }
1819
+ out.push(h('div', { key: 'tw' + key++, className: 'bn-md-table' },
1820
+ h('table', null,
1821
+ h('thead', null, h('tr', null, head.map((cell, ci) => h('th', { key: ci }, mdInline(cell, 'th' + ci + ':'))))),
1822
+ h('tbody', null, rows.map((row, ri) => h('tr', { key: ri }, row.map((cell, ci) => h('td', { key: ci }, mdInline(cell, 'td' + ri + '-' + ci + ':')))))),
1823
+ )));
1824
+ continue;
1825
+ }
1826
+ const ordered = /^\d+\.\s+/.test(text);
1827
+ if (ordered || /^[-*]\s+/.test(text)) {
1828
+ flush();
1829
+ const items = [];
1830
+ while (i < lines.length) {
1831
+ const cur = lines[i].trim();
1832
+ const item = ordered ? cur.match(/^\d+\.\s+(.*)$/) : cur.match(/^[-*]\s+(.*)$/);
1833
+ if (!item) break;
1834
+ items.push(item[1]);
1835
+ i += 1;
1836
+ }
1837
+ out.push(h(ordered ? 'ol' : 'ul', { key: 'l' + key++ },
1838
+ items.map((item, ii) => h('li', { key: ii }, mdInline(item, 'li' + key + '-' + ii + ':')))));
1839
+ continue;
1840
+ }
1841
+ para.push(text);
1842
+ i += 1;
1843
+ }
1844
+ flush();
1845
+ return out;
1846
+ };
1098
1847
  const licenseOn = !!(state.license && (state.license.state === 'active' || state.license.state === 'grace'));
1848
+ const member = state.member || null;
1849
+ const memberOn = !!(member && member.active);
1850
+ const memberCampaign = (state.campaigns || []).find(
1851
+ (c) => c.kind !== 'link' && /会员|年费|年卡|member|vip/i.test(String(c.name || '') + ' ' + String(c.slug || '')),
1852
+ );
1853
+ const memberHref = state.buyUrl
1854
+ ? state.buyUrl + (memberCampaign ? (String(state.buyUrl).indexOf('?') >= 0 ? '&' : '?') + 'c=' + encodeURIComponent(memberCampaign.slug) : '')
1855
+ : '';
1856
+ const diagKindLabel = (kind) => kind === 'profile' ? '账号主页' : kind === 'note' ? '图文' : kind === 'text' ? '文案' : kind === 'upload' ? '上传素材' : '视频';
1857
+ const fmtCount = (value) => {
1858
+ if (value == null) return '';
1859
+ if (value >= 10000) return (Math.round(value / 1000) / 10) + 'w';
1860
+ return String(value);
1861
+ };
1862
+ const diagSize = (bytes) => {
1863
+ const size = Number(bytes) || 0;
1864
+ if (size >= 1024 * 1024) return (Math.round(size / 1024 / 102.4) / 10) + 'MB';
1865
+ if (size >= 1024) return Math.round(size / 1024) + 'KB';
1866
+ return size ? size + 'B' : '';
1867
+ };
1868
+ const diagReady = !!(diagMedia.length || diagSnap);
1099
1869
  const openManual = () => {
1100
1870
  if (!docs.length) {
1101
1871
  setToast({ text: '还没有手册', bad: true });
@@ -1120,9 +1890,8 @@
1120
1890
  const topSeg = h('div', { className: 'bn-seg' },
1121
1891
  h('span', { className: 'on', title: (state.license && state.license.reason) || '' }, licenseOn ? '已授权' : '未授权'),
1122
1892
  h('button', { type: 'button', onClick: openManual }, '手册'),
1123
- h('button', { type: 'button', onClick: openCases }, '案例'),
1124
1893
  );
1125
- const campaigns = state.license && state.license.canExport ? [] : (state.campaigns || []);
1894
+ const campaigns = state.campaigns || [];
1126
1895
  const camp = campaigns.length ? campaigns[((campIdx % campaigns.length) + campaigns.length) % campaigns.length] : null;
1127
1896
  const campIcons = { spark: '✨', gift: '🎁', rocket: '🚀', crown: '👑', star: '⭐', bolt: '⚡', box: '📦', heart: '💛', fire: '🔥', gem: '💎', party: '🎉', tag: '🏷️' };
1128
1897
  const campHref = camp
@@ -1133,12 +1902,273 @@
1133
1902
  : ''
1134
1903
  : '';
1135
1904
 
1905
+ const completedDiagReports = diagReports.filter((report) => String(report.analysis || '').trim());
1906
+ const growthHeroCopy = {
1907
+ research: {
1908
+ title: '拆透对标,只迁移你能用的结构',
1909
+ desc: '拆解公开信息与真实作品,分清事实和推断,提炼五维内容公式,并明确哪些能借鉴、哪些不能照搬。',
1910
+ values: ['公开事实', '五维公式', '迁移边界', '下周动作'],
1911
+ },
1912
+ planner: {
1913
+ title: '让号脉结论直接变成下周选题',
1914
+ desc: '自动带入选定号脉报告,把诊断结论和真实素材转成日期、钩子、形式、公式卡与检查点都齐全的内容计划。',
1915
+ values: ['自动衔接号脉', '真实素材', '逐条公式卡', '指标检查点'],
1916
+ },
1917
+ followup: {
1918
+ title: '用两次真实号脉,看清改变是否发生',
1919
+ desc: '选择基线和本次号脉,只对同口径指标计算变化,验收此前 30 天目标,再决定处方的保留、停止与新增。',
1920
+ values: ['同口径对照', '变化量', '目标验收', '下阶段处方'],
1921
+ },
1922
+ };
1923
+ const growthHero = (kind) => {
1924
+ const copy = growthHeroCopy[kind];
1925
+ return h('section', { className: 'bn-diag-hero' },
1926
+ h('div', { style: { minWidth: 0 } },
1927
+ h('div', { className: 'bn-diag-kicker' }, memberOn ? '年会员 · ' + growthLabels[kind] : '年会员专属'),
1928
+ h('h2', null, copy.title),
1929
+ h('p', null, copy.desc + ' 素材与报告只存在本机。'),
1930
+ h('div', { className: 'bn-diag-values' }, copy.values.map((value, index) =>
1931
+ h('span', { key: value }, h('b', null, String(index + 1).padStart(2, '0')), value))),
1932
+ ),
1933
+ h('div', { className: 'bn-diag-hero-side' }, memberOn
1934
+ ? h('span', { className: 'bn-chip ok' }, member.daysLeft ? '剩余 ' + member.daysLeft + ' 天' : '已开通')
1935
+ : h('span', { className: 'bn-chip dim' }, '未开通')),
1936
+ );
1937
+ };
1938
+
1939
+ const growthMedia = (kind) => {
1940
+ const current = growth[kind];
1941
+ if (!current.media.length) return null;
1942
+ return h('div', { className: 'bn-media-grid' }, current.media.map((item) => h('div', { key: item.id, className: 'bn-media' },
1943
+ item.previewUrl ? h('img', { src: item.previewUrl, alt: '' }) : h('div', { className: 'bn-media-ph' }, item.kind === 'video' ? '▶ 视频' : '图片'),
1944
+ h('div', { className: 'bn-media-info' },
1945
+ h('span', { className: 'bn-media-name', title: item.name }, item.name),
1946
+ h('span', { className: 'bn-media-size' }, diagSize(item.size)),
1947
+ ),
1948
+ h('button', {
1949
+ className: 'bn-media-x', title: '移除',
1950
+ onClick: (event) => {
1951
+ event.stopPropagation();
1952
+ growthPatch(kind, (itemState) => ({ media: itemState.media.filter((row) => row.id !== item.id) }));
1953
+ },
1954
+ }, '×'),
1955
+ )));
1956
+ };
1957
+
1958
+ const growthResult = (kind) => {
1959
+ const current = growth[kind];
1960
+ if (!current.sessionId && !current.analysis && !current.promptText) return null;
1961
+ return h('section', { className: 'bn-panel' },
1962
+ h('div', { className: 'bn-sec-head' },
1963
+ h('h2', null, growthLabels[kind] + '报告'),
1964
+ h('div', { className: 'bn-sec-actions' },
1965
+ h('span', { className: 'bn-diag-status ' + (current.analysis ? 'ok' : current.sessionId ? 'live' : '') },
1966
+ current.analysis ? '已回填' : current.sessionId ? '分析中' : '手动模式'),
1967
+ ),
1968
+ ),
1969
+ h('textarea', {
1970
+ className: 'bn-input bn-diag-text', rows: 10,
1971
+ placeholder: '分析完成后自动回填;也可以把结果粘贴到这里保存',
1972
+ value: current.analysis,
1973
+ onChange: (event) => growthPatch(kind, { analysis: event.target.value }),
1974
+ }),
1975
+ h('div', { className: 'bn-diag-cta' },
1976
+ h('button', { className: 'bn-btn primary', disabled: !String(current.analysis || '').trim(), onClick: () => saveGrowth(kind) }, '保存到档案'),
1977
+ current.promptText ? h('button', { className: 'bn-btn', onClick: () => copyPrompt(current.promptText) }, '复制提示词') : null,
1978
+ current.sessionId ? h('button', { className: 'bn-btn ghost', onClick: () => openGrowthConversation(kind) }, '回到分析会话') : null,
1979
+ h('small', null, '报告仅保存在本机;切换档案不会上传素材或内容。'),
1980
+ ),
1981
+ );
1982
+ };
1983
+
1984
+ const growthArchive = (kind) => {
1985
+ const reports = growth[kind].reports;
1986
+ return h('section', { className: 'bn-panel' },
1987
+ h('div', { className: 'bn-sec-head' },
1988
+ h('h2', null, growthLabels[kind] + '档案'),
1989
+ h('div', { className: 'bn-sec-actions' }, h('span', { className: 'bn-chip dim' }, String(reports.length))),
1990
+ ),
1991
+ reports.length ? h('div', { className: 'bn-archive' }, reports.map((report) => h('article', {
1992
+ key: report.id, className: 'bn-archive-item', onClick: () => openGrowthRecord(kind, report),
1993
+ },
1994
+ h('div', { className: 'bn-archive-top' },
1995
+ h('span', { className: 'bn-archive-kind' }, report.analysis ? '已完成' : report.sessionId ? '待回填' : '手动存档'),
1996
+ h('span', { className: 'bn-archive-kind' }, timeAgo(report.createdAt)),
1997
+ ),
1998
+ h('div', { className: 'bn-archive-title' }, report.title || growthLabels[kind]),
1999
+ h('div', { className: 'bn-archive-meta' }, h('span', null, '本机档案 · 点击回看')),
2000
+ h('button', {
2001
+ className: 'bn-btn ghost bn-archive-del',
2002
+ onClick: (event) => { event.stopPropagation(); removeGrowthRecord(kind, report); },
2003
+ }, '删除'),
2004
+ ))) : h('div', { className: 'bn-empty' }, '还没有' + growthLabels[kind] + '档案。\n完成一次分析后会存在本机。'),
2005
+ );
2006
+ };
2007
+
2008
+ const researchWorkspace = () => {
2009
+ const current = growth.research;
2010
+ const input = current.input;
2011
+ return h('div', null,
2012
+ growthHero('research'),
2013
+ h('input', {
2014
+ ref: researchFileRef, type: 'file', accept: 'image/*,video/*', multiple: true, style: { display: 'none' },
2015
+ onChange: (event) => uploadDiagFiles(event, 'research'),
2016
+ }),
2017
+ h('section', { className: 'bn-panel bn-diag-work' },
2018
+ h('div', { className: 'bn-diag-block-head' }, h('h2', null, '确定调研对象'), h('span', null, '账号名必填,主页与高播放作品截图越完整,拆解越可靠')),
2019
+ h('div', { className: 'bn-growth-form' },
2020
+ h('div', { className: 'bn-field' }, h('label', null, '对标账号名(必填)'), h('input', {
2021
+ className: 'bn-input', value: input.accounts, placeholder: '多个账号用逗号分隔',
2022
+ onChange: (event) => growthInput('research', 'accounts', event.target.value),
2023
+ })),
2024
+ h('div', { className: 'bn-field' }, h('label', null, '主页链接(可选)'), h('input', {
2025
+ className: 'bn-input', value: input.links, placeholder: '粘贴抖音主页或公开报道链接',
2026
+ onChange: (event) => growthInput('research', 'links', event.target.value),
2027
+ })),
2028
+ h('div', { className: 'bn-field full' }, h('label', null, '你的定位与现有资源(可选,影响可迁移判断)'), h('textarea', {
2029
+ className: 'bn-input', value: input.positioning, placeholder: '例如:给实体店主讲短视频获客;自己一个人拍摄,有真实门店和客户问题',
2030
+ onChange: (event) => growthInput('research', 'positioning', event.target.value),
2031
+ })),
2032
+ ),
2033
+ h('div', {
2034
+ className: 'bn-drop' + (current.hot ? ' hot' : ''), style: { marginTop: 12 },
2035
+ onClick: () => { if (!current.uploading && researchFileRef.current) researchFileRef.current.click(); },
2036
+ onDragOver: (event) => { event.preventDefault(); growthPatch('research', { hot: true }); },
2037
+ onDragLeave: () => growthPatch('research', { hot: false }),
2038
+ onDrop: (event) => {
2039
+ event.preventDefault(); growthPatch('research', { hot: false });
2040
+ uploadDiagFiles(event.dataTransfer && event.dataTransfer.files, 'research');
2041
+ },
2042
+ },
2043
+ h('div', { className: 'bn-drop-ico' }, '+'),
2044
+ h('b', null, current.uploading ? '正在写入本机…' : '补充主页 / 作品截图或视频'),
2045
+ h('small', null, '建议包含 3–5 条代表作品的标题、发布时间与可见表现;模型会自行读取素材'),
2046
+ ),
2047
+ growthMedia('research'),
2048
+ h('div', { className: 'bn-diag-label' }, '调研重点(可选)'),
2049
+ h('textarea', {
2050
+ className: 'bn-input bn-diag-text', rows: 3, value: input.notes,
2051
+ placeholder: '例如:重点看开头钩子和选题来源,不要建议需要团队才能做的形式',
2052
+ onChange: (event) => growthInput('research', 'notes', event.target.value),
2053
+ }),
2054
+ current.error ? h('div', { className: 'bn-chip bad', style: { marginTop: 10 } }, current.error) : null,
2055
+ h('div', { className: 'bn-diag-cta' },
2056
+ h('button', { className: 'bn-btn primary', disabled: !String(input.accounts || '').trim() || !!current.busy || current.uploading, onClick: () => runGrowthSession('research') }, current.busy ? '正在开调研会话…' : '开始对标调研'),
2057
+ h('small', null, '使用你自己的 DSH 模型;没有联网工具时会明确标未核实,不会假装检索。'),
2058
+ ),
2059
+ ),
2060
+ growthResult('research'),
2061
+ growthArchive('research'),
2062
+ );
2063
+ };
2064
+
2065
+ const plannerWorkspace = () => {
2066
+ const current = growth.planner;
2067
+ const input = current.input;
2068
+ const selected = completedDiagReports.find((report) => report.id === input.diagnosisId) || null;
2069
+ return h('div', null,
2070
+ growthHero('planner'),
2071
+ h('section', { className: 'bn-panel bn-diag-work' },
2072
+ h('div', { className: 'bn-diag-block-head' }, h('h2', null, '衔接号脉与真实排期'), h('span', null, '默认选用最新已完成号脉,也可以切换或不用报告')),
2073
+ h('div', { className: 'bn-growth-form' },
2074
+ h('div', { className: 'bn-field full' }, h('label', null, '带入的号脉报告'), h('select', {
2075
+ className: 'bn-select', value: input.diagnosisId || '',
2076
+ onChange: (event) => growthInput('planner', 'diagnosisId', event.target.value),
2077
+ },
2078
+ h('option', { value: '' }, completedDiagReports.length ? '不使用号脉报告(需填写定位)' : '暂无已完成号脉报告'),
2079
+ completedDiagReports.map((report) => h('option', { key: report.id, value: report.id }, (report.title || '未命名号脉') + ' · ' + timeAgo(report.createdAt))),
2080
+ )),
2081
+ selected ? h('div', { className: 'bn-growth-source full' },
2082
+ h('span', null, '已自动衔接:' + (selected.title || '未命名号脉')),
2083
+ h('button', { className: 'bn-btn ghost', onClick: () => { openDiagReport(selected); setDiagView('diagnose'); } }, '查看原报告'),
2084
+ ) : null,
2085
+ h('div', { className: 'bn-field full' }, h('label', null, '账号定位(留空时仅从号脉报告提取)'), h('input', {
2086
+ className: 'bn-input', value: input.positioning, placeholder: '给谁看、讲什么、凭什么信你;报告无法确认时会列入待补,不会编造',
2087
+ onChange: (event) => growthInput('planner', 'positioning', event.target.value),
2088
+ })),
2089
+ h('div', { className: 'bn-field' }, h('label', null, '开始日期'), h('input', {
2090
+ className: 'bn-input', type: 'date', value: input.startDate,
2091
+ onChange: (event) => growthInput('planner', 'startDate', event.target.value),
2092
+ })),
2093
+ h('div', { className: 'bn-field' }, h('label', null, '每周发布上限(条)'), h('input', {
2094
+ className: 'bn-input', type: 'number', min: 1, max: 14, value: input.frequency,
2095
+ onChange: (event) => growthInput('planner', 'frequency', event.target.value),
2096
+ })),
2097
+ h('div', { className: 'bn-field full' }, h('label', null, '真实素材与排期约束'), h('textarea', {
2098
+ className: 'bn-input', value: input.notes,
2099
+ placeholder: '列出近期真实在做的事、可拍事件、产品/项目、可拍时间;每条选题都必须能追溯到这些素材或号脉证据',
2100
+ onChange: (event) => growthInput('planner', 'notes', event.target.value),
2101
+ })),
2102
+ ),
2103
+ current.error ? h('div', { className: 'bn-chip bad', style: { marginTop: 10 } }, current.error) : null,
2104
+ h('div', { className: 'bn-diag-cta' },
2105
+ h('button', {
2106
+ className: 'bn-btn primary', disabled: !!current.busy || (!input.diagnosisId && !String(input.positioning || '').trim()),
2107
+ onClick: () => runGrowthSession('planner'),
2108
+ }, current.busy ? '正在开规划会话…' : '生成选题计划'),
2109
+ h('small', null, selected ? '规划会话会读取这份号脉全文,并把诊断结论落实到选题设计逻辑。' : '不使用号脉时,账号定位必填。'),
2110
+ ),
2111
+ ),
2112
+ growthResult('planner'),
2113
+ growthArchive('planner'),
2114
+ );
2115
+ };
2116
+
2117
+ const followupWorkspace = () => {
2118
+ const current = growth.followup;
2119
+ const input = current.input;
2120
+ const baseline = completedDiagReports.find((report) => report.id === input.baselineId) || null;
2121
+ const currentReport = completedDiagReports.find((report) => report.id === input.currentId) || null;
2122
+ const selector = (key, placeholder) => h('select', {
2123
+ className: 'bn-select', value: input[key] || '', onChange: (event) => growthInput('followup', key, event.target.value),
2124
+ },
2125
+ h('option', { value: '' }, placeholder),
2126
+ completedDiagReports.map((report) => h('option', { key: report.id, value: report.id }, (report.title || '未命名号脉') + ' · ' + timeAgo(report.createdAt))),
2127
+ );
2128
+ return h('div', null,
2129
+ growthHero('followup'),
2130
+ h('section', { className: 'bn-panel bn-diag-work' },
2131
+ h('div', { className: 'bn-diag-block-head' }, h('h2', null, '选择两次号脉'), h('span', null, '只对照两份报告里真实存在且口径一致的指标')),
2132
+ completedDiagReports.length < 2
2133
+ ? h('div', { className: 'bn-empty' }, '至少需要两份已回填的号脉报告。\n先完成新一轮号脉,再回来复诊。')
2134
+ : h('div', null,
2135
+ h('div', { className: 'bn-growth-form' },
2136
+ h('div', { className: 'bn-field' }, h('label', null, '基线号脉(此前)'), selector('baselineId', '选择基线号脉')),
2137
+ h('div', { className: 'bn-field' }, h('label', null, '本次号脉(最近)'), selector('currentId', '选择本次号脉')),
2138
+ ),
2139
+ h('div', { className: 'bn-growth-compare' },
2140
+ h('div', null, h('b', null, '基线'), h('span', null, baseline ? baseline.title : '尚未选择')),
2141
+ h('div', null, h('b', null, '本次'), h('span', null, currentReport ? currentReport.title : '尚未选择')),
2142
+ ),
2143
+ h('div', { className: 'bn-diag-label' }, '本次复诊重点(可选)'),
2144
+ h('textarea', {
2145
+ className: 'bn-input bn-diag-text', rows: 3, value: input.notes,
2146
+ placeholder: '例如:重点验收更新频率和中位播放,说明上一轮哪条处方该继续',
2147
+ onChange: (event) => growthInput('followup', 'notes', event.target.value),
2148
+ }),
2149
+ ),
2150
+ current.error ? h('div', { className: 'bn-chip bad', style: { marginTop: 10 } }, current.error) : null,
2151
+ h('div', { className: 'bn-diag-cta' },
2152
+ h('button', {
2153
+ className: 'bn-btn primary',
2154
+ disabled: completedDiagReports.length < 2 || !!current.busy || !input.baselineId || !input.currentId || input.baselineId === input.currentId,
2155
+ onClick: () => runGrowthSession('followup'),
2156
+ }, current.busy ? '正在开复诊会话…' : '开始复诊对比'),
2157
+ input.baselineId && input.baselineId === input.currentId ? h('small', null, '两份报告不能相同。') : h('small', null, '缺失或口径不一致的指标会明确标注,不做虚假计算。'),
2158
+ ),
2159
+ ),
2160
+ growthResult('followup'),
2161
+ growthArchive('followup'),
2162
+ );
2163
+ };
2164
+
1136
2165
  return h('div', { className: 'bn-root' },
1137
2166
  h('aside', { className: 'bn-rail' },
1138
2167
  h('div', { className: 'bn-logo' }, h('span', { className: 'dot' }, h('img', { src: BASE + '/icons/app.svg', alt: '' })), BRAND),
1139
2168
  h('nav', { className: 'bn-nav' },
1140
2169
  h('button', { className: tab === 'agents' ? 'on' : '', onClick: () => setTab('agents') }, h(Icon, { name: 'grid' }), 'Agents', h('span', { className: 'count' }, String(agents.length))),
1141
2170
  h('button', { className: tab === 'studio' ? 'on' : '', onClick: () => studioAgentId && setTab('studio'), disabled: !studioAgentId }, h(Icon, { name: 'external' }), 'Studio'),
2171
+ h('button', { className: tab === 'diagnose' ? 'on' : '', onClick: () => setTab('diagnose') }, h(Icon, { name: memberOn ? 'bolt' : 'lock' }), '号脉', memberOn ? null : h('span', { className: 'count' }, '会员')),
1142
2172
  h('button', { className: tab === 'tasks' ? 'on' : '', onClick: () => setTab('tasks') }, h(Icon, { name: 'list' }), '任务', h('span', { className: 'count' }, String(tasks.filter((t) => t.status === 'running').length || ''))),
1143
2173
  h('button', { className: tab === 'account' ? 'on' : '', onClick: () => setTab('account') }, h(Icon, { name: 'key' }), '我的授权', h('span', { className: 'count' }, String(licenses.length || ''))),
1144
2174
  h('button', { className: tab === 'settings' ? 'on' : '', onClick: () => setTab('settings') }, h(Icon, { name: 'gear' }), '设置'),
@@ -1171,11 +2201,11 @@
1171
2201
  h('div', { className: 'bn-mono', style: { marginTop: 4 } }, licenses.length ? (licenses.length + ' 产品授权') : state.license.state),
1172
2202
  ),
1173
2203
  ),
1174
- h('main', { className: 'bn-main' + (tab === 'agents' ? ' has-note' : '') },
2204
+ h('main', { className: 'bn-main' },
1175
2205
  tab !== 'studio' ? h('div', { className: 'bn-head' },
1176
2206
  h('div', null,
1177
- h('h1', { className: 'bn-h1' }, tab === 'agents' ? '今天就出片' : tab === 'tasks' ? '任务' : tab === 'account' ? '我的授权' : '设置'),
1178
- h('div', { className: 'bn-sub' }, tab === 'agents' ? '看一条成片,选一个 Agent。模板里已经写好提示词,改一句就能开拍。' : tab === 'tasks' ? '安装与创作进度' : tab === 'account' ? '激活码与购买' : '偏好设置'),
2207
+ h('h1', { className: 'bn-h1' }, tab === 'agents' ? '今天就出片' : tab === 'diagnose' ? (diagView === 'diagnose' ? '号脉' : growthLabels[diagView]) : tab === 'tasks' ? '任务' : tab === 'account' ? '我的授权' : '设置'),
2208
+ h('div', { className: 'bn-sub' }, tab === 'agents' ? '看一条成片,选一个 Agent。模板里已经写好提示词,改一句就能开拍。' : tab === 'diagnose' ? '年会员专属 · 号脉、对标、选题与复诊 · 素材与报告只存在本机' : tab === 'tasks' ? '安装与创作进度' : tab === 'account' ? '激活码与购买' : '偏好设置'),
1179
2209
  ),
1180
2210
  h('div', { className: 'bn-head-actions' }, topSeg),
1181
2211
  ) : null,
@@ -1289,6 +2319,184 @@
1289
2319
  )
1290
2320
  ) : null,
1291
2321
 
2322
+ tab === 'diagnose' ? h('div', null,
2323
+ h('div', { className: 'bn-seg bn-growth-tabs' },
2324
+ h('button', { type: 'button', className: diagView === 'diagnose' ? 'on' : '', onClick: () => setDiagView('diagnose') }, '号脉'),
2325
+ h('button', { type: 'button', className: diagView === 'research' ? 'on' : '', onClick: () => setDiagView('research') }, '对标调研'),
2326
+ h('button', { type: 'button', className: diagView === 'planner' ? 'on' : '', onClick: () => setDiagView('planner') }, '选题规划'),
2327
+ h('button', { type: 'button', className: diagView === 'followup' ? 'on' : '', onClick: () => setDiagView('followup') }, '复诊对比'),
2328
+ ),
2329
+ diagView !== 'diagnose' ? (memberOn
2330
+ ? diagView === 'research' ? researchWorkspace() : diagView === 'planner' ? plannerWorkspace() : followupWorkspace()
2331
+ : h('section', { className: 'bn-diag-upsell' },
2332
+ h('div', { style: { minWidth: 0 } },
2333
+ h('h2', null, growthLabels[diagView] + '是年会员能力'),
2334
+ h('p', null, '与号脉共用本机档案和 DSH 会话,不增加平台服务器模型成本;开通后可使用完整账号增长工作流。'),
2335
+ ),
2336
+ memberHref
2337
+ ? h('a', { className: 'bn-btn primary', href: memberHref, target: '_blank', rel: 'noreferrer' }, '开通年会员')
2338
+ : h('div', { className: 'bn-sub' }, '暂时打不开购买页,请到「我的授权」重试。'),
2339
+ )) : null,
2340
+ diagView === 'diagnose' ? h('div', null,
2341
+ h('section', { className: 'bn-diag-hero' },
2342
+ h('div', { style: { minWidth: 0 } },
2343
+ h('div', { className: 'bn-diag-kicker' }, memberOn ? '年会员 · 账号体检' : '年会员专属'),
2344
+ h('h2', null, '看清账号瓶颈,拿到 30 天改法'),
2345
+ h('p', null, '上传抖音后台截图,从真实作品数据建立基线,完成四维诊断,给出带方法论出处的优化处方和验收指标。素材与报告只存在本机。'),
2346
+ h('div', { className: 'bn-diag-values' },
2347
+ h('span', null, h('b', null, '01'), '数据基线'),
2348
+ h('span', null, h('b', null, '02'), '四维诊断'),
2349
+ h('span', null, h('b', null, '03'), '溯源处方'),
2350
+ h('span', null, h('b', null, '04'), '30 天指标'),
2351
+ ),
2352
+ ),
2353
+ h('div', { className: 'bn-diag-hero-side' },
2354
+ memberOn
2355
+ ? h('span', { className: 'bn-chip ok' }, member.daysLeft ? '剩余 ' + member.daysLeft + ' 天' : '已开通')
2356
+ : h('span', { className: 'bn-chip dim' }, '未开通'),
2357
+ ),
2358
+ ),
2359
+ memberOn
2360
+ ? h('div', null,
2361
+ h('input', {
2362
+ ref: diagFileRef,
2363
+ type: 'file',
2364
+ accept: 'image/*,video/*',
2365
+ multiple: true,
2366
+ style: { display: 'none' },
2367
+ onChange: uploadDiagFiles,
2368
+ }),
2369
+ h('section', { className: 'bn-panel bn-diag-work' },
2370
+ h('div', { className: 'bn-diag-block-head' },
2371
+ h('h2', null, '输入账号素材'),
2372
+ h('span', null, '后台截图为主,视频与补充说明可选'),
2373
+ ),
2374
+ h('div', {
2375
+ className: 'bn-drop' + (diagHot ? ' hot' : ''),
2376
+ onClick: () => { if (!diagUploading) diagFileRef.current && diagFileRef.current.click(); },
2377
+ onDragOver: (e) => { e.preventDefault(); setDiagHot(true); },
2378
+ onDragLeave: () => setDiagHot(false),
2379
+ onDrop: (e) => {
2380
+ e.preventDefault();
2381
+ setDiagHot(false);
2382
+ uploadDiagFiles(e.dataTransfer && e.dataTransfer.files);
2383
+ },
2384
+ },
2385
+ h('div', { className: 'bn-drop-ico' }, '+'),
2386
+ h('b', null, diagUploading ? '正在写入本机…' : '拖入或点击上传后台截图 / 视频'),
2387
+ h('small', null, '建议提供至少 5 条作品的标题、播放量与发布时间;视频由 DSH 模型自己抽帧'),
2388
+ ),
2389
+ diagMedia.length ? h('div', { className: 'bn-media-grid' },
2390
+ diagMedia.map((item) => h('div', { key: item.id, className: 'bn-media' },
2391
+ item.previewUrl
2392
+ ? h('img', { src: item.previewUrl, alt: '' })
2393
+ : h('div', { className: 'bn-media-ph' }, item.kind === 'video' ? '▶ 视频' : '图片'),
2394
+ h('div', { className: 'bn-media-info' },
2395
+ h('span', { className: 'bn-media-name', title: item.name }, item.name),
2396
+ h('span', { className: 'bn-media-size' }, diagSize(item.size)),
2397
+ ),
2398
+ h('button', {
2399
+ className: 'bn-media-x',
2400
+ title: '移除',
2401
+ onClick: (e) => { e.stopPropagation(); removeDiagMedia(item.id); },
2402
+ }, '×'),
2403
+ )),
2404
+ ) : null,
2405
+ h('div', { className: 'bn-diag-label' }, '补充说明(可选)'),
2406
+ h('textarea', {
2407
+ className: 'bn-input bn-diag-text',
2408
+ rows: 3,
2409
+ placeholder: '粘贴作品数据 / 文案,或说明重点想诊断什么,例如:播放量长期低于 500,问题在哪里',
2410
+ value: diagText,
2411
+ onChange: (e) => setDiagText(e.target.value),
2412
+ }),
2413
+ diagErr ? h('div', { className: 'bn-chip bad', style: { marginTop: 10 } }, diagErr) : null,
2414
+ h('div', { className: 'bn-diag-cta' },
2415
+ h('button', {
2416
+ className: 'bn-btn primary',
2417
+ disabled: !diagReady || !!diagBusy || diagUploading,
2418
+ onClick: runDiagSession,
2419
+ }, diagBusy === 'session' ? '正在开分析会话…' : '开始账号体检'),
2420
+ h('small', null, diagSession
2421
+ ? '诊断在 DSH 会话里进行,写成 report.md 后会自动回填。'
2422
+ : '会在 DSH 新开「账号体检」会话,用你自己的模型分析。'),
2423
+ diagSession ? h('button', { className: 'bn-btn ghost', onClick: openDiagSession }, '回到分析会话') : null,
2424
+ ),
2425
+ ),
2426
+ diagSession || diagAnalysis ? h('section', { className: 'bn-panel' },
2427
+ h('div', { className: 'bn-sec-head' },
2428
+ h('h2', null, '账号体检报告'),
2429
+ h('div', { className: 'bn-sec-actions' },
2430
+ h('span', { className: 'bn-diag-status ' + (diagAnalysis ? 'ok' : 'live') }, diagAnalysis ? '已回填' : '分析中'),
2431
+ ),
2432
+ ),
2433
+ h('textarea', {
2434
+ className: 'bn-input bn-diag-text',
2435
+ rows: 8,
2436
+ placeholder: '分析完成后会自动回填;模型没写文件时,也可以把结果粘贴到这里',
2437
+ value: diagAnalysis,
2438
+ onChange: (e) => setDiagAnalysis(e.target.value),
2439
+ }),
2440
+ h('div', { className: 'bn-diag-cta' },
2441
+ h('button', { className: 'bn-btn primary', disabled: !diagAnalysis.trim(), onClick: saveDiagnose }, '保存到档案'),
2442
+ diagPrompt ? h('button', { className: 'bn-btn', onClick: () => copyPrompt(diagPrompt) }, '复制提示词') : null,
2443
+ h('small', null, '报告只保存在本机,可在下方档案里随时回看。'),
2444
+ ),
2445
+ ) : null,
2446
+ h('section', { className: 'bn-panel' },
2447
+ h('div', { className: 'bn-sec-head' },
2448
+ h('h2', null, '体检档案'),
2449
+ h('div', { className: 'bn-sec-actions' },
2450
+ h('span', { className: 'bn-chip dim' }, String(diagReports.length)),
2451
+ ),
2452
+ ),
2453
+ diagReports.length
2454
+ ? h('div', { className: 'bn-archive' },
2455
+ diagReports.map((report) => h('article', {
2456
+ key: report.id,
2457
+ className: 'bn-archive-item',
2458
+ onClick: () => openDiagReport(report),
2459
+ },
2460
+ h('div', { className: 'bn-archive-top' },
2461
+ h('span', { className: 'bn-archive-kind' }, report.analysis ? '已分析' : report.sessionId ? '待回填' : '待分析'),
2462
+ h('span', { className: 'bn-archive-kind' }, timeAgo(report.createdAt)),
2463
+ ),
2464
+ h('div', { className: 'bn-archive-title' }, report.title || '未命名体检'),
2465
+ h('div', { className: 'bn-archive-meta' },
2466
+ h('span', { style: { minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
2467
+ [report.snapshot && report.snapshot.author, report.snapshot && diagKindLabel(report.snapshot.kind)].filter(Boolean).join(' · ') || '本机存档',
2468
+ ),
2469
+ ),
2470
+ report.analysis ? h('div', { className: 'bn-card-actions', style: { marginTop: 8, paddingTop: 8, paddingRight: 34 } },
2471
+ h('button', { className: 'bn-btn', onClick: (event) => { event.stopPropagation(); planFromDiagnosis(report); } }, '做选题'),
2472
+ h('button', { className: 'bn-btn ghost', onClick: (event) => { event.stopPropagation(); followupFromDiagnosis(report); } }, '去复诊'),
2473
+ ) : null,
2474
+ h('button', {
2475
+ className: 'bn-btn ghost bn-archive-del',
2476
+ onClick: (e) => { e.stopPropagation(); removeDiagReport(report); },
2477
+ }, '删除'),
2478
+ )),
2479
+ )
2480
+ : h('div', { className: 'bn-empty' }, '还没有体检档案。\n完成一次诊断后会存在本机,方便回看和对比。'),
2481
+ ),
2482
+ )
2483
+ : h('section', { className: 'bn-diag-upsell' },
2484
+ h('div', { style: { minWidth: 0 } },
2485
+ h('h2', null, '账号体检是年会员能力'),
2486
+ h('p', null, '从后台真实数据定位账号瓶颈,交付带出处处方和 30 天验收指标;报告存在本机,同时获得全部 Agent 的一年授权。'),
2487
+ h('ul', null,
2488
+ h('li', null, '四维定位真实瓶颈'),
2489
+ h('li', null, '处方可溯源、可执行'),
2490
+ h('li', null, '30 天指标可验收'),
2491
+ ),
2492
+ ),
2493
+ memberHref
2494
+ ? h('a', { className: 'bn-btn primary', href: memberHref, target: '_blank', rel: 'noreferrer' }, '开通年会员')
2495
+ : h('div', { className: 'bn-sub' }, '暂时打不开购买页,请到「我的授权」重试。'),
2496
+ ),
2497
+ ) : null,
2498
+ ) : null,
2499
+
1292
2500
  tab === 'tasks' ? h('section', { className: 'bn-panel' },
1293
2501
  h('h2', null, '最近任务'),
1294
2502
  tasks.length ? tasks.slice(0, 20).map((t) => h(TaskRow, { key: t.id, task: t })) : h('div', { className: 'bn-sub' }, '暂无任务'),
@@ -1344,7 +2552,7 @@
1344
2552
  : h('div', { className: 'bn-sub' }, Number(state.trialRuns) > 0
1345
2553
  ? '尚未激活正式授权。安装后每个 Agent 可试用 ' + state.trialRuns + ' 次;购买后激活码会发到邮箱。'
1346
2554
  : '尚未激活正式授权。购买后激活码会发到邮箱。'),
1347
- h('div', { className: 'bn-activate' },
2555
+ h('div', { className: 'bn-activate batch' },
1348
2556
  h(BnDropdown, {
1349
2557
  value: productInput,
1350
2558
  onChange: (v) => setProductInput(v),
@@ -1372,8 +2580,25 @@
1372
2580
  return opts;
1373
2581
  })(),
1374
2582
  }),
1375
- h('input', { className: 'bn-input', placeholder: '粘贴激活码 DSHP-…', value: keyInput, onChange: (e) => setKeyInput(e.target.value) }),
1376
- h('button', { className: 'bn-btn primary', disabled: busy, onClick: () => act(async () => { await api('/activate', { method: 'POST', body: { key: keyInput.trim(), product: productInput } }); setKeyInput(''); }, '已激活 ' + productInput) }, '激活'),
2583
+ h('textarea', {
2584
+ className: 'bn-input',
2585
+ rows: 3,
2586
+ placeholder: '每行一个:产品 KEY\n也可以只粘 KEY,用左侧产品激活',
2587
+ value: keyInput,
2588
+ onChange: (e) => setKeyInput(e.target.value),
2589
+ }),
2590
+ h('button', { className: 'bn-btn primary', disabled: busy || !keyInput.trim(), onClick: activateKeys }, '激活'),
2591
+ activateResult ? h('div', { className: 'bn-activate-out' },
2592
+ activateResult.ok.map((p) => h('div', { key: 'ok:' + p, className: 'row' },
2593
+ h('span', { className: 'bn-chip ok' }, '成功'),
2594
+ h('span', null, p),
2595
+ )),
2596
+ activateResult.failed.map((f) => h('div', { key: 'bad:' + f.line, className: 'row' },
2597
+ h('span', { className: 'bn-chip bad' }, '失败'),
2598
+ h('span', { className: 'bn-mono', style: { minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, f.product + ' ' + f.key),
2599
+ h('span', { className: 'bn-sub', style: { margin: 0 } }, f.error),
2600
+ )),
2601
+ ) : null,
1377
2602
  ),
1378
2603
  ),
1379
2604
  h('section', { className: 'bn-panel' },
@@ -1618,44 +2843,56 @@
1618
2843
  ),
1619
2844
  ) : null,
1620
2845
 
1621
- docsOpen && doc ? h('div', { className: 'bn-docs-back bn-layer', popover: 'manual', onClick: () => setDocsOpen(false) },
2846
+ docsOpen ? h('div', { className: 'bn-docs-back bn-layer', popover: 'manual', onClick: () => setDocsOpen(false) },
1622
2847
  h('aside', { className: 'bn-docs', onClick: (event) => event.stopPropagation() },
1623
2848
  h('div', { className: 'bn-docs-bar' },
1624
- h('strong', null, doc.title),
1625
- h('a', { className: 'bn-btn', href: doc.url, target: '_blank', rel: 'noreferrer' }, docOpenLabel(doc.url)),
2849
+ h('strong', null, doc ? doc.title : '使用手册'),
2850
+ doc && doc.url ? h('a', { className: 'bn-btn', href: doc.url, target: '_blank', rel: 'noreferrer' }, docOpenLabel(doc.url)) : null,
1626
2851
  h('button', { type: 'button', className: 'bn-btn ghost', onClick: () => setDocsOpen(false) }, '关闭'),
1627
2852
  ),
1628
- docs.length > 1 ? h('div', { className: 'bn-docs-tabs' },
1629
- docs.map((item) => h('button', {
1630
- key: item.id,
2853
+ h('div', { className: 'bn-docs-tabs' },
2854
+ manualTabs.map((tab) => h('button', {
2855
+ key: tab.key,
1631
2856
  type: 'button',
1632
- className: item.id === doc.id ? 'on' : '',
1633
- onClick: () => { setDocId(item.id); setDocBlocked(false); },
1634
- }, item.title)),
1635
- ) : null,
1636
- h('div', { className: 'bn-docs-frame' },
1637
- h('iframe', {
1638
- key: doc.id,
1639
- title: doc.title,
1640
- src: doc.url,
1641
- onLoad: (event) => {
1642
- const frame = event.target;
1643
- window.setTimeout(() => {
1644
- if (!frame.isConnected) return;
1645
- try {
1646
- const href = frame.contentWindow && frame.contentWindow.location && frame.contentWindow.location.href;
1647
- setDocBlocked(!href || href === 'about:blank');
1648
- } catch {
1649
- setDocBlocked(false);
1650
- }
1651
- }, 700);
1652
- },
1653
- }),
1654
- docBlocked ? h('div', { className: 'bn-docs-miss' },
1655
- h('p', null, '这篇文档不允许嵌在面板里。'),
1656
- h('a', { className: 'bn-btn', href: doc.url, target: '_blank', rel: 'noreferrer' }, docOpenLabel(doc.url)),
1657
- ) : null,
2857
+ className: tab.key === (activeTab ? activeTab.key : '') ? 'on' : '',
2858
+ disabled: !tab.doc,
2859
+ title: tab.doc ? tab.label : '这篇手册还没上架',
2860
+ onClick: () => { if (!tab.doc) return; setDocId(tab.key); setDocBlocked(false); },
2861
+ }, tab.label, tab.doc && tab.doc.locked ? h('i', { className: 'bn-docs-tag' }, tab.doc.access === 'pro' ? '年会员' : '会员') : null)),
1658
2862
  ),
2863
+ doc
2864
+ ? (doc.locked
2865
+ ? h('div', { className: 'bn-docs-lock', key: doc.id },
2866
+ h('b', null, doc.access === 'pro' ? '这篇手册是年会员专属' : '这篇手册是会员专属'),
2867
+ h('p', null, '开通后即可查看完整内容;已购买的用户请先在「我的授权」里激活对应产品。'),
2868
+ h('a', { className: 'bn-btn primary', href: memberHref, target: '_blank', rel: 'noreferrer' }, '去开通'),
2869
+ )
2870
+ : doc.content
2871
+ ? h('div', { className: 'bn-docs-md', key: doc.id }, mdBlocks(doc.content))
2872
+ : h('div', { className: 'bn-docs-frame' },
2873
+ h('iframe', {
2874
+ key: doc.id,
2875
+ title: doc.title,
2876
+ src: doc.url,
2877
+ onLoad: (event) => {
2878
+ const frame = event.target;
2879
+ window.setTimeout(() => {
2880
+ if (!frame.isConnected) return;
2881
+ try {
2882
+ const href = frame.contentWindow && frame.contentWindow.location && frame.contentWindow.location.href;
2883
+ setDocBlocked(!href || href === 'about:blank');
2884
+ } catch {
2885
+ setDocBlocked(false);
2886
+ }
2887
+ }, 700);
2888
+ },
2889
+ }),
2890
+ docBlocked ? h('div', { className: 'bn-docs-miss' },
2891
+ h('p', null, '这篇文档不允许嵌在面板里。'),
2892
+ h('a', { className: 'bn-btn', href: doc.url, target: '_blank', rel: 'noreferrer' }, docOpenLabel(doc.url)),
2893
+ ) : null,
2894
+ ))
2895
+ : h('div', { className: 'bn-docs-empty' }, h('p', null, '这篇手册还没上架。')),
1659
2896
  ),
1660
2897
  ) : null,
1661
2898