chatlab-cli 0.30.2 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/{chat-command-VBDMWOKL.mjs → chat-command-CHV7RLBH.mjs} +9 -8
  2. package/dist/{chat-command-VBDMWOKL.mjs.map → chat-command-CHV7RLBH.mjs.map} +1 -1
  3. package/dist/{chunk-326OCJOT.mjs → chunk-DA5T64RY.mjs} +2 -2
  4. package/dist/{chunk-M2PXDX4G.mjs → chunk-DBBL74RK.mjs} +31 -22
  5. package/dist/chunk-DBBL74RK.mjs.map +1 -0
  6. package/dist/{chunk-KBSAVUFV.mjs → chunk-EXD2SXWL.mjs} +89 -15
  7. package/dist/chunk-EXD2SXWL.mjs.map +1 -0
  8. package/dist/{chunk-D3DPCDII.mjs → chunk-JH5RAJT2.mjs} +83 -34
  9. package/dist/chunk-JH5RAJT2.mjs.map +1 -0
  10. package/dist/{chunk-5EE2EFPE.mjs → chunk-RD335EMA.mjs} +4 -4
  11. package/dist/{chunk-WV5GSRQM.mjs → chunk-RDCUGC24.mjs} +5 -15
  12. package/dist/chunk-RDCUGC24.mjs.map +1 -0
  13. package/dist/{chunk-TEX44HNL.mjs → chunk-SNCXU2QL.mjs} +5 -15
  14. package/dist/chunk-SNCXU2QL.mjs.map +1 -0
  15. package/dist/{chunk-36JGKW6K.mjs → chunk-T64GA5HP.mjs} +1134 -364
  16. package/dist/chunk-T64GA5HP.mjs.map +1 -0
  17. package/dist/{chunk-LVEJHB3X.mjs → chunk-UWWFOEGF.mjs} +494 -97
  18. package/dist/chunk-UWWFOEGF.mjs.map +1 -0
  19. package/dist/{chunk-ULNRUS55.mjs → chunk-WQCY45U2.mjs} +3 -3
  20. package/dist/chunk-YAQLYL52.mjs +14 -0
  21. package/dist/chunk-YAQLYL52.mjs.map +1 -0
  22. package/dist/{chunk-TCZHG3G7.mjs → chunk-YPQ72HMX.mjs} +2 -2
  23. package/dist/cli.mjs +8 -7
  24. package/dist/contacts-worker.mjs +2 -2
  25. package/dist/global-insight-worker.mjs +179 -0
  26. package/dist/global-insight-worker.mjs.map +1 -0
  27. package/dist/{http-L4AMELPZ.mjs → http-3B5ARN7A.mjs} +12 -11
  28. package/dist/{import-WWCSXGVS.mjs → import-2DZGNSEX.mjs} +10 -7
  29. package/dist/index.mjs +12 -11
  30. package/dist/{mcp-A4M3LT5O.mjs → mcp-44I6FUUQ.mjs} +12 -11
  31. package/dist/{mcp-A4M3LT5O.mjs.map → mcp-44I6FUUQ.mjs.map} +1 -1
  32. package/dist/people-relationships-worker.mjs +2 -2
  33. package/dist/semantic-index-worker.mjs +1 -1
  34. package/dist/{src-MPNBTFOE.mjs → src-R3QX6L3L.mjs} +26 -6
  35. package/dist/{stream-import-HIE7PNL4.mjs → stream-import-VUEL2TTU.mjs} +10 -7
  36. package/dist/{worker-runtime-BJXO24XX.mjs → worker-runtime-GJAOIIZW.mjs} +6 -5
  37. package/dist/{worker-runtime-BJXO24XX.mjs.map → worker-runtime-GJAOIIZW.mjs.map} +1 -1
  38. package/dist-web/assets/ActionToolsPanel-fAio70bI.css +1 -0
  39. package/dist-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-CdJT0t2f.js +110 -0
  40. package/dist-web/assets/{BufferResource-q3rzaWWd.js → BufferResource-BPGkshPa.js} +1 -1
  41. package/dist-web/assets/{CanvasRenderer-BRk1y8tp.js → CanvasRenderer-DTKkZhq4.js} +1 -1
  42. package/dist-web/assets/{EChartWordcloud-Clg60FMo.js → EChartWordcloud-DU3ZYdgz.js} +1 -1
  43. package/dist-web/assets/{Filter-BJwode73.js → Filter-CHXKzS2l.js} +1 -1
  44. package/dist-web/assets/{LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js → LoadingState.vue_vue_type_script_setup_true_lang-DACMroOe.js} +1 -1
  45. package/dist-web/assets/MessageExportModal-h-zl0dx1.js +1 -0
  46. package/dist-web/assets/PageHeader-CK0hTsdx.js +1 -0
  47. package/dist-web/assets/PageHeader-XIXMTomn.css +1 -0
  48. package/dist-web/assets/{RelationshipGalaxyCanvas-CORMD7vL.js → RelationshipGalaxyCanvas-Dwdy5flh.js} +3 -3
  49. package/dist-web/assets/{RelationshipGalaxyThreeCanvas-B_w_P4ob.js → RelationshipGalaxyThreeCanvas-CtY4TGen.js} +1 -1
  50. package/dist-web/assets/{RenderTargetSystem-CGhV9R9E.js → RenderTargetSystem-BE56mKRG.js} +1 -1
  51. package/dist-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-BoZyssJF.js +1 -0
  52. package/dist-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-27hMyAUE.js +1 -0
  53. package/dist-web/assets/{WebGLRenderer-CAokTE5X.js → WebGLRenderer-Dm18dxOf.js} +1 -1
  54. package/dist-web/assets/{WebGPURenderer-DzP4ggSy.js → WebGPURenderer-BF6TF-is.js} +1 -1
  55. package/dist-web/assets/annual-summary-time-range-DVLXK1r4.js +1 -0
  56. package/dist-web/assets/base-CFPyD9Gy.js +1 -0
  57. package/dist-web/assets/{browserAll-CAZCK6dd.js → browserAll-Cn_CfkXl.js} +1 -1
  58. package/dist-web/assets/dateFormat-BcqNKTQ1.js +1 -0
  59. package/dist-web/assets/{electron-CkPDbAaS.js → electron-B6xOabTq.js} +1 -1
  60. package/dist-web/assets/electron-hcWiB7Gg.js +1 -0
  61. package/dist-web/assets/fetch-BPkgnY0R.js +1 -0
  62. package/dist-web/assets/{fetch-LX9jrJCC.js → fetch-BRXmDI_2.js} +1 -1
  63. package/dist-web/assets/{fetch-Apd5OLJw.js → fetch-BUm1isWe.js} +1 -1
  64. package/dist-web/assets/{fetch-B8rik0TM.js → fetch-CBOJwwJp.js} +3 -3
  65. package/dist-web/assets/{fetch-wqMSiaK3.js → fetch-CEhUu1Yu.js} +1 -1
  66. package/dist-web/assets/fetch-C_EfVFJi.js +3 -0
  67. package/dist-web/assets/{fetch-DQ9UNNAy.js → fetch-DL_u25Ui.js} +1 -1
  68. package/dist-web/assets/{fetch-BIEXkvDq.js → fetch-DMLq3xPG.js} +1 -1
  69. package/dist-web/assets/{fetch--UbRoBT7.js → fetch-DylpNKCR.js} +1 -1
  70. package/dist-web/assets/fetch-etgwVKIw.js +1 -0
  71. package/dist-web/assets/index-0x1QPzKZ.js +1 -0
  72. package/dist-web/assets/index-B5S9FnfP.js +1 -0
  73. package/dist-web/assets/index-BS6loLHW.js +1 -0
  74. package/dist-web/assets/index-BfO_LpDv.css +1 -0
  75. package/dist-web/assets/index-BrTlAl8b.js +1 -0
  76. package/dist-web/assets/index-ByUaiVQK.css +1 -0
  77. package/dist-web/assets/{index-S-YQRH1E.js → index-C3TnydSt.js} +1 -1
  78. package/dist-web/assets/index-CAWO10k1.js +2 -0
  79. package/dist-web/assets/index-C_0GHEcb.css +1 -0
  80. package/dist-web/assets/index-Chm17wNe.js +2 -0
  81. package/dist-web/assets/index-DAr_2DlV.js +173 -0
  82. package/dist-web/assets/index-Em6upenM.js +64 -0
  83. package/dist-web/assets/index-FoTy2Cce.js +1 -0
  84. package/dist-web/assets/index-YADL4XIp.js +22 -0
  85. package/dist-web/assets/index-ZsZwPLWy.css +1 -0
  86. package/dist-web/assets/index-_6lck7Bv.css +1 -0
  87. package/dist-web/assets/index-aMIgqj43.js +1 -0
  88. package/dist-web/assets/index-y7cxH1Et.css +1 -0
  89. package/dist-web/assets/index-zZVsV5HB.js +1 -0
  90. package/dist-web/assets/{people-page-header-Mupn-U_b.js → people-page-header-BdKM1qhX.js} +1 -1
  91. package/dist-web/assets/types-CZnACqaB.js +1 -0
  92. package/dist-web/assets/{vendor-echarts-hJVnODyU.js → vendor-echarts-B-i_56Av.js} +1 -1
  93. package/dist-web/assets/{vendor-echarts-wordcloud-k5ih2Jl4.js → vendor-echarts-wordcloud-Ca8n6qS6.js} +1 -1
  94. package/dist-web/assets/{vendor-nuxt-ui-DaLxYaC4.js → vendor-nuxt-ui-CS1uxE9C.js} +2 -2
  95. package/dist-web/assets/{vendor-reka-ui-CzM4kDQ7.js → vendor-reka-ui-Cta6JPvN.js} +1 -1
  96. package/dist-web/assets/{web-DbKs6-1b.js → web-BUZ-dZy0.js} +1 -1
  97. package/dist-web/assets/{webworkerAll-Bhv-hBqR.js → webworkerAll-BKGP--A4.js} +1 -1
  98. package/dist-web/index.html +4 -4
  99. package/package.json +1 -1
  100. package/dist/chunk-36JGKW6K.mjs.map +0 -1
  101. package/dist/chunk-D3DPCDII.mjs.map +0 -1
  102. package/dist/chunk-KBSAVUFV.mjs.map +0 -1
  103. package/dist/chunk-LVEJHB3X.mjs.map +0 -1
  104. package/dist/chunk-M2PXDX4G.mjs.map +0 -1
  105. package/dist/chunk-TEX44HNL.mjs.map +0 -1
  106. package/dist/chunk-WV5GSRQM.mjs.map +0 -1
  107. package/dist-web/assets/DebugToolsPanel-D_lFIW6j.css +0 -1
  108. package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-F4n0zNX2.js +0 -110
  109. package/dist-web/assets/MessageExportModal-CGcdMOyw.js +0 -1
  110. package/dist-web/assets/PageHeader-Bbn87QZS.css +0 -1
  111. package/dist-web/assets/PageHeader-CZaqOdBQ.js +0 -1
  112. package/dist-web/assets/electron-D9vE5t3H.js +0 -1
  113. package/dist-web/assets/fetch-1pB-HbYw.js +0 -3
  114. package/dist-web/assets/fetch-CF_3ZqRa.js +0 -1
  115. package/dist-web/assets/fetch-FSNxSnAp.js +0 -1
  116. package/dist-web/assets/index---rXG1hZ.css +0 -1
  117. package/dist-web/assets/index-B01uUoHE.js +0 -1
  118. package/dist-web/assets/index-B4l3rHie.css +0 -1
  119. package/dist-web/assets/index-BSIyyt0z.js +0 -1
  120. package/dist-web/assets/index-Bh8z441f.js +0 -2
  121. package/dist-web/assets/index-C0rya8v4.js +0 -1
  122. package/dist-web/assets/index-C1p9CbmN.css +0 -1
  123. package/dist-web/assets/index-COpza1A4.css +0 -1
  124. package/dist-web/assets/index-CZbZv2fh.js +0 -64
  125. package/dist-web/assets/index-CqUuHQBQ.js +0 -22
  126. package/dist-web/assets/index-CzeTP5MJ.js +0 -173
  127. package/dist-web/assets/index-DgNxTM_8.js +0 -2
  128. package/dist-web/assets/index-DosG7LmJ.css +0 -1
  129. /package/dist/{chunk-326OCJOT.mjs.map → chunk-DA5T64RY.mjs.map} +0 -0
  130. /package/dist/{chunk-5EE2EFPE.mjs.map → chunk-RD335EMA.mjs.map} +0 -0
  131. /package/dist/{chunk-ULNRUS55.mjs.map → chunk-WQCY45U2.mjs.map} +0 -0
  132. /package/dist/{chunk-TCZHG3G7.mjs.map → chunk-YPQ72HMX.mjs.map} +0 -0
  133. /package/dist/{http-L4AMELPZ.mjs.map → http-3B5ARN7A.mjs.map} +0 -0
  134. /package/dist/{import-WWCSXGVS.mjs.map → import-2DZGNSEX.mjs.map} +0 -0
  135. /package/dist/{src-MPNBTFOE.mjs.map → src-R3QX6L3L.mjs.map} +0 -0
  136. /package/dist/{stream-import-HIE7PNL4.mjs.map → stream-import-VUEL2TTU.mjs.map} +0 -0
