openclaw-agent-dashboard 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +55 -321
  2. package/frontend-dist/assets/index-B7XqKAxm.css +1 -0
  3. package/frontend-dist/assets/index-CxJaSYyo.js +24 -0
  4. package/{frontend → frontend-dist}/index.html +2 -1
  5. package/{plugin/openclaw.plugin.json → openclaw.plugin.json} +2 -2
  6. package/package.json +21 -13
  7. package/.github/workflows/release.yml +0 -56
  8. package/VERSION_DISPLAY_delivery.md +0 -242
  9. package/VERSION_DISPLAY_implementation_summary.md +0 -315
  10. package/design_manifest.md +0 -100
  11. package/docs/CHANGELOG_AGENT_MODIFICATIONS.md +0 -132
  12. package/docs/MAINTAINER_RELEASE_WORKFLOW.md +0 -211
  13. package/docs/Openclaw-Agent-Dashboard/345/217/221/345/270/203/344/270/216/346/233/264/346/226/260.md +0 -147
  14. package/docs/RELEASE-LATEST.md +0 -189
  15. package/docs/RELEASE-MODEL-CONFIG.md +0 -95
  16. package/docs/WINDOWS_INSTALL_TROUBLESHOOTING.md +0 -171
  17. package/docs/design/.gitkeep +0 -0
  18. package/docs/design/VERSION_DISPLAY_design.md +0 -1236
  19. package/docs/release-guide.md +0 -259
  20. package/docs/release-operations-manual.md +0 -167
  21. package/docs/reviews/.gitkeep +0 -0
  22. package/docs/reviews/approval_history.json +0 -14
  23. package/docs/reviews/cr_VERSION_DISPLAY.md +0 -397
  24. package/docs/reviews/traceability_manifest.json +0 -279
  25. package/docs/specs/VERSION_DISPLAY_spec.md +0 -371
  26. package/docs/specs/tr3-install-system.md +0 -580
  27. package/docs/windows-collaboration-model-paths-troubleshooting.md +0 -0
  28. package/frontend/package-lock.json +0 -1240
  29. package/frontend/package.json +0 -19
  30. package/frontend/src/App.vue +0 -355
  31. package/frontend/src/components/AgentCard.vue +0 -796
  32. package/frontend/src/components/AgentConfigPanel.vue +0 -539
  33. package/frontend/src/components/AgentDetailPanel.vue +0 -738
  34. package/frontend/src/components/ErrorAnalysisView.vue +0 -546
  35. package/frontend/src/components/ErrorCenterPanel.vue +0 -844
  36. package/frontend/src/components/PerformanceMonitor.vue +0 -515
  37. package/frontend/src/components/SettingsPanel.vue +0 -236
  38. package/frontend/src/components/TokenAnalysisPanel.vue +0 -683
  39. package/frontend/src/components/chain/ChainEdge.vue +0 -85
  40. package/frontend/src/components/chain/ChainNode.vue +0 -166
  41. package/frontend/src/components/chain/TaskChainView.vue +0 -425
  42. package/frontend/src/components/chain/index.ts +0 -3
  43. package/frontend/src/components/chain/types.ts +0 -70
  44. package/frontend/src/components/collaboration/CollaborationFlowSection.vue +0 -1032
  45. package/frontend/src/components/collaboration/CollaborationFlowWrapper.vue +0 -113
  46. package/frontend/src/components/common/VersionDisplay.vue +0 -187
  47. package/frontend/src/components/performance/PerformancePanel.vue +0 -119
  48. package/frontend/src/components/performance/PerformanceSection.vue +0 -1137
  49. package/frontend/src/components/tasks/TaskStatusSection.vue +0 -973
  50. package/frontend/src/components/timeline/TimelineConnector.vue +0 -31
  51. package/frontend/src/components/timeline/TimelineRound.vue +0 -135
  52. package/frontend/src/components/timeline/TimelineStep.vue +0 -691
  53. package/frontend/src/components/timeline/TimelineToolLink.vue +0 -109
  54. package/frontend/src/components/timeline/TimelineView.vue +0 -540
  55. package/frontend/src/components/timeline/index.ts +0 -5
  56. package/frontend/src/components/timeline/types.ts +0 -120
  57. package/frontend/src/composables/index.ts +0 -7
  58. package/frontend/src/composables/useDebounce.ts +0 -48
  59. package/frontend/src/composables/useRealtime.ts +0 -52
  60. package/frontend/src/composables/useState.ts +0 -52
  61. package/frontend/src/composables/useThrottle.ts +0 -46
  62. package/frontend/src/composables/useVirtualScroll.ts +0 -106
  63. package/frontend/src/main.ts +0 -4
  64. package/frontend/src/managers/EventDispatcher.ts +0 -127
  65. package/frontend/src/managers/RealtimeDataManager.ts +0 -302
  66. package/frontend/src/managers/StateManager.ts +0 -128
  67. package/frontend/src/managers/index.ts +0 -5
  68. package/frontend/src/types/collaboration.ts +0 -135
  69. package/frontend/src/types/index.ts +0 -20
  70. package/frontend/src/types/performance.ts +0 -105
  71. package/frontend/src/types/task.ts +0 -38
  72. package/frontend/vite.config.ts +0 -18
  73. package/legacy_code_anatomy.md +0 -518
  74. package/plugin/README.md +0 -99
  75. package/plugin/config.json.example +0 -1
  76. package/plugin/package.json +0 -26
  77. package/scripts/build-plugin.js +0 -81
  78. package/scripts/bundle.sh +0 -62
  79. package/scripts/install-plugin.sh +0 -162
  80. package/scripts/install-python-deps.sh +0 -226
  81. package/scripts/install.js +0 -684
  82. package/scripts/install.sh +0 -367
  83. package/scripts/lib/common.sh +0 -137
  84. package/scripts/release-pack.sh +0 -110
  85. package/scripts/start.js +0 -50
  86. package/scripts/test_available_models.py +0 -284
  87. package/scripts/test_version_display.sh +0 -128
  88. package/scripts/test_websocket_ping.py +0 -44
  89. package/session_registry.json +0 -58
  90. package/tests/.gitkeep +0 -0
  91. package/tests/qa_regression_report.md +0 -359
  92. package/tests/qa_version_display_report.md +0 -598
  93. /package/{src/backend → dashboard}/agents.py +0 -0
  94. /package/{src/backend → dashboard}/api/__init__.py +0 -0
  95. /package/{src/backend → dashboard}/api/agent_config_api.py +0 -0
  96. /package/{src/backend → dashboard}/api/agents.py +0 -0
  97. /package/{src/backend → dashboard}/api/agents_config.py +0 -0
  98. /package/{src/backend → dashboard}/api/chains.py +0 -0
  99. /package/{src/backend → dashboard}/api/collaboration.py +0 -0
  100. /package/{src/backend → dashboard}/api/debug_paths.py +0 -0
  101. /package/{src/backend → dashboard}/api/error_analysis.py +0 -0
  102. /package/{src/backend → dashboard}/api/errors.py +0 -0
  103. /package/{src/backend → dashboard}/api/performance.py +0 -0
  104. /package/{src/backend → dashboard}/api/subagents.py +0 -0
  105. /package/{src/backend → dashboard}/api/timeline.py +0 -0
  106. /package/{src/backend → dashboard}/api/version.py +0 -0
  107. /package/{src/backend → dashboard}/api/websocket.py +0 -0
  108. /package/{src/backend → dashboard}/collaboration.py +0 -0
  109. /package/{src/backend → dashboard}/data/__init__.py +0 -0
  110. /package/{src/backend → dashboard}/data/agent_config_manager.py +0 -0
  111. /package/{src/backend → dashboard}/data/chain_reader.py +0 -0
  112. /package/{src/backend → dashboard}/data/config_reader.py +0 -0
  113. /package/{src/backend → dashboard}/data/error_analyzer.py +0 -0
  114. /package/{src/backend → dashboard}/data/session_reader.py +0 -0
  115. /package/{src/backend → dashboard}/data/subagent_reader.py +0 -0
  116. /package/{src/backend → dashboard}/data/task_history.py +0 -0
  117. /package/{src/backend → dashboard}/data/timeline_reader.py +0 -0
  118. /package/{src/backend → dashboard}/data/version_info_reader.py +0 -0
  119. /package/{src/backend → dashboard}/errors.py +0 -0
  120. /package/{src/backend → dashboard}/main.py +0 -0
  121. /package/{src/backend → dashboard}/mechanism_reader.py +0 -0
  122. /package/{src/backend → dashboard}/mechanisms.py +0 -0
  123. /package/{src/backend → dashboard}/performance.py +0 -0
  124. /package/{src/backend → dashboard}/requirements.txt +0 -0
  125. /package/{src/backend → dashboard}/session_reader.py +0 -0
  126. /package/{src/backend → dashboard}/status/__init__.py +0 -0
  127. /package/{src/backend → dashboard}/status/change_tracker.py +0 -0
  128. /package/{src/backend → dashboard}/status/error_detector.py +0 -0
  129. /package/{src/backend → dashboard}/status/status_cache.py +0 -0
  130. /package/{src/backend → dashboard}/status/status_calculator.py +0 -0
  131. /package/{src/backend → dashboard}/status_calculator.py +0 -0
  132. /package/{src/backend → dashboard}/subagent_reader.py +0 -0
  133. /package/{src/backend → dashboard}/watchers/__init__.py +0 -0
  134. /package/{src/backend → dashboard}/watchers/file_watcher.py +0 -0
  135. /package/{plugin/index.js → index.js} +0 -0
