chatlab-cli 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{chat-command-3KUWKS53.mjs → chat-command-IHRNO7J4.mjs} +8 -8
- package/dist/{chunk-3J7WTUEE.mjs → chunk-4V6UP7EW.mjs} +2 -2
- package/dist/{chunk-YVNZ73O5.mjs → chunk-C3B7RXES.mjs} +3919 -3773
- package/dist/chunk-C3B7RXES.mjs.map +1 -0
- package/dist/{chunk-27DWKA3L.mjs → chunk-HGV4MUIW.mjs} +4 -4
- package/dist/{chunk-LNU4RW5G.mjs → chunk-KWJ5FZ74.mjs} +1182 -1042
- package/dist/chunk-KWJ5FZ74.mjs.map +1 -0
- package/dist/{chunk-DV4U34MR.mjs → chunk-NHTOSDYI.mjs} +2 -2
- package/dist/{chunk-CANPJOIE.mjs → chunk-NSWFHMBZ.mjs} +112 -16
- package/dist/chunk-NSWFHMBZ.mjs.map +1 -0
- package/dist/{chunk-UVCH2ICD.mjs → chunk-RHA534GU.mjs} +3 -3
- package/dist/{chunk-23AIEWCD.mjs → chunk-S7YPBKQ3.mjs} +2 -2
- package/dist/{chunk-BLOBEOCG.mjs → chunk-U4F6BNGZ.mjs} +2 -2
- package/dist/{chunk-3IGBPOJM.mjs → chunk-ZERQIKI4.mjs} +5 -4
- package/dist/chunk-ZERQIKI4.mjs.map +1 -0
- package/dist/{chunk-PZM3FHVZ.mjs → chunk-ZTMZ7S7T.mjs} +16 -16
- package/dist/chunk-ZTMZ7S7T.mjs.map +1 -0
- package/dist/cli.mjs +8 -8
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +1 -1
- package/dist/{http-YR26GF7X.mjs → http-Y2WC2UK4.mjs} +11 -11
- package/dist/{import-Q3DUACU4.mjs → import-4HF2UNQI.mjs} +7 -7
- package/dist/index.mjs +11 -11
- package/dist/{mcp-HTVZSGTI.mjs → mcp-DJPDRFTW.mjs} +8 -8
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{src-HJL7YZZJ.mjs → src-R7MZLKXQ.mjs} +9 -9
- package/dist/{stream-import-MXETSEPW.mjs → stream-import-DX57ANUL.mjs} +7 -7
- package/dist/{worker-runtime-DZQDL2E2.mjs → worker-runtime-QMN7OKOZ.mjs} +5 -5
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-hwRVh048.js +110 -0
- package/{dist-web/assets/BufferResource-BXfwfGam.js → dist-cli-web/assets/BufferResource-DwfMBlAa.js} +1 -1
- package/dist-cli-web/assets/CanvasRenderer-q312LRsp.js +1 -0
- package/dist-cli-web/assets/DataDirCleanupNotice--ee1dY0d.js +1 -0
- package/dist-cli-web/assets/EChartWordcloud-BaMgUl0Y.js +1 -0
- package/{dist-web/assets/Filter-Irxx0f6j.js → dist-cli-web/assets/Filter-BOb5cLBx.js} +1 -1
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-DK2z0Jrh.js +1 -0
- package/dist-cli-web/assets/MessageExportModal-CFbovWh1.js +1 -0
- package/dist-cli-web/assets/PageHeader-B3-W9mvh.js +1 -0
- package/{dist-web/assets/RelationshipGalaxyCanvas-ByDU6ZS_.js → dist-cli-web/assets/RelationshipGalaxyCanvas-GEpsKHxV.js} +4 -4
- package/{dist-web/assets/RelationshipGalaxyThreeCanvas-DgAlyKjc.js → dist-cli-web/assets/RelationshipGalaxyThreeCanvas-DHOU66Gj.js} +2 -2
- package/{dist-web/assets/RenderTargetSystem-Cx5U5HAM.js → dist-cli-web/assets/RenderTargetSystem-PEnnW2yb.js} +1 -1
- package/dist-cli-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-sNw3hP4c.js +1 -0
- package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-BtUvMehe.js +1 -0
- package/{dist-web/assets/WebGLRenderer-B3Fnp1WX.js → dist-cli-web/assets/WebGLRenderer-BjP_1do7.js} +2 -2
- package/{dist-web/assets/WebGPURenderer-DZ0X9N86.js → dist-cli-web/assets/WebGPURenderer-ldVv92u7.js} +2 -2
- package/dist-cli-web/assets/annual-summary-time-range-BHClzNvd.js +1 -0
- package/dist-cli-web/assets/base-DBJ95yXf.js +1 -0
- package/{dist-web/assets/browserAll-BqC9ELNO.js → dist-cli-web/assets/browserAll-CPoMOLKh.js} +1 -1
- package/dist-cli-web/assets/cli-web-B5VYO-Dh.js +1 -0
- package/{dist-web/assets/dateFormat-CX9atL2g.js → dist-cli-web/assets/dateFormat-Cf2xuaE-.js} +1 -1
- package/dist-cli-web/assets/fetch-80O3EH4a.js +1 -0
- package/dist-cli-web/assets/fetch-B1km2u3N.js +1 -0
- package/dist-cli-web/assets/fetch-BFDKzf1P.js +1 -0
- package/dist-cli-web/assets/fetch-BuWxo6oK.js +1 -0
- package/{dist-web/assets/fetch-C3KuMfIU.js → dist-cli-web/assets/fetch-C0HHT1Yn.js} +3 -3
- package/dist-cli-web/assets/fetch-CXIdj2-_.js +1 -0
- package/{dist-web/assets/fetch-CUT9JdXT.js → dist-cli-web/assets/fetch-CtyVktRW.js} +3 -3
- package/{dist-web/assets/fetch-th_egarZ.js → dist-cli-web/assets/fetch-DGi_9my2.js} +2 -2
- package/dist-cli-web/assets/fetch-Dr41uuXL.js +1 -0
- package/dist-cli-web/assets/fetch-J67jyI2k.js +1 -0
- package/dist-cli-web/assets/index-5UdyJtVU.js +1 -0
- package/dist-cli-web/assets/index-7jm3YI9u.js +53 -0
- package/dist-cli-web/assets/index-B7R74Yp7.js +1 -0
- package/dist-cli-web/assets/index-BGiTw98l.js +1 -0
- package/dist-cli-web/assets/index-Ba21yU86.js +1 -0
- package/{dist-web/assets/index-Bm_U0hSr.js → dist-cli-web/assets/index-Bf3gFaid.js} +4 -4
- package/dist-cli-web/assets/index-ByQSR8Bj.js +2 -0
- package/dist-cli-web/assets/index-CPZYydbc.js +2 -0
- package/dist-cli-web/assets/index-D8Q3U-6e.js +1 -0
- package/dist-cli-web/assets/index-DGtDxRCd.js +173 -0
- package/{dist-web/assets/index-DBb03wVF.css → dist-cli-web/assets/index-DTxnpQiv.css} +1 -1
- package/dist-cli-web/assets/index-DmrrdYXH.css +1 -0
- package/dist-cli-web/assets/index-DtlTo3nt.js +1 -0
- package/dist-cli-web/assets/index-DzQT-qXF.js +1 -0
- package/dist-cli-web/assets/index-gpTDI3sq.js +64 -0
- package/{dist-web/assets/index-D8Uq3_Dc.css → dist-cli-web/assets/index-lwhCMqhd.css} +1 -1
- package/dist-cli-web/assets/index-qsbWn8VP.css +1 -0
- package/dist-cli-web/assets/people-page-header-BvQy1GQj.js +1 -0
- package/{dist-web/assets/webworkerAll-a_fveCLR.js → dist-cli-web/assets/webworkerAll-DgKQKbNn.js} +1 -1
- package/{dist-web → dist-cli-web}/index.html +2 -4
- package/package.json +4 -4
- package/dist/chunk-3IGBPOJM.mjs.map +0 -1
- package/dist/chunk-CANPJOIE.mjs.map +0 -1
- package/dist/chunk-LNU4RW5G.mjs.map +0 -1
- package/dist/chunk-PZM3FHVZ.mjs.map +0 -1
- package/dist/chunk-YVNZ73O5.mjs.map +0 -1
- package/dist-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-DfQa9E2W.js +0 -110
- package/dist-web/assets/CanvasRenderer-Bvpsbxds.js +0 -1
- package/dist-web/assets/DataDirCleanupNotice-C0sCmNL2.js +0 -1
- package/dist-web/assets/EChartWordcloud-C5hLT1vS.js +0 -1
- package/dist-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-8s6XRB3S.js +0 -1
- package/dist-web/assets/MessageExportModal-tTI358HU.js +0 -1
- package/dist-web/assets/PageHeader-D5QQI9io.js +0 -1
- package/dist-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-CpNjFhpm.js +0 -1
- package/dist-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-DtCKfbaz.js +0 -1
- package/dist-web/assets/annual-summary-time-range-CvG74N2l.js +0 -1
- package/dist-web/assets/base-DdQRTliS.js +0 -1
- package/dist-web/assets/electron-ChQkD5ht.js +0 -1
- package/dist-web/assets/electron-DGxVMsvC.js +0 -1
- package/dist-web/assets/electron-hcWiB7Gg.js +0 -1
- package/dist-web/assets/fetch-3Ifr5YJN.js +0 -1
- package/dist-web/assets/fetch-74o_kRZf.js +0 -1
- package/dist-web/assets/fetch-BKFznq4l.js +0 -1
- package/dist-web/assets/fetch-BPj6IlT-.js +0 -1
- package/dist-web/assets/fetch-CoYaXr5K.js +0 -1
- package/dist-web/assets/fetch-Dcg6Q6Ei.js +0 -1
- package/dist-web/assets/fetch-DxWfYzkB.js +0 -1
- package/dist-web/assets/index-B3riRaJA.js +0 -1
- package/dist-web/assets/index-BKFGuwJu.css +0 -1
- package/dist-web/assets/index-BRDdozcm.js +0 -173
- package/dist-web/assets/index-Bg-OiHMa.js +0 -1
- package/dist-web/assets/index-BhewGKey.js +0 -2
- package/dist-web/assets/index-BpeJ40uK.js +0 -1
- package/dist-web/assets/index-C6bwt1H4.js +0 -1
- package/dist-web/assets/index-CEJqRkis.js +0 -2
- package/dist-web/assets/index-CKLCaqdT.js +0 -1
- package/dist-web/assets/index-Ds5PiVyB.js +0 -64
- package/dist-web/assets/index-GXMxhYc9.js +0 -1
- package/dist-web/assets/index-JyB6Cr8r.js +0 -25
- package/dist-web/assets/index-UJl03IYE.css +0 -1
- package/dist-web/assets/index-tx-Oal36.js +0 -1
- package/dist-web/assets/people-page-header-DGkK0AMO.js +0 -1
- package/dist-web/assets/types-CZnACqaB.js +0 -1
- package/dist-web/assets/vendor-nuxt-ui-DMdbdSFy.js +0 -15
- package/dist-web/assets/vendor-reka-ui-8_x7iKfi.js +0 -15
- package/dist-web/assets/web-aZcioccr.js +0 -1
- /package/dist/{chat-command-3KUWKS53.mjs.map → chat-command-IHRNO7J4.mjs.map} +0 -0
- /package/dist/{chunk-3J7WTUEE.mjs.map → chunk-4V6UP7EW.mjs.map} +0 -0
- /package/dist/{chunk-27DWKA3L.mjs.map → chunk-HGV4MUIW.mjs.map} +0 -0
- /package/dist/{chunk-DV4U34MR.mjs.map → chunk-NHTOSDYI.mjs.map} +0 -0
- /package/dist/{chunk-UVCH2ICD.mjs.map → chunk-RHA534GU.mjs.map} +0 -0
- /package/dist/{chunk-23AIEWCD.mjs.map → chunk-S7YPBKQ3.mjs.map} +0 -0
- /package/dist/{chunk-BLOBEOCG.mjs.map → chunk-U4F6BNGZ.mjs.map} +0 -0
- /package/dist/{http-YR26GF7X.mjs.map → http-Y2WC2UK4.mjs.map} +0 -0
- /package/dist/{import-Q3DUACU4.mjs.map → import-4HF2UNQI.mjs.map} +0 -0
- /package/dist/{mcp-HTVZSGTI.mjs.map → mcp-DJPDRFTW.mjs.map} +0 -0
- /package/dist/{src-HJL7YZZJ.mjs.map → src-R7MZLKXQ.mjs.map} +0 -0
- /package/dist/{stream-import-MXETSEPW.mjs.map → stream-import-DX57ANUL.mjs.map} +0 -0
- /package/dist/{worker-runtime-DZQDL2E2.mjs.map → worker-runtime-QMN7OKOZ.mjs.map} +0 -0
- /package/{dist-web → dist-cli-web}/assets/ActionToolsPanel-Dp-ojXjO.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/PageHeader-XIXMTomn.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/RelationshipGalaxyThreeCanvas-BluPHjCR.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/index-BfO_LpDv.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/index-ByUaiVQK.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/index-ZsZwPLWy.css +0 -0
- /package/{dist-web → dist-cli-web}/assets/logo-DXIuG_WE.svg +0 -0
- /package/{dist-web → dist-cli-web}/assets/relationship-galaxy-viewport-Cwfa51ER.js +0 -0
- /package/{dist-web → dist-cli-web}/assets/vendor-echarts-B-i_56Av.js +0 -0
- /package/{dist-web → dist-cli-web}/assets/vendor-echarts-wordcloud-Ca8n6qS6.js +0 -0
- /package/{dist-web → dist-cli-web}/assets/vendor-snapdom--nZvo8Sg.js +0 -0
- /package/{dist-web → dist-cli-web}/assets/vendor-zrender-5DcYjSZk.js +0 -0
- /package/{dist-web → dist-cli-web}/favicon.ico +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MessageExportModal-tTI358HU.js","assets/vendor-nuxt-ui-DMdbdSFy.js","assets/vendor-reka-ui-8_x7iKfi.js","assets/index-JyB6Cr8r.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-UJl03IYE.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{A as nt,u as Z,m as X,T as ie,R as lt,z as Ae,o as $e,j as Ue,S as it,U as rt,s as ut,B as ct,v as dt,D as mt,x as vt}from"./index-JyB6Cr8r.js";import{g as pt,b as Ce,a as pe,_ as he,m as Oe,l as ht,d as We,n as gt,o as Ke,f as ft,u as yt}from"./vendor-nuxt-ui-DMdbdSFy.js";import{r as S,x as Te,O as Fe,d as U,P as o,Z as T,_ as K,ag as s,ad as q,ae as Q,a0 as g,Y as oe,S as bt,Q as C,aa as ve,c as y,w as z,E as xt,u as e,T as I,U as x,a1 as A,$ as Y,bY as je,n as De,bS as Ie,bV as qe,ak as ze,bZ as kt,aG as wt,L as _t,A as He,bW as $t}from"./vendor-reka-ui-8_x7iKfi.js";import{c as E,b as Ct,d as Ee,e as Tt,u as It,a as le,f as Ge,g as St,h as Vt,i as Rt,j as Mt,k as Lt,l as Dt,m as Nt,n as At,C as Ut,o as Ft,L as Bt,D as qt,M as zt}from"./ActionToolsPanel.vue_vue_type_script_setup_true_lang-DfQa9E2W.js";import{a as te,g as Ht,_ as Et}from"./base-DdQRTliS.js";import"./vendor-echarts-wordcloud-Ca8n6qS6.js";import{u as Ye,y as Pt,j as Qe,s as Ot,i as Ze,k as Je,p as Wt,t as Kt,v as jt}from"./vendor-echarts-B-i_56Av.js";import{_ as ae}from"./LoadingState.vue_vue_type_script_setup_true_lang-8s6XRB3S.js";import{a as Gt}from"./index-Bm_U0hSr.js";import{_ as Yt}from"./ThemeCard.vue_vue_type_script_setup_true_lang-CpNjFhpm.js";import{a as Ne,b as Qt,c as Zt}from"./dateFormat-CX9atL2g.js";import"./vendor-snapdom--nZvo8Sg.js";import"./TimeSelect.vue_vue_type_script_setup_true_lang-DtCKfbaz.js";import"./PageHeader-D5QQI9io.js";import"./vendor-zrender-5DcYjSZk.js";function Jt(l,t={}){const{threshold:a=300,containerSelector:n=".overflow-y-auto",scrollLockDuration:r=800}=t,c=S(l[0]?.id||"");let d=!1;const v=S(null);let m=null;function _(){if(d)return;const u=[];l.forEach(p=>{const $=document.getElementById(p.id);if($){const h=$.getBoundingClientRect();u.push({id:p.id,top:Math.round(h.top)})}});let i=0;for(let p=0;p<u.length;p++){if(u[p].top>a){i=Math.max(0,p-1);break}i=p}c.value=l[i]?.id||""}function f(u){const i=document.getElementById(u);i&&(c.value=u,d=!0,i.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{d=!1,_()},r))}return Te(()=>{m=v.value?.closest(n)||null,m&&(m.addEventListener("scroll",_,{passive:!0}),_())}),Fe(()=>{m&&m.removeEventListener("scroll",_)}),{contentRef:v,activeAnchor:c,scrollToAnchor:f,updateActiveAnchor:_}}function xe(l){return l===0?"text-amber-500 dark:text-amber-400":l===1?"text-gray-500 dark:text-gray-300":l===2?"text-orange-600 dark:text-orange-400":"text-gray-400 dark:text-gray-500"}function ke(l){return String(l+1).padStart(2,"0")}function Xt(l){return l===0?"from-amber-400 to-orange-500":l===1?"from-gray-300 to-gray-400":l===2?"from-orange-400 to-amber-600":"from-primary-300 to-primary-500"}const ea={class:"sticky top-24 space-y-6"},ta={class:"border-l border-gray-200 dark:border-gray-800"},aa=["onClick"],sa=U({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(l,{emit:t}){const a=t;function n(r){a("click",r)}return(r,c)=>(o(),T("div",{class:K([l.width,"shrink-0",l.hideOnMobile?"hidden lg:block":""])},[s("div",ea,[s("nav",null,[s("div",ta,[(o(!0),T(q,null,Q(l.anchors,d=>(o(),T("button",{key:d.id,class:K(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[l.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:v=>n(d.id)},g(d.label),11,aa))),128))])]),oe(r.$slots,"default")])],2))}}),re=U({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=bt(l,"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 c=pt;return o(),C(c,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=d=>t.value=d),items:a,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),ge=U({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(l){const t=l,a=y(()=>typeof window>"u"?500:Math.round(window.innerHeight*t.maxHeightVh/100)),n=y(()=>t.contentHeight>a.value),r=y(()=>({maxHeight:`${t.maxHeightVh}vh`,overflowY:n.value?"auto":"hidden"}));return(c,d)=>(o(),T("div",{class:K(l.paddingClass),style:ve(r.value)},[oe(c.$slots,"default")],6))}}),oa=U({__name:"EChartGraph",props:{data:{},height:{default:400},layout:{default:"circular"},directed:{type:Boolean,default:!1}},setup(l,{expose:t}){Ye([Pt,Qe,Ot,Ze]);const a=l,n=y(()=>typeof a.height=="number"?`${a.height}px`:a.height),r=nt(),c=S(null);let d=null;const v=["#ee4567","#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#9a60b4","#fc8452","#3ba272","#ea7ccc","#6e7074","#546570"],m=y(()=>{const b=new Set;return a.data.nodes.filter(k=>b.has(k.name)?!1:(b.add(k.name),!0))}),_=y(()=>{const b=new Map;return m.value.forEach((k,w)=>{b.set(k.name,v[w%v.length])}),b});function f(b,k){return k<=0?1:1+b/k*5}const u=y(()=>{const b=a.data.maxLinkValue||Math.max(...a.data.links.map(k=>k.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:k=>k.dataType==="node"?`<b>${k.data.name}</b><br/>消息数: ${k.data.value||0}`:k.dataType==="edge"?`${k.data.source} → ${k.data.target}<br/>艾特次数: ${k.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:m.value.map(k=>{const w=_.value.get(k.name)||v[0];return{name:k.name,value:k.value,symbolSize:k.symbolSize||30,label:{show:a.layout==="circular"?!0:(k.symbolSize||30)>30},itemStyle:{color:w,borderColor:"#fff",borderWidth:2,shadowBlur:5,shadowColor:`${w}66`}}}),links:a.data.links.filter(k=>_.value.has(k.source)&&_.value.has(k.target)).map(k=>{const w=_.value.get(k.source)||v[0];return{source:k.source,target:k.target,value:k.value,lineStyle:{color:w,width:f(k.value||1,b)}}})}]}});function i(){c.value&&(d=Je(c.value,r.value?"dark":void 0,{renderer:"canvas"}),d.setOption({backgroundColor:"transparent",...u.value}))}function p(){d&&d.setOption({backgroundColor:"transparent",...u.value},{notMerge:!0})}function $(){d?.resize()}function h(){d&&d.dispatchAction({type:"restore"})}return t({resetView:h}),z([()=>a.data,()=>a.layout,()=>a.directed,r],()=>{d?p():i()},{deep:!0}),Te(()=>{i(),window.addEventListener("resize",$)}),Fe(()=>{window.removeEventListener("resize",$),d?.dispose()}),(b,k)=>(o(),T("div",{ref_key:"chartRef",ref:c,style:ve({height:n.value,width:"100%"})},null,4))}}),Xe=Symbol("ranking-width-mode"),et={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 fe(){const l=xt(Xe,null);return y(()=>et[l?.value??"standard"])}function ye(l,t){return l.length<=t?l:`${l.slice(0,t)}…`}const na={class:"px-3 py-2"},Se=U({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=fe(),n=y(()=>t.members.slice(0,t.topN)),r=y(()=>{if(t.height!=="auto")return t.height;const v=n.value.length*36;return Math.max(v+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},d=y(()=>{const v=[...n.value].reverse(),m=v.map(i=>ye(i.name,a.value.labelMaxLength)),_=v.map(i=>i.value),f=Math.max(..._,1),u=v.map(i=>({value:i.value,itemStyle:{color:c,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 $=n.value.length-1-p.dataIndex,h=n.value[$];return`
|
|
3
|
-
<div style="padding: 4px 8px;">
|
|
4
|
-
<div style="font-weight: bold; margin-bottom: 4px;">${h.name}</div>
|
|
5
|
-
<div>${h.value} ${t.unit} (${h.percentage}%)</div>
|
|
6
|
-
</div>
|
|
7
|
-
`}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:f*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:m,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:u,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} ${t.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(v,m)=>l.bare?(o(),C(e(ge),{key:0,"content-height":r.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(te,{option:d.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:I(()=>[s("div",na,[x(te,{option:d.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),la={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"},ia={class:"min-w-0 flex-1"},ra={class:"flex items-baseline justify-between gap-3"},ua=["title"],ca={class:"flex shrink-0 items-baseline gap-1.5 whitespace-nowrap"},da={class:"font-mono text-base font-black tabular-nums text-gray-900 dark:text-white"},ma={class:"text-xs text-gray-500 dark:text-gray-400"},va={class:"mt-2 flex items-center gap-2.5"},pa={class:"h-1.5 flex-1 overflow-hidden rounded-full bg-gray-100 dark:bg-white/5"},ha={class:"w-10 shrink-0 text-right font-mono text-[11px] tabular-nums text-gray-400 dark:text-gray-500"},Pe=U({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(l){const{t}=Z(),a=l,n=y(()=>a.unit||t("views.charts.rankList.unit")),r=y(()=>a.rankLimit>0?a.members.slice(0,a.rankLimit):a.members);function c(d){if(r.value.length===0)return 0;const v=r.value[0].value;return v===0?0:Math.round(r.value[d].value/v*100)}return(d,v)=>(o(),T("div",null,[(o(!0),T(q,null,Q(r.value,(m,_)=>(o(),T("div",{key:m.id,class:"flex items-start gap-3 px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[s("span",{class:K(["w-8 shrink-0 pt-0.5 text-center font-mono text-sm font-black tabular-nums",e(xe)(_)])},g(e(ke)(_)),3),l.showAvatar?(o(),T("div",la,g(m.name.slice(0,1)),1)):A("",!0),s("div",ia,[s("div",ra,[s("p",{class:"truncate text-sm font-medium text-gray-900 dark:text-white",title:m.name},g(m.name),9,ua),s("div",ca,[s("span",da,g(m.value),1),s("span",ma,g(n.value),1)])]),s("div",va,[s("div",pa,[s("div",{class:K(["h-full rounded-full bg-linear-to-r transition-all",e(Xt)(_)]),style:ve({width:`${c(_)}%`})},null,6)]),s("span",ha,g(m.percentage)+"% ",1)])])]))),128))]))}}),ga={class:"flex items-center gap-2"},fa={class:"shrink-0 whitespace-nowrap rounded-full bg-gray-100 px-2.5 py-1 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},ya={class:"no-capture"},ba={key:0,class:"no-capture px-3 pb-3 pt-1"},xa={class:"flex items-center gap-1.5"},ka={class:"flex w-full items-center justify-between border-b border-gray-100 px-6 py-5 dark:border-white/5"},wa={class:"min-w-0"},_a={class:"truncate text-base font-semibold text-gray-900 dark:text-white"},$a={class:"mt-1 text-xs text-gray-500 dark:text-gray-400"},Ca={class:"max-h-[70vh] overflow-y-auto"},tt=U({__name:"ExpandableListCard",props:{title:{},description:{},showViewAll:{type:Boolean},viewAllLabel:{},countLabel:{}},setup(l){const t=S(!1),a=S(null);return(n,r)=>{const c=he,d=pe,v=Ce;return o(),C(e(E),{title:l.title,description:l.description,"show-divider":!1},{headerRight:I(()=>[s("div",ga,[s("span",fa,g(l.countLabel),1),s("div",ya,[oe(n.$slots,"headerRight")])])]),default:I(()=>[s("div",null,[oe(n.$slots,"default")]),l.showViewAll?(o(),T("div",ba,[x(v,{open:t.value,"onUpdate:open":r[0]||(r[0]=m=>t.value=m),ui:{content:"md:w-full max-w-4xl"}},{content:I(()=>[s("div",{ref_key:"modalBodyRef",ref:a,class:"section-content flex flex-col overflow-hidden"},[s("div",ka,[s("div",wa,[s("h3",_a,g(l.title),1),s("p",$a,g(l.countLabel),1)]),x(Gt,{size:"xs",type:"element","target-element":a.value},null,8,["target-element"])]),s("div",Ca,[oe(n.$slots,"full")])],512)]),default:I(()=>[x(d,{color:"neutral",variant:"ghost",class:"w-full justify-center rounded-lg py-2.5 text-xs font-medium text-gray-500 dark:text-gray-400"},{default:I(()=>[s("span",xa,[Y(g(l.viewAllLabel)+" ",1),x(c,{name:"i-heroicons-arrow-right",class:"h-3.5 w-3.5"})])]),_:1})]),_:3},8,["open"])])):A("",!0)]),_:3},8,["title","description"])}}}),Ta=U({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(l){const{t}=Z(),a=l,n=y(()=>a.members.slice(0,a.topN)),r=y(()=>a.members.length>a.topN);return(c,d)=>(o(),C(tt,{title:l.title,description:l.description,"show-view-all":r.value,"view-all-label":e(t)("views.charts.rankListPro.fullRanking"),"count-label":e(t)("views.charts.rankListPro.memberCount",{count:l.members.length})},{headerRight:I(()=>[oe(c.$slots,"headerRight")]),full:I(()=>[x(Pe,{members:l.members,unit:l.unit},null,8,["members","unit"])]),default:I(()=>[x(Pe,{members:n.value,unit:l.unit},null,8,["members","unit"])]),_:3},8,["title","description","show-view-all","view-all-label","count-label"]))}}),Ia={key:0},Sa={class:"px-5 py-8 text-center text-sm text-gray-400"},_e=U({__name:"ListPro",props:{items:{},title:{},description:{},topN:{default:10},countLabel:{}},setup(l){const{t}=Z(),a=l,n=y(()=>a.items.slice(0,a.topN)),r=y(()=>a.items.length>a.topN),c=y(()=>a.countLabel?a.countLabel:t("views.charts.listPro.countTemplate",{count:a.items.length}));return(d,v)=>(o(),C(tt,{title:l.title,description:l.description,"show-view-all":r.value,"view-all-label":e(t)("views.charts.listPro.fullRanking"),"count-label":c.value},{headerRight:I(()=>[oe(d.$slots,"headerRight")]),full:I(()=>[s("div",null,[(o(!0),T(q,null,Q(l.items,(m,_)=>(o(),T("div",{key:_,class:"group/list-row px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[oe(d.$slots,"item",{item:m,index:_})]))),128))])]),default:I(()=>[oe(d.$slots,"config"),s("div",null,[(o(!0),T(q,null,Q(n.value,(m,_)=>(o(),T("div",{key:_,class:"group/list-row px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[oe(d.$slots,"item",{item:m,index:_})]))),128))]),l.items.length===0?(o(),T("div",Ia,[oe(d.$slots,"empty",{},()=>[s("div",Sa,g(e(t)("views.charts.listPro.empty")),1)])])):A("",!0)]),_:3},8,["title","description","show-view-all","view-all-label","count-label"]))}}),Va={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Ra={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ma={class:"p-5"},La={class:"p-5"},Da=U({__name:"OverviewTab",props:{session:{},memberActivity:{},topMembers:{},bottomMembers:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,{dailyChartData:n}=It(()=>a.dailyActivity),r=y(()=>({labels:a.messageTypes.map(d=>Ht(d.type,t)),values:a.messageTypes.map(d=>d.count)})),c=y(()=>{const d=[...a.memberActivity].sort((u,i)=>i.messageCount-u.messageCount),v=d.slice(0,10),m=d.slice(10).reduce((u,i)=>u+i.messageCount,0),_=v.map(u=>u.name),f=v.map(u=>u.messageCount);return m>0&&(_.push(t("analysis.overview.others")),f.push(m)),{labels:_,values:f}});return(d,v)=>(o(),T("div",Va,[x(Ct,{session:l.session,"daily-activity":l.dailyActivity,"message-types":l.messageTypes,"hourly-activity":l.hourlyActivity,"time-range":l.timeRange,"filtered-message-count":l.filteredMessageCount,"filtered-member-count":l.filteredMemberCount,"time-filter":l.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","filtered-message-count","filtered-member-count","time-filter"]),s("div",Ra,[x(e(E),{title:e(t)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:I(()=>[s("div",Ma,[x(e(Ee),{data:r.value,height:280},null,8,["data"])])]),_:1},8,["title"]),x(e(E),{title:e(t)("analysis.overview.memberDistribution"),"show-divider":!1},{default:I(()=>[s("div",La,[x(e(Ee),{data:c.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),x(Tt,{"daily-activity":l.dailyActivity,"daily-chart-data":e(n)},null,8,["daily-activity","daily-chart-data"])]))}}),Na={class:"flex h-full flex-col"},Aa={class:"flex items-center justify-end px-4 py-2"},Ua={class:"flex items-center gap-4"},Fa={class:"flex items-center gap-2"},Ba={class:"text-xs text-gray-400"},qa={class:"flex items-center gap-2"},za={class:"text-xs text-gray-400"},Ha={class:"flex-1 min-h-0 relative"},Ea={key:0,class:"absolute inset-0 flex items-center justify-center"},Pa={key:0,class:"h-full"},Oa={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"},Wa={key:1,class:"flex h-full items-center justify-center text-gray-400"},Ka={class:"text-center"},ja={class:"mt-2 text-sm"},Ga=U({__name:"InteractionView",props:{sessionId:{},timeFilter:{}},setup(l){const t=l,{t:a}=Z(),n=S(!0),r=S({nodes:[],links:[],maxLinkValue:0}),c=S("circular"),d=S(!1),v=S(null);function m(){v.value?.resetView()}async function _(){if(t.sessionId){n.value=!0;try{const f=await X().getMentionGraph(t.sessionId,t.timeFilter);r.value={nodes:f.nodes,links:f.links,maxLinkValue:f.maxLinkValue}}catch(f){console.error("[chart-interaction] 加载互动关系图数据失败:",f)}finally{n.value=!1}}}return z(()=>[t.sessionId,t.timeFilter],()=>{_()},{immediate:!0,deep:!0}),(f,u)=>{const i=pe,p=je("UButtonGroup"),$=Oe,h=he;return o(),T("div",Na,[s("div",Aa,[s("div",Ua,[s("div",Fa,[s("span",Ba,g(e(a)("views.interaction.layout"))+":",1),x(p,{size:"xs"},{default:I(()=>[x(i,{color:c.value==="circular"?"primary":"neutral",variant:c.value==="circular"?"solid":"ghost",onClick:u[0]||(u[0]=b=>c.value="circular")},{default:I(()=>[Y(g(e(a)("views.interaction.circular")),1)]),_:1},8,["color","variant"]),x(i,{color:c.value==="force"?"primary":"neutral",variant:c.value==="force"?"solid":"ghost",onClick:u[1]||(u[1]=b=>c.value="force")},{default:I(()=>[Y(g(e(a)("views.interaction.force")),1)]),_:1},8,["color","variant"])]),_:1})]),s("div",qa,[s("span",za,g(e(a)("views.interaction.directed"))+":",1),x($,{modelValue:d.value,"onUpdate:modelValue":u[2]||(u[2]=b=>d.value=b),size:"xs"},null,8,["modelValue"])]),x(i,{size:"xs",color:"neutral",variant:"ghost",icon:"i-heroicons-arrow-path",onClick:m},{default:I(()=>[Y(g(e(a)("views.interaction.reset")),1)]),_:1})])]),s("div",Ha,[n.value?(o(),T("div",Ea,[x(h,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):(o(),T(q,{key:1},[r.value.nodes.length>0?(o(),T("div",Pa,[x(e(oa),{ref_key:"graphRef",ref:v,data:r.value,layout:c.value,directed:d.value,height:"100%"},null,8,["data","layout","directed"]),s("div",Oa,g(e(a)("views.interaction.graphHint",{nodes:r.value.nodes.length,links:r.value.links.length})),1)])):(o(),T("div",Wa,[s("div",Ka,[x(h,{name:"i-heroicons-user-group",class:"mx-auto h-10 w-10 text-gray-300 dark:text-gray-600"}),s("p",ja,g(e(a)("views.interaction.noInteraction")),1)])]))],64))])])}}}),Ya={class:"main-content mx-auto max-w-3xl p-6"},Qa=U({__name:"Relationships",props:{sessionId:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,n=S(null),r=S(!1);async function c(){if(a.sessionId){r.value=!0;try{n.value=await X().getMentionAnalysis(a.sessionId,a.timeFilter)}catch(i){console.error("加载 @ 互动分析失败:",i)}finally{r.value=!1}}}const d=y(()=>n.value?n.value.topMentioners.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]),v=y(()=>n.value?n.value.topMentioned.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]),m=S("mentioners"),_=y(()=>[{label:t("members.relationships.rankModes.mentioners"),value:"mentioners"},{label:t("members.relationships.rankModes.mentioned"),value:"mentioned"}]),f=y(()=>m.value==="mentioners"?d.value:v.value),u=y(()=>m.value==="mentioners"?t("members.relationships.topMentionersDescription"):t("members.relationships.topMentionedDescription"));return z(()=>[a.sessionId,a.timeFilter],()=>{c()},{immediate:!0,deep:!0}),(i,p)=>(o(),T("div",Ya,[r.value?(o(),C(e(ae),{key:0,text:e(t)("members.relationships.loading")},null,8,["text"])):n.value&&n.value.totalMentions>0&&f.value.length>0?(o(),C(e(Ta),{key:1,members:f.value,title:e(t)("members.relationships.rankingTitle"),description:u.value,unit:e(t)("members.relationships.times")},{headerRight:I(()=>[x(e(ie),{modelValue:m.value,"onUpdate:modelValue":p[0]||(p[0]=$=>m.value=$),items:_.value,size:"sm"},null,8,["modelValue","items"])]),_:1},8,["members","title","description","unit"])):(o(),C(e(E),{key:2,title:e(t)("members.relationships.emptyTitle")},{default:I(()=>[x(e(le),{text:e(t)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"]))]))}}),Za={class:"mx-auto max-w-[920px] p-4 h-full"},Ja={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"},Xa={class:"flex items-center gap-3"},es={class:"flex items-center gap-3"},ts={class:"p-3 w-64"},as={class:"text-sm font-medium mb-3"},ss={class:"space-y-3"},os={class:"text-xs text-gray-500 mb-1 block"},ns={class:"text-xs text-gray-400 mt-1"},ls={class:"text-xs text-gray-500 mb-1 block"},is={class:"text-xs text-gray-400 mt-1"},rs={class:"flex-1 min-h-0 overflow-hidden"},us={key:0,class:"h-full flex items-center justify-center"},cs={key:1,class:"h-full flex items-center justify-center"},ds={class:"text-center text-gray-400"},ms={key:2,class:"h-full"},vs={key:3,class:"h-full flex overflow-hidden"},ps={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},hs={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},gs={class:"text-sm font-medium flex items-center gap-2"},fs={class:"flex-1 overflow-y-auto"},ys=["onClick"],bs={class:"flex items-center justify-between"},xs={class:"text-sm truncate"},ks={class:"text-xs text-gray-400"},ws={class:"flex-1 overflow-hidden flex flex-col"},_s={key:0,class:"flex-1 flex items-center justify-center"},$s={class:"text-center text-gray-400"},Cs={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},Ts={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},Is={class:"font-medium"},Ss={class:"text-xs text-gray-400"},Vs={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Rs={class:"text-sm font-medium flex items-center gap-2"},Ms={class:"flex-1 overflow-y-auto"},Ls={key:0,class:"p-4 text-center text-gray-400"},Ds={class:"flex items-center gap-3"},Ns={class:"flex-1 min-w-0"},As={class:"text-sm font-medium truncate"},Us={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},Fs={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Bs={key:4,class:"h-full flex flex-col overflow-hidden"},qs={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},zs={class:"text-sm font-medium flex items-center gap-2"},Hs={class:"flex-1 overflow-y-auto"},Es={class:"flex items-center gap-3"},Ps={class:"flex-1 min-w-0"},Os={class:"flex items-center gap-2 text-sm"},Ws={class:"font-medium truncate"},Ks={class:"font-medium truncate"},js={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},Gs={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Ys={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"},Qs=U({__name:"ClusterView",props:{sessionId:{},timeFilter:{}},setup(l){Ye([Wt,Qe,Kt,jt,Ze]);const t=l,{t:a}=Z(),n=lt(),r=y(()=>n.value==="dark"),c=S(!0),d=S(null),v=S("matrix"),m=S(null),_=S({lookAhead:3,decaySeconds:120,topEdges:150}),f=S(null);let u=null;async function i(){if(t.sessionId){c.value=!0;try{d.value=await X().getClusterGraph(t.sessionId,t.timeFilter,{lookAhead:_.value.lookAhead,decaySeconds:_.value.decaySeconds,topEdges:_.value.topEdges})}catch(F){console.error("[chart-cluster] 加载小团体关系数据失败:",F),d.value=null}finally{c.value=!1}}}const p=y(()=>{if(!d.value||d.value.nodes.length===0)return null;const{nodes:F,links:B,maxLinkValue:H}=d.value,G=[...F].sort((L,W)=>W.messageCount-L.messageCount).slice(0,20).map(L=>L.name),ee=new Map;for(const L of B)ee.set(`${L.source}-${L.target}`,L.value),ee.set(`${L.target}-${L.source}`,L.value);const j=[];for(let L=0;L<G.length;L++)for(let W=0;W<G.length;W++)if(L===W)j.push([L,W,-1]);else{const de=ee.get(`${G[L]}-${G[W]}`)||0;j.push([L,W,de])}return{names:G,data:j,maxValue:H}});function $(){if(!p.value)return{graphic:{type:"text",style:{text:a("views.cluster.noData"),fill:"#999"}}};const{names:F,data:B,maxValue:H}=p.value;return{tooltip:{position:"top",formatter:se=>{const[G,ee,j]=se.data;return j<0?`${F[G]}`:j===0?`${F[G]} ↔ ${F[ee]}<br/>暂无关系数据`:`${F[G]} ↔ ${F[ee]}<br/>临近度: ${j.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:H||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:B.filter(se=>se[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const h=y(()=>d.value?[...d.value.nodes].sort((F,B)=>B.messageCount-F.messageCount):[]),b=y(()=>!d.value||m.value===null?null:d.value.nodes.find(F=>F.id===m.value)||null),k=y(()=>{if(!d.value||!b.value)return[];const F=b.value.name,B=[];for(const H of d.value.links)H.source===F?B.push({otherName:H.target,value:H.value,coOccurrenceCount:H.coOccurrenceCount}):H.target===F&&B.push({otherName:H.source,value:H.value,coOccurrenceCount:H.coOccurrenceCount});return B.sort((H,se)=>se.value-H.value),B}),w=y(()=>d.value?d.value.links.slice(0,50):[]);function R(){u&&v.value==="matrix"&&u.setOption($(),{notMerge:!0})}function P(){f.value&&(u=Je(f.value,r.value?"dark":void 0),R())}function O(){u?.resize()}return z(v,async(F,B)=>{B==="matrix"&&u&&(u.dispose(),u=null),F==="matrix"&&(await De(),P())}),z([d,()=>r.value],()=>{v.value==="matrix"&&R()},{deep:!0}),z(c,async(F,B)=>{B&&!F&&v.value==="matrix"&&(u&&(u.dispose(),u=null),await De(),P())}),z(()=>[t.sessionId,t.timeFilter],()=>i(),{immediate:!0,deep:!0}),Te(()=>{window.addEventListener("resize",O),v.value==="matrix"&&De(()=>P())}),Fe(()=>{window.removeEventListener("resize",O),u?.dispose(),u=null}),(F,B)=>{const H=pe,se=je("UButtonGroup"),G=We,ee=ht,j=he;return o(),T("div",Za,[x(e(Yt),{class:"flex h-full flex-col"},{default:I(()=>[s("div",Ja,[s("div",Xa,[x(se,{size:"xs"},{default:I(()=>[x(H,{color:v.value==="matrix"?"primary":"neutral",variant:v.value==="matrix"?"solid":"ghost",onClick:B[0]||(B[0]=L=>v.value="matrix")},{default:I(()=>[Y(g(e(a)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),x(H,{color:v.value==="member"?"primary":"neutral",variant:v.value==="member"?"solid":"ghost",onClick:B[1]||(B[1]=L=>v.value="member")},{default:I(()=>[Y(g(e(a)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),x(H,{color:v.value==="circle"?"primary":"neutral",variant:v.value==="circle"?"solid":"ghost",onClick:B[2]||(B[2]=L=>v.value="circle")},{default:I(()=>[Y(g(e(a)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])]),_:1})]),s("div",es,[x(ee,null,{content:I(()=>[s("div",ts,[s("h4",as,g(e(a)("views.cluster.modelSettings")),1),s("div",ss,[s("div",null,[s("label",os,g(e(a)("views.cluster.lookAhead")),1),x(G,{modelValue:_.value.lookAhead,"onUpdate:modelValue":B[3]||(B[3]=L=>_.value.lookAhead=L),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),s("p",ns,g(e(a)("views.cluster.lookAheadDesc")),1)]),s("div",null,[s("label",ls,g(e(a)("views.cluster.decaySeconds")),1),x(G,{modelValue:_.value.decaySeconds,"onUpdate:modelValue":B[4]||(B[4]=L=>_.value.decaySeconds=L),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),s("p",is,g(e(a)("views.cluster.decaySecondsDesc")),1)]),x(H,{size:"xs",color:"primary",class:"w-full mt-2",onClick:i},{default:I(()=>[Y(g(e(a)("views.cluster.applySettings")),1)]),_:1})])])]),default:I(()=>[x(H,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),x(H,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:i})])]),s("div",rs,[c.value?(o(),T("div",us,[x(j,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!d.value||d.value.nodes.length===0?(o(),T("div",cs,[s("div",ds,[x(j,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),s("p",null,g(e(a)("views.cluster.noData")),1)])])):v.value==="matrix"?(o(),T("div",ms,[s("div",{ref_key:"chartRef",ref:f,class:"w-full h-full"},null,512)])):v.value==="member"?(o(),T("div",vs,[s("div",ps,[s("div",hs,[s("h3",gs,[x(j,{name:"i-heroicons-users",class:"w-4 h-4"}),Y(" "+g(e(a)("views.cluster.selectMember")),1)])]),s("div",fs,[(o(!0),T(q,null,Q(h.value,L=>(o(),T("div",{key:L.id,class:K(["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":m.value===L.id}]),onClick:W=>m.value=L.id},[s("div",bs,[s("span",xs,g(L.name),1),s("span",ks,g(L.messageCount),1)])],10,ys))),128))])]),s("div",ws,[b.value?(o(),T(q,{key:1},[s("div",Cs,[s("div",Ts,g(b.value.name.charAt(0)),1),s("div",null,[s("div",Is,g(b.value.name),1),s("div",Ss,g(e(a)("views.cluster.msgCount"))+": "+g(b.value.messageCount)+" | "+g(e(a)("views.cluster.relationCount"))+": "+g(k.value.length),1)])]),s("div",Vs,[s("h3",Rs,[x(j,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),Y(" "+g(e(a)("views.cluster.relationsByIntimacy")),1)])]),s("div",Ms,[k.value.length===0?(o(),T("div",Ls,g(e(a)("views.cluster.noRelations")),1)):A("",!0),(o(!0),T(q,null,Q(k.value,(L,W)=>(o(),T("div",{key:L.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"},[s("div",Ds,[s("span",{class:K(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",W<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"])},g(W+1),3),s("div",Ns,[s("div",As,g(L.otherName),1),s("div",Us,[s("span",null,g(e(a)("views.cluster.intimacy"))+": "+g((L.value*100).toFixed(0))+"%",1),s("span",null,g(e(a)("views.cluster.coOccurrence"))+": "+g(L.coOccurrenceCount)+g(e(a)("views.cluster.times")),1)])]),s("div",Fs,[s("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:ve({width:`${k.value[0]?.value?L.value/k.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(o(),T("div",_s,[s("div",$s,[x(j,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),s("p",null,g(e(a)("views.cluster.selectMemberHint")),1)])]))])])):(o(),T("div",Bs,[s("div",qs,[s("h3",zs,[x(j,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),Y(" "+g(e(a)("views.cluster.interactionRanking")),1)])]),s("div",Hs,[(o(!0),T(q,null,Q(w.value,(L,W)=>(o(),T("div",{key:W,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[s("div",Es,[s("span",{class:K(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",W<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"])},g(W+1),3),s("div",Ps,[s("div",Os,[s("span",Ws,g(L.source),1),B[5]||(B[5]=s("span",{class:"text-gray-400"},"↔",-1)),s("span",Ks,g(L.target),1)]),s("div",js,[s("span",null,g(e(a)("views.cluster.score"))+": "+g(L.value.toFixed(2)),1),s("span",null,g(e(a)("views.cluster.coOccurrence"))+": "+g(L.coOccurrenceCount)+g(e(a)("views.cluster.times")),1)])]),s("div",Gs,[s("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:ve({width:`${w.value[0]?.value?L.value/w.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),d.value?(o(),T("div",Ys,[s("span",null,g(e(a)("views.cluster.totalMembers"))+": "+g(d.value.stats.totalMembers),1),s("span",null,g(e(a)("views.cluster.totalMessages"))+": "+g(d.value.stats.totalMessages.toLocaleString()),1),s("span",null,g(e(a)("views.cluster.involvedMembers"))+": "+g(d.value.stats.involvedMembers),1),s("span",null,g(e(a)("views.cluster.edgeCount"))+": "+g(d.value.stats.edgeCount),1)])):A("",!0)]),_:1})])}}}),Zs={class:"flex h-full flex-col"},Js={class:"min-h-0 flex-1 overflow-y-auto"},Xs=U({__name:"GroupRelationships",props:{sessionId:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,n=S("mention-graph"),r=y(()=>[{id:"mention-graph",label:t("analysis.subTabs.groupRelationships.mentionGraph"),icon:"i-heroicons-arrows-right-left"},{id:"mention-ranking",label:t("analysis.subTabs.groupRelationships.mentionRanking"),icon:"i-heroicons-heart"},{id:"proximity",label:t("analysis.subTabs.groupRelationships.proximity"),icon:"i-heroicons-user-group"}]);return(c,d)=>(o(),T("div",Zs,[x(e(Ae),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=v=>n.value=v),items:r.value,"persist-key":"groupRelationshipsTab"},null,8,["modelValue","items"]),s("div",Js,[x(Ie,{name:"fade",mode:"out-in"},{default:I(()=>[n.value==="mention-graph"?(o(),C(Ga,{key:0,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):n.value==="mention-ranking"?(o(),C(Qa,{key:1,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):n.value==="proximity"?(o(),C(Qs,{key:2,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):A("",!0)]),_:1})])]))}}),eo=$e(Xs,[["__scopeId","data-v-a5aec593"]]);function to(l,t){return{keywords:[l],...t?.memberId!=null?{memberId:t.memberId}:{}}}const ao={class:"main-content mx-auto max-w-3xl p-6"},so=["aria-label","onClick"],oo=["title"],no={class:"flex shrink-0 items-center gap-3 pl-2"},lo={class:"font-mono text-sm font-black tabular-nums text-primary-600 dark:text-primary-400"},io={class:"grid w-full grid-cols-[2rem_minmax(0,1fr)] items-start gap-x-3 sm:grid-cols-[2rem_minmax(7.5rem,0.65fr)_minmax(0,1.35fr)]"},ro=["title"],uo={class:"col-start-2 row-start-2 mt-1.5 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1.5 sm:col-start-3 sm:row-start-1 sm:mt-0"},co=["title","aria-label","onClick"],mo={class:"max-w-40 truncate text-sm text-gray-700 transition-colors group-hover/phrase:text-primary-600 dark:text-gray-200 dark:group-hover/phrase:text-primary-400"},vo={class:"shrink-0 font-mono text-[11px] tabular-nums text-gray-400 dark:text-gray-500"},po=U({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(l){const{t}=Z(),a=Ue(),n=l,r=S(null),c=S(!1),d=y(()=>r.value?.members??[]),v=y(()=>n.timeFilter?.memberId!=null),m=y(()=>v.value?d.value[0]??null:null),_=y(()=>m.value?t("quotes.catchphrase.memberTitle",{name:m.value.name}):t("quotes.catchphrase.title")),f=y(()=>v.value?t("quotes.catchphrase.memberDescription"):t("quotes.catchphrase.description"));async function u(){if(n.sessionId){c.value=!0;try{r.value=await X().getCatchphraseAnalysis(n.sessionId,n.timeFilter)}catch($){console.error("Failed to load catchphrase analysis:",$)}finally{c.value=!1}}}function i($){a.openChatRecordDrawer(to($,n.timeFilter))}function p($){return $.catchphrases.slice(0,5)}return z(()=>[n.sessionId,n.timeFilter],()=>{u()},{immediate:!0,deep:!0}),($,h)=>{const b=he;return o(),T("div",ao,[c.value?(o(),C(e(ae),{key:0,text:e(t)("quotes.catchphrase.loading")},null,8,["text"])):m.value?(o(),C(e(_e),{key:1,items:m.value.catchphrases,title:_.value,description:f.value,"top-n":10,"count-label":e(t)("quotes.catchphrase.phraseCount",{count:m.value.catchphrases.length})},{item:I(({item:k,index:w})=>[s("button",{type:"button",class:"group/item grid w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40","aria-label":`${e(t)("quotes.catchphrase.viewChat")}: ${k.content}`,onClick:R=>i(k.content)},[s("span",{class:K(["w-8 shrink-0 text-center font-mono text-sm font-black tabular-nums",e(xe)(w)])},g(e(ke)(w)),3),s("p",{class:"line-clamp-2 min-w-0 text-sm font-medium leading-5 text-gray-900 dark:text-white",title:k.content},g(k.content),9,oo),s("div",no,[s("span",lo,g(e(t)("quotes.catchphrase.times",{count:k.count})),1),x(b,{name:"i-heroicons-chevron-right",class:"h-4 w-4 text-gray-300 transition-colors group-hover/item:text-gray-500 dark:text-gray-600 dark:group-hover/item:text-gray-400"})])],8,so)]),_:1},8,["items","title","description","count-label"])):d.value.length>0?(o(),C(e(_e),{key:2,items:d.value,title:_.value,description:f.value,"top-n":10,"count-label":e(t)("quotes.catchphrase.memberCount",{count:d.value.length})},{item:I(({item:k,index:w})=>[s("div",io,[s("span",{class:K(["row-span-2 w-8 shrink-0 pt-0.5 text-center font-mono text-sm font-black tabular-nums sm:row-span-1",e(xe)(w)])},g(e(ke)(w)),3),s("p",{class:"col-start-2 row-start-1 min-w-0 truncate pt-0.5 text-sm font-semibold text-gray-900 dark:text-white",title:k.name},g(k.name),9,ro),s("div",uo,[(o(!0),T(q,null,Q(p(k),R=>(o(),T("button",{key:R.content,type:"button",class:"group/phrase inline-flex max-w-full items-baseline gap-1 rounded text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40",title:R.content,"aria-label":`${e(t)("quotes.catchphrase.viewChat")}: ${R.content}`,onClick:P=>i(R.content)},[s("span",mo," “"+g(R.content)+"” ",1),s("span",vo,g(e(t)("quotes.catchphrase.times",{count:R.count})),1)],8,co))),128))])])]),_:1},8,["items","title","description","count-label"])):(o(),C(e(E),{key:3,title:_.value,description:f.value,"show-divider":!1},{default:I(()=>[x(e(le),{text:e(t)("quotes.catchphrase.empty.title")},null,8,["text"])]),_:1},8,["title","description"]))])}}}),ho={class:"main-content mx-auto max-w-3xl p-6"},go=["aria-label","onClick"],fo={class:"min-w-0"},yo=["title"],bo={class:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},xo={class:"truncate"},ko={class:"shrink-0"},wo={class:"flex shrink-0 items-center gap-3 pl-2"},_o={class:"text-right"},$o={class:"font-mono text-sm font-black tabular-nums text-primary-600 dark:text-primary-400"},Co={class:"mt-0.5 text-[11px] text-gray-400 dark:text-gray-500"},To=U({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,n=Ue(),r=S(null),c=S(!1);async function d(){if(a.sessionId){c.value=!0;try{r.value=await X().getRepeatAnalysis(a.sessionId,a.timeFilter)}catch(m){console.error("Failed to load repeat analysis:",m)}finally{c.value=!1}}}function v(m){n.openChatRecordDrawer({scrollToMessageId:m.firstMessageId,highlightKeywords:[m.content]})}return z(()=>[a.sessionId,a.timeFilter],()=>{d()},{immediate:!0,deep:!0}),(m,_)=>{const f=he;return o(),T("div",ho,[c.value?(o(),C(e(ae),{key:0,text:e(t)("quotes.hotRepeat.loading")},null,8,["text"])):r.value&&r.value.hotContents.length>0?(o(),C(e(_e),{key:1,items:r.value.hotContents,title:e(t)("quotes.hotRepeat.title"),description:e(t)("quotes.hotRepeat.description"),"top-n":10,"count-label":e(t)("quotes.hotRepeat.countTemplate",{count:r.value.hotContents.length})},{item:I(({item:u,index:i})=>[s("button",{type:"button",class:"group/item grid w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40","aria-label":`${e(t)("quotes.hotRepeat.viewChat")}: ${u.content}`,onClick:p=>v(u)},[s("span",{class:K(["w-8 shrink-0 text-center font-mono text-sm font-black tabular-nums",e(xe)(i)])},g(e(ke)(i)),3),s("div",fo,[s("p",{class:"line-clamp-2 text-sm font-medium leading-5 text-gray-900 dark:text-white",title:u.content},g(u.content),9,yo),s("div",bo,[s("span",xo,g(u.originatorName),1),_[0]||(_[0]=s("span",{"aria-hidden":"true"},"·",-1)),s("span",ko,g(e(Ne)(u.lastTs)),1)])]),s("div",wo,[s("div",_o,[s("p",$o,g(e(t)("quotes.hotRepeat.people",{count:u.maxChainLength})),1),s("p",Co,g(e(t)("quotes.hotRepeat.times",{count:u.count})),1)]),x(f,{name:"i-heroicons-chevron-right",class:"h-4 w-4 text-gray-300 transition-colors group-hover/item:text-gray-500 dark:text-gray-600 dark:group-hover/item:text-gray-400"})])],8,go)]),_:1},8,["items","title","description","count-label"])):(o(),C(e(E),{key:2,title:e(t)("quotes.hotRepeat.title")},{default:I(()=>[x(e(le),{text:e(t)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Io={class:"flex h-full flex-col"},So={class:"flex-1 min-h-0 overflow-y-auto"},Vo=U({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,n=y(()=>[{id:"type-analysis",label:t("analysis.subTabs.view.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:t("analysis.subTabs.view.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:t("analysis.subTabs.view.topic"),icon:"i-heroicons-cloud"},{id:"group-relationships",label:t("analysis.subTabs.view.groupRelationships"),icon:"i-heroicons-heart"}]),r=S("type-analysis"),c=S(null),d=y(()=>({...a.timeFilter,memberId:c.value}));return(v,m)=>(o(),T("div",Io,[x(e(Ae),{modelValue:r.value,"onUpdate:modelValue":m[1]||(m[1]=_=>r.value=_),items:n.value,"persist-key":"groupViewTab"},{right:I(()=>[r.value!=="topic"?(o(),C(Ge,{key:0,modelValue:c.value,"onUpdate:modelValue":m[0]||(m[0]=_=>c.value=_),"session-id":a.sessionId},null,8,["modelValue","session-id"])):A("",!0)]),_:1},8,["modelValue","items"]),s("div",So,[x(Ie,{name:"fade",mode:"out-in"},{default:I(()=>[r.value==="type-analysis"?(o(),C(St,{key:0,"session-id":a.sessionId,"session-name":a.sessionName,"time-filter":d.value},null,8,["session-id","session-name","time-filter"])):r.value==="time-analysis"?(o(),C(Vt,{key:1,"session-id":a.sessionId,"session-name":a.sessionName,"time-filter":d.value},null,8,["session-id","session-name","time-filter"])):r.value==="topic"?(o(),C(e(Rt),{key:2,"session-id":a.sessionId,"time-filter":a.timeFilter},null,8,["session-id","time-filter"])):r.value==="group-relationships"?(o(),C(eo,{key:3,"session-id":a.sessionId,"time-filter":d.value},null,8,["session-id","time-filter"])):A("",!0)]),_:1})])]))}}),Ro=$e(Vo,[["__scopeId","data-v-ddbcce42"]]),Mo={class:"border-b border-gray-100 p-4 dark:border-gray-800"},Lo={class:"mb-3 flex flex-wrap items-center gap-2"},Do={class:"text-xs text-gray-500 dark:text-gray-400"},No=["onClick"],Ao={class:"p-4"},Uo={class:"mb-3 font-semibold text-gray-900 dark:text-white"},Fo={class:"space-y-3"},Bo={class:"mb-1 block text-xs text-gray-500"},qo={class:"mb-1 block text-xs text-gray-500"},zo={class:"flex flex-wrap items-center gap-2"},Ho={class:"mt-4 flex justify-end gap-2"},Eo={class:"flex flex-wrap items-center gap-2"},Po={class:"mt-1.5 text-xs text-gray-400"},Oo={key:0,class:"border-b border-gray-100 px-5 py-4 dark:border-gray-800"},Wo={class:"mb-3 flex items-center justify-between"},Ko={class:"text-base font-medium text-gray-700 dark:text-gray-300"},jo={class:"flex cursor-pointer items-center gap-1.5 text-xs text-gray-500"},Go={class:"flex flex-wrap gap-2"},Yo={class:"text-xs text-gray-500"},Qo={class:"flex items-center gap-3"},Zo={class:"w-32 shrink-0"},Jo={class:"truncate font-medium text-gray-900 dark:text-white"},Xo={class:"flex flex-1 items-center"},en={class:"flex h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-white/5"},tn=["title"],an={class:"flex shrink-0 items-baseline gap-2"},sn={class:"font-mono text-base font-black tabular-nums text-gray-900 dark:text-white"},on={class:"text-xs text-gray-500"},nn={key:0,class:"flex h-64 flex-col items-center justify-center text-gray-400"},ln={class:"text-sm"},rn={key:1,class:"h-64"},un=U({__name:"KeywordRankingTab",props:{sessionId:{},timeFilter:{}},setup(l){const{t}=Z(),a=l,n=it(),r=S(!1),c={bg:"bg-pink-400",text:"text-pink-700",badge:"pink",wrapBg:"bg-pink-50 dark:bg-pink-900/20"},d=[{bg:"bg-amber-400",text:"text-amber-700",badge:"amber",wrapBg:"bg-amber-50 dark:bg-amber-900/20"},{bg:"bg-pink-400",text:"text-pink-700",badge:"pink",wrapBg:"bg-pink-50 dark:bg-pink-900/20"},{bg:"bg-blue-400",text:"text-blue-700",badge:"blue",wrapBg:"bg-blue-50 dark:bg-blue-900/20"},{bg:"bg-green-400",text:"text-green-700",badge:"green",wrapBg:"bg-green-50 dark:bg-green-900/20"},{bg:"bg-purple-400",text:"text-purple-700",badge:"purple",wrapBg:"bg-purple-50 dark:bg-purple-900/20"},{bg:"bg-red-400",text:"text-red-700",badge:"red",wrapBg:"bg-red-50 dark:bg-red-900/20"},{bg:"bg-cyan-400",text:"text-cyan-700",badge:"cyan",wrapBg:"bg-cyan-50 dark:bg-cyan-900/20"},{bg:"bg-orange-400",text:"text-orange-700",badge:"orange",wrapBg:"bg-orange-50 dark:bg-orange-900/20"}];function v(V){if(!r.value)return c;const M=i.value.indexOf(V);return d[M%d.length]}const m=["laugh","sad","praise","slacker","gossip","polite","curious"],_=y(()=>[{id:"laugh",name:t("quotes.keywords.templates.laugh.name"),keywords:t("quotes.keywords.templates.laugh.keywords").split(","),description:t("quotes.keywords.templates.laugh.description")},{id:"sad",name:t("quotes.keywords.templates.sad.name"),keywords:t("quotes.keywords.templates.sad.keywords").split(","),description:t("quotes.keywords.templates.sad.description")},{id:"praise",name:t("quotes.keywords.templates.praise.name"),keywords:t("quotes.keywords.templates.praise.keywords").split(","),description:t("quotes.keywords.templates.praise.description")},{id:"slacker",name:t("quotes.keywords.templates.slacker.name"),keywords:t("quotes.keywords.templates.slacker.keywords").split(","),description:t("quotes.keywords.templates.slacker.description")},{id:"gossip",name:t("quotes.keywords.templates.gossip.name"),keywords:t("quotes.keywords.templates.gossip.keywords").split(","),description:t("quotes.keywords.templates.gossip.description")},{id:"polite",name:t("quotes.keywords.templates.polite.name"),keywords:t("quotes.keywords.templates.polite.keywords").split(","),description:t("quotes.keywords.templates.polite.description")},{id:"curious",name:t("quotes.keywords.templates.curious.name"),keywords:t("quotes.keywords.templates.curious.keywords").split(","),description:t("quotes.keywords.templates.curious.description")}]),f=y(()=>{const V=n.customKeywordTemplates.map(ue=>({...ue,isCustom:!0}));return[..._.value.filter(ue=>!n.deletedPresetTemplateIds.includes(ue.id)),...V]}),u=S("laugh"),i=S([]);z(_,V=>{V.length>0&&i.value.length===0&&(i.value=[...V[0].keywords])},{immediate:!0});const p=y(()=>{const V=f.value.find(M=>M.id===u.value);return V?V.name:""}),$=S(null),h=S(!1),b=S(!1),k=S(null),w=S(""),R=S([]),P=S(""),O=y(()=>k.value!==null),F=y(()=>O.value?t("quotes.keywords.modal.editTitle"):t("quotes.keywords.modal.createTitle"));function B(){k.value=null,w.value="",R.value=[],P.value="",b.value=!0}function H(V){k.value=V.id,w.value=V.name,R.value=[...V.keywords],b.value=!0}function se(){const V=P.value.trim();V&&!R.value.includes(V)&&(R.value=[...R.value,V]),P.value=""}function G(V){R.value=R.value.filter(M=>M!==V)}function ee(V){u.value=V.id,i.value=[...V.keywords],$.value=null,ne()}function j(){i.value=[],$.value=null,u.value=""}const L=S("");function W(){const V=L.value.trim();V&&!i.value.includes(V)&&(i.value=[...i.value,V],ne()),L.value=""}function de(V){i.value=i.value.filter(M=>M!==V),ne()}function we(V){return m.includes(V)}function Ve(){if(w.value.trim()){if(O.value&&k.value)if(we(k.value)){const V={id:`custom_${Date.now()}`,name:w.value.trim(),keywords:[...R.value]};n.addCustomKeywordTemplate(V),u.value=V.id,i.value=[...V.keywords],ne()}else n.updateCustomKeywordTemplate(k.value,{name:w.value.trim(),keywords:[...R.value]}),u.value===k.value&&(i.value=[...R.value],ne());else{const V={id:`custom_${Date.now()}`,name:w.value.trim(),keywords:[...R.value]};n.addCustomKeywordTemplate(V),u.value=V.id,i.value=[...V.keywords],ne()}b.value=!1}}function Re(V){we(V)?n.addDeletedPresetTemplateId(V):n.removeCustomKeywordTemplate(V),u.value===V&&(f.value.length>0?ee(f.value[0]):j())}async function ne(){if(!a.sessionId||i.value.length===0){$.value=null;return}h.value=!0;try{$.value=await X().getLaughAnalysis(a.sessionId,a.timeFilter,[...i.value])}catch(V){console.error("Failed to load keyword ranking:",V),$.value=null}finally{h.value=!1}}const J=y(()=>$.value?$.value.rankByCount.map(V=>({id:V.memberId.toString(),name:V.name,value:V.laughCount,percentage:V.percentage,keywordDistribution:V.keywordDistribution||[]})):[]);function N(V){if(J.value.length===0)return 0;const M=J.value[0].value;return M===0?0:Math.round(J.value[V].value/M*100)}function Me(V,M){const ue=N(M);return!V.keywordDistribution||V.keywordDistribution.length===0?[{keyword:"default",width:ue,bg:"bg-amber-400"}]:V.keywordDistribution.map(ce=>({keyword:ce.keyword,width:ce.percentage/100*ue,bg:v(ce.keyword).bg}))}return z(()=>[a.sessionId,a.timeFilter],()=>{ne()},{immediate:!0,deep:!0}),(V,M)=>{const ue=gt,ce=We,Le=Ke,Be=pe,at=Ce,st=Oe,ot=he;return o(),C(e(_e),{items:J.value,title:e(t)("quotes.keywords.title"),description:e(t)("quotes.keywords.description"),"top-n":10,"count-label":e(t)("quotes.keywords.countTemplate",{count:J.value.length})},{config:I(()=>[s("div",Mo,[s("div",Lo,[s("span",Do,g(e(t)("quotes.keywords.templateLabel")),1),(o(!0),T(q,null,Q(f.value,D=>(o(),C(ue,{key:D.id,items:[[{label:e(t)("quotes.keywords.contextMenu.edit"),icon:"i-lucide-pencil",disabled:!D.isCustom,onSelect:()=>H(D)},{label:e(t)("quotes.keywords.contextMenu.delete"),icon:"i-lucide-trash",color:"error",onSelect:()=>Re(D.id)}]]},{default:I(()=>[s("button",{class:K(["rounded-md border px-2.5 py-1 text-sm transition-all",u.value===D.id?"border-pink-500 bg-pink-50 text-pink-600 dark:border-pink-400 dark:bg-pink-900/20 dark:text-pink-400":"border-gray-200 text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:text-gray-400 dark:hover:border-gray-600"]),onClick:me=>ee(D)},g(D.name),11,No)]),_:2},1032,["items"]))),128)),x(at,{open:b.value,"onUpdate:open":M[3]||(M[3]=D=>b.value=D)},{content:I(()=>[s("div",Ao,[s("h3",Uo,g(F.value),1),s("div",Fo,[s("div",null,[s("label",Bo,g(e(t)("quotes.keywords.modal.templateName")),1),x(ce,{modelValue:w.value,"onUpdate:modelValue":M[0]||(M[0]=D=>w.value=D),placeholder:e(t)("quotes.keywords.modal.templateNamePlaceholder")},null,8,["modelValue","placeholder"])]),s("div",null,[s("label",qo,g(e(t)("quotes.keywords.modal.keywords")),1),s("div",zo,[(o(!0),T(q,null,Q(R.value,D=>(o(),C(Le,{key:D,variant:"soft",class:"cursor-pointer",onClick:me=>G(D)},{default:I(()=>[Y(g(D)+" ",1),M[6]||(M[6]=s("span",{class:"ml-0.5 hover:text-red-500"},"×",-1))]),_:2},1032,["onClick"]))),128)),x(ce,{modelValue:P.value,"onUpdate:modelValue":M[1]||(M[1]=D=>P.value=D),placeholder:e(t)("quotes.keywords.modal.keywordPlaceholder"),class:"w-full",onKeydown:qe(ze(se,["prevent"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])])])]),s("div",Ho,[x(Be,{variant:"soft",onClick:M[2]||(M[2]=D=>b.value=!1)},{default:I(()=>[Y(g(e(t)("common.cancel")),1)]),_:1}),x(Be,{color:"primary",disabled:!w.value.trim()||R.value.length===0,onClick:Ve},{default:I(()=>[Y(g(O.value?e(t)("quotes.keywords.modal.update"):e(t)("common.save")),1)]),_:1},8,["disabled"])])])]),default:I(()=>[s("button",{class:"rounded-md border border-dashed border-gray-300 px-2.5 py-1 text-sm text-gray-500 transition-all hover:border-pink-400 hover:text-pink-500 dark:border-gray-600",onClick:B},g(e(t)("quotes.keywords.newTemplate")),1)]),_:1},8,["open"])]),s("div",Eo,[(o(!0),T(q,null,Q(i.value,D=>(o(),C(Le,{key:D,class:"cursor-pointer",onClick:me=>de(D)},{default:I(()=>[Y(g(D)+" ",1),M[7]||(M[7]=s("span",{class:"ml-0.5 hover:text-red-500"},"×",-1))]),_:2},1032,["onClick"]))),128)),x(ce,{modelValue:L.value,"onUpdate:modelValue":M[4]||(M[4]=D=>L.value=D),placeholder:e(t)("quotes.keywords.searchPlaceholder"),class:"w-32",onKeydown:qe(ze(W,["prevent"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),i.value.length>0?(o(),T("button",{key:0,class:"text-sm text-pink-500 hover:text-red-500",onClick:j},g(e(t)("quotes.keywords.clear")),1)):A("",!0)]),s("div",Po,g(e(t)("quotes.keywords.templateHint")),1)]),$.value&&$.value.typeDistribution.length>0?(o(),T("div",Oo,[s("div",Wo,[s("span",Ko,g(p.value?p.value:i.value.length===1?i.value[0]:e(t)("quotes.keywords.keyword"))+g(e(t)("quotes.keywords.ranking")),1),s("label",jo,[s("span",null,g(e(t)("quotes.keywords.multiColorMode")),1),x(st,{modelValue:r.value,"onUpdate:modelValue":M[5]||(M[5]=D=>r.value=D),size:"md"},null,8,["modelValue"])])]),s("div",Go,[(o(!0),T(q,null,Q($.value.typeDistribution,D=>(o(),T("div",{key:D.type,class:K(["flex items-center gap-2 rounded-lg px-2 py-2 text-xs",v(D.type).wrapBg])},[s("span",{class:K(["h-2.5 w-2.5 shrink-0 rounded-full",v(D.type).bg])},null,2),s("span",{class:K(["font-medium",v(D.type).text])},g(D.type),3),s("span",Yo,g(e(t)("quotes.keywords.times",{count:D.count})),1),x(Le,{color:v(D.type).badge,variant:"soft",size:"xs"},{default:I(()=>[Y(g(D.percentage)+"%",1)]),_:2},1032,["color"])],2))),128))])])):A("",!0),h.value&&J.value.length===0?(o(),C(e(ae),{key:1,text:e(t)("quotes.keywords.loading")},null,8,["text"])):A("",!0)]),item:I(({item:D,index:me})=>[s("div",Qo,[s("span",{class:K(["w-8 shrink-0 text-center font-mono text-sm font-black tabular-nums",e(xe)(me)])},g(e(ke)(me)),3),s("div",Zo,[s("p",Jo,g(D.name),1)]),s("div",Xo,[s("div",en,[(o(!0),T(q,null,Q(Me(D,me),be=>(o(),T("div",{key:be.keyword,class:K(["h-full transition-all first:rounded-l-full last:rounded-r-full",be.bg]),style:ve({width:`${be.width}%`}),title:`${be.keyword}: ${be.width.toFixed(1)}%`},null,14,tn))),128))])]),s("div",an,[s("span",sn,g(D.value),1),s("span",on,g(e(t)("quotes.keywords.timesWithPercent",{count:D.value,percent:D.percentage})),1)])])]),empty:I(()=>[h.value?(o(),T("div",rn)):(o(),T("div",nn,[x(ot,{name:"i-heroicons-magnifying-glass",class:"mb-2 h-8 w-8 opacity-50"}),s("p",ln,g(e(t)("quotes.keywords.empty")),1)]))]),_:1},8,["items","title","description","count-label"])}}}),cn={class:"flex items-center gap-3"},dn={key:1,class:"py-8 text-center text-sm text-gray-400"},mn=U({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(null),r=S(!1),c=S("activity"),d=S(t.globalTopN??10);z(()=>t.globalTopN,h=>{h!==void 0&&(d.value=h)});async function v(){if(t.sessionId){r.value=!0;try{const h=X(),[b,k]=await Promise.all([h.getDragonKingAnalysis(t.sessionId,t.timeFilter),h.getCheckInAnalysis(t.sessionId,t.timeFilter)]);a.value=b,n.value=k}catch(h){console.error("加载活跃数据失败:",h)}finally{r.value=!1}}}const m=y(()=>t.memberActivity.map(h=>({id:h.memberId.toString(),name:h.name,value:h.messageCount,percentage:h.percentage}))),_=y(()=>a.value?a.value.rank.map(h=>({id:h.memberId.toString(),name:h.name,value:h.count,percentage:h.percentage})):[]),f=y(()=>n.value?n.value.loyaltyRank.map(h=>({id:h.memberId.toString(),name:h.name,value:h.totalDays,percentage:h.percentage})):[]),u=y(()=>{switch(c.value){case"activity":return m.value;case"dragon":return _.value;case"loyalty":return f.value;default:return m.value}}),i=y(()=>{switch(c.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),p=y(()=>{switch(c.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),$=y(()=>{switch(c.value){case"activity":return"按消息发送数量排名";case"dragon":return`每天发言最多的人+1(共 ${a.value?.totalDays??0} 天)`;case"loyalty":return`累计发言天数排名(共 ${n.value?.totalDays??0} 天)`;default:return""}});return z(()=>[t.sessionId,t.timeFilter],()=>v(),{immediate:!0,deep:!0}),(h,b)=>(o(),C(e(E),{title:p.value,description:$.value},{headerRight:I(()=>[s("div",cn,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=k=>d.value=k)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:c.value,"onUpdate:modelValue":b[1]||(b[1]=k=>c.value=k),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[r.value&&(c.value==="dragon"||c.value==="loyalty")?(o(),C(e(ae),{key:0,text:"正在加载数据..."})):(o(),T(q,{key:1},[u.value.length>0?(o(),C(e(Se),{key:0,members:u.value,title:p.value,unit:i.value,"top-n":d.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),T("div",dn,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),vn={key:0},pn={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},hn={class:"px-3 py-2"},gn=U({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=fe(),n=y(()=>t.mode==="current"?t.items.filter(f=>f.currentStreak>0).sort((f,u)=>u.currentStreak-f.currentStreak).slice(0,t.topN):t.items.slice(0,t.topN)),r=y(()=>{const f=n.value.length*36;return Math.max(f+30,180)}),c={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 v(f,u){return`${f} ~ ${u}`}function m(f){return t.mode==="current"?f.currentStreak:f.maxStreak}const _=y(()=>{const f=[...n.value].reverse(),u=f.map(h=>ye(h.name,a.value.labelMaxLength)),i=f.map(h=>m(h)),p=Math.max(...i,1),$=f.map(h=>({value:m(h),itemStyle:{color:t.mode==="current"||h.currentStreak>0?d:c,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 b=h[0];if(!b)return"";const k=n.value.length-1-b.dataIndex,w=n.value[k];if(t.mode==="current")return`
|
|
8
|
-
<div style="padding: 4px 8px;">
|
|
9
|
-
<div style="font-weight: bold; margin-bottom: 6px;">${w.name}</div>
|
|
10
|
-
<div style="color: #fb923c;">🔥 当前连续 <b>${w.currentStreak}</b> 天</div>
|
|
11
|
-
<div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${w.maxStreak} 天</div>
|
|
12
|
-
</div>
|
|
13
|
-
`;let R=`
|
|
14
|
-
<div style="padding: 4px 8px;">
|
|
15
|
-
<div style="font-weight: bold; margin-bottom: 6px;">${w.name}</div>
|
|
16
|
-
<div style="margin-bottom: 4px;">🔥 最长连续: <b>${w.maxStreak}</b> 天</div>
|
|
17
|
-
<div style="font-size: 12px; color: #9ca3af;">${v(w.maxStreakStart,w.maxStreakEnd)}</div>
|
|
18
|
-
`;return w.currentStreak>0&&(R+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${w.currentStreak} 天</div>`),R+="</div>",R}},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:u,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(h,b)=>{const w=n.value.length-1-b+1;return`${w===1?"🥇":w===2?"🥈":w===3?"🥉":`${w}.`} ${h}`}}},series:[{type:"bar",data:$,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:h=>{const b=n.value.length-1-h.dataIndex,k=n.value[b],w=m(k),R=t.mode==="current"||k.currentStreak>0?" 🔥":"";return`${w} 天${R}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(f,u)=>l.bare?(o(),T("div",vn,[x(e(ge),{"content-height":r.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(e(te),{option:_.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),l.mode==="max"?(o(),T("div",pn,[...u[0]||(u[0]=[kt('<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)])])):A("",!0)])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},wt({default:I(()=>[s("div",hn,[x(e(te),{option:_.value,height:r.value},null,8,["option","height"])])]),_:2},[l.mode==="max"?{name:"footer",fn:I(()=>[u[1]||(u[1]=s("div",{class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},[s("div",{class:"flex items-center gap-1.5"},[s("div",{class:"h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"}),s("span",{class:"text-xs text-gray-500"},"当前连续中 🔥")]),s("div",{class:"flex items-center gap-1.5"},[s("div",{class:"h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"}),s("span",{class:"text-xs text-gray-500"},"已中断")])],-1))]),key:"0"}:void 0]),1032,["title","description","max-height-vh"]))}}),fn={class:"px-3 py-2"},yn=U({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=y(()=>t.battles.slice(0,t.topN)),n=y(()=>{const v=a.value.length*36;return Math.max(v+30,180)}),r={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function c(v){return`${v.participantCount} 人参战`}const d=y(()=>{const v=[...a.value].reverse(),m=v.map(i=>c(i)),_=v.map(i=>i.totalImages),f=Math.max(..._,1),u=v.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 $=a.value.length-1-p.dataIndex,h=a.value[$],b=h.participants.slice(0,5).map(w=>`<span style="color: #d1d5db;">${w.name}</span> <b>${w.imageCount}</b>张`).join("、"),k=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
|
-
⚔️ ${Ne(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
|
-
${b}${k}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`}},grid:{left:95,right:125,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:f*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:m,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:u,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:i=>{const p=a.value.length-1-i.dataIndex,$=a.value[p],h=Ne($.startTime);return`${$.totalImages} 张 (${h})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(v,m)=>l.bare?(o(),C(e(ge),{key:0,"content-height":n.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(e(te),{option:d.value,height:n.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:I(()=>[s("div",fn,[x(e(te),{option:d.value,height:n.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),bn={class:"px-3 py-2"},xn=U({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=fe(),n=y(()=>t.items.slice(0,t.topN)),r=y(()=>{const m=n.value.length*36;return Math.max(m+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function d(m){return(m/1e3).toFixed(2)+"s"}const v=y(()=>{if(n.value.length===0)return{};const m=[...n.value].reverse(),_=m.map(i=>ye(i.name,a.value.labelMaxLength)),f=n.value[0].avgTimeDiff,u=m.map(i=>({value:Math.round(f/i.avgTimeDiff*100),itemStyle:{color:c,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 $=n.value.length-1-p.dataIndex,h=n.value[$];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:_,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:u,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:i=>{const p=n.value.length-1-i.dataIndex,$=n.value[p];return`${d($.avgTimeDiff)} · ${$.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(m,_)=>l.bare?(o(),C(e(ge),{key:0,"content-height":r.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(e(te),{option:v.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:I(()=>[s("div",bn,[x(e(te),{option:v.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),kn={class:"flex items-center gap-3"},wn={class:"px-3 py-2"},_n=U({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(l){const t=l,a=fe(),n=S("desc"),r=S(t.globalTopN??10);z(()=>t.globalTopN,i=>{i!==void 0&&(r.value=i)});const c=y(()=>[...t.items].sort((p,$)=>n.value==="desc"?$.daysSinceLastMessage-p.daysSinceLastMessage:p.daysSinceLastMessage-$.daysSinceLastMessage).slice(0,r.value)),d=y(()=>n.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),v=y(()=>n.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),m=y(()=>{const i=c.value.length*36;return Math.max(i+30,180)}),_={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function f(i){return i===0?"今天":i===1?"昨天":`${i} 天前`}const u=y(()=>{if(c.value.length===0)return{};const i=[...c.value].reverse(),p=i.map(b=>ye(b.name,a.value.labelMaxLength)),$=Math.max(...c.value.map(b=>b.daysSinceLastMessage),1),h=i.map(b=>({value:b.daysSinceLastMessage,itemStyle:{color:_,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:b=>{const k=b[0];if(!k)return"";const w=c.value.length-1-k.dataIndex,R=c.value[w];return`
|
|
40
|
-
<div style="padding: 4px 8px;">
|
|
41
|
-
<div style="font-weight: bold; margin-bottom: 6px;">${R.name}</div>
|
|
42
|
-
<div style="margin-bottom: 4px;">🤿 ${f(R.daysSinceLastMessage)}</div>
|
|
43
|
-
<div style="font-size: 12px; color: #9ca3af;">最后发言: ${Qt(R.lastMessageTs)}</div>
|
|
44
|
-
</div>
|
|
45
|
-
`}},grid:{left:a.value.gridLeft,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:$*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:(b,k)=>{const R=c.value.length-1-k+1;return`${R===1?"🥇":R===2?"🥈":R===3?"🥉":`${R}.`} ${b}`}}},series:[{type:"bar",data:h,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:b=>{const k=c.value.length-1-b.dataIndex,w=c.value[k];return f(w.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(i,p)=>(o(),C(e(E),{title:d.value,description:v.value,scrollable:"","max-height-vh":l.maxHeightVh},{headerRight:I(()=>[s("div",kn,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=$=>r.value=$)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:n.value,"onUpdate:modelValue":p[1]||(p[1]=$=>n.value=$),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[s("div",wn,[x(e(te),{option:u.value,height:m.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),$n={class:"px-3 py-2"},Cn=U({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=fe(),n=y(()=>[...t.items].sort((m,_)=>_.maxConsecutiveDays-m.maxConsecutiveDays).slice(0,t.topN)),r=y(()=>{const m=n.value.length*36;return Math.max(m+30,180)}),c={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"}]},v=y(()=>{if(n.value.length===0)return{};const m=[...n.value].reverse(),_=m.map(u=>ye(u.name,a.value.labelMaxLength)),f=Math.max(...n.value.map(u=>u.maxConsecutiveDays),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:u=>{if(!u||u.length===0)return"";const i=u[0].dataIndex,p=n.value.length-1-i,$=n.value[p];let h=`
|
|
46
|
-
<div style="padding: 6px 8px;">
|
|
47
|
-
<div style="font-weight: bold; margin-bottom: 6px;">${$.name}</div>
|
|
48
|
-
<div>最长连续: <b style="color: #f472b6;">${$.maxConsecutiveDays}</b> 天</div>
|
|
49
|
-
`;return $.currentStreak>0&&(h+=`<div style="color: #f97316;">🔥 当前连续 ${$.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:f*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:_,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(u,i)=>{const $=n.value.length-1-i+1;return`${$===1?"🥇":$===2?"🥈":$===3?"🥉":`${$}.`} ${u}`}}},series:[{name:"当前连续",type:"bar",data:m.map(u=>({value:u.currentStreak>0?u.maxConsecutiveDays:0,itemStyle:{color:c,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:u=>{const i=n.value.length-1-u.dataIndex,p=n.value[i];return p.currentStreak>0?`${p.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:m.map(u=>({value:u.currentStreak===0?u.maxConsecutiveDays:0,itemStyle:{color:d,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:u=>{const i=n.value.length-1-u.dataIndex,p=n.value[i];return p.currentStreak===0?`${p.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(m,_)=>l.bare?(o(),C(e(ge),{key:0,"content-height":r.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(e(te),{option:v.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:I(()=>[s("div",$n,[x(e(te),{option:v.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Tn={class:"px-3 py-2"},In=U({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const t=l,a=fe(),n=y(()=>t.items.slice(0,t.topN)),r=y(()=>{const v=n.value.length*36;return Math.max(v+50,200)}),c={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"},d=y(()=>{if(n.value.length===0)return{};const v=[...n.value].reverse(),m=v.map(f=>ye(f.name,a.value.labelMaxLength)),_=Math.max(...n.value.map(f=>f.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:f=>{if(!f||f.length===0)return"";const u=f[0].dataIndex,i=n.value.length-1-u,p=n.value[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: ${c.h23};">●</span> 23点: ${$.h23} 条</div>
|
|
58
|
-
<div><span style="color: ${c.h0};">●</span> 0点: ${$.h0} 条</div>
|
|
59
|
-
<div><span style="color: ${c.h1};">●</span> 1点: ${$.h1} 条</div>
|
|
60
|
-
<div><span style="color: ${c.h2};">●</span> 2点: ${$.h2} 条</div>
|
|
61
|
-
<div><span style="color: ${c.h3to4};">●</span> 3-4点: ${$.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:_*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:m,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(f,u)=>{const p=n.value.length-1-u+1;return`${p===1?"🥇":p===2?"🥈":p===3?"🥉":`${p}.`} ${f}`}}},series:[{name:"23点",type:"bar",stack:"total",data:v.map(f=>f.hourlyBreakdown.h23),itemStyle:{color:c.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:v.map(f=>f.hourlyBreakdown.h0),itemStyle:{color:c.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:v.map(f=>f.hourlyBreakdown.h1),itemStyle:{color:c.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:v.map(f=>f.hourlyBreakdown.h2),itemStyle:{color:c.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:v.map(f=>f.hourlyBreakdown.h3to4),itemStyle:{color:c.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:f=>{const u=n.value.length-1-f.dataIndex;return`${n.value[u].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(v,m)=>l.bare?(o(),C(e(ge),{key:0,"content-height":r.value,"max-height-vh":l.maxHeightVh},{default:I(()=>[x(e(te),{option:d.value,height:r.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),C(e(E),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:I(()=>[s("div",Tn,[x(e(te),{option:d.value,height:r.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Sn={id:"streak-rank",class:"scroll-mt-24"},Vn={class:"flex items-center gap-3"},Rn=U({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(!1),r=S("max"),c=S(t.globalTopN??10);z(()=>t.globalTopN,f=>{f!==void 0&&(c.value=f)});const d=y(()=>r.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),v=y(()=>r.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),m=y(()=>a.value?a.value.streakRank.some(f=>f.currentStreak>0):!1);async function _(){if(t.sessionId){n.value=!0;try{a.value=await X().getCheckInAnalysis(t.sessionId,t.timeFilter)}catch(f){console.error("加载打卡分析失败:",f)}finally{n.value=!1}}}return z(()=>[t.sessionId,t.timeFilter],()=>{_()},{immediate:!0,deep:!0}),(f,u)=>(o(),T("div",Sn,[n.value?(o(),C(e(ae),{key:0,text:"正在分析数据..."})):a.value&&a.value.streakRank.length>0?(o(),C(e(E),{key:1,title:d.value,description:v.value},{headerRight:I(()=>[s("div",Vn,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=i=>c.value=i)},null,8,["modelValue"])):A("",!0),m.value?(o(),C(e(ie),{key:1,modelValue:r.value,"onUpdate:modelValue":u[1]||(u[1]=i=>r.value=i),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):A("",!0)])]),default:I(()=>[x(e(gn),{items:a.value.streakRank,title:d.value,mode:r.value,"top-n":c.value,bare:""},null,8,["items","title","mode","top-n"])]),_:1},8,["title","description"])):(o(),C(e(E),{key:2,title:"🔥 火花榜"},{default:I(()=>[x(e(le),{text:"暂无连续发言数据"})]),_:1}))]))}}),Mn={class:"flex items-center gap-3"},Ln={key:1,class:"py-8 text-center text-sm text-gray-400"},Dn={key:1,class:"py-8 text-center text-sm text-gray-400"},Nn=U({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(!1),r=S("count"),c=S(t.globalTopN??10);z(()=>t.globalTopN,p=>{p!==void 0&&(c.value=p)});async function d(){if(t.sessionId){n.value=!0;try{a.value=await X().getMemeBattleAnalysis(t.sessionId,t.timeFilter)}catch(p){console.error("加载斗图分析失败:",p)}finally{n.value=!1}}}const v=y(()=>a.value?a.value.rankByCount.map(p=>({id:p.memberId.toString(),name:p.name,value:p.count,percentage:p.percentage})):[]),m=y(()=>a.value?a.value.rankByImageCount.map(p=>({id:p.memberId.toString(),name:p.name,value:p.count,percentage:p.percentage})):[]),_=y(()=>r.value==="count"?v.value:m.value),f=y(()=>r.value==="count"?"场":"张"),u=y(()=>{switch(r.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),i=y(()=>{switch(r.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return z(()=>[t.sessionId,t.timeFilter],()=>d(),{immediate:!0,deep:!0}),(p,$)=>n.value?(o(),C(e(ae),{key:0,text:"正在统计斗图数据..."})):a.value?(o(),C(e(E),{key:1,title:u.value,description:i.value},{headerRight:I(()=>[s("div",Mn,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:c.value,"onUpdate:modelValue":$[0]||($[0]=h=>c.value=h)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:r.value,"onUpdate:modelValue":$[1]||($[1]=h=>r.value=h),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[r.value==="battle"?(o(),T(q,{key:0},[a.value.topBattles.length>0?(o(),C(e(yn),{key:0,battles:a.value.topBattles,title:"","top-n":c.value,bare:""},null,8,["battles","top-n"])):(o(),T("div",Ln,"暂无史诗级战役数据"))],64)):(o(),T(q,{key:1},[_.value.length>0?(o(),C(e(Se),{key:0,members:_.value,title:u.value,unit:f.value,"top-n":c.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),T("div",Dn,"暂无斗图数据"))],64))]),_:1},8,["title","description"])):A("",!0)}}),An={class:"space-y-6"},Un={class:"flex items-center gap-3"},Fn={class:"flex items-center gap-3"},Bn={key:1,class:"px-3 py-2"},qn=U({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(!1),r=S("originator"),c=S("fastest"),d=S(t.globalTopN??10),v=S(t.globalTopN??10);z(()=>t.globalTopN,w=>{w!==void 0&&(d.value=w,v.value=w)});async function m(){if(t.sessionId){n.value=!0;try{a.value=await X().getRepeatAnalysis(t.sessionId,t.timeFilter)}catch(w){console.error("加载复读分析失败:",w)}finally{n.value=!1}}}const _=y(()=>a.value?a.value.originators.map(w=>({id:w.memberId.toString(),name:w.name,value:w.count,percentage:w.percentage})):[]),f=y(()=>a.value?a.value.initiators.map(w=>({id:w.memberId.toString(),name:w.name,value:w.count,percentage:w.percentage})):[]),u=y(()=>a.value?a.value.breakers.map(w=>({id:w.memberId.toString(),name:w.name,value:w.count,percentage:w.percentage})):[]),i=y(()=>{switch(r.value){case"originator":return _.value;case"initiator":return f.value;case"breaker":return u.value;default:return _.value}}),p=y(()=>{switch(r.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),$=y(()=>{switch(r.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),h=y(()=>{if(!a.value)return{labels:[],values:[]};const w=a.value.chainLengthDistribution;return{labels:w.map(R=>`${R.length}人`),values:w.map(R=>R.count)}}),b=y(()=>c.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),k=y(()=>{if(c.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const w=a.value?.totalRepeatChains??0,R=a.value?.avgChainLength??0;return`共 ${w} 次复读,平均 ${R} 人参与`});return z(()=>[t.sessionId,t.timeFilter],()=>m(),{immediate:!0,deep:!0}),(w,R)=>(o(),T("div",An,[n.value?(o(),C(e(ae),{key:0,text:"正在分析复读数据..."})):a.value&&a.value.totalRepeatChains>0?(o(),T(q,{key:1},[x(e(E),{title:p.value,description:$.value},{headerRight:I(()=>[s("div",Un,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":R[0]||(R[0]=P=>d.value=P)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:r.value,"onUpdate:modelValue":R[1]||(R[1]=P=>r.value=P),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[i.value.length>0?(o(),C(e(Se),{key:0,members:i.value,title:p.value,unit:"次","top-n":d.value,bare:""},null,8,["members","title","top-n"])):(o(),C(e(le),{key:1,text:"暂无数据"}))]),_:1},8,["title","description"]),x(e(E),{title:b.value,description:k.value},{headerRight:I(()=>[s("div",Fn,[l.showTopNSelect&&c.value==="fastest"?(o(),C(e(re),{key:0,modelValue:v.value,"onUpdate:modelValue":R[2]||(R[2]=P=>v.value=P)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:c.value,"onUpdate:modelValue":R[3]||(R[3]=P=>c.value=P),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[c.value==="fastest"?(o(),T(q,{key:0},[a.value.fastestRepeaters&&a.value.fastestRepeaters.length>0?(o(),C(e(xn),{key:0,items:a.value.fastestRepeaters,"top-n":v.value,title:"",bare:""},null,8,["items","top-n"])):(o(),C(e(le),{key:1,text:"暂无最快复读数据"}))],64)):(o(),T("div",Bn,[h.value.labels.length>0?(o(),C(e(Et),{key:0,data:h.value,height:200},null,8,["data"])):(o(),C(e(le),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(o(),C(e(E),{key:2,title:"🔁 复读榜"},{default:I(()=>[x(e(le),{text:"该群组暂无复读记录"})]),_:1}))]))}}),zn=U({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(!1);async function r(){if(t.sessionId){n.value=!0;try{a.value=await X().getDivingAnalysis(t.sessionId,t.timeFilter)}catch(c){console.error("加载潜水分析失败:",c)}finally{n.value=!1}}}return z(()=>[t.sessionId,t.timeFilter],()=>r(),{immediate:!0,deep:!0}),(c,d)=>n.value?(o(),C(e(ae),{key:0,text:"正在统计潜水数据..."})):a.value&&a.value.rank.length>0?(o(),C(e(_n),{key:1,items:a.value.rank,"global-top-n":l.globalTopN},null,8,["items","global-top-n"])):A("",!0)}}),Hn={class:"space-y-6"},En={class:"flex items-center gap-3"},Pn={key:1,class:"py-8 text-center text-sm text-gray-400"},On={key:1,class:"py-8 text-center text-sm text-gray-400"},Wn={class:"flex items-center gap-3"},Kn={key:1,class:"py-8 text-center text-sm text-gray-400"},jn=U({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const t=l,a=S(null),n=S(!1),r=S("first"),c=S("distribution"),d=S(t.globalTopN??10),v=S(t.globalTopN??10);z(()=>t.globalTopN,b=>{b!==void 0&&(d.value=b,v.value=b)});async function m(){if(t.sessionId){n.value=!0;try{a.value=await X().getNightOwlAnalysis(t.sessionId,t.timeFilter)}catch(b){console.error("加载出勤分析失败:",b)}finally{n.value=!1}}}const _=y(()=>a.value?a.value.lastSpeakerRank.map(b=>({id:String(b.memberId),name:b.name,value:b.count,percentage:b.percentage})):[]),f=y(()=>a.value?a.value.firstSpeakerRank.map(b=>({id:String(b.memberId),name:b.name,value:b.count,percentage:b.percentage})):[]),u=y(()=>r.value==="last"?_.value:f.value),i=y(()=>r.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),p=y(()=>{const b=a.value?.totalDays??0;return r.value==="last"?`每天最后一个发言的人(共 ${b} 天)`:`每天第一个发言的人(共 ${b} 天)`}),$=y(()=>c.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),h=y(()=>c.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return z(()=>[t.sessionId,t.timeFilter],()=>m(),{immediate:!0,deep:!0}),(b,k)=>(o(),T("div",Hn,[n.value?(o(),C(e(ae),{key:0,text:"正在加载出勤分析..."})):a.value?(o(),T(q,{key:1},[x(e(E),{title:$.value,description:h.value},{headerRight:I(()=>[s("div",En,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:d.value,"onUpdate:modelValue":k[0]||(k[0]=w=>d.value=w)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:c.value,"onUpdate:modelValue":k[1]||(k[1]=w=>c.value=w),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[c.value==="distribution"?(o(),T(q,{key:0},[a.value.nightOwlRank.length>0?(o(),C(e(In),{key:0,items:a.value.nightOwlRank,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(o(),T("div",Pn,"暂无深夜发言数据"))],64)):(o(),T(q,{key:1},[a.value.consecutiveRecords.length>0?(o(),C(e(Cn),{key:0,items:a.value.consecutiveRecords,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(o(),T("div",On,"暂无连续记录"))],64))]),_:1},8,["title","description"]),x(e(E),{title:i.value,description:p.value},{headerRight:I(()=>[s("div",Wn,[l.showTopNSelect?(o(),C(e(re),{key:0,modelValue:v.value,"onUpdate:modelValue":k[2]||(k[2]=w=>v.value=w)},null,8,["modelValue"])):A("",!0),x(e(ie),{modelValue:r.value,"onUpdate:modelValue":k[3]||(k[3]=w=>r.value=w),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:I(()=>[u.value.length>0?(o(),C(e(Se),{key:0,members:u.value,title:i.value,"top-n":v.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(o(),T("div",Kn,"暂无数据"))]),_:1},8,["title","description"])],64)):A("",!0)]))}}),Gn={class:"mb-8 mt-4"},Yn={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"}},Qn={id:"activity-rank",class:"scroll-mt-24"},Zn={id:"meme-battle",class:"scroll-mt-24"},Jn={id:"repeat",class:"scroll-mt-24"},Xn={id:"night-owl",class:"scroll-mt-24"},el={id:"diving",class:"scroll-mt-24"},tl={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},al={class:"mt-4 border-l border-gray-200 pl-4 dark:border-gray-800"},sl={class:"flex rounded-lg border border-gray-200 bg-white p-0.5 text-xs dark:border-gray-700 dark:bg-page-dark"},ol=["onClick"],nl=U({__name:"OverallRankingTab",props:{sessionId:{},timeFilter:{}},setup(l){const t=l,a=S([]),n=S([]);async function r(){if(!t.sessionId)return;const h=X(),[b,k]=await Promise.all([h.getMemberActivity(t.sessionId,t.timeFilter),h.getAvailableYears(t.sessionId)]);a.value=b,n.value=k}z(()=>[t.sessionId,t.timeFilter],()=>r(),{immediate:!0,deep:!0});const c=y(()=>{if(t.timeFilter?.startTs&&t.timeFilter?.endTs){const h=new Date(t.timeFilter.startTs*1e3).getFullYear(),b=new Date(t.timeFilter.endTs*1e3).getFullYear();return h===b?`${h} 赛季`:`${h}-${b} 赛季`}if(n.value.length>0){const h=[...n.value].sort((w,R)=>w-R),b=h[0],k=h[h.length-1];return b===k?`${b} 赛季`:`${b}-${k} 赛季`}return"全部赛季"}),d=y(()=>({startTs:t.timeFilter?.startTs,endTs:t.timeFilter?.endTs})),v=[{id:"activity-rank",label:"🏆 活跃榜"},{id:"streak-rank",label:"🔥 火花榜"},{id:"meme-battle",label:"⚔️ 斗图榜"},{id:"repeat",label:"🔁 复读榜"},{id:"night-owl",label:"⏰ 出勤榜"},{id:"diving",label:"🤿 潜水榜"}],{contentRef:m,activeAnchor:_,scrollToAnchor:f}=Jt(v,{threshold:350}),u=S(10),i=S("standard");_t(Xe,i);const p=[{value:"standard",label:"标准"},{value:"wide",label:"宽屏"},{value:"full",label:"全宽"}],$=y(()=>et[i.value].contentClass);return(h,b)=>(o(),T("div",{ref_key:"contentRef",ref:m,class:"flex gap-6 p-6"},[s("div",{class:K(["main-content mx-auto min-w-0 flex-1 space-y-6 px-8",$.value])},[s("div",Gn,[s("h1",Yn," 🏆 "+g(c.value),1),b[1]||(b[1]=s("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),s("div",Qn,[x(e(mn),{"session-id":t.sessionId,"member-activity":a.value,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","member-activity","time-filter","global-top-n"])]),x(e(Rn),{"session-id":t.sessionId,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","time-filter","global-top-n"]),s("div",Zn,[x(e(Nn),{"session-id":t.sessionId,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","time-filter","global-top-n"])]),s("div",Jn,[x(e(qn),{"session-id":t.sessionId,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","time-filter","global-top-n"])]),s("div",Xn,[x(e(jn),{"session-id":t.sessionId,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","time-filter","global-top-n"])]),s("div",el,[x(e(zn),{"session-id":t.sessionId,"time-filter":d.value,"global-top-n":u.value},null,8,["session-id","time-filter","global-top-n"])]),b[2]||(b[2]=s("div",{class:"h-48 no-capture"},null,-1))],2),x(e(sa),{anchors:v,"active-anchor":e(_),onClick:e(f)},{default:I(()=>[s("div",tl,[b[3]||(b[3]=s("div",{class:"mb-2 text-xs text-gray-400"},"显示数量",-1)),x(e(re),{modelValue:u.value,"onUpdate:modelValue":b[0]||(b[0]=k=>u.value=k)},null,8,["modelValue"])]),s("div",al,[b[4]||(b[4]=s("div",{class:"mb-2 text-xs text-gray-400"},"榜单宽度",-1)),s("div",sl,[(o(),T(q,null,Q(p,k=>s("button",{key:k.value,type:"button",class:K(["rounded-md px-2 py-1 transition",i.value===k.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:w=>i.value=k.value},g(k.label),11,ol)),64))])])]),_:1},8,["active-anchor","onClick"])],512))}}),ll={class:"flex h-full flex-col"},il={class:"min-h-0 flex-1 overflow-y-auto"},rl={key:1,class:"main-content mx-auto w-full max-w-3xl p-6"},ul=U({__name:"RankingView",props:{sessionId:{},timeFilter:{}},setup(l){const t=l,{t:a,locale:n}=Z(),r=S("overall"),c=S(null),d=y(()=>rt("groupRanking",n.value)),v=y(()=>[...d.value?[{id:"overall",label:a("analysis.subTabs.ranking.overall"),icon:"i-heroicons-trophy"}]:[],{id:"hot-repeat",label:a("analysis.subTabs.quotes.hotRepeat"),icon:"i-heroicons-sparkles"},{id:"catchphrase",label:a("analysis.subTabs.quotes.catchphrase"),icon:"i-heroicons-chat-bubble-bottom-center-text"},{id:"keyword",label:a("analysis.subTabs.ranking.keyword"),icon:"i-heroicons-magnifying-glass"}]),m=y(()=>({startTs:t.timeFilter?.startTs,endTs:t.timeFilter?.endTs})),_=y(()=>({...m.value,memberId:c.value}));return z(v,f=>{f.some(u=>u.id===r.value)||(r.value=f[0]?.id??"hot-repeat")},{immediate:!0}),(f,u)=>(o(),T("div",ll,[x(e(Ae),{modelValue:r.value,"onUpdate:modelValue":u[1]||(u[1]=i=>r.value=i),items:v.value,"persist-key":"groupRankingTab"},{right:I(()=>[r.value==="catchphrase"?(o(),C(Ge,{key:0,modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=i=>c.value=i),"session-id":t.sessionId},null,8,["modelValue","session-id"])):A("",!0)]),_:1},8,["modelValue","items"]),s("div",il,[x(Ie,{name:"fade",mode:"out-in"},{default:I(()=>[r.value==="overall"?(o(),C(nl,{key:0,"session-id":t.sessionId,"time-filter":m.value},null,8,["session-id","time-filter"])):r.value==="keyword"?(o(),T("div",rl,[x(un,{"session-id":t.sessionId,"time-filter":m.value},null,8,["session-id","time-filter"])])):r.value==="hot-repeat"?(o(),C(e(To),{key:2,"session-id":t.sessionId,"time-filter":m.value},null,8,["session-id","time-filter"])):r.value==="catchphrase"?(o(),C(e(po),{key:3,"session-id":t.sessionId,"time-filter":_.value},null,8,["session-id","time-filter"])):A("",!0)]),_:1})])]))}}),cl=$e(ul,[["__scopeId","data-v-d8d145dc"]]),dl={class:"main-content max-w-5xl p-6"},ml={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},vl={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},pl={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},hl={class:"flex flex-1 flex-wrap items-center gap-2"},gl={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},fl={class:"text-xs text-gray-400"},yl={key:0,class:"text-gray-300 dark:text-gray-600"},bl=U({__name:"NicknameHistory",props:{sessionId:{}},setup(l){const{t}=Z(),a=l,n=S([]),r=S([]),c=S(!1);function d(_){return _.groupNickname||_.accountName||_.platformId}async function v(){if(a.sessionId)try{n.value=await X().getMembers(a.sessionId)}catch(_){console.error("加载成员列表失败:",_)}}async function m(){if(!a.sessionId||n.value.length===0)return;c.value=!0;const _=[];try{const f=n.value.map(i=>X().getMemberNameHistory(a.sessionId,i.id)),u=await Promise.all(f);n.value.forEach((i,p)=>{const $=u[p];$.length>2&&_.push({memberId:i.id,name:d(i),history:$})}),r.value=_}catch(f){console.error("加载昵称变更记录失败:",f)}finally{c.value=!1}}return z(()=>a.sessionId,async()=>{await v()},{immediate:!0}),z(()=>n.value.length,()=>{n.value.length>0&&m()}),Te(async()=>{n.value.length===0&&await v()}),(_,f)=>{const u=Ke;return o(),T("div",dl,[s("p",ml,g(e(t)("members.nicknameHistory.note")),1),x(e(E),{title:e(t)("members.nicknameHistory.title"),description:c.value?e(t)("members.nicknameHistory.loading"):r.value.length>0?e(t)("members.nicknameHistory.hasChanges",{count:r.value.length}):e(t)("members.nicknameHistory.noChanges")},{default:I(()=>[!c.value&&r.value.length>0?(o(),T("div",vl,[(o(!0),T(q,null,Q(r.value,i=>(o(),T("div",{key:i.memberId,class:"flex items-start gap-3 px-5 py-3"},[s("div",pl,g(i.name),1),s("div",hl,[(o(!0),T(q,null,Q(i.history,(p,$)=>(o(),T(q,{key:$},[s("div",gl,[s("span",{class:K(["text-sm",p.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},g(p.name),3),p.endTs===null?(o(),C(u,{key:0,color:"primary",variant:"soft",size:"xs"},{default:I(()=>[Y(g(e(t)("members.nicknameHistory.current")),1)]),_:1})):A("",!0),s("span",fl,"("+g(e(Zt)(p.startTs,p.endTs))+")",1)]),$<i.history.length-1?(o(),T("span",yl,"→")):A("",!0)],64))),128))])]))),128))])):c.value?(o(),C(e(ae),{key:2,text:e(t)("members.nicknameHistory.loadingText")},null,8,["text"])):(o(),C(e(le),{key:1,text:e(t)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),xl={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},kl={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},wl={class:"text-lg font-semibold text-gray-900 dark:text-white"},_l={class:"flex-1 overflow-auto"},$l=U({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(l){const{t}=Z(),a=l,n=S(!1);return(r,c)=>{const d=pe,v=Ce;return o(),T(q,null,[x(d,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:c[0]||(c[0]=m=>n.value=!0)},{default:I(()=>[Y(g(e(t)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),a.sessionId?(o(),C(v,{key:0,open:n.value,"onUpdate:open":c[2]||(c[2]=m=>n.value=m),ui:{content:"max-w-6xl h-[85vh]"}},{content:I(()=>[s("div",xl,[s("div",kl,[s("h2",wl,g(e(t)("analysis.subTabs.member.nicknameHistory")),1),x(d,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:c[1]||(c[1]=m=>n.value=!1)})]),s("div",_l,[x(bl,{"session-id":a.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):A("",!0)],64)}}}),Cl={class:"flex h-full flex-col dark:bg-page-dark",style:{"padding-top":"var(--titlebar-area-height)"}},Tl={class:"relative flex-1 overflow-y-auto"},Il={class:"h-full"},Sl={key:2,class:"flex h-full items-center justify-center"},Vl={class:"text-gray-500"},Rl={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},Ml={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Ll={class:"text-lg font-semibold text-gray-900 dark:text-white"},Dl={class:"text-sm text-gray-500 dark:text-gray-400"},Nl={class:"flex items-center gap-2"},Al={class:"flex-1 overflow-hidden"},Ul=U({__name:"index",setup(l){const t=$t(()=>vt(()=>import("./MessageExportModal-tTI358HU.js"),__vite__mapDeps([0,1,2,3,4,5]))),{t:a}=Z(),n=ft(),r=yt(),c=ut(),d=Ue(),v=ct(),{currentSessionId:m}=dt(c),_=S(!1),f=S(!1),u=S(!1),i=S(!1),p=S(!1);function $(){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:"ranking",labelKey:"analysis.tabs.ranking",icon:"i-heroicons-trophy"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],b=y(()=>v.debugMode?[...h,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:h),k=y(()=>b.value.map(J=>J.id)),{activeTab:w,isLoading:R,isInitialLoad:P,session:O,memberActivity:F,hourlyActivity:B,dailyActivity:H,messageTypes:se,timeRangeValue:G,fullTimeRange:ee,availableYears:j,timeFilter:L,initialTimeState:W,loadData:de}=Mt({route:n,router:r,currentSessionId:m,selectSession:c.selectSession,defaultTab:v.defaultSessionTab,validTabIds:k.value}),we=y(()=>F.value.slice(0,3)),Ve=y(()=>F.value.length<=1?[]:[...F.value].sort((J,N)=>J.messageCount-N.messageCount).slice(0,1)),Re=y(()=>F.value.reduce((J,N)=>J+N.messageCount,0)),ne=y(()=>F.value.filter(J=>J.messageCount>0).length);return(J,N)=>{const Me=pe,V=Ce;return o(),T("div",Cl,[e(P)?(o(),C(ae,{key:0,variant:"page",text:e(a)("analysis.groupChat.loading")},null,8,["text"])):e(O)?(o(),T(q,{key:1},[x(Lt,{"active-tab":e(w),"onUpdate:activeTab":N[0]||(N[0]=M=>He(w)?w.value=M:null),"time-range-value":e(G),"onUpdate:timeRangeValue":N[1]||(N[1]=M=>He(G)?G.value=M:null),title:e(O).name,avatar:e(O).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:b.value,"current-session-id":e(m),"initial-time-state":e(W),onOpenIncrementalImport:N[2]||(N[2]=M=>u.value=!0),onOpenMemberManagement:N[3]||(N[3]=M=>p.value=!0),onOpenChatRecord:$,"onUpdate:fullRange":N[4]||(N[4]=M=>ee.value=M),"onUpdate:availableYears":N[5]||(N[5]=M=>j.value=M)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),s("div",Tl,[e(R)?(o(),C(ae,{key:0,variant:"overlay"})):A("",!0),s("div",Il,[x(Ie,{name:"tab-slide",mode:"out-in"},{default:I(()=>[e(w)==="overview"?(o(),C(Da,{key:"overview-"+e(m),session:e(O),"member-activity":e(F),"top-members":we.value,"bottom-members":Ve.value,"message-types":e(se),"hourly-activity":e(B),"daily-activity":e(H),"time-range":e(ee),"filtered-message-count":Re.value,"filtered-member-count":ne.value,"time-filter":e(L)},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(w)==="view"?(o(),C(Ro,{key:"view-"+e(m),"session-id":e(m),"session-name":e(O).name,"time-filter":e(L)},null,8,["session-id","session-name","time-filter"])):e(w)==="ranking"?(o(),C(cl,{key:"ranking-"+e(m),"session-id":e(m),"time-filter":e(L)},null,8,["session-id","time-filter"])):e(w)==="ai-chat"?(o(),C(e(Ut),{key:"ai-chat-"+e(m),"session-id":e(m),"session-name":e(O).name,"chat-type":"group"},null,8,["session-id","session-name"])):e(w)==="memory"?(o(),C(Ft,{key:"memory-"+e(m),"session-id":e(m),"session-name":e(O).name},null,8,["session-id","session-name"])):e(w)==="lab"?(o(),C(Bt,{key:"lab-"+e(m),"session-id":e(m),"chat-type":"group"},null,8,["session-id"])):e(w)==="debug"?(o(),C(e(qt),{key:"debug-"+e(m),"session-id":e(m)},null,8,["session-id"])):A("",!0)]),_:1})])]),x(Dt,{onOpenIncrementalImport:N[6]||(N[6]=M=>u.value=!0),onOpenSemanticIndex:N[7]||(N[7]=M=>_.value=!0),onOpenMemberManagement:N[8]||(N[8]=M=>p.value=!0),onOpenChatRecord:$,onOpenMessageExport:N[9]||(N[9]=M=>i.value=!0)})],64)):(o(),T("div",Sl,[s("p",Vl,g(e(a)("analysis.groupChat.loadError")),1)])),e(m)&&e(O)?(o(),C(Nt,{key:3,modelValue:_.value,"onUpdate:modelValue":N[10]||(N[10]=M=>_.value=M),"session-id":e(m),"message-count":e(O).messageCount},null,8,["modelValue","session-id","message-count"])):A("",!0),e(m)&&e(O)?(o(),C(mt,{key:4,modelValue:f.value,"onUpdate:modelValue":N[11]||(N[11]=M=>f.value=M),"session-id":e(m),"chat-type":"group","auto-check":""},null,8,["modelValue","session-id"])):A("",!0),e(m)&&e(O)?(o(),C(At,{key:5,modelValue:u.value,"onUpdate:modelValue":N[12]||(N[12]=M=>u.value=M),"session-id":e(m),"session-name":e(O).name,onImported:N[13]||(N[13]=()=>{e(de)(),e(c).loadSessions()})},null,8,["modelValue","session-id","session-name"])):A("",!0),e(m)?(o(),C(e(t),{key:6,modelValue:i.value,"onUpdate:modelValue":N[14]||(N[14]=M=>i.value=M)},null,8,["modelValue"])):A("",!0),e(m)?(o(),C(V,{key:7,open:p.value,"onUpdate:open":N[16]||(N[16]=M=>p.value=M),ui:{content:"max-w-6xl h-[85vh]"}},{content:I(()=>[s("div",Rl,[s("div",Ml,[s("div",null,[s("h2",Ll,g(e(a)("analysis.tooltip.memberManagement")),1),s("p",Dl,g(e(a)("members.list.description",{count:e(O)?.memberCount??0})),1)]),s("div",Nl,[x($l,{"session-id":e(m)},null,8,["session-id"]),x(Me,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:N[15]||(N[15]=M=>p.value=!1)})])]),s("div",Al,[x(zt,{"session-id":e(m),"show-header":!1,"chat-type":"group",onDataChanged:e(de)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):A("",!0)])}}}),Jl=$e(Ul,[["__scopeId","data-v-d9741d3c"]]);export{Jl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ke,_ as be,h as Tt,d as Lt,i as $t,u as It}from"./vendor-nuxt-ui-DMdbdSFy.js";import{u as _e,o as Ge,q as Pt,m as Ft,j as Mt,y as zt,z as At,C as Nt}from"./index-JyB6Cr8r.js";import{_ as Et}from"./ThemeCard.vue_vue_type_script_setup_true_lang-CpNjFhpm.js";import{_ as Bt}from"./LoadingState.vue_vue_type_script_setup_true_lang-8s6XRB3S.js";import{u as jt}from"./people-page-header-DGkK0AMO.js";import{d as Se,Q as re,T,bS as Vt,P as c,Z as f,ag as a,a0 as o,u as r,U as y,ad as q,ae as he,a1 as E,$ as J,c as u,w as O,x as Gt,O as Dt,r as b,aG as Ot,aa as X,_ as U,n as Be}from"./vendor-reka-ui-8_x7iKfi.js";import"./vendor-snapdom--nZvo8Sg.js";const Ut={key:0,class:"flex h-full w-[420px] max-w-[80vw] shrink-0 flex-col border-l border-gray-200 bg-white dark:border-gray-800 dark:bg-page-dark",style:{"-webkit-app-region":"no-drag"}},qt={class:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-800"},Rt={class:"text-base font-semibold text-gray-900 dark:text-white"},Ht={key:0,class:"flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-gray-400 dark:text-gray-500"},Kt={key:1,class:"min-h-0 flex-1 overflow-y-auto"},Yt={class:"px-5 py-5"},Qt={class:"flex items-start gap-4"},Wt={class:"relative shrink-0"},Zt=["src","alt"],Xt={key:1,class:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-gray-155 to-gray-200 text-lg font-bold text-gray-700 dark:from-gray-800 dark:to-page-dark dark:text-gray-200"},Jt={class:"min-w-0 flex-1 pt-1"},ea={class:"truncate text-lg font-bold tracking-tight text-gray-900 dark:text-white"},ta={class:"mt-1 truncate font-mono text-xs text-gray-400 dark:text-gray-500"},aa={key:0,class:"mt-2 flex flex-wrap gap-1.5"},na={key:1,class:"mt-3 flex flex-wrap items-center gap-2"},sa={class:"border-t border-gray-100 px-5 py-4 dark:border-white/5"},oa={class:"mb-3 text-[10px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500"},ra={class:"space-y-2.5"},ia={class:"flex items-center justify-between gap-2"},la={class:"truncate text-xs font-semibold text-gray-700 dark:text-gray-300"},ca={class:"flex items-center gap-1 text-[10px] font-bold text-gray-400 transition group-hover/item:text-pink-500 dark:text-gray-500"},da={class:"mt-1.5 truncate text-[11px] font-medium text-gray-400 dark:text-gray-500"},ua={class:"mt-2 flex flex-wrap gap-1.5"},fa=Se({__name:"ContactDetailPanel",props:{selectedKey:{},contact:{},isLoading:{type:Boolean},isFriendActionLoading:{type:Boolean}},emits:["clear","openSource","viewSourceRecords","markFriend","unmarkFriend"],setup(n,{emit:s}){const h=n,S=s,{t:C}=_e(),A=u(()=>{const p=h.contact;if(!p)return[];const v=new Set([p.displayName.trim().toLowerCase(),p.platformId.trim().toLowerCase()]);return p.aliases.filter(w=>!v.has(w.trim().toLowerCase()))}),I=u(()=>h.contact?.pool==="non_friend"),P=u(()=>h.contact?.friendSource==="manual"),B=u(()=>I.value||P.value);function F(p){return p.displayName.trim().slice(0,1).toUpperCase()||"?"}return(p,v)=>{const w=ke,R=be;return c(),re(Vt,{name:"contact-detail-panel"},{default:T(()=>[n.selectedKey?(c(),f("aside",Ut,[a("div",qt,[a("h3",Rt,o(r(C)("contacts.detail.title")),1),y(w,{"aria-label":r(C)("contacts.actions.clearSelection"),icon:"i-heroicons-x-mark",color:"neutral",variant:"ghost",size:"sm",onClick:v[0]||(v[0]=x=>S("clear"))},null,8,["aria-label"])]),n.isLoading?(c(),f("div",Ht,[y(R,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(C)("common.loading")),1)])):n.contact?(c(),f("div",Kt,[a("section",Yt,[a("div",Qt,[a("div",Wt,[n.contact.avatar?(c(),f("img",{key:0,src:n.contact.avatar,alt:n.contact.displayName,loading:"lazy",decoding:"async",class:"h-16 w-16 rounded-2xl object-cover shadow-sm ring-2 ring-white dark:ring-page-dark"},null,8,Zt)):(c(),f("div",Xt,o(F(n.contact)),1))]),a("div",Jt,[a("h2",ea,o(n.contact.displayName),1),a("p",ta,o(n.contact.platform)+" · "+o(n.contact.platformId),1),A.value.length>0?(c(),f("div",aa,[(c(!0),f(q,null,he(A.value.slice(0,4),x=>(c(),f("span",{key:x,class:"max-w-full truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},o(x),1))),128))])):E("",!0),B.value?(c(),f("div",na,[I.value?(c(),re(w,{key:0,icon:"i-lucide-user-plus",color:"primary",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[1]||(v[1]=x=>S("markFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.markFriend")),1)]),_:1},8,["loading"])):P.value?(c(),re(w,{key:1,icon:"i-lucide-user-minus",color:"neutral",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[2]||(v[2]=x=>S("unmarkFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.unmarkFriend")),1)]),_:1},8,["loading"])):E("",!0)])):E("",!0)])])]),a("section",sa,[a("h3",oa,o(r(C)("contacts.detail.sources")),1),a("div",ra,[(c(!0),f(q,null,he(n.contact.sourceSessions,x=>(c(),f("div",{key:x.id,class:"w-full rounded-2xl border border-gray-100 bg-white/40 px-3.5 py-3 text-left transition duration-300 hover:border-gray-200 dark:border-white/5 dark:bg-page-dark/10 dark:hover:border-white/10"},[a("div",ia,[a("span",la,o(x.name),1),a("span",ca,o(x.type==="private"?r(C)("contacts.detail.sourceType.private"):r(C)("contacts.detail.sourceType.group")),1)]),a("div",da,o(x.privateMessageCount!=null?r(C)("contacts.metrics.privateMessages",{count:x.privateMessageCount}):r(C)("contacts.metrics.groupSignals",{count:x.coOccurrenceCount??0})),1),a("div",ua,[y(w,{icon:"i-lucide-arrow-up-right",color:"primary",variant:"soft",size:"xs",onClick:j=>S("openSource",x)},{default:T(()=>[J(o(r(C)("contacts.actions.openSourceSession")),1)]),_:1},8,["onClick"]),y(w,{icon:"i-lucide-messages-square",color:"primary",variant:"soft",size:"xs",onClick:j=>S("viewSourceRecords",x)},{default:T(()=>[J(o(r(C)("contacts.actions.viewSourceRecords")),1)]),_:1},8,["onClick"])])]))),128))])])])):E("",!0)])):E("",!0)]),_:1})}}}),ma=Ge(fa,[["__scopeId","data-v-4df1b50a"]]),pa={key:0,class:"flex items-center gap-3.5 rounded-2xl border border-amber-200/60 bg-amber-50/40 p-4 text-sm text-amber-800 backdrop-blur-sm dark:border-amber-900/40 dark:bg-amber-950/10 dark:text-amber-200"},ga={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-amber-100/80 dark:bg-amber-950/50"},va={class:"font-medium"},xa={key:1,class:"flex flex-col gap-4 rounded-2xl border border-zinc-200/80 bg-zinc-50/60 p-4 text-sm text-zinc-700 backdrop-blur-sm dark:border-zinc-800/80 dark:bg-page-dark/40 dark:text-zinc-300 sm:flex-row sm:items-center sm:justify-between"},ya={class:"flex items-center gap-3.5"},ha={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-zinc-100 dark:bg-zinc-800/80"},ka={class:"font-medium"},ba={class:"flex items-center shrink-0 self-end sm:self-center"},_a={key:2,class:"flex flex-col gap-4 rounded-2xl border border-red-200/60 bg-red-50/40 p-4 text-sm text-red-700 backdrop-blur-sm dark:border-red-900/40 dark:bg-red-950/10 dark:text-red-300 sm:flex-row sm:items-center sm:justify-between"},Sa={class:"flex min-w-0 items-center gap-3.5"},wa={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-red-100/80 dark:bg-red-950/50"},Ca={class:"truncate font-medium"},Ta={class:"flex items-center shrink-0 self-end sm:self-center"},La=Se({__name:"ContactsStatusBlocks",props:{showDisabledNotice:{type:Boolean},activePrivateSessionCount:{},cacheStatus:{},taskFailed:{type:Boolean},taskLastError:{},isTaskRunning:{type:Boolean},isRecomputing:{type:Boolean}},emits:["recompute"],setup(n,{emit:s}){const h=s,{t:S}=_e();return(C,A)=>{const I=be,P=ke;return c(),f(q,null,[n.showDisabledNotice?(c(),f("div",pa,[a("div",ga,[y(I,{name:"i-lucide-alert-triangle",class:"h-5 w-5 text-amber-500"})]),a("span",va,o(r(S)("contacts.disabled",{count:n.activePrivateSessionCount})),1)])):E("",!0),n.cacheStatus==="stale"&&!n.isTaskRunning?(c(),f("div",xa,[a("div",ya,[a("div",ha,[y(I,{name:"i-lucide-history",class:"h-5 w-5 text-zinc-500 dark:text-zinc-400"})]),a("span",ka,o(r(S)("contacts.stale.inline")),1)]),a("div",ba,[y(P,{size:"sm",color:"primary",variant:"soft",class:"rounded-xl px-4 font-medium",loading:n.isRecomputing||n.isTaskRunning,disabled:n.isTaskRunning,onClick:A[0]||(A[0]=B=>h("recompute"))},{default:T(()=>[J(o(r(S)("contacts.actions.recompute")),1)]),_:1},8,["loading","disabled"])])])):E("",!0),n.taskFailed?(c(),f("div",_a,[a("div",Sa,[a("div",wa,[y(I,{name:"i-lucide-alert-circle",class:"h-5 w-5 text-red-500"})]),a("span",Ca,o(n.taskLastError||r(S)("contacts.task.failed")),1)]),a("div",Ta,[y(P,{size:"sm",color:"error",variant:"soft",class:"rounded-xl px-4 font-medium",onClick:A[1]||(A[1]=B=>h("recompute"))},{default:T(()=>[J(o(r(S)("contacts.task.retry")),1)]),_:1})])])):E("",!0)],64)}}});function $a(n){return!!n.diagnostics&&!n.showLoadingState&&!n.diagnostics.contactsEnabled}function Ia(n){return n.previousScrollTop}function je(n){return n!=="friend"}function Pa(n){return n.friendInitialLoading||n.groupmateInitialLoading}function Fa(n){return n.activeSection==="non_friend"||n.friendSectionReady}function Ma(n){return n.friendInitialLoading||n.groupmateInitialLoading||n.completionProgressVisible===!0||n.activeTaskStatus==="running"||n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"}function za(n){return n.previousStatus==="running"&&n.nextStatus==="succeeded"&&n.nextTotalSessions>0&&n.nextProcessedSessions>=n.nextTotalSessions&&n.previousProcessedSessions<n.nextTotalSessions}function Aa(n){return n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"?["friend","non_friend"]:[n.activePool]}function Na(n){const s=[{type:"section",key:"section:friend",pool:"friend"}];return s.push(...n.friends.map(h=>({type:"contact",key:h.key,pool:"friend",contact:h}))),n.friendLoadingMore&&s.push({type:"loading",key:"loading:friend",pool:"friend"}),n.showGroupSection&&(s.push({type:"section",key:"section:non_friend",pool:"non_friend"}),s.push(...n.groupmates.map(h=>({type:"contact",key:h.key,pool:"non_friend",contact:h}))),n.groupmateLoadingMore&&s.push({type:"loading",key:"loading:non_friend",pool:"non_friend"})),s}const Ea={class:"flex min-h-0 flex-1 flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100"},Ba={class:"flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2 py-1.5 xl:py-0"},ja={class:"flex min-h-0 flex-1 overflow-hidden"},Va={class:"min-h-0 min-w-0 flex-1 overflow-hidden"},Ga={class:"flex h-full min-h-0 w-full flex-col gap-6 px-6 pb-3 pt-4"},Da={class:"flex min-h-0 flex-1 flex-col gap-4"},Oa={key:1,class:"rounded-2xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"},Ua={key:2,class:"min-h-0 flex-1"},qa={key:0,class:"flex flex-col items-center justify-center rounded-3xl border border-dashed border-gray-250 p-16 text-center dark:border-white/5"},Ra={class:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gray-50 text-gray-400 dark:bg-white/5 dark:text-gray-500"},Ha={class:"mt-4 text-sm font-medium text-gray-400 dark:text-gray-500"},Ka={class:"shrink-0 overflow-hidden border-b border-gray-100 bg-white dark:border-white/5 dark:bg-[#202024]"},Ya={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Qa={class:"truncate"},Wa={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},Za={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Xa={class:"truncate"},Ja={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},en=["aria-label","onClick"],tn={class:"group flex min-w-0 w-full items-center gap-3"},an={class:"relative shrink-0 overflow-hidden rounded-lg"},nn=["src","alt"],sn={key:1,class:"flex h-10 w-10 items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 text-sm font-bold text-gray-500 transition-transform duration-300 group-hover:scale-105 dark:from-gray-800 dark:to-gray-800/60 dark:text-gray-400"},on={class:"min-w-0 flex-1"},rn={class:"flex min-w-0 items-center gap-1"},ln={class:"mt-1 inline-flex items-center rounded bg-gray-50 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wider text-gray-400 dark:bg-white/5 dark:text-gray-500"},cn={class:"contact-table-value"},dn={class:"contact-table-value"},un={class:"contact-table-value"},fn={class:"contact-table-value"},mn=100,Ve=69,pn=20,gn=Se({__name:"index",setup(n){const{t:s}=_e(),h=Pt(),S=Ft(),C=Mt(),A=It(),I=b(!1),P=b(""),B=b(""),F=b("1y"),p=b("friend"),v=b(null),w=b(null),R=b(!1),x=b(!1),j=b(null),fe=b(!1),H=b(null),ee=b(null),te=b(null),M=b(null),ae={friend:null,non_friend:null},K=b(!1),Y=b(null),we=b(0),ne=b({});function me(){return{items:[],response:null,page:0,total:0,hasMore:!1,isLoadingInitial:!1,isLoadingMore:!1,error:"",requestId:0,scrollOffset:0}}const V=b({friend:me(),non_friend:me()}),ie=u(()=>V.value[p.value]),k=u(()=>V.value.friend),m=u(()=>V.value.non_friend),Ce=u(()=>!!k.value.response&&!k.value.hasMore&&!k.value.isLoadingInitial),pe=u(()=>Fa({activeSection:p.value,friendSectionReady:Ce.value,groupmateHasItems:m.value.items.length>0,groupmateLoading:m.value.isLoadingInitial||m.value.isLoadingMore})),N=u(()=>Na({friends:k.value.items,groupmates:m.value.items,showGroupSection:pe.value,friendLoadingMore:k.value.isLoadingMore,groupmateLoadingMore:m.value.isLoadingInitial||m.value.isLoadingMore})),le=u(()=>ie.value.response??k.value.response??m.value.response),ge=u(()=>[ie.value.response,k.value.response,m.value.response].find(e=>e?.task?.status==="running")??le.value),De=u(()=>k.value.items.length+m.value.items.length>0),Oe=u(()=>!De.value&&!!k.value.response&&!!m.value.response&&!k.value.hasMore&&!m.value.hasMore&&!k.value.isLoadingInitial&&!m.value.isLoadingInitial),Te=u(()=>k.value.error||m.value.error),ve=u(()=>le.value?.diagnostics),z=u(()=>ge.value?.task),ce=u(()=>H.value??z.value),Q=u(()=>z.value?.status==="running"),Ue=u(()=>z.value?.status==="failed"),Le=u(()=>Ma({activeTaskStatus:ie.value.response?.task?.status,friendTaskStatus:k.value.response?.task?.status,groupmateTaskStatus:m.value.response?.task?.status,friendInitialLoading:k.value.isLoadingInitial,groupmateInitialLoading:m.value.isLoadingInitial,completionProgressVisible:H.value!==null})),qe=u(()=>H.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):ge.value?.cache.status==="stale"&&Q.value?s("contacts.task.updating"):ge.value?.cache.status==="missing"&&Q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):s("common.loading")),Re=u(()=>$a({diagnostics:ve.value,showLoadingState:Le.value})),se=u(()=>{const e=le.value?.stats,t=e?.friendsTotal??0,i=e?.nonFriendsTotal??0;return{total:t+i,friends:t,nonFriends:i}}),He=u(()=>[{id:"friend",label:`${s("contacts.tabs.friends")} ${se.value.friends.toLocaleString()}`,icon:"i-heroicons-user"},{id:"non_friend",label:`${s("contacts.tabs.groupContacts")} ${se.value.nonFriends.toLocaleString()}`,icon:"i-heroicons-user-group"}]),Ke=u(()=>Nt.map(e=>({label:s(`contacts.timeRange.${e}`),value:e}))),de=zt(u(()=>({count:N.value.length,getScrollElement:()=>Y.value,estimateSize:e=>Je(N.value[e]),overscan:10,getItemKey:e=>N.value[e]?.key??e}))),xe=u(()=>de.value.getVirtualItems()),Ye=u(()=>de.value.getTotalSize());O(P,e=>{te.value&&clearTimeout(te.value),te.value=setTimeout(()=>{B.value=e.trim()},300)}),O(()=>z.value?.status,()=>Fe()),O(()=>({status:z.value?.status,processedSessions:z.value?.processedSessions??0,totalSessions:z.value?.totalSessions??0}),(e,t)=>{e.status==="running"&&ue(),z.value&&za({previousStatus:t?.status,nextStatus:e.status,previousProcessedSessions:t?.processedSessions??0,nextProcessedSessions:e.processedSessions,nextTotalSessions:e.totalSessions})&&rt(z.value)}),O([B,F],()=>{nt(),$e()}),O(()=>N.value.length,()=>{de.value.measure()}),O(xe,()=>{Xe()},{flush:"post"}),O(N,()=>{v.value&&(k.value.items.some(e=>e.key===v.value)||m.value.items.some(e=>e.key===v.value)||oe())}),Gt(()=>{$e()}),Dt(()=>{Me(),ue(),te.value&&clearTimeout(te.value),M.value&&clearTimeout(M.value)});async function G(e,t){const i=W(e,1,{...t,replace:!0});ae[e]=i;try{await i}finally{ae[e]===i&&(ae[e]=null)}}async function $e(){await Promise.all([G("friend"),G("non_friend")])}async function Ie(e){const t=V.value[e];!t.hasMore||t.isLoadingInitial||t.isLoadingMore||await W(e,t.page+1,{acceptStale:!0,replace:!1})}async function W(e,t,i){const d=V.value[e],_=i?.replace!==!1,L=d.requestId+1;d.requestId=L,d.error="",i?.silent||(_?d.isLoadingInitial=d.items.length===0:d.isLoadingMore=!0);try{const $={acceptStale:i?.acceptStale,timeRangePreset:F.value,pool:e,page:t,pageSize:mn,query:B.value||void 0},l=i?.force?await S.recomputeContacts($):await S.getContacts($);if(d.requestId!==L)return;We(d,l,_,{preserveExisting:i?.preserveExisting}),Fe()}catch($){if(d.requestId===L&&(d.error=String($)),i?.throwOnError)throw $}finally{d.requestId===L&&(d.isLoadingInitial=!1,d.isLoadingMore=!1)}}async function Pe(){I.value=!0;try{await W(p.value,1,{acceptStale:!0,force:!0,replace:!0,throwOnError:!0}),h.success(s("contacts.toast.recomputeStarted"))}catch(e){h.fail(s("contacts.toast.recomputeFailed"),{description:String(e)})}finally{I.value=!1}}const Qe=u(()=>({title:s("layout.relationships"),description:s("contacts.subtitle",{count:ve.value?.privateSessionCount??0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm",action:{label:s("contacts.actions.recompute"),icon:"i-lucide-refresh-cw",loading:I.value,disabled:Q.value,class:"border border-pink-100 hover:border-pink-200 dark:border-pink-950/30 dark:hover:border-pink-900/50",onClick:Pe},stats:[{id:"total",label:s("contacts.stats.total"),value:se.value.total.toLocaleString()},{id:"friends",label:s("contacts.stats.friends"),value:se.value.friends.toLocaleString()},{id:"nonFriends",label:s("contacts.stats.nonFriends"),value:se.value.nonFriends.toLocaleString(),dividerBefore:!0}]}));jt(Qe);function We(e,t,i,d){const _=e.response?.cache.signature,L=t.cache.signature,$=!!_&&!!L&&_!==L;if(e.response=t,e.total=t.pagination.total,d?.preserveExisting&&!$&&e.items.length>0){e.hasMore=e.items.length<t.pagination.total;return}e.page=t.pagination.page,e.hasMore=t.pagination.hasMore,e.items=i||$?t.contacts:Ze(e.items,t.contacts),$&&oe()}function Ze(e,t){const i=new Set(e.map(_=>_.key)),d=[...e];for(const _ of t)i.has(_.key)||(i.add(_.key),d.push(_));return d}function Xe(){const t=xe.value.at(-1);if(!t||t.index<N.value.length-pn)return;if(D(t.index).pool==="friend"){if(k.value.hasMore){Ie("friend");return}Ce.value&&!m.value.response&&!m.value.isLoadingInitial&&G("non_friend");return}if(!m.value.response&&!m.value.isLoadingInitial){G("non_friend");return}m.value.hasMore&&Ie("non_friend")}function D(e){return N.value[e]}function g(e){return D(e)}function Je(e){return e?.type==="section"?e.pool==="non_friend"?42:1:e?.type==="loading"?44:Ve}async function et(e){const t=e==="non_friend"?"non_friend":"friend";p.value=t,K.value=!0,M.value&&clearTimeout(M.value),t==="non_friend"&&await tt(),await Be();const i=N.value.findIndex(d=>d.type==="section"&&d.pool===t);if(i>=0){const d=t==="non_friend"?Math.min(i+1,N.value.length-1):i;de.value.scrollToIndex(d,{align:"start"})}M.value=setTimeout(()=>{K.value=!1,p.value=t},350)}async function tt(){!m.value.response&&!m.value.isLoadingInitial&&await G("non_friend",{acceptStale:!0}),await at()}async function at(e){if(!Pa({friendInitialLoading:k.value.isLoadingInitial,groupmateInitialLoading:m.value.isLoadingInitial}))return;const t=[ae.friend,ae.non_friend].filter(i=>!!i);t.length!==0&&await Promise.allSettled(t)}function nt(){K.value=!1,M.value&&clearTimeout(M.value),ue();for(const e of["friend","non_friend"])V.value[e].requestId++,V.value[e]=me();oe(),ne.value={},Y.value&&(Y.value.scrollTop=0)}function Fe(){Q.value?st():Me()}function st(){j.value||(j.value=setInterval(()=>{ot()},1500))}async function ot(){if(!fe.value){fe.value=!0;try{const e=Aa({activePool:p.value,friendTaskStatus:k.value.response?.task?.status,groupmateTaskStatus:m.value.response?.task?.status});await Promise.all(e.map(t=>W(t,1,{acceptStale:!0,replace:!0,preserveExisting:!0,silent:!0})))}finally{fe.value=!1}}}function Me(){j.value&&(clearInterval(j.value),j.value=null)}function rt(e){ue(),H.value={...e,processedSessions:e.totalSessions},ee.value=setTimeout(()=>{H.value=null,ee.value=null},450)}function ue(){ee.value&&(clearTimeout(ee.value),ee.value=null),H.value=null}async function it(e){v.value=e.key,await ze(e.key)}async function ze(e,t){const i=`${F.value}:${e}`,d=ne.value[i];if(d&&!t?.skipCache){w.value=d;return}w.value=null,R.value=!0;try{const _=await S.getContactDetail(e,{acceptStale:!0,timeRangePreset:F.value});if(v.value!==e)return;w.value=_.contact,_.contact&&(ne.value={...ne.value,[i]:_.contact})}catch(_){h.fail(s("contacts.toast.recomputeFailed"),{description:String(_)})}finally{v.value===e&&(R.value=!1)}}async function lt(){const e=w.value?.key;if(!(!e||x.value)){x.value=!0;try{await S.markContactAsFriend(e,{timeRangePreset:F.value}),h.success(s("contacts.toast.markFriendSucceeded")),await Ae(e)}catch(t){h.fail(s("contacts.toast.markFriendFailed"),{description:String(t)})}finally{x.value=!1}}}async function ct(){const e=w.value?.key;if(!(!e||x.value)){x.value=!0;try{await S.unmarkContactAsFriend(e,{timeRangePreset:F.value}),h.success(s("contacts.toast.unmarkFriendSucceeded")),await Ae(e)}catch(t){h.fail(s("contacts.toast.unmarkFriendFailed"),{description:String(t)})}finally{x.value=!1}}}async function Ae(e){const t=p.value,i=Y.value?.scrollTop??0,d=w.value?.pool??t;if(ne.value={},d==="non_friend"){dt(e),oe(),await Ee(t,i),await ut();return}await Promise.all([G("friend",{acceptStale:!0}),G("non_friend",{acceptStale:!0})]),v.value=e,await ze(e,{skipCache:!0}),await Ee(t,i)}function dt(e){const t=m.value,i=t.items.filter(d=>d.key!==e);i.length!==t.items.length&&(t.items=i,t.total=Math.max(0,t.total-1),t.hasMore=t.items.length<t.total)}async function ut(){await Promise.all([W("friend",1,{acceptStale:!0,replace:!0,preserveExisting:je("friend"),silent:!0}),W("non_friend",1,{acceptStale:!0,replace:!0,preserveExisting:je("non_friend"),silent:!0})])}function oe(){v.value=null,w.value=null,R.value=!1}function ft(e){return e.friendSource==="manual"?s("contacts.pool.manualFriend"):e.pool==="friend"?s("contacts.pool.friend"):s("contacts.pool.nonFriend")}function mt(e){return e.friendSource==="manual"?"bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400 border border-indigo-100/50 dark:border-indigo-500/20":e.pool==="friend"?"bg-sky-50 text-sky-600 dark:bg-sky-500/10 dark:text-sky-400 border border-sky-100/50 dark:border-sky-500/20":"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400 border border-emerald-100/50 dark:border-emerald-500/20"}function ye(e){return e==="friend"?"contact-table-grid--friends":"contact-table-grid--group-contacts"}function pt(e,t){return Z(e==="friend"?t.scoreBreakdown.privateMessageCount:t.scoreBreakdown.commonGroupCount)}function gt(e,t){return Z(e==="friend"?t.scoreBreakdown.activePrivateMonths:t.scoreBreakdown.coOccurrenceCount)}function vt(e,t){return Z(e==="friend"?t.scoreBreakdown.commonGroupCount:t.scoreBreakdown.replyInteractionCount)}function xt(e){return(e.displayName||e.platformId||"?").slice(0,1)}function yt(e){return Math.round(e*100).toString()}function ht(e){return e.friendSource==="manual"?"-":yt(e.score)}function Z(e){return String(e??0)}function kt(e){return e?new Date(e*1e3).toLocaleDateString():s("contacts.emptyValue")}function bt(e){A.push({name:e.type==="private"?"private-chat":"group-chat",params:{id:e.id}})}function _t(e){C.openChatRecordDrawer({sessionId:e.id})}function St(e){const t=e.target;if(ie.value.scrollOffset=t.scrollTop,we.value=t.scrollLeft,K.value)return;const i=wt(t);p.value!==i&&(p.value=i)}function wt(e){return pe.value&&e.scrollTop>=Ne()?"non_friend":"friend"}function Ne(){return 1+k.value.items.length*Ve+(k.value.isLoadingMore?44:0)}async function Ee(e,t){p.value=e,await Be();const i=Y.value;i&&(K.value=!0,M.value&&clearTimeout(M.value),i.scrollTop=Ia({previousScrollTop:t,groupSectionScrollTop:Ct()}),M.value=setTimeout(()=>{K.value=!1,p.value=e},150))}function Ct(){return pe.value?Ne():null}return(e,t)=>{const i=Tt,d=ke,_=Lt,L=be,$=$t;return c(),f("div",Ea,[y(r(At),{modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=l=>p.value=l),items:He.value,"persist-key":"contactsTab",onChange:et},{right:T(()=>[a("div",Ba,[y(i,{modelValue:F.value,"onUpdate:modelValue":t[0]||(t[0]=l=>F.value=l),items:Ke.value,content:!1,size:"xs",class:"min-w-max gap-0 bg-transparent dark:bg-transparent shadow-none",disabled:Q.value},null,8,["modelValue","items","disabled"]),y(_,{modelValue:P.value,"onUpdate:modelValue":t[2]||(t[2]=l=>P.value=l),icon:"i-lucide-search",placeholder:r(s)("contacts.search"),size:"sm",class:"w-full sm:w-36"},Ot({_:2},[P.value?{name:"trailing",fn:T(()=>[y(d,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs","aria-label":r(s)("contacts.actions.clearSearch"),onClick:t[1]||(t[1]=l=>P.value="")},null,8,["aria-label"])]),key:"0"}:void 0]),1032,["modelValue","placeholder"])])]),_:1},8,["modelValue","items"]),a("div",ja,[a("main",Va,[a("div",Ga,[y(La,{"show-disabled-notice":Re.value,"active-private-session-count":ve.value?.activePrivateSessionCount??0,"cache-status":le.value?.cache.status,"task-failed":Ue.value,"task-last-error":z.value?.lastError,"is-task-running":Q.value,"is-recomputing":I.value,onRecompute:Pe},null,8,["show-disabled-notice","active-private-session-count","cache-status","task-failed","task-last-error","is-task-running","is-recomputing"]),a("section",Da,[Le.value?(c(),re(r(Bt),{key:0,text:qe.value,height:"py-16"},null,8,["text"])):Te.value?(c(),f("div",Oa,o(Te.value),1)):(c(),f("div",Ua,[Oe.value?(c(),f("div",qa,[a("div",Ra,[y(L,{name:"i-lucide-users-2",class:"h-6 w-6"})]),a("p",Ha,o(r(s)("contacts.empty")),1)])):(c(),re(r(Et),{key:1,shadow:!1,class:"flex h-full min-w-0 flex-col"},{default:T(()=>[a("div",Ka,[a("div",{class:U(["contact-table-grid min-w-[720px] px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500",ye(p.value)]),style:X({transform:`translateX(-${we.value}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),p.value==="friend"?(c(),f(q,{key:0},[a("span",null,o(r(s)("contacts.metrics.privateMessagesLabel")),1),a("span",null,o(r(s)("contacts.metrics.activeMonths")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1)],64)):(c(),f(q,{key:1},[a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1)],64)),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Ya,[a("span",Qa,o(r(s)("contacts.detail.score")),1),y($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Wa,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[y(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)]),a("div",{ref_key:"scrollContainerRef",ref:Y,class:"min-h-0 flex-1 overflow-auto scrollbar-hide",onScroll:St},[a("div",{class:"relative min-w-[720px]",style:X({height:`${Ye.value}px`})},[(c(!0),f(q,null,he(xe.value,l=>(c(),f(q,{key:String(l.key)},[D(l.index).type==="section"&&D(l.index).pool==="friend"?(c(),f("div",{key:0,class:"absolute left-0 top-0 h-px w-full",style:X({transform:`translateY(${l.start}px)`}),"aria-hidden":"true"},null,4)):D(l.index).type==="section"?(c(),f("div",{key:1,class:U(["contact-table-grid absolute left-0 top-0 w-full border-b border-gray-100 bg-white px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:border-white/5 dark:bg-[#202024] dark:text-gray-500",ye(D(l.index).pool)]),style:X({transform:`translateY(${l.start}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Za,[a("span",Xa,o(r(s)("contacts.detail.score")),1),y($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Ja,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[y(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)):D(l.index).type==="contact"?(c(),f("button",{key:2,type:"button",class:U(["contact-table-grid absolute left-0 top-0 w-full px-4 py-3.5 text-left outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",[ye(g(l.index).pool),v.value===g(l.index).contact.key?"border-b border-primary-500/20 bg-primary-500/[0.03] dark:bg-primary-500/[0.04]":"border-b border-gray-100/50 bg-transparent hover:bg-gray-50/50 dark:border-white/5 dark:hover:bg-gray-800/20"]]),style:X({transform:`translateY(${l.start}px)`}),"aria-label":r(s)("contacts.actions.viewDetail",{name:g(l.index).contact.displayName}),onClick:vn=>it(g(l.index).contact)},[a("div",{class:U(["absolute left-0 top-1/4 h-1/2 w-1 rounded-r-full bg-primary-500 transition-all duration-300",v.value===g(l.index).contact.key?"scale-100 opacity-100":"scale-75 opacity-0"])},null,2),a("div",tn,[a("div",an,[g(l.index).contact.avatar?(c(),f("img",{key:0,src:g(l.index).contact.avatar??"",alt:g(l.index).contact.displayName,loading:"lazy",decoding:"async",class:"h-10 w-10 object-cover transition-transform duration-300 group-hover:scale-105"},null,8,nn)):(c(),f("div",sn,o(xt(g(l.index).contact)),1))]),a("div",on,[a("div",rn,[a("span",{class:U(["truncate text-sm font-semibold leading-tight tracking-tight text-gray-800 transition-colors group-hover:text-primary-600 group-focus-visible:text-primary-600 dark:text-gray-200 dark:group-hover:text-primary-400 dark:group-focus-visible:text-primary-400",v.value===g(l.index).contact.key?"text-primary-600 dark:text-primary-400":""])},o(g(l.index).contact.displayName),3)]),a("span",ln,o(g(l.index).contact.platform),1)])]),a("span",{class:U(["inline-flex w-fit justify-self-start rounded-lg px-2.5 py-1 text-xs font-semibold",mt(g(l.index).contact)])},o(ft(g(l.index).contact)),3),a("span",cn,o(pt(g(l.index).pool,g(l.index).contact)),1),a("span",dn,o(gt(g(l.index).pool,g(l.index).contact)),1),a("span",un,o(vt(g(l.index).pool,g(l.index).contact)),1),a("span",fn,o(kt(g(l.index).contact.lastInteractionTs)),1),a("span",{class:U(["inline-flex h-7 w-12 items-center justify-center justify-self-end rounded-lg font-mono text-xs font-bold tabular-nums transition-colors duration-200",v.value===g(l.index).contact.key?"bg-primary-500 text-white":"bg-primary-50 text-primary-600 dark:bg-primary-500/10 dark:text-primary-400"])},o(ht(g(l.index).contact)),3)],14,en)):(c(),f("div",{key:3,class:"absolute left-0 top-0 flex h-11 w-full items-center justify-center gap-2 border-b border-gray-100/50 text-xs font-semibold text-gray-500 dark:border-white/5 dark:text-gray-400",style:X({transform:`translateY(${l.start}px)`})},[y(L,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(s)("common.loading")),1)],4))],64))),128))],4)],544)]),_:1}))]))])])]),y(ma,{"selected-key":v.value,contact:w.value,"is-loading":R.value,"is-friend-action-loading":x.value,onClear:oe,onOpenSource:bt,onViewSourceRecords:_t,onMarkFriend:lt,onUnmarkFriend:ct},null,8,["selected-key","contact","is-loading","is-friend-action-loading"])])])}}}),wn=Ge(gn,[["__scopeId","data-v-30c675a1"]]);export{wn as default};
|