@@ -1,64 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EChartWordcloud-Clg60FMo.js","assets/vendor-echarts-wordcloud-k5ih2Jl4.js","assets/vendor-echarts-hJVnODyU.js","assets/vendor-zrender-5DcYjSZk.js","assets/vendor-reka-ui-CzM4kDQ7.js","assets/MessageExportModal-CGcdMOyw.js","assets/vendor-nuxt-ui-DaLxYaC4.js","assets/index-CqUuHQBQ.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-B4l3rHie.css"])))=>i.map(i=>d[i]);
2
- import{_ as We}from"./vendor-snapdom-XnBoh1gd.js";import{j as st,f as ge,c as ce,o as ot,_ as Re,p as Oe,n as nt,d as je,i as lt,b as it,k as rt,e as ct,u as ut}from"./vendor-nuxt-ui-DaLxYaC4.js";import{b as S,d as fe,F as Le,p as B,G as o,P as b,Q as J,a5 as t,Z as W,a3 as Z,T as u,O as Ee,J as dt,H as C,a0 as pe,h as w,w as E,m as mt,u as e,K as M,L as x,U as L,R as K,bA as Pe,a9 as qe,bD as vt,au as Ge,E as ht,bE as Ke,n as Me,by as De,i as ze}from"./vendor-reka-ui-CzM4kDQ7.js";import{r as pt,u as X,o as be,T as le,m as Q,H as gt,q as Ye,_ as Ne,J as ft,k as yt,s as xt,t as bt}from"./index-CqUuHQBQ.js";import{f as ae,c as G,v as Je,w as kt,a as ne,x as _t,y as Ve,b as wt,d as Ue,e as $t,u as Ct,g as It,z as St,B as Mt,h as Tt,i as Vt,j as Rt,k as Lt,l as Dt,E as Nt,m as At,n as zt,o as Ut,p as Ft,q as Ht,r as Bt,C as Wt,s as Ot,A as jt,D as Et,t as Pt}from"./DebugToolsPanel.vue_vue_type_script_setup_true_lang-F4n0zNX2.js";import"./vendor-echarts-wordcloud-k5ih2Jl4.js";import{_ as se}from"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import{u as Qe,s as qt,j as Ze,p as Gt,i as Xe,k as et,t as Kt,o as Yt,v as Jt}from"./vendor-echarts-hJVnODyU.js";import{a as Fe}from"./index-S-YQRH1E.js";import"./PageHeader-CZaqOdBQ.js";import"./vendor-zrender-5DcYjSZk.js";function Qt(m,s={}){const{threshold:a=300,containerSelector:n=".overflow-y-auto",scrollLockDuration:r=800}=s,l=S(m[0]?.id||"");let d=!1;const f=S(null);let y=null;function k(){if(d)return;const c=[];m.forEach(p=>{const I=document.getElementById(p.id);if(I){const h=I.getBoundingClientRect();c.push({id:p.id,top:Math.round(h.top)})}});let i=0;for(let p=0;p<c.length;p++){if(c[p].top>a){i=Math.max(0,p-1);break}i=p}l.value=m[i]?.id||""}function g(c){const i=document.getElementById(c);i&&(l.value=c,d=!0,i.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{d=!1,k()},r))}return fe(()=>{y=f.value?.closest(n)||null,y&&(y.addEventListener("scroll",k,{passive:!0}),k())}),Le(()=>{y&&y.removeEventListener("scroll",k)}),{contentRef:f,activeAnchor:l,scrollToAnchor:g,updateActiveAnchor:k}}const Zt={class:"sticky top-24 space-y-6"},Xt={class:"border-l border-gray-200 dark:border-gray-800"},ea=["onClick"],ta=B({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(m,{emit:s}){const a=s;function n(r){a("click",r)}return(r,l)=>(o(),b("div",{class:J([m.width,"shrink-0",m.hideOnMobile?"hidden lg:block":""])},[t("div",Zt,[t("nav",null,[t("div",Xt,[(o(!0),b(W,null,Z(m.anchors,d=>(o(),b("button",{key:d.id,class:J(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[m.activeAnchor===d.id?"border-pink-500 font-medium text-pink-600 dark:text-pink-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]]),onClick:f=>n(d.id)},u(d.label),11,ea))),128))])]),Ee(r.$slots,"default")])],2))}}),re=B({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(m){const s=dt(m,"modelValue"),a=[{label:"Top 5",value:5},{label:"Top 10",value:10},{label:"Top 20",value:20},{label:"Top 30",value:30},{label:"Top 50",value:50},{label:"Top 100",value:100}];return(n,r)=>{const l=st;return o(),C(l,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=d=>s.value=d),items:a,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),de=B({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(m){const s=m,a=w(()=>typeof window>"u"?500:Math.round(window.innerHeight*s.maxHeightVh/100)),n=w(()=>s.contentHeight>a.value),r=w(()=>({maxHeight:`${s.maxHeightVh}vh`,overflowY:n.value?"auto":"hidden"}));return(l,d)=>(o(),b("div",{class:J(m.paddingClass),style:pe(r.value)},[Ee(l.$slots,"default")],6))}}),aa=B({__name:"EChartGraph",props:{data:{},height:{default:400},layout:{default:"circular"},directed:{type:Boolean,default:!1}},setup(m,{expose:s}){Qe([qt,Ze,Gt,Xe]);const a=m,n=w(()=>typeof a.height=="number"?`${a.height}px`:a.height),r=pt(),l=S(null);let d=null;const f=["#ee4567","#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#9a60b4","#fc8452","#3ba272","#ea7ccc","#6e7074","#546570"],y=w(()=>{const v=new Set;return a.data.nodes.filter(_=>v.has(_.name)?!1:(v.add(_.name),!0))}),k=w(()=>{const v=new Map;return y.value.forEach((_,$)=>{v.set(_.name,f[$%f.length])}),v});function g(v,_){return _<=0?1:1+v/_*5}const c=w(()=>{const v=a.data.maxLinkValue||Math.max(...a.data.links.map(_=>_.value||1),1);return{tooltip:{trigger:"item",backgroundColor:r.value?"rgba(30, 30, 30, 0.9)":"rgba(255, 255, 255, 0.95)",borderColor:r.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",textStyle:{color:r.value?"#e5e7eb":"#374151"},formatter:_=>_.dataType==="node"?`<b>${_.data.name}</b><br/>消息数: ${_.data.value||0}`:_.dataType==="edge"?`${_.data.source} → ${_.data.target}<br/>艾特次数: ${_.data.value||0}`:""},animationDuration:1e3,animationDurationUpdate:500,animationEasingUpdate:"quinticInOut",series:[{type:"graph",layout:a.layout,circular:a.layout==="circular"?{rotateLabel:!0}:void 0,force:a.layout==="force"?{repulsion:300,gravity:.1,edgeLength:[80,200],friction:.6}:void 0,roam:!0,scaleLimit:{min:.3,max:3},draggable:!0,label:{show:!0,position:"right",formatter:"{b}",color:r.value?"#e5e7eb":"#374151",fontSize:11,fontWeight:500},edgeSymbol:a.directed?["none","arrow"]:["none","none"],edgeSymbolSize:a.directed?[0,10]:[0,0],lineStyle:{curveness:.3,opacity:.5},emphasis:{focus:"adjacency",label:{show:!0,fontSize:13,fontWeight:600},lineStyle:{width:4,opacity:.9},itemStyle:{shadowBlur:15,shadowColor:"rgba(0, 0, 0, 0.3)"}},data:y.value.map(_=>{const $=k.value.get(_.name)||f[0];return{name:_.name,value:_.value,symbolSize:_.symbolSize||30,label:{show:a.layout==="circular"?!0:(_.symbolSize||30)>30},itemStyle:{color:$,borderColor:"#fff",borderWidth:2,shadowBlur:5,shadowColor:`${$}66`}}}),links:a.data.links.filter(_=>k.value.has(_.source)&&k.value.has(_.target)).map(_=>{const $=k.value.get(_.source)||f[0];return{source:_.source,target:_.target,value:_.value,lineStyle:{color:$,width:g(_.value||1,v)}}})}]}});function i(){l.value&&(d=et(l.value,r.value?"dark":void 0,{renderer:"canvas"}),d.setOption({backgroundColor:"transparent",...c.value}))}function p(){d&&d.setOption({backgroundColor:"transparent",...c.value},{notMerge:!0})}function I(){d?.resize()}function h(){d&&d.dispatchAction({type:"restore"})}return s({resetView:h}),E([()=>a.data,()=>a.layout,()=>a.directed,r],()=>{d?p():i()},{deep:!0}),fe(()=>{i(),window.addEventListener("resize",I)}),Le(()=>{window.removeEventListener("resize",I),d?.dispose()}),(v,_)=>(o(),b("div",{ref_key:"chartRef",ref:l,style:pe({height:n.value,width:"100%"})},null,4))}}),tt=Symbol("ranking-width-mode"),at={standard:{contentClass:"max-w-3xl",gridLeft:110,labelMaxLength:8},wide:{contentClass:"max-w-5xl",gridLeft:180,labelMaxLength:16},full:{contentClass:"max-w-none",gridLeft:260,labelMaxLength:28}};function me(){const m=mt(tt,null);return w(()=>at[m?.value??"standard"])}function ve(m,s){return m.length<=s?m:`${m.slice(0,s)}…`}const sa={class:"px-3 py-2"},ke=B({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=me(),n=w(()=>s.members.slice(0,s.topN)),r=w(()=>{if(s.height!=="auto")return s.height;const f=n.value.length*36;return Math.max(f+30,180)}),l={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},d=w(()=>{const f=[...n.value].reverse(),y=f.map(i=>ve(i.name,a.value.labelMaxLength)),k=f.map(i=>i.value),g=Math.max(...k,1),c=f.map(i=>({value:i.value,itemStyle:{color:l,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:i=>{const p=i[0];if(!p)return"";const I=n.value.length-1-p.dataIndex,h=n.value[I];return`
3
- <div style="padding: 4px 8px;">
4
- <div style="font-weight: bold; margin-bottom: 4px;">${h.name}</div>
5
- <div>${h.value} ${s.unit} (${h.percentage}%)</div>
6
- </div>
7
- `}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(i,p)=>{const h=n.value.length-1-p+1;return`${h===1?"🥇":h===2?"🥈":h===3?"🥉":`${h}.`} ${i}`}}},series:[{type:"bar",data:c,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:i=>{const p=n.value.length-1-i.dataIndex;return`${n.value[p].value} ${s.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(f,y)=>m.bare?(o(),C(e(de),{key:0,"content-height":r.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(ae,{option:d.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},{default:M(()=>[t("div",sa,[x(ae,{option:d.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),oa={class:"divide-y divide-gray-100 dark:divide-gray-800"},na={key:0,class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-sm font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},la={class:"w-32 shrink-0"},ia={class:"wrap-break-word font-medium text-gray-900 dark:text-white"},ra={class:"flex flex-1 items-center"},ca={class:"h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},ua={class:"flex shrink-0 items-baseline gap-2 whitespace-nowrap"},da={class:"text-lg font-bold text-gray-900 dark:text-white"},ma={class:"text-sm text-gray-500"},He=B({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(m){const{t:s}=X(),a=m,n=w(()=>a.unit||s("views.charts.rankList.unit")),r=w(()=>a.rankLimit>0?a.members.slice(0,a.rankLimit):a.members);function l(d){if(r.value.length===0)return 0;const f=r.value[0].value;return f===0?0:Math.round(r.value[d].value/f*100)}return(d,f)=>(o(),b("div",oa,[(o(!0),b(W,null,Z(r.value,(y,k)=>(o(),b("div",{key:y.id,class:"flex items-center gap-3 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("div",{class:J(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-bold",e(Je)(k)])},u(k+1),3),m.showAvatar?(o(),b("div",na,u(y.name.slice(0,1)),1)):L("",!0),t("div",la,[t("p",ia,u(y.name),1)]),t("div",ra,[t("div",ca,[t("div",{class:J(["h-full rounded-full bg-linear-to-r transition-all",e(kt)(k)]),style:pe({width:`${l(k)}%`})},null,6)])]),t("div",ua,[t("span",da,u(y.value),1),t("span",ma,u(n.value)+" ("+u(y.percentage)+"%)",1)])]))),128))]))}}),va={class:"flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-800"},ha={class:"font-semibold text-gray-900 whitespace-nowrap dark:text-white"},pa={key:0,class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},ga={class:"no-capture flex items-center gap-1"},fa={class:"flex w-full items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700"},ya={class:"flex items-center gap-2"},xa={class:"text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"},ba={class:"text-sm text-gray-500"},ka={class:"max-h-[60vh] p-4 overflow-y-auto"},Be=B({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(m){const{t:s}=X(),a=m,n=S(!1),r=S(null),l=S(null),d=w(()=>a.members.slice(0,a.topN)),f=w(()=>a.members.length>a.topN);return(y,k)=>{const g=ce,c=ge;return o(),b("div",{ref_key:"cardRef",ref:r,class:"rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-page-dark"},[t("div",va,[t("div",null,[t("h3",ha,u(m.title),1),m.description?(o(),b("p",pa,u(m.description),1)):L("",!0)]),t("div",ga,[x(Fe,{size:"xs",type:"element","target-element":r.value},null,8,["target-element"]),x(c,{open:n.value,"onUpdate:open":k[0]||(k[0]=i=>n.value=i),ui:{content:"md:w-full max-w-3xl"}},{content:M(()=>[t("div",{ref_key:"modalBodyRef",ref:l,class:"section-content flex flex-col"},[t("div",fa,[t("div",ya,[t("h3",xa,u(m.title),1),t("span",ba," ("+u(e(s)("views.charts.rankListPro.memberCount",{count:m.members.length}))+") ",1)]),x(Fe,{size:"xs",type:"element","target-element":l.value},null,8,["target-element"])]),t("div",ka,[x(He,{members:m.members,unit:m.unit},null,8,["members","unit"])])],512)]),default:M(()=>[f.value?(o(),C(g,{key:0,icon:"i-heroicons-list-bullet",variant:"ghost"},{default:M(()=>[K(u(e(s)("views.charts.rankListPro.fullRanking")),1)]),_:1})):L("",!0)]),_:1},8,["open"])])]),x(He,{members:d.value,unit:m.unit},null,8,["members","unit"])],512)}}}),_a={class:"main-content mx-auto max-w-6xl py-6"},wa={class:"mb-4 flex items-center justify-end gap-4"},$a={class:"text-xs text-gray-500 dark:text-gray-400"},Ca={key:0,class:"grid grid-cols-2 gap-6"},Ia={class:"mb-3 text-center"},Sa={class:"text-base font-semibold text-gray-900 dark:text-white"},Ma={class:"flex flex-wrap gap-2"},Ta=["title","onClick"],Va={class:"text-xs opacity-50"},Ra={key:1,class:"grid grid-cols-2 gap-6"},La={class:"mb-3 text-center"},Da={class:"text-base font-semibold text-gray-900 dark:text-white"},Na={class:"relative w-full",style:{"aspect-ratio":"4 / 3"}},Aa={class:"mt-4 text-center text-xs text-gray-500 dark:text-gray-400"},za=B({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(m){const s=Pe(()=>We(()=>import("./EChartWordcloud-Clg60FMo.js"),__vite__mapDeps([0,1,2,3,4]))),{t:a}=X(),n=be(),r=m,l=S(null),d=S(!1),f=S("list"),y=S(30),k=w(()=>[{label:a("quotes.catchphrase.viewMode.list"),value:"list"},{label:a("quotes.catchphrase.viewMode.wordcloud"),value:"wordcloud"}]),g=[{label:"10",value:10},{label:"30",value:30},{label:"50",value:50},{label:"100",value:100}],c=w(()=>l.value&&l.value.members.length>0),i=w(()=>{if(!l.value)return[];const T=y.value;return console.log("[CatchphraseTab] displayMembers recompute, topN:",T,"type:",typeof T),l.value.members.map(z=>{const D=z.catchphrases.slice(0,T);return console.log("[CatchphraseTab]",z.name,"total:",z.catchphrases.length,"display:",D.length),{...z,catchphrases:D}})}),p=w(()=>i.value.map(T=>({name:T.name,data:{words:T.catchphrases.map(z=>({word:z.content,count:z.count}))}}))),I=[{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-400",badge:"bg-amber-100 dark:bg-amber-800/40 text-amber-600 dark:text-amber-300"},{bg:"bg-slate-50 dark:bg-slate-800/40",text:"text-slate-600 dark:text-slate-300",badge:"bg-slate-100 dark:bg-slate-700/60 text-slate-500 dark:text-slate-400"},{bg:"bg-orange-50 dark:bg-orange-900/15",text:"text-orange-600 dark:text-orange-400",badge:"bg-orange-100 dark:bg-orange-800/30 text-orange-500 dark:text-orange-300"}];function h(T){return T<I.length?I[T]:{bg:"bg-gray-50 dark:bg-gray-800/30",text:"text-gray-600 dark:text-gray-400",badge:"bg-gray-100 dark:bg-gray-700/40 text-gray-500 dark:text-gray-400"}}function v(T,z=20){return T.length<=z?T:T.slice(0,z)+"..."}async function _(){if(r.sessionId){d.value=!0;try{l.value=await Q().getCatchphraseAnalysis(r.sessionId,r.timeFilter),console.log("[CatchphraseTab] API result: members:",l.value?.members.length,"per-member catchphrases:",l.value?.members.map(T=>({name:T.name,count:T.catchphrases.length})))}catch(T){console.error("Failed to load catchphrase analysis:",T)}finally{d.value=!1}}}function $(T){n.openChatRecordDrawer({keywords:[T]})}return E(y,(T,z)=>{console.log("[CatchphraseTab] topN changed:",z,"->",T,"type:",typeof T)}),E(()=>[r.sessionId,r.timeFilter],()=>{_()},{immediate:!0,deep:!0}),(T,z)=>(o(),b("div",_a,[d.value?(o(),C(e(se),{key:0,text:e(a)("quotes.catchphrase.loading")},null,8,["text"])):c.value?(o(),b(W,{key:2},[t("div",wa,[t("span",$a,u(e(a)("quotes.catchphrase.topN")),1),x(e(le),{modelValue:y.value,"onUpdate:modelValue":z[0]||(z[0]=D=>y.value=D),size:"xs",items:g},null,8,["modelValue"]),z[2]||(z[2]=t("div",{class:"h-4 w-px bg-gray-200 dark:bg-gray-700"},null,-1)),x(e(le),{modelValue:f.value,"onUpdate:modelValue":z[1]||(z[1]=D=>f.value=D),size:"xs",items:k.value},null,8,["modelValue","items"])]),f.value==="list"?(o(),b("div",Ca,[(o(!0),b(W,null,Z(i.value,D=>(o(),b("div",{key:D.memberId},[t("div",Ia,[t("span",Sa,u(D.name),1)]),t("div",Ma,[(o(!0),b(W,null,Z(D.catchphrases,(F,U)=>(o(),b("div",{key:U,class:J(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 transition-opacity hover:opacity-75",h(U).bg]),title:F.content,onClick:O=>$(F.content)},[U<3?(o(),b("span",{key:0,class:J(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",h(U).badge])},u(U+1),3)):L("",!0),t("span",{class:J(["text-sm font-medium",h(U).text])},u(v(F.content)),3),t("span",Va,u(e(a)("quotes.catchphrase.times",{count:F.count})),1)],10,Ta))),128))])]))),128))])):(o(),b("div",Ra,[(o(!0),b(W,null,Z(p.value,D=>(o(),b("div",{key:D.name},[t("div",La,[t("span",Da,u(D.name),1)]),t("div",Na,[D.data.words.length===0?(o(),C(e(ne),{key:0,text:e(a)("quotes.catchphrase.empty.title"),class:"h-full"},null,8,["text"])):(o(),C(e(s),{key:1,data:D.data,height:"100%","max-words":y.value,"color-scheme":"default","size-scale":1,loading:d.value,onWordClick:$},null,8,["data","max-words","loading"]))])]))),128))])),t("p",Aa,u(e(a)("quotes.catchphrase.stats.clickHint")),1)],64)):(o(),C(e(ne),{key:1,text:e(a)("quotes.catchphrase.empty.title")},null,8,["text"]))]))}}),Ua={class:"main-content mx-auto max-w-3xl p-6"},Fa={class:"flex items-center gap-3"},Ha={class:"shrink-0 text-lg font-bold text-pink-600"},Ba={class:"flex flex-1 items-center gap-1 overflow-hidden text-sm"},Wa={class:"shrink-0 font-medium text-gray-900 dark:text-white whitespace-nowrap"},Oa=["title"],ja={class:"flex shrink-0 items-center gap-2 text-xs text-gray-500"},Ea=B({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(m){const{t:s}=X(),a=m,n=be(),r=S(null),l=S(!1);async function d(){if(a.sessionId){l.value=!0;try{r.value=await Q().getRepeatAnalysis(a.sessionId,a.timeFilter)}catch(k){console.error("Failed to load repeat analysis:",k)}finally{l.value=!1}}}function f(k,g=30){return k.length<=g?k:k.slice(0,g)+"..."}function y(k){n.openChatRecordDrawer({scrollToMessageId:k.firstMessageId,highlightKeywords:[k.content]})}return E(()=>[a.sessionId,a.timeFilter],()=>{d()},{immediate:!0,deep:!0}),(k,g)=>{const c=ce;return o(),b("div",Ua,[l.value?(o(),C(e(se),{key:0,text:e(s)("quotes.hotRepeat.loading")},null,8,["text"])):r.value&&r.value.hotContents.length>0?(o(),C(e(_t),{key:1,items:r.value.hotContents,title:e(s)("quotes.hotRepeat.title"),description:e(s)("quotes.hotRepeat.description"),"top-n":50,"count-template":e(s)("quotes.hotRepeat.countTemplate")},{item:M(({item:i,index:p})=>[t("div",Fa,[t("span",{class:J(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",e(Je)(p)])},u(p+1),3),t("span",Ha,u(e(s)("quotes.hotRepeat.people",{count:i.maxChainLength})),1),t("div",Ba,[t("span",Wa,u(i.originatorName)+u(e(s)("quotes.hotRepeat.colon")),1),t("span",{class:"truncate text-gray-600 dark:text-gray-400",title:i.content},u(f(i.content)),9,Oa)]),t("div",ja,[t("span",null,u(e(s)("quotes.hotRepeat.times",{count:i.count})),1),g[0]||(g[0]=t("span",{class:"text-gray-300 dark:text-gray-600"},"|",-1)),t("span",null,u(e(Ve)(i.lastTs)),1),x(c,{icon:"i-heroicons-chat-bubble-left-right",color:"neutral",variant:"ghost",size:"xs",title:e(s)("quotes.hotRepeat.viewChat"),onClick:qe(I=>y(i),["stop"])},null,8,["title","onClick"])])])]),_:1},8,["items","title","description","count-template"])):(o(),C(e(G),{key:2,title:e(s)("quotes.hotRepeat.title")},{default:M(()=>[x(e(ne),{text:e(s)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Pa={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},qa={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ga={class:"p-5"},Ka={class:"p-5"},Ya=B({__name:"OverviewTab",props:{session:{},memberActivity:{},topMembers:{},bottomMembers:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(m){const{t:s}=X(),a=m,{dailyChartData:n}=Ct(()=>a.dailyActivity),r=w(()=>({labels:a.messageTypes.map(d=>It(d.type,s)),values:a.messageTypes.map(d=>d.count)})),l=w(()=>{const d=[...a.memberActivity].sort((c,i)=>i.messageCount-c.messageCount),f=d.slice(0,10),y=d.slice(10).reduce((c,i)=>c+i.messageCount,0),k=f.map(c=>c.name),g=f.map(c=>c.messageCount);return y>0&&(k.push(s("analysis.overview.others")),g.push(y)),{labels:k,values:g}});return(d,f)=>(o(),b("div",Pa,[x(wt,{session:m.session,"daily-activity":m.dailyActivity,"message-types":m.messageTypes,"hourly-activity":m.hourlyActivity,"time-range":m.timeRange,"filtered-message-count":m.filteredMessageCount,"filtered-member-count":m.filteredMemberCount,"time-filter":m.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","filtered-message-count","filtered-member-count","time-filter"]),t("div",qa,[x(e(G),{title:e(s)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:M(()=>[t("div",Ga,[x(e(Ue),{data:r.value,height:280},null,8,["data"])])]),_:1},8,["title"]),x(e(G),{title:e(s)("analysis.overview.memberDistribution"),"show-divider":!1},{default:M(()=>[t("div",Ka,[x(e(Ue),{data:l.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),x($t,{"daily-activity":m.dailyActivity,"daily-chart-data":e(n)},null,8,["daily-activity","daily-chart-data"])]))}}),Ja={class:"flex items-center gap-3"},Qa={key:1,class:"py-8 text-center text-sm text-gray-400"},Za=B({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(null),r=S(!1),l=S("activity"),d=S(s.globalTopN??10);E(()=>s.globalTopN,h=>{h!==void 0&&(d.value=h)});async function f(){if(s.sessionId){r.value=!0;try{const h=Q(),[v,_]=await Promise.all([h.getDragonKingAnalysis(s.sessionId,s.timeFilter),h.getCheckInAnalysis(s.sessionId,s.timeFilter)]);a.value=v,n.value=_}catch(h){console.error("加载活跃数据失败:",h)}finally{r.value=!1}}}const y=w(()=>s.memberActivity.map(h=>({id:h.memberId.toString(),name:h.name,value:h.messageCount,percentage:h.percentage}))),k=w(()=>a.value?a.value.rank.map(h=>({id:h.memberId.toString(),name:h.name,value:h.count,percentage:h.percentage})):[]),g=w(()=>n.value?n.value.loyaltyRank.map(h=>({id:h.memberId.toString(),name:h.name,value:h.totalDays,percentage:h.percentage})):[]),c=w(()=>{switch(l.value){case"activity":return y.value;case"dragon":return k.value;case"loyalty":return g.value;default:return y.value}}),i=w(()=>{switch(l.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),p=w(()=>{switch(l.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),I=w(()=>{switch(l.value){case"activity":return"按消息发送数量排名";case"dragon":return`每天发言最多的人+1(共 ${a.value?.totalDays??0} 天)`;case"loyalty":return`累计发言天数排名(共 ${n.value?.totalDays??0} 天)`;default:return""}});return E(()=>[s.sessionId,s.timeFilter],()=>f(),{immediate:!0,deep:!0}),(h,v)=>(o(),C(e(G),{title:p.value,description:I.value},{headerRight:M(()=>[t("div",Ja,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":v[0]||(v[0]=_=>d.value=_)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:l.value,"onUpdate:modelValue":v[1]||(v[1]=_=>l.value=_),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[r.value&&(l.value==="dragon"||l.value==="loyalty")?(o(),C(e(se),{key:0,text:"正在加载数据..."})):(o(),b(W,{key:1},[c.value.length>0?(o(),C(e(ke),{key:0,members:c.value,title:p.value,unit:i.value,"top-n":d.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),b("div",Qa,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),Xa={key:0},es={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},ts={class:"px-3 py-2"},as=B({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=me(),n=w(()=>s.mode==="current"?s.items.filter(g=>g.currentStreak>0).sort((g,c)=>c.currentStreak-g.currentStreak).slice(0,s.topN):s.items.slice(0,s.topN)),r=w(()=>{const g=n.value.length*36;return Math.max(g+30,180)}),l={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},d={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]};function f(g,c){return`${g} ~ ${c}`}function y(g){return s.mode==="current"?g.currentStreak:g.maxStreak}const k=w(()=>{const g=[...n.value].reverse(),c=g.map(h=>ve(h.name,a.value.labelMaxLength)),i=g.map(h=>y(h)),p=Math.max(...i,1),I=g.map(h=>({value:y(h),itemStyle:{color:s.mode==="current"||h.currentStreak>0?d:l,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:h=>{const v=h[0];if(!v)return"";const _=n.value.length-1-v.dataIndex,$=n.value[_];if(s.mode==="current")return`
8
- <div style="padding: 4px 8px;">
9
- <div style="font-weight: bold; margin-bottom: 6px;">${$.name}</div>
10
- <div style="color: #fb923c;">🔥 当前连续 <b>${$.currentStreak}</b> 天</div>
11
- <div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${$.maxStreak} 天</div>
12
- </div>
13
- `;let T=`
14
- <div style="padding: 4px 8px;">
15
- <div style="font-weight: bold; margin-bottom: 6px;">${$.name}</div>
16
- <div style="margin-bottom: 4px;">🔥 最长连续: <b>${$.maxStreak}</b> 天</div>
17
- <div style="font-size: 12px; color: #9ca3af;">${f($.maxStreakStart,$.maxStreakEnd)}</div>
18
- `;return $.currentStreak>0&&(T+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${$.currentStreak} 天</div>`),T+="</div>",T}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:p*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:c,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(h,v)=>{const $=n.value.length-1-v+1;return`${$===1?"🥇":$===2?"🥈":$===3?"🥉":`${$}.`} ${h}`}}},series:[{type:"bar",data:I,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:h=>{const v=n.value.length-1-h.dataIndex,_=n.value[v],$=y(_),T=s.mode==="current"||_.currentStreak>0?" 🔥":"";return`${$} 天${T}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(g,c)=>m.bare?(o(),b("div",Xa,[x(e(de),{"content-height":r.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(e(ae),{option:k.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),m.mode==="max"?(o(),b("div",es,[...c[0]||(c[0]=[vt('<div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"></div><span class="text-xs text-gray-500">当前连续中 🔥</span></div><div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"></div><span class="text-xs text-gray-500">已中断</span></div>',2)])])):L("",!0)])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},Ge({default:M(()=>[t("div",ts,[x(e(ae),{option:k.value,height:r.value},null,8,["option","height"])])]),_:2},[m.mode==="max"?{name:"footer",fn:M(()=>[c[1]||(c[1]=t("div",{class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},[t("div",{class:"flex items-center gap-1.5"},[t("div",{class:"h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"}),t("span",{class:"text-xs text-gray-500"},"当前连续中 🔥")]),t("div",{class:"flex items-center gap-1.5"},[t("div",{class:"h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"}),t("span",{class:"text-xs text-gray-500"},"已中断")])],-1))]),key:"0"}:void 0]),1032,["title","description","max-height-vh"]))}}),ss={class:"px-3 py-2"},os=B({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=w(()=>s.battles.slice(0,s.topN)),n=w(()=>{const f=a.value.length*36;return Math.max(f+30,180)}),r={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function l(f){return`${f.participantCount} 人参战`}const d=w(()=>{const f=[...a.value].reverse(),y=f.map(i=>l(i)),k=f.map(i=>i.totalImages),g=Math.max(...k,1),c=f.map(i=>({value:i.totalImages,itemStyle:{color:r,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},extraCssText:"max-width: 300px;",formatter:i=>{const p=i[0];if(!p)return"";const I=a.value.length-1-p.dataIndex,h=a.value[I],v=h.participants.slice(0,5).map($=>`<span style="color: #d1d5db;">${$.name}</span> <b>${$.imageCount}</b>张`).join("、"),_=h.participants.length>5?`、+${h.participants.length-5}`:"";return`
19
- <div style="padding: 6px 8px;">
20
- <div style="font-weight: bold; margin-bottom: 8px; font-size: 13px;">
21
- ⚔️ ${Ve(h.startTime)}
22
- </div>
23
- <div style="margin-bottom: 6px;">
24
- <span style="color: #9ca3af;">参战人数:</span> <b>${h.participantCount}</b> 人
25
- </div>
26
- <div style="margin-bottom: 8px;">
27
- <span style="color: #9ca3af;">总图片数:</span> <b style="color: #f472b6;">${h.totalImages}</b> 张
28
- </div>
29
- <div style="border-top: 1px solid #374151; padding-top: 6px; font-size: 11px;">
30
- ${v}${_}
31
- </div>
32
- </div>
33
- `}},grid:{left:95,right:125,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:"#4b5563",margin:12,formatter:(i,p)=>{const h=a.value.length-1-p+1;return`${h===1?"🥇":h===2?"🥈":h===3?"🥉":`${h}.`} ${i}`}}},series:[{type:"bar",data:c,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:i=>{const p=a.value.length-1-i.dataIndex,I=a.value[p],h=Ve(I.startTime);return`${I.totalImages} 张 (${h})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(f,y)=>m.bare?(o(),C(e(de),{key:0,"content-height":n.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(e(ae),{option:d.value,height:n.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},{default:M(()=>[t("div",ss,[x(e(ae),{option:d.value,height:n.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ns={class:"px-3 py-2"},ls=B({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=me(),n=w(()=>s.items.slice(0,s.topN)),r=w(()=>{const y=n.value.length*36;return Math.max(y+30,180)}),l={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function d(y){return(y/1e3).toFixed(2)+"s"}const f=w(()=>{if(n.value.length===0)return{};const y=[...n.value].reverse(),k=y.map(i=>ve(i.name,a.value.labelMaxLength)),g=n.value[0].avgTimeDiff,c=y.map(i=>({value:Math.round(g/i.avgTimeDiff*100),itemStyle:{color:l,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:i=>{const p=i[0];if(!p)return"";const I=n.value.length-1-p.dataIndex,h=n.value[I];return`
34
- <div style="padding: 4px 8px;">
35
- <div style="font-weight: bold; margin-bottom: 6px;">${h.name}</div>
36
- <div style="margin-bottom: 4px;">⚡️ 平均反应时间: <b>${d(h.avgTimeDiff)}</b></div>
37
- <div style="font-size: 12px; color: #9ca3af;">参与复读 ${h.count} 次</div>
38
- </div>
39
- `}},grid:{left:a.value.gridLeft,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:105,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:k,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(i,p)=>{const h=n.value.length-1-p+1;return`${h===1?"🥇":h===2?"🥈":h===3?"🥉":`${h}.`} ${i}`}}},series:[{type:"bar",data:c,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:i=>{const p=n.value.length-1-i.dataIndex,I=n.value[p];return`${d(I.avgTimeDiff)} · ${I.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(y,k)=>m.bare?(o(),C(e(de),{key:0,"content-height":r.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(e(ae),{option:f.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},{default:M(()=>[t("div",ns,[x(e(ae),{option:f.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),is={class:"flex items-center gap-3"},rs={class:"px-3 py-2"},cs=B({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(m){const s=m,a=me(),n=S("desc"),r=S(s.globalTopN??10);E(()=>s.globalTopN,i=>{i!==void 0&&(r.value=i)});const l=w(()=>[...s.items].sort((p,I)=>n.value==="desc"?I.daysSinceLastMessage-p.daysSinceLastMessage:p.daysSinceLastMessage-I.daysSinceLastMessage).slice(0,r.value)),d=w(()=>n.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),f=w(()=>n.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),y=w(()=>{const i=l.value.length*36;return Math.max(i+30,180)}),k={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function g(i){return i===0?"今天":i===1?"昨天":`${i} 天前`}const c=w(()=>{if(l.value.length===0)return{};const i=[...l.value].reverse(),p=i.map(v=>ve(v.name,a.value.labelMaxLength)),I=Math.max(...l.value.map(v=>v.daysSinceLastMessage),1),h=i.map(v=>({value:v.daysSinceLastMessage,itemStyle:{color:k,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:v=>{const _=v[0];if(!_)return"";const $=l.value.length-1-_.dataIndex,T=l.value[$];return`
40
- <div style="padding: 4px 8px;">
41
- <div style="font-weight: bold; margin-bottom: 6px;">${T.name}</div>
42
- <div style="margin-bottom: 4px;">🤿 ${g(T.daysSinceLastMessage)}</div>
43
- <div style="font-size: 12px; color: #9ca3af;">最后发言: ${St(T.lastMessageTs)}</div>
44
- </div>
45
- `}},grid:{left:a.value.gridLeft,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:I*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:p,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(v,_)=>{const T=l.value.length-1-_+1;return`${T===1?"🥇":T===2?"🥈":T===3?"🥉":`${T}.`} ${v}`}}},series:[{type:"bar",data:h,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:v=>{const _=l.value.length-1-v.dataIndex,$=l.value[_];return g($.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(i,p)=>(o(),C(e(G),{title:d.value,description:f.value,scrollable:"","max-height-vh":m.maxHeightVh},{headerRight:M(()=>[t("div",is,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=I=>r.value=I)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:n.value,"onUpdate:modelValue":p[1]||(p[1]=I=>n.value=I),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[t("div",rs,[x(e(ae),{option:c.value,height:y.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),us={class:"px-3 py-2"},ds=B({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=me(),n=w(()=>[...s.items].sort((y,k)=>k.maxConsecutiveDays-y.maxConsecutiveDays).slice(0,s.topN)),r=w(()=>{const y=n.value.length*36;return Math.max(y+30,180)}),l={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]},d={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ec4899"},{offset:1,color:"#f472b6"}]},f=w(()=>{if(n.value.length===0)return{};const y=[...n.value].reverse(),k=y.map(c=>ve(c.name,a.value.labelMaxLength)),g=Math.max(...n.value.map(c=>c.maxConsecutiveDays),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:c=>{if(!c||c.length===0)return"";const i=c[0].dataIndex,p=n.value.length-1-i,I=n.value[p];let h=`
46
- <div style="padding: 6px 8px;">
47
- <div style="font-weight: bold; margin-bottom: 6px;">${I.name}</div>
48
- <div>最长连续: <b style="color: #f472b6;">${I.maxConsecutiveDays}</b> 天</div>
49
- `;return I.currentStreak>0&&(h+=`<div style="color: #f97316;">🔥 当前连续 ${I.currentStreak} 天</div>`),h+="</div>",h}},legend:{show:!1},grid:{left:a.value.gridLeft,right:75,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:k,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(c,i)=>{const I=n.value.length-1-i+1;return`${I===1?"🥇":I===2?"🥈":I===3?"🥉":`${I}.`} ${c}`}}},series:[{name:"当前连续",type:"bar",data:y.map(c=>({value:c.currentStreak>0?c.maxConsecutiveDays:0,itemStyle:{color:l,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:c=>{const i=n.value.length-1-c.dataIndex,p=n.value[i];return p.currentStreak>0?`${p.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:y.map(c=>({value:c.currentStreak===0?c.maxConsecutiveDays:0,itemStyle:{color:d,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:c=>{const i=n.value.length-1-c.dataIndex,p=n.value[i];return p.currentStreak===0?`${p.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(y,k)=>m.bare?(o(),C(e(de),{key:0,"content-height":r.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(e(ae),{option:f.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},{default:M(()=>[t("div",us,[x(e(ae),{option:f.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ms={class:"px-3 py-2"},vs=B({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(m){const s=m,a=me(),n=w(()=>s.items.slice(0,s.topN)),r=w(()=>{const f=n.value.length*36;return Math.max(f+50,200)}),l={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"},d=w(()=>{if(n.value.length===0)return{};const f=[...n.value].reverse(),y=f.map(g=>ve(g.name,a.value.labelMaxLength)),k=Math.max(...n.value.map(g=>g.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:g=>{if(!g||g.length===0)return"";const c=g[0].dataIndex,i=n.value.length-1-c,p=n.value[i],I=p.hourlyBreakdown;return`
50
- <div style="padding: 6px 8px;">
51
- <div style="font-weight: bold; margin-bottom: 6px;">${p.name}</div>
52
- <div style="margin-bottom: 4px;">
53
- 称号: <b style="color: #f472b6;">${p.title}</b>
54
- </div>
55
- <div style="margin-bottom: 6px;">总发言: <b>${p.totalNightMessages}</b> 条</div>
56
- <div style="border-top: 1px solid #374151; padding-top: 6px;">
57
- <div><span style="color: ${l.h23};">●</span> 23点: ${I.h23} 条</div>
58
- <div><span style="color: ${l.h0};">●</span> 0点: ${I.h0} 条</div>
59
- <div><span style="color: ${l.h1};">●</span> 1点: ${I.h1} 条</div>
60
- <div><span style="color: ${l.h2};">●</span> 2点: ${I.h2} 条</div>
61
- <div><span style="color: ${l.h3to4};">●</span> 3-4点: ${I.h3to4} 条</div>
62
- </div>
63
- </div>
64
- `}},legend:{show:!0,bottom:0,itemWidth:12,itemHeight:12,textStyle:{color:"#6b7280",fontSize:10}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:35,containLabel:!1},xAxis:{type:"value",max:k*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(g,c)=>{const p=n.value.length-1-c+1;return`${p===1?"🥇":p===2?"🥈":p===3?"🥉":`${p}.`} ${g}`}}},series:[{name:"23点",type:"bar",stack:"total",data:f.map(g=>g.hourlyBreakdown.h23),itemStyle:{color:l.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:f.map(g=>g.hourlyBreakdown.h0),itemStyle:{color:l.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:f.map(g=>g.hourlyBreakdown.h1),itemStyle:{color:l.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:f.map(g=>g.hourlyBreakdown.h2),itemStyle:{color:l.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:f.map(g=>g.hourlyBreakdown.h3to4),itemStyle:{color:l.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:g=>{const c=n.value.length-1-g.dataIndex;return`${n.value[c].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(f,y)=>m.bare?(o(),C(e(de),{key:0,"content-height":r.value,"max-height-vh":m.maxHeightVh},{default:M(()=>[x(e(ae),{option:d.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(G),{key:1,title:m.title,description:m.description,scrollable:"","max-height-vh":m.maxHeightVh},{default:M(()=>[t("div",ms,[x(e(ae),{option:d.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),hs={id:"streak-rank",class:"scroll-mt-24"},ps={class:"flex items-center gap-3"},gs=B({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(!1),r=S("max"),l=S(s.globalTopN??10);E(()=>s.globalTopN,g=>{g!==void 0&&(l.value=g)});const d=w(()=>r.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),f=w(()=>r.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),y=w(()=>a.value?a.value.streakRank.some(g=>g.currentStreak>0):!1);async function k(){if(s.sessionId){n.value=!0;try{a.value=await Q().getCheckInAnalysis(s.sessionId,s.timeFilter)}catch(g){console.error("加载打卡分析失败:",g)}finally{n.value=!1}}}return E(()=>[s.sessionId,s.timeFilter],()=>{k()},{immediate:!0,deep:!0}),(g,c)=>(o(),b("div",hs,[n.value?(o(),C(e(se),{key:0,text:"正在分析数据..."})):a.value&&a.value.streakRank.length>0?(o(),C(e(G),{key:1,title:d.value,description:f.value},{headerRight:M(()=>[t("div",ps,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=i=>l.value=i)},null,8,["modelValue"])):L("",!0),y.value?(o(),C(e(le),{key:1,modelValue:r.value,"onUpdate:modelValue":c[1]||(c[1]=i=>r.value=i),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):L("",!0)])]),default:M(()=>[x(e(as),{items:a.value.streakRank,title:d.value,mode:r.value,"top-n":l.value,bare:""},null,8,["items","title","mode","top-n"])]),_:1},8,["title","description"])):(o(),C(e(G),{key:2,title:"🔥 火花榜"},{default:M(()=>[x(e(ne),{text:"暂无连续发言数据"})]),_:1}))]))}}),fs={class:"flex items-center gap-3"},ys={key:1,class:"py-8 text-center text-sm text-gray-400"},xs={key:1,class:"py-8 text-center text-sm text-gray-400"},bs=B({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(!1),r=S("count"),l=S(s.globalTopN??10);E(()=>s.globalTopN,p=>{p!==void 0&&(l.value=p)});async function d(){if(s.sessionId){n.value=!0;try{a.value=await Q().getMemeBattleAnalysis(s.sessionId,s.timeFilter)}catch(p){console.error("加载斗图分析失败:",p)}finally{n.value=!1}}}const f=w(()=>a.value?a.value.rankByCount.map(p=>({id:p.memberId.toString(),name:p.name,value:p.count,percentage:p.percentage})):[]),y=w(()=>a.value?a.value.rankByImageCount.map(p=>({id:p.memberId.toString(),name:p.name,value:p.count,percentage:p.percentage})):[]),k=w(()=>r.value==="count"?f.value:y.value),g=w(()=>r.value==="count"?"场":"张"),c=w(()=>{switch(r.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),i=w(()=>{switch(r.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return E(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(p,I)=>n.value?(o(),C(e(se),{key:0,text:"正在统计斗图数据..."})):a.value?(o(),C(e(G),{key:1,title:c.value,description:i.value},{headerRight:M(()=>[t("div",fs,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=h=>l.value=h)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:r.value,"onUpdate:modelValue":I[1]||(I[1]=h=>r.value=h),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[r.value==="battle"?(o(),b(W,{key:0},[a.value.topBattles.length>0?(o(),C(e(os),{key:0,battles:a.value.topBattles,title:"","top-n":l.value,bare:""},null,8,["battles","top-n"])):(o(),b("div",ys,"暂无史诗级战役数据"))],64)):(o(),b(W,{key:1},[k.value.length>0?(o(),C(e(ke),{key:0,members:k.value,title:c.value,unit:g.value,"top-n":l.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),b("div",xs,"暂无斗图数据"))],64))]),_:1},8,["title","description"])):L("",!0)}}),ks={class:"space-y-6"},_s={class:"flex items-center gap-3"},ws={class:"flex items-center gap-3"},$s={key:1,class:"px-3 py-2"},Cs=B({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(!1),r=S("originator"),l=S("fastest"),d=S(s.globalTopN??10),f=S(s.globalTopN??10);E(()=>s.globalTopN,$=>{$!==void 0&&(d.value=$,f.value=$)});async function y(){if(s.sessionId){n.value=!0;try{a.value=await Q().getRepeatAnalysis(s.sessionId,s.timeFilter)}catch($){console.error("加载复读分析失败:",$)}finally{n.value=!1}}}const k=w(()=>a.value?a.value.originators.map($=>({id:$.memberId.toString(),name:$.name,value:$.count,percentage:$.percentage})):[]),g=w(()=>a.value?a.value.initiators.map($=>({id:$.memberId.toString(),name:$.name,value:$.count,percentage:$.percentage})):[]),c=w(()=>a.value?a.value.breakers.map($=>({id:$.memberId.toString(),name:$.name,value:$.count,percentage:$.percentage})):[]),i=w(()=>{switch(r.value){case"originator":return k.value;case"initiator":return g.value;case"breaker":return c.value;default:return k.value}}),p=w(()=>{switch(r.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),I=w(()=>{switch(r.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),h=w(()=>{if(!a.value)return{labels:[],values:[]};const $=a.value.chainLengthDistribution;return{labels:$.map(T=>`${T.length}人`),values:$.map(T=>T.count)}}),v=w(()=>l.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),_=w(()=>{if(l.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const $=a.value?.totalRepeatChains??0,T=a.value?.avgChainLength??0;return`共 ${$} 次复读,平均 ${T} 人参与`});return E(()=>[s.sessionId,s.timeFilter],()=>y(),{immediate:!0,deep:!0}),($,T)=>(o(),b("div",ks,[n.value?(o(),C(e(se),{key:0,text:"正在分析复读数据..."})):a.value&&a.value.totalRepeatChains>0?(o(),b(W,{key:1},[x(e(G),{title:p.value,description:I.value},{headerRight:M(()=>[t("div",_s,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":T[0]||(T[0]=z=>d.value=z)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:r.value,"onUpdate:modelValue":T[1]||(T[1]=z=>r.value=z),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[i.value.length>0?(o(),C(e(ke),{key:0,members:i.value,title:p.value,unit:"次","top-n":d.value,bare:""},null,8,["members","title","top-n"])):(o(),C(e(ne),{key:1,text:"暂无数据"}))]),_:1},8,["title","description"]),x(e(G),{title:v.value,description:_.value},{headerRight:M(()=>[t("div",ws,[m.showTopNSelect&&l.value==="fastest"?(o(),C(e(re),{key:0,modelValue:f.value,"onUpdate:modelValue":T[2]||(T[2]=z=>f.value=z)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:l.value,"onUpdate:modelValue":T[3]||(T[3]=z=>l.value=z),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[l.value==="fastest"?(o(),b(W,{key:0},[a.value.fastestRepeaters&&a.value.fastestRepeaters.length>0?(o(),C(e(ls),{key:0,items:a.value.fastestRepeaters,"top-n":f.value,title:"",bare:""},null,8,["items","top-n"])):(o(),C(e(ne),{key:1,text:"暂无最快复读数据"}))],64)):(o(),b("div",$s,[h.value.labels.length>0?(o(),C(e(Mt),{key:0,data:h.value,height:200},null,8,["data"])):(o(),C(e(ne),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(o(),C(e(G),{key:2,title:"🔁 复读榜"},{default:M(()=>[x(e(ne),{text:"该群组暂无复读记录"})]),_:1}))]))}}),Is=B({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(!1);async function r(){if(s.sessionId){n.value=!0;try{a.value=await Q().getDivingAnalysis(s.sessionId,s.timeFilter)}catch(l){console.error("加载潜水分析失败:",l)}finally{n.value=!1}}}return E(()=>[s.sessionId,s.timeFilter],()=>r(),{immediate:!0,deep:!0}),(l,d)=>n.value?(o(),C(e(se),{key:0,text:"正在统计潜水数据..."})):a.value&&a.value.rank.length>0?(o(),C(e(cs),{key:1,items:a.value.rank,"global-top-n":m.globalTopN},null,8,["items","global-top-n"])):L("",!0)}}),Ss={class:"space-y-6"},Ms={class:"flex items-center gap-3"},Ts={key:1,class:"py-8 text-center text-sm text-gray-400"},Vs={key:1,class:"py-8 text-center text-sm text-gray-400"},Rs={class:"flex items-center gap-3"},Ls={key:1,class:"py-8 text-center text-sm text-gray-400"},Ds=B({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(m){const s=m,a=S(null),n=S(!1),r=S("first"),l=S("distribution"),d=S(s.globalTopN??10),f=S(s.globalTopN??10);E(()=>s.globalTopN,v=>{v!==void 0&&(d.value=v,f.value=v)});async function y(){if(s.sessionId){n.value=!0;try{a.value=await Q().getNightOwlAnalysis(s.sessionId,s.timeFilter)}catch(v){console.error("加载出勤分析失败:",v)}finally{n.value=!1}}}const k=w(()=>a.value?a.value.lastSpeakerRank.map(v=>({id:String(v.memberId),name:v.name,value:v.count,percentage:v.percentage})):[]),g=w(()=>a.value?a.value.firstSpeakerRank.map(v=>({id:String(v.memberId),name:v.name,value:v.count,percentage:v.percentage})):[]),c=w(()=>r.value==="last"?k.value:g.value),i=w(()=>r.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),p=w(()=>{const v=a.value?.totalDays??0;return r.value==="last"?`每天最后一个发言的人(共 ${v} 天)`:`每天第一个发言的人(共 ${v} 天)`}),I=w(()=>l.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),h=w(()=>l.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return E(()=>[s.sessionId,s.timeFilter],()=>y(),{immediate:!0,deep:!0}),(v,_)=>(o(),b("div",Ss,[n.value?(o(),C(e(se),{key:0,text:"正在加载出勤分析..."})):a.value?(o(),b(W,{key:1},[x(e(G),{title:I.value,description:h.value},{headerRight:M(()=>[t("div",Ms,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":_[0]||(_[0]=$=>d.value=$)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=$=>l.value=$),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[l.value==="distribution"?(o(),b(W,{key:0},[a.value.nightOwlRank.length>0?(o(),C(e(vs),{key:0,items:a.value.nightOwlRank,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(o(),b("div",Ts,"暂无深夜发言数据"))],64)):(o(),b(W,{key:1},[a.value.consecutiveRecords.length>0?(o(),C(e(ds),{key:0,items:a.value.consecutiveRecords,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(o(),b("div",Vs,"暂无连续记录"))],64))]),_:1},8,["title","description"]),x(e(G),{title:i.value,description:p.value},{headerRight:M(()=>[t("div",Rs,[m.showTopNSelect?(o(),C(e(re),{key:0,modelValue:f.value,"onUpdate:modelValue":_[2]||(_[2]=$=>f.value=$)},null,8,["modelValue"])):L("",!0),x(e(le),{modelValue:r.value,"onUpdate:modelValue":_[3]||(_[3]=$=>r.value=$),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:M(()=>[c.value.length>0?(o(),C(e(ke),{key:0,members:c.value,title:i.value,"top-n":f.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(o(),b("div",Ls,"暂无数据"))]),_:1},8,["title","description"])],64)):L("",!0)]))}}),Ns={class:"mb-8 mt-4"},As={class:"text-5xl tracking-wider",style:{"font-weight":"800",background:"linear-gradient(to right, #f59e0b, #ec4899, #9333ea)","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},zs={id:"activity-rank",class:"scroll-mt-24"},Us={id:"meme-battle",class:"scroll-mt-24"},Fs={id:"repeat",class:"scroll-mt-24"},Hs={id:"night-owl",class:"scroll-mt-24"},Bs={id:"diving",class:"scroll-mt-24"},Ws={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},Os={class:"mt-4 border-l border-gray-200 pl-4 dark:border-gray-800"},js={class:"flex rounded-lg border border-gray-200 bg-white p-0.5 text-xs dark:border-gray-700 dark:bg-page-dark"},Es=["onClick"],Ps=B({__name:"RankingView",props:{sessionId:{},timeFilter:{}},setup(m){const s=m,a=S([]),n=S([]);async function r(){if(!s.sessionId)return;const h=Q(),[v,_]=await Promise.all([h.getMemberActivity(s.sessionId,s.timeFilter),h.getAvailableYears(s.sessionId)]);a.value=v,n.value=_}E(()=>[s.sessionId,s.timeFilter],()=>r(),{immediate:!0,deep:!0});const l=w(()=>{if(s.timeFilter?.startTs&&s.timeFilter?.endTs){const h=new Date(s.timeFilter.startTs*1e3).getFullYear(),v=new Date(s.timeFilter.endTs*1e3).getFullYear();return h===v?`${h} 赛季`:`${h}-${v} 赛季`}if(n.value.length>0){const h=[...n.value].sort(($,T)=>$-T),v=h[0],_=h[h.length-1];return v===_?`${v} 赛季`:`${v}-${_} 赛季`}return"全部赛季"}),d=w(()=>({startTs:s.timeFilter?.startTs,endTs:s.timeFilter?.endTs})),f=[{id:"activity-rank",label:"🏆 活跃榜"},{id:"streak-rank",label:"🔥 火花榜"},{id:"meme-battle",label:"⚔️ 斗图榜"},{id:"repeat",label:"🔁 复读榜"},{id:"night-owl",label:"⏰ 出勤榜"},{id:"diving",label:"🤿 潜水榜"}],{contentRef:y,activeAnchor:k,scrollToAnchor:g}=Qt(f,{threshold:350}),c=S(10),i=S("standard");ht(tt,i);const p=[{value:"standard",label:"标准"},{value:"wide",label:"宽屏"},{value:"full",label:"全宽"}],I=w(()=>at[i.value].contentClass);return(h,v)=>(o(),b("div",{ref_key:"contentRef",ref:y,class:"flex gap-6 p-6"},[t("div",{class:J(["main-content min-w-0 flex-1 px-8 mx-auto space-y-6",I.value])},[t("div",Ns,[t("h1",As," 🏆 "+u(l.value),1),v[1]||(v[1]=t("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),t("div",zs,[x(e(Za),{"session-id":s.sessionId,"member-activity":a.value,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","member-activity","time-filter","global-top-n"])]),x(e(gs),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","time-filter","global-top-n"]),t("div",Us,[x(e(bs),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","time-filter","global-top-n"])]),t("div",Fs,[x(e(Cs),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","time-filter","global-top-n"])]),t("div",Hs,[x(e(Ds),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","time-filter","global-top-n"])]),t("div",Bs,[x(e(Is),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":c.value},null,8,["session-id","time-filter","global-top-n"])]),v[2]||(v[2]=t("div",{class:"h-48 no-capture"},null,-1))],2),x(e(ta),{anchors:f,"active-anchor":e(k),onClick:e(g)},{default:M(()=>[t("div",Ws,[v[3]||(v[3]=t("div",{class:"text-xs text-gray-400 mb-2"},"显示数量",-1)),x(e(re),{modelValue:c.value,"onUpdate:modelValue":v[0]||(v[0]=_=>c.value=_)},null,8,["modelValue"])]),t("div",Os,[v[4]||(v[4]=t("div",{class:"mb-2 text-xs text-gray-400"},"榜单宽度",-1)),t("div",js,[(o(),b(W,null,Z(p,_=>t("button",{key:_.value,type:"button",class:J(["rounded-md px-2 py-1 transition",i.value===_.value?"bg-pink-500 text-white shadow-sm":"text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"]),onClick:$=>i.value=_.value},u(_.label),11,Es)),64))])])]),_:1},8,["active-anchor","onClick"])],512))}}),qs={class:"flex h-full flex-col"},Gs={class:"flex items-center justify-end px-4 py-2"},Ks={class:"flex items-center gap-4"},Ys={class:"flex items-center gap-2"},Js={class:"text-xs text-gray-400"},Qs={class:"flex items-center gap-2"},Zs={class:"text-xs text-gray-400"},Xs={class:"flex-1 min-h-0 relative"},eo={key:0,class:"absolute inset-0 flex items-center justify-center"},to={key:0,class:"h-full"},ao={class:"absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-gray-100/80 px-3 py-1 text-xs text-gray-500 backdrop-blur-sm dark:bg-gray-800/80 dark:text-gray-400"},so={key:1,class:"flex h-full items-center justify-center text-gray-400"},oo={class:"text-center"},no={class:"mt-2 text-sm"},lo=B({__name:"InteractionView",props:{sessionId:{},timeFilter:{}},setup(m){const s=m,{t:a}=X(),n=S(!0),r=S({nodes:[],links:[],maxLinkValue:0}),l=S("circular"),d=S(!1),f=S(null);function y(){f.value?.resetView()}async function k(){if(s.sessionId){n.value=!0;try{const g=await Q().getMentionGraph(s.sessionId,s.timeFilter);r.value={nodes:g.nodes,links:g.links,maxLinkValue:g.maxLinkValue}}catch(g){console.error("[chart-interaction] 加载互动关系图数据失败:",g)}finally{n.value=!1}}}return E(()=>[s.sessionId,s.timeFilter],()=>{k()},{immediate:!0,deep:!0}),(g,c)=>{const i=ce,p=Ke("UButtonGroup"),I=ot,h=Re;return o(),b("div",qs,[t("div",Gs,[t("div",Ks,[t("div",Ys,[t("span",Js,u(e(a)("views.interaction.layout"))+":",1),x(p,{size:"xs"},{default:M(()=>[x(i,{color:l.value==="circular"?"primary":"neutral",variant:l.value==="circular"?"solid":"ghost",onClick:c[0]||(c[0]=v=>l.value="circular")},{default:M(()=>[K(u(e(a)("views.interaction.circular")),1)]),_:1},8,["color","variant"]),x(i,{color:l.value==="force"?"primary":"neutral",variant:l.value==="force"?"solid":"ghost",onClick:c[1]||(c[1]=v=>l.value="force")},{default:M(()=>[K(u(e(a)("views.interaction.force")),1)]),_:1},8,["color","variant"])]),_:1})]),t("div",Qs,[t("span",Zs,u(e(a)("views.interaction.directed"))+":",1),x(I,{modelValue:d.value,"onUpdate:modelValue":c[2]||(c[2]=v=>d.value=v),size:"xs"},null,8,["modelValue"])]),x(i,{size:"xs",color:"neutral",variant:"ghost",icon:"i-heroicons-arrow-path",onClick:y},{default:M(()=>[K(u(e(a)("views.interaction.reset")),1)]),_:1})])]),t("div",Xs,[n.value?(o(),b("div",eo,[x(h,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):(o(),b(W,{key:1},[r.value.nodes.length>0?(o(),b("div",to,[x(e(aa),{ref_key:"graphRef",ref:f,data:r.value,layout:l.value,directed:d.value,height:"100%"},null,8,["data","layout","directed"]),t("div",ao,u(e(a)("views.interaction.graphHint",{nodes:r.value.nodes.length,links:r.value.links.length})),1)])):(o(),b("div",so,[t("div",oo,[x(h,{name:"i-heroicons-user-group",class:"mx-auto h-10 w-10 text-gray-300 dark:text-gray-600"}),t("p",no,u(e(a)("views.interaction.noInteraction")),1)])]))],64))])])}}}),io={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},ro={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},co={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},uo={class:"divide-y divide-gray-100 dark:divide-gray-800"},mo={class:"flex flex-1 items-center gap-2"},vo=["onClick"],ho={class:"flex items-center gap-1 text-pink-500"},po={class:"text-xs"},go=["onClick"],fo={class:"shrink-0 text-right text-sm text-gray-500"},yo={key:0,class:"text-red-500"},xo={key:1},bo={class:"divide-y divide-gray-100 dark:divide-gray-800"},ko={class:"flex flex-1 items-center gap-2"},_o=["onClick"],wo={class:"flex items-center gap-1"},$o={class:"text-xs text-gray-400"},Co={class:"text-xs text-gray-400"},Io=["onClick"],So={class:"shrink-0 text-right"},Mo={class:"text-lg font-bold text-pink-600"},To={class:"ml-1 text-sm text-gray-500"},Vo={key:0,class:"p-5"},Ro={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},Lo={key:0,class:"mb-4"},Do={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},No={class:"space-y-2"},Ao={class:"text-sm font-medium text-gray-900 dark:text-white"},zo={class:"text-xs text-gray-500"},Uo={key:1},Fo={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},Ho={class:"space-y-2"},Bo={class:"text-sm font-medium text-gray-900 dark:text-white"},Wo={class:"text-xs text-gray-500"},Oo={class:"mt-4 flex justify-end"},jo=B({__name:"Relationships",props:{sessionId:{},timeFilter:{}},setup(m){const{t:s}=X(),a=m,n=S(null),r=S(!1),l=S(null),d=S(!1);async function f(){if(a.sessionId){r.value=!0;try{n.value=await Q().getMentionAnalysis(a.sessionId,a.timeFilter)}catch(c){console.error("加载 @ 互动分析失败:",c)}finally{r.value=!1}}}const y=w(()=>n.value?n.value.topMentioners.map(c=>({id:c.memberId.toString(),name:c.name,value:c.count,percentage:c.percentage})):[]),k=w(()=>n.value?n.value.topMentioned.map(c=>({id:c.memberId.toString(),name:c.name,value:c.count,percentage:c.percentage})):[]);function g(c){if(!n.value)return;const i=n.value.memberDetails.find(p=>p.memberId===c);i&&(l.value=i,d.value=!0)}return E(()=>[a.sessionId,a.timeFilter],()=>{f()},{immediate:!0,deep:!0}),(c,i)=>{const p=Oe,I=ce,h=ge;return o(),b("div",io,[r.value?(o(),C(e(se),{key:0,text:e(s)("members.relationships.loading")},null,8,["text"])):n.value&&n.value.totalMentions>0?(o(),b(W,{key:1},[t("div",ro,[y.value.length>0?(o(),C(e(Be),{key:0,members:y.value,title:e(s)("members.relationships.topMentioners"),description:e(s)("members.relationships.totalMentions",{count:n.value.totalMentions}),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):L("",!0),k.value.length>0?(o(),C(e(Be),{key:1,members:k.value,title:e(s)("members.relationships.topMentioned"),description:e(s)("members.relationships.popularMember"),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):L("",!0)]),t("div",co,[n.value.oneWay.length>0?(o(),C(e(G),{key:0,class:"hidden",title:e(s)("members.relationships.oneWay.title"),description:e(s)("members.relationships.oneWay.description",{count:n.value.oneWay.length})},{default:M(()=>[t("div",uo,[(o(!0),b(W,null,Z(n.value.oneWay.slice(0,10),(v,_)=>(o(),b("div",{key:_,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("span",{class:J(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",_===0?"bg-pink-100 text-pink-600 dark:bg-pink-900/30 dark:text-pink-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(_+1),3),t("div",mo,[t("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:$=>g(v.fromMemberId)},u(v.fromName),9,vo),t("div",ho,[i[2]||(i[2]=t("span",{class:"text-lg"},"→",-1)),t("span",po,u(v.fromToCount)+"次",1)]),t("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:$=>g(v.toMemberId)},u(v.toName),9,go)]),t("div",fo,[v.toFromCount===0?(o(),b("span",yo,u(e(s)("members.relationships.oneWay.neverRespond")),1)):(o(),b("span",xo,u(e(s)("members.relationships.oneWay.reverse",{count:v.toFromCount})),1))]),x(p,{color:"pink",variant:"soft",size:"xs"},{default:M(()=>[K(u(e(s)("members.relationships.oneWay.ratio",{value:Math.round(v.ratio*100)})),1)]),_:2},1024)]))),128))])]),_:1},8,["title","description"])):L("",!0),n.value.twoWay.length>0?(o(),C(e(G),{key:1,title:e(s)("members.relationships.twoWay.title"),description:e(s)("members.relationships.twoWay.description",{count:n.value.twoWay.length})},{default:M(()=>[t("div",bo,[(o(!0),b(W,null,Z(n.value.twoWay.slice(0,10),(v,_)=>(o(),b("div",{key:_,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("span",{class:J(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",_===0?"bg-linear-to-r from-pink-400 to-red-400 text-white":_===1?"bg-linear-to-r from-pink-300 to-red-300 text-white":_===2?"bg-linear-to-r from-pink-200 to-red-200 text-pink-700":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(_+1),3),t("div",ko,[t("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:$=>g(v.member1Id)},u(v.member1Name),9,_o),t("div",wo,[t("span",$o,u(v.member1To2),1),i[3]||(i[3]=t("span",{class:"text-lg text-pink-500"},"⇄",-1)),t("span",Co,u(v.member2To1),1)]),t("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:$=>g(v.member2Id)},u(v.member2Name),9,Io)]),t("div",So,[t("span",Mo,u(v.total),1),t("span",To,u(e(s)("members.relationships.twoWay.interactions")),1)]),x(p,{color:v.balance>=.7?"green":v.balance>=.5?"blue":"gray",variant:"soft",size:"xs"},{default:M(()=>[K(u(e(s)("members.relationships.twoWay.balance",{value:Math.round(v.balance*100)})),1)]),_:2},1032,["color"])]))),128))])]),_:1},8,["title","description"])):L("",!0)])],64)):r.value?L("",!0):(o(),C(e(G),{key:2,title:e(s)("members.relationships.emptyTitle")},{default:M(()=>[x(e(ne),{text:e(s)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"])),x(h,{open:d.value,"onUpdate:open":i[1]||(i[1]=v=>d.value=v)},{content:M(()=>[l.value?(o(),b("div",Vo,[t("h3",Ro,u(e(s)("members.relationships.modal.title",{name:l.value.name})),1),l.value.topMentioned.length>0?(o(),b("div",Lo,[t("h4",Do,u(e(s)("members.relationships.modal.topMentioned")),1),t("div",No,[(o(!0),b(W,null,Z(l.value.topMentioned,(v,_)=>(o(),b("div",{key:_,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[t("span",Ao,u(v.toName),1),t("span",zo,u(e(s)("members.relationships.modal.timesCount",{count:v.count})),1)]))),128))])])):L("",!0),l.value.topMentioners.length>0?(o(),b("div",Uo,[t("h4",Fo,u(e(s)("members.relationships.modal.topMentioners")),1),t("div",Ho,[(o(!0),b(W,null,Z(l.value.topMentioners,(v,_)=>(o(),b("div",{key:_,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[t("span",Bo,u(v.fromName),1),t("span",Wo,u(e(s)("members.relationships.modal.timesCount",{count:v.count})),1)]))),128))])])):L("",!0),t("div",Oo,[x(I,{variant:"soft",onClick:i[0]||(i[0]=v=>d.value=!1)},{default:M(()=>[K(u(e(s)("members.relationships.modal.close")),1)]),_:1})])])):L("",!0)]),_:1},8,["open"])])}}}),Eo={class:"mx-auto max-w-[920px] p-4 h-full"},Po={class:"flex h-full flex-col rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-page-dark shadow-sm overflow-hidden"},qo={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-page-dark/50"},Go={class:"flex items-center gap-3"},Ko={class:"flex items-center gap-3"},Yo={class:"p-3 w-64"},Jo={class:"text-sm font-medium mb-3"},Qo={class:"space-y-3"},Zo={class:"text-xs text-gray-500 mb-1 block"},Xo={class:"text-xs text-gray-400 mt-1"},en={class:"text-xs text-gray-500 mb-1 block"},tn={class:"text-xs text-gray-400 mt-1"},an={class:"flex-1 min-h-0 overflow-hidden"},sn={key:0,class:"h-full flex items-center justify-center"},on={key:1,class:"h-full flex items-center justify-center"},nn={class:"text-center text-gray-400"},ln={key:2,class:"h-full"},rn={key:3,class:"h-full flex overflow-hidden"},cn={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},un={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},dn={class:"text-sm font-medium flex items-center gap-2"},mn={class:"flex-1 overflow-y-auto"},vn=["onClick"],hn={class:"flex items-center justify-between"},pn={class:"text-sm truncate"},gn={class:"text-xs text-gray-400"},fn={class:"flex-1 overflow-hidden flex flex-col"},yn={key:0,class:"flex-1 flex items-center justify-center"},xn={class:"text-center text-gray-400"},bn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},kn={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},_n={class:"font-medium"},wn={class:"text-xs text-gray-400"},$n={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Cn={class:"text-sm font-medium flex items-center gap-2"},In={class:"flex-1 overflow-y-auto"},Sn={key:0,class:"p-4 text-center text-gray-400"},Mn={class:"flex items-center gap-3"},Tn={class:"flex-1 min-w-0"},Vn={class:"text-sm font-medium truncate"},Rn={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},Ln={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Dn={key:4,class:"h-full flex flex-col overflow-hidden"},Nn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},An={class:"text-sm font-medium flex items-center gap-2"},zn={class:"flex-1 overflow-y-auto"},Un={class:"flex items-center gap-3"},Fn={class:"flex-1 min-w-0"},Hn={class:"flex items-center gap-2 text-sm"},Bn={class:"font-medium truncate"},Wn={class:"font-medium truncate"},On={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},jn={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},En={key:0,class:"px-4 py-2 border-t border-gray-200 dark:border-gray-700 text-xs text-gray-400 flex items-center gap-4 bg-gray-50 dark:bg-page-dark/50"},Pn=B({__name:"ClusterView",props:{sessionId:{},timeFilter:{}},setup(m){Qe([Kt,Ze,Yt,Jt,Xe]);const s=m,{t:a}=X(),n=gt(),r=w(()=>n.value==="dark"),l=S(!0),d=S(null),f=S("matrix"),y=S(null),k=S({lookAhead:3,decaySeconds:120,topEdges:150}),g=S(null);let c=null;async function i(){if(s.sessionId){l.value=!0;try{d.value=await Q().getClusterGraph(s.sessionId,s.timeFilter,{lookAhead:k.value.lookAhead,decaySeconds:k.value.decaySeconds,topEdges:k.value.topEdges})}catch(F){console.error("[chart-cluster] 加载小团体关系数据失败:",F),d.value=null}finally{l.value=!1}}}const p=w(()=>{if(!d.value||d.value.nodes.length===0)return null;const{nodes:F,links:U,maxLinkValue:O}=d.value,j=[...F].sort((V,Y)=>Y.messageCount-V.messageCount).slice(0,20).map(V=>V.name),te=new Map;for(const V of U)te.set(`${V.source}-${V.target}`,V.value),te.set(`${V.target}-${V.source}`,V.value);const q=[];for(let V=0;V<j.length;V++)for(let Y=0;Y<j.length;Y++)if(V===Y)q.push([V,Y,-1]);else{const ue=te.get(`${j[V]}-${j[Y]}`)||0;q.push([V,Y,ue])}return{names:j,data:q,maxValue:O}});function I(){if(!p.value)return{graphic:{type:"text",style:{text:a("views.cluster.noData"),fill:"#999"}}};const{names:F,data:U,maxValue:O}=p.value;return{tooltip:{position:"top",formatter:ee=>{const[j,te,q]=ee.data;return q<0?`${F[j]}`:q===0?`${F[j]} ↔ ${F[te]}<br/>暂无关系数据`:`${F[j]} ↔ ${F[te]}<br/>临近度: ${q.toFixed(2)}`}},grid:{left:120,right:40,top:40,bottom:120},xAxis:{type:"category",data:F,splitArea:{show:!0},axisLabel:{rotate:45,fontSize:10,color:r.value?"#ccc":"#333"}},yAxis:{type:"category",data:F,splitArea:{show:!0},axisLabel:{fontSize:10,color:r.value?"#ccc":"#333"}},visualMap:{min:0,max:O||1,calculable:!0,orient:"horizontal",left:"center",bottom:10,inRange:{color:r.value?["#1a1a2e","#16213e","#0f3460","#e94560"]:["#f7f7f7","#fce4ec","#f8bbd9","#ee4567"]},textStyle:{color:r.value?"#ccc":"#333"}},series:[{type:"heatmap",data:U.filter(ee=>ee[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const h=w(()=>d.value?[...d.value.nodes].sort((F,U)=>U.messageCount-F.messageCount):[]),v=w(()=>!d.value||y.value===null?null:d.value.nodes.find(F=>F.id===y.value)||null),_=w(()=>{if(!d.value||!v.value)return[];const F=v.value.name,U=[];for(const O of d.value.links)O.source===F?U.push({otherName:O.target,value:O.value,coOccurrenceCount:O.coOccurrenceCount}):O.target===F&&U.push({otherName:O.source,value:O.value,coOccurrenceCount:O.coOccurrenceCount});return U.sort((O,ee)=>ee.value-O.value),U}),$=w(()=>d.value?d.value.links.slice(0,50):[]);function T(){c&&f.value==="matrix"&&c.setOption(I(),{notMerge:!0})}function z(){g.value&&(c=et(g.value,r.value?"dark":void 0),T())}function D(){c?.resize()}return E(f,async(F,U)=>{U==="matrix"&&c&&(c.dispose(),c=null),F==="matrix"&&(await Me(),z())}),E([d,()=>r.value],()=>{f.value==="matrix"&&T()},{deep:!0}),E(l,async(F,U)=>{U&&!F&&f.value==="matrix"&&(c&&(c.dispose(),c=null),await Me(),z())}),E(()=>[s.sessionId,s.timeFilter],()=>i(),{immediate:!0,deep:!0}),fe(()=>{window.addEventListener("resize",D),f.value==="matrix"&&Me(()=>z())}),Le(()=>{window.removeEventListener("resize",D),c?.dispose(),c=null}),(F,U)=>{const O=ce,ee=Ke("UButtonGroup"),j=je,te=nt,q=Re;return o(),b("div",Eo,[t("div",Po,[t("div",qo,[t("div",Go,[x(ee,{size:"xs"},{default:M(()=>[x(O,{color:f.value==="matrix"?"primary":"neutral",variant:f.value==="matrix"?"solid":"ghost",onClick:U[0]||(U[0]=V=>f.value="matrix")},{default:M(()=>[K(u(e(a)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),x(O,{color:f.value==="member"?"primary":"neutral",variant:f.value==="member"?"solid":"ghost",onClick:U[1]||(U[1]=V=>f.value="member")},{default:M(()=>[K(u(e(a)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),x(O,{color:f.value==="circle"?"primary":"neutral",variant:f.value==="circle"?"solid":"ghost",onClick:U[2]||(U[2]=V=>f.value="circle")},{default:M(()=>[K(u(e(a)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])]),_:1})]),t("div",Ko,[x(te,null,{content:M(()=>[t("div",Yo,[t("h4",Jo,u(e(a)("views.cluster.modelSettings")),1),t("div",Qo,[t("div",null,[t("label",Zo,u(e(a)("views.cluster.lookAhead")),1),x(j,{modelValue:k.value.lookAhead,"onUpdate:modelValue":U[3]||(U[3]=V=>k.value.lookAhead=V),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),t("p",Xo,u(e(a)("views.cluster.lookAheadDesc")),1)]),t("div",null,[t("label",en,u(e(a)("views.cluster.decaySeconds")),1),x(j,{modelValue:k.value.decaySeconds,"onUpdate:modelValue":U[4]||(U[4]=V=>k.value.decaySeconds=V),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),t("p",tn,u(e(a)("views.cluster.decaySecondsDesc")),1)]),x(O,{size:"xs",color:"primary",class:"w-full mt-2",onClick:i},{default:M(()=>[K(u(e(a)("views.cluster.applySettings")),1)]),_:1})])])]),default:M(()=>[x(O,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),x(O,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:i})])]),t("div",an,[l.value?(o(),b("div",sn,[x(q,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!d.value||d.value.nodes.length===0?(o(),b("div",on,[t("div",nn,[x(q,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),t("p",null,u(e(a)("views.cluster.noData")),1)])])):f.value==="matrix"?(o(),b("div",ln,[t("div",{ref_key:"chartRef",ref:g,class:"w-full h-full"},null,512)])):f.value==="member"?(o(),b("div",rn,[t("div",cn,[t("div",un,[t("h3",dn,[x(q,{name:"i-heroicons-users",class:"w-4 h-4"}),K(" "+u(e(a)("views.cluster.selectMember")),1)])]),t("div",mn,[(o(!0),b(W,null,Z(h.value,V=>(o(),b("div",{key:V.id,class:J(["px-4 py-2 cursor-pointer border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",{"bg-primary-50 dark:bg-primary-900/30":y.value===V.id}]),onClick:Y=>y.value=V.id},[t("div",hn,[t("span",pn,u(V.name),1),t("span",gn,u(V.messageCount),1)])],10,vn))),128))])]),t("div",fn,[v.value?(o(),b(W,{key:1},[t("div",bn,[t("div",kn,u(v.value.name.charAt(0)),1),t("div",null,[t("div",_n,u(v.value.name),1),t("div",wn,u(e(a)("views.cluster.msgCount"))+": "+u(v.value.messageCount)+" | "+u(e(a)("views.cluster.relationCount"))+": "+u(_.value.length),1)])]),t("div",$n,[t("h3",Cn,[x(q,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),K(" "+u(e(a)("views.cluster.relationsByIntimacy")),1)])]),t("div",In,[_.value.length===0?(o(),b("div",Sn,u(e(a)("views.cluster.noRelations")),1)):L("",!0),(o(!0),b(W,null,Z(_.value,(V,Y)=>(o(),b("div",{key:V.otherName,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("div",Mn,[t("span",{class:J(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),t("div",Tn,[t("div",Vn,u(V.otherName),1),t("div",Rn,[t("span",null,u(e(a)("views.cluster.intimacy"))+": "+u((V.value*100).toFixed(0))+"%",1),t("span",null,u(e(a)("views.cluster.coOccurrence"))+": "+u(V.coOccurrenceCount)+u(e(a)("views.cluster.times")),1)])]),t("div",Ln,[t("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:pe({width:`${_.value[0]?.value?V.value/_.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(o(),b("div",yn,[t("div",xn,[x(q,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),t("p",null,u(e(a)("views.cluster.selectMemberHint")),1)])]))])])):(o(),b("div",Dn,[t("div",Nn,[t("h3",An,[x(q,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),K(" "+u(e(a)("views.cluster.interactionRanking")),1)])]),t("div",zn,[(o(!0),b(W,null,Z($.value,(V,Y)=>(o(),b("div",{key:Y,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("div",Un,[t("span",{class:J(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),t("div",Fn,[t("div",Hn,[t("span",Bn,u(V.source),1),U[5]||(U[5]=t("span",{class:"text-gray-400"},"↔",-1)),t("span",Wn,u(V.target),1)]),t("div",On,[t("span",null,u(e(a)("views.cluster.score"))+": "+u(V.value.toFixed(2)),1),t("span",null,u(e(a)("views.cluster.coOccurrence"))+": "+u(V.coOccurrenceCount)+u(e(a)("views.cluster.times")),1)])]),t("div",jn,[t("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:pe({width:`${$.value[0]?.value?V.value/$.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),d.value?(o(),b("div",En,[t("span",null,u(e(a)("views.cluster.totalMembers"))+": "+u(d.value.stats.totalMembers),1),t("span",null,u(e(a)("views.cluster.totalMessages"))+": "+u(d.value.stats.totalMessages.toLocaleString()),1),t("span",null,u(e(a)("views.cluster.involvedMembers"))+": "+u(d.value.stats.involvedMembers),1),t("span",null,u(e(a)("views.cluster.edgeCount"))+": "+u(d.value.stats.edgeCount),1)])):L("",!0)])])}}}),qn={class:"flex h-full flex-col"},Gn={class:"min-h-0 flex-1 overflow-y-auto"},Kn=B({__name:"GroupRelationships",props:{sessionId:{},timeFilter:{}},setup(m){const{t:s}=X(),a=m,n=S("mention-graph"),r=w(()=>[{id:"mention-graph",label:s("analysis.subTabs.groupRelationships.mentionGraph"),icon:"i-heroicons-arrows-right-left"},{id:"mention-ranking",label:s("analysis.subTabs.groupRelationships.mentionRanking"),icon:"i-heroicons-heart"},{id:"proximity",label:s("analysis.subTabs.groupRelationships.proximity"),icon:"i-heroicons-user-group"}]);return(l,d)=>(o(),b("div",qn,[x(e(Ye),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=f=>n.value=f),items:r.value,"persist-key":"groupRelationshipsTab",size:"sm"},null,8,["modelValue","items"]),t("div",Gn,[x(De,{name:"fade",mode:"out-in"},{default:M(()=>[n.value==="mention-graph"?(o(),C(lo,{key:0,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):n.value==="mention-ranking"?(o(),C(jo,{key:1,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):n.value==="proximity"?(o(),C(Pn,{key:2,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):L("",!0)]),_:1})])]))}}),Yn=Ne(Kn,[["__scopeId","data-v-531340f2"]]),Jn={class:"flex h-full flex-col"},Qn={class:"flex-1 min-h-0 overflow-y-auto"},Zn=B({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup(m){const{t:s,locale:a}=X(),n=m,r=w(()=>{const y=[{id:"type-analysis",label:s("analysis.subTabs.view.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:s("analysis.subTabs.view.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:s("analysis.subTabs.view.topic"),icon:"i-heroicons-cloud"},{id:"group-relationships",label:s("analysis.subTabs.view.groupRelationships"),icon:"i-heroicons-heart"},{id:"hot-repeat",label:s("analysis.subTabs.quotes.hotRepeat"),icon:"i-heroicons-fire"},{id:"catchphrase",label:s("analysis.subTabs.quotes.catchphrase"),icon:"i-heroicons-chat-bubble-bottom-center-text"}];return ft("groupRanking",a.value)&&y.splice(2,0,{id:"ranking",label:s("analysis.subTabs.view.ranking"),icon:"i-heroicons-trophy"}),y}),l=S("type-analysis"),d=S(null),f=w(()=>({...n.timeFilter,memberId:d.value}));return(y,k)=>(o(),b("div",Jn,[x(e(Ye),{modelValue:l.value,"onUpdate:modelValue":k[1]||(k[1]=g=>l.value=g),items:r.value,"persist-key":"groupViewTab"},{right:M(()=>[l.value!=="topic"?(o(),C(Tt,{key:0,modelValue:d.value,"onUpdate:modelValue":k[0]||(k[0]=g=>d.value=g),"session-id":n.sessionId},null,8,["modelValue","session-id"])):L("",!0)]),_:1},8,["modelValue","items"]),t("div",Qn,[x(De,{name:"fade",mode:"out-in"},{default:M(()=>[l.value==="type-analysis"?(o(),C(Vt,{key:0,"session-id":n.sessionId,"session-name":n.sessionName,"time-filter":f.value},null,8,["session-id","session-name","time-filter"])):l.value==="time-analysis"?(o(),C(Rt,{key:1,"session-id":n.sessionId,"session-name":n.sessionName,"time-filter":f.value},null,8,["session-id","session-name","time-filter"])):l.value==="topic"?(o(),C(e(Lt),{key:2,"session-id":n.sessionId,"time-filter":n.timeFilter},null,8,["session-id","time-filter"])):l.value==="group-relationships"?(o(),C(Yn,{key:3,"session-id":n.sessionId,"time-filter":f.value},null,8,["session-id","time-filter"])):l.value==="ranking"?(o(),C(Ps,{key:4,"session-id":n.sessionId,"time-filter":f.value},null,8,["session-id","time-filter"])):l.value==="hot-repeat"?(o(),C(e(Ea),{key:5,"session-id":n.sessionId,"time-filter":n.timeFilter},null,8,["session-id","time-filter"])):l.value==="catchphrase"?(o(),C(e(za),{key:6,"session-id":n.sessionId,"time-filter":n.timeFilter},null,8,["session-id","time-filter"])):L("",!0)]),_:1})])]))}}),Xn=Ne(Zn,[["__scopeId","data-v-ab94305e"]]),el={key:0,class:"mb-6"},tl={class:"flex items-center gap-3"},al={class:"text-xl font-bold text-gray-900 dark:text-white"},sl={class:"text-sm text-gray-500 dark:text-gray-400"},ol={class:"mb-4 flex flex-wrap items-center justify-between gap-3"},nl={class:"flex items-center gap-2"},ll={class:"text-xs text-gray-500 dark:text-gray-400"},il={key:0,class:"flex h-60 items-center justify-center"},rl={key:1,class:"flex h-60 flex-col items-center justify-center"},cl={class:"text-gray-500 dark:text-gray-400"},ul={key:2,class:"flex min-h-0 flex-1 flex-col"},dl={class:"w-full"},ml={class:"sticky top-0 bg-gray-50 dark:bg-page-dark"},vl={class:"text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"},hl={class:"px-4 py-4"},pl={class:"px-4 py-4"},gl={class:"px-4 py-4"},fl={class:"w-64 px-4 py-4"},yl={class:"inline-flex items-center gap-1.5"},xl={class:"px-4 py-4 text-right"},bl={class:"divide-y divide-gray-200 dark:divide-gray-700"},kl={class:"px-4 py-4"},_l={class:"px-4 py-4"},wl={class:"flex items-center gap-2"},$l=["src","alt"],Cl={key:1,class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-pink-400 to-pink-600 text-xs font-medium text-white"},Il={class:"text-sm font-medium text-gray-900 dark:text-white"},Sl={class:"ml-1 text-sm text-gray-500 dark:text-gray-400"},Ml={class:"px-4 py-4"},Tl={key:0,class:"text-sm font-medium text-gray-900 dark:text-white"},Vl={key:1,class:"text-sm text-gray-400 dark:text-gray-500"},Rl={class:"px-4 py-4"},Ll={class:"text-sm font-semibold text-gray-900 dark:text-white"},Dl={class:"px-4 py-4"},Nl={class:"max-w-xs"},Al={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2"},zl={class:"px-4 py-4 text-right"},Ul={class:"flex justify-end gap-2"},Fl={key:0,class:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700"},Hl={class:"text-sm text-gray-500 dark:text-gray-400"},Bl={class:"flex items-center gap-2"},Wl={class:"text-sm font-medium text-gray-600 dark:text-gray-300"},Ol={class:"p-6 text-center"},jl={class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30"},El={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},Pl={class:"mb-6 text-sm text-gray-500 dark:text-gray-400"},ql={class:"flex justify-center gap-3"},Gl={class:"p-6"},Kl={class:"mb-4 flex items-center gap-3"},Yl={class:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30"},Jl={class:"text-lg font-semibold text-gray-900 dark:text-white"},Ql={class:"mb-2 text-sm text-gray-600 dark:text-gray-400"},Zl={class:"mb-6 text-xs text-amber-700 dark:text-amber-300"},Xl={class:"flex justify-end gap-2"},Te=20,ei=B({__name:"MemberList",props:{sessionId:{},showHeader:{type:Boolean,default:!0}},emits:["data-changed"],setup(m,{emit:s}){const{t:a}=X(),n=be(),r=m,l=s,d=S([]),f=S([]),y=S(!1),k=S(""),g=S(null),c=S(!1),i=S(new Set),p=S(!1),I=S(!1),h=S(1),v=S(0),_=S(0),$=S("desc"),T=S(null);let z=null;function D(R){return R.groupNickname||R.accountName||R.platformId}function F(R){return D(R).slice(0,1)}function U(R){n.openChatRecordDrawer({sessionId:r.sessionId,memberId:R.id,memberName:D(R)})}const O=w(()=>f.value.filter(R=>i.value.has(R.id))),ee=w(()=>O.value.length===2),j=w(()=>{if(O.value.length!==2)return null;const[R,H]=O.value;return H.messageCount>R.messageCount||H.messageCount===R.messageCount&&H.id<R.id?{primary:H,secondary:R}:{primary:R,secondary:H}});function te(){$.value=$.value==="desc"?"asc":"desc",h.value=1,q()}async function q(){if(r.sessionId){y.value=!0;try{const R=await Q().getMembersPaginated(r.sessionId,{page:h.value,pageSize:Te,search:k.value.trim(),sortOrder:$.value});d.value=R.items,v.value=R.total,_.value=R.totalPages}catch(R){console.error("加载成员列表失败:",R)}finally{y.value=!1}}}async function V(){if(r.sessionId)try{f.value=await Q().getMembers(r.sessionId)}catch(R){console.error("加载所有成员失败:",R)}}async function Y(R,H){const A=JSON.parse(JSON.stringify(H)),Ie=JSON.stringify(R.aliases),ie=JSON.stringify(A);if(Ie!==ie){T.value=R.id;try{if(await Q().updateMemberAliases(r.sessionId,R.id,A)){const he=d.value.findIndex(Se=>Se.id===R.id);he!==-1&&(d.value[he]={...d.value[he],aliases:A})}}catch(ye){console.error("保存别名失败:",ye)}finally{T.value=null}}}function ue(R){g.value=R}function _e(){g.value=null}async function we(){if(g.value){c.value=!0;try{await Q().deleteMember(r.sessionId,g.value.id)&&(await q(),await V(),l("data-changed"))}catch(R){console.error("删除成员失败:",R)}finally{c.value=!1,g.value=null}}}function $e(R){const H=new Set(i.value);H.has(R)?H.delete(R):H.add(R),i.value=H}function Ce(){ee.value&&(p.value=!0)}function oe(){i.value=new Set}async function N(){if(j.value){I.value=!0;try{await Q().mergeMembers(r.sessionId,j.value.primary.id,j.value.secondary.id)&&(p.value=!1,oe(),await q(),await V(),l("data-changed"))}catch(R){console.error("合并成员失败:",R)}finally{I.value=!1}}}return E(k,()=>{h.value=1,z&&clearTimeout(z),z=setTimeout(()=>{q()},300)}),E(h,()=>{q()}),E(()=>r.sessionId,()=>{k.value="",h.value=1,oe(),q(),V()},{immediate:!0}),fe(()=>{q(),V()}),(R,H)=>{const A=ce,Ie=je,ie=Re,ye=lt,he=it,Se=rt,Ae=ge;return o(),b("div",{class:J(["main-content",r.showHeader?"max-w-5xl p-6":"flex h-full max-w-none flex-col overflow-hidden p-4"])},[r.showHeader?(o(),b("div",el,[t("div",tl,[t("div",null,[t("h2",al,u(e(a)("members.list.title")),1),t("p",sl,u(e(a)("members.list.description",{count:v.value})),1)])])])):L("",!0),x(Dt,{class:"mb-6","session-id":m.sessionId,members:f.value,"chat-type":"group"},null,8,["session-id","members"]),t("div",ol,[x(Ie,{modelValue:k.value,"onUpdate:modelValue":H[1]||(H[1]=P=>k.value=P),placeholder:e(a)("members.list.searchPlaceholder"),icon:"i-heroicons-magnifying-glass",class:"w-full md:w-100"},Ge({_:2},[k.value?{name:"trailing",fn:M(()=>[x(A,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs",onClick:H[0]||(H[0]=P=>k.value="")})]),key:"0"}:void 0]),1032,["modelValue","placeholder"]),t("div",nl,[t("span",ll,u(e(a)("members.list.mergeSelectedCount",{count:i.value.size})),1),x(A,{icon:"i-heroicons-link",size:"sm",color:"primary",disabled:!ee.value,onClick:Ce},{default:M(()=>[K(u(e(a)("members.list.mergeSelected")),1)]),_:1},8,["disabled"])])]),t("div",{class:J(["rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-page-dark",r.showHeader?"":"flex min-h-0 flex-1 flex-col"])},[y.value?(o(),b("div",il,[x(ie,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):d.value.length===0?(o(),b("div",rl,[x(ie,{name:"i-heroicons-user-group",class:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),t("p",cl,u(k.value?e(a)("members.list.noMatch"):e(a)("members.list.empty")),1)])):(o(),b("div",ul,[t("div",{class:J(["max-h-[500px] overflow-y-auto",r.showHeader?"":"max-h-none min-h-0 flex-1"])},[t("table",dl,[t("thead",ml,[t("tr",vl,[H[7]||(H[7]=t("th",{class:"w-12 px-4 py-4"},null,-1)),t("th",hl,u(e(a)("members.list.table.accountName")),1),t("th",pl,u(e(a)("members.list.table.groupNickname")),1),t("th",gl,[t("button",{class:"flex items-center gap-1.5 hover:text-gray-700 dark:hover:text-gray-200",onClick:te},[K(u(e(a)("members.list.table.messageCount"))+" ",1),x(ie,{name:$.value==="desc"?"i-heroicons-arrow-down":"i-heroicons-arrow-up",class:"h-3.5 w-3.5"},null,8,["name"])])]),t("th",fl,[t("div",yl,[t("span",null,u(e(a)("members.list.table.customAlias")),1),x(ye,{text:e(a)("members.list.tip"),popper:{placement:"top"}},{default:M(()=>[x(ie,{name:"i-heroicons-question-mark-circle",class:"h-4 w-4 text-gray-400 dark:text-gray-500"})]),_:1},8,["text"])])]),t("th",xl,u(e(a)("members.list.table.actions")),1)])]),t("tbody",bl,[(o(!0),b(W,null,Z(d.value,P=>(o(),b("tr",{key:P.id,class:"hover:bg-gray-50 dark:hover:bg-gray-800/50"},[t("td",kl,[x(he,{"model-value":i.value.has(P.id),onClick:qe(xe=>$e(P.id),["stop"])},null,8,["model-value","onClick"])]),t("td",_l,[t("div",wl,[P.avatar?(o(),b("img",{key:0,src:P.avatar,alt:D(P),class:"h-8 w-8 shrink-0 rounded-full object-cover"},null,8,$l)):(o(),b("div",Cl,u(F(P)),1)),t("div",null,[t("span",Il,u(P.accountName||"-"),1),t("span",Sl,"("+u(P.platformId)+")",1)])])]),t("td",Ml,[P.groupNickname?(o(),b("span",Tl,u(P.groupNickname),1)):(o(),b("span",Vl,"-"))]),t("td",Rl,[t("span",Ll,u(P.messageCount.toLocaleString()),1)]),t("td",Dl,[t("div",Nl,[x(Se,{"model-value":P.aliases,placeholder:e(a)("members.list.aliasPlaceholder"),class:"w-80","onUpdate:modelValue":xe=>Y(P,xe)},null,8,["model-value","placeholder","onUpdate:modelValue"]),T.value===P.id?(o(),b("div",Al,[x(ie,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-pink-500"})])):L("",!0)])]),t("td",zl,[t("div",Ul,[x(A,{icon:"i-heroicons-chat-bubble-left-ellipsis",size:"xs",color:"neutral",variant:"ghost",title:e(a)("common.viewChatRecords"),onClick:xe=>U(P)},null,8,["title","onClick"]),x(A,{label:e(a)("members.list.delete"),size:"xs",onClick:xe=>ue(P)},null,8,["label","onClick"])])])]))),128))])])],2),_.value>1?(o(),b("div",Fl,[t("p",Hl,u(e(a)("members.list.pagination",{start:(h.value-1)*Te+1,end:Math.min(h.value*Te,v.value),total:v.value})),1),t("div",Bl,[x(A,{icon:"i-heroicons-chevron-left",variant:"outline",size:"sm",disabled:h.value===1||y.value,onClick:H[2]||(H[2]=P=>h.value--)},null,8,["disabled"]),t("span",Wl,u(h.value)+" / "+u(_.value),1),x(A,{icon:"i-heroicons-chevron-right",variant:"outline",size:"sm",disabled:h.value>=_.value||y.value,onClick:H[3]||(H[3]=P=>h.value++)},null,8,["disabled"])])])):L("",!0)]))],2),x(Ae,{open:!!g.value,ui:{content:"max-w-sm"},"onUpdate:open":H[4]||(H[4]=P=>g.value=null)},{content:M(()=>[t("div",Ol,[t("div",jl,[x(ie,{name:"i-heroicons-exclamation-triangle",class:"h-7 w-7 text-red-500"})]),t("h3",El,u(e(a)("members.list.modal.title")),1),t("p",Pl,u(e(a)("members.list.modal.content",{name:g.value?D(g.value):"",count:g.value?.messageCount.toLocaleString()})),1),t("div",ql,[x(A,{variant:"outline",onClick:_e},{default:M(()=>[K(u(e(a)("members.list.modal.cancel")),1)]),_:1}),x(A,{color:"error",loading:c.value,onClick:we},{default:M(()=>[K(u(e(a)("members.list.modal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"]),x(Ae,{open:p.value,ui:{content:"max-w-md"},"onUpdate:open":H[6]||(H[6]=P=>p.value=P)},{content:M(()=>[t("div",Gl,[t("div",Kl,[t("div",Yl,[x(ie,{name:"i-heroicons-link",class:"h-5 w-5 text-amber-600 dark:text-amber-400"})]),t("h3",Jl,u(e(a)("members.list.mergeModal.title")),1)]),t("p",Ql,u(e(a)("members.list.mergeModal.content",{source:j.value?D(j.value.secondary):"",sourceCount:j.value?j.value.secondary.messageCount.toLocaleString():"0",target:j.value?D(j.value.primary):"",targetCount:j.value?j.value.primary.messageCount.toLocaleString():"0"})),1),t("p",Zl,u(e(a)("members.list.mergeModal.hint")),1),t("div",Xl,[x(A,{variant:"outline",disabled:I.value,onClick:H[5]||(H[5]=P=>p.value=!1)},{default:M(()=>[K(u(e(a)("members.list.mergeModal.cancel")),1)]),_:1},8,["disabled"]),x(A,{color:"primary",loading:I.value,onClick:N},{default:M(()=>[K(u(e(a)("members.list.mergeModal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])],2)}}}),ti={class:"main-content max-w-5xl p-6"},ai={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},si={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},oi={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},ni={class:"flex flex-1 flex-wrap items-center gap-2"},li={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},ii={class:"text-xs text-gray-400"},ri={key:0,class:"text-gray-300 dark:text-gray-600"},ci=B({__name:"NicknameHistory",props:{sessionId:{}},setup(m){const{t:s}=X(),a=m,n=S([]),r=S([]),l=S(!1);function d(k){return k.groupNickname||k.accountName||k.platformId}async function f(){if(a.sessionId)try{n.value=await Q().getMembers(a.sessionId)}catch(k){console.error("加载成员列表失败:",k)}}async function y(){if(!a.sessionId||n.value.length===0)return;l.value=!0;const k=[];try{const g=n.value.map(i=>Q().getMemberNameHistory(a.sessionId,i.id)),c=await Promise.all(g);n.value.forEach((i,p)=>{const I=c[p];I.length>2&&k.push({memberId:i.id,name:d(i),history:I})}),r.value=k}catch(g){console.error("加载昵称变更记录失败:",g)}finally{l.value=!1}}return E(()=>a.sessionId,async()=>{await f()},{immediate:!0}),E(()=>n.value.length,()=>{n.value.length>0&&y()}),fe(async()=>{n.value.length===0&&await f()}),(k,g)=>{const c=Oe;return o(),b("div",ti,[t("p",ai,u(e(s)("members.nicknameHistory.note")),1),x(e(G),{title:e(s)("members.nicknameHistory.title"),description:l.value?e(s)("members.nicknameHistory.loading"):r.value.length>0?e(s)("members.nicknameHistory.hasChanges",{count:r.value.length}):e(s)("members.nicknameHistory.noChanges")},{default:M(()=>[!l.value&&r.value.length>0?(o(),b("div",si,[(o(!0),b(W,null,Z(r.value,i=>(o(),b("div",{key:i.memberId,class:"flex items-start gap-3 px-5 py-3"},[t("div",oi,u(i.name),1),t("div",ni,[(o(!0),b(W,null,Z(i.history,(p,I)=>(o(),b(W,{key:I},[t("div",li,[t("span",{class:J(["text-sm",p.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},u(p.name),3),p.endTs===null?(o(),C(c,{key:0,color:"primary",variant:"soft",size:"xs"},{default:M(()=>[K(u(e(s)("members.nicknameHistory.current")),1)]),_:1})):L("",!0),t("span",ii,"("+u(e(Nt)(p.startTs,p.endTs))+")",1)]),I<i.history.length-1?(o(),b("span",ri,"→")):L("",!0)],64))),128))])]))),128))])):l.value?(o(),C(e(se),{key:2,text:e(s)("members.nicknameHistory.loadingText")},null,8,["text"])):(o(),C(e(ne),{key:1,text:e(s)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),ui={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},di={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},mi={class:"text-lg font-semibold text-gray-900 dark:text-white"},vi={class:"flex-1 overflow-auto"},hi=B({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(m){const{t:s}=X(),a=m,n=S(!1);return(r,l)=>{const d=ce,f=ge;return o(),b(W,null,[x(d,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:l[0]||(l[0]=y=>n.value=!0)},{default:M(()=>[K(u(e(s)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),a.sessionId?(o(),C(f,{key:0,open:n.value,"onUpdate:open":l[2]||(l[2]=y=>n.value=y),ui:{content:"max-w-6xl h-[85vh]"}},{content:M(()=>[t("div",ui,[t("div",di,[t("h2",mi,u(e(s)("analysis.subTabs.member.nicknameHistory")),1),x(d,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:l[1]||(l[1]=y=>n.value=!1)})]),t("div",vi,[x(ci,{"session-id":a.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):L("",!0)],64)}}}),pi={class:"flex h-full flex-col bg-white dark:bg-page-dark",style:{"padding-top":"var(--titlebar-area-height)"}},gi={class:"relative flex-1 overflow-y-auto"},fi={class:"h-full"},yi={key:2,class:"flex h-full items-center justify-center"},xi={class:"text-gray-500"},bi={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},ki={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},_i={class:"text-lg font-semibold text-gray-900 dark:text-white"},wi={class:"text-sm text-gray-500 dark:text-gray-400"},$i={class:"flex items-center gap-2"},Ci={class:"flex-1 overflow-hidden"},Ii=B({__name:"index",setup(m){const s=Pe(()=>We(()=>import("./MessageExportModal-CGcdMOyw.js"),__vite__mapDeps([5,6,4,7,8,9]))),{t:a}=X(),n=ct(),r=ut(),l=yt(),d=be(),f=xt(),{currentSessionId:y}=bt(l),k=S(!1),g=S(!1),c=S(!1),i=S(!1),p=S(!1);function I(){d.openChatRecordDrawer({})}const h=[{id:"overview",labelKey:"analysis.tabs.overview",icon:"i-heroicons-chart-pie"},{id:"view",labelKey:"analysis.tabs.view",icon:"i-heroicons-presentation-chart-bar"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],v=w(()=>f.debugMode?[...h,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:h),_=w(()=>v.value.map(oe=>oe.id)),{activeTab:$,isLoading:T,isInitialLoad:z,session:D,memberActivity:F,hourlyActivity:U,dailyActivity:O,messageTypes:ee,timeRangeValue:j,fullTimeRange:te,availableYears:q,timeFilter:V,initialTimeState:Y,loadData:ue}=At({route:n,router:r,currentSessionId:y,selectSession:l.selectSession,defaultTab:f.defaultSessionTab,validTabIds:_.value}),_e=w(()=>F.value.slice(0,3)),we=w(()=>F.value.length<=1?[]:[...F.value].sort((oe,N)=>oe.messageCount-N.messageCount).slice(0,1)),$e=w(()=>F.value.reduce((oe,N)=>oe+N.messageCount,0)),Ce=w(()=>F.value.filter(oe=>oe.messageCount>0).length);return(oe,N)=>{const R=ce,H=ge;return o(),b("div",pi,[e(z)?(o(),C(se,{key:0,variant:"page",text:e(a)("analysis.groupChat.loading")},null,8,["text"])):e(D)?(o(),b(W,{key:1},[x(zt,{"active-tab":e($),"onUpdate:activeTab":N[0]||(N[0]=A=>ze($)?$.value=A:null),"time-range-value":e(j),"onUpdate:timeRangeValue":N[1]||(N[1]=A=>ze(j)?j.value=A:null),title:e(D).name,avatar:e(D).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:v.value,"current-session-id":e(y),"initial-time-state":e(Y),onOpenIncrementalImport:N[2]||(N[2]=A=>c.value=!0),onOpenMemberManagement:N[3]||(N[3]=A=>p.value=!0),onOpenChatRecord:I,"onUpdate:fullRange":N[4]||(N[4]=A=>te.value=A),"onUpdate:availableYears":N[5]||(N[5]=A=>q.value=A)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),t("div",gi,[e(T)?(o(),C(se,{key:0,variant:"overlay"})):L("",!0),t("div",fi,[x(De,{name:"tab-slide",mode:"out-in"},{default:M(()=>[e($)==="overview"?(o(),C(Ya,{key:"overview-"+e(y),session:e(D),"member-activity":e(F),"top-members":_e.value,"bottom-members":we.value,"message-types":e(ee),"hourly-activity":e(U),"daily-activity":e(O),"time-range":e(te),"filtered-message-count":$e.value,"filtered-member-count":Ce.value,"time-filter":e(V)},null,8,["session","member-activity","top-members","bottom-members","message-types","hourly-activity","daily-activity","time-range","filtered-message-count","filtered-member-count","time-filter"])):e($)==="view"?(o(),C(Xn,{key:"view-"+e(y),"session-id":e(y),"session-name":e(D).name,"time-filter":e(V)},null,8,["session-id","session-name","time-filter"])):e($)==="ai-chat"?(o(),C(e(Wt),{key:"ai-chat-"+e(y),"session-id":e(y),"session-name":e(D).name,"chat-type":"group"},null,8,["session-id","session-name"])):e($)==="memory"?(o(),C(Ot,{key:"memory-"+e(y),"session-id":e(y),"session-name":e(D).name},null,8,["session-id","session-name"])):e($)==="lab"?(o(),C(jt,{key:"lab-"+e(y),"session-id":e(y),"session-name":e(D).name,"time-filter":e(V),"chat-type":"group",mode:"sql-only"},null,8,["session-id","session-name","time-filter"])):e($)==="debug"?(o(),C(e(Et),{key:"debug-"+e(y),"session-id":e(y)},null,8,["session-id"])):L("",!0)]),_:1})])]),x(Ut,{onOpenIncrementalImport:N[6]||(N[6]=A=>c.value=!0),onOpenSemanticIndex:N[7]||(N[7]=A=>k.value=!0),onOpenMemberManagement:N[8]||(N[8]=A=>p.value=!0),onOpenChatRecord:I,onOpenMessageExport:N[9]||(N[9]=A=>i.value=!0)}),e(f).debugMode?(o(),C(Pt,{key:0})):L("",!0)],64)):(o(),b("div",yi,[t("p",xi,u(e(a)("analysis.groupChat.loadError")),1)])),e(y)&&e(D)?(o(),C(Ft,{key:3,modelValue:k.value,"onUpdate:modelValue":N[10]||(N[10]=A=>k.value=A),"session-id":e(y),"message-count":e(D).messageCount},null,8,["modelValue","session-id","message-count"])):L("",!0),e(y)&&e(D)?(o(),C(Ht,{key:4,modelValue:g.value,"onUpdate:modelValue":N[11]||(N[11]=A=>g.value=A),"session-id":e(y),"chat-type":"group","auto-check":""},null,8,["modelValue","session-id"])):L("",!0),e(y)&&e(D)?(o(),C(Bt,{key:5,modelValue:c.value,"onUpdate:modelValue":N[12]||(N[12]=A=>c.value=A),"session-id":e(y),"session-name":e(D).name,onImported:N[13]||(N[13]=()=>{e(ue)(),e(l).loadSessions()})},null,8,["modelValue","session-id","session-name"])):L("",!0),e(y)?(o(),C(e(s),{key:6,modelValue:i.value,"onUpdate:modelValue":N[14]||(N[14]=A=>i.value=A)},null,8,["modelValue"])):L("",!0),e(y)?(o(),C(H,{key:7,open:p.value,"onUpdate:open":N[16]||(N[16]=A=>p.value=A),ui:{content:"max-w-6xl h-[85vh]"}},{content:M(()=>[t("div",bi,[t("div",ki,[t("div",null,[t("h2",_i,u(e(a)("analysis.tooltip.memberManagement")),1),t("p",wi,u(e(a)("members.list.description",{count:e(D)?.memberCount??0})),1)]),t("div",$i,[x(hi,{"session-id":e(y)},null,8,["session-id"]),x(R,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:N[15]||(N[15]=A=>p.value=!1)})])]),t("div",Ci,[x(ei,{"session-id":e(y),"show-header":!1,onDataChanged:e(ue)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):L("",!0)])}}}),Fi=Ne(Ii,[["__scopeId","data-v-7722d374"]]);export{Fi as default};