@@ -0,0 +1,24 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))l(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();/**
2
+ * @vue/shared v3.5.29
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function bn(t){const e=Object.create(null);for(const s of t.split(","))e[s]=1;return s=>s in e}const yt={},Ne=[],ne=()=>{},xl=()=>!1,Fs=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),$n=t=>t.startsWith("onUpdate:"),Mt=Object.assign,kn=(t,e)=>{const s=t.indexOf(e);s>-1&&t.splice(s,1)},Li=Object.prototype.hasOwnProperty,pt=(t,e)=>Li.call(t,e),at=Array.isArray,je=t=>ps(t)==="[object Map]",Ke=t=>ps(t)==="[object Set]",Hn=t=>ps(t)==="[object Date]",ut=t=>typeof t=="function",xt=t=>typeof t=="string",ie=t=>typeof t=="symbol",_t=t=>t!==null&&typeof t=="object",Al=t=>(_t(t)||ut(t))&&ut(t.then)&&ut(t.catch),Il=Object.prototype.toString,ps=t=>Il.call(t),Ni=t=>ps(t).slice(8,-1),Ml=t=>ps(t)==="[object Object]",wn=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Xe=bn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Os=t=>{const e=Object.create(null);return s=>e[s]||(e[s]=t(s))},ji=/-\w/g,Ce=Os(t=>t.replace(ji,e=>e.slice(1).toUpperCase())),Ui=/\B([A-Z])/g,De=Os(t=>t.replace(Ui,"-$1").toLowerCase()),Rl=Os(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ks=Os(t=>t?`on${Rl(t)}`:""),we=(t,e)=>!Object.is(t,e),$s=(t,...e)=>{for(let s=0;s<t.length;s++)t[s](...e)},El=(t,e,s,l=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:l,value:s})},Ls=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let Bn;const Ns=()=>Bn||(Bn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function St(t){if(at(t)){const e={};for(let s=0;s<t.length;s++){const l=t[s],i=xt(l)?Bi(l):St(l);if(i)for(const o in i)e[o]=i[o]}return e}else if(xt(t)||_t(t))return t}const Vi=/;(?![^(]*\))/g,Wi=/:([^]+)/,Hi=/\/\*[^]*?\*\//g;function Bi(t){const e={};return t.replace(Hi,"").split(Vi).forEach(s=>{if(s){const l=s.split(Wi);l.length>1&&(e[l[0].trim()]=l[1].trim())}}),e}function nt(t){let e="";if(xt(t))e=t;else if(at(t))for(let s=0;s<t.length;s++){const l=nt(t[s]);l&&(e+=l+" ")}else if(_t(t))for(const s in t)t[s]&&(e+=s+" ");return e.trim()}const Ki="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",qi=bn(Ki);function Pl(t){return!!t||t===""}function Gi(t,e){if(t.length!==e.length)return!1;let s=!0;for(let l=0;s&&l<t.length;l++)s=qe(t[l],e[l]);return s}function qe(t,e){if(t===e)return!0;let s=Hn(t),l=Hn(e);if(s||l)return s&&l?t.getTime()===e.getTime():!1;if(s=ie(t),l=ie(e),s||l)return t===e;if(s=at(t),l=at(e),s||l)return s&&l?Gi(t,e):!1;if(s=_t(t),l=_t(e),s||l){if(!s||!l)return!1;const i=Object.keys(t).length,o=Object.keys(e).length;if(i!==o)return!1;for(const a in t){const r=t.hasOwnProperty(a),u=e.hasOwnProperty(a);if(r&&!u||!r&&u||!qe(t[a],e[a]))return!1}}return String(t)===String(e)}function Cn(t,e){return t.findIndex(s=>qe(s,e))}const Dl=t=>!!(t&&t.__v_isRef===!0),f=t=>xt(t)?t:t==null?"":at(t)||_t(t)&&(t.toString===Il||!ut(t.toString))?Dl(t)?f(t.value):JSON.stringify(t,Fl,2):String(t),Fl=(t,e)=>Dl(e)?Fl(t,e.value):je(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((s,[l,i],o)=>(s[qs(l,o)+" =>"]=i,s),{})}:Ke(e)?{[`Set(${e.size})`]:[...e.values()].map(s=>qs(s))}:ie(e)?qs(e):_t(e)&&!at(e)&&!Ml(e)?String(e):e,qs=(t,e="")=>{var s;return ie(t)?`Symbol(${(s=t.description)!=null?s:e})`:t};/**
6
+ * @vue/reactivity v3.5.29
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let Vt;class zi{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Vt,!e&&Vt&&(this.index=(Vt.scopes||(Vt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,s;if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].pause();for(e=0,s=this.effects.length;e<s;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,s;if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].resume();for(e=0,s=this.effects.length;e<s;e++)this.effects[e].resume()}}run(e){if(this._active){const s=Vt;try{return Vt=this,e()}finally{Vt=s}}}on(){++this._on===1&&(this.prevScope=Vt,Vt=this)}off(){this._on>0&&--this._on===0&&(Vt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let s,l;for(s=0,l=this.effects.length;s<l;s++)this.effects[s].stop();for(this.effects.length=0,s=0,l=this.cleanups.length;s<l;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,l=this.scopes.length;s<l;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Ji(){return Vt}let $t;const Gs=new WeakSet;class Ol{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Vt&&Vt.active&&Vt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Gs.has(this)&&(Gs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Nl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Kn(this),jl(this);const e=$t,s=zt;$t=this,zt=!0;try{return this.fn()}finally{Ul(this),$t=e,zt=s,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)xn(e);this.deps=this.depsTail=void 0,Kn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Gs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){nn(this)&&this.run()}get dirty(){return nn(this)}}let Ll=0,Ze,ts;function Nl(t,e=!1){if(t.flags|=8,e){t.next=ts,ts=t;return}t.next=Ze,Ze=t}function Tn(){Ll++}function Sn(){if(--Ll>0)return;if(ts){let e=ts;for(ts=void 0;e;){const s=e.next;e.next=void 0,e.flags&=-9,e=s}}let t;for(;Ze;){let e=Ze;for(Ze=void 0;e;){const s=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(l){t||(t=l)}e=s}}if(t)throw t}function jl(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Ul(t){let e,s=t.depsTail,l=s;for(;l;){const i=l.prevDep;l.version===-1?(l===s&&(s=i),xn(l),Qi(l)):e=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=i}t.deps=e,t.depsTail=s}function nn(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Vl(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Vl(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===os)||(t.globalVersion=os,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!nn(t))))return;t.flags|=2;const e=t.dep,s=$t,l=zt;$t=t,zt=!0;try{jl(t);const i=t.fn(t._value);(e.version===0||we(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{$t=s,zt=l,Ul(t),t.flags&=-3}}function xn(t,e=!1){const{dep:s,prevSub:l,nextSub:i}=t;if(l&&(l.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)xn(o,!0)}!e&&!--s.sc&&s.map&&s.map.delete(s.key)}function Qi(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}let zt=!0;const Wl=[];function pe(){Wl.push(zt),zt=!1}function ve(){const t=Wl.pop();zt=t===void 0?!0:t}function Kn(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const s=$t;$t=void 0;try{e()}finally{$t=s}}}let os=0;class Yi{constructor(e,s){this.sub=e,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class An{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!$t||!zt||$t===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==$t)s=this.activeLink=new Yi($t,this),$t.deps?(s.prevDep=$t.depsTail,$t.depsTail.nextDep=s,$t.depsTail=s):$t.deps=$t.depsTail=s,Hl(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=$t.depsTail,s.nextDep=void 0,$t.depsTail.nextDep=s,$t.depsTail=s,$t.deps===s&&($t.deps=l)}return s}trigger(e){this.version++,os++,this.notify(e)}notify(e){Tn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Sn()}}}function Hl(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let l=e.deps;l;l=l.nextDep)Hl(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const ln=new WeakMap,Re=Symbol(""),on=Symbol(""),as=Symbol("");function Et(t,e,s){if(zt&&$t){let l=ln.get(t);l||ln.set(t,l=new Map);let i=l.get(s);i||(l.set(s,i=new An),i.map=l,i.key=s),i.track()}}function de(t,e,s,l,i,o){const a=ln.get(t);if(!a){os++;return}const r=u=>{u&&u.trigger()};if(Tn(),e==="clear")a.forEach(r);else{const u=at(t),v=u&&wn(s);if(u&&s==="length"){const p=Number(l);a.forEach((C,A)=>{(A==="length"||A===as||!ie(A)&&A>=p)&&r(C)})}else switch((s!==void 0||a.has(void 0))&&r(a.get(s)),v&&r(a.get(as)),e){case"add":u?v&&r(a.get("length")):(r(a.get(Re)),je(t)&&r(a.get(on)));break;case"delete":u||(r(a.get(Re)),je(t)&&r(a.get(on)));break;case"set":je(t)&&r(a.get(Re));break}}Sn()}function Fe(t){const e=ht(t);return e===t?e:(Et(e,"iterate",as),qt(t)?e:e.map(Jt))}function js(t){return Et(t=ht(t),"iterate",as),t}function be(t,e){return ge(t)?We(Ee(t)?Jt(e):e):Jt(e)}const Xi={__proto__:null,[Symbol.iterator](){return zs(this,Symbol.iterator,t=>be(this,t))},concat(...t){return Fe(this).concat(...t.map(e=>at(e)?Fe(e):e))},entries(){return zs(this,"entries",t=>(t[1]=be(this,t[1]),t))},every(t,e){return re(this,"every",t,e,void 0,arguments)},filter(t,e){return re(this,"filter",t,e,s=>s.map(l=>be(this,l)),arguments)},find(t,e){return re(this,"find",t,e,s=>be(this,s),arguments)},findIndex(t,e){return re(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return re(this,"findLast",t,e,s=>be(this,s),arguments)},findLastIndex(t,e){return re(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return re(this,"forEach",t,e,void 0,arguments)},includes(...t){return Js(this,"includes",t)},indexOf(...t){return Js(this,"indexOf",t)},join(t){return Fe(this).join(t)},lastIndexOf(...t){return Js(this,"lastIndexOf",t)},map(t,e){return re(this,"map",t,e,void 0,arguments)},pop(){return ze(this,"pop")},push(...t){return ze(this,"push",t)},reduce(t,...e){return qn(this,"reduce",t,e)},reduceRight(t,...e){return qn(this,"reduceRight",t,e)},shift(){return ze(this,"shift")},some(t,e){return re(this,"some",t,e,void 0,arguments)},splice(...t){return ze(this,"splice",t)},toReversed(){return Fe(this).toReversed()},toSorted(t){return Fe(this).toSorted(t)},toSpliced(...t){return Fe(this).toSpliced(...t)},unshift(...t){return ze(this,"unshift",t)},values(){return zs(this,"values",t=>be(this,t))}};function zs(t,e,s){const l=js(t),i=l[e]();return l!==t&&!qt(t)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=s(o.value)),o}),i}const Zi=Array.prototype;function re(t,e,s,l,i,o){const a=js(t),r=a!==t&&!qt(t),u=a[e];if(u!==Zi[e]){const C=u.apply(t,o);return r?Jt(C):C}let v=s;a!==t&&(r?v=function(C,A){return s.call(this,be(t,C),A,t)}:s.length>2&&(v=function(C,A){return s.call(this,C,A,t)}));const p=u.call(a,v,l);return r&&i?i(p):p}function qn(t,e,s,l){const i=js(t);let o=s;return i!==t&&(qt(t)?s.length>3&&(o=function(a,r,u){return s.call(this,a,r,u,t)}):o=function(a,r,u){return s.call(this,a,be(t,r),u,t)}),i[e](o,...l)}function Js(t,e,s){const l=ht(t);Et(l,"iterate",as);const i=l[e](...s);return(i===-1||i===!1)&&En(s[0])?(s[0]=ht(s[0]),l[e](...s)):i}function ze(t,e,s=[]){pe(),Tn();const l=ht(t)[e].apply(t,s);return Sn(),ve(),l}const to=bn("__proto__,__v_isRef,__isVue"),Bl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(ie));function eo(t){ie(t)||(t=String(t));const e=ht(this);return Et(e,"has",t),e.hasOwnProperty(t)}class Kl{constructor(e=!1,s=!1){this._isReadonly=e,this._isShallow=s}get(e,s,l){if(s==="__v_skip")return e.__v_skip;const i=this._isReadonly,o=this._isShallow;if(s==="__v_isReactive")return!i;if(s==="__v_isReadonly")return i;if(s==="__v_isShallow")return o;if(s==="__v_raw")return l===(i?o?fo:Jl:o?zl:Gl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(l)?e:void 0;const a=at(e);if(!i){let u;if(a&&(u=Xi[s]))return u;if(s==="hasOwnProperty")return eo}const r=Reflect.get(e,s,Pt(e)?e:l);if((ie(s)?Bl.has(s):to(s))||(i||Et(e,"get",s),o))return r;if(Pt(r)){const u=a&&wn(s)?r:r.value;return i&&_t(u)?rn(u):u}return _t(r)?i?rn(r):Mn(r):r}}class ql extends Kl{constructor(e=!1){super(!1,e)}set(e,s,l,i){let o=e[s];const a=at(e)&&wn(s);if(!this._isShallow){const v=ge(o);if(!qt(l)&&!ge(l)&&(o=ht(o),l=ht(l)),!a&&Pt(o)&&!Pt(l))return v||(o.value=l),!0}const r=a?Number(s)<e.length:pt(e,s),u=Reflect.set(e,s,l,Pt(e)?e:i);return e===ht(i)&&(r?we(l,o)&&de(e,"set",s,l):de(e,"add",s,l)),u}deleteProperty(e,s){const l=pt(e,s);e[s];const i=Reflect.deleteProperty(e,s);return i&&l&&de(e,"delete",s,void 0),i}has(e,s){const l=Reflect.has(e,s);return(!ie(s)||!Bl.has(s))&&Et(e,"has",s),l}ownKeys(e){return Et(e,"iterate",at(e)?"length":Re),Reflect.ownKeys(e)}}class so extends Kl{constructor(e=!1){super(!0,e)}set(e,s){return!0}deleteProperty(e,s){return!0}}const no=new ql,lo=new so,io=new ql(!0);const an=t=>t,ms=t=>Reflect.getPrototypeOf(t);function oo(t,e,s){return function(...l){const i=this.__v_raw,o=ht(i),a=je(o),r=t==="entries"||t===Symbol.iterator&&a,u=t==="keys"&&a,v=i[t](...l),p=s?an:e?We:Jt;return!e&&Et(o,"iterate",u?on:Re),Mt(Object.create(v),{next(){const{value:C,done:A}=v.next();return A?{value:C,done:A}:{value:r?[p(C[0]),p(C[1])]:p(C),done:A}}})}}function _s(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function ao(t,e){const s={get(i){const o=this.__v_raw,a=ht(o),r=ht(i);t||(we(i,r)&&Et(a,"get",i),Et(a,"get",r));const{has:u}=ms(a),v=e?an:t?We:Jt;if(u.call(a,i))return v(o.get(i));if(u.call(a,r))return v(o.get(r));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!t&&Et(ht(i),"iterate",Re),i.size},has(i){const o=this.__v_raw,a=ht(o),r=ht(i);return t||(we(i,r)&&Et(a,"has",i),Et(a,"has",r)),i===r?o.has(i):o.has(i)||o.has(r)},forEach(i,o){const a=this,r=a.__v_raw,u=ht(r),v=e?an:t?We:Jt;return!t&&Et(u,"iterate",Re),r.forEach((p,C)=>i.call(o,v(p),v(C),a))}};return Mt(s,t?{add:_s("add"),set:_s("set"),delete:_s("delete"),clear:_s("clear")}:{add(i){!e&&!qt(i)&&!ge(i)&&(i=ht(i));const o=ht(this);return ms(o).has.call(o,i)||(o.add(i),de(o,"add",i,i)),this},set(i,o){!e&&!qt(o)&&!ge(o)&&(o=ht(o));const a=ht(this),{has:r,get:u}=ms(a);let v=r.call(a,i);v||(i=ht(i),v=r.call(a,i));const p=u.call(a,i);return a.set(i,o),v?we(o,p)&&de(a,"set",i,o):de(a,"add",i,o),this},delete(i){const o=ht(this),{has:a,get:r}=ms(o);let u=a.call(o,i);u||(i=ht(i),u=a.call(o,i)),r&&r.call(o,i);const v=o.delete(i);return u&&de(o,"delete",i,void 0),v},clear(){const i=ht(this),o=i.size!==0,a=i.clear();return o&&de(i,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{s[i]=oo(i,t,e)}),s}function In(t,e){const s=ao(t,e);return(l,i,o)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?l:Reflect.get(pt(s,i)&&i in l?s:l,i,o)}const ro={get:In(!1,!1)},co={get:In(!1,!0)},uo={get:In(!0,!1)};const Gl=new WeakMap,zl=new WeakMap,Jl=new WeakMap,fo=new WeakMap;function ho(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function po(t){return t.__v_skip||!Object.isExtensible(t)?0:ho(Ni(t))}function Mn(t){return ge(t)?t:Rn(t,!1,no,ro,Gl)}function vo(t){return Rn(t,!1,io,co,zl)}function rn(t){return Rn(t,!0,lo,uo,Jl)}function Rn(t,e,s,l,i){if(!_t(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=po(t);if(o===0)return t;const a=i.get(t);if(a)return a;const r=new Proxy(t,o===2?l:s);return i.set(t,r),r}function Ee(t){return ge(t)?Ee(t.__v_raw):!!(t&&t.__v_isReactive)}function ge(t){return!!(t&&t.__v_isReadonly)}function qt(t){return!!(t&&t.__v_isShallow)}function En(t){return t?!!t.__v_raw:!1}function ht(t){const e=t&&t.__v_raw;return e?ht(e):t}function go(t){return!pt(t,"__v_skip")&&Object.isExtensible(t)&&El(t,"__v_skip",!0),t}const Jt=t=>_t(t)?Mn(t):t,We=t=>_t(t)?rn(t):t;function Pt(t){return t?t.__v_isRef===!0:!1}function j(t){return mo(t,!1)}function mo(t,e){return Pt(t)?t:new _o(t,e)}class _o{constructor(e,s){this.dep=new An,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?e:ht(e),this._value=s?e:Jt(e),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(e){const s=this._rawValue,l=this.__v_isShallow||qt(e)||ge(e);e=l?e:ht(e),we(e,s)&&(this._rawValue=e,this._value=l?e:Jt(e),this.dep.trigger())}}function rs(t){return Pt(t)?t.value:t}const yo={get:(t,e,s)=>e==="__v_raw"?t:rs(Reflect.get(t,e,s)),set:(t,e,s,l)=>{const i=t[e];return Pt(i)&&!Pt(s)?(i.value=s,!0):Reflect.set(t,e,s,l)}};function Ql(t){return Ee(t)?t:new Proxy(t,yo)}class bo{constructor(e,s,l){this.fn=e,this.setter=s,this._value=void 0,this.dep=new An(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&$t!==this)return Nl(this,!0),!0}get value(){const e=this.dep.track();return Vl(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function $o(t,e,s=!1){let l,i;return ut(t)?l=t:(l=t.get,i=t.set),new bo(l,i,s)}const ys={},As=new WeakMap;let Ie;function ko(t,e=!1,s=Ie){if(s){let l=As.get(s);l||As.set(s,l=[]),l.push(t)}}function wo(t,e,s=yt){const{immediate:l,deep:i,once:o,scheduler:a,augmentJob:r,call:u}=s,v=R=>i?R:qt(R)||i===!1||i===0?fe(R,1):fe(R);let p,C,A,S,m=!1,T=!1;if(Pt(t)?(C=()=>t.value,m=qt(t)):Ee(t)?(C=()=>v(t),m=!0):at(t)?(T=!0,m=t.some(R=>Ee(R)||qt(R)),C=()=>t.map(R=>{if(Pt(R))return R.value;if(Ee(R))return v(R);if(ut(R))return u?u(R,2):R()})):ut(t)?e?C=u?()=>u(t,2):t:C=()=>{if(A){pe();try{A()}finally{ve()}}const R=Ie;Ie=p;try{return u?u(t,3,[S]):t(S)}finally{Ie=R}}:C=ne,e&&i){const R=C,K=i===!0?1/0:i;C=()=>fe(R(),K)}const D=Ji(),$=()=>{p.stop(),D&&D.active&&kn(D.effects,p)};if(o&&e){const R=e;e=(...K)=>{R(...K),$()}}let k=T?new Array(t.length).fill(ys):ys;const b=R=>{if(!(!(p.flags&1)||!p.dirty&&!R))if(e){const K=p.run();if(i||m||(T?K.some((x,F)=>we(x,k[F])):we(K,k))){A&&A();const x=Ie;Ie=p;try{const F=[K,k===ys?void 0:T&&k[0]===ys?[]:k,S];k=K,u?u(e,3,F):e(...F)}finally{Ie=x}}}else p.run()};return r&&r(b),p=new Ol(C),p.scheduler=a?()=>a(b,!1):b,S=R=>ko(R,!1,p),A=p.onStop=()=>{const R=As.get(p);if(R){if(u)u(R,4);else for(const K of R)K();As.delete(p)}},e?l?b(!0):k=p.run():a?a(b.bind(null,!0),!0):p.run(),$.pause=p.pause.bind(p),$.resume=p.resume.bind(p),$.stop=$,$}function fe(t,e=1/0,s){if(e<=0||!_t(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=e))return t;if(s.set(t,e),e--,Pt(t))fe(t.value,e,s);else if(at(t))for(let l=0;l<t.length;l++)fe(t[l],e,s);else if(Ke(t)||je(t))t.forEach(l=>{fe(l,e,s)});else if(Ml(t)){for(const l in t)fe(t[l],e,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&fe(t[l],e,s)}return t}/**
10
+ * @vue/runtime-core v3.5.29
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function vs(t,e,s,l){try{return l?t(...l):t()}catch(i){Us(i,e,s)}}function oe(t,e,s,l){if(ut(t)){const i=vs(t,e,s,l);return i&&Al(i)&&i.catch(o=>{Us(o,e,s)}),i}if(at(t)){const i=[];for(let o=0;o<t.length;o++)i.push(oe(t[o],e,s,l));return i}}function Us(t,e,s,l=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||yt;if(e){let r=e.parent;const u=e.proxy,v=`https://vuejs.org/error-reference/#runtime-${s}`;for(;r;){const p=r.ec;if(p){for(let C=0;C<p.length;C++)if(p[C](t,u,v)===!1)return}r=r.parent}if(o){pe(),vs(o,null,10,[t,u,v]),ve();return}}Co(t,s,i,l,a)}function Co(t,e,s,l=!0,i=!1){if(i)throw t;console.error(t)}const Ot=[];let ee=-1;const Ue=[];let $e=null,Le=0;const Yl=Promise.resolve();let Is=null;function Me(t){const e=Is||Yl;return t?e.then(this?t.bind(this):t):e}function To(t){let e=ee+1,s=Ot.length;for(;e<s;){const l=e+s>>>1,i=Ot[l],o=cs(i);o<t||o===t&&i.flags&2?e=l+1:s=l}return e}function Pn(t){if(!(t.flags&1)){const e=cs(t),s=Ot[Ot.length-1];!s||!(t.flags&2)&&e>=cs(s)?Ot.push(t):Ot.splice(To(e),0,t),t.flags|=1,Xl()}}function Xl(){Is||(Is=Yl.then(ti))}function So(t){at(t)?Ue.push(...t):$e&&t.id===-1?$e.splice(Le+1,0,t):t.flags&1||(Ue.push(t),t.flags|=1),Xl()}function Gn(t,e,s=ee+1){for(;s<Ot.length;s++){const l=Ot[s];if(l&&l.flags&2){if(t&&l.id!==t.uid)continue;Ot.splice(s,1),s--,l.flags&4&&(l.flags&=-2),l(),l.flags&4||(l.flags&=-2)}}}function Zl(t){if(Ue.length){const e=[...new Set(Ue)].sort((s,l)=>cs(s)-cs(l));if(Ue.length=0,$e){$e.push(...e);return}for($e=e,Le=0;Le<$e.length;Le++){const s=$e[Le];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}$e=null,Le=0}}const cs=t=>t.id==null?t.flags&2?-1:1/0:t.id;function ti(t){try{for(ee=0;ee<Ot.length;ee++){const e=Ot[ee];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),vs(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ee<Ot.length;ee++){const e=Ot[ee];e&&(e.flags&=-2)}ee=-1,Ot.length=0,Zl(),Is=null,(Ot.length||Ue.length)&&ti()}}let Kt=null,ei=null;function Ms(t){const e=Kt;return Kt=t,ei=t&&t.type.__scopeId||null,e}function xo(t,e=Kt,s){if(!e||t._n)return t;const l=(...i)=>{l._d&&al(-1);const o=Ms(e);let a;try{a=t(...i)}finally{Ms(o),l._d&&al(1)}return a};return l._n=!0,l._c=!0,l._d=!0,l}function Tt(t,e){if(Kt===null)return t;const s=Bs(Kt),l=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[o,a,r,u=yt]=e[i];o&&(ut(o)&&(o={mounted:o,updated:o}),o.deep&&fe(a),l.push({dir:o,instance:s,value:a,oldValue:void 0,arg:r,modifiers:u}))}return t}function xe(t,e,s,l){const i=t.dirs,o=e&&e.dirs;for(let a=0;a<i.length;a++){const r=i[a];o&&(r.oldValue=o[a].value);let u=r.dir[l];u&&(pe(),oe(u,s,8,[t.el,r,t,e]),ve())}}function ks(t,e){if(Lt){let s=Lt.provides;const l=Lt.parent&&Lt.parent.provides;l===s&&(s=Lt.provides=Object.create(l)),s[t]=e}}function ws(t,e,s=!1){const l=Ta();if(l||Ve){let i=Ve?Ve._context.provides:l?l.parent==null||l.ce?l.vnode.appContext&&l.vnode.appContext.provides:l.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return s&&ut(e)?e.call(l&&l.proxy):e}}const Ao=Symbol.for("v-scx"),Io=()=>ws(Ao);function Bt(t,e,s){return si(t,e,s)}function si(t,e,s=yt){const{immediate:l,deep:i,flush:o,once:a}=s,r=Mt({},s),u=e&&l||!e&&o!=="post";let v;if(ds){if(o==="sync"){const S=Io();v=S.__watcherHandles||(S.__watcherHandles=[])}else if(!u){const S=()=>{};return S.stop=ne,S.resume=ne,S.pause=ne,S}}const p=Lt;r.call=(S,m,T)=>oe(S,p,m,T);let C=!1;o==="post"?r.scheduler=S=>{Rt(S,p&&p.suspense)}:o!=="sync"&&(C=!0,r.scheduler=(S,m)=>{m?S():Pn(S)}),r.augmentJob=S=>{e&&(S.flags|=4),C&&(S.flags|=2,p&&(S.id=p.uid,S.i=p))};const A=wo(t,e,r);return ds&&(v?v.push(A):u&&A()),A}function Mo(t,e,s){const l=this.proxy,i=xt(t)?t.includes(".")?ni(l,t):()=>l[t]:t.bind(l,l);let o;ut(e)?o=e:(o=e.handler,s=e);const a=gs(this),r=si(i,o.bind(l),s);return a(),r}function ni(t,e){const s=e.split(".");return()=>{let l=t;for(let i=0;i<s.length&&l;i++)l=l[s[i]];return l}}const li=Symbol("_vte"),Ro=t=>t.__isTeleport,es=t=>t&&(t.disabled||t.disabled===""),zn=t=>t&&(t.defer||t.defer===""),Jn=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Qn=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,cn=(t,e)=>{const s=t&&t.to;return xt(s)?e?e(s):null:s},ii={name:"Teleport",__isTeleport:!0,process(t,e,s,l,i,o,a,r,u,v){const{mc:p,pc:C,pbc:A,o:{insert:S,querySelector:m,createText:T,createComment:D}}=v,$=es(e.props);let{shapeFlag:k,children:b,dynamicChildren:R}=e;if(t==null){const K=e.el=T(""),x=e.anchor=T("");S(K,s,l),S(x,s,l);const F=(H,q)=>{k&16&&p(b,H,q,i,o,a,r,u)},X=()=>{const H=e.target=cn(e.props,m),q=un(H,e,T,S);H&&(a!=="svg"&&Jn(H)?a="svg":a!=="mathml"&&Qn(H)&&(a="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(H),$||(F(H,q),Cs(e,!1)))};$&&(F(s,x),Cs(e,!0)),zn(e.props)?(e.el.__isMounted=!1,Rt(()=>{X(),delete e.el.__isMounted},o)):X()}else{if(zn(e.props)&&t.el.__isMounted===!1){Rt(()=>{ii.process(t,e,s,l,i,o,a,r,u,v)},o);return}e.el=t.el,e.targetStart=t.targetStart;const K=e.anchor=t.anchor,x=e.target=t.target,F=e.targetAnchor=t.targetAnchor,X=es(t.props),H=X?s:x,q=X?K:F;if(a==="svg"||Jn(x)?a="svg":(a==="mathml"||Qn(x))&&(a="mathml"),R?(A(t.dynamicChildren,R,H,i,o,a,r),Ln(t,e,!0)):u||C(t,e,H,q,i,o,a,r,!1),$)X?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):bs(e,s,K,v,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const G=e.target=cn(e.props,m);G&&bs(e,G,null,v,0)}else X&&bs(e,x,F,v,1);Cs(e,$)}},remove(t,e,s,{um:l,o:{remove:i}},o){const{shapeFlag:a,children:r,anchor:u,targetStart:v,targetAnchor:p,target:C,props:A}=t;if(C&&(i(v),i(p)),o&&i(u),a&16){const S=o||!es(A);for(let m=0;m<r.length;m++){const T=r[m];l(T,e,s,S,!!T.dynamicChildren)}}},move:bs,hydrate:Eo};function bs(t,e,s,{o:{insert:l},m:i},o=2){o===0&&l(t.targetAnchor,e,s);const{el:a,anchor:r,shapeFlag:u,children:v,props:p}=t,C=o===2;if(C&&l(a,e,s),(!C||es(p))&&u&16)for(let A=0;A<v.length;A++)i(v[A],e,s,2);C&&l(r,e,s)}function Eo(t,e,s,l,i,o,{o:{nextSibling:a,parentNode:r,querySelector:u,insert:v,createText:p}},C){function A(D,$){let k=$;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")e.targetStart=k;else if(k.data==="teleport anchor"){e.targetAnchor=k,D._lpa=e.targetAnchor&&a(e.targetAnchor);break}}k=a(k)}}function S(D,$){$.anchor=C(a(D),$,r(D),s,l,i,o)}const m=e.target=cn(e.props,u),T=es(e.props);if(m){const D=m._lpa||m.firstChild;e.shapeFlag&16&&(T?(S(t,e),A(m,D),e.targetAnchor||un(m,e,p,v,r(t)===m?t:null)):(e.anchor=a(t),A(m,D),e.targetAnchor||un(m,e,p,v),C(D&&a(D),e,m,s,l,i,o))),Cs(e,T)}else T&&e.shapeFlag&16&&(S(t,e),e.targetStart=t,e.targetAnchor=a(t));return e.anchor&&a(e.anchor)}const Po=ii;function Cs(t,e){const s=t.ctx;if(s&&s.ut){let l,i;for(e?(l=t.el,i=t.anchor):(l=t.targetStart,i=t.targetAnchor);l&&l!==i;)l.nodeType===1&&l.setAttribute("data-v-owner",s.uid),l=l.nextSibling;s.ut()}}function un(t,e,s,l,i=null){const o=e.targetStart=s(""),a=e.targetAnchor=s("");return o[li]=a,t&&(l(o,t,i),l(a,t,i)),a}const Do=Symbol("_leaveCb");function Dn(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Dn(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function wt(t,e){return ut(t)?Mt({name:t.name},e,{setup:t}):t}function oi(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Yn(t,e){let s;return!!((s=Object.getOwnPropertyDescriptor(t,e))&&!s.configurable)}const Rs=new WeakMap;function ss(t,e,s,l,i=!1){if(at(t)){t.forEach((T,D)=>ss(T,e&&(at(e)?e[D]:e),s,l,i));return}if(ns(l)&&!i){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&ss(t,e,s,l.component.subTree);return}const o=l.shapeFlag&4?Bs(l.component):l.el,a=i?null:o,{i:r,r:u}=t,v=e&&e.r,p=r.refs===yt?r.refs={}:r.refs,C=r.setupState,A=ht(C),S=C===yt?xl:T=>Yn(p,T)?!1:pt(A,T),m=(T,D)=>!(D&&Yn(p,D));if(v!=null&&v!==u){if(Xn(e),xt(v))p[v]=null,S(v)&&(C[v]=null);else if(Pt(v)){const T=e;m(v,T.k)&&(v.value=null),T.k&&(p[T.k]=null)}}if(ut(u))vs(u,r,12,[a,p]);else{const T=xt(u),D=Pt(u);if(T||D){const $=()=>{if(t.f){const k=T?S(u)?C[u]:p[u]:m()||!t.k?u.value:p[t.k];if(i)at(k)&&kn(k,o);else if(at(k))k.includes(o)||k.push(o);else if(T)p[u]=[o],S(u)&&(C[u]=p[u]);else{const b=[o];m(u,t.k)&&(u.value=b),t.k&&(p[t.k]=b)}}else T?(p[u]=a,S(u)&&(C[u]=a)):D&&(m(u,t.k)&&(u.value=a),t.k&&(p[t.k]=a))};if(a){const k=()=>{$(),Rs.delete(t)};k.id=-1,Rs.set(t,k),Rt(k,s)}else Xn(t),$()}}}function Xn(t){const e=Rs.get(t);e&&(e.flags|=8,Rs.delete(t))}Ns().requestIdleCallback;Ns().cancelIdleCallback;const ns=t=>!!t.type.__asyncLoader,ai=t=>t.type.__isKeepAlive;function Fo(t,e){ri(t,"a",e)}function Oo(t,e){ri(t,"da",e)}function ri(t,e,s=Lt){const l=t.__wdc||(t.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Vs(e,l,s),s){let i=s.parent;for(;i&&i.parent;)ai(i.parent.vnode)&&Lo(l,e,s,i),i=i.parent}}function Lo(t,e,s,l){const i=Vs(e,t,l,!0);ae(()=>{kn(l[e],i)},s)}function Vs(t,e,s=Lt,l=!1){if(s){const i=s[t]||(s[t]=[]),o=e.__weh||(e.__weh=(...a)=>{pe();const r=gs(s),u=oe(e,s,t,a);return r(),ve(),u});return l?i.unshift(o):i.push(o),o}}const me=t=>(e,s=Lt)=>{(!ds||t==="sp")&&Vs(t,(...l)=>e(...l),s)},No=me("bm"),Nt=me("m"),jo=me("bu"),Uo=me("u"),Vo=me("bum"),ae=me("um"),Wo=me("sp"),Ho=me("rtg"),Bo=me("rtc");function ci(t,e=Lt){Vs("ec",t,e)}const Ko=Symbol.for("v-ndc");function ct(t,e,s,l){let i;const o=s,a=at(t);if(a||xt(t)){const r=a&&Ee(t);let u=!1,v=!1;r&&(u=!qt(t),v=ge(t),t=js(t)),i=new Array(t.length);for(let p=0,C=t.length;p<C;p++)i[p]=e(u?v?We(Jt(t[p])):Jt(t[p]):t[p],p,void 0,o)}else if(typeof t=="number"){i=new Array(t);for(let r=0;r<t;r++)i[r]=e(r+1,r,void 0,o)}else if(_t(t))if(t[Symbol.iterator])i=Array.from(t,(r,u)=>e(r,u,void 0,o));else{const r=Object.keys(t);i=new Array(r.length);for(let u=0,v=r.length;u<v;u++){const p=r[u];i[u]=e(t[p],p,u,o)}}else i=[];return i}const dn=t=>t?Mi(t)?Bs(t):dn(t.parent):null,ls=Mt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>dn(t.parent),$root:t=>dn(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>di(t),$forceUpdate:t=>t.f||(t.f=()=>{Pn(t.update)}),$nextTick:t=>t.n||(t.n=Me.bind(t.proxy)),$watch:t=>Mo.bind(t)}),Qs=(t,e)=>t!==yt&&!t.__isScriptSetup&&pt(t,e),qo={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:s,setupState:l,data:i,props:o,accessCache:a,type:r,appContext:u}=t;if(e[0]!=="$"){const A=a[e];if(A!==void 0)switch(A){case 1:return l[e];case 2:return i[e];case 4:return s[e];case 3:return o[e]}else{if(Qs(l,e))return a[e]=1,l[e];if(i!==yt&&pt(i,e))return a[e]=2,i[e];if(pt(o,e))return a[e]=3,o[e];if(s!==yt&&pt(s,e))return a[e]=4,s[e];fn&&(a[e]=0)}}const v=ls[e];let p,C;if(v)return e==="$attrs"&&Et(t.attrs,"get",""),v(t);if((p=r.__cssModules)&&(p=p[e]))return p;if(s!==yt&&pt(s,e))return a[e]=4,s[e];if(C=u.config.globalProperties,pt(C,e))return C[e]},set({_:t},e,s){const{data:l,setupState:i,ctx:o}=t;return Qs(i,e)?(i[e]=s,!0):l!==yt&&pt(l,e)?(l[e]=s,!0):pt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(o[e]=s,!0)},has({_:{data:t,setupState:e,accessCache:s,ctx:l,appContext:i,props:o,type:a}},r){let u;return!!(s[r]||t!==yt&&r[0]!=="$"&&pt(t,r)||Qs(e,r)||pt(o,r)||pt(l,r)||pt(ls,r)||pt(i.config.globalProperties,r)||(u=a.__cssModules)&&u[r])},defineProperty(t,e,s){return s.get!=null?t._.accessCache[e]=0:pt(s,"value")&&this.set(t,e,s.value,null),Reflect.defineProperty(t,e,s)}};function Zn(t){return at(t)?t.reduce((e,s)=>(e[s]=null,e),{}):t}let fn=!0;function Go(t){const e=di(t),s=t.proxy,l=t.ctx;fn=!1,e.beforeCreate&&tl(e.beforeCreate,t,"bc");const{data:i,computed:o,methods:a,watch:r,provide:u,inject:v,created:p,beforeMount:C,mounted:A,beforeUpdate:S,updated:m,activated:T,deactivated:D,beforeDestroy:$,beforeUnmount:k,destroyed:b,unmounted:R,render:K,renderTracked:x,renderTriggered:F,errorCaptured:X,serverPrefetch:H,expose:q,inheritAttrs:G,components:I,directives:st,filters:mt}=e;if(v&&zo(v,l,null),a)for(const Z in a){const it=a[Z];ut(it)&&(l[Z]=it.bind(s))}if(i){const Z=i.call(s,s);_t(Z)&&(t.data=Mn(Z))}if(fn=!0,o)for(const Z in o){const it=o[Z],N=ut(it)?it.bind(s,s):ut(it.get)?it.get.bind(s,s):ne,U=!ut(it)&&ut(it.set)?it.set.bind(s):ne,rt=Q({get:N,set:U});Object.defineProperty(l,Z,{enumerable:!0,configurable:!0,get:()=>rt.value,set:lt=>rt.value=lt})}if(r)for(const Z in r)ui(r[Z],l,s,Z);if(u){const Z=ut(u)?u.call(s):u;Reflect.ownKeys(Z).forEach(it=>{ks(it,Z[it])})}p&&tl(p,t,"c");function L(Z,it){at(it)?it.forEach(N=>Z(N.bind(s))):it&&Z(it.bind(s))}if(L(No,C),L(Nt,A),L(jo,S),L(Uo,m),L(Fo,T),L(Oo,D),L(ci,X),L(Bo,x),L(Ho,F),L(Vo,k),L(ae,R),L(Wo,H),at(q))if(q.length){const Z=t.exposed||(t.exposed={});q.forEach(it=>{Object.defineProperty(Z,it,{get:()=>s[it],set:N=>s[it]=N,enumerable:!0})})}else t.exposed||(t.exposed={});K&&t.render===ne&&(t.render=K),G!=null&&(t.inheritAttrs=G),I&&(t.components=I),st&&(t.directives=st),H&&oi(t)}function zo(t,e,s=ne){at(t)&&(t=hn(t));for(const l in t){const i=t[l];let o;_t(i)?"default"in i?o=ws(i.from||l,i.default,!0):o=ws(i.from||l):o=ws(i),Pt(o)?Object.defineProperty(e,l,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):e[l]=o}}function tl(t,e,s){oe(at(t)?t.map(l=>l.bind(e.proxy)):t.bind(e.proxy),e,s)}function ui(t,e,s,l){let i=l.includes(".")?ni(s,l):()=>s[l];if(xt(t)){const o=e[t];ut(o)&&Bt(i,o)}else if(ut(t))Bt(i,t.bind(s));else if(_t(t))if(at(t))t.forEach(o=>ui(o,e,s,l));else{const o=ut(t.handler)?t.handler.bind(s):e[t.handler];ut(o)&&Bt(i,o,t)}}function di(t){const e=t.type,{mixins:s,extends:l}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=t.appContext,r=o.get(e);let u;return r?u=r:!i.length&&!s&&!l?u=e:(u={},i.length&&i.forEach(v=>Es(u,v,a,!0)),Es(u,e,a)),_t(e)&&o.set(e,u),u}function Es(t,e,s,l=!1){const{mixins:i,extends:o}=e;o&&Es(t,o,s,!0),i&&i.forEach(a=>Es(t,a,s,!0));for(const a in e)if(!(l&&a==="expose")){const r=Jo[a]||s&&s[a];t[a]=r?r(t[a],e[a]):e[a]}return t}const Jo={data:el,props:sl,emits:sl,methods:Ye,computed:Ye,beforeCreate:Ft,created:Ft,beforeMount:Ft,mounted:Ft,beforeUpdate:Ft,updated:Ft,beforeDestroy:Ft,beforeUnmount:Ft,destroyed:Ft,unmounted:Ft,activated:Ft,deactivated:Ft,errorCaptured:Ft,serverPrefetch:Ft,components:Ye,directives:Ye,watch:Yo,provide:el,inject:Qo};function el(t,e){return e?t?function(){return Mt(ut(t)?t.call(this,this):t,ut(e)?e.call(this,this):e)}:e:t}function Qo(t,e){return Ye(hn(t),hn(e))}function hn(t){if(at(t)){const e={};for(let s=0;s<t.length;s++)e[t[s]]=t[s];return e}return t}function Ft(t,e){return t?[...new Set([].concat(t,e))]:e}function Ye(t,e){return t?Mt(Object.create(null),t,e):e}function sl(t,e){return t?at(t)&&at(e)?[...new Set([...t,...e])]:Mt(Object.create(null),Zn(t),Zn(e??{})):e}function Yo(t,e){if(!t)return e;if(!e)return t;const s=Mt(Object.create(null),t);for(const l in e)s[l]=Ft(t[l],e[l]);return s}function fi(){return{app:null,config:{isNativeTag:xl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Xo=0;function Zo(t,e){return function(l,i=null){ut(l)||(l=Mt({},l)),i!=null&&!_t(i)&&(i=null);const o=fi(),a=new WeakSet,r=[];let u=!1;const v=o.app={_uid:Xo++,_component:l,_props:i,_container:null,_context:o,_instance:null,version:Ra,get config(){return o.config},set config(p){},use(p,...C){return a.has(p)||(p&&ut(p.install)?(a.add(p),p.install(v,...C)):ut(p)&&(a.add(p),p(v,...C))),v},mixin(p){return o.mixins.includes(p)||o.mixins.push(p),v},component(p,C){return C?(o.components[p]=C,v):o.components[p]},directive(p,C){return C?(o.directives[p]=C,v):o.directives[p]},mount(p,C,A){if(!u){const S=v._ceVNode||bt(l,i);return S.appContext=o,A===!0?A="svg":A===!1&&(A=void 0),t(S,p,A),u=!0,v._container=p,p.__vue_app__=v,Bs(S.component)}},onUnmount(p){r.push(p)},unmount(){u&&(oe(r,v._instance,16),t(null,v._container),delete v._container.__vue_app__)},provide(p,C){return o.provides[p]=C,v},runWithContext(p){const C=Ve;Ve=v;try{return p()}finally{Ve=C}}};return v}}let Ve=null;const ta=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Ce(e)}Modifiers`]||t[`${De(e)}Modifiers`];function ea(t,e,...s){if(t.isUnmounted)return;const l=t.vnode.props||yt;let i=s;const o=e.startsWith("update:"),a=o&&ta(l,e.slice(7));a&&(a.trim&&(i=s.map(p=>xt(p)?p.trim():p)),a.number&&(i=s.map(Ls)));let r,u=l[r=Ks(e)]||l[r=Ks(Ce(e))];!u&&o&&(u=l[r=Ks(De(e))]),u&&oe(u,t,6,i);const v=l[r+"Once"];if(v){if(!t.emitted)t.emitted={};else if(t.emitted[r])return;t.emitted[r]=!0,oe(v,t,6,i)}}const sa=new WeakMap;function hi(t,e,s=!1){const l=s?sa:e.emitsCache,i=l.get(t);if(i!==void 0)return i;const o=t.emits;let a={},r=!1;if(!ut(t)){const u=v=>{const p=hi(v,e,!0);p&&(r=!0,Mt(a,p))};!s&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!o&&!r?(_t(t)&&l.set(t,null),null):(at(o)?o.forEach(u=>a[u]=null):Mt(a,o),_t(t)&&l.set(t,a),a)}function Ws(t,e){return!t||!Fs(e)?!1:(e=e.slice(2).replace(/Once$/,""),pt(t,e[0].toLowerCase()+e.slice(1))||pt(t,De(e))||pt(t,e))}function nl(t){const{type:e,vnode:s,proxy:l,withProxy:i,propsOptions:[o],slots:a,attrs:r,emit:u,render:v,renderCache:p,props:C,data:A,setupState:S,ctx:m,inheritAttrs:T}=t,D=Ms(t);let $,k;try{if(s.shapeFlag&4){const R=i||l,K=R;$=se(v.call(K,R,p,C,S,A,m)),k=r}else{const R=e;$=se(R.length>1?R(C,{attrs:r,slots:a,emit:u}):R(C,null)),k=e.props?r:na(r)}}catch(R){is.length=0,Us(R,t,1),$=bt(Te)}let b=$;if(k&&T!==!1){const R=Object.keys(k),{shapeFlag:K}=b;R.length&&K&7&&(o&&R.some($n)&&(k=la(k,o)),b=He(b,k,!1,!0))}return s.dirs&&(b=He(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(s.dirs):s.dirs),s.transition&&Dn(b,s.transition),$=b,Ms(D),$}const na=t=>{let e;for(const s in t)(s==="class"||s==="style"||Fs(s))&&((e||(e={}))[s]=t[s]);return e},la=(t,e)=>{const s={};for(const l in t)(!$n(l)||!(l.slice(9)in e))&&(s[l]=t[l]);return s};function ia(t,e,s){const{props:l,children:i,component:o}=t,{props:a,children:r,patchFlag:u}=e,v=o.emitsOptions;if(e.dirs||e.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return l?ll(l,a,v):!!a;if(u&8){const p=e.dynamicProps;for(let C=0;C<p.length;C++){const A=p[C];if(pi(a,l,A)&&!Ws(v,A))return!0}}}else return(i||r)&&(!r||!r.$stable)?!0:l===a?!1:l?a?ll(l,a,v):!0:!!a;return!1}function ll(t,e,s){const l=Object.keys(e);if(l.length!==Object.keys(t).length)return!0;for(let i=0;i<l.length;i++){const o=l[i];if(pi(e,t,o)&&!Ws(s,o))return!0}return!1}function pi(t,e,s){const l=t[s],i=e[s];return s==="style"&&_t(l)&&_t(i)?!qe(l,i):l!==i}function oa({vnode:t,parent:e},s){for(;e;){const l=e.subTree;if(l.suspense&&l.suspense.activeBranch===t&&(l.el=t.el),l===t)(t=e.vnode).el=s,e=e.parent;else break}}const vi={},gi=()=>Object.create(vi),mi=t=>Object.getPrototypeOf(t)===vi;function aa(t,e,s,l=!1){const i={},o=gi();t.propsDefaults=Object.create(null),_i(t,e,i,o);for(const a in t.propsOptions[0])a in i||(i[a]=void 0);s?t.props=l?i:vo(i):t.type.props?t.props=i:t.props=o,t.attrs=o}function ra(t,e,s,l){const{props:i,attrs:o,vnode:{patchFlag:a}}=t,r=ht(i),[u]=t.propsOptions;let v=!1;if((l||a>0)&&!(a&16)){if(a&8){const p=t.vnode.dynamicProps;for(let C=0;C<p.length;C++){let A=p[C];if(Ws(t.emitsOptions,A))continue;const S=e[A];if(u)if(pt(o,A))S!==o[A]&&(o[A]=S,v=!0);else{const m=Ce(A);i[m]=pn(u,r,m,S,t,!1)}else S!==o[A]&&(o[A]=S,v=!0)}}}else{_i(t,e,i,o)&&(v=!0);let p;for(const C in r)(!e||!pt(e,C)&&((p=De(C))===C||!pt(e,p)))&&(u?s&&(s[C]!==void 0||s[p]!==void 0)&&(i[C]=pn(u,r,C,void 0,t,!0)):delete i[C]);if(o!==r)for(const C in o)(!e||!pt(e,C))&&(delete o[C],v=!0)}v&&de(t.attrs,"set","")}function _i(t,e,s,l){const[i,o]=t.propsOptions;let a=!1,r;if(e)for(let u in e){if(Xe(u))continue;const v=e[u];let p;i&&pt(i,p=Ce(u))?!o||!o.includes(p)?s[p]=v:(r||(r={}))[p]=v:Ws(t.emitsOptions,u)||(!(u in l)||v!==l[u])&&(l[u]=v,a=!0)}if(o){const u=ht(s),v=r||yt;for(let p=0;p<o.length;p++){const C=o[p];s[C]=pn(i,u,C,v[C],t,!pt(v,C))}}return a}function pn(t,e,s,l,i,o){const a=t[s];if(a!=null){const r=pt(a,"default");if(r&&l===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&ut(u)){const{propsDefaults:v}=i;if(s in v)l=v[s];else{const p=gs(i);l=v[s]=u.call(null,e),p()}}else l=u;i.ce&&i.ce._setProp(s,l)}a[0]&&(o&&!r?l=!1:a[1]&&(l===""||l===De(s))&&(l=!0))}return l}const ca=new WeakMap;function yi(t,e,s=!1){const l=s?ca:e.propsCache,i=l.get(t);if(i)return i;const o=t.props,a={},r=[];let u=!1;if(!ut(t)){const p=C=>{u=!0;const[A,S]=yi(C,e,!0);Mt(a,A),S&&r.push(...S)};!s&&e.mixins.length&&e.mixins.forEach(p),t.extends&&p(t.extends),t.mixins&&t.mixins.forEach(p)}if(!o&&!u)return _t(t)&&l.set(t,Ne),Ne;if(at(o))for(let p=0;p<o.length;p++){const C=Ce(o[p]);il(C)&&(a[C]=yt)}else if(o)for(const p in o){const C=Ce(p);if(il(C)){const A=o[p],S=a[C]=at(A)||ut(A)?{type:A}:Mt({},A),m=S.type;let T=!1,D=!0;if(at(m))for(let $=0;$<m.length;++$){const k=m[$],b=ut(k)&&k.name;if(b==="Boolean"){T=!0;break}else b==="String"&&(D=!1)}else T=ut(m)&&m.name==="Boolean";S[0]=T,S[1]=D,(T||pt(S,"default"))&&r.push(C)}}const v=[a,r];return _t(t)&&l.set(t,v),v}function il(t){return t[0]!=="$"&&!Xe(t)}const Fn=t=>t==="_"||t==="_ctx"||t==="$stable",On=t=>at(t)?t.map(se):[se(t)],ua=(t,e,s)=>{if(e._n)return e;const l=xo((...i)=>On(e(...i)),s);return l._c=!1,l},bi=(t,e,s)=>{const l=t._ctx;for(const i in t){if(Fn(i))continue;const o=t[i];if(ut(o))e[i]=ua(i,o,l);else if(o!=null){const a=On(o);e[i]=()=>a}}},$i=(t,e)=>{const s=On(e);t.slots.default=()=>s},ki=(t,e,s)=>{for(const l in e)(s||!Fn(l))&&(t[l]=e[l])},da=(t,e,s)=>{const l=t.slots=gi();if(t.vnode.shapeFlag&32){const i=e._;i?(ki(l,e,s),s&&El(l,"_",i,!0)):bi(e,l)}else e&&$i(t,e)},fa=(t,e,s)=>{const{vnode:l,slots:i}=t;let o=!0,a=yt;if(l.shapeFlag&32){const r=e._;r?s&&r===1?o=!1:ki(i,e,s):(o=!e.$stable,bi(e,i)),a=e}else e&&($i(t,e),a={default:1});if(o)for(const r in i)!Fn(r)&&a[r]==null&&delete i[r]},Rt=ma;function ha(t){return pa(t)}function pa(t,e){const s=Ns();s.__VUE__=!0;const{insert:l,remove:i,patchProp:o,createElement:a,createText:r,createComment:u,setText:v,setElementText:p,parentNode:C,nextSibling:A,setScopeId:S=ne,insertStaticContent:m}=t,T=(h,y,E,B=null,g=null,_=null,V=void 0,O=null,W=!!y.dynamicChildren)=>{if(h===y)return;h&&!Je(h,y)&&(B=Dt(h),lt(h,g,_,!0),h=null),y.patchFlag===-2&&(W=!1,y.dynamicChildren=null);const{type:w,ref:J,shapeFlag:z}=y;switch(w){case Hs:D(h,y,E,B);break;case Te:$(h,y,E,B);break;case Ts:h==null&&k(y,E,B,V);break;case Y:I(h,y,E,B,g,_,V,O,W);break;default:z&1?K(h,y,E,B,g,_,V,O,W):z&6?st(h,y,E,B,g,_,V,O,W):(z&64||z&128)&&w.process(h,y,E,B,g,_,V,O,W,Qt)}J!=null&&g?ss(J,h&&h.ref,_,y||h,!y):J==null&&h&&h.ref!=null&&ss(h.ref,null,_,h,!0)},D=(h,y,E,B)=>{if(h==null)l(y.el=r(y.children),E,B);else{const g=y.el=h.el;y.children!==h.children&&v(g,y.children)}},$=(h,y,E,B)=>{h==null?l(y.el=u(y.children||""),E,B):y.el=h.el},k=(h,y,E,B)=>{[h.el,h.anchor]=m(h.children,y,E,B,h.el,h.anchor)},b=({el:h,anchor:y},E,B)=>{let g;for(;h&&h!==y;)g=A(h),l(h,E,B),h=g;l(y,E,B)},R=({el:h,anchor:y})=>{let E;for(;h&&h!==y;)E=A(h),i(h),h=E;i(y)},K=(h,y,E,B,g,_,V,O,W)=>{if(y.type==="svg"?V="svg":y.type==="math"&&(V="mathml"),h==null)x(y,E,B,g,_,V,O,W);else{const w=h.el&&h.el._isVueCE?h.el:null;try{w&&w._beginPatch(),H(h,y,g,_,V,O,W)}finally{w&&w._endPatch()}}},x=(h,y,E,B,g,_,V,O)=>{let W,w;const{props:J,shapeFlag:z,transition:et,dirs:ot}=h;if(W=h.el=a(h.type,_,J&&J.is,J),z&8?p(W,h.children):z&16&&X(h.children,W,null,B,g,Ys(h,_),V,O),ot&&xe(h,null,B,"created"),F(W,h,h.scopeId,V,B),J){for(const vt in J)vt!=="value"&&!Xe(vt)&&o(W,vt,null,J[vt],_,B);"value"in J&&o(W,"value",null,J.value,_),(w=J.onVnodeBeforeMount)&&te(w,B,h)}ot&&xe(h,null,B,"beforeMount");const dt=va(g,et);dt&&et.beforeEnter(W),l(W,y,E),((w=J&&J.onVnodeMounted)||dt||ot)&&Rt(()=>{w&&te(w,B,h),dt&&et.enter(W),ot&&xe(h,null,B,"mounted")},g)},F=(h,y,E,B,g)=>{if(E&&S(h,E),B)for(let _=0;_<B.length;_++)S(h,B[_]);if(g){let _=g.subTree;if(y===_||Ti(_.type)&&(_.ssContent===y||_.ssFallback===y)){const V=g.vnode;F(h,V,V.scopeId,V.slotScopeIds,g.parent)}}},X=(h,y,E,B,g,_,V,O,W=0)=>{for(let w=W;w<h.length;w++){const J=h[w]=O?ue(h[w]):se(h[w]);T(null,J,y,E,B,g,_,V,O)}},H=(h,y,E,B,g,_,V)=>{const O=y.el=h.el;let{patchFlag:W,dynamicChildren:w,dirs:J}=y;W|=h.patchFlag&16;const z=h.props||yt,et=y.props||yt;let ot;if(E&&Ae(E,!1),(ot=et.onVnodeBeforeUpdate)&&te(ot,E,y,h),J&&xe(y,h,E,"beforeUpdate"),E&&Ae(E,!0),(z.innerHTML&&et.innerHTML==null||z.textContent&&et.textContent==null)&&p(O,""),w?q(h.dynamicChildren,w,O,E,B,Ys(y,g),_):V||it(h,y,O,null,E,B,Ys(y,g),_,!1),W>0){if(W&16)G(O,z,et,E,g);else if(W&2&&z.class!==et.class&&o(O,"class",null,et.class,g),W&4&&o(O,"style",z.style,et.style,g),W&8){const dt=y.dynamicProps;for(let vt=0;vt<dt.length;vt++){const gt=dt[vt],jt=z[gt],Ut=et[gt];(Ut!==jt||gt==="value")&&o(O,gt,jt,Ut,g,E)}}W&1&&h.children!==y.children&&p(O,y.children)}else!V&&w==null&&G(O,z,et,E,g);((ot=et.onVnodeUpdated)||J)&&Rt(()=>{ot&&te(ot,E,y,h),J&&xe(y,h,E,"updated")},B)},q=(h,y,E,B,g,_,V)=>{for(let O=0;O<y.length;O++){const W=h[O],w=y[O],J=W.el&&(W.type===Y||!Je(W,w)||W.shapeFlag&198)?C(W.el):E;T(W,w,J,null,B,g,_,V,!0)}},G=(h,y,E,B,g)=>{if(y!==E){if(y!==yt)for(const _ in y)!Xe(_)&&!(_ in E)&&o(h,_,y[_],null,g,B);for(const _ in E){if(Xe(_))continue;const V=E[_],O=y[_];V!==O&&_!=="value"&&o(h,_,O,V,g,B)}"value"in E&&o(h,"value",y.value,E.value,g)}},I=(h,y,E,B,g,_,V,O,W)=>{const w=y.el=h?h.el:r(""),J=y.anchor=h?h.anchor:r("");let{patchFlag:z,dynamicChildren:et,slotScopeIds:ot}=y;ot&&(O=O?O.concat(ot):ot),h==null?(l(w,E,B),l(J,E,B),X(y.children||[],E,J,g,_,V,O,W)):z>0&&z&64&&et&&h.dynamicChildren&&h.dynamicChildren.length===et.length?(q(h.dynamicChildren,et,E,g,_,V,O),(y.key!=null||g&&y===g.subTree)&&Ln(h,y,!0)):it(h,y,E,J,g,_,V,O,W)},st=(h,y,E,B,g,_,V,O,W)=>{y.slotScopeIds=O,h==null?y.shapeFlag&512?g.ctx.activate(y,E,B,V,W):mt(y,E,B,g,_,V,W):P(h,y,W)},mt=(h,y,E,B,g,_,V)=>{const O=h.component=Ca(h,B,g);if(ai(h)&&(O.ctx.renderer=Qt),Sa(O,!1,V),O.asyncDep){if(g&&g.registerDep(O,L,V),!h.el){const W=O.subTree=bt(Te);$(null,W,y,E),h.placeholder=W.el}}else L(O,h,y,E,g,_,V)},P=(h,y,E)=>{const B=y.component=h.component;if(ia(h,y,E))if(B.asyncDep&&!B.asyncResolved){Z(B,y,E);return}else B.next=y,B.update();else y.el=h.el,B.vnode=y},L=(h,y,E,B,g,_,V)=>{const O=()=>{if(h.isMounted){let{next:z,bu:et,u:ot,parent:dt,vnode:vt}=h;{const Xt=wi(h);if(Xt){z&&(z.el=vt.el,Z(h,z,V)),Xt.asyncDep.then(()=>{Rt(()=>{h.isUnmounted||w()},g)});return}}let gt=z,jt;Ae(h,!1),z?(z.el=vt.el,Z(h,z,V)):z=vt,et&&$s(et),(jt=z.props&&z.props.onVnodeBeforeUpdate)&&te(jt,dt,z,vt),Ae(h,!0);const Ut=nl(h),Yt=h.subTree;h.subTree=Ut,T(Yt,Ut,C(Yt.el),Dt(Yt),h,g,_),z.el=Ut.el,gt===null&&oa(h,Ut.el),ot&&Rt(ot,g),(jt=z.props&&z.props.onVnodeUpdated)&&Rt(()=>te(jt,dt,z,vt),g)}else{let z;const{el:et,props:ot}=y,{bm:dt,m:vt,parent:gt,root:jt,type:Ut}=h,Yt=ns(y);Ae(h,!1),dt&&$s(dt),!Yt&&(z=ot&&ot.onVnodeBeforeMount)&&te(z,gt,y),Ae(h,!0);{jt.ce&&jt.ce._hasShadowRoot()&&jt.ce._injectChildStyle(Ut);const Xt=h.subTree=nl(h);T(null,Xt,E,B,h,g,_),y.el=Xt.el}if(vt&&Rt(vt,g),!Yt&&(z=ot&&ot.onVnodeMounted)){const Xt=y;Rt(()=>te(z,gt,Xt),g)}(y.shapeFlag&256||gt&&ns(gt.vnode)&&gt.vnode.shapeFlag&256)&&h.a&&Rt(h.a,g),h.isMounted=!0,y=E=B=null}};h.scope.on();const W=h.effect=new Ol(O);h.scope.off();const w=h.update=W.run.bind(W),J=h.job=W.runIfDirty.bind(W);J.i=h,J.id=h.uid,W.scheduler=()=>Pn(J),Ae(h,!0),w()},Z=(h,y,E)=>{y.component=h;const B=h.vnode.props;h.vnode=y,h.next=null,ra(h,y.props,B,E),fa(h,y.children,E),pe(),Gn(h),ve()},it=(h,y,E,B,g,_,V,O,W=!1)=>{const w=h&&h.children,J=h?h.shapeFlag:0,z=y.children,{patchFlag:et,shapeFlag:ot}=y;if(et>0){if(et&128){U(w,z,E,B,g,_,V,O,W);return}else if(et&256){N(w,z,E,B,g,_,V,O,W);return}}ot&8?(J&16&&It(w,g,_),z!==w&&p(E,z)):J&16?ot&16?U(w,z,E,B,g,_,V,O,W):It(w,g,_,!0):(J&8&&p(E,""),ot&16&&X(z,E,B,g,_,V,O,W))},N=(h,y,E,B,g,_,V,O,W)=>{h=h||Ne,y=y||Ne;const w=h.length,J=y.length,z=Math.min(w,J);let et;for(et=0;et<z;et++){const ot=y[et]=W?ue(y[et]):se(y[et]);T(h[et],ot,E,null,g,_,V,O,W)}w>J?It(h,g,_,!0,!1,z):X(y,E,B,g,_,V,O,W,z)},U=(h,y,E,B,g,_,V,O,W)=>{let w=0;const J=y.length;let z=h.length-1,et=J-1;for(;w<=z&&w<=et;){const ot=h[w],dt=y[w]=W?ue(y[w]):se(y[w]);if(Je(ot,dt))T(ot,dt,E,null,g,_,V,O,W);else break;w++}for(;w<=z&&w<=et;){const ot=h[z],dt=y[et]=W?ue(y[et]):se(y[et]);if(Je(ot,dt))T(ot,dt,E,null,g,_,V,O,W);else break;z--,et--}if(w>z){if(w<=et){const ot=et+1,dt=ot<J?y[ot].el:B;for(;w<=et;)T(null,y[w]=W?ue(y[w]):se(y[w]),E,dt,g,_,V,O,W),w++}}else if(w>et)for(;w<=z;)lt(h[w],g,_,!0),w++;else{const ot=w,dt=w,vt=new Map;for(w=dt;w<=et;w++){const Wt=y[w]=W?ue(y[w]):se(y[w]);Wt.key!=null&&vt.set(Wt.key,w)}let gt,jt=0;const Ut=et-dt+1;let Yt=!1,Xt=0;const Ge=new Array(Ut);for(w=0;w<Ut;w++)Ge[w]=0;for(w=ot;w<=z;w++){const Wt=h[w];if(jt>=Ut){lt(Wt,g,_,!0);continue}let Zt;if(Wt.key!=null)Zt=vt.get(Wt.key);else for(gt=dt;gt<=et;gt++)if(Ge[gt-dt]===0&&Je(Wt,y[gt])){Zt=gt;break}Zt===void 0?lt(Wt,g,_,!0):(Ge[Zt-dt]=w+1,Zt>=Xt?Xt=Zt:Yt=!0,T(Wt,y[Zt],E,null,g,_,V,O,W),jt++)}const Un=Yt?ga(Ge):Ne;for(gt=Un.length-1,w=Ut-1;w>=0;w--){const Wt=dt+w,Zt=y[Wt],Vn=y[Wt+1],Wn=Wt+1<J?Vn.el||Ci(Vn):B;Ge[w]===0?T(null,Zt,E,Wn,g,_,V,O,W):Yt&&(gt<0||w!==Un[gt]?rt(Zt,E,Wn,2):gt--)}}},rt=(h,y,E,B,g=null)=>{const{el:_,type:V,transition:O,children:W,shapeFlag:w}=h;if(w&6){rt(h.component.subTree,y,E,B);return}if(w&128){h.suspense.move(y,E,B);return}if(w&64){V.move(h,y,E,Qt);return}if(V===Y){l(_,y,E);for(let z=0;z<W.length;z++)rt(W[z],y,E,B);l(h.anchor,y,E);return}if(V===Ts){b(h,y,E);return}if(B!==2&&w&1&&O)if(B===0)O.beforeEnter(_),l(_,y,E),Rt(()=>O.enter(_),g);else{const{leave:z,delayLeave:et,afterLeave:ot}=O,dt=()=>{h.ctx.isUnmounted?i(_):l(_,y,E)},vt=()=>{_._isLeaving&&_[Do](!0),z(_,()=>{dt(),ot&&ot()})};et?et(_,dt,vt):vt()}else l(_,y,E)},lt=(h,y,E,B=!1,g=!1)=>{const{type:_,props:V,ref:O,children:W,dynamicChildren:w,shapeFlag:J,patchFlag:z,dirs:et,cacheIndex:ot}=h;if(z===-2&&(g=!1),O!=null&&(pe(),ss(O,null,E,h,!0),ve()),ot!=null&&(y.renderCache[ot]=void 0),J&256){y.ctx.deactivate(h);return}const dt=J&1&&et,vt=!ns(h);let gt;if(vt&&(gt=V&&V.onVnodeBeforeUnmount)&&te(gt,y,h),J&6)kt(h.component,E,B);else{if(J&128){h.suspense.unmount(E,B);return}dt&&xe(h,null,y,"beforeUnmount"),J&64?h.type.remove(h,y,E,Qt,B):w&&!w.hasOnce&&(_!==Y||z>0&&z&64)?It(w,y,E,!1,!0):(_===Y&&z&384||!g&&J&16)&&It(W,y,E),B&&ft(h)}(vt&&(gt=V&&V.onVnodeUnmounted)||dt)&&Rt(()=>{gt&&te(gt,y,h),dt&&xe(h,null,y,"unmounted")},E)},ft=h=>{const{type:y,el:E,anchor:B,transition:g}=h;if(y===Y){tt(E,B);return}if(y===Ts){R(h);return}const _=()=>{i(E),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(h.shapeFlag&1&&g&&!g.persisted){const{leave:V,delayLeave:O}=g,W=()=>V(E,_);O?O(h.el,_,W):W()}else _()},tt=(h,y)=>{let E;for(;h!==y;)E=A(h),i(h),h=E;i(y)},kt=(h,y,E)=>{const{bum:B,scope:g,job:_,subTree:V,um:O,m:W,a:w}=h;ol(W),ol(w),B&&$s(B),g.stop(),_&&(_.flags|=8,lt(V,h,y,E)),O&&Rt(O,y),Rt(()=>{h.isUnmounted=!0},y)},It=(h,y,E,B=!1,g=!1,_=0)=>{for(let V=_;V<h.length;V++)lt(h[V],y,E,B,g)},Dt=h=>{if(h.shapeFlag&6)return Dt(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const y=A(h.anchor||h.el),E=y&&y[li];return E?A(E):y};let _e=!1;const ye=(h,y,E)=>{let B;h==null?y._vnode&&(lt(y._vnode,null,null,!0),B=y._vnode.component):T(y._vnode||null,h,y,null,null,null,E),y._vnode=h,_e||(_e=!0,Gn(B),Zl(),_e=!1)},Qt={p:T,um:lt,m:rt,r:ft,mt,mc:X,pc:it,pbc:q,n:Dt,o:t};return{render:ye,hydrate:void 0,createApp:Zo(ye)}}function Ys({type:t,props:e},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:s}function Ae({effect:t,job:e},s){s?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function va(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ln(t,e,s=!1){const l=t.children,i=e.children;if(at(l)&&at(i))for(let o=0;o<l.length;o++){const a=l[o];let r=i[o];r.shapeFlag&1&&!r.dynamicChildren&&((r.patchFlag<=0||r.patchFlag===32)&&(r=i[o]=ue(i[o]),r.el=a.el),!s&&r.patchFlag!==-2&&Ln(a,r)),r.type===Hs&&(r.patchFlag===-1&&(r=i[o]=ue(r)),r.el=a.el),r.type===Te&&!r.el&&(r.el=a.el)}}function ga(t){const e=t.slice(),s=[0];let l,i,o,a,r;const u=t.length;for(l=0;l<u;l++){const v=t[l];if(v!==0){if(i=s[s.length-1],t[i]<v){e[l]=i,s.push(l);continue}for(o=0,a=s.length-1;o<a;)r=o+a>>1,t[s[r]]<v?o=r+1:a=r;v<t[s[o]]&&(o>0&&(e[l]=s[o-1]),s[o]=l)}}for(o=s.length,a=s[o-1];o-- >0;)s[o]=a,a=e[a];return s}function wi(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:wi(e)}function ol(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function Ci(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?Ci(e.subTree):null}const Ti=t=>t.__isSuspense;function ma(t,e){e&&e.pendingBranch?at(t)?e.effects.push(...t):e.effects.push(t):So(t)}const Y=Symbol.for("v-fgt"),Hs=Symbol.for("v-txt"),Te=Symbol.for("v-cmt"),Ts=Symbol.for("v-stc"),is=[];let Ht=null;function c(t=!1){is.push(Ht=t?null:[])}function _a(){is.pop(),Ht=is[is.length-1]||null}let us=1;function al(t,e=!1){us+=t,t<0&&Ht&&e&&(Ht.hasOnce=!0)}function Si(t){return t.dynamicChildren=us>0?Ht||Ne:null,_a(),us>0&&Ht&&Ht.push(t),t}function d(t,e,s,l,i,o){return Si(n(t,e,s,l,i,o,!0))}function Gt(t,e,s,l,i){return Si(bt(t,e,s,l,i,!0))}function xi(t){return t?t.__v_isVNode===!0:!1}function Je(t,e){return t.type===e.type&&t.key===e.key}const Ai=({key:t})=>t??null,Ss=({ref:t,ref_key:e,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||Pt(t)||ut(t)?{i:Kt,r:t,k:e,f:!!s}:t:null);function n(t,e=null,s=null,l=0,i=null,o=t===Y?0:1,a=!1,r=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Ai(e),ref:e&&Ss(e),scopeId:ei,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:l,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Kt};return r?(Nn(u,s),o&128&&t.normalize(u)):s&&(u.shapeFlag|=xt(s)?8:16),us>0&&!a&&Ht&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Ht.push(u),u}const bt=ya;function ya(t,e=null,s=null,l=0,i=null,o=!1){if((!t||t===Ko)&&(t=Te),xi(t)){const r=He(t,e,!0);return s&&Nn(r,s),us>0&&!o&&Ht&&(r.shapeFlag&6?Ht[Ht.indexOf(t)]=r:Ht.push(r)),r.patchFlag=-2,r}if(Ma(t)&&(t=t.__vccOpts),e){e=ba(e);let{class:r,style:u}=e;r&&!xt(r)&&(e.class=nt(r)),_t(u)&&(En(u)&&!at(u)&&(u=Mt({},u)),e.style=St(u))}const a=xt(t)?1:Ti(t)?128:Ro(t)?64:_t(t)?4:ut(t)?2:0;return n(t,e,s,l,i,a,o,!0)}function ba(t){return t?En(t)||mi(t)?Mt({},t):t:null}function He(t,e,s=!1,l=!1){const{props:i,ref:o,patchFlag:a,children:r,transition:u}=t,v=e?$a(i||{},e):i,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:v,key:v&&Ai(v),ref:e&&e.ref?s&&o?at(o)?o.concat(Ss(e)):[o,Ss(e)]:Ss(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:r,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Y?a===-1?16:a|16:a,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:u,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&He(t.ssContent),ssFallback:t.ssFallback&&He(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return u&&l&&Dn(p,u.clone(p)),p}function At(t=" ",e=0){return bt(Hs,null,t,e)}function Ii(t,e){const s=bt(Ts,null,t);return s.staticCount=e,s}function M(t="",e=!1){return e?(c(),Gt(Te,null,t)):bt(Te,null,t)}function se(t){return t==null||typeof t=="boolean"?bt(Te):at(t)?bt(Y,null,t.slice()):xi(t)?ue(t):bt(Hs,null,String(t))}function ue(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:He(t)}function Nn(t,e){let s=0;const{shapeFlag:l}=t;if(e==null)e=null;else if(at(e))s=16;else if(typeof e=="object")if(l&65){const i=e.default;i&&(i._c&&(i._d=!1),Nn(t,i()),i._c&&(i._d=!0));return}else{s=32;const i=e._;!i&&!mi(e)?e._ctx=Kt:i===3&&Kt&&(Kt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ut(e)?(e={default:e,_ctx:Kt},s=32):(e=String(e),l&64?(s=16,e=[At(e)]):s=8);t.children=e,t.shapeFlag|=s}function $a(...t){const e={};for(let s=0;s<t.length;s++){const l=t[s];for(const i in l)if(i==="class")e.class!==l.class&&(e.class=nt([e.class,l.class]));else if(i==="style")e.style=St([e.style,l.style]);else if(Fs(i)){const o=e[i],a=l[i];a&&o!==a&&!(at(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=l[i])}return e}function te(t,e,s,l=null){oe(t,e,7,[s,l])}const ka=fi();let wa=0;function Ca(t,e,s){const l=t.type,i=(e?e.appContext:t.appContext)||ka,o={uid:wa++,vnode:t,type:l,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new zi(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:yi(l,i),emitsOptions:hi(l,i),emit:null,emitted:null,propsDefaults:yt,inheritAttrs:l.inheritAttrs,ctx:yt,data:yt,props:yt,attrs:yt,slots:yt,refs:yt,setupState:yt,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=e?e.root:o,o.emit=ea.bind(null,o),t.ce&&t.ce(o),o}let Lt=null;const Ta=()=>Lt||Kt;let Ps,vn;{const t=Ns(),e=(s,l)=>{let i;return(i=t[s])||(i=t[s]=[]),i.push(l),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Ps=e("__VUE_INSTANCE_SETTERS__",s=>Lt=s),vn=e("__VUE_SSR_SETTERS__",s=>ds=s)}const gs=t=>{const e=Lt;return Ps(t),t.scope.on(),()=>{t.scope.off(),Ps(e)}},rl=()=>{Lt&&Lt.scope.off(),Ps(null)};function Mi(t){return t.vnode.shapeFlag&4}let ds=!1;function Sa(t,e=!1,s=!1){e&&vn(e);const{props:l,children:i}=t.vnode,o=Mi(t);aa(t,l,o,e),da(t,i,s||e);const a=o?xa(t,e):void 0;return e&&vn(!1),a}function xa(t,e){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,qo);const{setup:l}=s;if(l){pe();const i=t.setupContext=l.length>1?Ia(t):null,o=gs(t),a=vs(l,t,0,[t.props,i]),r=Al(a);if(ve(),o(),(r||t.sp)&&!ns(t)&&oi(t),r){if(a.then(rl,rl),e)return a.then(u=>{cl(t,u)}).catch(u=>{Us(u,t,0)});t.asyncDep=a}else cl(t,a)}else Ri(t)}function cl(t,e,s){ut(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:_t(e)&&(t.setupState=Ql(e)),Ri(t)}function Ri(t,e,s){const l=t.type;t.render||(t.render=l.render||ne);{const i=gs(t);pe();try{Go(t)}finally{ve(),i()}}}const Aa={get(t,e){return Et(t,"get",""),t[e]}};function Ia(t){const e=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,Aa),slots:t.slots,emit:t.emit,expose:e}}function Bs(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ql(go(t.exposed)),{get(e,s){if(s in e)return e[s];if(s in ls)return ls[s](t)},has(e,s){return s in e||s in ls}})):t.proxy}function Ma(t){return ut(t)&&"__vccOpts"in t}const Q=(t,e)=>$o(t,e,ds),Ra="3.5.29";/**
14
+ * @vue/runtime-dom v3.5.29
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let gn;const ul=typeof window<"u"&&window.trustedTypes;if(ul)try{gn=ul.createPolicy("vue",{createHTML:t=>t})}catch{}const Ei=gn?t=>gn.createHTML(t):t=>t,Ea="http://www.w3.org/2000/svg",Pa="http://www.w3.org/1998/Math/MathML",ce=typeof document<"u"?document:null,dl=ce&&ce.createElement("template"),Da={insert:(t,e,s)=>{e.insertBefore(t,s||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,s,l)=>{const i=e==="svg"?ce.createElementNS(Ea,t):e==="mathml"?ce.createElementNS(Pa,t):s?ce.createElement(t,{is:s}):ce.createElement(t);return t==="select"&&l&&l.multiple!=null&&i.setAttribute("multiple",l.multiple),i},createText:t=>ce.createTextNode(t),createComment:t=>ce.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ce.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,s,l,i,o){const a=s?s.previousSibling:e.lastChild;if(i&&(i===o||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{dl.innerHTML=Ei(l==="svg"?`<svg>${t}</svg>`:l==="mathml"?`<math>${t}</math>`:t);const r=dl.content;if(l==="svg"||l==="mathml"){const u=r.firstChild;for(;u.firstChild;)r.appendChild(u.firstChild);r.removeChild(u)}e.insertBefore(r,s)}return[a?a.nextSibling:e.firstChild,s?s.previousSibling:e.lastChild]}},Fa=Symbol("_vtc");function Oa(t,e,s){const l=t[Fa];l&&(e=(e?[e,...l]:[...l]).join(" ")),e==null?t.removeAttribute("class"):s?t.setAttribute("class",e):t.className=e}const Ds=Symbol("_vod"),Pi=Symbol("_vsh"),fs={name:"show",beforeMount(t,{value:e},{transition:s}){t[Ds]=t.style.display==="none"?"":t.style.display,s&&e?s.beforeEnter(t):Qe(t,e)},mounted(t,{value:e},{transition:s}){s&&e&&s.enter(t)},updated(t,{value:e,oldValue:s},{transition:l}){!e!=!s&&(l?e?(l.beforeEnter(t),Qe(t,!0),l.enter(t)):l.leave(t,()=>{Qe(t,!1)}):Qe(t,e))},beforeUnmount(t,{value:e}){Qe(t,e)}};function Qe(t,e){t.style.display=e?t[Ds]:"none",t[Pi]=!e}const La=Symbol(""),Na=/(?:^|;)\s*display\s*:/;function ja(t,e,s){const l=t.style,i=xt(s);let o=!1;if(s&&!i){if(e)if(xt(e))for(const a of e.split(";")){const r=a.slice(0,a.indexOf(":")).trim();s[r]==null&&xs(l,r,"")}else for(const a in e)s[a]==null&&xs(l,a,"");for(const a in s)a==="display"&&(o=!0),xs(l,a,s[a])}else if(i){if(e!==s){const a=l[La];a&&(s+=";"+a),l.cssText=s,o=Na.test(s)}}else e&&t.removeAttribute("style");Ds in t&&(t[Ds]=o?l.display:"",t[Pi]&&(l.display="none"))}const fl=/\s*!important$/;function xs(t,e,s){if(at(s))s.forEach(l=>xs(t,e,l));else if(s==null&&(s=""),e.startsWith("--"))t.setProperty(e,s);else{const l=Ua(t,e);fl.test(s)?t.setProperty(De(l),s.replace(fl,""),"important"):t[l]=s}}const hl=["Webkit","Moz","ms"],Xs={};function Ua(t,e){const s=Xs[e];if(s)return s;let l=Ce(e);if(l!=="filter"&&l in t)return Xs[e]=l;l=Rl(l);for(let i=0;i<hl.length;i++){const o=hl[i]+l;if(o in t)return Xs[e]=o}return e}const pl="http://www.w3.org/1999/xlink";function vl(t,e,s,l,i,o=qi(e)){l&&e.startsWith("xlink:")?s==null?t.removeAttributeNS(pl,e.slice(6,e.length)):t.setAttributeNS(pl,e,s):s==null||o&&!Pl(s)?t.removeAttribute(e):t.setAttribute(e,o?"":ie(s)?String(s):s)}function gl(t,e,s,l,i){if(e==="innerHTML"||e==="textContent"){s!=null&&(t[e]=e==="innerHTML"?Ei(s):s);return}const o=t.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){const r=o==="OPTION"?t.getAttribute("value")||"":t.value,u=s==null?t.type==="checkbox"?"on":"":String(s);(r!==u||!("_value"in t))&&(t.value=u),s==null&&t.removeAttribute(e),t._value=s;return}let a=!1;if(s===""||s==null){const r=typeof t[e];r==="boolean"?s=Pl(s):s==null&&r==="string"?(s="",a=!0):r==="number"&&(s=0,a=!0)}try{t[e]=s}catch{}a&&t.removeAttribute(i||e)}function ke(t,e,s,l){t.addEventListener(e,s,l)}function Va(t,e,s,l){t.removeEventListener(e,s,l)}const ml=Symbol("_vei");function Wa(t,e,s,l,i=null){const o=t[ml]||(t[ml]={}),a=o[e];if(l&&a)a.value=l;else{const[r,u]=Ha(e);if(l){const v=o[e]=qa(l,i);ke(t,r,v,u)}else a&&(Va(t,r,a,u),o[e]=void 0)}}const _l=/(?:Once|Passive|Capture)$/;function Ha(t){let e;if(_l.test(t)){e={};let l;for(;l=t.match(_l);)t=t.slice(0,t.length-l[0].length),e[l[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):De(t.slice(2)),e]}let Zs=0;const Ba=Promise.resolve(),Ka=()=>Zs||(Ba.then(()=>Zs=0),Zs=Date.now());function qa(t,e){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;oe(Ga(l,s.value),e,5,[l])};return s.value=t,s.attached=Ka(),s}function Ga(t,e){if(at(e)){const s=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{s.call(t),t._stopped=!0},e.map(l=>i=>!i._stopped&&l&&l(i))}else return e}const yl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,za=(t,e,s,l,i,o)=>{const a=i==="svg";e==="class"?Oa(t,l,a):e==="style"?ja(t,s,l):Fs(e)?$n(e)||Wa(t,e,s,l,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Ja(t,e,l,a))?(gl(t,e,l),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&vl(t,e,l,a,o,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!xt(l))?gl(t,Ce(e),l,o,e):(e==="true-value"?t._trueValue=l:e==="false-value"&&(t._falseValue=l),vl(t,e,l,a))};function Ja(t,e,s,l){if(l)return!!(e==="innerHTML"||e==="textContent"||e in t&&yl(e)&&ut(s));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return yl(e)&&xt(s)?!1:e in t}const Be=t=>{const e=t.props["onUpdate:modelValue"]||!1;return at(e)?s=>$s(e,s):e};function Qa(t){t.target.composing=!0}function bl(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const he=Symbol("_assign");function $l(t,e,s){return e&&(t=t.trim()),s&&(t=Ls(t)),t}const jn={created(t,{modifiers:{lazy:e,trim:s,number:l}},i){t[he]=Be(i);const o=l||i.props&&i.props.type==="number";ke(t,e?"change":"input",a=>{a.target.composing||t[he]($l(t.value,s,o))}),(s||o)&&ke(t,"change",()=>{t.value=$l(t.value,s,o)}),e||(ke(t,"compositionstart",Qa),ke(t,"compositionend",bl),ke(t,"change",bl))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:s,modifiers:{lazy:l,trim:i,number:o}},a){if(t[he]=Be(a),t.composing)return;const r=(o||t.type==="number")&&!/^0\d/.test(t.value)?Ls(t.value):t.value,u=e??"";r!==u&&(document.activeElement===t&&t.type!=="range"&&(l&&e===s||i&&t.value.trim()===u)||(t.value=u))}},Oe={deep:!0,created(t,e,s){t[he]=Be(s),ke(t,"change",()=>{const l=t._modelValue,i=hs(t),o=t.checked,a=t[he];if(at(l)){const r=Cn(l,i),u=r!==-1;if(o&&!u)a(l.concat(i));else if(!o&&u){const v=[...l];v.splice(r,1),a(v)}}else if(Ke(l)){const r=new Set(l);o?r.add(i):r.delete(i),a(r)}else a(Di(t,o))})},mounted:kl,beforeUpdate(t,e,s){t[he]=Be(s),kl(t,e,s)}};function kl(t,{value:e,oldValue:s},l){t._modelValue=e;let i;if(at(e))i=Cn(e,l.props.value)>-1;else if(Ke(e))i=e.has(l.props.value);else{if(e===s)return;i=qe(e,Di(t,!0))}t.checked!==i&&(t.checked=i)}const Pe={deep:!0,created(t,{value:e,modifiers:{number:s}},l){const i=Ke(e);ke(t,"change",()=>{const o=Array.prototype.filter.call(t.options,a=>a.selected).map(a=>s?Ls(hs(a)):hs(a));t[he](t.multiple?i?new Set(o):o:o[0]),t._assigning=!0,Me(()=>{t._assigning=!1})}),t[he]=Be(l)},mounted(t,{value:e}){wl(t,e)},beforeUpdate(t,e,s){t[he]=Be(s)},updated(t,{value:e}){t._assigning||wl(t,e)}};function wl(t,e){const s=t.multiple,l=at(e);if(!(s&&!l&&!Ke(e))){for(let i=0,o=t.options.length;i<o;i++){const a=t.options[i],r=hs(a);if(s)if(l){const u=typeof r;u==="string"||u==="number"?a.selected=e.some(v=>String(v)===String(r)):a.selected=Cn(e,r)>-1}else a.selected=e.has(r);else if(qe(hs(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function hs(t){return"_value"in t?t._value:t.value}function Di(t,e){const s=e?"_trueValue":"_falseValue";return s in t?t[s]:e}const Ya=["ctrl","shift","alt","meta"],Xa={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Ya.some(s=>t[`${s}Key`]&&!e.includes(s))},le=(t,e)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=e.join(".");return s[l]||(s[l]=(i,...o)=>{for(let a=0;a<e.length;a++){const r=Xa[e[a]];if(r&&r(i,e))return}return t(i,...o)})},Za=Mt({patchProp:za},Da);let Cl;function tr(){return Cl||(Cl=ha(Za))}const er=(...t)=>{const e=tr().createApp(...t),{mount:s}=e;return e.mount=l=>{const i=nr(l);if(!i)return;const o=e._component;!ut(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const a=s(i,!1,sr(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),a},e};function sr(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function nr(t){return xt(t)?document.querySelector(t):t}const Tl={user:{icon:"👤",bgColor:"#f0f9ff",borderColor:"#3b82f6",label:"用户"},thinking:{icon:"🧠",bgColor:"#fef3c7",borderColor:"#f59e0b",label:"思考"},text:{icon:"🤖",bgColor:"#f0fdf4",borderColor:"#22c55e",label:"回复"},toolCall:{icon:"🔧",bgColor:"#f5f3ff",borderColor:"#8b5cf6",label:"调用"},toolResult:{icon:"✅",bgColor:"#ecfdf5",borderColor:"#10b981",label:"结果"},error:{icon:"⚠️",bgColor:"#fef2f2",borderColor:"#dc2626",label:"错误"}};function lr(t){return t.senderName?t.senderName:t.senderId?t.senderId:"用户"}const ir={class:"header-left"},or={class:"step-icon"},ar={class:"step-type"},rr={key:0,class:"step-subtitle"},cr={key:1,class:"collapse-summary"},ur={class:"step-time"},dr={key:2,class:"step-duration"},fr={key:3,class:"execution-time"},hr={class:"header-right"},pr={key:0,class:"step-tokens"},vr=["title"],gr={key:2,class:"expand-icon"},mr={key:0,class:"step-content"},_r={key:0,class:"content-block user-content"},yr={key:1,class:"content-block thinking-content"},br={key:2,class:"content-block text-content"},$r={key:3,class:"content-block tool-call-content"},kr={key:0,class:"args-section"},wr={class:"code-block"},Cr={key:4,class:"content-block tool-result-content"},Tr={class:"result-header"},Sr={key:0,class:"tool-error-section"},xr={class:"tool-error-message"},Ar={key:0,class:"tool-error-suggestion"},Ir={key:1,class:"result-body"},Mr={key:0,class:"result-body"},Rr={key:5,class:"content-block error-content"},Er={class:"error-type"},Pr={class:"error-message"},Dr={key:0,class:"error-suggestion"},Fr=wt({__name:"TimelineStep",props:{step:{},prevStep:{},highlightedPair:{}},emits:["toggle-collapse","highlight-pair"],setup(t,{emit:e}){const s=t,l=e,i=j(!s.step.collapsed),o=j(!1),a=Q(()=>{var G;return((G=Tl[s.step.type])==null?void 0:G.icon)||"📄"}),r=Q(()=>{var G;if(s.step.type==="user")return lr(s.step);if(s.step.type==="toolCall")return`${s.step.toolName||"工具"} 调用`;if(s.step.type==="toolResult"){const I=s.step.toolName||"工具",st=s.step.toolResultStatus==="ok"?"结果":"失败";return`${I} ${st}`}return((G=Tl[s.step.type])==null?void 0:G.label)||s.step.type}),u=Q(()=>s.step.type==="thinking"?"LLM 推理":s.step.type==="text"?"LLM 输出":""),v=Q(()=>!!(s.step.pairedToolCallId||s.step.pairedToolResultId)),p=Q(()=>s.step.type==="toolResult"&&s.step.pairedToolCallId),C=Q(()=>{if(!s.highlightedPair||!v.value)return!1;const{callId:G,resultId:I}=s.highlightedPair;return s.step.id===G||s.step.id===I}),A=Q(()=>s.step.type==="toolCall"&&s.step.pairedToolResultId?"点击高亮对应结果":s.step.type==="toolResult"&&s.step.pairedToolCallId?"点击高亮对应调用":""),S=Q(()=>{const{type:G,content:I,thinking:st,toolArguments:mt,toolResult:P,errorMessage:L}=s.step;return I||st||mt||P||L}),m=Q(()=>{const G=s.step;if(G.type==="toolCall"&&G.toolArguments){const I=G.toolArguments.path??G.toolArguments.file_path??G.toolArguments.filePath;if(typeof I=="string")return I;const st=G.toolArguments.pattern;if(typeof st=="string")return st;const mt=G.toolArguments.command;if(typeof mt=="string")return mt.length>40?mt.slice(0,40)+"…":mt}if(G.type==="toolResult"){if(G.toolResultStatus==="error"){const I=(G.toolResultError||G.toolResult||"").slice(0,30);return I?`${I}${I.length>=30?"…":""}`:"失败"}if(G.toolResult){const I=G.toolResult.split(`
18
+ `).length;return I>1?`${I} 行`:""}}if(G.type==="thinking"&&G.thinking){const I=G.thinking.length;return I>0?`约 ${I} 字`:""}if(G.type==="text"&&G.content){const I=G.content.length;return I>0?`约 ${I} 字`:""}return""}),T=Q(()=>s.step.toolResult?s.step.toolResult.length>500||s.step.toolResult.split(`
19
+ `).length>10:!1),D=Q(()=>s.step.toolResult?s.step.toolResult.split(`
20
+ `).length:0),$=Q(()=>s.step.toolResult?o.value||!T.value?s.step.toolResult:s.step.toolResult.split(`
21
+ `).slice(0,10).join(`
22
+ `)+`
23
+ ...`:""),k=Q(()=>s.step.type!=="toolResult"||s.step.toolResultStatus!=="error"?"":s.step.toolResultError?s.step.toolResultError:s.step.toolResult||"工具执行失败"),b=Q(()=>{if(s.step.type!=="toolResult"||s.step.toolResultStatus!=="error")return null;const G=(s.step.toolResultError||s.step.toolResult||"").toLowerCase(),I=(s.step.toolName||"").toLowerCase(),st=[];return(G.includes("enoent")||G.includes("no such file")||G.includes("文件不存在"))&&st.push("检查文件路径是否正确","确认文件是否存在"),(G.includes("eacces")||G.includes("permission")||G.includes("权限"))&&st.push("检查文件/目录权限","确认当前用户有访问权限"),(G.includes("timeout")||G.includes("超时"))&&st.push("增加超时时间","简化任务或检查网络"),I==="read"&&st.length===0&&st.push("检查路径是否在 workspace 内","确认文件编码正确"),I.includes("bash")&&st.length===0&&st.push("检查命令语法","确认依赖已安装","查看退出码"),st.length===0&&st.push("查看原始返回详情","尝试调整参数后重试"),st}),R=Q(()=>s.step.type!=="error"||!s.step.errorType?null:{"rate-limit":["降低调用频率","切换到 fallback model","等待配额恢复"],"token-limit":["减少上下文长度","分段处理任务","使用更大 context 的模型"],timeout:["检查网络连接","简化任务复杂度","增加超时时间"],quota:["充值账户","切换到其他 provider","等待配额重置"]}[s.step.errorType]||null);function K(){if(v.value){const G=s.step.pairedToolCallId||s.step.id,I=s.step.pairedToolResultId||s.step.id;l("highlight-pair",{callId:G,resultId:I})}x()}function x(){S.value&&(i.value=!i.value)}function F(G){return G?new Date(G).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function X(G){return G?G<1e3?`${G}ms`:G<6e4?`${(G/1e3).toFixed(1)}s`:`${(G/6e4).toFixed(1)}min`:"0ms"}function H(G){try{return JSON.stringify(G,null,2)}catch{return String(G)}}async function q(){if(s.step.toolResult)try{await navigator.clipboard.writeText(s.step.toolResult),alert("已复制到剪贴板")}catch{}}return(G,I)=>(c(),d("div",{class:nt(["timeline-step",[`step-${t.step.type}`,`status-${t.step.status}`,{"is-paired-result":p.value,highlighted:C.value}]])},[n("div",{class:"step-header",onClick:K},[n("div",ir,[n("span",or,f(a.value),1),n("span",ar,f(r.value),1),u.value?(c(),d("span",rr,f(u.value),1)):M("",!0),!i.value&&m.value?(c(),d("span",cr,f(m.value),1)):M("",!0),n("span",ur,f(F(t.step.timestamp)),1),t.step.duration&&t.step.duration>0?(c(),d("span",dr," +"+f(X(t.step.duration)),1)):M("",!0),t.step.executionTime?(c(),d("span",fr," ⏱ "+f(X(t.step.executionTime)),1)):M("",!0)]),n("div",hr,[t.step.tokens?(c(),d("span",pr,[I[2]||(I[2]=n("span",{class:"token-label"},"tokens:",-1)),At(" "+f(t.step.tokens.input+t.step.tokens.output),1)])):M("",!0),v.value?(c(),d("span",{key:1,class:"pair-indicator",title:A.value}," 🔗 ",8,vr)):M("",!0),S.value?(c(),d("span",gr,f(i.value?"▼":"▶"),1)):M("",!0)])]),S.value&&i.value?(c(),d("div",mr,[t.step.type==="user"&&t.step.content?(c(),d("div",_r,[n("pre",null,f(t.step.content),1)])):M("",!0),t.step.type==="thinking"&&t.step.thinking?(c(),d("div",yr,[I[3]||(I[3]=n("div",{class:"thinking-label"},"💭 思考过程",-1)),n("pre",null,f(t.step.thinking),1)])):M("",!0),t.step.type==="text"&&t.step.content?(c(),d("div",br,[n("pre",null,f(t.step.content),1)])):M("",!0),t.step.type==="toolCall"?(c(),d("div",$r,[t.step.toolArguments?(c(),d("div",kr,[I[4]||(I[4]=n("div",{class:"section-label"},"参数:",-1)),n("pre",wr,f(H(t.step.toolArguments)),1)])):M("",!0)])):M("",!0),t.step.type==="toolResult"?(c(),d("div",Cr,[n("div",Tr,[n("span",{class:nt(["result-status",t.step.toolResultStatus])},f(t.step.toolResultStatus==="ok"?"✅ 成功":"❌ 工具执行失败"),3),t.step.toolResult?(c(),d("button",{key:0,class:"copy-btn",onClick:q}," 复制 ")):M("",!0)]),t.step.toolResultStatus==="error"?(c(),d(Y,{key:0},[k.value?(c(),d("div",Sr,[n("div",xr,f(k.value),1),b.value?(c(),d("div",Ar,[I[5]||(I[5]=n("span",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),d(Y,null,ct(b.value,(st,mt)=>(c(),d("li",{key:mt},f(st),1))),128))])])):M("",!0)])):M("",!0),t.step.toolResult?(c(),d("div",Ir,[I[6]||(I[6]=n("div",{class:"section-label"},"原始返回:",-1)),n("pre",{class:nt({truncated:!o.value})},f($.value),3),T.value?(c(),d("button",{key:0,class:"show-more-btn",onClick:I[0]||(I[0]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${D.value} 行)`),1)):M("",!0)])):M("",!0)],64)):(c(),d(Y,{key:1},[t.step.toolResult?(c(),d("div",Mr,[n("pre",{class:nt({truncated:!o.value})},f($.value),3),T.value?(c(),d("button",{key:0,class:"show-more-btn",onClick:I[1]||(I[1]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${D.value} 行)`),1)):M("",!0)])):M("",!0)],64))])):M("",!0),t.step.type==="error"?(c(),d("div",Rr,[n("div",Er,f(t.step.errorType||"unknown"),1),n("div",Pr,f(t.step.errorMessage),1),R.value?(c(),d("div",Dr,[I[7]||(I[7]=n("div",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),d(Y,null,ct(R.value,(st,mt)=>(c(),d("li",{key:mt},f(st),1))),128))])])):M("",!0)])):M("",!0)])):M("",!0)],2))}}),Ct=(t,e)=>{const s=t.__vccOpts||t;for(const[l,i]of e)s[l]=i;return s},mn=Ct(Fr,[["__scopeId","data-v-b8bd62e0"]]),Or={class:"timeline-connector"},Lr=wt({__name:"TimelineConnector",setup(t){return(e,s)=>(c(),d("div",Or,[...s[0]||(s[0]=[n("div",{class:"connector-line"},null,-1),n("div",{class:"connector-arrow"},"▼",-1)])]))}}),_n=Ct(Lr,[["__scopeId","data-v-01a6bfe6"]]),Nr={class:"round-header"},jr={class:"round-badge"},Ur={class:"round-trigger"},Vr={key:0,class:"round-stats"},Wr={class:"round-content"},Hr=wt({__name:"TimelineRound",props:{round:{},steps:{},highlightedPair:{}},emits:["highlight-pair"],setup(t){const e=t,s={user_input:"👤 用户输入触发",subagent_result:"↩️ 子代理回传",tool_result:"🔧 工具结果触发",start:"🚀 会话开始"},l=Q(()=>{const o=s[e.round.trigger]||e.round.trigger;return e.round.triggerBy&&e.round.triggerBy!=="用户"?`${o} · ${e.round.triggerBy}`:o});function i(o){const a=e.steps.find(r=>r.id===o);return a||(console.warn(`Step not found: ${o}`),{id:o,type:"text",status:"success",timestamp:0})}return(o,a)=>(c(),d("div",{class:nt(["timeline-round",`trigger-${t.round.trigger}`])},[n("div",Nr,[n("span",jr,"LLM #"+f(t.round.index),1),n("span",Ur,f(l.value),1),t.round.tokens?(c(),d("span",Vr,f(t.round.tokens.input+t.round.tokens.output)+" tokens ",1)):M("",!0)]),n("div",Wr,[(c(!0),d(Y,null,ct(t.round.stepIds,(r,u)=>(c(),d(Y,{key:r},[u>0?(c(),Gt(_n,{key:0})):M("",!0),bt(mn,{step:i(r),prevStep:u>0?i(t.round.stepIds[u-1]):void 0,highlightedPair:t.highlightedPair,onHighlightPair:a[0]||(a[0]=v=>o.$emit("highlight-pair",v))},null,8,["step","prevStep","highlightedPair"])],64))),128))])],2))}}),Br=Ct(Hr,[["__scopeId","data-v-2aa49052"]]),Kr={key:0,class:"link-time"},qr=wt({__name:"TimelineToolLink",props:{isError:{type:Boolean},isActive:{type:Boolean},executionTime:{}},setup(t){function e(s){return s?s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}min`:""}return(s,l)=>(c(),d("div",{class:nt(["tool-link",{"link-error":t.isError,"link-active":t.isActive}])},[l[0]||(l[0]=n("div",{class:"link-line"},[n("span",{class:"link-dot top"}),n("span",{class:"link-connector"}),n("span",{class:"link-dot bottom"})],-1)),t.executionTime?(c(),d("span",Kr,f(e(t.executionTime)),1)):M("",!0)],2))}}),Sl=Ct(qr,[["__scopeId","data-v-d1e21896"]]),Gr={class:"timeline-view"},zr={class:"timeline-header"},Jr={class:"header-left"},Qr={key:0,class:"agent-info"},Yr={key:0,class:"model"},Xr={class:"header-right"},Zr=["disabled"],tc={key:0,class:"loading-state"},ec={key:1,class:"empty-state"},sc={key:0,class:"empty-message"},nc={key:1},lc={key:2,class:"empty-hint"},ic={key:2,class:"timeline-content"},oc={key:0,class:"session-info"},ac={class:"session-id"},rc={key:0,class:"started-at"},cc={class:"steps-list"},uc={key:0,class:"tool-execution-label"},dc={class:"timeline-footer"},fc={class:"stats-grid"},hc={class:"stat-item"},pc={class:"stat-value"},vc={class:"stat-item"},gc={class:"stat-value"},mc={class:"stat-item"},_c={class:"stat-value"},yc={class:"stat-item"},bc={class:"stat-value"},$c=wt({__name:"TimelineView",props:{agentId:{},sessionKey:{},autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=j(null),l=j(!1),i=j(null),o=j(null),a=Q(()=>s.value?s.value.status:"empty"),r=Q(()=>({running:"🔄 进行中",completed:"✅ 已完成",error:"❌ 出错",empty:"空",no_sessions:"无会话"})[a.value]||"未知"),u=Q(()=>{var k;return((k=s.value)==null?void 0:k.roundMode)&&s.value.rounds&&s.value.rounds.length>0}),v=Q(()=>{var R;if(!s.value||!u.value)return[];const k=[],b=new Set;for(const K of s.value.steps){if(b.has(K.id))continue;const x=(R=s.value.rounds)==null?void 0:R.find(F=>F.stepIds.includes(K.id));x?(k.push({type:"round",data:x}),x.stepIds.forEach(F=>b.add(F))):(k.push({type:"step",data:K}),b.add(K.id))}return k});async function p(){if(e.agentId){l.value=!0,i.value=null;try{let k=`/api/timeline/${e.agentId}?limit=100`;e.sessionKey&&(k+=`&session_key=${encodeURIComponent(e.sessionKey)}`);const b=await fetch(k);if(!b.ok)throw new Error(`HTTP ${b.status}`);s.value=await b.json()}catch(k){i.value=k instanceof Error?k.message:"加载失败",console.error("Timeline load error:",k)}finally{l.value=!1}}}function C(k){s.value&&s.value.steps[k]&&(s.value.steps[k].collapsed=!s.value.steps[k].collapsed)}function A(k){if(s.value){const b=s.value.steps.find(R=>R.id===k);b&&(b.collapsed=!b.collapsed)}}function S(k){o.value=k,setTimeout(()=>{o.value=null},3e3)}function m(k){return k?new Date(k).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function T(k){return k?k<1e3?`${k}ms`:k<6e4?`${(k/1e3).toFixed(1)}s`:`${(k/6e4).toFixed(1)}min`:"0ms"}function D(k){return k>=1e3?`${(k/1e3).toFixed(1)}k`:String(k)}Nt(p),Bt(()=>e.agentId,p);let $=null;return Bt([()=>e.autoRefresh,()=>e.refreshInterval],([k,b])=>{$&&(clearInterval($),$=null),k&&b&&b>0&&($=setInterval(p,b*1e3))},{immediate:!0}),(k,b)=>{var R,K;return c(),d("div",Gr,[n("div",zr,[n("div",Jr,[b[0]||(b[0]=n("span",{class:"title"},"📊 实时执行时序",-1)),s.value?(c(),d("span",Qr,[At(f(s.value.agentName||s.value.agentId)+" ",1),s.value.model?(c(),d("span",Yr,"("+f(s.value.model)+")",1)):M("",!0)])):M("",!0)]),n("div",Xr,[n("span",{class:nt(["status-badge",`status-${a.value}`])},f(r.value),3),n("button",{class:"refresh-btn",onClick:p,disabled:l.value},f(l.value?"加载中...":"🔄 刷新"),9,Zr)])]),l.value&&!s.value?(c(),d("div",tc,[...b[1]||(b[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载时序数据...",-1)])])):!s.value||s.value.steps.length===0?(c(),d("div",ec,[b[2]||(b[2]=n("span",{class:"empty-icon"},"📭",-1)),((R=s.value)==null?void 0:R.status)==="no_sessions"?(c(),d("span",sc," 该 Agent 是子代理,暂无独立会话记录 ")):(c(),d("span",nc,"暂无会话记录")),(K=s.value)!=null&&K.message?(c(),d("div",lc,f(s.value.message),1)):M("",!0)])):(c(),d("div",ic,[b[8]||(b[8]=Ii('<div class="timeline-legend" data-v-4ac4b073><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>👤</span> 用户/回传</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>🧠</span> LLM 思考</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>🤖</span> LLM 回复</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>🔧</span> 工具调用</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>✅</span> 工具成功</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>❌</span> 工具失败</span><span class="legend-item" data-v-4ac4b073><span class="legend-icon" data-v-4ac4b073>⚠️</span> 错误</span></div>',1)),s.value.sessionId?(c(),d("div",oc,[n("span",ac,"Session: "+f(s.value.sessionId.slice(0,8))+"...",1),s.value.startedAt?(c(),d("span",rc," 开始: "+f(m(s.value.startedAt)),1)):M("",!0)])):M("",!0),n("div",cc,[u.value?(c(!0),d(Y,{key:0},ct(v.value,(x,F)=>{var X;return c(),d(Y,{key:(x.type==="round",x.data.id)},[F>0?(c(),Gt(_n,{key:0})):M("",!0),x.type==="round"?(c(),Gt(Br,{key:1,round:x.data,steps:s.value.steps,highlightedPair:o.value,onHighlightPair:S},null,8,["round","steps","highlightedPair"])):(c(),d(Y,{key:2},[x.data.type==="toolResult"?(c(),d("div",uc,[...b[3]||(b[3]=[n("span",{class:"label-line"},null,-1),n("span",{class:"label-text"},"⚡ 工具执行",-1),n("span",{class:"label-line"},null,-1)])])):M("",!0),x.data.type==="toolResult"&&x.data.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:x.data.toolResultStatus==="error",isActive:((X=o.value)==null?void 0:X.resultId)===x.data.id,executionTime:x.data.executionTime},null,8,["isError","isActive","executionTime"])):M("",!0),bt(mn,{step:x.data,highlightedPair:o.value,onToggleCollapse:H=>A(x.data.id),onHighlightPair:S},null,8,["step","highlightedPair","onToggleCollapse"])],64))],64)}),128)):(c(!0),d(Y,{key:1},ct(s.value.steps,(x,F)=>{var X;return c(),d(Y,{key:x.id},[F>0?(c(),Gt(_n,{key:0})):M("",!0),x.type==="toolResult"&&x.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:x.toolResultStatus==="error",isActive:((X=o.value)==null?void 0:X.resultId)===x.id,executionTime:x.executionTime},null,8,["isError","isActive","executionTime"])):M("",!0),bt(mn,{step:x,prevStep:s.value.steps[F-1],highlightedPair:o.value,onToggleCollapse:H=>C(F),onHighlightPair:S},null,8,["step","prevStep","highlightedPair","onToggleCollapse"])],64)}),128))]),n("div",dc,[n("div",fc,[n("div",hc,[b[4]||(b[4]=n("span",{class:"stat-label"},"总耗时",-1)),n("span",pc,f(T(s.value.stats.totalDuration)),1)]),n("div",vc,[b[5]||(b[5]=n("span",{class:"stat-label"},"Token",-1)),n("span",gc,f(D(s.value.stats.totalInputTokens))+" / "+f(D(s.value.stats.totalOutputTokens)),1)]),n("div",mc,[b[6]||(b[6]=n("span",{class:"stat-label"},"工具调用",-1)),n("span",_c,f(s.value.stats.toolCallCount)+" 次",1)]),n("div",yc,[b[7]||(b[7]=n("span",{class:"stat-label"},"步骤数",-1)),n("span",bc,f(s.value.stats.stepCount),1)])])])]))])}}}),kc=Ct($c,[["__scopeId","data-v-4ac4b073"]]),yn={pending:{icon:"⏳",bgColor:"#f3f4f6",borderColor:"#9ca3af",label:"等待中"},running:{icon:"🔄",bgColor:"#eff6ff",borderColor:"#3b82f6",label:"进行中"},completed:{icon:"✅",bgColor:"#f0fdf4",borderColor:"#22c55e",label:"已完成"},error:{icon:"❌",bgColor:"#fef2f2",borderColor:"#ef4444",label:"失败"}},wc={class:"node-icon"},Cc={class:"node-info"},Tc={class:"node-name"},Sc={class:"node-role"},xc={class:"node-status"},Ac={key:0,class:"node-time"},Ic={key:1,class:"node-progress"},Mc=wt({__name:"ChainNode",props:{node:{},isSelected:{type:Boolean}},emits:["click"],setup(t){const e=t,s=Q(()=>{var o;return((o=yn[e.node.status])==null?void 0:o.icon)||"📄"}),l=Q(()=>{var o;return((o=yn[e.node.status])==null?void 0:o.label)||e.node.status});function i(o){return o?o<1e3?`${o}ms`:o<6e4?`${(o/1e3).toFixed(1)}s`:`${(o/6e4).toFixed(1)}min`:""}return(o,a)=>(c(),d("div",{class:nt(["chain-node",[`status-${t.node.status}`,{selected:t.isSelected}]]),onClick:a[0]||(a[0]=r=>o.$emit("click"))},[n("div",wc,f(s.value),1),n("div",Cc,[n("div",Tc,f(t.node.agentName),1),n("div",Sc,f(t.node.role),1)]),n("div",xc,f(l.value),1),t.node.startedAt?(c(),d("div",Ac,f(i(t.node.duration)),1)):M("",!0),t.node.status==="running"?(c(),d("div",Ic,[...a[1]||(a[1]=[n("div",{class:"progress-spinner"},null,-1)])])):M("",!0)],2))}}),Rc=Ct(Mc,[["__scopeId","data-v-973c6755"]]),Ec={width:"60",height:"20",viewBox:"0 0 60 20"},Pc={id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto"},Dc=["fill"],Fc=["stroke","stroke-dasharray"],Oc=wt({__name:"ChainEdge",props:{fromStatus:{},toStatus:{}},setup(t){const e=t,s=Q(()=>e.toStatus==="running"?"#3b82f6":e.toStatus==="completed"?"#22c55e":e.toStatus==="error"?"#ef4444":"#9ca3af"),l=Q(()=>s.value),i=Q(()=>e.toStatus==="pending"?"4 4":"none"),o=Q(()=>({"edge-running":e.toStatus==="running","edge-completed":e.toStatus==="completed","edge-error":e.toStatus==="error","edge-pending":e.toStatus==="pending"}));return(a,r)=>(c(),d("div",{class:nt(["chain-edge",o.value])},[(c(),d("svg",Ec,[n("defs",null,[n("marker",Pc,[n("polygon",{points:"0 0, 10 3.5, 0 7",fill:l.value},null,8,Dc)])]),n("line",{x1:"0",y1:"10",x2:"50",y2:"10",stroke:s.value,"stroke-width":"2","stroke-dasharray":i.value,"marker-end":"url(#arrowhead)"},null,8,Fc)]))],2))}}),Lc=Ct(Oc,[["__scopeId","data-v-c94ab96b"]]),Nc={class:"chain-view"},jc={class:"chain-header"},Uc={class:"header-left"},Vc={key:0,class:"project-info"},Wc={class:"header-right"},Hc=["disabled"],Bc={key:0,class:"loading-state"},Kc={key:1,class:"empty-state"},qc={key:2,class:"chain-content"},Gc={key:0,class:"root-task"},zc={class:"task-text"},Jc={class:"task-meta"},Qc={key:0},Yc={key:1,class:"chain-diagram"},Xc={class:"diagram-container"},Zc={key:2,class:"chain-progress"},tu={class:"progress-bar"},eu={class:"progress-text"},su={key:3,class:"node-detail"},nu={class:"detail-header"},lu={class:"detail-title"},iu={class:"detail-content"},ou={key:0,class:"detail-section"},au={class:"section-value"},ru={class:"detail-row"},cu={class:"detail-item"},uu={class:"item-value"},du={class:"detail-item"},fu={class:"item-value"},hu={key:1,class:"detail-row"},pu={class:"detail-item"},vu={class:"item-value"},gu={class:"detail-item"},mu={class:"item-value"},_u={key:2,class:"detail-section"},yu={class:"section-value"},bu={key:3,class:"detail-section"},$u={class:"artifacts-list"},ku=wt({__name:"TaskChainView",props:{autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=j([]),l=j(null),i=j(null),o=j(!1),a=Q(()=>{var T;return{running:"🔄 进行中",completed:"✅ 已完成",error:"❌ 出错",empty:"空"}[((T=l.value)==null?void 0:T.status)||"empty"]||"未知"}),r=Q(()=>{var T;if(!((T=l.value)!=null&&T.nodes))return[];const m=["main","analyst","architect","devops"];return[...l.value.nodes].sort((D,$)=>{const k=m.findIndex(R=>D.role.includes(R)),b=m.findIndex(R=>$.role.includes(R));return k-b})});async function u(){o.value=!0;try{const m=await fetch("/api/chains?limit=10");if(m.ok){const T=await m.json();s.value=T.chains||[],l.value=T.activeChain||null}}catch(m){console.error("Chain load error:",m)}finally{o.value=!1}}function v(m){var T;i.value=((T=i.value)==null?void 0:T.agentId)===m.agentId?null:m}function p(m){return m?new Date(m).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"-"}function C(m){return m?m<1e3?`${m}ms`:m<6e4?`${(m/1e3).toFixed(1)}s`:`${(m/6e4).toFixed(1)}min`:"-"}function A(m){return m?m>=1e3?`${(m/1e3).toFixed(1)}k`:String(m):"0"}let S=null;return Nt(()=>{u(),e.autoRefresh&&e.refreshInterval&&(S=setInterval(u,e.refreshInterval*1e3))}),ae(()=>{S&&(clearInterval(S),S=null)}),(m,T)=>{var D,$;return c(),d("div",Nc,[n("div",jc,[n("div",Uc,[T[0]||(T[0]=n("span",{class:"title"},"🔗 任务执行链路",-1)),l.value?(c(),d("span",Vc,f(l.value.projectId||"当前任务"),1)):M("",!0)]),n("div",Wc,[n("span",{class:nt(["status-badge",`status-${((D=l.value)==null?void 0:D.status)||"empty"}`])},f(a.value),3),n("button",{class:"refresh-btn",onClick:u,disabled:o.value},f(o.value?"加载中...":"🔄 刷新"),9,Hc)])]),o.value&&!l.value?(c(),d("div",Bc,[...T[1]||(T[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载链路数据...",-1)])])):!l.value&&s.value.length===0?(c(),d("div",Kc,[...T[2]||(T[2]=[n("span",{class:"empty-icon"},"🔗",-1),n("span",null,"暂无任务链路",-1),n("div",{class:"empty-hint"},"当 Main Agent 派发任务给子 Agent 时,这里会显示执行链路",-1)])])):(c(),d("div",qc,[l.value?(c(),d("div",Gc,[T[3]||(T[3]=n("div",{class:"task-label"},"根任务",-1)),n("div",zc,f(l.value.rootTask),1),n("div",Jc,[l.value.startedAt?(c(),d("span",Qc,"开始: "+f(p(l.value.startedAt)),1)):M("",!0)])])):M("",!0),l.value?(c(),d("div",Yc,[n("div",Xc,[(c(!0),d(Y,null,ct(r.value,(k,b)=>{var R,K;return c(),d(Y,{key:k.agentId},[b>0?(c(),Gt(Lc,{key:0,"from-status":(R=r.value[b-1])==null?void 0:R.status,"to-status":k.status},null,8,["from-status","to-status"])):M("",!0),bt(Rc,{node:k,"is-selected":((K=i.value)==null?void 0:K.agentId)===k.agentId,onClick:x=>v(k)},null,8,["node","is-selected","onClick"])],64)}),128))])])):M("",!0),l.value?(c(),d("div",Zc,[n("div",tu,[n("div",{class:"progress-fill",style:St({width:`${l.value.progress*100}%`})},null,4)]),n("div",eu,f(Math.round(l.value.progress*100))+"% ("+f(l.value.completedNodes)+"/"+f(l.value.totalNodes)+" 完成) ",1)])):M("",!0),i.value?(c(),d("div",su,[n("div",nu,[n("span",lu,f(i.value.agentName),1),n("span",{class:nt(["detail-status",`status-${i.value.status}`])},f((($=rs(yn)[i.value.status])==null?void 0:$.label)||i.value.status),3)]),n("div",iu,[i.value.task?(c(),d("div",ou,[T[4]||(T[4]=n("div",{class:"section-label"},"任务",-1)),n("div",au,f(i.value.task),1)])):M("",!0),n("div",ru,[n("div",cu,[T[5]||(T[5]=n("span",{class:"item-label"},"开始时间",-1)),n("span",uu,f(i.value.startedAt?p(i.value.startedAt):"-"),1)]),n("div",du,[T[6]||(T[6]=n("span",{class:"item-label"},"耗时",-1)),n("span",fu,f(C(i.value.duration)),1)])]),i.value.tokenUsage?(c(),d("div",hu,[n("div",pu,[T[7]||(T[7]=n("span",{class:"item-label"},"Token 输入",-1)),n("span",vu,f(A(i.value.tokenUsage.input)),1)]),n("div",gu,[T[8]||(T[8]=n("span",{class:"item-label"},"Token 输出",-1)),n("span",mu,f(A(i.value.tokenUsage.output)),1)])])):M("",!0),i.value.toolCallCount>0?(c(),d("div",_u,[T[9]||(T[9]=n("div",{class:"section-label"},"工具调用",-1)),n("div",yu,f(i.value.toolCallCount)+" 次",1)])):M("",!0),i.value.artifacts&&i.value.artifacts.length>0?(c(),d("div",bu,[T[10]||(T[10]=n("div",{class:"section-label"},"产出物",-1)),n("div",$u,[(c(!0),d(Y,null,ct(i.value.artifacts,k=>(c(),d("div",{key:k,class:"artifact-item"}," 📄 "+f(k),1))),128))])])):M("",!0)])])):M("",!0)]))])}}}),wu=Ct(ku,[["__scopeId","data-v-5e7f751f"]]),Cu={class:"agent-config-panel"},Tu={class:"header"},Su=["disabled"],xu={key:0,class:"loading-state"},Au={key:1,class:"error-state"},Iu={key:2,class:"config-content"},Mu={class:"config-section"},Ru={class:"info-grid"},Eu={class:"info-item"},Pu={class:"value monospace"},Du={class:"info-item"},Fu={class:"value"},Ou={class:"info-item full-width"},Lu={class:"value monospace"},Nu={class:"info-item"},ju={class:"config-section"},Uu={class:"model-config"},Vu={class:"model-field"},Wu={class:"model-select-wrapper"},Hu=["disabled"],Bu=["label"],Ku=["value"],qu={key:0,class:"current-model"},Gu={class:"model-field"},zu={class:"fallbacks-list"},Ju=["onUpdate:modelValue","disabled"],Qu=["label"],Yu=["value"],Xu=["onClick","disabled"],Zu=["disabled"],td={class:"model-actions"},ed=["disabled"],sd=["disabled"],nd={key:0,class:"config-section"},ld={class:"description-text"},id=wt({__name:"AgentConfigPanel",props:{agentId:{}},setup(t){const e=t,s=j(null),l=j([]),i=j(!1),o=j(!1),a=j(""),r=j(""),u=j([]),v=Q(()=>{const k={};for(const b of l.value)k[b.provider]||(k[b.provider]=[]),k[b.provider].push(b);return Object.entries(k).map(([b,R])=>({provider:b,models:R}))}),p=Q(()=>{var b;if(!((b=s.value)!=null&&b.model))return!1;const k=s.value.model;return r.value!==k.primary||JSON.stringify(u.value.filter(R=>R))!==JSON.stringify(k.fallbacks||[])});function C(k){return{idle:"空闲",working:"工作中",down:"异常"}[k]||k}function A(k){if(!k)return"";const b=k.split("/");return b.length>1?b[b.length-1]:k}async function S(){var k;i.value=!0,a.value="";try{const[b,R]=await Promise.all([fetch(`/api/agent-config/${e.agentId}`),fetch("/api/available-models")]);if(b.ok?(s.value=await b.json(),(k=s.value)!=null&&k.model&&(r.value=s.value.model.primary||"",u.value=[...s.value.model.fallbacks||[]])):a.value="加载配置失败",R.ok){const K=await R.json();l.value=K.models||[]}}catch(b){a.value="加载失败: "+b.message}finally{i.value=!1}}function m(){u.value.length<3&&u.value.push("")}function T(k){u.value.splice(k,1)}function D(){var k;(k=s.value)!=null&&k.model&&(r.value=s.value.model.primary||"",u.value=[...s.value.model.fallbacks||[]])}async function $(){if(p.value){o.value=!0;try{const k=await fetch(`/api/agent-config/${e.agentId}/model`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({primary:r.value||null,fallbacks:u.value.filter(b=>b)||null})});if(k.ok){const b=await k.json();s.value&&b.model&&(s.value.model=b.model),alert("模型配置已保存!重启 Agent 后生效。")}else{const b=await k.json();alert("保存失败: "+(b.detail||"未知错误"))}}catch(k){alert("保存失败: "+k.message)}finally{o.value=!1}}}return Bt(()=>e.agentId,()=>{S()},{immediate:!0}),Nt(()=>{S()}),(k,b)=>{var R;return c(),d("div",Cu,[n("div",Tu,[b[1]||(b[1]=n("h3",null,"⚙️ Agent 配置",-1)),n("button",{class:"refresh-btn",onClick:S,disabled:i.value},f(i.value?"加载中...":"刷新"),9,Su)]),i.value&&!s.value?(c(),d("div",xu," 加载配置... ")):a.value?(c(),d("div",Au,f(a.value),1)):s.value?(c(),d("div",Iu,[n("div",Mu,[b[6]||(b[6]=n("h4",null,"基本信息",-1)),n("div",Ru,[n("div",Eu,[b[2]||(b[2]=n("span",{class:"label"},"ID",-1)),n("span",Pu,f(s.value.id),1)]),n("div",Du,[b[3]||(b[3]=n("span",{class:"label"},"名称",-1)),n("span",Fu,f(s.value.name),1)]),n("div",Ou,[b[4]||(b[4]=n("span",{class:"label"},"工作区",-1)),n("span",Lu,f(s.value.workspace||"未设置"),1)]),n("div",Nu,[b[5]||(b[5]=n("span",{class:"label"},"状态",-1)),n("span",{class:nt(["value",`status-${s.value.status}`])},f(C(s.value.status)),3)])])]),n("div",ju,[b[11]||(b[11]=n("h4",null,"模型配置",-1)),n("div",Uu,[n("div",Vu,[b[8]||(b[8]=n("label",null,"主模型 (Primary)",-1)),n("div",Wu,[Tt(n("select",{"onUpdate:modelValue":b[0]||(b[0]=K=>r.value=K),disabled:o.value,class:"model-select"},[b[7]||(b[7]=n("option",{value:""},"-- 选择模型 --",-1)),(c(!0),d(Y,null,ct(v.value,K=>(c(),d("optgroup",{key:K.provider,label:K.provider},[(c(!0),d(Y,null,ct(K.models,x=>(c(),d("option",{key:x.id,value:x.id},f(x.name),9,Ku))),128))],8,Bu))),128))],8,Hu),[[Pe,r.value]]),(R=s.value.model)!=null&&R.primary?(c(),d("span",qu," 当前: "+f(A(s.value.model.primary)),1)):M("",!0)])]),n("div",Gu,[b[10]||(b[10]=n("label",null,"备选模型 (Fallbacks)",-1)),n("div",zu,[(c(!0),d(Y,null,ct(u.value,(K,x)=>(c(),d("div",{key:x,class:"fallback-item"},[Tt(n("select",{"onUpdate:modelValue":F=>u.value[x]=F,disabled:o.value,class:"model-select small"},[b[9]||(b[9]=n("option",{value:""},"-- 选择 --",-1)),(c(!0),d(Y,null,ct(v.value,F=>(c(),d("optgroup",{key:F.provider,label:F.provider},[(c(!0),d(Y,null,ct(F.models,X=>(c(),d("option",{key:X.id,value:X.id},f(X.name),9,Yu))),128))],8,Qu))),128))],8,Ju),[[Pe,u.value[x]]]),n("button",{class:"remove-btn",onClick:F=>T(x),disabled:o.value},"×",8,Xu)]))),128)),n("button",{class:"add-fallback-btn",onClick:m,disabled:o.value||u.value.length>=3}," + 添加备选模型 ",8,Zu)])]),n("div",td,[n("button",{class:"save-btn",onClick:$,disabled:o.value||!p.value},f(o.value?"保存中...":"保存修改"),9,ed),n("button",{class:"reset-btn",onClick:D,disabled:o.value}," 重置 ",8,sd)])])]),s.value.description?(c(),d("div",nd,[b[12]||(b[12]=n("h4",null,"描述",-1)),n("p",ld,f(s.value.description),1)])):M("",!0)])):M("",!0)])}}}),od=Ct(id,[["__scopeId","data-v-c0a2c245"]]),ad={class:"error-analysis-view"},rd={class:"header"},cd=["disabled"],ud={key:0,class:"agent-summary"},dd={class:"summary-card total"},fd={class:"count"},hd={key:0,class:"summary-card critical"},pd={class:"count"},vd={key:1,class:"summary-card high"},gd={class:"count"},md={key:2,class:"summary-card medium"},_d={class:"count"},yd={key:1,class:"loading-state"},bd={key:2,class:"empty-state"},$d={key:3,class:"errors-list"},kd=["onClick"],wd={class:"error-header"},Cd={class:"error-badges"},Td={key:0,class:"badge archived",title:"已归档的子任务"},Sd={key:1,class:"badge provider"},xd={key:2,class:"badge model"},Ad={class:"error-time"},Id={class:"error-message"},Md={key:0,class:"error-detail"},Rd={class:"detail-section"},Ed={class:"error-full"},Pd={key:0,class:"detail-section"},Dd={class:"tool-chain"},Fd={class:"tool-index"},Od={class:"tool-name"},Ld={class:"tool-time"},Nd={key:1,class:"detail-section"},jd={class:"suggestions"},Ud={class:"detail-section meta"},Vd={key:4,class:"type-summary"},Wd={class:"type-bars"},Hd={class:"type-label"},Bd={class:"bar-container"},Kd={class:"type-count"},qd=wt({__name:"ErrorAnalysisView",props:{agentId:{}},setup(t){const e=t,s=j([]),l=j(null),i=j(!1),o=j(new Set),a={api_auth:"API 认证",api_rate_limit:"API 限流",api_model:"模型错误",timeout:"超时",permission:"权限错误",tool_error:"工具错误",subagent:"子任务错误",network:"网络错误",unknown:"未知"};function r(S){return a[S]||S}function u(S){return S?new Date(S).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function v(S,m){return!S||S.length<=m?S||"":S.slice(0,m)+"..."}function p(S,m){return m?Math.round(S/m*100)+"%":"0%"}function C(S){o.value.has(S)?o.value.delete(S):o.value.add(S),o.value=new Set(o.value)}async function A(){if(e.agentId){i.value=!0;try{const S=await fetch(`/api/error-analysis/${e.agentId}?session_limit=5`);if(S.ok){const m=await S.json();s.value=m.errors||[],l.value=m.summary||null}}catch(S){console.error("Failed to load error analysis:",S)}finally{i.value=!1}}}return Bt(()=>e.agentId,()=>{A()},{immediate:!0}),Nt(()=>{A()}),(S,m)=>{var T,D,$,k;return c(),d("div",ad,[n("div",rd,[m[0]||(m[0]=n("h3",null,"🔍 错误分析",-1)),n("button",{class:"refresh-btn",onClick:A,disabled:i.value},f(i.value?"分析中...":"刷新"),9,cd)]),l.value?(c(),d("div",ud,[n("div",dd,[n("span",fd,f(l.value.total||0),1),m[1]||(m[1]=n("span",{class:"label"},"错误数",-1))]),(T=l.value.bySeverity)!=null&&T.critical?(c(),d("div",hd,[n("span",pd,f(l.value.bySeverity.critical),1),m[2]||(m[2]=n("span",{class:"label"},"严重",-1))])):M("",!0),(D=l.value.bySeverity)!=null&&D.high?(c(),d("div",vd,[n("span",gd,f(l.value.bySeverity.high),1),m[3]||(m[3]=n("span",{class:"label"},"高",-1))])):M("",!0),($=l.value.bySeverity)!=null&&$.medium?(c(),d("div",md,[n("span",_d,f(l.value.bySeverity.medium),1),m[4]||(m[4]=n("span",{class:"label"},"中",-1))])):M("",!0)])):M("",!0),i.value&&!s.value.length?(c(),d("div",yd," 正在分析错误... ")):s.value.length?(c(),d("div",$d,[(c(!0),d(Y,null,ct(s.value,(b,R)=>{var K,x;return c(),d("div",{key:R,class:nt(["error-item",`severity-${b.severity}`]),onClick:F=>C(R)},[n("div",wd,[n("span",{class:"error-type",style:St({color:b.severityColor})},f(b.severityLabel)+" - "+f(b.errorTypeLabel),5),n("div",Cd,[b.isArchived?(c(),d("span",Td,"📦 归档")):M("",!0),b.provider?(c(),d("span",Sd,f(b.provider),1)):M("",!0),b.model?(c(),d("span",xd,f(b.model),1)):M("",!0)]),n("span",Ad,f(u(b.timestamp)),1)]),n("div",Id,f(v(b.rawMessage,150)),1),o.value.has(R)?(c(),d("div",Md,[n("div",Rd,[m[5]||(m[5]=n("h4",null,"错误信息",-1)),n("pre",Ed,f(b.rawMessage||"无详细信息"),1)]),(K=b.toolChain)!=null&&K.length?(c(),d("div",Pd,[m[6]||(m[6]=n("h4",null,"工具调用链(错误前)",-1)),n("div",Dd,[(c(!0),d(Y,null,ct(b.toolChain,(F,X)=>(c(),d("div",{key:X,class:"tool-item"},[n("span",Fd,f(X+1),1),n("span",Od,f(F.toolName),1),n("span",Ld,f(u(F.timestamp)),1)]))),128))])])):M("",!0),(x=b.suggestions)!=null&&x.length?(c(),d("div",Nd,[m[7]||(m[7]=n("h4",null,"修复建议",-1)),n("ul",jd,[(c(!0),d(Y,null,ct(b.suggestions,(F,X)=>(c(),d("li",{key:X},f(F),1))),128))])])):M("",!0),n("div",Ud,[n("span",null,"Session: "+f(b.sessionFile),1),n("span",null,"Turn: "+f(b.turnIndex),1)])])):M("",!0)],10,kd)}),128))])):(c(),d("div",bd," ✅ 暂无错误记录 ")),(k=l.value)!=null&&k.byType&&Object.keys(l.value.byType).length>0?(c(),d("div",Vd,[m[8]||(m[8]=n("h4",null,"错误类型分布",-1)),n("div",Wd,[(c(!0),d(Y,null,ct(l.value.byType,(b,R)=>(c(),d("div",{key:R,class:"type-bar"},[n("span",Hd,f(r(R)),1),n("div",Bd,[n("div",{class:"bar-fill",style:St({width:p(b,l.value.total)})},null,4)]),n("span",Kd,f(b),1)]))),128))])])):M("",!0)])}}}),Gd=Ct(qd,[["__scopeId","data-v-bc05715d"]]),zd={class:"header"},Jd={class:"content"},Qd={class:"section"},Yd={class:"status-info"},Xd={class:"status-text"},Zd={key:0,class:"section"},tf={key:1,class:"section"},ef={key:2,class:"section"},sf={class:"error-info"},nf={class:"error-type"},lf={class:"error-message"},of={key:3,class:"section"},af={class:"diagnostic-header"},rf={class:"diagnostic-icon"},cf={class:"diagnostic-title"},uf={class:"diagnostic-content"},df={class:"diagnostic-item"},ff={class:"item-value highlight"},hf={key:0,class:"diagnostic-item"},pf={class:"item-value"},vf={key:1,class:"diagnostic-item"},gf={class:"item-value"},mf={class:"diagnostic-actions"},_f={class:"section"},yf={class:"activity-list"},bf={key:0,class:"activity-item working"},$f={key:1,class:"activity-item idle"},kf={key:2,class:"activity-item down"},wf={class:"section"},Cf={class:"view-tabs"},Tf={key:0,class:"timeline-container"},Sf={key:1,class:"chain-container"},xf={key:2,class:"advanced-container"},Af={class:"advanced-section"},If={class:"advanced-section"},Mf=5*60*1e3,Rf=15*60*1e3,Ef=wt({__name:"AgentDetailPanel",props:{agent:{}},emits:["close"],setup(t){const e=t,s=j("timeline"),l=j(null),i=j(Date.now());let o=null;const a=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[e.agent.status]||"未知"),r=Q(()=>{if(e.agent.status!=="working")return null;const D=e.agent.lastActiveAt||0,$=i.value-D;return $>Rf?{isStuck:!0,idleMinutes:Math.floor($/6e4),severity:"critical",label:"严重卡顿"}:$>Mf?{isStuck:!0,idleMinutes:Math.floor($/6e4),severity:"warning",label:"可能卡顿"}:null}),u=Q(()=>{var b;if(!((b=l.value)!=null&&b.archiveAtMs))return null;const D=l.value.archiveAtMs-i.value;if(D<=0)return"即将超时";const $=Math.floor(D/6e4),k=Math.floor(D%6e4/1e3);return`${$}分${k}秒`}),v=Q(()=>{if(!p.value.length)return null;const D=p.value[p.value.length-1];if(D.role==="toolResult"){const $=D.content[0];if($){const k=$.text||$.content||"";return{tool:D.toolName||"未知工具",status:$.status||"completed",result:k.slice(0,100)||"(无输出)"}}}return null}),p=j([]),C=j(!1);async function A(){var D;if((D=e.agent)!=null&&D.id){C.value=!0;try{const $=await fetch(`/api/agents/${e.agent.id}/output?limit=30`);if($.ok){const k=await $.json();p.value=k.turns||[]}else p.value=[]}catch{p.value=[]}finally{C.value=!1}}}async function S(){if(e.agent.status!=="working"){l.value=null;return}try{const D=await fetch("/api/chains?limit=10");if(D.ok){const k=(await D.json()).activeChain;if(k!=null&&k.nodes){const b=k.nodes.find(R=>R.agentId===e.agent.id);b&&b.status==="running"&&(l.value={runId:k.chainId,status:"running",startedAt:b.startedAt,archiveAtMs:k.archiveAtMs})}}}catch{}}async function m(){var D;if((D=l.value)!=null&&D.runId&&confirm("确定要取消这个任务吗?"))try{alert("取消功能需要 OpenClaw 支持,请使用命令行: openclaw subagents cancel "+l.value.runId)}catch($){console.error("Cancel failed:",$)}}function T(){A(),S()}return Bt(()=>{var D;return(D=e.agent)==null?void 0:D.id},()=>{A(),S()},{immediate:!0}),Bt(()=>e.agent.status,S),Nt(()=>{o=setInterval(()=>{i.value=Date.now()},1e3)}),ae(()=>{o&&(clearInterval(o),o=null)}),(D,$)=>(c(),d("div",{class:"panel-overlay",onClick:$[5]||($[5]=k=>D.$emit("close"))},[n("div",{class:"panel",onClick:$[4]||($[4]=le(()=>{},["stop"]))},[n("div",zd,[n("h2",null,f(t.agent.name),1),n("button",{class:"close-btn",onClick:$[0]||($[0]=k=>D.$emit("close"))},"×")]),n("div",Jd,[n("div",Qd,[$[6]||($[6]=n("h3",null,"状态",-1)),n("div",Yd,[n("span",{class:nt(["status-dot",`status-${t.agent.status}`])},null,2),n("span",Xd,f(a.value),1)])]),t.agent.currentTask?(c(),d("div",Zd,[$[7]||($[7]=n("h3",null,"当前任务",-1)),n("p",null,f(t.agent.currentTask),1)])):M("",!0),t.agent.lastActiveFormatted?(c(),d("div",tf,[$[8]||($[8]=n("h3",null,"最后活跃",-1)),n("p",null,f(t.agent.lastActiveFormatted),1)])):M("",!0),t.agent.error?(c(),d("div",ef,[$[9]||($[9]=n("h3",{class:"error-title"},"错误信息",-1)),n("div",sf,[n("div",nf,f(t.agent.error.type),1),n("div",lf,f(t.agent.error.message),1)])])):M("",!0),r.value?(c(),d("div",of,[n("div",{class:nt(["diagnostic-panel",`severity-${r.value.severity}`])},[n("div",af,[n("span",rf,f(r.value.severity==="critical"?"🚨":"⚠️"),1),n("span",cf,f(r.value.label)+"检测",1)]),n("div",uf,[n("div",df,[$[10]||($[10]=n("span",{class:"item-label"},"无响应时间:",-1)),n("span",ff,f(r.value.idleMinutes)+" 分钟",1)]),v.value?(c(),d("div",hf,[$[11]||($[11]=n("span",{class:"item-label"},"最后操作:",-1)),n("span",pf,f(v.value.tool)+" → "+f(v.value.result),1)])):M("",!0),u.value?(c(),d("div",vf,[$[12]||($[12]=n("span",{class:"item-label"},"自动超时:",-1)),n("span",gf,f(u.value),1)])):M("",!0),$[13]||($[13]=n("div",{class:"diagnostic-hint"},[n("div",{class:"hint-title"},"可能原因:"),n("ul",null,[n("li",null,"LLM API 响应超时"),n("li",null,"网络连接问题"),n("li",null,"API 配额限制")])],-1)),n("div",mf,[l.value?(c(),d("button",{key:0,class:"action-btn primary",onClick:m}," 取消任务 ")):M("",!0),n("button",{class:"action-btn",onClick:T}," 刷新状态 ")])])],2)])):M("",!0),n("div",_f,[$[14]||($[14]=n("h3",null,"最近活动",-1)),n("div",yf,[t.agent.status==="working"?(c(),d("div",bf," 💼 正在执行任务... ")):t.agent.status==="idle"?(c(),d("div",$f," 😴 空闲中 ")):t.agent.status==="down"?(c(),d("div",kf," ⚠️ 检测到错误 ")):M("",!0)])]),n("div",wf,[n("div",Cf,[n("button",{class:nt(["tab-btn",{active:s.value==="timeline"}]),onClick:$[1]||($[1]=k=>s.value="timeline")}," 📊 时序视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="chain"}]),onClick:$[2]||($[2]=k=>s.value="chain")}," 🔗 链路视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="advanced"}]),onClick:$[3]||($[3]=k=>s.value="advanced")}," ⚙️ 高级 ",2)]),s.value==="timeline"?(c(),d("div",Tf,[bt(rs(kc),{agentId:t.agent.id,autoRefresh:!1},null,8,["agentId"])])):s.value==="chain"?(c(),d("div",Sf,[bt(rs(wu),{autoRefresh:!0,refreshInterval:10})])):s.value==="advanced"?(c(),d("div",xf,[n("div",Af,[$[15]||($[15]=n("h4",null,"⚙️ 配置",-1)),bt(od,{agentId:t.agent.id},null,8,["agentId"])]),n("div",If,[$[16]||($[16]=n("h4",null,"🔍 错误分析",-1)),bt(Gd,{agentId:t.agent.id},null,8,["agentId"])])])):M("",!0)])])])]))}}),Pf=Ct(Ef,[["__scopeId","data-v-aec763c1"]]),Df={class:"settings-panel"},Ff={class:"header"},Of={class:"content"},Lf={class:"setting-item"},Nf={class:"setting-item"},jf={class:"setting-item"},Uf={class:"setting-item"},Vf={class:"setting-item"},Wf={class:"setting-item"},Hf={class:"setting-item"},Bf={class:"setting-item"},Kf=wt({__name:"SettingsPanel",emits:["close"],setup(t,{emit:e}){const s=e,l=j(10),i=j(!0),o=j(!0),a=j(!0),r=j(!0),u=j(!1),v=j(100),p=j(!0);function C(){const S=localStorage.getItem("dashboard-settings");if(S)try{const m=JSON.parse(S);l.value=m.refreshInterval||10,i.value=m.autoRefreshEnabled!==!1,o.value=m.showTimestamps!==!1,a.value=m.showTokens!==!1,r.value=m.notifyOnError!==!1,u.value=m.notifyOnComplete||!1,v.value=m.logLines||100,p.value=m.autoScrollLog!==!1}catch(m){console.error("加载设置失败:",m)}}function A(){const S={refreshInterval:l.value,autoRefreshEnabled:i.value,showTimestamps:o.value,showTokens:a.value,notifyOnError:r.value,notifyOnComplete:u.value,logLines:v.value,autoScrollLog:p.value};localStorage.setItem("dashboard-settings",JSON.stringify(S)),s("settings-changed",S)}return Nt(()=>{C()}),(S,m)=>(c(),d("div",Df,[n("div",Ff,[m[9]||(m[9]=n("h2",null,"设置",-1)),n("button",{class:"close-btn",onClick:m[0]||(m[0]=T=>S.$emit("close"))},"×")]),n("div",Of,[n("section",null,[m[12]||(m[12]=n("h3",null,"自动刷新",-1)),n("div",Lf,[m[10]||(m[10]=n("label",null,"刷新间隔(秒)",-1)),Tt(n("input",{type:"number","onUpdate:modelValue":m[1]||(m[1]=T=>l.value=T),min:"1",max:"300",onChange:A},null,544),[[jn,l.value,void 0,{number:!0}]])]),n("div",Nf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[2]||(m[2]=T=>i.value=T),onChange:A},null,544),[[Oe,i.value]]),m[11]||(m[11]=At(" 启用自动刷新 ",-1))])])]),n("section",null,[m[15]||(m[15]=n("h3",null,"显示选项",-1)),n("div",jf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[3]||(m[3]=T=>o.value=T),onChange:A},null,544),[[Oe,o.value]]),m[13]||(m[13]=At(" 显示时间戳 ",-1))])]),n("div",Uf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[4]||(m[4]=T=>a.value=T),onChange:A},null,544),[[Oe,a.value]]),m[14]||(m[14]=At(" 显示 Token 消耗 ",-1))])])]),n("section",null,[m[18]||(m[18]=n("h3",null,"通知",-1)),n("div",Vf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[5]||(m[5]=T=>r.value=T),onChange:A},null,544),[[Oe,r.value]]),m[16]||(m[16]=At(" Agent 异常时通知 ",-1))])]),n("div",Wf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[6]||(m[6]=T=>u.value=T),onChange:A},null,544),[[Oe,u.value]]),m[17]||(m[17]=At(" 任务完成时通知 ",-1))])])]),n("section",null,[m[22]||(m[22]=n("h3",null,"日志查看",-1)),n("div",Hf,[m[20]||(m[20]=n("label",null,"日志行数",-1)),Tt(n("select",{"onUpdate:modelValue":m[7]||(m[7]=T=>v.value=T),onChange:A},[...m[19]||(m[19]=[n("option",{value:50},"50 行",-1),n("option",{value:100},"100 行",-1),n("option",{value:200},"200 行",-1),n("option",{value:500},"500 行",-1)])],544),[[Pe,v.value]])]),n("div",Bf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":m[8]||(m[8]=T=>p.value=T),onChange:A},null,544),[[Oe,p.value]]),m[21]||(m[21]=At(" 自动滚动日志 ",-1))])])])])]))}}),qf=Ct(Kf,[["__scopeId","data-v-e5b26232"]]);function Gf(t,e=300){const s=j(null);let l=null;const i=(...r)=>{l=r,s.value&&clearTimeout(s.value),s.value=setTimeout(()=>{t(...r),s.value=null,l=null},e)},o=()=>{s.value&&(clearTimeout(s.value),s.value=null,l=null)},a=()=>{s.value&&l&&(clearTimeout(s.value),t(...l),s.value=null,l=null)};return ae(()=>{o()}),{debouncedFn:i,cancel:o,flush:a}}class zf{constructor(e={}){this.ws=null,this.connectionState={status:"disconnected",reconnectAttempts:0},this.subscribers=new Map,this.reconnectTimer=null,this.pollingTimer=null,this.heartbeatTimer=null,this.stateListeners=new Set,this.options={wsUrl:e.wsUrl||`ws://${window.location.host}/ws`,httpFallback:e.httpFallback??!0,reconnectMaxAttempts:e.reconnectMaxAttempts??5,reconnectDelay:e.reconnectDelay??3e3,pollingInterval:e.pollingInterval??1e4}}connect(){var e;if(((e=this.ws)==null?void 0:e.readyState)!==WebSocket.OPEN){this.updateConnectionState({status:"connecting",reconnectAttempts:this.connectionState.reconnectAttempts});try{this.ws=new WebSocket(this.options.wsUrl),this.ws.onopen=()=>{this.updateConnectionState({status:"connected",lastConnected:Date.now(),reconnectAttempts:0}),this.startHeartbeat(),this.stopPolling()},this.ws.onclose=()=>{this.stopHeartbeat(),this.handleDisconnect()},this.ws.onerror=s=>{console.error("WebSocket error:",s),this.updateConnectionState({status:"error",errorMessage:"WebSocket connection failed"}),this.handleDisconnect()},this.ws.onmessage=s=>{try{const l=JSON.parse(s.data);this.handleMessage(l)}catch(l){console.error("Failed to parse WebSocket message:",l)}}}catch(s){console.error("Failed to create WebSocket:",s),this.handleDisconnect()}}}disconnect(){this.stopHeartbeat(),this.stopReconnect(),this.stopPolling(),this.ws&&(this.ws.close(),this.ws=null),this.updateConnectionState({status:"disconnected",reconnectAttempts:0})}getConnectionState(){return{...this.connectionState}}subscribe(e,s){return this.subscribers.has(e)||this.subscribers.set(e,new Set),this.subscribers.get(e).add(s),()=>{var l;(l=this.subscribers.get(e))==null||l.delete(s)}}onStateChange(e){return this.stateListeners.add(e),()=>{this.stateListeners.delete(e)}}isConnected(){return this.connectionState.status==="connected"}async fetchInitialData(){try{const[e,s,l,i]=await Promise.all([fetch("/api/collaboration").then(o=>o.json()).catch(()=>null),fetch("/api/tasks").then(o=>o.json()).catch(()=>null),fetch("/api/performance?range=20m").then(o=>o.json()).catch(()=>null),fetch("/api/agents").then(o=>o.json()).catch(()=>null)]);e&&this.emit("collaboration",e),s&&this.emit("tasks",s),l&&this.emit("performance",l),i&&this.emit("agents",i)}catch(e){console.error("Failed to fetch initial data:",e)}}handleMessage(e){if(e.type==="ping"){this.send({type:"pong",timestamp:Date.now()});return}if(e.type==="full_state"&&e.data){const s=e.data;s.agents&&this.emit("agents",s.agents),s.subagents&&this.emit("subagents",s.subagents),s.collaboration&&this.emit("collaboration",s.collaboration);const l=Array.isArray(s.tasks)?s.tasks:[];this.emit("tasks",{tasks:l}),s.performance&&this.emit("performance",s.performance);return}if(e.type==="state_update"&&e.data){const s=e.data;s.agents&&this.emit("agents_update",s.agents);return}e.channel&&e.data&&this.emit(e.channel,e.data)}emit(e,s){const l=this.subscribers.get(e);l&&l.forEach(i=>{try{i(s)}catch(o){console.error(`Error in subscriber callback for ${e}:`,o)}})}send(e){var s;((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handleDisconnect(){this.connectionState.reconnectAttempts<this.options.reconnectMaxAttempts?this.scheduleReconnect():this.options.httpFallback&&this.startPolling()}scheduleReconnect(){this.stopReconnect();const e=this.options.reconnectDelay*Math.pow(1.5,this.connectionState.reconnectAttempts);this.reconnectTimer=setTimeout(()=>{this.updateConnectionState({status:"connecting",reconnectAttempts:this.connectionState.reconnectAttempts+1}),this.connect()},e)}stopReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.send({type:"ping",timestamp:Date.now()})},3e4)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}startPolling(){this.stopPolling(),this.updateConnectionState({status:"connected",errorMessage:"Using HTTP polling fallback"}),this.fetchInitialData(),this.pollingTimer=setInterval(()=>{this.fetchInitialData()},this.options.pollingInterval)}stopPolling(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)}updateConnectionState(e){this.connectionState={...this.connectionState,...e},this.stateListeners.forEach(s=>{try{s(this.connectionState)}catch(l){console.error("Error in state listener:",l)}})}}let tn=null;function Fi(t){return tn||(tn=new zf(t)),tn}class Jf{constructor(){this.state=new Map,this.cache=new Map,this.defaultTTL=5e3}getState(e){const s=this.state.get(e);return s==null?void 0:s.value}setState(e,s){const l=this.state.get(e);l?l.value=s:this.state.set(e,j(s))}useStore(e,s){const l=this.state.get(e);if(l)return l;const i=j(s);return this.state.set(e,i),i}getCache(e){const s=this.cache.get(e);if(s){if(Date.now()>s.expiresAt){this.cache.delete(e);return}return s.value}}setCache(e,s,l){this.cache.set(e,{value:s,expiresAt:Date.now()+(l??this.defaultTTL)})}hasValidCache(e){const s=this.cache.get(e);return s?Date.now()<=s.expiresAt:!1}invalidateCache(e){this.cache.delete(e)}batchUpdate(e){Object.entries(e).forEach(([s,l])=>{this.setState(s,l)})}clearAll(){this.state.clear(),this.cache.clear()}clearCache(){this.cache.clear()}}let en=null;function Qf(){return en||(en=new Jf),en}class Yf{constructor(){this.listeners=new Map,this.eventQueue=[],this.isFlushing=!1,this.maxQueueSize=100}emit(e,s){const l=this.listeners.get(e);l&&l.forEach(i=>{try{i(s)}catch(o){console.error(`Error in event handler for ${e}:`,o)}})}on(e,s){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(s),()=>{var l;(l=this.listeners.get(e))==null||l.delete(s)}}once(e,s){const l=i=>{this.off(e,l),s(i)};this.on(e,l)}off(e,s){var l;(l=this.listeners.get(e))==null||l.delete(s)}enqueue(e,s){this.eventQueue.length>=this.maxQueueSize&&(console.warn("Event queue is full, dropping oldest event"),this.eventQueue.shift()),this.eventQueue.push({event:e,payload:s})}flush(){if(!this.isFlushing){this.isFlushing=!0;try{for(;this.eventQueue.length>0;){const{event:e,payload:s}=this.eventQueue.shift();this.emit(e,s)}}finally{this.isFlushing=!1}}}getQueueLength(){return this.eventQueue.length}clearQueue(){this.eventQueue=[]}clearAll(){this.listeners.clear(),this.eventQueue=[]}}let sn=null;function Xf(){return sn||(sn=new Yf),sn}function Oi(){const t=Fi(),e=j(t.getConnectionState()),s=j(!1);let l=null;const i=(r,u)=>t.subscribe(r,u),o=()=>{t.connect()},a=()=>{t.disconnect()};return Nt(()=>{l=t.onStateChange(r=>{e.value=r,s.value=r.status==="connected"}),t.isConnected()||t.connect()}),ae(()=>{l&&l()}),{connectionState:e,isConnected:s,subscribe:i,connect:o,disconnect:a}}const Zf={class:"indicator-icon"},th={key:0,class:"indicator-count"},eh={class:"card-header"},sh={class:"avatar"},nh={class:"header-info"},lh={class:"name"},ih={class:"status-text"},oh={key:0,class:"main-badge"},ah={class:"card-body"},rh={key:0,class:"model-row"},ch={class:"model-value"},uh=["title"],dh={key:0,class:"fallback-more"},fh={key:1,class:"current-task"},hh=["title"],ph={key:0,class:"task-child-info"},vh={class:"child-name"},gh={key:2,class:"multi-tasks"},mh={class:"tasks-count"},_h={class:"tasks-toggle"},yh=["title"],bh={key:0,class:"task-child-agent"},$h={key:0,class:"tasks-more"},kh={class:"action-icon"},wh={class:"action-text"},Ch={key:4,class:"idle-hint"},Th={class:"warning-modal"},Sh={class:"modal-header"},xh={class:"modal-icon"},Ah={class:"modal-title"},Ih={class:"modal-body"},Mh={class:"detail-row"},Rh={class:"detail-value error-type-tag"},Eh={class:"detail-row"},Ph={class:"detail-value"},Dh={class:"detail-row"},Fh={class:"detail-value highlight"},Oh={key:0,class:"detail-row"},Lh={class:"detail-value"},Nh={key:1,class:"detail-row"},jh={class:"detail-value"},Uh={key:2,class:"detail-row"},Vh={key:0,class:"waiting-task"},Wh={key:3,class:"stuck-suggestion"},Hh=wt({__name:"AgentCard",props:{agent:{},modelInfo:{},isMain:{type:Boolean},currentTask:{},error:{},stuckWarning:{},hierarchyDepth:{},agentColor:{},subStatus:{},currentAction:{},toolName:{},waitingFor:{},agentTasks:{}},emits:["click","navigate-agent"],setup(t,{emit:e}){const s=t,l=e,i=j(!1),o=j(!1),a=["🤖","👤","📊","🏗️","💻","🧪","🔧","📋","🎯","⚙️"],r=Q(()=>{const x=(s.agent.name||"").toLowerCase();if(x.includes("pm")||x.includes("project")||x.includes("主"))return"👨‍💼";if(x.includes("analyst")||x.includes("分析"))return"📊";if(x.includes("architect")||x.includes("架构"))return"🏗️";if(x.includes("dev")||x.includes("开发"))return"💻";if(x.includes("qa")||x.includes("test")||x.includes("测试"))return"🧪";if(x.includes("ops")||x.includes("运维"))return"🔧";if(x.includes("frontend")||x.includes("前端"))return"🎨";if(x.includes("backend")||x.includes("后端"))return"⚙️";let F=0;for(let X=0;X<x.length;X++)F=(F<<5)-F+x.charCodeAt(X);return a[Math.abs(F)%a.length]}),u=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[s.agent.status]||"未知"),v=Q(()=>{var x;return((x=s.agentTasks)==null?void 0:x.length)||0}),p=Q(()=>s.isMain&&v.value>=2),C=Q(()=>s.agentTasks?s.agentTasks.slice(0,3):[]),A=Q(()=>s.agentTasks?Math.max(0,s.agentTasks.length-3):0),S=Q(()=>s.agentTasks&&s.agentTasks.length===1?s.agentTasks[0].name:s.currentTask),m=Q(()=>{if(s.agentTasks&&s.agentTasks.length===1)return s.agentTasks[0].childAgentId}),T=Q(()=>({thinking:"🧠",tool_executing:"⚙️",waiting_llm:"📡",waiting_child:"⏳"})[s.subStatus||""]||"🔄"),D=Q(()=>{var F;return{"rate-limit":"请求过快","token-limit":"Token 超限",timeout:"请求超时",quota:"余额不足",unknown:"发生错误"}[((F=s.error)==null?void 0:F.type)||"unknown"]||"发生错误"}),$=Q(()=>{var F;return{waiting_for_child:"等待子代理响应",self_busy:"自身处理中",unknown:"原因未明"}[((F=s.stuckWarning)==null?void 0:F.reason)||"unknown"]||"原因未明"}),k=Q(()=>{if(!s.stuckWarning)return null;const x=s.stuckWarning.reason,F=s.stuckWarning.idleSeconds;return x==="waiting_for_child"?F>180?"子代理响应时间过长,建议检查子代理状态或考虑终止任务":"子代理正在执行任务,请耐心等待":x==="self_busy"?F>120?"任务处理时间过长,可能遇到复杂问题或外部资源阻塞":"正在处理复杂任务,请稍候":null});function b(x){const F=x.split("/");return F[F.length-1]||x}function R(){i.value=!0}function K(x){l("navigate-agent",x),i.value=!1}return(x,F)=>{var X;return c(),d("div",{class:nt(["agent-card",[`status-${t.agent.status}`,{"is-main":t.isMain}]]),onClick:F[4]||(F[4]=H=>x.$emit("click"))},[t.error||t.stuckWarning?(c(),d("div",{key:0,class:nt(["warning-indicator",{"has-error":t.error}]),onClick:le(R,["stop"])},[n("span",Zf,f(t.error?"⚠️":"⏳"),1),t.stuckWarning?(c(),d("span",th,f(t.stuckWarning.idleSeconds)+"s",1)):M("",!0)],2)):M("",!0),n("div",eh,[n("div",sh,f(r.value),1),n("div",nh,[n("div",lh,f(t.agent.name),1),n("div",{class:nt(["status-pill",`status-${t.agent.status}`])},[n("span",{class:nt(["status-dot",`status-${t.agent.status}`])},null,2),n("span",ih,f(u.value),1)],2)]),t.isMain?(c(),d("div",oh,"PM")):M("",!0)]),n("div",ah,[t.modelInfo&&t.modelInfo.primary?(c(),d("div",rh,[F[5]||(F[5]=n("span",{class:"model-label"},"模型",-1)),n("span",ch,f(b(t.modelInfo.primary)),1),(X=t.modelInfo.fallbacks)!=null&&X.length?(c(),d("span",{key:0,class:"model-fallbacks",title:"备用: "+t.modelInfo.fallbacks.map(b).join(", ")},[(c(!0),d(Y,null,ct(t.modelInfo.fallbacks.slice(0,2),(H,q)=>(c(),d("span",{key:H,class:"fallback-tag"},f(b(H)),1))),128)),t.modelInfo.fallbacks.length>2?(c(),d("span",dh,"+"+f(t.modelInfo.fallbacks.length-2),1)):M("",!0)],8,uh)):M("",!0)])):M("",!0),S.value&&!p.value?(c(),d("div",fh,[F[7]||(F[7]=n("div",{class:"task-header"},[n("span",{class:"task-icon"},"▶"),n("span",{class:"task-label"},"当前任务")],-1)),n("div",{class:"task-name",title:S.value},f(S.value),9,hh),m.value?(c(),d("div",ph,[F[6]||(F[6]=n("span",{class:"child-arrow"},"→",-1)),n("span",vh,f(m.value),1)])):M("",!0)])):M("",!0),p.value?(c(),d("div",gh,[n("div",{class:"tasks-header",onClick:F[0]||(F[0]=le(H=>o.value=!o.value,["stop"]))},[F[8]||(F[8]=n("span",{class:"tasks-icon"},"📋",-1)),F[9]||(F[9]=n("span",{class:"tasks-label"},"并行任务",-1)),n("span",mh,f(v.value),1),n("span",_h,f(o.value?"▲":"▼"),1)]),n("div",{class:nt(["tasks-list",{expanded:o.value}])},[(c(!0),d(Y,null,ct(C.value,H=>(c(),d("div",{key:H.id,class:nt(["task-item",`task-status-${H.status}`])},[F[10]||(F[10]=n("span",{class:"task-status-dot"},null,-1)),n("span",{class:"task-name",title:H.name},f(H.name),9,yh),H.childAgentId?(c(),d("span",bh,"→ "+f(H.childAgentId),1)):M("",!0)],2))),128)),A.value>0?(c(),d("div",$h," +"+f(A.value)+" 更多任务 ",1)):M("",!0)],2)])):M("",!0),t.agent.status==="working"&&t.currentAction?(c(),d("div",{key:3,class:nt(["status-detail",`sub-status-${t.subStatus}`])},[n("span",kh,f(T.value),1),n("span",wh,f(t.currentAction),1)],2)):t.agent.status==="idle"?(c(),d("div",Ch," 空闲中,等待任务... ")):M("",!0)]),(c(),Gt(Po,{to:"body"},[i.value?(c(),d("div",{key:0,class:"warning-modal-overlay",onClick:F[3]||(F[3]=le(H=>i.value=!1,["self"]))},[n("div",Th,[n("div",Sh,[n("span",xh,f(t.error?"⚠️":"⏳"),1),n("span",Ah,f(t.error?"异常详情":"卡顿分析"),1),n("button",{class:"modal-close",onClick:F[1]||(F[1]=H=>i.value=!1)},"×")]),n("div",Ih,[t.error?(c(),d(Y,{key:0},[n("div",Mh,[F[11]||(F[11]=n("span",{class:"detail-label"},"类型",-1)),n("span",Rh,f(D.value),1)]),n("div",Eh,[F[12]||(F[12]=n("span",{class:"detail-label"},"信息",-1)),n("span",Ph,f(t.error.message),1)])],64)):t.stuckWarning?(c(),d(Y,{key:1},[n("div",Dh,[F[13]||(F[13]=n("span",{class:"detail-label"},"等待时间",-1)),n("span",Fh,f(t.stuckWarning.idleSeconds)+" 秒",1)]),t.stuckWarning.reason?(c(),d("div",Oh,[F[14]||(F[14]=n("span",{class:"detail-label"},"原因",-1)),n("span",Lh,f($.value),1)])):M("",!0),t.stuckWarning.reasonDetail?(c(),d("div",Nh,[F[15]||(F[15]=n("span",{class:"detail-label"},"详情",-1)),n("span",jh,f(t.stuckWarning.reasonDetail),1)])):M("",!0),t.stuckWarning.waitingFor?(c(),d("div",Uh,[F[16]||(F[16]=n("span",{class:"detail-label"},"等待对象",-1)),n("span",{class:"detail-value agent-link",onClick:F[2]||(F[2]=H=>K(t.stuckWarning.waitingFor.agentId))},[At(f(t.stuckWarning.waitingFor.agentId)+" ",1),t.stuckWarning.waitingFor.task?(c(),d("span",Vh,"("+f(t.stuckWarning.waitingFor.task)+")",1)):M("",!0)])])):M("",!0),k.value?(c(),d("div",Wh,[F[17]||(F[17]=n("span",{class:"suggestion-icon"},"💡",-1)),n("span",null,f(k.value),1)])):M("",!0)],64)):M("",!0)])])])):M("",!0)]))],2)}}}),Bh=Ct(Hh,[["__scopeId","data-v-04c4a970"]]),Kh={class:"collaboration-flow-section"},qh={class:"section-header"},Gh={class:"header-right"},zh={key:0,class:"flow-legend flow-legend-inline"},Jh={class:"legend-name"},Qh={class:"indicator-text"},Yh={class:"flow-container",ref:"flowContainerRef"},Xh={key:0,class:"loading-state"},Zh={key:1,class:"error-state"},tp={key:2,class:"empty-state"},ep={key:3,class:"flow-layout"},sp={class:"level-header"},np={class:"level-badge"},lp={class:"level-title"},ip={class:"level-cards"},op=["onClick"],ap=["d"],rp={key:0,r:"5",fill:"url(#lightGradient)"},cp={dur:"2s",repeatCount:"1",rotate:"0"},up=["href"],dp={key:0,class:"model-panel"},fp={class:"model-toggle-icon"},hp={class:"model-panel-body"},pp={class:"model-name"},vp={class:"model-dots"},gp=["title","onClick"],mp={class:"model-count"},_p={class:"call-detail-modal"},yp={class:"call-detail-header"},bp={class:"call-detail-body"},$p={class:"call-detail-row"},kp={class:"value"},wp={class:"call-detail-row"},Cp={class:"value"},Tp={class:"call-detail-row"},Sp={class:"value"},xp={class:"call-detail-row"},Ap={class:"value"},Ip={class:"call-detail-row trigger"},Mp={class:"value"},Rp=3e3,Ep=wt({__name:"CollaborationFlowSection",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t,{emit:e}){const s=t,l=e,{connectionState:i,subscribe:o}=Oi(),a=j([]),r=j([]),u=j([]),v=j({}),p=j([]),C=j(!0),A=j(null),S=j(null),m=j({}),T=j({}),D=j(""),$=j(!0),k=j({}),b=j(null),R=j(null),K=j({});function x(g,_){_&&(K.value[g]=_)}const F=Q(()=>s.mainAgentId?s.mainAgentId:D.value?D.value:"main"),X=Q(()=>a.value.filter(g=>g.type==="agent")),H=Q(()=>a.value.filter(g=>g.type==="model")),q=Q(()=>r.value.filter(g=>g.type==="delegates")),G=Q(()=>{const g={};for(const V of X.value){const O=Z(V.id);g[O]||(g[O]=[]),g[O].push(V)}const _={};return Object.keys(g).map(Number).sort((V,O)=>V-O).forEach(V=>{_[V]=g[V]}),_});function I(g){return g===0?"主控":g===1?"一级子代理":`${g}级子代理`}const st={"analyst-agent":"#10b981","architect-agent":"#f59e0b","devops-agent":"#8b5cf6","test-agent":"#ec4899","frontend-agent":"#06b6d4","backend-agent":"#f43f5e"};function mt(g){return g===F.value?"#4a9eff":st[g]||"#64748b"}const P=Q(()=>X.value.map(g=>g.id).filter(Boolean)),L=Q(()=>({connected:"已连接",connecting:"连接中...",disconnected:"未连接",error:"连接错误"})[i.value.status]||"未知");function Z(g){return g===F.value?T.value[g]??0:T.value[g]??1}function it(g){const _=X.value.find(V=>V.id===g);return(_==null?void 0:_.name)||g}function N(g){var O;const _=W=>W==="error"?"down":W,V=g.id===F.value?s.mainAgent:(O=s.subAgents)==null?void 0:O.find(W=>W.id===g.id);return V?{name:V.name,status:V.status,currentTask:V.currentTask,lastActiveFormatted:V.lastActiveFormatted}:{name:g.name,status:_(g.status)}}function U(g){if(g.type==="agent")return v.value[g.id]}function rt(g){return k.value[g]}function lt(g){return u.value.includes(g.id)}function ft(g){return u.value.includes(g.source)&&u.value.includes(g.target)}function tt(g){const _=K.value[g.source],V=K.value[g.target],O=b.value;if(!_||!V||!O)return"";const W=O.getBoundingClientRect(),w=_.getBoundingClientRect(),J=V.getBoundingClientRect(),z=w.left-W.left+w.width/2,et=w.top-W.top+w.height,ot=J.left-W.left+J.width/2,dt=J.top-W.top,vt=(et+dt)/2;return`M ${z} ${et} C ${z} ${vt}, ${ot} ${vt}, ${ot} ${dt}`}function kt(){Me(()=>{if(!b.value||!R.value)return;const g=b.value.getBoundingClientRect();R.value.setAttribute("width",String(g.width)),R.value.setAttribute("height",String(g.height))})}const It=Q(()=>{const g={};for(const _ of p.value){const V=_.model||"(unknown)";g[V]||(g[V]=[]),g[V].push(_)}return g});function Dt(g){var O;const _=((O=g.metadata)==null?void 0:O.modelId)||"",V=_.split("/").pop()||_;return It.value[_]||It.value[V]||[]}function _e(g){return Dt(g).length>0}async function ye(){C.value=!0,A.value=null;try{const g=await fetch("/api/collaboration");if(!g.ok)throw new Error("Failed to fetch collaboration data");const _=await g.json();a.value=_.nodes||[],r.value=_.edges||[],u.value=_.activePath||[],v.value=_.agentModels||{},p.value=_.recentCalls||[],_.hierarchy&&(m.value=_.hierarchy),_.depths&&(T.value=_.depths),_.mainAgentId&&(D.value=_.mainAgentId),_.agentActiveTasks&&(k.value=_.agentActiveTasks),Me(kt)}catch(g){A.value=g.message}finally{C.value=!1}}function Qt(){ye()}function Se(g){const _=g;a.value=_.nodes||[],r.value=_.edges||[],u.value=_.activePath||[],v.value=_.agentModels||{},p.value=_.recentCalls||[],_.hierarchy&&(m.value=_.hierarchy),_.depths&&(T.value=_.depths),_.mainAgentId&&(D.value=_.mainAgentId),_.agentActiveTasks&&(k.value=_.agentActiveTasks),Me(kt)}function h(g){u.value=g.activePath||[],p.value=g.recentCalls||[],g.agentActiveTasks&&(k.value=g.agentActiveTasks);const _=a.value.filter(w=>w.type==="agent");for(const w of _){if(w.id&&g.agentStatuses&&g.agentStatuses[w.id]!==void 0&&(w.status=g.agentStatuses[w.id]),w.id&&g.agentDynamicStatuses&&g.agentDynamicStatuses[w.id]){const J=g.agentDynamicStatuses[w.id];w.subStatus=J.subStatus,w.currentAction=J.currentAction,w.toolName=J.toolName,w.waitingFor=J.waitingFor}if(w.id&&g.agentDisplayStatuses&&g.agentDisplayStatuses[w.id]){const J=g.agentDisplayStatuses[w.id];w.currentAction=J.display,w.metadata||(w.metadata={}),w.metadata={...w.metadata,duration:J.duration,alert:J.alert},J.alert?w.stuckWarning={isStuck:!0,idleSeconds:J.duration,lastUpdate:Date.now(),reason:"self_busy",reasonDetail:J.display}:w.stuckWarning&&!w.stuckWaitingForChildAgent&&(w.stuckWarning=void 0)}}const V=new Set(a.value.filter(w=>w.type==="task").map(w=>w.id)),O=new Set((g.taskNodes||[]).map(w=>w.id));if(V.size!==O.size||[...O].some(w=>!V.has(w))){const w=a.value.filter(z=>z.type==="model"),J=r.value.filter(z=>z.type==="delegates");a.value=[..._,...g.taskNodes||[],...w],r.value=[...J,...g.taskEdges||[]],Me(kt)}else{const w=new Map((g.taskNodes||[]).map(J=>[J.id,J]));for(const J of a.value.filter(z=>z.type==="task")){const z=w.get(J.id);z&&(J.status=z.status,J.name=z.name,z.timestamp&&(J.timestamp=z.timestamp))}}}async function y(){if(!(C.value||a.value.length===0))try{const g=await fetch("/api/collaboration/dynamic");if(!g.ok)return;const _=await g.json();h(_)}catch{}}let E=null,B=null;return Bt([X,$],()=>{Me(kt)}),Nt(()=>{ye(),E=o("collaboration",Se),B=setInterval(y,Rp),window.addEventListener("resize",kt)}),ae(()=>{E&&E(),B&&clearInterval(B),window.removeEventListener("resize",kt)}),(g,_)=>{var V;return c(),d("div",Kh,[n("div",qh,[_[4]||(_[4]=n("h2",null,"协作流程",-1)),n("div",Gh,[X.value.length>0?(c(),d("div",zh,[(c(!0),d(Y,null,ct(P.value,O=>(c(),d("div",{key:O,class:"legend-item"},[n("span",{class:"legend-dot",style:St({background:mt(O)})},null,4),n("span",Jh,f(it(O)),1)]))),128))])):M("",!0),n("div",{class:nt(["connection-indicator",rs(i).status])},[_[3]||(_[3]=n("span",{class:"indicator-dot"},null,-1)),n("span",Qh,f(L.value),1)],2)])]),n("div",Yh,[C.value?(c(),d("div",Xh,[..._[5]||(_[5]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载中...",-1)])])):A.value?(c(),d("div",Zh,[_[6]||(_[6]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(A.value),1),n("button",{onClick:Qt,class:"retry-btn"},"重试")])):a.value.length===0?(c(),d("div",tp,[..._[7]||(_[7]=[n("span",{class:"empty-icon"},"📭",-1),n("span",null,"暂无协作数据",-1)])])):(c(),d("div",ep,[n("div",{class:"agent-area",ref_key:"agentAreaRef",ref:b},[(c(!0),d(Y,null,ct(G.value,(O,W)=>(c(),d("div",{key:W,class:"level-section"},[n("div",sp,[n("span",np,"L"+f(W),1),n("span",lp,f(I(Number(W))),1)]),n("div",ip,[(c(!0),d(Y,null,ct(O,w=>(c(),d("div",{key:w.id,class:nt(["agent-card-wrapper",{"main-agent":w.id===F.value,active:lt(w),[`status-${w.status}`]:!0}]),style:St({"--agent-color":mt(w.id)}),ref_for:!0,ref:J=>x(w.id,J),onClick:J=>l("agent-click",w)},[bt(Bh,{agent:N(w),"model-info":U(w),"is-main":w.id===F.value,"current-task":w.currentTask,error:w.error,"stuck-warning":w.stuckWarning,"hierarchy-depth":Z(w.id),"agent-color":mt(w.id),"sub-status":w.subStatus,"current-action":w.currentAction,"tool-name":w.toolName,"waiting-for":w.waitingFor,"agent-tasks":rt(w.id)},null,8,["agent","model-info","is-main","current-task","error","stuck-warning","hierarchy-depth","agent-color","sub-status","current-action","tool-name","waiting-for","agent-tasks"])],14,op))),128))])]))),128)),(c(),d("svg",{class:"edges-svg",ref_key:"edgesSvgRef",ref:R},[_[8]||(_[8]=n("defs",null,[n("linearGradient",{id:"lightGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[n("stop",{offset:"0%",style:{"stop-color":"#4a9eff","stop-opacity":"0.2"}}),n("stop",{offset:"50%",style:{"stop-color":"#4a9eff","stop-opacity":"1"}}),n("stop",{offset:"100%",style:{"stop-color":"#4a9eff","stop-opacity":"0.2"}})])],-1)),(c(!0),d(Y,null,ct(q.value,O=>(c(),d("g",{key:O.id},[n("path",{d:tt(O),class:nt(["edge-path",{active:ft(O)}]),stroke:"#4a9eff","stroke-width":"2",fill:"none"},null,10,ap),ft(O)?(c(),d("circle",rp,[n("animateMotion",cp,[n("mpath",{href:`#edge-${O.id}`},null,8,up)])])):M("",!0)]))),128))],512))],512),H.value.length>0?(c(),d("div",dp,[n("div",{class:"model-panel-header",onClick:_[0]||(_[0]=O=>$.value=!$.value)},[_[9]||(_[9]=n("span",{class:"model-panel-title"},"🧠 模型",-1)),n("span",fp,f($.value?"▼":"▶"),1)]),Tt(n("div",hp,[(c(!0),d(Y,null,ct(H.value,O=>(c(),d("div",{key:O.id,class:nt(["model-card",{active:_e(O)}])},[n("div",pp,f(O.name),1),n("div",vp,[(c(!0),d(Y,null,ct(Dt(O).slice(0,8),W=>(c(),d("span",{key:W.id,class:"model-dot",style:St({background:mt(W.agentId)}),title:`${it(W.agentId)} @ ${W.model||"unknown"}`,onClick:le(w=>S.value=W,["stop"])},null,12,gp))),128))]),n("div",mp,f(Dt(O).length),1)],2))),128))],512),[[fs,$.value]])])):M("",!0)]))],512),S.value?(c(),d("div",{key:0,class:"call-detail-overlay",onClick:_[2]||(_[2]=le(O=>S.value=null,["self"]))},[n("div",_p,[n("div",yp,[_[10]||(_[10]=n("h3",null,"调用详情",-1)),n("button",{class:"close-btn",onClick:_[1]||(_[1]=O=>S.value=null)},"×")]),n("div",bp,[n("div",$p,[_[11]||(_[11]=n("span",{class:"label"},"Agent",-1)),n("span",kp,f(S.value.agentId),1)]),n("div",wp,[_[12]||(_[12]=n("span",{class:"label"},"模型",-1)),n("span",Cp,f(S.value.model),1)]),n("div",Tp,[_[13]||(_[13]=n("span",{class:"label"},"时间",-1)),n("span",Sp,f(S.value.time),1)]),n("div",xp,[_[14]||(_[14]=n("span",{class:"label"},"Tokens",-1)),n("span",Ap,f(S.value.tokens),1)]),n("div",Ip,[_[15]||(_[15]=n("span",{class:"label"},"触发",-1)),n("div",Mp,f((V=S.value.trigger)==null?void 0:V.replace(/^【完成回传】/,"")),1)])])])])):M("",!0)])}}}),Pp=Ct(Ep,[["__scopeId","data-v-db77627b"]]),Dp={class:"collaboration-box"},Fp={class:"collaboration-box-body"},Op={class:"collaboration-error-fallback"},Lp={class:"fallback-reason"},Np=wt({__name:"CollaborationFlowWrapper",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t){const e=j(null);return ci(s=>(e.value=s instanceof Error?s.message:String(s),!1)),(s,l)=>(c(),d("div",Dp,[l[3]||(l[3]=n("div",{class:"collaboration-box-header"},[n("h2",null,"协作流程"),n("span",{class:"collaboration-hint"},"展示主 Agent 与子 Agents 的协作关系")],-1)),n("div",Fp,[Tt(bt(Pp,{"main-agent":t.mainAgent,"sub-agents":t.subAgents,"main-agent-id":t.mainAgentId,onAgentClick:l[0]||(l[0]=i=>s.$emit("agent-click",i))},null,8,["main-agent","sub-agents","main-agent-id"]),[[fs,!e.value]]),Tt(n("div",Op,[l[2]||(l[2]=n("p",{class:"fallback-title"},"协作流程加载失败",-1)),n("p",Lp,f(e.value),1),n("button",{onClick:l[1]||(l[1]=i=>e.value=null)},"重试")],512),[[fs,e.value]])])]))}}),jp=Ct(Np,[["__scopeId","data-v-ef9f8c73"]]),Up={class:"task-status-section"},Vp={class:"section-header"},Wp={class:"summary-stats"},Hp={class:"stat total"},Bp={class:"filters-row"},Kp={class:"search-box"},qp={class:"filter-buttons"},Gp=["onClick"],zp={key:0,class:"loading-state"},Jp={key:1,class:"error-state"},Qp={key:2,class:"empty-state"},Yp={class:"task-list"},Xp=["onClick"],Zp={class:"task-main"},tv={class:"task-name-short"},ev={key:0,class:"task-agent"},sv={key:1,class:"task-time"},nv={class:"task-detail-modal"},lv={class:"task-detail-header"},iv={class:"task-detail-body"},ov={class:"detail-row"},av={class:"detail-value task-content"},rv={key:0,class:"detail-row"},cv={class:"detail-value"},uv={class:"detail-row"},dv={class:"detail-value"},fv={key:1,class:"detail-row"},hv={class:"detail-value"},pv={key:2,class:"detail-row"},vv={class:"detail-value path-value"},gv={key:3,class:"detail-row"},mv={class:"detail-value"},_v={key:4,class:"detail-row"},yv={class:"detail-progress"},bv={class:"progress-bar"},$v={class:"progress-text"},kv={key:5,class:"detail-row"},wv={class:"detail-value error"},Cv={key:6,class:"detail-row"},Tv={class:"generated-files-list"},Sv={key:7,class:"detail-row"},xv={class:"detail-value output-content"},Av={key:8,class:"detail-row"},Iv={class:"detail-subtasks"},Mv={key:0,class:"subtask-error-inline"},Rv={key:9,class:"detail-row"},Ev={class:"timeline-container"},Pv={class:"timeline"},Dv={class:"timeline-time"},Fv={class:"timeline-desc"},Ov=wt({__name:"TaskStatusSection",setup(t){const{subscribe:e}=Oi(),s=j([]),l=j(!0),i=j(null),o=j(""),a=j([]),r=j(null),u=j(null),v=j([]),p=j(!1),C=[{value:"running",label:"执行中"},{value:"completed",label:"已完成"},{value:"failed",label:"失败"},{value:"pending",label:"待分配"}];Gf(P=>{},300);const A=Q(()=>{let P=s.value;if(a.value.length>0&&(P=P.filter(L=>a.value.includes(L.status))),o.value){const L=o.value.toLowerCase();P=P.filter(Z=>{var it;return Z.name.toLowerCase().includes(L)||((it=Z.agentName)==null?void 0:it.toLowerCase().includes(L))})}return P}),S=Q(()=>({total:s.value.length,running:s.value.filter(P=>P.status==="running").length,completed:s.value.filter(P=>P.status==="completed").length,failed:s.value.filter(P=>P.status==="failed").length,pending:s.value.filter(P=>P.status==="pending").length,cancelled:s.value.filter(P=>P.status==="cancelled").length}));function m(P){return{pending:"⏳",running:"🔄",completed:"✅",failed:"❌",cancelled:"🚫"}[P]||"📋"}function T(P){return s.value.filter(L=>L.status===P).length}function D(P){if(!P||!P.trim())return"未知";const L=P.trim().toLowerCase(),Z={terminated:"任务被终止(可能是超时或被用户取消)",timeout:"任务执行超时",cancelled:"任务已取消",canceled:"任务已取消",killed:"任务被终止","subagent-error":"子任务执行异常"};for(const[it,N]of Object.entries(Z))if(L.includes(it))return N;return P.trim()}function $(P){return!P||typeof P!="string"?"":P.replace(/\*\*/g,"").replace(/`([^`]+)`/g,"$1")}function k(P){if(!P.startTime)return"";const L=new Date(P.startTime).getTime(),Z=P.endTime?new Date(P.endTime).getTime():Date.now(),it=Math.floor((Z-L)/1e3);return it<60?`${it}s`:it<3600?`${Math.floor(it/60)}m ${it%60}s`:`${Math.floor(it/3600)}h ${Math.floor(it%3600/60)}m`}function b(P){const L=a.value.indexOf(P);L===-1?a.value.push(P):a.value.splice(L,1)}function R(P){a.value.length===1&&a.value[0]===P?a.value=[]:a.value=[P]}function K(P){const Z=$(P.task??P.name).split(`
24
+ `)[0].trim();return Z.length<=60?Z:Z.slice(0,60)+"…"}function x(P){return{pending:"待分配",running:"执行中",completed:"已完成",failed:"失败",cancelled:"已取消"}[P]||P}async function F(){l.value=!0,i.value=null;try{const P=await fetch("/api/tasks");if(!P.ok)throw new Error("Failed to fetch tasks");const L=await P.json();s.value=(L.tasks||[]).map(Z=>q(Z))}catch(P){i.value=P.message}finally{l.value=!1}}function X(P){return{pending:"pending",assigning:"pending",running:"running",in_progress:"running",active:"running",completed:"completed",success:"completed",failed:"failed",error:"failed",cancelled:"cancelled"}[P]||"pending"}function H(){F()}function q(P){const L=(P.subtasks||[]).map(Z=>({id:Z.id||Z.name,name:Z.name||"Unknown",task:Z.task,status:X(Z.status),progress:Z.progress??0,startTime:Z.startTime,endTime:Z.endTime,agentId:Z.agentId,agentName:Z.agentName,agentWorkspace:Z.agentWorkspace,taskPath:Z.taskPath,error:Z.error,output:Z.output,generatedFiles:Z.generatedFiles}));return{id:P.id,name:P.name||"Unknown Task",task:P.task,status:X(P.status),progress:P.progress??0,startTime:P.startTime,endTime:P.endTime,agentId:P.agentId,agentName:P.agentName,agentWorkspace:P.agentWorkspace,taskPath:P.taskPath,error:P.error,output:P.output,generatedFiles:P.generatedFiles,subtasks:L.length?L:void 0}}function G(P){const Z=(Array.isArray(P)?P:P&&typeof P=="object"&&"tasks"in P?P.tasks??[]:[]).map(it=>q(it));Z.length===0&&s.value.length>0||(s.value=Z)}function I(P){return P?new Date(P).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}async function st(P){if(!P){v.value=[];return}p.value=!0;try{const L=await fetch(`/api/tasks/${P}/timeline`);if(L.ok){const Z=await L.json();v.value=Z.timeline||[]}}catch(L){console.error("Failed to fetch timeline:",L),v.value=[]}finally{p.value=!1}}Bt(r,P=>{P?st(P.id):v.value=[]});let mt=null;return Nt(()=>{F(),mt=e("tasks",G)}),ae(()=>{mt&&mt()}),(P,L)=>{var Z,it;return c(),d("div",Up,[n("div",Vp,[L[6]||(L[6]=n("h2",null,"任务状态",-1)),n("div",Wp,[n("span",{class:nt(["stat running clickable",{active:a.value.includes("running")}]),onClick:L[0]||(L[0]=N=>R("running"))},"执行中: "+f(S.value.running),3),n("span",{class:nt(["stat completed clickable",{active:a.value.includes("completed")}]),onClick:L[1]||(L[1]=N=>R("completed"))},"已完成: "+f(S.value.completed),3),n("span",{class:nt(["stat failed clickable",{active:a.value.includes("failed")}]),onClick:L[2]||(L[2]=N=>R("failed"))},"失败: "+f(S.value.failed),3),n("span",Hp,"总计: "+f(S.value.total),1)])]),n("div",Bp,[n("div",Kp,[Tt(n("input",{"onUpdate:modelValue":L[3]||(L[3]=N=>o.value=N),type:"text",placeholder:"搜索任务...",class:"search-input"},null,512),[[jn,o.value]])]),n("div",qp,[(c(),d(Y,null,ct(C,N=>n("button",{key:N.value,class:nt(["filter-btn",{active:a.value.includes(N.value)}]),onClick:U=>b(N.value)},f(N.label)+" ("+f(T(N.value))+") ",11,Gp)),64))])]),l.value?(c(),d("div",zp,[...L[7]||(L[7]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载任务数据...",-1)])])):i.value?(c(),d("div",Jp,[L[8]||(L[8]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(i.value),1),n("button",{onClick:H,class:"retry-btn"},"重试")])):A.value.length===0?(c(),d("div",Qp,[L[9]||(L[9]=n("span",{class:"empty-icon"},"📭",-1)),n("span",null,f(o.value?"无匹配任务":"暂无任务数据"),1)])):(c(),d("div",{key:3,class:"task-list-container",ref_key:"containerRef",ref:u},[n("div",Yp,[(c(!0),d(Y,null,ct(A.value,N=>(c(),d("div",{key:N.id,class:"task-item",onClick:U=>r.value=N},[n("span",{class:nt(["task-status-icon",N.status])},f(m(N.status)),3),n("div",Zp,[n("div",tv,f(K(N)),1)]),N.agentName?(c(),d("span",ev,f(N.agentName),1)):M("",!0),N.startTime?(c(),d("span",sv,f(k(N)),1)):M("",!0),L[10]||(L[10]=n("span",{class:"task-detail-hint"},"详情 ›",-1))],8,Xp))),128))])],512)),r.value?(c(),d("div",{key:4,class:"task-detail-overlay",onClick:L[5]||(L[5]=le(N=>r.value=null,["self"]))},[n("div",nv,[n("div",lv,[L[11]||(L[11]=n("h3",null,"任务详情",-1)),n("button",{class:"close-btn",onClick:L[4]||(L[4]=N=>r.value=null)},"×")]),n("div",iv,[n("div",ov,[L[12]||(L[12]=n("span",{class:"detail-label"},"任务",-1)),n("span",av,f($(r.value.task??r.value.name)),1)]),r.value.taskPath?(c(),d("div",rv,[L[13]||(L[13]=n("span",{class:"detail-label"},"项目路径",-1)),n("span",cv,f($(r.value.taskPath)),1)])):M("",!0),n("div",uv,[L[14]||(L[14]=n("span",{class:"detail-label"},"状态",-1)),n("span",dv,[n("span",{class:nt(["task-status-icon",r.value.status])},f(m(r.value.status)),3),At(" "+f(x(r.value.status)),1)])]),r.value.agentName?(c(),d("div",fv,[L[15]||(L[15]=n("span",{class:"detail-label"},"执行者",-1)),n("span",hv,f(r.value.agentName),1)])):M("",!0),r.value.agentWorkspace?(c(),d("div",pv,[L[16]||(L[16]=n("span",{class:"detail-label"},"Agent 工作区路径",-1)),n("span",vv,f(r.value.agentWorkspace),1)])):M("",!0),r.value.startTime?(c(),d("div",gv,[L[17]||(L[17]=n("span",{class:"detail-label"},"耗时",-1)),n("span",mv,f(k(r.value)),1)])):M("",!0),r.value.status==="running"?(c(),d("div",_v,[L[18]||(L[18]=n("span",{class:"detail-label"},"进度",-1)),n("div",yv,[n("div",bv,[n("div",{class:"progress-fill",style:St({width:`${r.value.progress}%`})},null,4)]),n("span",$v,f(r.value.progress)+"%",1)])])):M("",!0),r.value.status==="failed"?(c(),d("div",kv,[L[19]||(L[19]=n("span",{class:"detail-label"},"失败原因",-1)),n("span",wv,f(D(r.value.error)),1)])):M("",!0),r.value.status==="completed"&&((Z=r.value.generatedFiles)!=null&&Z.length)?(c(),d("div",Cv,[L[20]||(L[20]=n("span",{class:"detail-label"},"生成的文件",-1)),n("ul",Tv,[(c(!0),d(Y,null,ct(r.value.generatedFiles,N=>(c(),d("li",{key:N,class:"file-path-item"},f(N),1))),128))])])):M("",!0),r.value.status==="completed"&&r.value.output?(c(),d("div",Sv,[L[21]||(L[21]=n("span",{class:"detail-label"},"Agent 输出",-1)),n("div",xv,f($(r.value.output)),1)])):M("",!0),(it=r.value.subtasks)!=null&&it.length?(c(),d("div",Av,[L[22]||(L[22]=n("span",{class:"detail-label"},"子任务",-1)),n("div",Iv,[(c(!0),d(Y,null,ct(r.value.subtasks,N=>(c(),d("div",{key:N.id,class:"subtask-row"},[n("span",{class:nt(["task-status-icon",N.status])},f(m(N.status)),3),n("span",null,f(N.name),1),N.status==="failed"?(c(),d("span",Mv,f(D(N.error)),1)):M("",!0)]))),128))])])):M("",!0),v.value.length>0?(c(),d("div",Rv,[L[24]||(L[24]=n("span",{class:"detail-label"},"执行时间线",-1)),n("div",Ev,[n("div",Pv,[(c(!0),d(Y,null,ct(v.value,(N,U)=>(c(),d("div",{key:U,class:nt(["timeline-item",N.type])},[n("span",Dv,f(I(N.time)),1),L[23]||(L[23]=n("span",{class:"timeline-dot"},null,-1)),n("span",Fv,f(N.description),1)],2))),128))])])])):M("",!0)])])])):M("",!0)])}}}),Lv=Ct(Ov,[["__scopeId","data-v-5d944098"]]),Nv={class:"performance-section"},jv={class:"section-header"},Uv={class:"time-range-selector"},Vv=["onClick"],Wv={key:0,class:"loading-state"},Hv={key:1,class:"error-state"},Bv={class:"metrics-grid"},Kv={class:"metric-card primary"},qv={class:"metric-content"},Gv={class:"metric-value"},zv={key:0,class:"metric-alert"},Jv={class:"metric-card"},Qv={class:"metric-content"},Yv={class:"metric-value"},Xv={class:"metric-card highlight"},Zv={class:"metric-content"},tg={class:"metric-value"},eg={class:"metric-unit"},sg={class:"metric-card highlight"},ng={class:"metric-content"},lg={class:"metric-value"},ig={class:"metric-unit"},og={class:"charts-stack"},ag={class:"chart-card"},rg={class:"chart-header"},cg={class:"chart-datetime"},ug={class:"chart-container"},dg={class:"chart-bars"},fg=["title","onClick"],hg={class:"bar-value"},pg={class:"bar-time-label"},vg={class:"chart-card"},gg={class:"chart-header"},mg={class:"chart-datetime"},_g={class:"chart-container"},yg={class:"chart-bars rpm"},bg=["title","onClick"],$g={class:"bar-value"},kg={class:"bar-time-label"},wg={class:"summary-section"},Cg={class:"summary-grid"},Tg={class:"summary-item"},Sg={class:"summary-value"},xg={class:"summary-item"},Ag={class:"summary-value"},Ig={key:0,class:"summary-sub"},Mg={class:"summary-item highlight"},Rg={class:"summary-value"},Eg={class:"detail-modal"},Pg={class:"detail-modal-header"},Dg={class:"detail-modal-body"},Fg={key:0,class:"detail-loading"},Og={key:1,class:"detail-calls"},Lg={class:"detail-summary"},Ng={class:"detail-filters"},jg=["value"],Ug={key:0,class:"detail-call-hint"},Vg={class:"call-header"},Wg={class:"call-agent"},Hg={class:"call-time"},Bg={class:"call-tokens"},Kg=["title"],qg={key:0,class:"call-trigger-badge"},Gg={key:0,class:"call-meta"},zg={key:2,class:"detail-empty"},Jg={key:1,class:"alerts-panel"},Qg={class:"alerts-list"},Yg={class:"alert-message"},Xg={class:"alert-value"},Zg={class:"alert-time"},tm=["onClick"],em=wt({__name:"PerformanceSection",setup(t){const e=j(!0),s=j(null),l=j("20m"),i=j([]),o=j(!1),a=j(!1),r=j(null),u=j(""),v=j(""),p=j(""),C=j("tokens_desc"),A=Q(()=>{var U;if(!((U=r.value)!=null&&U.calls))return[];const N=new Set(r.value.calls.map(rt=>rt.agentId));return Array.from(N).sort()}),S=Q(()=>{var U;if(!((U=r.value)!=null&&U.calls))return[];let N=[...r.value.calls];if(v.value){const rt=v.value.toLowerCase();N=N.filter(lt=>{var ft;return(ft=lt.trigger)==null?void 0:ft.toLowerCase().includes(rt)})}switch(p.value&&(N=N.filter(rt=>rt.agentId===p.value)),C.value){case"tokens_desc":N.sort((rt,lt)=>lt.tokens-rt.tokens);break;case"tokens_asc":N.sort((rt,lt)=>rt.tokens-lt.tokens);break;case"time_asc":N.sort((rt,lt)=>rt.time.localeCompare(lt.time));break;case"time_desc":N.sort((rt,lt)=>lt.time.localeCompare(rt.time));break}return N}),m=Q(()=>S.value.reduce((N,U)=>N+U.tokens,0)),T=j({current:{tpm:0,rpm:0,windowTotal:{tokens:0,requests:0}},history:{tpm:[],rpm:[],timestamps:[]},statistics:{avgTpm:0,peakTpm:0,peakTime:""}}),D=[{value:"20m",label:"20分钟"},{value:"1h",label:"1小时"},{value:"24h",label:"24小时"}],$=Q(()=>{const N=D.find(U=>U.value===l.value);return N?`最近 ${N.label}`:""}),k=Q(()=>{switch(l.value){case"20m":return 20;case"1h":return 60;case"24h":return 24;default:return 20}}),b=Q(()=>{const N=T.value.history,U=k.value;if(N.tpm.length===0){const rt=l.value==="24h"?36e5:6e4;return Array.from({length:U},(lt,ft)=>({timestamp:Date.now()-(U-ft-1)*rt,tpm:0,rpm:0}))}return N.tpm.map((rt,lt)=>({timestamp:N.timestamps[lt]||Date.now()-lt*6e4,tpm:rt,rpm:N.rpm[lt]||0}))});function R(N){const U=b.value.map(lt=>lt[N]);return Math.max(...U,1)*1.2}function K(N,U){return Math.max(N/U*100,5)}function x(N){return N>=1e6?(N/1e6).toFixed(1)+"M":N>=1e3?(N/1e3).toFixed(1)+"K":N.toString()}const F=j(Date.now());function X(N){const U=N??Date.now(),rt=typeof U=="number"?U:Number(U);if(isNaN(rt))return new Date().toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});const lt=rt<1e12?rt*1e3:rt,ft=new Date(lt);return isNaN(ft.getTime())?new Date().toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):ft.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function H(N){if(N==null)return"--:--";if(typeof N=="string"){const lt=N.split(":").map(Number);if(lt.length>=2){const ft=new Date;return new Date(Date.UTC(ft.getUTCFullYear(),ft.getUTCMonth(),ft.getUTCDate(),lt[0],lt[1],0,0)).toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}return N}const U=Number(N);if(isNaN(U))return"--:--";const rt=new Date(U);return isNaN(rt.getTime())?"--:--":l.value==="24h"?rt.toLocaleString("zh-CN",{hour:"2-digit",hour12:!1})+":00":rt.toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function q(N){return i.value.some(U=>U.type===N&&!U.acknowledged)}function G(N){const U=i.value.find(rt=>rt.id===N);U&&(U.acknowledged=!0)}async function I(){var N,U,rt,lt,ft,tt,kt,It,Dt,_e,ye,Qt;e.value=!0,s.value=null;try{const Se=await fetch(`/api/performance?range=${l.value}`);if(!Se.ok)throw new Error("Failed to fetch performance data");const h=await Se.json();T.value={current:{tpm:((N=h.current)==null?void 0:N.tpm)??0,rpm:((U=h.current)==null?void 0:U.rpm)??0,windowTotal:{tokens:((lt=(rt=h.current)==null?void 0:rt.windowTotal)==null?void 0:lt.tokens)??0,requests:((tt=(ft=h.current)==null?void 0:ft.windowTotal)==null?void 0:tt.requests)??0}},history:{tpm:((kt=h.history)==null?void 0:kt.tpm)??[],rpm:((It=h.history)==null?void 0:It.rpm)??[],timestamps:((Dt=h.history)==null?void 0:Dt.timestamps)??[]},statistics:{avgTpm:((_e=h.statistics)==null?void 0:_e.avgTpm)??0,peakTpm:((ye=h.statistics)==null?void 0:ye.peakTpm)??0,peakTime:((Qt=h.statistics)==null?void 0:Qt.peakTime)??""}},F.value=Date.now(),st()}catch(Se){s.value=Se.message}finally{e.value=!1}}function st(){const{current:N}=T.value;N.tpm>1e5&&i.value.push({id:`high_tpm_${Date.now()}`,type:"high_tpm",message:"TPM 过高",value:N.tpm,threshold:1e5,timestamp:Date.now(),acknowledged:!1}),i.value=i.value.slice(-10)}function mt(){I()}async function P(N){let U;if(typeof N.timestamp=="number")U=N.timestamp<1e12?N.timestamp*1e3:N.timestamp;else if(typeof N.timestamp=="string"){const lt=N.timestamp.split(":").map(Number);if(lt.length>=2){const ft=new Date;let tt=ft.getUTCDate();const kt=lt[0]*60+lt[1],It=ft.getUTCHours()*60+ft.getUTCMinutes();kt>It+10&&(tt-=1),U=new Date(Date.UTC(ft.getUTCFullYear(),ft.getUTCMonth(),tt,lt[0],lt[1],0,0)).getTime()}else return}else return;const rt=l.value==="24h"?"hour":"minute";o.value=!0,u.value=`${H(N.timestamp)} 调用详情`,r.value=null,a.value=!0,v.value="",p.value="",C.value="tokens_desc";try{const lt=await fetch(`/api/performance/details?timestamp=${U}&granularity=${rt}`),ft=await lt.json();lt.ok?(r.value=ft,u.value=`${ft.timeWindow||H(N.timestamp)} 调用详情`):r.value={timeWindow:H(N.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}catch{r.value={timeWindow:H(N.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}finally{a.value=!1}}let L=null;function Z(){it();const N=l.value==="24h"?3e5:3e4;L=setInterval(I,N)}function it(){L&&(clearInterval(L),L=null)}return Nt(()=>{I(),Z()}),ae(()=>{it()}),Bt(l,()=>{I(),Z()}),(N,U)=>{var rt,lt,ft;return c(),d("div",Nv,[n("div",jv,[U[5]||(U[5]=n("h2",null,"性能数据",-1)),n("div",Uv,[(c(),d(Y,null,ct(D,tt=>n("button",{key:tt.value,class:nt(["range-btn",{active:l.value===tt.value}]),onClick:kt=>l.value=tt.value},f(tt.label),11,Vv)),64))])]),e.value?(c(),d("div",Wv,[...U[6]||(U[6]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载性能数据...",-1)])])):s.value?(c(),d("div",Hv,[U[7]||(U[7]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(s.value),1),n("button",{onClick:mt,class:"retry-btn"},"重试")])):(c(),d(Y,{key:2},[n("div",Bv,[n("div",Kv,[U[10]||(U[10]=n("div",{class:"metric-icon"},"⚡",-1)),n("div",qv,[U[8]||(U[8]=n("div",{class:"metric-label"},"TPM",-1)),n("div",Gv,f(x(T.value.current.tpm)),1),U[9]||(U[9]=n("div",{class:"metric-unit"},"Tokens/分钟",-1))]),q("high_tpm")?(c(),d("div",zv,"⚠️")):M("",!0)]),n("div",Jv,[U[13]||(U[13]=n("div",{class:"metric-icon"},"🔄",-1)),n("div",Qv,[U[11]||(U[11]=n("div",{class:"metric-label"},"RPM",-1)),n("div",Yv,f(x(T.value.current.rpm)),1),U[12]||(U[12]=n("div",{class:"metric-unit"},"Requests/分钟",-1))])]),n("div",Xv,[U[15]||(U[15]=n("div",{class:"metric-icon"},"📊",-1)),n("div",Zv,[U[14]||(U[14]=n("div",{class:"metric-label"},"总 Token",-1)),n("div",tg,f(x(T.value.current.windowTotal.tokens)),1),n("div",eg,f($.value),1)])]),n("div",sg,[U[17]||(U[17]=n("div",{class:"metric-icon"},"🔢",-1)),n("div",ng,[U[16]||(U[16]=n("div",{class:"metric-label"},"总请求",-1)),n("div",lg,f(x(T.value.current.windowTotal.requests)),1),n("div",ig,f($.value),1)])])]),n("div",og,[n("div",ag,[n("div",rg,[U[18]||(U[18]=n("h3",null,"TPM 趋势",-1)),n("span",cg,f(X(F.value)),1)]),n("div",ug,[n("div",dg,[(c(!0),d(Y,null,ct(b.value,(tt,kt)=>(c(),d("div",{key:kt,class:"chart-bar clickable",style:St({height:`${K(tt.tpm,R("tpm"))}%`}),title:`${H(tt.timestamp)}: ${x(tt.tpm)} TPM - 点击查看详情`,onClick:It=>P(tt)},[n("span",hg,f(x(tt.tpm)),1),n("span",pg,f(H(tt.timestamp)),1)],12,fg))),128))])])]),n("div",vg,[n("div",gg,[U[19]||(U[19]=n("h3",null,"RPM 趋势",-1)),n("span",mg,f(X(F.value)),1)]),n("div",_g,[n("div",yg,[(c(!0),d(Y,null,ct(b.value,(tt,kt)=>(c(),d("div",{key:kt,class:"chart-bar clickable",style:St({height:`${K(tt.rpm,R("rpm"))}%`}),title:`${H(tt.timestamp)}: ${tt.rpm} RPM - 点击查看调用详情`,onClick:It=>P(tt)},[n("span",$g,f(tt.rpm),1),n("span",kg,f(H(tt.timestamp)),1)],12,bg))),128))])])])]),n("div",wg,[U[23]||(U[23]=n("h3",null,"统计摘要",-1)),n("div",Cg,[n("div",Tg,[U[20]||(U[20]=n("span",{class:"summary-label"},"平均 TPM",-1)),n("span",Sg,f(x(T.value.statistics.avgTpm)),1)]),n("div",xg,[U[21]||(U[21]=n("span",{class:"summary-label"},"峰值 TPM",-1)),n("span",Ag,f(x(T.value.statistics.peakTpm)),1),T.value.statistics.peakTime?(c(),d("span",Ig,"峰值时间: "+f(T.value.statistics.peakTime),1)):M("",!0)]),n("div",Mg,[U[22]||(U[22]=n("span",{class:"summary-label"},"时间窗口",-1)),n("span",Rg,f($.value),1)])])]),o.value?(c(),d("div",{key:0,class:"detail-modal-overlay",onClick:U[4]||(U[4]=le(tt=>o.value=!1,["self"]))},[n("div",Eg,[n("div",Pg,[n("h3",null,f(u.value),1),n("button",{class:"close-btn",onClick:U[0]||(U[0]=tt=>o.value=!1)},"×")]),n("div",Dg,[a.value?(c(),d("div",Fg,"加载详情...")):(lt=(rt=r.value)==null?void 0:rt.calls)!=null&&lt.length?(c(),d("div",Og,[n("div",Lg,f(S.value.length)+" / "+f(r.value.totalCalls)+" 次调用 · "+f(x(m.value))+" Tokens · 平均 "+f(x(((ft=r.value.summary)==null?void 0:ft.avgTokens)||0))+" Tokens/调用 ",1),n("div",Ng,[Tt(n("input",{"onUpdate:modelValue":U[1]||(U[1]=tt=>v.value=tt),type:"text",class:"search-input",placeholder:"搜索触发内容..."},null,512),[[jn,v.value]]),Tt(n("select",{"onUpdate:modelValue":U[2]||(U[2]=tt=>p.value=tt),class:"agent-filter"},[U[24]||(U[24]=n("option",{value:""},"全部 Agent",-1)),(c(!0),d(Y,null,ct(A.value,tt=>(c(),d("option",{key:tt,value:tt},f(tt),9,jg))),128))],512),[[Pe,p.value]]),Tt(n("select",{"onUpdate:modelValue":U[3]||(U[3]=tt=>C.value=tt),class:"sort-select"},[...U[25]||(U[25]=[n("option",{value:"tokens_desc"},"Token 降序",-1),n("option",{value:"tokens_asc"},"Token 升序",-1),n("option",{value:"time_asc"},"时间 升序",-1),n("option",{value:"time_desc"},"时间 降序",-1)])],512),[[Pe,C.value]])]),r.value.calls.some(tt=>{var kt;return(kt=tt.trigger)==null?void 0:kt.startsWith("【完成回传】")})?(c(),d("div",Ug,[...U[26]||(U[26]=[n("span",{class:"hint-badge"},"完成回传",-1),n("span",{class:"hint-text"},"此时间戳为子任务完成后的回传时间,不是派发时间",-1)])])):M("",!0),(c(!0),d(Y,null,ct(S.value,(tt,kt)=>{var It,Dt;return c(),d("div",{key:kt,class:"detail-call-item"},[n("div",Vg,[n("span",Wg,f(tt.agentId),1),n("span",Hg,f(tt.time),1),n("span",Bg,f(x(tt.tokens))+" tokens",1)]),n("div",{class:"call-trigger",title:tt.trigger},[(It=tt.trigger)!=null&&It.startsWith("【完成回传】")?(c(),d("span",qg,"完成回传")):M("",!0),At(" "+f((Dt=tt.trigger)==null?void 0:Dt.replace(/^【完成回传】/,"")),1)],8,Kg),tt.model?(c(),d("div",Gg,"模型: "+f(tt.model),1)):M("",!0)])}),128))])):(c(),d("div",zg,"该时段无调用记录"))])])])):M("",!0),i.value.length>0?(c(),d("div",Jg,[U[27]||(U[27]=n("h3",null,"⚠️ 性能告警",-1)),n("div",Qg,[(c(!0),d(Y,null,ct(i.value,tt=>(c(),d("div",{key:tt.id,class:nt(["alert-item",tt.type])},[n("span",Yg,f(tt.message),1),n("span",Xg,f(x(tt.value))+" (阈值: "+f(x(tt.threshold))+")",1),n("span",Zg,f(H(tt.timestamp)),1),n("button",{class:"ack-btn",onClick:kt=>G(tt.id)},"确认",8,tm)],2))),128))])])):M("",!0)],64))])}}}),sm=Ct(em,[["__scopeId","data-v-6508c9b4"]]),nm={class:"token-analysis"},lm={class:"section-header"},im={class:"time-range-selector"},om=["onClick"],am={key:0,class:"loading-state"},rm={key:1,class:"error-state"},cm={class:"summary-cards"},um={class:"summary-card"},dm={class:"card-content"},fm={class:"card-value"},hm={class:"summary-card"},pm={class:"card-content"},vm={class:"card-value"},gm={class:"summary-card highlight"},mm={class:"card-content"},_m={class:"card-value"},ym={class:"card-sub"},bm={class:"summary-card"},$m={class:"card-content"},km={class:"card-value"},wm={class:"summary-card cost"},Cm={class:"card-content"},Tm={class:"card-value"},Sm={key:0,class:"card-sub saved"},xm={key:0,class:"trend-section"},Am={class:"trend-chart"},Im={class:"trend-bars"},Mm={key:0,class:"bar-tooltip"},Rm={key:0,class:"bar-tooltip"},Em={class:"trend-time"},Pm={class:"view-toggle"},Dm={key:1,class:"by-agent-table"},Fm={class:"agent-name"},Om={class:"total-col"},Lm={class:"percent-bar"},Nm={class:"percent-text"},jm={class:"total-col"},Um={key:2,class:"by-agent-chart"},Vm={class:"bar-chart"},Wm={class:"bar-label"},Hm={class:"bar-container"},Bm={class:"bar-value"},Km={class:"bar-percent"},qm=wt({__name:"TokenAnalysisPanel",setup(t){const e=j({summary:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0,cacheHitRate:0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0,saved:0,savedPercent:0},byAgent:[],trend:null}),s=j(!1),l=j(""),i=j("table"),o=j("all"),a=[{value:"all",label:"全部"},{value:"24h",label:"24小时"},{value:"1h",label:"1小时"},{value:"20m",label:"20分钟"}],r=Q(()=>o.value!=="all"&&e.value.trend),u=Q(()=>{if(!e.value.trend)return 1;const D=[...e.value.trend.input,...e.value.trend.output];return Math.max(...D,1)}),v=Q(()=>[...e.value.byAgent||[]].sort((D,$)=>$.total-D.total));function p(D,$){return Math.max(D/$*100,2)}function C(D){const $=new Date(D);return o.value==="24h"?$.toLocaleString("zh-CN",{hour:"2-digit",hour12:!1})+":00":$.toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function A(D){return D==null?"0":D>=1e6?(D/1e6).toFixed(2)+"M":D>=1e3?(D/1e3).toFixed(1)+"K":D.toLocaleString()}function S(D){return D==null?"0%":(D*100).toFixed(1)+"%"}function m(D){return D==null?"0.00":D>=1?D.toFixed(2):D.toFixed(4)}async function T(){s.value=!0,l.value="";try{const D=await fetch(`/api/tokens/analysis?range=${o.value}`);D.ok?e.value=await D.json():l.value="加载失败"}catch(D){l.value=String(D)}finally{s.value=!1}}return Nt(T),Bt(o,T),(D,$)=>{var k,b,R,K,x,F,X,H,q,G,I,st,mt;return c(),d("section",nm,[n("div",lm,[$[2]||($[2]=n("h2",null,"Token 分析",-1)),n("div",im,[(c(),d(Y,null,ct(a,P=>n("button",{key:P.value,class:nt(["range-btn",{active:o.value===P.value}]),onClick:L=>o.value=P.value},f(P.label),11,om)),64))])]),s.value?(c(),d("div",am,[...$[3]||($[3]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载 Token 数据...",-1)])])):l.value?(c(),d("div",rm,[$[4]||($[4]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(l.value),1),n("button",{onClick:T,class:"retry-btn"},"重试")])):(c(),d(Y,{key:2},[n("div",cm,[n("div",um,[$[6]||($[6]=n("div",{class:"card-icon"},"📥",-1)),n("div",dm,[$[5]||($[5]=n("div",{class:"card-label"},"Input",-1)),n("div",fm,f(A((k=e.value.summary)==null?void 0:k.input)),1)])]),n("div",hm,[$[8]||($[8]=n("div",{class:"card-icon"},"📤",-1)),n("div",pm,[$[7]||($[7]=n("div",{class:"card-label"},"Output",-1)),n("div",vm,f(A((b=e.value.summary)==null?void 0:b.output)),1)])]),n("div",gm,[$[10]||($[10]=n("div",{class:"card-icon"},"💾",-1)),n("div",mm,[$[9]||($[9]=n("div",{class:"card-label"},"Cache Read",-1)),n("div",_m,f(A((R=e.value.summary)==null?void 0:R.cacheRead)),1),n("div",ym,"命中率 "+f(S((K=e.value.summary)==null?void 0:K.cacheHitRate)),1)])]),n("div",bm,[$[12]||($[12]=n("div",{class:"card-icon"},"📝",-1)),n("div",$m,[$[11]||($[11]=n("div",{class:"card-label"},"Cache Write",-1)),n("div",km,f(A((x=e.value.summary)==null?void 0:x.cacheWrite)),1)])]),n("div",wm,[$[14]||($[14]=n("div",{class:"card-icon"},"💰",-1)),n("div",Cm,[$[13]||($[13]=n("div",{class:"card-label"},"估算成本",-1)),n("div",Tm,"$"+f(m((F=e.value.cost)==null?void 0:F.total)),1),((X=e.value.cost)==null?void 0:X.saved)>0?(c(),d("div",Sm,"节省 $"+f(m((H=e.value.cost)==null?void 0:H.saved)),1)):M("",!0)])])]),e.value.trend&&r.value?(c(),d("div",xm,[$[16]||($[16]=n("h3",null,"Token 消耗趋势",-1)),n("div",Am,[n("div",Im,[(c(!0),d(Y,null,ct(e.value.trend.timestamps,(P,L)=>(c(),d("div",{key:L,class:"trend-bar-group"},[n("div",{class:"trend-bar input",style:St({height:p(e.value.trend.input[L],u.value)+"%"})},[e.value.trend.input[L]>0?(c(),d("span",Mm,"In: "+f(A(e.value.trend.input[L])),1)):M("",!0)],4),n("div",{class:"trend-bar output",style:St({height:p(e.value.trend.output[L],u.value)+"%"})},[e.value.trend.output[L]>0?(c(),d("span",Rm,"Out: "+f(A(e.value.trend.output[L])),1)):M("",!0)],4),n("span",Em,f(C(P)),1)]))),128))]),$[15]||($[15]=Ii('<div class="trend-legend" data-v-b98a8391><span class="legend-item" data-v-b98a8391><span class="legend-color input" data-v-b98a8391></span> Input</span><span class="legend-item" data-v-b98a8391><span class="legend-color output" data-v-b98a8391></span> Output</span></div>',1))])])):M("",!0),n("div",Pm,[n("button",{class:nt({active:i.value==="table"}),onClick:$[0]||($[0]=P=>i.value="table")},"📊 表格",2),n("button",{class:nt({active:i.value==="chart"}),onClick:$[1]||($[1]=P=>i.value="chart")},"📈 图表",2)]),i.value==="table"?(c(),d("div",Dm,[n("table",null,[$[19]||($[19]=n("thead",null,[n("tr",null,[n("th",null,"Agent"),n("th",null,"Input"),n("th",null,"Output"),n("th",null,"Cache"),n("th",null,"总计"),n("th",null,"占比")])],-1)),n("tbody",null,[(c(!0),d(Y,null,ct(v.value,P=>(c(),d("tr",{key:P.agent},[n("td",Fm,f(P.agent),1),n("td",null,f(A(P.input)),1),n("td",null,f(A(P.output)),1),n("td",null,f(A(P.cacheRead+P.cacheWrite)),1),n("td",Om,f(A(P.total)),1),n("td",null,[n("div",Lm,[n("div",{class:"percent-fill",style:St({width:P.percent*100+"%"})},null,4),n("span",Nm,f(S(P.percent)),1)])])]))),128))]),n("tfoot",null,[n("tr",null,[$[17]||($[17]=n("td",null,[n("strong",null,"合计")],-1)),n("td",null,f(A((q=e.value.summary)==null?void 0:q.input)),1),n("td",null,f(A((G=e.value.summary)==null?void 0:G.output)),1),n("td",null,f(A((((I=e.value.summary)==null?void 0:I.cacheRead)||0)+(((st=e.value.summary)==null?void 0:st.cacheWrite)||0))),1),n("td",jm,[n("strong",null,f(A((mt=e.value.summary)==null?void 0:mt.total)),1)]),$[18]||($[18]=n("td",null,"100%",-1))])])])])):(c(),d("div",Um,[$[20]||($[20]=n("h3",null,"Token 消耗分布",-1)),n("div",Vm,[(c(!0),d(Y,null,ct(v.value,P=>(c(),d("div",{key:P.agent,class:"bar-row"},[n("div",Wm,f(P.agent),1),n("div",Hm,[n("div",{class:"bar",style:St({width:P.percent*100+"%"})},[n("span",Bm,f(A(P.total)),1)],4)]),n("div",Km,f(S(P.percent)),1)]))),128))])]))],64))])}}}),Gm=Ct(qm,[["__scopeId","data-v-b98a8391"]]),zm={class:"performance-panel"},Jm={class:"panel-header"},Qm={class:"tab-switcher"},Ym={class:"panel-content"},Xm=wt({__name:"PerformancePanel",setup(t){const e=j("tpm");return(s,l)=>(c(),d("div",zm,[n("div",Jm,[l[2]||(l[2]=n("h2",null,"性能监控",-1)),n("div",Qm,[n("button",{class:nt(["tab-btn",{active:e.value==="tpm"}]),onClick:l[0]||(l[0]=i=>e.value="tpm")}," 📊 TPM/RPM ",2),n("button",{class:nt(["tab-btn",{active:e.value==="token"}]),onClick:l[1]||(l[1]=i=>e.value="token")}," 💰 Token 分析 ",2)])]),n("div",Ym,[Tt(bt(sm,null,null,512),[[fs,e.value==="tpm"]]),Tt(bt(Gm,null,null,512),[[fs,e.value==="token"]])])]))}}),Zm=Ct(Xm,[["__scopeId","data-v-7962ace4"]]),t1={class:"error-center"},e1={class:"header"},s1={class:"header-actions"},n1=["value"],l1=["value"],i1={class:"stats-row"},o1={class:"stat-card total"},a1={class:"stat-value"},r1={class:"stat-card session"},c1={class:"stat-value"},u1={class:"stat-card model"},d1={class:"stat-value"},f1={class:"stat-value"},h1={key:0,class:"trend-section"},p1={class:"trend-chart"},v1=["title"],g1={key:0,class:"bar-label"},m1={class:"trend-labels"},_1={key:1,class:"type-distribution"},y1={class:"type-bars"},b1={class:"type-bar-label"},$1={class:"type-bar-track"},k1={class:"type-count"},w1={key:2,class:"api-status-section"},C1={class:"api-status-grid"},T1={class:"api-header"},S1={class:"api-model"},x1={class:"api-provider"},A1={class:"api-status"},I1={class:"status-text"},M1={key:0,class:"api-last-error"},R1={class:"error-type"},E1={class:"error-time"},P1={key:1,class:"api-error-count"},D1={class:"error-lists"},F1={class:"error-group"},O1={class:"count-badge"},L1={key:0,class:"empty"},N1={key:1,class:"error-list"},j1=["onClick"],U1={class:"error-main"},V1={class:"error-agent"},W1={class:"error-msg"},H1={class:"error-time"},B1={class:"expand-icon"},K1={key:0,class:"error-detail"},q1={class:"detail-row"},G1={class:"detail-row"},z1={class:"detail-message"},J1={class:"error-group"},Q1={class:"count-badge"},Y1={key:0,class:"empty"},X1={key:1,class:"error-list"},Z1=["onClick"],t_={class:"error-main"},e_={class:"error-agent"},s_={class:"error-msg"},n_={class:"error-time"},l_={class:"expand-icon"},i_={key:0,class:"error-detail"},o_={class:"detail-row"},a_={class:"detail-row"},r_={class:"detail-message"},c_=wt({__name:"ErrorCenterPanel",setup(t){const e=j([]),s=j([]),l=j([]),i=j({totalCount:0,sessionErrorCount:0,modelFailureCount:0,byType:{},byAgent:{},hourlyTrend:[]}),o=j(!1),a=j(""),r=j(null),u=j(""),v=j(""),p=j([]),C={"rate-limit":{label:"Rate Limit",color:"#f59e0b"},"token-limit":{label:"Token 超限",color:"#8b5cf6"},timeout:{label:"超时",color:"#ef4444"},auth:{label:"认证失败",color:"#dc2626"},unknown:{label:"未知错误",color:"#6b7280"}},A=Q(()=>l.value.filter(H=>H.status==="healthy").length),S=Q(()=>{var H;return Math.max(...((H=i.value.hourlyTrend)==null?void 0:H.map(q=>q.count))||[1],1)});function m(H){return H/S.value*100}function T(H){const q=i.value.totalCount||1;return H/q*100}function D(H){var q;return((q=C[H])==null?void 0:q.color)||"#6b7280"}function $(H){const q=H.match(/(\d{2}):00/);return q?q[1]+"h":""}function k(H){if(!H)return"-";const G=Date.now()-H,I=Math.floor(G/6e4);if(I<1)return"刚刚";if(I<60)return`${I}分钟前`;const st=Math.floor(I/60);return st<24?`${st}小时前`:`${Math.floor(st/24)}天前`}function b(H,q){return H?H.length>q?H.slice(0,q)+"...":H:"-"}function R(H){return{healthy:"正常",degraded:"降级",down:"异常"}[H]||"未知"}function K(H){const q=p.value.find(G=>G.id===H);return q?q.name:H}function x(H){r.value=r.value===H?null:H}async function F(){try{const H=await fetch("/api/agents");if(H.ok){const q=await H.json();p.value=(Array.isArray(q)?q:[]).map(G=>({id:G.id,name:G.name||G.id}))}}catch(H){console.error("Failed to load agents:",H)}}async function X(){o.value=!0,a.value="";try{const H=new URLSearchParams;u.value&&H.set("agent",u.value),v.value&&H.set("type",v.value);const[q,G]=await Promise.all([fetch(`/api/errors/summary?${H.toString()}`),fetch("/api/errors/stats")]);if(q.ok){const I=await q.json();e.value=I.sessionErrors||[],s.value=I.modelFailures||[],l.value=I.apiStatus||[]}G.ok&&(i.value=await G.json())}catch(H){a.value=String(H)}finally{o.value=!1}}return Nt(()=>{F(),X()}),(H,q)=>{var G;return c(),d("section",t1,[n("div",e1,[q[4]||(q[4]=n("h2",null,"错误中心",-1)),n("div",s1,[Tt(n("select",{"onUpdate:modelValue":q[0]||(q[0]=I=>u.value=I),onChange:X,class:"filter-select"},[q[2]||(q[2]=n("option",{value:""},"全部 Agent",-1)),(c(!0),d(Y,null,ct(p.value,I=>(c(),d("option",{key:I.id,value:I.id},f(I.name),9,n1))),128))],544),[[Pe,u.value]]),Tt(n("select",{"onUpdate:modelValue":q[1]||(q[1]=I=>v.value=I),onChange:X,class:"filter-select"},[q[3]||(q[3]=n("option",{value:""},"全部类型",-1)),(c(),d(Y,null,ct(C,(I,st)=>n("option",{key:st,value:st},f(I.label),9,l1)),64))],544),[[Pe,v.value]]),n("button",{onClick:X,class:"refresh-btn"},"刷新")])]),n("div",i1,[n("div",o1,[n("div",a1,f(i.value.totalCount),1),q[5]||(q[5]=n("div",{class:"stat-label"},"总错误数",-1))]),n("div",r1,[n("div",c1,f(i.value.sessionErrorCount),1),q[6]||(q[6]=n("div",{class:"stat-label"},"Session 错误",-1))]),n("div",u1,[n("div",d1,f(i.value.modelFailureCount),1),q[7]||(q[7]=n("div",{class:"stat-label"},"Model 错误",-1))]),n("div",{class:nt(["stat-card",A.value===l.value.length?"healthy":"warning"])},[n("div",f1,f(A.value)+"/"+f(l.value.length),1),q[8]||(q[8]=n("div",{class:"stat-label"},"API 健康",-1))],2)]),(G=i.value.hourlyTrend)!=null&&G.length?(c(),d("div",h1,[q[9]||(q[9]=n("h3",null,"24 小时错误趋势",-1)),n("div",p1,[(c(!0),d(Y,null,ct(i.value.hourlyTrend,(I,st)=>(c(),d("div",{key:st,class:"trend-bar",style:St({height:m(I.count)+"%"}),title:`${I.hour}: ${I.count} 个错误`},[I.count>0?(c(),d("span",g1,f(I.count),1)):M("",!0)],12,v1))),128))]),n("div",m1,[(c(!0),d(Y,null,ct(i.value.hourlyTrend,(I,st)=>(c(),d("span",{key:st,class:"trend-time"},f(st%4===0?$(I.hour):""),1))),128))])])):M("",!0),Object.keys(i.value.byType||{}).length?(c(),d("div",_1,[q[10]||(q[10]=n("h3",null,"错误类型分布",-1)),n("div",y1,[(c(!0),d(Y,null,ct(i.value.byType,(I,st)=>(c(),d("div",{key:st,class:"type-bar-item"},[n("div",b1,[n("span",{class:"type-dot",style:St({background:I.color})},null,4),At(" "+f(I.label),1)]),n("div",$1,[n("div",{class:"type-bar-fill",style:St({width:T(I.count)+"%",background:I.color})},null,4)]),n("span",k1,f(I.count),1)]))),128))])])):M("",!0),l.value.length?(c(),d("div",w1,[q[11]||(q[11]=n("h3",null,"API 状态",-1)),n("div",C1,[(c(!0),d(Y,null,ct(l.value,I=>(c(),d("div",{key:I.model,class:nt(["api-status-card",`status-${I.status}`])},[n("div",T1,[n("span",S1,f(I.model),1),n("span",x1,f(I.provider),1)]),n("div",A1,[n("span",{class:nt(["status-dot",`status-${I.status}`])},null,2),n("span",I1,f(R(I.status)),1)]),I.lastError?(c(),d("div",M1,[n("span",R1,f(I.lastError.type),1),n("span",E1,f(k(I.lastError.timestamp)),1)])):M("",!0),I.errorCount>0?(c(),d("div",P1," 错误: "+f(I.errorCount)+" 次 ",1)):M("",!0)],2))),128))])])):M("",!0),n("div",D1,[n("div",F1,[n("h3",null,[q[12]||(q[12]=At("Session 错误 ",-1)),n("span",O1,f(e.value.length),1)]),e.value.length?(c(),d("div",N1,[(c(!0),d(Y,null,ct(e.value,I=>(c(),d("div",{key:I.id,class:nt(["error-item",`severity-${I.severity}`]),onClick:st=>x(I.id)},[n("div",U1,[n("span",V1,f(K(I.agentId)),1),n("span",{class:"error-type",style:St({color:D(I.type)})},f(I.typeLabel),5),n("span",W1,f(b(I.message,80)),1),n("span",H1,f(k(I.timestamp)),1),n("span",B1,f(r.value===I.id?"▼":"▶"),1)]),r.value===I.id?(c(),d("div",K1,[n("div",q1,[q[13]||(q[13]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(I.datetime),1)]),n("div",G1,[q[14]||(q[14]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",z1,f(I.fullMessage||I.message),1)])])):M("",!0)],10,j1))),128))])):(c(),d("div",L1,"暂无错误"))]),n("div",J1,[n("h3",null,[q[15]||(q[15]=At("Model Failures ",-1)),n("span",Q1,f(s.value.length),1)]),s.value.length?(c(),d("div",X1,[(c(!0),d(Y,null,ct(s.value,I=>(c(),d("div",{key:I.id,class:nt(["error-item",`severity-${I.severity}`]),onClick:st=>x(I.id)},[n("div",t_,[n("span",e_,f(I.model),1),n("span",{class:"error-type",style:St({color:D(I.type)})},f(I.typeLabel),5),n("span",s_,f(b(I.message,80)),1),n("span",n_,f(k(I.timestamp)),1),n("span",l_,f(r.value===I.id?"▼":"▶"),1)]),r.value===I.id?(c(),d("div",i_,[n("div",o_,[q[16]||(q[16]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(I.datetime),1)]),n("div",a_,[q[17]||(q[17]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",r_,f(I.fullMessage||I.message),1)])])):M("",!0)],10,Z1))),128))])):(c(),d("div",Y1,"暂无错误"))])])])}}}),u_=Ct(c_,[["__scopeId","data-v-ca874c41"]]),d_={class:"version-display"},f_={key:0,class:"loading-text"},h_={key:1,class:"error-text"},p_={key:0,class:"tooltip"},v_={class:"tooltip-item"},g_={class:"tooltip-item"},m_={class:"tooltip-item"},__={key:0,class:"tooltip-item"},y_={key:1,class:"tooltip-item"},b_=wt({__name:"VersionDisplay",setup(t){const e=j(!0),s=j(!1),l=j({version:"",name:"",description:""}),i=j(!1),o=Q(()=>l.value.name&&l.value.version?`${l.value.name} v${l.value.version}`:l.value.version||"v?"),a=u=>{try{return new Date(u).toLocaleString("zh-CN")}catch{return u}},r=async()=>{try{e.value=!0,s.value=!1;const u=`${window.location.origin}/api/version`,v=await fetch(u,{headers:{Accept:"application/json"},cache:"no-store"});if(!v.ok){const p=await v.text().catch(()=>"");throw new Error(`HTTP ${v.status}${p?`: ${p.slice(0,120)}`:""}`)}l.value=await v.json()}catch(u){console.error("获取版本信息失败:",u),s.value=!0}finally{e.value=!1}};return Nt(()=>{r()}),(u,v)=>(c(),d("div",d_,[e.value?(c(),d("span",f_,"加载中...")):s.value?(c(),d("span",h_,"版本信息获取失败")):(c(),d(Y,{key:2},[n("span",{class:"version-text",onMouseenter:v[0]||(v[0]=p=>i.value=!0),onMouseleave:v[1]||(v[1]=p=>i.value=!1)},f(o.value),33),i.value?(c(),d("div",p_,[n("div",v_,[v[2]||(v[2]=n("strong",null,"名称:",-1)),At(" "+f(l.value.name),1)]),n("div",g_,[v[3]||(v[3]=n("strong",null,"版本:",-1)),At(" "+f(l.value.version),1)]),n("div",m_,[v[4]||(v[4]=n("strong",null,"描述:",-1)),At(" "+f(l.value.description),1)]),l.value.build_date?(c(),d("div",__,[v[5]||(v[5]=n("strong",null,"构建时间:",-1)),At(" "+f(a(l.value.build_date)),1)])):M("",!0),l.value.git_commit?(c(),d("div",y_,[v[6]||(v[6]=n("strong",null,"Git 提交:",-1)),At(" "+f(l.value.git_commit),1)])):M("",!0)])):M("",!0)],64))]))}}),$_=Ct(b_,[["__scopeId","data-v-87a575a1"]]),k_={id:"app"},w_={class:"controls"},C_={class:"collaboration-section"},T_={class:"task-status-section"},S_={class:"performance-section"},x_={class:"error-center-section"},A_=wt({__name:"App",setup(t){const e=Fi(),s=Qf(),l=Xf();ks("realtimeManager",e),ks("stateManager",s),ks("eventDispatcher",l);const i=j([]),o=j(null),a=j(!1),r=j({status:"disconnected",reconnectAttempts:0}),u=Q(()=>{switch(r.value.status){case"connected":return"已连接";case"connecting":return"连接中...";case"disconnected":return"未连接";case"error":return"连接错误";default:return"未知"}}),v=j(null),p=j("main"),C=j([]);async function A(){try{const[R,K]=await Promise.all([fetch("/api/agents"),fetch("/api/config").catch(()=>null)]),x=await R.json();if(i.value=Array.isArray(x)?x:[],K!=null&&K.ok){const H=await K.json();p.value=H&&H.mainAgentId||"main"}const F=Array.isArray(i.value)?i.value:[],X=F.find(H=>H.id===p.value);X&&(v.value=X),C.value=F.filter(H=>H.id!==p.value)}catch(R){console.error("刷新数据失败:",R)}}function S(R){o.value=R}function m(R){const K=R.id===p.value?v.value:C.value.find(x=>x.id===R.id);S(K||{id:R.id,name:R.name,role:R.id===p.value?"主 Agent":"子 Agent",status:R.status==="error"?"down":R.status})}function T(R){A()}function D(R){r.value=R}let $=null,k=null,b=null;return Nt(()=>{A(),e.connect(),$=e.onStateChange(D),k=e.subscribe("agents",R=>{if(Array.isArray(R)){i.value=R;const K=R.find(x=>x.id===p.value);v.value=K||null,C.value=R.filter(x=>x.id!==p.value)}}),b=e.subscribe("agents_update",R=>{if(Array.isArray(R)){R.forEach(x=>{const F=i.value.findIndex(X=>X.id===x.id);F>=0&&(i.value[F]={...i.value[F],...x})});const K=i.value.find(x=>x.id===p.value);K&&(v.value=K),C.value=i.value.filter(x=>x.id!==p.value)}})}),ae(()=>{$==null||$(),k==null||k(),b==null||b(),e.disconnect()}),(R,K)=>(c(),d("div",k_,[n("header",null,[K[3]||(K[3]=n("h1",null,"OpenClaw Agent Dashboard",-1)),n("div",w_,[bt($_),n("button",{onClick:A},"刷新"),n("button",{onClick:K[0]||(K[0]=x=>a.value=!0)},"⚙️ 设置"),n("span",{class:nt(["connection-status",r.value.status])},f(u.value),3)])]),n("main",null,[n("section",C_,[bt(jp,{"main-agent":v.value,"sub-agents":C.value,"main-agent-id":p.value,onAgentClick:m},null,8,["main-agent","sub-agents","main-agent-id"])]),n("section",T_,[bt(Lv)]),n("section",S_,[bt(Zm)]),n("section",x_,[bt(u_)])]),a.value?(c(),Gt(qf,{key:0,onClose:K[1]||(K[1]=x=>a.value=!1),onSettingsChanged:T})):M("",!0),o.value?(c(),Gt(Pf,{key:1,agent:o.value,onClose:K[2]||(K[2]=x=>o.value=null)},null,8,["agent"])):M("",!0)]))}}),I_=Ct(A_,[["__scopeId","data-v-543ef282"]]);er(I_).mount("#app");
@@ -4,9 +4,10 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>OpenClow Agent Dashboard</title>
7
+ <script type="module" crossorigin src="/assets/index-CxJaSYyo.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-B7XqKAxm.css">
7
9
  </head>
8
10
  <body>
9
11
  <div id="app"></div>
10
- <script type="module" src="/src/main.ts"></script>
11
12
  </body>
12
13
  </html>
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-agent-dashboard",
3
3
  "name": "OpenClaw Agent Dashboard",
4
4
  "description": "多 Agent 可视化看板 - 状态、任务、API、工作流、协作流程",
5
- "version": "1.0.20",
5
+ "version": "1.0.23",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
@@ -14,4 +14,4 @@
14
14
  }
15
15
  }
16
16
  }
17
- }
17
+ }