openclaw-agent-dashboard 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/api/collaboration.py +42 -35
- package/dashboard/data/session_reader.py +21 -14
- package/dashboard/data/timeline_reader.py +206 -37
- package/frontend-dist/assets/{index-CVnP0JTr.js → index-DyRXGevD.js} +8 -8
- package/frontend-dist/assets/{index-DsWSoANz.css → index-cYIOn3Wq.css} +1 -1
- package/frontend-dist/index.html +2 -2
- package/package.json +1 -1
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* @vue/reactivity v3.5.29
|
|
7
7
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
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 Ll{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 Ol=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(){Ol++}function Sn(){if(--Ol>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=d=>{d&&d.trigger()};if(Tn(),e==="clear")a.forEach(r);else{const d=rt(t),v=d&&wn(s);if(d&&s==="length"){const p=Number(l);a.forEach((C,I)=>{(I==="length"||I===as||!ie(I)&&I>=p)&&r(C)})}else switch((s!==void 0||a.has(void 0))&&r(a.get(s)),v&&r(a.get(as)),e){case"add":d?v&&r(a.get("length")):(r(a.get(Re)),je(t)&&r(a.get(on)));break;case"delete":d||(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=>rt(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),d=a[e];if(d!==Zi[e]){const C=d.apply(t,o);return r?Jt(C):C}let v=s;a!==t&&(r?v=function(C,I){return s.call(this,be(t,C),I,t)}:s.length>2&&(v=function(C,I){return s.call(this,C,I,t)}));const p=d.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,d){return s.call(this,a,r,d,t)}):o=function(a,r,d){return s.call(this,a,be(t,r),d,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=rt(e);if(!i){let d;if(a&&(d=Xi[s]))return d;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 d=a&&wn(s)?r:r.value;return i&&_t(d)?rn(d):d}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=rt(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),d=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)),d}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",rt(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,d=t==="keys"&&a,v=i[t](...l),p=s?an:e?We:Jt;return!e&&Et(o,"iterate",d?on:Re),Mt(Object.create(v),{next(){const{value:C,done:I}=v.next();return I?{value:C,done:I}:{value:r?[p(C[0]),p(C[1])]:p(C),done:I}}})}}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:d}=ms(a),v=e?an:t?We:Jt;if(d.call(a,i))return v(o.get(i));if(d.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,d=ht(r),v=e?an:t?We:Jt;return!t&&Et(d,"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:d}=ms(a);let v=r.call(a,i);v||(i=ht(i),v=r.call(a,i));const p=d.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 d=a.call(o,i);d||(i=ht(i),d=a.call(o,i)),r&&r.call(o,i);const v=o.delete(i);return d&&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 W(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:d}=s,v=w=>i?w:qt(w)||i===!1||i===0?fe(w,1):fe(w);let p,C,I,S,_=!1,T=!1;if(Pt(t)?(C=()=>t.value,_=qt(t)):Ee(t)?(C=()=>v(t),_=!0):rt(t)?(T=!0,_=t.some(w=>Ee(w)||qt(w)),C=()=>t.map(w=>{if(Pt(w))return w.value;if(Ee(w))return v(w);if(ut(w))return d?d(w,2):w()})):ut(t)?e?C=d?()=>d(t,2):t:C=()=>{if(I){pe();try{I()}finally{ve()}}const w=Ie;Ie=p;try{return d?d(t,3,[S]):t(S)}finally{Ie=w}}:C=ne,e&&i){const w=C,G=i===!0?1/0:i;C=()=>fe(w(),G)}const O=Ji(),$=()=>{p.stop(),O&&O.active&&kn(O.effects,p)};if(o&&e){const w=e;e=(...G)=>{w(...G),$()}}let x=T?new Array(t.length).fill(ys):ys;const y=w=>{if(!(!(p.flags&1)||!p.dirty&&!w))if(e){const G=p.run();if(i||_||(T?G.some((P,j)=>we(P,x[j])):we(G,x))){I&&I();const P=Ie;Ie=p;try{const j=[G,x===ys?void 0:T&&x[0]===ys?[]:x,S];x=G,d?d(e,3,j):e(...j)}finally{Ie=P}}}else p.run()};return r&&r(y),p=new Ll(C),p.scheduler=a?()=>a(y,!1):y,S=w=>ko(w,!1,p),I=p.onStop=()=>{const w=As.get(p);if(w){if(d)d(w,4);else for(const G of w)G();As.delete(p)}},e?l?y(!0):x=p.run():a?a(y.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(rt(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}/**
|
|
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 Ll{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 Ol=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(){Ol++}function Sn(){if(--Ol>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=d=>{d&&d.trigger()};if(Tn(),e==="clear")a.forEach(r);else{const d=rt(t),v=d&&wn(s);if(d&&s==="length"){const p=Number(l);a.forEach((C,I)=>{(I==="length"||I===as||!ie(I)&&I>=p)&&r(C)})}else switch((s!==void 0||a.has(void 0))&&r(a.get(s)),v&&r(a.get(as)),e){case"add":d?v&&r(a.get("length")):(r(a.get(Re)),je(t)&&r(a.get(on)));break;case"delete":d||(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=>rt(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),d=a[e];if(d!==Zi[e]){const C=d.apply(t,o);return r?Jt(C):C}let v=s;a!==t&&(r?v=function(C,I){return s.call(this,be(t,C),I,t)}:s.length>2&&(v=function(C,I){return s.call(this,C,I,t)}));const p=d.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,d){return s.call(this,a,r,d,t)}):o=function(a,r,d){return s.call(this,a,be(t,r),d,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=rt(e);if(!i){let d;if(a&&(d=Xi[s]))return d;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 d=a&&wn(s)?r:r.value;return i&&_t(d)?rn(d):d}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=rt(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),d=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)),d}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",rt(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,d=t==="keys"&&a,v=i[t](...l),p=s?an:e?We:Jt;return!e&&Et(o,"iterate",d?on:Re),Mt(Object.create(v),{next(){const{value:C,done:I}=v.next();return I?{value:C,done:I}:{value:r?[p(C[0]),p(C[1])]:p(C),done:I}}})}}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:d}=ms(a),v=e?an:t?We:Jt;if(d.call(a,i))return v(o.get(i));if(d.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,d=ht(r),v=e?an:t?We:Jt;return!t&&Et(d,"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:d}=ms(a);let v=r.call(a,i);v||(i=ht(i),v=r.call(a,i));const p=d.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 d=a.call(o,i);d||(i=ht(i),d=a.call(o,i)),r&&r.call(o,i);const v=o.delete(i);return d&&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 W(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:d}=s,v=w=>i?w:qt(w)||i===!1||i===0?fe(w,1):fe(w);let p,C,I,S,k=!1,x=!1;if(Pt(t)?(C=()=>t.value,k=qt(t)):Ee(t)?(C=()=>v(t),k=!0):rt(t)?(x=!0,k=t.some(w=>Ee(w)||qt(w)),C=()=>t.map(w=>{if(Pt(w))return w.value;if(Ee(w))return v(w);if(ut(w))return d?d(w,2):w()})):ut(t)?e?C=d?()=>d(t,2):t:C=()=>{if(I){pe();try{I()}finally{ve()}}const w=Ie;Ie=p;try{return d?d(t,3,[S]):t(S)}finally{Ie=w}}:C=ne,e&&i){const w=C,K=i===!0?1/0:i;C=()=>fe(w(),K)}const T=Ji(),b=()=>{p.stop(),T&&T.active&&kn(T.effects,p)};if(o&&e){const w=e;e=(...K)=>{w(...K),b()}}let M=x?new Array(t.length).fill(ys):ys;const _=w=>{if(!(!(p.flags&1)||!p.dirty&&!w))if(e){const K=p.run();if(i||k||(x?K.some((P,N)=>we(P,M[N])):we(K,M))){I&&I();const P=Ie;Ie=p;try{const N=[K,M===ys?void 0:x&&M[0]===ys?[]:M,S];M=K,d?d(e,3,N):e(...N)}finally{Ie=P}}}else p.run()};return r&&r(_),p=new Ll(C),p.scheduler=a?()=>a(_,!1):_,S=w=>ko(w,!1,p),I=p.onStop=()=>{const w=As.get(p);if(w){if(d)d(w,4);else for(const K of w)K();As.delete(p)}},e?l?_(!0):M=p.run():a?a(_.bind(null,!0),!0):p.run(),b.pause=p.pause.bind(p),b.resume=p.resume.bind(p),b.stop=b,b}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(rt(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
10
|
* @vue/runtime-core v3.5.29
|
|
11
11
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
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(rt(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 d=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,d,v)===!1)return}r=r.parent}if(o){pe(),vs(o,null,10,[t,d,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 Lt=[];let ee=-1;const Ue=[];let $e=null,Oe=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=Lt.length;for(;e<s;){const l=e+s>>>1,i=Lt[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=Lt[Lt.length-1];!s||!(t.flags&2)&&e>=cs(s)?Lt.push(t):Lt.splice(To(e),0,t),t.flags|=1,Xl()}}function Xl(){Is||(Is=Yl.then(ti))}function So(t){rt(t)?Ue.push(...t):$e&&t.id===-1?$e.splice(Oe+1,0,t):t.flags&1||(Ue.push(t),t.flags|=1),Xl()}function Gn(t,e,s=ee+1){for(;s<Lt.length;s++){const l=Lt[s];if(l&&l.flags&2){if(t&&l.id!==t.uid)continue;Lt.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,Oe=0;Oe<$e.length;Oe++){const s=$e[Oe];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}$e=null,Oe=0}}const cs=t=>t.id==null?t.flags&2?-1:1/0:t.id;function ti(t){try{for(ee=0;ee<Lt.length;ee++){const e=Lt[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<Lt.length;ee++){const e=Lt[ee];e&&(e.flags&=-2)}ee=-1,Lt.length=0,Zl(),Is=null,(Lt.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,d=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:d}))}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 d=r.dir[l];d&&(pe(),oe(d,s,8,[t.el,r,t,e]),ve())}}function ks(t,e){if(Ot){let s=Ot.provides;const l=Ot.parent&&Ot.parent.provides;l===s&&(s=Ot.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),d=e&&l||!e&&o!=="post";let v;if(ds){if(o==="sync"){const S=Io();v=S.__watcherHandles||(S.__watcherHandles=[])}else if(!d){const S=()=>{};return S.stop=ne,S.resume=ne,S.pause=ne,S}}const p=Ot;r.call=(S,_,T)=>oe(S,p,_,T);let C=!1;o==="post"?r.scheduler=S=>{Rt(S,p&&p.suspense)}:o!=="sync"&&(C=!0,r.scheduler=(S,_)=>{_?S():Pn(S)}),r.augmentJob=S=>{e&&(S.flags|=4),C&&(S.flags|=2,p&&(S.id=p.uid,S.i=p))};const I=wo(t,e,r);return ds&&(v?v.push(I):d&&I()),I}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,d,v){const{mc:p,pc:C,pbc:I,o:{insert:S,querySelector:_,createText:T,createComment:O}}=v,$=es(e.props);let{shapeFlag:x,children:y,dynamicChildren:w}=e;if(t==null){const G=e.el=T(""),P=e.anchor=T("");S(G,s,l),S(P,s,l);const j=(D,K)=>{x&16&&p(y,D,K,i,o,a,r,d)},Z=()=>{const D=e.target=cn(e.props,_),K=un(D,e,T,S);D&&(a!=="svg"&&Jn(D)?a="svg":a!=="mathml"&&Qn(D)&&(a="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(D),$||(j(D,K),Cs(e,!1)))};$&&(j(s,P),Cs(e,!0)),zn(e.props)?(e.el.__isMounted=!1,Rt(()=>{Z(),delete e.el.__isMounted},o)):Z()}else{if(zn(e.props)&&t.el.__isMounted===!1){Rt(()=>{ii.process(t,e,s,l,i,o,a,r,d,v)},o);return}e.el=t.el,e.targetStart=t.targetStart;const G=e.anchor=t.anchor,P=e.target=t.target,j=e.targetAnchor=t.targetAnchor,Z=es(t.props),D=Z?s:P,K=Z?G:j;if(a==="svg"||Jn(P)?a="svg":(a==="mathml"||Qn(P))&&(a="mathml"),w?(I(t.dynamicChildren,w,D,i,o,a,r),On(t,e,!0)):d||C(t,e,D,K,i,o,a,r,!1),$)Z?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):bs(e,s,G,v,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const q=e.target=cn(e.props,_);q&&bs(e,q,null,v,0)}else Z&&bs(e,P,j,v,1);Cs(e,$)}},remove(t,e,s,{um:l,o:{remove:i}},o){const{shapeFlag:a,children:r,anchor:d,targetStart:v,targetAnchor:p,target:C,props:I}=t;if(C&&(i(v),i(p)),o&&i(d),a&16){const S=o||!es(I);for(let _=0;_<r.length;_++){const T=r[_];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:d,children:v,props:p}=t,C=o===2;if(C&&l(a,e,s),(!C||es(p))&&d&16)for(let I=0;I<v.length;I++)i(v[I],e,s,2);C&&l(r,e,s)}function Eo(t,e,s,l,i,o,{o:{nextSibling:a,parentNode:r,querySelector:d,insert:v,createText:p}},C){function I(O,$){let x=$;for(;x;){if(x&&x.nodeType===8){if(x.data==="teleport start anchor")e.targetStart=x;else if(x.data==="teleport anchor"){e.targetAnchor=x,O._lpa=e.targetAnchor&&a(e.targetAnchor);break}}x=a(x)}}function S(O,$){$.anchor=C(a(O),$,r(O),s,l,i,o)}const _=e.target=cn(e.props,d),T=es(e.props);if(_){const O=_._lpa||_.firstChild;e.shapeFlag&16&&(T?(S(t,e),I(_,O),e.targetAnchor||un(_,e,p,v,r(t)===_?t:null)):(e.anchor=a(t),I(_,O),e.targetAnchor||un(_,e,p,v),C(O&&a(O),e,_,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(rt(t)){t.forEach((T,O)=>ss(T,e&&(rt(e)?e[O]: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:d}=t,v=e&&e.r,p=r.refs===yt?r.refs={}:r.refs,C=r.setupState,I=ht(C),S=C===yt?xl:T=>Yn(p,T)?!1:pt(I,T),_=(T,O)=>!(O&&Yn(p,O));if(v!=null&&v!==d){if(Xn(e),xt(v))p[v]=null,S(v)&&(C[v]=null);else if(Pt(v)){const T=e;_(v,T.k)&&(v.value=null),T.k&&(p[T.k]=null)}}if(ut(d))vs(d,r,12,[a,p]);else{const T=xt(d),O=Pt(d);if(T||O){const $=()=>{if(t.f){const x=T?S(d)?C[d]:p[d]:_()||!t.k?d.value:p[t.k];if(i)rt(x)&&kn(x,o);else if(rt(x))x.includes(o)||x.push(o);else if(T)p[d]=[o],S(d)&&(C[d]=p[d]);else{const y=[o];_(d,t.k)&&(d.value=y),t.k&&(p[t.k]=y)}}else T?(p[d]=a,S(d)&&(C[d]=a)):O&&(_(d,t.k)&&(d.value=a),t.k&&(p[t.k]=a))};if(a){const x=()=>{$(),Rs.delete(t)};x.id=-1,Rs.set(t,x),Rt(x,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 Lo(t,e){ri(t,"da",e)}function ri(t,e,s=Ot){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)&&Oo(l,e,s,i),i=i.parent}}function Oo(t,e,s,l){const i=Vs(e,t,l,!0);ae(()=>{kn(l[e],i)},s)}function Vs(t,e,s=Ot,l=!1){if(s){const i=s[t]||(s[t]=[]),o=e.__weh||(e.__weh=(...a)=>{pe();const r=gs(s),d=oe(e,s,t,a);return r(),ve(),d});return l?i.unshift(o):i.push(o),o}}const me=t=>(e,s=Ot)=>{(!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=Ot){Vs("ec",t,e)}const Ko=Symbol.for("v-ndc");function ct(t,e,s,l){let i;const o=s,a=rt(t);if(a||xt(t)){const r=a&&Ee(t);let d=!1,v=!1;r&&(d=!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(d?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,d)=>e(r,d,void 0,o));else{const r=Object.keys(t);i=new Array(r.length);for(let d=0,v=r.length;d<v;d++){const p=r[d];i[d]=e(t[p],p,d,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:d}=t;if(e[0]!=="$"){const I=a[e];if(I!==void 0)switch(I){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=d.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 d;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)||(d=a.__cssModules)&&d[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 rt(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:d,inject:v,created:p,beforeMount:C,mounted:I,beforeUpdate:S,updated:_,activated:T,deactivated:O,beforeDestroy:$,beforeUnmount:x,destroyed:y,unmounted:w,render:G,renderTracked:P,renderTriggered:j,errorCaptured:Z,serverPrefetch:D,expose:K,inheritAttrs:q,components:A,directives:st,filters:mt}=e;if(v&&zo(v,l,null),a)for(const X in a){const it=a[X];ut(it)&&(l[X]=it.bind(s))}if(i){const X=i.call(s,s);_t(X)&&(t.data=Mn(X))}if(fn=!0,o)for(const X in o){const it=o[X],V=ut(it)?it.bind(s,s):ut(it.get)?it.get.bind(s,s):ne,H=!ut(it)&&ut(it.set)?it.set.bind(s):ne,ot=Q({get:V,set:H});Object.defineProperty(l,X,{enumerable:!0,configurable:!0,get:()=>ot.value,set:lt=>ot.value=lt})}if(r)for(const X in r)ui(r[X],l,s,X);if(d){const X=ut(d)?d.call(s):d;Reflect.ownKeys(X).forEach(it=>{ks(it,X[it])})}p&&tl(p,t,"c");function U(X,it){rt(it)?it.forEach(V=>X(V.bind(s))):it&&X(it.bind(s))}if(U(No,C),U(Nt,I),U(jo,S),U(Uo,_),U(Fo,T),U(Lo,O),U(ci,Z),U(Bo,P),U(Ho,j),U(Vo,x),U(ae,w),U(Wo,D),rt(K))if(K.length){const X=t.exposed||(t.exposed={});K.forEach(it=>{Object.defineProperty(X,it,{get:()=>s[it],set:V=>s[it]=V,enumerable:!0})})}else t.exposed||(t.exposed={});G&&t.render===ne&&(t.render=G),q!=null&&(t.inheritAttrs=q),A&&(t.components=A),st&&(t.directives=st),D&&oi(t)}function zo(t,e,s=ne){rt(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(rt(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(rt(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 d;return r?d=r:!i.length&&!s&&!l?d=e:(d={},i.length&&i.forEach(v=>Es(d,v,a,!0)),Es(d,e,a)),_t(e)&&o.set(e,d),d}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(rt(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?rt(t)&&rt(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 d=!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,I){if(!d){const S=v._ceVNode||bt(l,i);return S.appContext=o,I===!0?I="svg":I===!1&&(I=void 0),t(S,p,I),d=!0,v._container=p,p.__vue_app__=v,Bs(S.component)}},onUnmount(p){r.push(p)},unmount(){d&&(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(Os)));let r,d=l[r=Ks(e)]||l[r=Ks(Ce(e))];!d&&o&&(d=l[r=Ks(De(e))]),d&&oe(d,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 d=v=>{const p=hi(v,e,!0);p&&(r=!0,Mt(a,p))};!s&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}return!o&&!r?(_t(t)&&l.set(t,null),null):(rt(o)?o.forEach(d=>a[d]=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:d,render:v,renderCache:p,props:C,data:I,setupState:S,ctx:_,inheritAttrs:T}=t,O=Ms(t);let $,x;try{if(s.shapeFlag&4){const w=i||l,G=w;$=se(v.call(G,w,p,C,S,I,_)),x=r}else{const w=e;$=se(w.length>1?w(C,{attrs:r,slots:a,emit:d}):w(C,null)),x=e.props?r:na(r)}}catch(w){is.length=0,Us(w,t,1),$=bt(Te)}let y=$;if(x&&T!==!1){const w=Object.keys(x),{shapeFlag:G}=y;w.length&&G&7&&(o&&w.some($n)&&(x=la(x,o)),y=He(y,x,!1,!0))}return s.dirs&&(y=He(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(s.dirs):s.dirs),s.transition&&Dn(y,s.transition),$=y,Ms(O),$}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:d}=e,v=o.emitsOptions;if(e.dirs||e.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return l?ll(l,a,v):!!a;if(d&8){const p=e.dynamicProps;for(let C=0;C<p.length;C++){const I=p[C];if(pi(a,l,I)&&!Ws(v,I))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),[d]=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 I=p[C];if(Ws(t.emitsOptions,I))continue;const S=e[I];if(d)if(pt(o,I))S!==o[I]&&(o[I]=S,v=!0);else{const _=Ce(I);i[_]=pn(d,r,_,S,t,!1)}else S!==o[I]&&(o[I]=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)))&&(d?s&&(s[C]!==void 0||s[p]!==void 0)&&(i[C]=pn(d,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 d in e){if(Xe(d))continue;const v=e[d];let p;i&&pt(i,p=Ce(d))?!o||!o.includes(p)?s[p]=v:(r||(r={}))[p]=v:Ws(t.emitsOptions,d)||(!(d in l)||v!==l[d])&&(l[d]=v,a=!0)}if(o){const d=ht(s),v=r||yt;for(let p=0;p<o.length;p++){const C=o[p];s[C]=pn(i,d,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 d=a.default;if(a.type!==Function&&!a.skipFactory&&ut(d)){const{propsDefaults:v}=i;if(s in v)l=v[s];else{const p=gs(i);l=v[s]=d.call(null,e),p()}}else l=d;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 d=!1;if(!ut(t)){const p=C=>{d=!0;const[I,S]=yi(C,e,!0);Mt(a,I),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&&!d)return _t(t)&&l.set(t,Ne),Ne;if(rt(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 I=o[p],S=a[C]=rt(I)||ut(I)?{type:I}:Mt({},I),_=S.type;let T=!1,O=!0;if(rt(_))for(let $=0;$<_.length;++$){const x=_[$],y=ut(x)&&x.name;if(y==="Boolean"){T=!0;break}else y==="String"&&(O=!1)}else T=ut(_)&&_.name==="Boolean";S[0]=T,S[1]=O,(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",Ln=t=>rt(t)?t.map(se):[se(t)],ua=(t,e,s)=>{if(e._n)return e;const l=xo((...i)=>Ln(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=Ln(o);e[i]=()=>a}}},$i=(t,e)=>{const s=Ln(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:d,setText:v,setElementText:p,parentNode:C,nextSibling:I,setScopeId:S=ne,insertStaticContent:_}=t,T=(h,b,R,B=null,g=null,m=null,L=void 0,E=null,N=!!b.dynamicChildren)=>{if(h===b)return;h&&!Je(h,b)&&(B=Dt(h),lt(h,g,m,!0),h=null),b.patchFlag===-2&&(N=!1,b.dynamicChildren=null);const{type:k,ref:J,shapeFlag:z}=b;switch(k){case Hs:O(h,b,R,B);break;case Te:$(h,b,R,B);break;case Ts:h==null&&x(b,R,B,L);break;case Y:A(h,b,R,B,g,m,L,E,N);break;default:z&1?G(h,b,R,B,g,m,L,E,N):z&6?st(h,b,R,B,g,m,L,E,N):(z&64||z&128)&&k.process(h,b,R,B,g,m,L,E,N,Qt)}J!=null&&g?ss(J,h&&h.ref,m,b||h,!b):J==null&&h&&h.ref!=null&&ss(h.ref,null,m,h,!0)},O=(h,b,R,B)=>{if(h==null)l(b.el=r(b.children),R,B);else{const g=b.el=h.el;b.children!==h.children&&v(g,b.children)}},$=(h,b,R,B)=>{h==null?l(b.el=d(b.children||""),R,B):b.el=h.el},x=(h,b,R,B)=>{[h.el,h.anchor]=_(h.children,b,R,B,h.el,h.anchor)},y=({el:h,anchor:b},R,B)=>{let g;for(;h&&h!==b;)g=I(h),l(h,R,B),h=g;l(b,R,B)},w=({el:h,anchor:b})=>{let R;for(;h&&h!==b;)R=I(h),i(h),h=R;i(b)},G=(h,b,R,B,g,m,L,E,N)=>{if(b.type==="svg"?L="svg":b.type==="math"&&(L="mathml"),h==null)P(b,R,B,g,m,L,E,N);else{const k=h.el&&h.el._isVueCE?h.el:null;try{k&&k._beginPatch(),D(h,b,g,m,L,E,N)}finally{k&&k._endPatch()}}},P=(h,b,R,B,g,m,L,E)=>{let N,k;const{props:J,shapeFlag:z,transition:et,dirs:at}=h;if(N=h.el=a(h.type,m,J&&J.is,J),z&8?p(N,h.children):z&16&&Z(h.children,N,null,B,g,Ys(h,m),L,E),at&&xe(h,null,B,"created"),j(N,h,h.scopeId,L,B),J){for(const vt in J)vt!=="value"&&!Xe(vt)&&o(N,vt,null,J[vt],m,B);"value"in J&&o(N,"value",null,J.value,m),(k=J.onVnodeBeforeMount)&&te(k,B,h)}at&&xe(h,null,B,"beforeMount");const dt=va(g,et);dt&&et.beforeEnter(N),l(N,b,R),((k=J&&J.onVnodeMounted)||dt||at)&&Rt(()=>{k&&te(k,B,h),dt&&et.enter(N),at&&xe(h,null,B,"mounted")},g)},j=(h,b,R,B,g)=>{if(R&&S(h,R),B)for(let m=0;m<B.length;m++)S(h,B[m]);if(g){let m=g.subTree;if(b===m||Ti(m.type)&&(m.ssContent===b||m.ssFallback===b)){const L=g.vnode;j(h,L,L.scopeId,L.slotScopeIds,g.parent)}}},Z=(h,b,R,B,g,m,L,E,N=0)=>{for(let k=N;k<h.length;k++){const J=h[k]=E?ue(h[k]):se(h[k]);T(null,J,b,R,B,g,m,L,E)}},D=(h,b,R,B,g,m,L)=>{const E=b.el=h.el;let{patchFlag:N,dynamicChildren:k,dirs:J}=b;N|=h.patchFlag&16;const z=h.props||yt,et=b.props||yt;let at;if(R&&Ae(R,!1),(at=et.onVnodeBeforeUpdate)&&te(at,R,b,h),J&&xe(b,h,R,"beforeUpdate"),R&&Ae(R,!0),(z.innerHTML&&et.innerHTML==null||z.textContent&&et.textContent==null)&&p(E,""),k?K(h.dynamicChildren,k,E,R,B,Ys(b,g),m):L||it(h,b,E,null,R,B,Ys(b,g),m,!1),N>0){if(N&16)q(E,z,et,R,g);else if(N&2&&z.class!==et.class&&o(E,"class",null,et.class,g),N&4&&o(E,"style",z.style,et.style,g),N&8){const dt=b.dynamicProps;for(let vt=0;vt<dt.length;vt++){const gt=dt[vt],jt=z[gt],Ut=et[gt];(Ut!==jt||gt==="value")&&o(E,gt,jt,Ut,g,R)}}N&1&&h.children!==b.children&&p(E,b.children)}else!L&&k==null&&q(E,z,et,R,g);((at=et.onVnodeUpdated)||J)&&Rt(()=>{at&&te(at,R,b,h),J&&xe(b,h,R,"updated")},B)},K=(h,b,R,B,g,m,L)=>{for(let E=0;E<b.length;E++){const N=h[E],k=b[E],J=N.el&&(N.type===Y||!Je(N,k)||N.shapeFlag&198)?C(N.el):R;T(N,k,J,null,B,g,m,L,!0)}},q=(h,b,R,B,g)=>{if(b!==R){if(b!==yt)for(const m in b)!Xe(m)&&!(m in R)&&o(h,m,b[m],null,g,B);for(const m in R){if(Xe(m))continue;const L=R[m],E=b[m];L!==E&&m!=="value"&&o(h,m,E,L,g,B)}"value"in R&&o(h,"value",b.value,R.value,g)}},A=(h,b,R,B,g,m,L,E,N)=>{const k=b.el=h?h.el:r(""),J=b.anchor=h?h.anchor:r("");let{patchFlag:z,dynamicChildren:et,slotScopeIds:at}=b;at&&(E=E?E.concat(at):at),h==null?(l(k,R,B),l(J,R,B),Z(b.children||[],R,J,g,m,L,E,N)):z>0&&z&64&&et&&h.dynamicChildren&&h.dynamicChildren.length===et.length?(K(h.dynamicChildren,et,R,g,m,L,E),(b.key!=null||g&&b===g.subTree)&&On(h,b,!0)):it(h,b,R,J,g,m,L,E,N)},st=(h,b,R,B,g,m,L,E,N)=>{b.slotScopeIds=E,h==null?b.shapeFlag&512?g.ctx.activate(b,R,B,L,N):mt(b,R,B,g,m,L,N):F(h,b,N)},mt=(h,b,R,B,g,m,L)=>{const E=h.component=Ca(h,B,g);if(ai(h)&&(E.ctx.renderer=Qt),Sa(E,!1,L),E.asyncDep){if(g&&g.registerDep(E,U,L),!h.el){const N=E.subTree=bt(Te);$(null,N,b,R),h.placeholder=N.el}}else U(E,h,b,R,g,m,L)},F=(h,b,R)=>{const B=b.component=h.component;if(ia(h,b,R))if(B.asyncDep&&!B.asyncResolved){X(B,b,R);return}else B.next=b,B.update();else b.el=h.el,B.vnode=b},U=(h,b,R,B,g,m,L)=>{const E=()=>{if(h.isMounted){let{next:z,bu:et,u:at,parent:dt,vnode:vt}=h;{const Xt=wi(h);if(Xt){z&&(z.el=vt.el,X(h,z,L)),Xt.asyncDep.then(()=>{Rt(()=>{h.isUnmounted||k()},g)});return}}let gt=z,jt;Ae(h,!1),z?(z.el=vt.el,X(h,z,L)):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,m),z.el=Ut.el,gt===null&&oa(h,Ut.el),at&&Rt(at,g),(jt=z.props&&z.props.onVnodeUpdated)&&Rt(()=>te(jt,dt,z,vt),g)}else{let z;const{el:et,props:at}=b,{bm:dt,m:vt,parent:gt,root:jt,type:Ut}=h,Yt=ns(b);Ae(h,!1),dt&&$s(dt),!Yt&&(z=at&&at.onVnodeBeforeMount)&&te(z,gt,b),Ae(h,!0);{jt.ce&&jt.ce._hasShadowRoot()&&jt.ce._injectChildStyle(Ut);const Xt=h.subTree=nl(h);T(null,Xt,R,B,h,g,m),b.el=Xt.el}if(vt&&Rt(vt,g),!Yt&&(z=at&&at.onVnodeMounted)){const Xt=b;Rt(()=>te(z,gt,Xt),g)}(b.shapeFlag&256||gt&&ns(gt.vnode)&>.vnode.shapeFlag&256)&&h.a&&Rt(h.a,g),h.isMounted=!0,b=R=B=null}};h.scope.on();const N=h.effect=new Ll(E);h.scope.off();const k=h.update=N.run.bind(N),J=h.job=N.runIfDirty.bind(N);J.i=h,J.id=h.uid,N.scheduler=()=>Pn(J),Ae(h,!0),k()},X=(h,b,R)=>{b.component=h;const B=h.vnode.props;h.vnode=b,h.next=null,ra(h,b.props,B,R),fa(h,b.children,R),pe(),Gn(h),ve()},it=(h,b,R,B,g,m,L,E,N=!1)=>{const k=h&&h.children,J=h?h.shapeFlag:0,z=b.children,{patchFlag:et,shapeFlag:at}=b;if(et>0){if(et&128){H(k,z,R,B,g,m,L,E,N);return}else if(et&256){V(k,z,R,B,g,m,L,E,N);return}}at&8?(J&16&&It(k,g,m),z!==k&&p(R,z)):J&16?at&16?H(k,z,R,B,g,m,L,E,N):It(k,g,m,!0):(J&8&&p(R,""),at&16&&Z(z,R,B,g,m,L,E,N))},V=(h,b,R,B,g,m,L,E,N)=>{h=h||Ne,b=b||Ne;const k=h.length,J=b.length,z=Math.min(k,J);let et;for(et=0;et<z;et++){const at=b[et]=N?ue(b[et]):se(b[et]);T(h[et],at,R,null,g,m,L,E,N)}k>J?It(h,g,m,!0,!1,z):Z(b,R,B,g,m,L,E,N,z)},H=(h,b,R,B,g,m,L,E,N)=>{let k=0;const J=b.length;let z=h.length-1,et=J-1;for(;k<=z&&k<=et;){const at=h[k],dt=b[k]=N?ue(b[k]):se(b[k]);if(Je(at,dt))T(at,dt,R,null,g,m,L,E,N);else break;k++}for(;k<=z&&k<=et;){const at=h[z],dt=b[et]=N?ue(b[et]):se(b[et]);if(Je(at,dt))T(at,dt,R,null,g,m,L,E,N);else break;z--,et--}if(k>z){if(k<=et){const at=et+1,dt=at<J?b[at].el:B;for(;k<=et;)T(null,b[k]=N?ue(b[k]):se(b[k]),R,dt,g,m,L,E,N),k++}}else if(k>et)for(;k<=z;)lt(h[k],g,m,!0),k++;else{const at=k,dt=k,vt=new Map;for(k=dt;k<=et;k++){const Wt=b[k]=N?ue(b[k]):se(b[k]);Wt.key!=null&&vt.set(Wt.key,k)}let gt,jt=0;const Ut=et-dt+1;let Yt=!1,Xt=0;const Ge=new Array(Ut);for(k=0;k<Ut;k++)Ge[k]=0;for(k=at;k<=z;k++){const Wt=h[k];if(jt>=Ut){lt(Wt,g,m,!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,b[gt])){Zt=gt;break}Zt===void 0?lt(Wt,g,m,!0):(Ge[Zt-dt]=k+1,Zt>=Xt?Xt=Zt:Yt=!0,T(Wt,b[Zt],R,null,g,m,L,E,N),jt++)}const Un=Yt?ga(Ge):Ne;for(gt=Un.length-1,k=Ut-1;k>=0;k--){const Wt=dt+k,Zt=b[Wt],Vn=b[Wt+1],Wn=Wt+1<J?Vn.el||Ci(Vn):B;Ge[k]===0?T(null,Zt,R,Wn,g,m,L,E,N):Yt&&(gt<0||k!==Un[gt]?ot(Zt,R,Wn,2):gt--)}}},ot=(h,b,R,B,g=null)=>{const{el:m,type:L,transition:E,children:N,shapeFlag:k}=h;if(k&6){ot(h.component.subTree,b,R,B);return}if(k&128){h.suspense.move(b,R,B);return}if(k&64){L.move(h,b,R,Qt);return}if(L===Y){l(m,b,R);for(let z=0;z<N.length;z++)ot(N[z],b,R,B);l(h.anchor,b,R);return}if(L===Ts){y(h,b,R);return}if(B!==2&&k&1&&E)if(B===0)E.beforeEnter(m),l(m,b,R),Rt(()=>E.enter(m),g);else{const{leave:z,delayLeave:et,afterLeave:at}=E,dt=()=>{h.ctx.isUnmounted?i(m):l(m,b,R)},vt=()=>{m._isLeaving&&m[Do](!0),z(m,()=>{dt(),at&&at()})};et?et(m,dt,vt):vt()}else l(m,b,R)},lt=(h,b,R,B=!1,g=!1)=>{const{type:m,props:L,ref:E,children:N,dynamicChildren:k,shapeFlag:J,patchFlag:z,dirs:et,cacheIndex:at}=h;if(z===-2&&(g=!1),E!=null&&(pe(),ss(E,null,R,h,!0),ve()),at!=null&&(b.renderCache[at]=void 0),J&256){b.ctx.deactivate(h);return}const dt=J&1&&et,vt=!ns(h);let gt;if(vt&&(gt=L&&L.onVnodeBeforeUnmount)&&te(gt,b,h),J&6)kt(h.component,R,B);else{if(J&128){h.suspense.unmount(R,B);return}dt&&xe(h,null,b,"beforeUnmount"),J&64?h.type.remove(h,b,R,Qt,B):k&&!k.hasOnce&&(m!==Y||z>0&&z&64)?It(k,b,R,!1,!0):(m===Y&&z&384||!g&&J&16)&&It(N,b,R),B&&ft(h)}(vt&&(gt=L&&L.onVnodeUnmounted)||dt)&&Rt(()=>{gt&&te(gt,b,h),dt&&xe(h,null,b,"unmounted")},R)},ft=h=>{const{type:b,el:R,anchor:B,transition:g}=h;if(b===Y){tt(R,B);return}if(b===Ts){w(h);return}const m=()=>{i(R),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(h.shapeFlag&1&&g&&!g.persisted){const{leave:L,delayLeave:E}=g,N=()=>L(R,m);E?E(h.el,m,N):N()}else m()},tt=(h,b)=>{let R;for(;h!==b;)R=I(h),i(h),h=R;i(b)},kt=(h,b,R)=>{const{bum:B,scope:g,job:m,subTree:L,um:E,m:N,a:k}=h;ol(N),ol(k),B&&$s(B),g.stop(),m&&(m.flags|=8,lt(L,h,b,R)),E&&Rt(E,b),Rt(()=>{h.isUnmounted=!0},b)},It=(h,b,R,B=!1,g=!1,m=0)=>{for(let L=m;L<h.length;L++)lt(h[L],b,R,B,g)},Dt=h=>{if(h.shapeFlag&6)return Dt(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const b=I(h.anchor||h.el),R=b&&b[li];return R?I(R):b};let _e=!1;const ye=(h,b,R)=>{let B;h==null?b._vnode&&(lt(b._vnode,null,null,!0),B=b._vnode.component):T(b._vnode||null,h,b,null,null,null,R),b._vnode=h,_e||(_e=!0,Gn(B),Zl(),_e=!1)},Qt={p:T,um:lt,m:ot,r:ft,mt,mc:Z,pc:it,pbc:K,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 On(t,e,s=!1){const l=t.children,i=e.children;if(rt(l)&&rt(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&&On(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 d=t.length;for(l=0;l<d;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?rt(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 u(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 d={__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(d,s),o&128&&t.normalize(d)):s&&(d.shapeFlag|=xt(s)?8:16),us>0&&!a&&Ht&&(d.patchFlag>0||o&6)&&d.patchFlag!==32&&Ht.push(d),d}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:d}=e;r&&!xt(r)&&(e.class=nt(r)),_t(d)&&(En(d)&&!rt(d)&&(d=Mt({},d)),e.style=St(d))}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:d}=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?rt(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:d,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 d&&l&&Dn(p,d.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):rt(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(rt(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&&!(rt(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 Ot=null;const Ta=()=>Ot||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=>Ot=s),vn=e("__VUE_SSR_SETTERS__",s=>ds=s)}const gs=t=>{const e=Ot;return Ps(t),t.scope.on(),()=>{t.scope.off(),Ps(e)}},rl=()=>{Ot&&Ot.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(d=>{cl(t,d)}).catch(d=>{Us(d,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";/**
|
|
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(rt(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 d=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,d,v)===!1)return}r=r.parent}if(o){pe(),vs(o,null,10,[t,d,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 Lt=[];let ee=-1;const Ue=[];let $e=null,Oe=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=Lt.length;for(;e<s;){const l=e+s>>>1,i=Lt[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=Lt[Lt.length-1];!s||!(t.flags&2)&&e>=cs(s)?Lt.push(t):Lt.splice(To(e),0,t),t.flags|=1,Xl()}}function Xl(){Is||(Is=Yl.then(ti))}function So(t){rt(t)?Ue.push(...t):$e&&t.id===-1?$e.splice(Oe+1,0,t):t.flags&1||(Ue.push(t),t.flags|=1),Xl()}function Gn(t,e,s=ee+1){for(;s<Lt.length;s++){const l=Lt[s];if(l&&l.flags&2){if(t&&l.id!==t.uid)continue;Lt.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,Oe=0;Oe<$e.length;Oe++){const s=$e[Oe];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}$e=null,Oe=0}}const cs=t=>t.id==null?t.flags&2?-1:1/0:t.id;function ti(t){try{for(ee=0;ee<Lt.length;ee++){const e=Lt[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<Lt.length;ee++){const e=Lt[ee];e&&(e.flags&=-2)}ee=-1,Lt.length=0,Zl(),Is=null,(Lt.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,d=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:d}))}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 d=r.dir[l];d&&(pe(),oe(d,s,8,[t.el,r,t,e]),ve())}}function ks(t,e){if(Ot){let s=Ot.provides;const l=Ot.parent&&Ot.parent.provides;l===s&&(s=Ot.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),d=e&&l||!e&&o!=="post";let v;if(ds){if(o==="sync"){const S=Io();v=S.__watcherHandles||(S.__watcherHandles=[])}else if(!d){const S=()=>{};return S.stop=ne,S.resume=ne,S.pause=ne,S}}const p=Ot;r.call=(S,k,x)=>oe(S,p,k,x);let C=!1;o==="post"?r.scheduler=S=>{Rt(S,p&&p.suspense)}:o!=="sync"&&(C=!0,r.scheduler=(S,k)=>{k?S():Pn(S)}),r.augmentJob=S=>{e&&(S.flags|=4),C&&(S.flags|=2,p&&(S.id=p.uid,S.i=p))};const I=wo(t,e,r);return ds&&(v?v.push(I):d&&I()),I}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,d,v){const{mc:p,pc:C,pbc:I,o:{insert:S,querySelector:k,createText:x,createComment:T}}=v,b=es(e.props);let{shapeFlag:M,children:_,dynamicChildren:w}=e;if(t==null){const K=e.el=x(""),P=e.anchor=x("");S(K,s,l),S(P,s,l);const N=(F,q)=>{M&16&&p(_,F,q,i,o,a,r,d)},Z=()=>{const F=e.target=cn(e.props,k),q=un(F,e,x,S);F&&(a!=="svg"&&Jn(F)?a="svg":a!=="mathml"&&Qn(F)&&(a="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(F),b||(N(F,q),Cs(e,!1)))};b&&(N(s,P),Cs(e,!0)),zn(e.props)?(e.el.__isMounted=!1,Rt(()=>{Z(),delete e.el.__isMounted},o)):Z()}else{if(zn(e.props)&&t.el.__isMounted===!1){Rt(()=>{ii.process(t,e,s,l,i,o,a,r,d,v)},o);return}e.el=t.el,e.targetStart=t.targetStart;const K=e.anchor=t.anchor,P=e.target=t.target,N=e.targetAnchor=t.targetAnchor,Z=es(t.props),F=Z?s:P,q=Z?K:N;if(a==="svg"||Jn(P)?a="svg":(a==="mathml"||Qn(P))&&(a="mathml"),w?(I(t.dynamicChildren,w,F,i,o,a,r),On(t,e,!0)):d||C(t,e,F,q,i,o,a,r,!1),b)Z?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,k);G&&bs(e,G,null,v,0)}else Z&&bs(e,P,N,v,1);Cs(e,b)}},remove(t,e,s,{um:l,o:{remove:i}},o){const{shapeFlag:a,children:r,anchor:d,targetStart:v,targetAnchor:p,target:C,props:I}=t;if(C&&(i(v),i(p)),o&&i(d),a&16){const S=o||!es(I);for(let k=0;k<r.length;k++){const x=r[k];l(x,e,s,S,!!x.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:d,children:v,props:p}=t,C=o===2;if(C&&l(a,e,s),(!C||es(p))&&d&16)for(let I=0;I<v.length;I++)i(v[I],e,s,2);C&&l(r,e,s)}function Eo(t,e,s,l,i,o,{o:{nextSibling:a,parentNode:r,querySelector:d,insert:v,createText:p}},C){function I(T,b){let M=b;for(;M;){if(M&&M.nodeType===8){if(M.data==="teleport start anchor")e.targetStart=M;else if(M.data==="teleport anchor"){e.targetAnchor=M,T._lpa=e.targetAnchor&&a(e.targetAnchor);break}}M=a(M)}}function S(T,b){b.anchor=C(a(T),b,r(T),s,l,i,o)}const k=e.target=cn(e.props,d),x=es(e.props);if(k){const T=k._lpa||k.firstChild;e.shapeFlag&16&&(x?(S(t,e),I(k,T),e.targetAnchor||un(k,e,p,v,r(t)===k?t:null)):(e.anchor=a(t),I(k,T),e.targetAnchor||un(k,e,p,v),C(T&&a(T),e,k,s,l,i,o))),Cs(e,x)}else x&&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(rt(t)){t.forEach((x,T)=>ss(x,e&&(rt(e)?e[T]: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:d}=t,v=e&&e.r,p=r.refs===yt?r.refs={}:r.refs,C=r.setupState,I=ht(C),S=C===yt?xl:x=>Yn(p,x)?!1:pt(I,x),k=(x,T)=>!(T&&Yn(p,T));if(v!=null&&v!==d){if(Xn(e),xt(v))p[v]=null,S(v)&&(C[v]=null);else if(Pt(v)){const x=e;k(v,x.k)&&(v.value=null),x.k&&(p[x.k]=null)}}if(ut(d))vs(d,r,12,[a,p]);else{const x=xt(d),T=Pt(d);if(x||T){const b=()=>{if(t.f){const M=x?S(d)?C[d]:p[d]:k()||!t.k?d.value:p[t.k];if(i)rt(M)&&kn(M,o);else if(rt(M))M.includes(o)||M.push(o);else if(x)p[d]=[o],S(d)&&(C[d]=p[d]);else{const _=[o];k(d,t.k)&&(d.value=_),t.k&&(p[t.k]=_)}}else x?(p[d]=a,S(d)&&(C[d]=a)):T&&(k(d,t.k)&&(d.value=a),t.k&&(p[t.k]=a))};if(a){const M=()=>{b(),Rs.delete(t)};M.id=-1,Rs.set(t,M),Rt(M,s)}else Xn(t),b()}}}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 Lo(t,e){ri(t,"da",e)}function ri(t,e,s=Ot){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)&&Oo(l,e,s,i),i=i.parent}}function Oo(t,e,s,l){const i=Vs(e,t,l,!0);ae(()=>{kn(l[e],i)},s)}function Vs(t,e,s=Ot,l=!1){if(s){const i=s[t]||(s[t]=[]),o=e.__weh||(e.__weh=(...a)=>{pe();const r=gs(s),d=oe(e,s,t,a);return r(),ve(),d});return l?i.unshift(o):i.push(o),o}}const me=t=>(e,s=Ot)=>{(!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=Ot){Vs("ec",t,e)}const Ko=Symbol.for("v-ndc");function ct(t,e,s,l){let i;const o=s,a=rt(t);if(a||xt(t)){const r=a&&Ee(t);let d=!1,v=!1;r&&(d=!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(d?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,d)=>e(r,d,void 0,o));else{const r=Object.keys(t);i=new Array(r.length);for(let d=0,v=r.length;d<v;d++){const p=r[d];i[d]=e(t[p],p,d,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:d}=t;if(e[0]!=="$"){const I=a[e];if(I!==void 0)switch(I){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=d.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 d;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)||(d=a.__cssModules)&&d[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 rt(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:d,inject:v,created:p,beforeMount:C,mounted:I,beforeUpdate:S,updated:k,activated:x,deactivated:T,beforeDestroy:b,beforeUnmount:M,destroyed:_,unmounted:w,render:K,renderTracked:P,renderTriggered:N,errorCaptured:Z,serverPrefetch:F,expose:q,inheritAttrs:G,components:A,directives:st,filters:mt}=e;if(v&&zo(v,l,null),a)for(const X in a){const it=a[X];ut(it)&&(l[X]=it.bind(s))}if(i){const X=i.call(s,s);_t(X)&&(t.data=Mn(X))}if(fn=!0,o)for(const X in o){const it=o[X],V=ut(it)?it.bind(s,s):ut(it.get)?it.get.bind(s,s):ne,H=!ut(it)&&ut(it.set)?it.set.bind(s):ne,ot=Q({get:V,set:H});Object.defineProperty(l,X,{enumerable:!0,configurable:!0,get:()=>ot.value,set:lt=>ot.value=lt})}if(r)for(const X in r)ui(r[X],l,s,X);if(d){const X=ut(d)?d.call(s):d;Reflect.ownKeys(X).forEach(it=>{ks(it,X[it])})}p&&tl(p,t,"c");function U(X,it){rt(it)?it.forEach(V=>X(V.bind(s))):it&&X(it.bind(s))}if(U(No,C),U(Nt,I),U(jo,S),U(Uo,k),U(Fo,x),U(Lo,T),U(ci,Z),U(Bo,P),U(Ho,N),U(Vo,M),U(ae,w),U(Wo,F),rt(q))if(q.length){const X=t.exposed||(t.exposed={});q.forEach(it=>{Object.defineProperty(X,it,{get:()=>s[it],set:V=>s[it]=V,enumerable:!0})})}else t.exposed||(t.exposed={});K&&t.render===ne&&(t.render=K),G!=null&&(t.inheritAttrs=G),A&&(t.components=A),st&&(t.directives=st),F&&oi(t)}function zo(t,e,s=ne){rt(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(rt(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(rt(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 d;return r?d=r:!i.length&&!s&&!l?d=e:(d={},i.length&&i.forEach(v=>Es(d,v,a,!0)),Es(d,e,a)),_t(e)&&o.set(e,d),d}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(rt(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?rt(t)&&rt(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 d=!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,I){if(!d){const S=v._ceVNode||bt(l,i);return S.appContext=o,I===!0?I="svg":I===!1&&(I=void 0),t(S,p,I),d=!0,v._container=p,p.__vue_app__=v,Bs(S.component)}},onUnmount(p){r.push(p)},unmount(){d&&(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(Os)));let r,d=l[r=Ks(e)]||l[r=Ks(Ce(e))];!d&&o&&(d=l[r=Ks(De(e))]),d&&oe(d,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 d=v=>{const p=hi(v,e,!0);p&&(r=!0,Mt(a,p))};!s&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}return!o&&!r?(_t(t)&&l.set(t,null),null):(rt(o)?o.forEach(d=>a[d]=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:d,render:v,renderCache:p,props:C,data:I,setupState:S,ctx:k,inheritAttrs:x}=t,T=Ms(t);let b,M;try{if(s.shapeFlag&4){const w=i||l,K=w;b=se(v.call(K,w,p,C,S,I,k)),M=r}else{const w=e;b=se(w.length>1?w(C,{attrs:r,slots:a,emit:d}):w(C,null)),M=e.props?r:na(r)}}catch(w){is.length=0,Us(w,t,1),b=bt(Te)}let _=b;if(M&&x!==!1){const w=Object.keys(M),{shapeFlag:K}=_;w.length&&K&7&&(o&&w.some($n)&&(M=la(M,o)),_=He(_,M,!1,!0))}return s.dirs&&(_=He(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(s.dirs):s.dirs),s.transition&&Dn(_,s.transition),b=_,Ms(T),b}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:d}=e,v=o.emitsOptions;if(e.dirs||e.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return l?ll(l,a,v):!!a;if(d&8){const p=e.dynamicProps;for(let C=0;C<p.length;C++){const I=p[C];if(pi(a,l,I)&&!Ws(v,I))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),[d]=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 I=p[C];if(Ws(t.emitsOptions,I))continue;const S=e[I];if(d)if(pt(o,I))S!==o[I]&&(o[I]=S,v=!0);else{const k=Ce(I);i[k]=pn(d,r,k,S,t,!1)}else S!==o[I]&&(o[I]=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)))&&(d?s&&(s[C]!==void 0||s[p]!==void 0)&&(i[C]=pn(d,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 d in e){if(Xe(d))continue;const v=e[d];let p;i&&pt(i,p=Ce(d))?!o||!o.includes(p)?s[p]=v:(r||(r={}))[p]=v:Ws(t.emitsOptions,d)||(!(d in l)||v!==l[d])&&(l[d]=v,a=!0)}if(o){const d=ht(s),v=r||yt;for(let p=0;p<o.length;p++){const C=o[p];s[C]=pn(i,d,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 d=a.default;if(a.type!==Function&&!a.skipFactory&&ut(d)){const{propsDefaults:v}=i;if(s in v)l=v[s];else{const p=gs(i);l=v[s]=d.call(null,e),p()}}else l=d;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 d=!1;if(!ut(t)){const p=C=>{d=!0;const[I,S]=yi(C,e,!0);Mt(a,I),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&&!d)return _t(t)&&l.set(t,Ne),Ne;if(rt(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 I=o[p],S=a[C]=rt(I)||ut(I)?{type:I}:Mt({},I),k=S.type;let x=!1,T=!0;if(rt(k))for(let b=0;b<k.length;++b){const M=k[b],_=ut(M)&&M.name;if(_==="Boolean"){x=!0;break}else _==="String"&&(T=!1)}else x=ut(k)&&k.name==="Boolean";S[0]=x,S[1]=T,(x||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",Ln=t=>rt(t)?t.map(se):[se(t)],ua=(t,e,s)=>{if(e._n)return e;const l=xo((...i)=>Ln(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=Ln(o);e[i]=()=>a}}},$i=(t,e)=>{const s=Ln(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:d,setText:v,setElementText:p,parentNode:C,nextSibling:I,setScopeId:S=ne,insertStaticContent:k}=t,x=(h,y,E,B=null,g=null,m=null,O=void 0,D=null,j=!!y.dynamicChildren)=>{if(h===y)return;h&&!Je(h,y)&&(B=Dt(h),lt(h,g,m,!0),h=null),y.patchFlag===-2&&(j=!1,y.dynamicChildren=null);const{type:$,ref:J,shapeFlag:z}=y;switch($){case Hs:T(h,y,E,B);break;case Te:b(h,y,E,B);break;case Ts:h==null&&M(y,E,B,O);break;case Y:A(h,y,E,B,g,m,O,D,j);break;default:z&1?K(h,y,E,B,g,m,O,D,j):z&6?st(h,y,E,B,g,m,O,D,j):(z&64||z&128)&&$.process(h,y,E,B,g,m,O,D,j,Qt)}J!=null&&g?ss(J,h&&h.ref,m,y||h,!y):J==null&&h&&h.ref!=null&&ss(h.ref,null,m,h,!0)},T=(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)}},b=(h,y,E,B)=>{h==null?l(y.el=d(y.children||""),E,B):y.el=h.el},M=(h,y,E,B)=>{[h.el,h.anchor]=k(h.children,y,E,B,h.el,h.anchor)},_=({el:h,anchor:y},E,B)=>{let g;for(;h&&h!==y;)g=I(h),l(h,E,B),h=g;l(y,E,B)},w=({el:h,anchor:y})=>{let E;for(;h&&h!==y;)E=I(h),i(h),h=E;i(y)},K=(h,y,E,B,g,m,O,D,j)=>{if(y.type==="svg"?O="svg":y.type==="math"&&(O="mathml"),h==null)P(y,E,B,g,m,O,D,j);else{const $=h.el&&h.el._isVueCE?h.el:null;try{$&&$._beginPatch(),F(h,y,g,m,O,D,j)}finally{$&&$._endPatch()}}},P=(h,y,E,B,g,m,O,D)=>{let j,$;const{props:J,shapeFlag:z,transition:et,dirs:at}=h;if(j=h.el=a(h.type,m,J&&J.is,J),z&8?p(j,h.children):z&16&&Z(h.children,j,null,B,g,Ys(h,m),O,D),at&&xe(h,null,B,"created"),N(j,h,h.scopeId,O,B),J){for(const vt in J)vt!=="value"&&!Xe(vt)&&o(j,vt,null,J[vt],m,B);"value"in J&&o(j,"value",null,J.value,m),($=J.onVnodeBeforeMount)&&te($,B,h)}at&&xe(h,null,B,"beforeMount");const dt=va(g,et);dt&&et.beforeEnter(j),l(j,y,E),(($=J&&J.onVnodeMounted)||dt||at)&&Rt(()=>{$&&te($,B,h),dt&&et.enter(j),at&&xe(h,null,B,"mounted")},g)},N=(h,y,E,B,g)=>{if(E&&S(h,E),B)for(let m=0;m<B.length;m++)S(h,B[m]);if(g){let m=g.subTree;if(y===m||Ti(m.type)&&(m.ssContent===y||m.ssFallback===y)){const O=g.vnode;N(h,O,O.scopeId,O.slotScopeIds,g.parent)}}},Z=(h,y,E,B,g,m,O,D,j=0)=>{for(let $=j;$<h.length;$++){const J=h[$]=D?ue(h[$]):se(h[$]);x(null,J,y,E,B,g,m,O,D)}},F=(h,y,E,B,g,m,O)=>{const D=y.el=h.el;let{patchFlag:j,dynamicChildren:$,dirs:J}=y;j|=h.patchFlag&16;const z=h.props||yt,et=y.props||yt;let at;if(E&&Ae(E,!1),(at=et.onVnodeBeforeUpdate)&&te(at,E,y,h),J&&xe(y,h,E,"beforeUpdate"),E&&Ae(E,!0),(z.innerHTML&&et.innerHTML==null||z.textContent&&et.textContent==null)&&p(D,""),$?q(h.dynamicChildren,$,D,E,B,Ys(y,g),m):O||it(h,y,D,null,E,B,Ys(y,g),m,!1),j>0){if(j&16)G(D,z,et,E,g);else if(j&2&&z.class!==et.class&&o(D,"class",null,et.class,g),j&4&&o(D,"style",z.style,et.style,g),j&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(D,gt,jt,Ut,g,E)}}j&1&&h.children!==y.children&&p(D,y.children)}else!O&&$==null&&G(D,z,et,E,g);((at=et.onVnodeUpdated)||J)&&Rt(()=>{at&&te(at,E,y,h),J&&xe(y,h,E,"updated")},B)},q=(h,y,E,B,g,m,O)=>{for(let D=0;D<y.length;D++){const j=h[D],$=y[D],J=j.el&&(j.type===Y||!Je(j,$)||j.shapeFlag&198)?C(j.el):E;x(j,$,J,null,B,g,m,O,!0)}},G=(h,y,E,B,g)=>{if(y!==E){if(y!==yt)for(const m in y)!Xe(m)&&!(m in E)&&o(h,m,y[m],null,g,B);for(const m in E){if(Xe(m))continue;const O=E[m],D=y[m];O!==D&&m!=="value"&&o(h,m,D,O,g,B)}"value"in E&&o(h,"value",y.value,E.value,g)}},A=(h,y,E,B,g,m,O,D,j)=>{const $=y.el=h?h.el:r(""),J=y.anchor=h?h.anchor:r("");let{patchFlag:z,dynamicChildren:et,slotScopeIds:at}=y;at&&(D=D?D.concat(at):at),h==null?(l($,E,B),l(J,E,B),Z(y.children||[],E,J,g,m,O,D,j)):z>0&&z&64&&et&&h.dynamicChildren&&h.dynamicChildren.length===et.length?(q(h.dynamicChildren,et,E,g,m,O,D),(y.key!=null||g&&y===g.subTree)&&On(h,y,!0)):it(h,y,E,J,g,m,O,D,j)},st=(h,y,E,B,g,m,O,D,j)=>{y.slotScopeIds=D,h==null?y.shapeFlag&512?g.ctx.activate(y,E,B,O,j):mt(y,E,B,g,m,O,j):L(h,y,j)},mt=(h,y,E,B,g,m,O)=>{const D=h.component=Ca(h,B,g);if(ai(h)&&(D.ctx.renderer=Qt),Sa(D,!1,O),D.asyncDep){if(g&&g.registerDep(D,U,O),!h.el){const j=D.subTree=bt(Te);b(null,j,y,E),h.placeholder=j.el}}else U(D,h,y,E,g,m,O)},L=(h,y,E)=>{const B=y.component=h.component;if(ia(h,y,E))if(B.asyncDep&&!B.asyncResolved){X(B,y,E);return}else B.next=y,B.update();else y.el=h.el,B.vnode=y},U=(h,y,E,B,g,m,O)=>{const D=()=>{if(h.isMounted){let{next:z,bu:et,u:at,parent:dt,vnode:vt}=h;{const Xt=wi(h);if(Xt){z&&(z.el=vt.el,X(h,z,O)),Xt.asyncDep.then(()=>{Rt(()=>{h.isUnmounted||$()},g)});return}}let gt=z,jt;Ae(h,!1),z?(z.el=vt.el,X(h,z,O)):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,x(Yt,Ut,C(Yt.el),Dt(Yt),h,g,m),z.el=Ut.el,gt===null&&oa(h,Ut.el),at&&Rt(at,g),(jt=z.props&&z.props.onVnodeUpdated)&&Rt(()=>te(jt,dt,z,vt),g)}else{let z;const{el:et,props:at}=y,{bm:dt,m:vt,parent:gt,root:jt,type:Ut}=h,Yt=ns(y);Ae(h,!1),dt&&$s(dt),!Yt&&(z=at&&at.onVnodeBeforeMount)&&te(z,gt,y),Ae(h,!0);{jt.ce&&jt.ce._hasShadowRoot()&&jt.ce._injectChildStyle(Ut);const Xt=h.subTree=nl(h);x(null,Xt,E,B,h,g,m),y.el=Xt.el}if(vt&&Rt(vt,g),!Yt&&(z=at&&at.onVnodeMounted)){const Xt=y;Rt(()=>te(z,gt,Xt),g)}(y.shapeFlag&256||gt&&ns(gt.vnode)&>.vnode.shapeFlag&256)&&h.a&&Rt(h.a,g),h.isMounted=!0,y=E=B=null}};h.scope.on();const j=h.effect=new Ll(D);h.scope.off();const $=h.update=j.run.bind(j),J=h.job=j.runIfDirty.bind(j);J.i=h,J.id=h.uid,j.scheduler=()=>Pn(J),Ae(h,!0),$()},X=(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,m,O,D,j=!1)=>{const $=h&&h.children,J=h?h.shapeFlag:0,z=y.children,{patchFlag:et,shapeFlag:at}=y;if(et>0){if(et&128){H($,z,E,B,g,m,O,D,j);return}else if(et&256){V($,z,E,B,g,m,O,D,j);return}}at&8?(J&16&&It($,g,m),z!==$&&p(E,z)):J&16?at&16?H($,z,E,B,g,m,O,D,j):It($,g,m,!0):(J&8&&p(E,""),at&16&&Z(z,E,B,g,m,O,D,j))},V=(h,y,E,B,g,m,O,D,j)=>{h=h||Ne,y=y||Ne;const $=h.length,J=y.length,z=Math.min($,J);let et;for(et=0;et<z;et++){const at=y[et]=j?ue(y[et]):se(y[et]);x(h[et],at,E,null,g,m,O,D,j)}$>J?It(h,g,m,!0,!1,z):Z(y,E,B,g,m,O,D,j,z)},H=(h,y,E,B,g,m,O,D,j)=>{let $=0;const J=y.length;let z=h.length-1,et=J-1;for(;$<=z&&$<=et;){const at=h[$],dt=y[$]=j?ue(y[$]):se(y[$]);if(Je(at,dt))x(at,dt,E,null,g,m,O,D,j);else break;$++}for(;$<=z&&$<=et;){const at=h[z],dt=y[et]=j?ue(y[et]):se(y[et]);if(Je(at,dt))x(at,dt,E,null,g,m,O,D,j);else break;z--,et--}if($>z){if($<=et){const at=et+1,dt=at<J?y[at].el:B;for(;$<=et;)x(null,y[$]=j?ue(y[$]):se(y[$]),E,dt,g,m,O,D,j),$++}}else if($>et)for(;$<=z;)lt(h[$],g,m,!0),$++;else{const at=$,dt=$,vt=new Map;for($=dt;$<=et;$++){const Wt=y[$]=j?ue(y[$]):se(y[$]);Wt.key!=null&&vt.set(Wt.key,$)}let gt,jt=0;const Ut=et-dt+1;let Yt=!1,Xt=0;const Ge=new Array(Ut);for($=0;$<Ut;$++)Ge[$]=0;for($=at;$<=z;$++){const Wt=h[$];if(jt>=Ut){lt(Wt,g,m,!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,m,!0):(Ge[Zt-dt]=$+1,Zt>=Xt?Xt=Zt:Yt=!0,x(Wt,y[Zt],E,null,g,m,O,D,j),jt++)}const Un=Yt?ga(Ge):Ne;for(gt=Un.length-1,$=Ut-1;$>=0;$--){const Wt=dt+$,Zt=y[Wt],Vn=y[Wt+1],Wn=Wt+1<J?Vn.el||Ci(Vn):B;Ge[$]===0?x(null,Zt,E,Wn,g,m,O,D,j):Yt&&(gt<0||$!==Un[gt]?ot(Zt,E,Wn,2):gt--)}}},ot=(h,y,E,B,g=null)=>{const{el:m,type:O,transition:D,children:j,shapeFlag:$}=h;if($&6){ot(h.component.subTree,y,E,B);return}if($&128){h.suspense.move(y,E,B);return}if($&64){O.move(h,y,E,Qt);return}if(O===Y){l(m,y,E);for(let z=0;z<j.length;z++)ot(j[z],y,E,B);l(h.anchor,y,E);return}if(O===Ts){_(h,y,E);return}if(B!==2&&$&1&&D)if(B===0)D.beforeEnter(m),l(m,y,E),Rt(()=>D.enter(m),g);else{const{leave:z,delayLeave:et,afterLeave:at}=D,dt=()=>{h.ctx.isUnmounted?i(m):l(m,y,E)},vt=()=>{m._isLeaving&&m[Do](!0),z(m,()=>{dt(),at&&at()})};et?et(m,dt,vt):vt()}else l(m,y,E)},lt=(h,y,E,B=!1,g=!1)=>{const{type:m,props:O,ref:D,children:j,dynamicChildren:$,shapeFlag:J,patchFlag:z,dirs:et,cacheIndex:at}=h;if(z===-2&&(g=!1),D!=null&&(pe(),ss(D,null,E,h,!0),ve()),at!=null&&(y.renderCache[at]=void 0),J&256){y.ctx.deactivate(h);return}const dt=J&1&&et,vt=!ns(h);let gt;if(vt&&(gt=O&&O.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):$&&!$.hasOnce&&(m!==Y||z>0&&z&64)?It($,y,E,!1,!0):(m===Y&&z&384||!g&&J&16)&&It(j,y,E),B&&ft(h)}(vt&&(gt=O&&O.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){w(h);return}const m=()=>{i(E),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(h.shapeFlag&1&&g&&!g.persisted){const{leave:O,delayLeave:D}=g,j=()=>O(E,m);D?D(h.el,m,j):j()}else m()},tt=(h,y)=>{let E;for(;h!==y;)E=I(h),i(h),h=E;i(y)},kt=(h,y,E)=>{const{bum:B,scope:g,job:m,subTree:O,um:D,m:j,a:$}=h;ol(j),ol($),B&&$s(B),g.stop(),m&&(m.flags|=8,lt(O,h,y,E)),D&&Rt(D,y),Rt(()=>{h.isUnmounted=!0},y)},It=(h,y,E,B=!1,g=!1,m=0)=>{for(let O=m;O<h.length;O++)lt(h[O],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=I(h.anchor||h.el),E=y&&y[li];return E?I(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):x(y._vnode||null,h,y,null,null,null,E),y._vnode=h,_e||(_e=!0,Gn(B),Zl(),_e=!1)},Qt={p:x,um:lt,m:ot,r:ft,mt,mc:Z,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 On(t,e,s=!1){const l=t.children,i=e.children;if(rt(l)&&rt(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&&On(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 d=t.length;for(l=0;l<d;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?rt(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 u(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 d={__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(d,s),o&128&&t.normalize(d)):s&&(d.shapeFlag|=xt(s)?8:16),us>0&&!a&&Ht&&(d.patchFlag>0||o&6)&&d.patchFlag!==32&&Ht.push(d),d}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:d}=e;r&&!xt(r)&&(e.class=nt(r)),_t(d)&&(En(d)&&!rt(d)&&(d=Mt({},d)),e.style=St(d))}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:d}=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?rt(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:d,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 d&&l&&Dn(p,d.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 R(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):rt(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(rt(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&&!(rt(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 Ot=null;const Ta=()=>Ot||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=>Ot=s),vn=e("__VUE_SSR_SETTERS__",s=>ds=s)}const gs=t=>{const e=Ot;return Ps(t),t.scope.on(),()=>{t.scope.off(),Ps(e)}},rl=()=>{Ot&&Ot.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(d=>{cl(t,d)}).catch(d=>{Us(d,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
14
|
* @vue/runtime-dom v3.5.29
|
|
15
15
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
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 d=r.firstChild;for(;d.firstChild;)r.appendChild(d.firstChild);r.removeChild(d)}e.insertBefore(r,s)}return[a?a.nextSibling:e.firstChild,s?s.previousSibling:e.lastChild]}},Fa=Symbol("_vtc");function La(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 Oa=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[Oa];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(rt(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,d=s==null?t.type==="checkbox"?"on":"":String(s);(r!==d||!("_value"in t))&&(t.value=d),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,d]=Ha(e);if(l){const v=o[e]=qa(l,i);ke(t,r,v,d)}else a&&(Va(t,r,a,d),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(rt(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"?La(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 rt(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=Os(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)?Os(t.value):t.value,d=e??"";r!==d&&(document.activeElement===t&&t.type!=="range"&&(l&&e===s||i&&t.value.trim()===d)||(t.value=d))}},Le={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(rt(l)){const r=Cn(l,i),d=r!==-1;if(o&&!d)a(l.concat(i));else if(!o&&d){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(rt(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?Os(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=rt(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 d=typeof r;d==="string"||d==="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=W(!s.step.collapsed),o=W(!1),a=Q(()=>{var q;return((q=Tl[s.step.type])==null?void 0:q.icon)||"📄"}),r=Q(()=>{var q;if(s.step.type==="user")return lr(s.step);if(s.step.type==="toolCall")return`${s.step.toolName||"工具"} 调用`;if(s.step.type==="toolResult"){const A=s.step.toolName||"工具",st=s.step.toolResultStatus==="ok"?"结果":"失败";return`${A} ${st}`}return((q=Tl[s.step.type])==null?void 0:q.label)||s.step.type}),d=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:q,resultId:A}=s.highlightedPair;return s.step.id===q||s.step.id===A}),I=Q(()=>s.step.type==="toolCall"&&s.step.pairedToolResultId?"点击高亮对应结果":s.step.type==="toolResult"&&s.step.pairedToolCallId?"点击高亮对应调用":""),S=Q(()=>{const{type:q,content:A,thinking:st,toolArguments:mt,toolResult:F,errorMessage:U}=s.step;return A||st||mt||F||U}),_=Q(()=>{const q=s.step;if(q.type==="toolCall"&&q.toolArguments){const A=q.toolArguments.path??q.toolArguments.file_path??q.toolArguments.filePath;if(typeof A=="string")return A;const st=q.toolArguments.pattern;if(typeof st=="string")return st;const mt=q.toolArguments.command;if(typeof mt=="string")return mt.length>40?mt.slice(0,40)+"…":mt}if(q.type==="toolResult"){if(q.toolResultStatus==="error"){const A=(q.toolResultError||q.toolResult||"").slice(0,30);return A?`${A}${A.length>=30?"…":""}`:"失败"}if(q.toolResult){const A=q.toolResult.split(`
|
|
18
|
-
`).length;return A>1?`${A} 行`:""}}if(
|
|
19
|
-
`).length>10:!1),
|
|
20
|
-
`).length:0)
|
|
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 d=r.firstChild;for(;d.firstChild;)r.appendChild(d.firstChild);r.removeChild(d)}e.insertBefore(r,s)}return[a?a.nextSibling:e.firstChild,s?s.previousSibling:e.lastChild]}},Fa=Symbol("_vtc");function La(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 Oa=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[Oa];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(rt(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,d=s==null?t.type==="checkbox"?"on":"":String(s);(r!==d||!("_value"in t))&&(t.value=d),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,d]=Ha(e);if(l){const v=o[e]=qa(l,i);ke(t,r,v,d)}else a&&(Va(t,r,a,d),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(rt(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"?La(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 rt(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=Os(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)?Os(t.value):t.value,d=e??"";r!==d&&(document.activeElement===t&&t.type!=="range"&&(l&&e===s||i&&t.value.trim()===d)||(t.value=d))}},Le={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(rt(l)){const r=Cn(l,i),d=r!==-1;if(o&&!d)a(l.concat(i));else if(!o&&d){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(rt(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?Os(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=rt(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 d=typeof r;d==="string"||d==="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=W(!s.step.collapsed),o=W(!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 A=s.step.toolName||"工具",st=s.step.toolResultStatus==="ok"?"结果":"失败";return`${A} ${st}`}return((G=Tl[s.step.type])==null?void 0:G.label)||s.step.type}),d=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:A}=s.highlightedPair;return s.step.id===G||s.step.id===A}),I=Q(()=>s.step.type==="toolCall"&&s.step.pairedToolResultId?"点击高亮对应结果":s.step.type==="toolResult"&&s.step.pairedToolCallId?"点击高亮对应调用":""),S=Q(()=>{const{type:G,content:A,thinking:st,toolArguments:mt,toolResult:L,errorMessage:U}=s.step;return A||st||mt||L||U}),k=Q(()=>{const G=s.step;if(G.type==="toolCall"&&G.toolArguments){const A=G.toolArguments.path??G.toolArguments.file_path??G.toolArguments.filePath;if(typeof A=="string")return A;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 A=(G.toolResultError||G.toolResult||"").slice(0,30);return A?`${A}${A.length>=30?"…":""}`:"失败"}if(G.toolResult){const A=G.toolResult.split(`
|
|
18
|
+
`).length;return A>1?`${A} 行`:""}}if(G.type==="thinking"&&G.thinking){const A=G.thinking.length;return A>0?`约 ${A} 字`:""}if(G.type==="text"&&G.content){const A=G.content.length;return A>0?`约 ${A} 字`:""}return""}),x=Q(()=>s.step.toolResult?s.step.toolResult.length>500||s.step.toolResult.split(`
|
|
19
|
+
`).length>10:!1),T=Q(()=>s.step.toolResult?s.step.toolResult.split(`
|
|
20
|
+
`).length:0),b=Q(()=>s.step.toolResult?o.value||!x.value?s.step.toolResult:s.step.toolResult.split(`
|
|
21
21
|
`).slice(0,10).join(`
|
|
22
22
|
`)+`
|
|
23
|
-
...`:""),x=Q(()=>s.step.type!=="toolResult"||s.step.toolResultStatus!=="error"?"":s.step.toolResultError?s.step.toolResultError:s.step.toolResult||"工具执行失败"),y=Q(()=>{if(s.step.type!=="toolResult"||s.step.toolResultStatus!=="error")return null;const q=(s.step.toolResultError||s.step.toolResult||"").toLowerCase(),A=(s.step.toolName||"").toLowerCase(),st=[];return(q.includes("enoent")||q.includes("no such file")||q.includes("文件不存在"))&&st.push("检查文件路径是否正确","确认文件是否存在"),(q.includes("eacces")||q.includes("permission")||q.includes("权限"))&&st.push("检查文件/目录权限","确认当前用户有访问权限"),(q.includes("timeout")||q.includes("超时"))&&st.push("增加超时时间","简化任务或检查网络"),A==="read"&&st.length===0&&st.push("检查路径是否在 workspace 内","确认文件编码正确"),A.includes("bash")&&st.length===0&&st.push("检查命令语法","确认依赖已安装","查看退出码"),st.length===0&&st.push("查看原始返回详情","尝试调整参数后重试"),st}),w=Q(()=>s.step.type!=="error"||!s.step.errorType?null:{"rate-limit":["降低调用频率","切换到 fallback model","等待配额恢复"],"token-limit":["减少上下文长度","分段处理任务","使用更大 context 的模型"],timeout:["检查网络连接","简化任务复杂度","增加超时时间"],quota:["充值账户","切换到其他 provider","等待配额重置"]}[s.step.errorType]||null);function G(){if(v.value){const q=s.step.pairedToolCallId||s.step.id,A=s.step.pairedToolResultId||s.step.id;l("highlight-pair",{callId:q,resultId:A})}P()}function P(){S.value&&(i.value=!i.value)}function j(q){return q?new Date(q).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Z(q){return q?q<1e3?`${q}ms`:q<6e4?`${(q/1e3).toFixed(1)}s`:`${(q/6e4).toFixed(1)}min`:"0ms"}function D(q){try{return JSON.stringify(q,null,2)}catch{return String(q)}}async function K(){if(s.step.toolResult)try{await navigator.clipboard.writeText(s.step.toolResult),alert("已复制到剪贴板")}catch{}}return(q,A)=>(c(),u("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:G},[n("div",ir,[n("span",or,f(a.value),1),n("span",ar,f(r.value),1),d.value?(c(),u("span",rr,f(d.value),1)):M("",!0),!i.value&&_.value?(c(),u("span",cr,f(_.value),1)):M("",!0),n("span",ur,f(j(t.step.timestamp)),1),t.step.duration&&t.step.duration>0?(c(),u("span",dr," +"+f(Z(t.step.duration)),1)):M("",!0),t.step.executionTime?(c(),u("span",fr," ⏱ "+f(Z(t.step.executionTime)),1)):M("",!0)]),n("div",hr,[t.step.tokens?(c(),u("span",pr,[A[2]||(A[2]=n("span",{class:"token-label"},"tokens:",-1)),At(" "+f(t.step.tokens.input+t.step.tokens.output),1)])):M("",!0),v.value?(c(),u("span",{key:1,class:"pair-indicator",title:I.value}," 🔗 ",8,vr)):M("",!0),S.value?(c(),u("span",gr,f(i.value?"▼":"▶"),1)):M("",!0)])]),S.value&&i.value?(c(),u("div",mr,[t.step.type==="user"&&t.step.content?(c(),u("div",_r,[n("pre",null,f(t.step.content),1)])):M("",!0),t.step.type==="thinking"&&t.step.thinking?(c(),u("div",yr,[A[3]||(A[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(),u("div",br,[n("pre",null,f(t.step.content),1)])):M("",!0),t.step.type==="toolCall"?(c(),u("div",$r,[t.step.toolArguments?(c(),u("div",kr,[A[4]||(A[4]=n("div",{class:"section-label"},"参数:",-1)),n("pre",wr,f(D(t.step.toolArguments)),1)])):M("",!0)])):M("",!0),t.step.type==="toolResult"?(c(),u("div",Cr,[n("div",Tr,[n("span",{class:nt(["result-status",t.step.toolResultStatus])},f(t.step.toolResultStatus==="ok"?"✅ 成功":"❌ 工具执行失败"),3),t.step.toolResult?(c(),u("button",{key:0,class:"copy-btn",onClick:K}," 复制 ")):M("",!0)]),t.step.toolResultStatus==="error"?(c(),u(Y,{key:0},[x.value?(c(),u("div",Sr,[n("div",xr,f(x.value),1),y.value?(c(),u("div",Ar,[A[5]||(A[5]=n("span",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),u(Y,null,ct(y.value,(st,mt)=>(c(),u("li",{key:mt},f(st),1))),128))])])):M("",!0)])):M("",!0),t.step.toolResult?(c(),u("div",Ir,[A[6]||(A[6]=n("div",{class:"section-label"},"原始返回:",-1)),n("pre",{class:nt({truncated:!o.value})},f($.value),3),T.value?(c(),u("button",{key:0,class:"show-more-btn",onClick:A[0]||(A[0]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${O.value} 行)`),1)):M("",!0)])):M("",!0)],64)):(c(),u(Y,{key:1},[t.step.toolResult?(c(),u("div",Mr,[n("pre",{class:nt({truncated:!o.value})},f($.value),3),T.value?(c(),u("button",{key:0,class:"show-more-btn",onClick:A[1]||(A[1]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${O.value} 行)`),1)):M("",!0)])):M("",!0)],64))])):M("",!0),t.step.type==="error"?(c(),u("div",Rr,[n("div",Er,f(t.step.errorType||"unknown"),1),n("div",Pr,f(t.step.errorMessage),1),w.value?(c(),u("div",Dr,[A[7]||(A[7]=n("div",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),u(Y,null,ct(w.value,(st,mt)=>(c(),u("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"]]),Lr={class:"timeline-connector"},Or=wt({__name:"TimelineConnector",setup(t){return(e,s)=>(c(),u("div",Lr,[...s[0]||(s[0]=[n("div",{class:"connector-line"},null,-1),n("div",{class:"connector-arrow"},"▼",-1)])]))}}),_n=Ct(Or,[["__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(),u("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(),u("span",Vr,f(t.round.tokens.input+t.round.tokens.output)+" tokens ",1)):M("",!0)]),n("div",Wr,[(c(!0),u(Y,null,ct(t.round.stepIds,(r,d)=>(c(),u(Y,{key:r},[d>0?(c(),Gt(_n,{key:0})):M("",!0),bt(mn,{step:i(r),prevStep:d>0?i(t.round.stepIds[d-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(),u("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(),u("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,class:"empty-message"},lc={key:2},ic={key:3,class:"empty-hint"},oc={key:2,class:"timeline-content"},ac={key:0,class:"session-info"},rc={class:"session-id"},cc={key:0,class:"started-at"},uc={class:"steps-list"},dc={key:0,class:"tool-execution-label"},fc={class:"timeline-footer"},hc={class:"stats-grid"},pc={class:"stat-item"},vc={class:"stat-value"},gc={class:"stat-item"},mc={class:"stat-value"},_c={class:"stat-item"},yc={class:"stat-value"},bc={class:"stat-item"},$c={class:"stat-value"},kc=wt({__name:"TimelineView",props:{agentId:{},sessionKey:{},autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=W(null),l=W(!1),i=W(null),o=W(null),a=Q(()=>s.value?s.value.status:"empty"),r=Q(()=>({running:"🔄 进行中",completed:"✅ 已完成",error:"❌ 出错",empty:"空",no_sessions:"无会话"})[a.value]||"未知"),d=Q(()=>{var y;return((y=s.value)==null?void 0:y.roundMode)&&s.value.rounds&&s.value.rounds.length>0}),v=Q(()=>{var w;const y=new Map;if(!((w=s.value)!=null&&w.rounds))return y;for(const G of s.value.rounds)for(const P of G.stepIds)y.set(P,G);return y}),p=Q(()=>{if(!s.value||!d.value)return[];const y=[],w=new Set;for(const G of s.value.steps){if(w.has(G.id))continue;const P=v.value.get(G.id);P?(y.push({type:"round",data:P}),P.stepIds.forEach(j=>w.add(j))):(y.push({type:"step",data:G}),w.add(G.id))}return y});async function C(){if(e.agentId){l.value=!0,i.value=null;try{let y=`/api/timeline/${e.agentId}?limit=100`;e.sessionKey&&(y+=`&session_key=${encodeURIComponent(e.sessionKey)}`);const w=await fetch(y);if(!w.ok)throw new Error(`HTTP ${w.status}`);s.value=await w.json()}catch(y){i.value=y instanceof Error?y.message:"加载失败",console.error("Timeline load error:",y)}finally{l.value=!1}}}function I(y){s.value&&s.value.steps[y]&&(s.value.steps[y].collapsed=!s.value.steps[y].collapsed)}function S(y){if(s.value){const w=s.value.steps.find(G=>G.id===y);w&&(w.collapsed=!w.collapsed)}}function _(y){o.value=y,setTimeout(()=>{o.value=null},3e3)}function T(y){return y?new Date(y).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function O(y){return y?y<1e3?`${y}ms`:y<6e4?`${(y/1e3).toFixed(1)}s`:`${(y/6e4).toFixed(1)}min`:"0ms"}function $(y){return y>=1e3?`${(y/1e3).toFixed(1)}k`:String(y)}Nt(C),Bt(()=>e.agentId,C);let x=null;return Bt([()=>e.autoRefresh,()=>e.refreshInterval],([y,w])=>{x&&(clearInterval(x),x=null),y&&w&&w>0&&(x=setInterval(C,w*1e3))},{immediate:!0}),(y,w)=>{var G,P,j,Z;return c(),u("div",Gr,[n("div",zr,[n("div",Jr,[w[0]||(w[0]=n("span",{class:"title"},"📊 实时执行时序",-1)),s.value?(c(),u("span",Qr,[At(f(s.value.agentName||s.value.agentId)+" ",1),s.value.model?(c(),u("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:C,disabled:l.value},f(l.value?"加载中...":"🔄 刷新"),9,Zr)])]),l.value&&!s.value?(c(),u("div",tc,[...w[1]||(w[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载时序数据...",-1)])])):!s.value||s.value.steps.length===0?(c(),u("div",ec,[w[2]||(w[2]=n("span",{class:"empty-icon"},"📭",-1)),((G=s.value)==null?void 0:G.status)==="no_sessions"&&((P=s.value)!=null&&P.isMainAgent)?(c(),u("span",sc," 主 Agent 暂无会话记录 ")):((j=s.value)==null?void 0:j.status)==="no_sessions"?(c(),u("span",nc," 该 Agent 是子代理,暂无独立会话记录 ")):(c(),u("span",lc,"暂无会话记录")),(Z=s.value)!=null&&Z.message?(c(),u("div",ic,f(s.value.message),1)):M("",!0)])):(c(),u("div",oc,[w[8]||(w[8]=Ii('<div class="timeline-legend" data-v-3b17c2f5><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>👤</span> 用户/回传</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🧠</span> LLM 思考</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🤖</span> LLM 回复</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🔧</span> 工具调用</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>✅</span> 工具成功</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>❌</span> 工具失败</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>⚠️</span> 错误</span></div>',1)),s.value.sessionId?(c(),u("div",ac,[n("span",rc,"Session: "+f(s.value.sessionId.slice(0,8))+"...",1),s.value.startedAt?(c(),u("span",cc," 开始: "+f(T(s.value.startedAt)),1)):M("",!0)])):M("",!0),n("div",uc,[d.value?(c(!0),u(Y,{key:0},ct(p.value,(D,K)=>{var q;return c(),u(Y,{key:(D.type==="round",D.data.id)},[K>0?(c(),Gt(_n,{key:0})):M("",!0),D.type==="round"?(c(),Gt(Br,{key:1,round:D.data,steps:s.value.steps,highlightedPair:o.value,onHighlightPair:_},null,8,["round","steps","highlightedPair"])):(c(),u(Y,{key:2},[D.data.type==="toolResult"?(c(),u("div",dc,[...w[3]||(w[3]=[n("span",{class:"label-line"},null,-1),n("span",{class:"label-text"},"⚡ 工具执行",-1),n("span",{class:"label-line"},null,-1)])])):M("",!0),D.data.type==="toolResult"&&D.data.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:D.data.toolResultStatus==="error",isActive:((q=o.value)==null?void 0:q.resultId)===D.data.id,executionTime:D.data.executionTime},null,8,["isError","isActive","executionTime"])):M("",!0),bt(mn,{step:D.data,highlightedPair:o.value,onToggleCollapse:A=>S(D.data.id),onHighlightPair:_},null,8,["step","highlightedPair","onToggleCollapse"])],64))],64)}),128)):(c(!0),u(Y,{key:1},ct(s.value.steps,(D,K)=>{var q;return c(),u(Y,{key:D.id},[K>0?(c(),Gt(_n,{key:0})):M("",!0),D.type==="toolResult"&&D.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:D.toolResultStatus==="error",isActive:((q=o.value)==null?void 0:q.resultId)===D.id,executionTime:D.executionTime},null,8,["isError","isActive","executionTime"])):M("",!0),bt(mn,{step:D,prevStep:s.value.steps[K-1],highlightedPair:o.value,onToggleCollapse:A=>I(K),onHighlightPair:_},null,8,["step","prevStep","highlightedPair","onToggleCollapse"])],64)}),128))]),n("div",fc,[n("div",hc,[n("div",pc,[w[4]||(w[4]=n("span",{class:"stat-label"},"总耗时",-1)),n("span",vc,f(O(s.value.stats.totalDuration)),1)]),n("div",gc,[w[5]||(w[5]=n("span",{class:"stat-label"},"Token",-1)),n("span",mc,f($(s.value.stats.totalInputTokens))+" / "+f($(s.value.stats.totalOutputTokens)),1)]),n("div",_c,[w[6]||(w[6]=n("span",{class:"stat-label"},"工具调用",-1)),n("span",yc,f(s.value.stats.toolCallCount)+" 次",1)]),n("div",bc,[w[7]||(w[7]=n("span",{class:"stat-label"},"步骤数",-1)),n("span",$c,f(s.value.stats.stepCount),1)])])])]))])}}}),wc=Ct(kc,[["__scopeId","data-v-3b17c2f5"]]),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:"失败"}},Cc={class:"node-icon"},Tc={class:"node-info"},Sc={class:"node-name"},xc={class:"node-role"},Ac={class:"node-status"},Ic={key:0,class:"node-time"},Mc={key:1,class:"node-progress"},Rc=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(),u("div",{class:nt(["chain-node",[`status-${t.node.status}`,{selected:t.isSelected}]]),onClick:a[0]||(a[0]=r=>o.$emit("click"))},[n("div",Cc,f(s.value),1),n("div",Tc,[n("div",Sc,f(t.node.agentName),1),n("div",xc,f(t.node.role),1)]),n("div",Ac,f(l.value),1),t.node.startedAt?(c(),u("div",Ic,f(i(t.node.duration)),1)):M("",!0),t.node.status==="running"?(c(),u("div",Mc,[...a[1]||(a[1]=[n("div",{class:"progress-spinner"},null,-1)])])):M("",!0)],2))}}),Ec=Ct(Rc,[["__scopeId","data-v-973c6755"]]),Pc={width:"60",height:"20",viewBox:"0 0 60 20"},Dc={id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto"},Fc=["fill"],Lc=["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(),u("div",{class:nt(["chain-edge",o.value])},[(c(),u("svg",Pc,[n("defs",null,[n("marker",Dc,[n("polygon",{points:"0 0, 10 3.5, 0 7",fill:l.value},null,8,Fc)])]),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,Lc)]))],2))}}),Nc=Ct(Oc,[["__scopeId","data-v-c94ab96b"]]),jc={class:"chain-view"},Uc={class:"chain-header"},Vc={class:"header-left"},Wc={key:0,class:"project-info"},Hc={class:"header-right"},Bc=["disabled"],Kc={key:0,class:"loading-state"},qc={key:1,class:"empty-state"},Gc={key:2,class:"chain-content"},zc={key:0,class:"root-task"},Jc={class:"task-text"},Qc={class:"task-meta"},Yc={key:0},Xc={key:1,class:"chain-diagram"},Zc={class:"diagram-container"},tu={key:2,class:"chain-progress"},eu={class:"progress-bar"},su={class:"progress-text"},nu={key:3,class:"node-detail"},lu={class:"detail-header"},iu={class:"detail-title"},ou={class:"detail-content"},au={key:0,class:"detail-section"},ru={class:"section-value"},cu={class:"detail-row"},uu={class:"detail-item"},du={class:"item-value"},fu={class:"detail-item"},hu={class:"item-value"},pu={key:1,class:"detail-row"},vu={class:"detail-item"},gu={class:"item-value"},mu={class:"detail-item"},_u={class:"item-value"},yu={key:2,class:"detail-section"},bu={class:"section-value"},$u={key:3,class:"detail-section"},ku={class:"artifacts-list"},wu=wt({__name:"TaskChainView",props:{autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=W([]),l=W(null),i=W(null),o=W(!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 _=["main","analyst","architect","devops"];return[...l.value.nodes].sort((O,$)=>{const x=_.findIndex(w=>O.role.includes(w)),y=_.findIndex(w=>$.role.includes(w));return x-y})});async function d(){o.value=!0;try{const _=await fetch("/api/chains?limit=10");if(_.ok){const T=await _.json();s.value=T.chains||[],l.value=T.activeChain||null}}catch(_){console.error("Chain load error:",_)}finally{o.value=!1}}function v(_){var T;i.value=((T=i.value)==null?void 0:T.agentId)===_.agentId?null:_}function p(_){return _?new Date(_).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"-"}function C(_){return _?_<1e3?`${_}ms`:_<6e4?`${(_/1e3).toFixed(1)}s`:`${(_/6e4).toFixed(1)}min`:"-"}function I(_){return _?_>=1e3?`${(_/1e3).toFixed(1)}k`:String(_):"0"}let S=null;return Nt(()=>{d(),e.autoRefresh&&e.refreshInterval&&(S=setInterval(d,e.refreshInterval*1e3))}),ae(()=>{S&&(clearInterval(S),S=null)}),(_,T)=>{var O,$;return c(),u("div",jc,[n("div",Uc,[n("div",Vc,[T[0]||(T[0]=n("span",{class:"title"},"🔗 任务执行链路",-1)),l.value?(c(),u("span",Wc,f(l.value.projectId||"当前任务"),1)):M("",!0)]),n("div",Hc,[n("span",{class:nt(["status-badge",`status-${((O=l.value)==null?void 0:O.status)||"empty"}`])},f(a.value),3),n("button",{class:"refresh-btn",onClick:d,disabled:o.value},f(o.value?"加载中...":"🔄 刷新"),9,Bc)])]),o.value&&!l.value?(c(),u("div",Kc,[...T[1]||(T[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载链路数据...",-1)])])):!l.value&&s.value.length===0?(c(),u("div",qc,[...T[2]||(T[2]=[n("span",{class:"empty-icon"},"🔗",-1),n("span",null,"暂无任务链路",-1),n("div",{class:"empty-hint"},"当 Main Agent 派发任务给子 Agent 时,这里会显示执行链路",-1)])])):(c(),u("div",Gc,[l.value?(c(),u("div",zc,[T[3]||(T[3]=n("div",{class:"task-label"},"根任务",-1)),n("div",Jc,f(l.value.rootTask),1),n("div",Qc,[l.value.startedAt?(c(),u("span",Yc,"开始: "+f(p(l.value.startedAt)),1)):M("",!0)])])):M("",!0),l.value?(c(),u("div",Xc,[n("div",Zc,[(c(!0),u(Y,null,ct(r.value,(x,y)=>{var w,G;return c(),u(Y,{key:x.agentId},[y>0?(c(),Gt(Nc,{key:0,"from-status":(w=r.value[y-1])==null?void 0:w.status,"to-status":x.status},null,8,["from-status","to-status"])):M("",!0),bt(Ec,{node:x,"is-selected":((G=i.value)==null?void 0:G.agentId)===x.agentId,onClick:P=>v(x)},null,8,["node","is-selected","onClick"])],64)}),128))])])):M("",!0),l.value?(c(),u("div",tu,[n("div",eu,[n("div",{class:"progress-fill",style:St({width:`${l.value.progress*100}%`})},null,4)]),n("div",su,f(Math.round(l.value.progress*100))+"% ("+f(l.value.completedNodes)+"/"+f(l.value.totalNodes)+" 完成) ",1)])):M("",!0),i.value?(c(),u("div",nu,[n("div",lu,[n("span",iu,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",ou,[i.value.task?(c(),u("div",au,[T[4]||(T[4]=n("div",{class:"section-label"},"任务",-1)),n("div",ru,f(i.value.task),1)])):M("",!0),n("div",cu,[n("div",uu,[T[5]||(T[5]=n("span",{class:"item-label"},"开始时间",-1)),n("span",du,f(i.value.startedAt?p(i.value.startedAt):"-"),1)]),n("div",fu,[T[6]||(T[6]=n("span",{class:"item-label"},"耗时",-1)),n("span",hu,f(C(i.value.duration)),1)])]),i.value.tokenUsage?(c(),u("div",pu,[n("div",vu,[T[7]||(T[7]=n("span",{class:"item-label"},"Token 输入",-1)),n("span",gu,f(I(i.value.tokenUsage.input)),1)]),n("div",mu,[T[8]||(T[8]=n("span",{class:"item-label"},"Token 输出",-1)),n("span",_u,f(I(i.value.tokenUsage.output)),1)])])):M("",!0),i.value.toolCallCount>0?(c(),u("div",yu,[T[9]||(T[9]=n("div",{class:"section-label"},"工具调用",-1)),n("div",bu,f(i.value.toolCallCount)+" 次",1)])):M("",!0),i.value.artifacts&&i.value.artifacts.length>0?(c(),u("div",$u,[T[10]||(T[10]=n("div",{class:"section-label"},"产出物",-1)),n("div",ku,[(c(!0),u(Y,null,ct(i.value.artifacts,x=>(c(),u("div",{key:x,class:"artifact-item"}," 📄 "+f(x),1))),128))])])):M("",!0)])])):M("",!0)]))])}}}),Cu=Ct(wu,[["__scopeId","data-v-5e7f751f"]]),Tu={class:"agent-config-panel"},Su={class:"header"},xu=["disabled"],Au={key:0,class:"loading-state"},Iu={key:1,class:"error-state"},Mu={key:2,class:"config-content"},Ru={class:"config-section"},Eu={class:"info-grid"},Pu={class:"info-item"},Du={class:"value monospace"},Fu={class:"info-item"},Lu={class:"value"},Ou={class:"info-item full-width"},Nu={class:"value monospace"},ju={class:"info-item"},Uu={class:"config-section"},Vu={class:"model-config"},Wu={class:"model-field"},Hu={class:"model-select-wrapper"},Bu=["disabled"],Ku=["label"],qu=["value"],Gu={key:0,class:"current-model"},zu={class:"model-field"},Ju={class:"fallbacks-list"},Qu=["onUpdate:modelValue","disabled"],Yu=["label"],Xu=["value"],Zu=["onClick","disabled"],td=["disabled"],ed={class:"model-actions"},sd=["disabled"],nd=["disabled"],ld={key:0,class:"config-section"},id={class:"description-text"},od=wt({__name:"AgentConfigPanel",props:{agentId:{}},setup(t){const e=t,s=W(null),l=W([]),i=W(!1),o=W(!1),a=W(""),r=W(""),d=W([]),v=Q(()=>{const x={};for(const y of l.value)x[y.provider]||(x[y.provider]=[]),x[y.provider].push(y);return Object.entries(x).map(([y,w])=>({provider:y,models:w}))}),p=Q(()=>{var y;if(!((y=s.value)!=null&&y.model))return!1;const x=s.value.model;return r.value!==x.primary||JSON.stringify(d.value.filter(w=>w))!==JSON.stringify(x.fallbacks||[])});function C(x){return{idle:"空闲",working:"工作中",down:"异常"}[x]||x}function I(x){if(!x)return"";const y=x.split("/");return y.length>1?y[y.length-1]:x}async function S(){var x;i.value=!0,a.value="";try{const[y,w]=await Promise.all([fetch(`/api/agent-config/${e.agentId}`),fetch("/api/available-models")]);if(y.ok?(s.value=await y.json(),(x=s.value)!=null&&x.model&&(r.value=s.value.model.primary||"",d.value=[...s.value.model.fallbacks||[]])):a.value="加载配置失败",w.ok){const G=await w.json();l.value=G.models||[]}}catch(y){a.value="加载失败: "+y.message}finally{i.value=!1}}function _(){d.value.length<3&&d.value.push("")}function T(x){d.value.splice(x,1)}function O(){var x;(x=s.value)!=null&&x.model&&(r.value=s.value.model.primary||"",d.value=[...s.value.model.fallbacks||[]])}async function $(){if(p.value){o.value=!0;try{const x=await fetch(`/api/agent-config/${e.agentId}/model`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({primary:r.value||null,fallbacks:d.value.filter(y=>y)||null})});if(x.ok){const y=await x.json();s.value&&y.model&&(s.value.model=y.model),alert("模型配置已保存!重启 Agent 后生效。")}else{const y=await x.json();alert("保存失败: "+(y.detail||"未知错误"))}}catch(x){alert("保存失败: "+x.message)}finally{o.value=!1}}}return Bt(()=>e.agentId,()=>{S()},{immediate:!0}),Nt(()=>{S()}),(x,y)=>{var w;return c(),u("div",Tu,[n("div",Su,[y[1]||(y[1]=n("h3",null,"⚙️ Agent 配置",-1)),n("button",{class:"refresh-btn",onClick:S,disabled:i.value},f(i.value?"加载中...":"刷新"),9,xu)]),i.value&&!s.value?(c(),u("div",Au," 加载配置... ")):a.value?(c(),u("div",Iu,f(a.value),1)):s.value?(c(),u("div",Mu,[n("div",Ru,[y[6]||(y[6]=n("h4",null,"基本信息",-1)),n("div",Eu,[n("div",Pu,[y[2]||(y[2]=n("span",{class:"label"},"ID",-1)),n("span",Du,f(s.value.id),1)]),n("div",Fu,[y[3]||(y[3]=n("span",{class:"label"},"名称",-1)),n("span",Lu,f(s.value.name),1)]),n("div",Ou,[y[4]||(y[4]=n("span",{class:"label"},"工作区",-1)),n("span",Nu,f(s.value.workspace||"未设置"),1)]),n("div",ju,[y[5]||(y[5]=n("span",{class:"label"},"状态",-1)),n("span",{class:nt(["value",`status-${s.value.status}`])},f(C(s.value.status)),3)])])]),n("div",Uu,[y[11]||(y[11]=n("h4",null,"模型配置",-1)),n("div",Vu,[n("div",Wu,[y[8]||(y[8]=n("label",null,"主模型 (Primary)",-1)),n("div",Hu,[Tt(n("select",{"onUpdate:modelValue":y[0]||(y[0]=G=>r.value=G),disabled:o.value,class:"model-select"},[y[7]||(y[7]=n("option",{value:""},"-- 选择模型 --",-1)),(c(!0),u(Y,null,ct(v.value,G=>(c(),u("optgroup",{key:G.provider,label:G.provider},[(c(!0),u(Y,null,ct(G.models,P=>(c(),u("option",{key:P.id,value:P.id},f(P.name),9,qu))),128))],8,Ku))),128))],8,Bu),[[Pe,r.value]]),(w=s.value.model)!=null&&w.primary?(c(),u("span",Gu," 当前: "+f(I(s.value.model.primary)),1)):M("",!0)])]),n("div",zu,[y[10]||(y[10]=n("label",null,"备选模型 (Fallbacks)",-1)),n("div",Ju,[(c(!0),u(Y,null,ct(d.value,(G,P)=>(c(),u("div",{key:P,class:"fallback-item"},[Tt(n("select",{"onUpdate:modelValue":j=>d.value[P]=j,disabled:o.value,class:"model-select small"},[y[9]||(y[9]=n("option",{value:""},"-- 选择 --",-1)),(c(!0),u(Y,null,ct(v.value,j=>(c(),u("optgroup",{key:j.provider,label:j.provider},[(c(!0),u(Y,null,ct(j.models,Z=>(c(),u("option",{key:Z.id,value:Z.id},f(Z.name),9,Xu))),128))],8,Yu))),128))],8,Qu),[[Pe,d.value[P]]]),n("button",{class:"remove-btn",onClick:j=>T(P),disabled:o.value},"×",8,Zu)]))),128)),n("button",{class:"add-fallback-btn",onClick:_,disabled:o.value||d.value.length>=3}," + 添加备选模型 ",8,td)])]),n("div",ed,[n("button",{class:"save-btn",onClick:$,disabled:o.value||!p.value},f(o.value?"保存中...":"保存修改"),9,sd),n("button",{class:"reset-btn",onClick:O,disabled:o.value}," 重置 ",8,nd)])])]),s.value.description?(c(),u("div",ld,[y[12]||(y[12]=n("h4",null,"描述",-1)),n("p",id,f(s.value.description),1)])):M("",!0)])):M("",!0)])}}}),ad=Ct(od,[["__scopeId","data-v-c0a2c245"]]),rd={class:"error-analysis-view"},cd={class:"header"},ud=["disabled"],dd={key:0,class:"agent-summary"},fd={class:"summary-card total"},hd={class:"count"},pd={key:0,class:"summary-card critical"},vd={class:"count"},gd={key:1,class:"summary-card high"},md={class:"count"},_d={key:2,class:"summary-card medium"},yd={class:"count"},bd={key:1,class:"loading-state"},$d={key:2,class:"empty-state"},kd={key:3,class:"errors-list"},wd=["onClick"],Cd={class:"error-header"},Td={class:"error-badges"},Sd={key:0,class:"badge archived",title:"已归档的子任务"},xd={key:1,class:"badge provider"},Ad={key:2,class:"badge model"},Id={class:"error-time"},Md={class:"error-message"},Rd={key:0,class:"error-detail"},Ed={class:"detail-section"},Pd={class:"error-full"},Dd={key:0,class:"detail-section"},Fd={class:"tool-chain"},Ld={class:"tool-index"},Od={class:"tool-name"},Nd={class:"tool-time"},jd={key:1,class:"detail-section"},Ud={class:"suggestions"},Vd={class:"detail-section meta"},Wd={key:4,class:"type-summary"},Hd={class:"type-bars"},Bd={class:"type-label"},Kd={class:"bar-container"},qd={class:"type-count"},Gd=wt({__name:"ErrorAnalysisView",props:{agentId:{}},setup(t){const e=t,s=W([]),l=W(null),i=W(!1),o=W(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 d(S){return S?new Date(S).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function v(S,_){return!S||S.length<=_?S||"":S.slice(0,_)+"..."}function p(S,_){return _?Math.round(S/_*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 I(){if(e.agentId){i.value=!0;try{const S=await fetch(`/api/error-analysis/${e.agentId}?session_limit=5`);if(S.ok){const _=await S.json();s.value=_.errors||[],l.value=_.summary||null}}catch(S){console.error("Failed to load error analysis:",S)}finally{i.value=!1}}}return Bt(()=>e.agentId,()=>{I()},{immediate:!0}),Nt(()=>{I()}),(S,_)=>{var T,O,$,x;return c(),u("div",rd,[n("div",cd,[_[0]||(_[0]=n("h3",null,"🔍 错误分析",-1)),n("button",{class:"refresh-btn",onClick:I,disabled:i.value},f(i.value?"分析中...":"刷新"),9,ud)]),l.value?(c(),u("div",dd,[n("div",fd,[n("span",hd,f(l.value.total||0),1),_[1]||(_[1]=n("span",{class:"label"},"错误数",-1))]),(T=l.value.bySeverity)!=null&&T.critical?(c(),u("div",pd,[n("span",vd,f(l.value.bySeverity.critical),1),_[2]||(_[2]=n("span",{class:"label"},"严重",-1))])):M("",!0),(O=l.value.bySeverity)!=null&&O.high?(c(),u("div",gd,[n("span",md,f(l.value.bySeverity.high),1),_[3]||(_[3]=n("span",{class:"label"},"高",-1))])):M("",!0),($=l.value.bySeverity)!=null&&$.medium?(c(),u("div",_d,[n("span",yd,f(l.value.bySeverity.medium),1),_[4]||(_[4]=n("span",{class:"label"},"中",-1))])):M("",!0)])):M("",!0),i.value&&!s.value.length?(c(),u("div",bd," 正在分析错误... ")):s.value.length?(c(),u("div",kd,[(c(!0),u(Y,null,ct(s.value,(y,w)=>{var G,P;return c(),u("div",{key:w,class:nt(["error-item",`severity-${y.severity}`]),onClick:j=>C(w)},[n("div",Cd,[n("span",{class:"error-type",style:St({color:y.severityColor})},f(y.severityLabel)+" - "+f(y.errorTypeLabel),5),n("div",Td,[y.isArchived?(c(),u("span",Sd,"📦 归档")):M("",!0),y.provider?(c(),u("span",xd,f(y.provider),1)):M("",!0),y.model?(c(),u("span",Ad,f(y.model),1)):M("",!0)]),n("span",Id,f(d(y.timestamp)),1)]),n("div",Md,f(v(y.rawMessage,150)),1),o.value.has(w)?(c(),u("div",Rd,[n("div",Ed,[_[5]||(_[5]=n("h4",null,"错误信息",-1)),n("pre",Pd,f(y.rawMessage||"无详细信息"),1)]),(G=y.toolChain)!=null&&G.length?(c(),u("div",Dd,[_[6]||(_[6]=n("h4",null,"工具调用链(错误前)",-1)),n("div",Fd,[(c(!0),u(Y,null,ct(y.toolChain,(j,Z)=>(c(),u("div",{key:Z,class:"tool-item"},[n("span",Ld,f(Z+1),1),n("span",Od,f(j.toolName),1),n("span",Nd,f(d(j.timestamp)),1)]))),128))])])):M("",!0),(P=y.suggestions)!=null&&P.length?(c(),u("div",jd,[_[7]||(_[7]=n("h4",null,"修复建议",-1)),n("ul",Ud,[(c(!0),u(Y,null,ct(y.suggestions,(j,Z)=>(c(),u("li",{key:Z},f(j),1))),128))])])):M("",!0),n("div",Vd,[n("span",null,"Session: "+f(y.sessionFile),1),n("span",null,"Turn: "+f(y.turnIndex),1)])])):M("",!0)],10,wd)}),128))])):(c(),u("div",$d," ✅ 暂无错误记录 ")),(x=l.value)!=null&&x.byType&&Object.keys(l.value.byType).length>0?(c(),u("div",Wd,[_[8]||(_[8]=n("h4",null,"错误类型分布",-1)),n("div",Hd,[(c(!0),u(Y,null,ct(l.value.byType,(y,w)=>(c(),u("div",{key:w,class:"type-bar"},[n("span",Bd,f(r(w)),1),n("div",Kd,[n("div",{class:"bar-fill",style:St({width:p(y,l.value.total)})},null,4)]),n("span",qd,f(y),1)]))),128))])])):M("",!0)])}}}),zd=Ct(Gd,[["__scopeId","data-v-bc05715d"]]),Jd={class:"header"},Qd={class:"content"},Yd={class:"section"},Xd={class:"status-info"},Zd={class:"status-text"},tf={key:0,class:"section"},ef={key:1,class:"section"},sf={key:2,class:"section"},nf={class:"error-info"},lf={class:"error-type"},of={class:"error-message"},af={key:3,class:"section"},rf={class:"diagnostic-header"},cf={class:"diagnostic-icon"},uf={class:"diagnostic-title"},df={class:"diagnostic-content"},ff={class:"diagnostic-item"},hf={class:"item-value highlight"},pf={key:0,class:"diagnostic-item"},vf={class:"item-value"},gf={key:1,class:"diagnostic-item"},mf={class:"item-value"},_f={class:"diagnostic-actions"},yf={class:"section"},bf={class:"activity-list"},$f={key:0,class:"activity-item working"},kf={key:1,class:"activity-item idle"},wf={key:2,class:"activity-item down"},Cf={class:"section"},Tf={class:"view-tabs"},Sf={key:0,class:"timeline-container"},xf={key:1,class:"chain-container"},Af={key:2,class:"advanced-container"},If={class:"advanced-section"},Mf={class:"advanced-section"},Rf=5*60*1e3,Ef=15*60*1e3,Pf=wt({__name:"AgentDetailPanel",props:{agent:{}},emits:["close"],setup(t){const e=t,s=W("timeline"),l=W(null),i=W(Date.now());let o=null;const a=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[e.agent.status]||"未知"),r=Q(()=>{if(e.agent.status!=="working")return null;const O=e.agent.lastActiveAt||0,$=i.value-O;return $>Ef?{isStuck:!0,idleMinutes:Math.floor($/6e4),severity:"critical",label:"严重卡顿"}:$>Rf?{isStuck:!0,idleMinutes:Math.floor($/6e4),severity:"warning",label:"可能卡顿"}:null}),d=Q(()=>{var y;if(!((y=l.value)!=null&&y.archiveAtMs))return null;const O=l.value.archiveAtMs-i.value;if(O<=0)return"即将超时";const $=Math.floor(O/6e4),x=Math.floor(O%6e4/1e3);return`${$}分${x}秒`}),v=Q(()=>{if(!p.value.length)return null;const O=p.value[p.value.length-1];if(O.role==="toolResult"){const $=O.content[0];if($){const x=$.text||$.content||"";return{tool:O.toolName||"未知工具",status:$.status||"completed",result:x.slice(0,100)||"(无输出)"}}}return null}),p=W([]),C=W(!1);async function I(){var O;if((O=e.agent)!=null&&O.id){C.value=!0;try{const $=await fetch(`/api/agents/${e.agent.id}/output?limit=30`);if($.ok){const x=await $.json();p.value=x.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 O=await fetch("/api/chains?limit=10");if(O.ok){const x=(await O.json()).activeChain;if(x!=null&&x.nodes){const y=x.nodes.find(w=>w.agentId===e.agent.id);y&&y.status==="running"&&(l.value={runId:x.chainId,status:"running",startedAt:y.startedAt,archiveAtMs:x.archiveAtMs})}}}catch{}}async function _(){var O;if((O=l.value)!=null&&O.runId&&confirm("确定要取消这个任务吗?"))try{alert("取消功能需要 OpenClaw 支持,请使用命令行: openclaw subagents cancel "+l.value.runId)}catch($){console.error("Cancel failed:",$)}}function T(){I(),S()}return Bt(()=>{var O;return(O=e.agent)==null?void 0:O.id},()=>{I(),S()},{immediate:!0}),Bt(()=>e.agent.status,S),Nt(()=>{o=setInterval(()=>{i.value=Date.now()},1e3)}),ae(()=>{o&&(clearInterval(o),o=null)}),(O,$)=>(c(),u("div",{class:"panel-overlay",onClick:$[5]||($[5]=x=>O.$emit("close"))},[n("div",{class:"panel",onClick:$[4]||($[4]=le(()=>{},["stop"]))},[n("div",Jd,[n("h2",null,f(t.agent.name),1),n("button",{class:"close-btn",onClick:$[0]||($[0]=x=>O.$emit("close"))},"×")]),n("div",Qd,[n("div",Yd,[$[6]||($[6]=n("h3",null,"状态",-1)),n("div",Xd,[n("span",{class:nt(["status-dot",`status-${t.agent.status}`])},null,2),n("span",Zd,f(a.value),1)])]),t.agent.currentTask?(c(),u("div",tf,[$[7]||($[7]=n("h3",null,"当前任务",-1)),n("p",null,f(t.agent.currentTask),1)])):M("",!0),t.agent.lastActiveFormatted?(c(),u("div",ef,[$[8]||($[8]=n("h3",null,"最后活跃",-1)),n("p",null,f(t.agent.lastActiveFormatted),1)])):M("",!0),t.agent.error?(c(),u("div",sf,[$[9]||($[9]=n("h3",{class:"error-title"},"错误信息",-1)),n("div",nf,[n("div",lf,f(t.agent.error.type),1),n("div",of,f(t.agent.error.message),1)])])):M("",!0),r.value?(c(),u("div",af,[n("div",{class:nt(["diagnostic-panel",`severity-${r.value.severity}`])},[n("div",rf,[n("span",cf,f(r.value.severity==="critical"?"🚨":"⚠️"),1),n("span",uf,f(r.value.label)+"检测",1)]),n("div",df,[n("div",ff,[$[10]||($[10]=n("span",{class:"item-label"},"无响应时间:",-1)),n("span",hf,f(r.value.idleMinutes)+" 分钟",1)]),v.value?(c(),u("div",pf,[$[11]||($[11]=n("span",{class:"item-label"},"最后操作:",-1)),n("span",vf,f(v.value.tool)+" → "+f(v.value.result),1)])):M("",!0),d.value?(c(),u("div",gf,[$[12]||($[12]=n("span",{class:"item-label"},"自动超时:",-1)),n("span",mf,f(d.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",_f,[l.value?(c(),u("button",{key:0,class:"action-btn primary",onClick:_}," 取消任务 ")):M("",!0),n("button",{class:"action-btn",onClick:T}," 刷新状态 ")])])],2)])):M("",!0),n("div",yf,[$[14]||($[14]=n("h3",null,"最近活动",-1)),n("div",bf,[t.agent.status==="working"?(c(),u("div",$f," 💼 正在执行任务... ")):t.agent.status==="idle"?(c(),u("div",kf," 😴 空闲中 ")):t.agent.status==="down"?(c(),u("div",wf," ⚠️ 检测到错误 ")):M("",!0)])]),n("div",Cf,[n("div",Tf,[n("button",{class:nt(["tab-btn",{active:s.value==="timeline"}]),onClick:$[1]||($[1]=x=>s.value="timeline")}," 📊 时序视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="chain"}]),onClick:$[2]||($[2]=x=>s.value="chain")}," 🔗 链路视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="advanced"}]),onClick:$[3]||($[3]=x=>s.value="advanced")}," ⚙️ 高级 ",2)]),s.value==="timeline"?(c(),u("div",Sf,[bt(rs(wc),{agentId:t.agent.id,autoRefresh:!1},null,8,["agentId"])])):s.value==="chain"?(c(),u("div",xf,[bt(rs(Cu),{autoRefresh:!0,refreshInterval:10})])):s.value==="advanced"?(c(),u("div",Af,[n("div",If,[$[15]||($[15]=n("h4",null,"⚙️ 配置",-1)),bt(ad,{agentId:t.agent.id},null,8,["agentId"])]),n("div",Mf,[$[16]||($[16]=n("h4",null,"🔍 错误分析",-1)),bt(zd,{agentId:t.agent.id},null,8,["agentId"])])])):M("",!0)])])])]))}}),Df=Ct(Pf,[["__scopeId","data-v-aec763c1"]]),Ff={class:"settings-panel"},Lf={class:"header"},Of={class:"content"},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={class:"setting-item"},qf=wt({__name:"SettingsPanel",emits:["close"],setup(t,{emit:e}){const s=e,l=W(10),i=W(!0),o=W(!0),a=W(!0),r=W(!0),d=W(!1),v=W(100),p=W(!0);function C(){const S=localStorage.getItem("dashboard-settings");if(S)try{const _=JSON.parse(S);l.value=_.refreshInterval||10,i.value=_.autoRefreshEnabled!==!1,o.value=_.showTimestamps!==!1,a.value=_.showTokens!==!1,r.value=_.notifyOnError!==!1,d.value=_.notifyOnComplete||!1,v.value=_.logLines||100,p.value=_.autoScrollLog!==!1}catch(_){console.error("加载设置失败:",_)}}function I(){const S={refreshInterval:l.value,autoRefreshEnabled:i.value,showTimestamps:o.value,showTokens:a.value,notifyOnError:r.value,notifyOnComplete:d.value,logLines:v.value,autoScrollLog:p.value};localStorage.setItem("dashboard-settings",JSON.stringify(S)),s("settings-changed",S)}return Nt(()=>{C()}),(S,_)=>(c(),u("div",Ff,[n("div",Lf,[_[9]||(_[9]=n("h2",null,"设置",-1)),n("button",{class:"close-btn",onClick:_[0]||(_[0]=T=>S.$emit("close"))},"×")]),n("div",Of,[n("section",null,[_[12]||(_[12]=n("h3",null,"自动刷新",-1)),n("div",Nf,[_[10]||(_[10]=n("label",null,"刷新间隔(秒)",-1)),Tt(n("input",{type:"number","onUpdate:modelValue":_[1]||(_[1]=T=>l.value=T),min:"1",max:"300",onChange:I},null,544),[[jn,l.value,void 0,{number:!0}]])]),n("div",jf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[2]||(_[2]=T=>i.value=T),onChange:I},null,544),[[Le,i.value]]),_[11]||(_[11]=At(" 启用自动刷新 ",-1))])])]),n("section",null,[_[15]||(_[15]=n("h3",null,"显示选项",-1)),n("div",Uf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[3]||(_[3]=T=>o.value=T),onChange:I},null,544),[[Le,o.value]]),_[13]||(_[13]=At(" 显示时间戳 ",-1))])]),n("div",Vf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[4]||(_[4]=T=>a.value=T),onChange:I},null,544),[[Le,a.value]]),_[14]||(_[14]=At(" 显示 Token 消耗 ",-1))])])]),n("section",null,[_[18]||(_[18]=n("h3",null,"通知",-1)),n("div",Wf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[5]||(_[5]=T=>r.value=T),onChange:I},null,544),[[Le,r.value]]),_[16]||(_[16]=At(" Agent 异常时通知 ",-1))])]),n("div",Hf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[6]||(_[6]=T=>d.value=T),onChange:I},null,544),[[Le,d.value]]),_[17]||(_[17]=At(" 任务完成时通知 ",-1))])])]),n("section",null,[_[22]||(_[22]=n("h3",null,"日志查看",-1)),n("div",Bf,[_[20]||(_[20]=n("label",null,"日志行数",-1)),Tt(n("select",{"onUpdate:modelValue":_[7]||(_[7]=T=>v.value=T),onChange:I},[..._[19]||(_[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",Kf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":_[8]||(_[8]=T=>p.value=T),onChange:I},null,544),[[Le,p.value]]),_[21]||(_[21]=At(" 自动滚动日志 ",-1))])])])])]))}}),Gf=Ct(qf,[["__scopeId","data-v-e5b26232"]]);function zf(t,e=300){const s=W(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 Jf{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 Jf(t)),tn}class Qf{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,W(s))}useStore(e,s){const l=this.state.get(e);if(l)return l;const i=W(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 Yf(){return en||(en=new Qf),en}class Xf{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 Zf(){return sn||(sn=new Xf),sn}function Li(){const t=Fi(),e=W(t.getConnectionState()),s=W(!1);let l=null;const i=(r,d)=>t.subscribe(r,d),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 th={class:"indicator-icon"},eh={key:0,class:"indicator-count"},sh={class:"card-header"},nh={class:"avatar"},lh={class:"header-info"},ih={class:"name"},oh={class:"status-text"},ah={key:0,class:"main-badge"},rh={class:"card-body"},ch={key:0,class:"model-row"},uh={class:"model-value"},dh=["title"],fh={key:0,class:"fallback-more"},hh={key:1,class:"current-task"},ph=["title"],vh={key:0,class:"task-child-info"},gh={class:"child-name"},mh={key:2,class:"multi-tasks"},_h={class:"tasks-count"},yh={class:"tasks-toggle"},bh=["title"],$h={key:0,class:"task-child-agent"},kh={key:0,class:"tasks-more"},wh={class:"action-icon"},Ch={class:"action-text"},Th={key:4,class:"idle-hint"},Sh={class:"warning-modal"},xh={class:"modal-header"},Ah={class:"modal-icon"},Ih={class:"modal-title"},Mh={class:"modal-body"},Rh={class:"detail-row"},Eh={class:"detail-value error-type-tag"},Ph={class:"detail-row"},Dh={class:"detail-value"},Fh={class:"detail-row"},Lh={class:"detail-value highlight"},Oh={key:0,class:"detail-row"},Nh={class:"detail-value"},jh={key:1,class:"detail-row"},Uh={class:"detail-value"},Vh={key:2,class:"detail-row"},Wh={key:0,class:"waiting-task"},Hh={key:3,class:"stuck-suggestion"},Bh=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=W(!1),o=W(!1),a=["🤖","👤","📊","🏗️","💻","🧪","🔧","📋","🎯","⚙️"],r=Q(()=>{const P=(s.agent.name||"").toLowerCase();if(P.includes("pm")||P.includes("project")||P.includes("主"))return"👨💼";if(P.includes("analyst")||P.includes("分析"))return"📊";if(P.includes("architect")||P.includes("架构"))return"🏗️";if(P.includes("dev")||P.includes("开发"))return"💻";if(P.includes("qa")||P.includes("test")||P.includes("测试"))return"🧪";if(P.includes("ops")||P.includes("运维"))return"🔧";if(P.includes("frontend")||P.includes("前端"))return"🎨";if(P.includes("backend")||P.includes("后端"))return"⚙️";let j=0;for(let Z=0;Z<P.length;Z++)j=(j<<5)-j+P.charCodeAt(Z);return a[Math.abs(j)%a.length]}),d=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[s.agent.status]||"未知"),v=Q(()=>{var P;return((P=s.agentTasks)==null?void 0:P.length)||0}),p=Q(()=>s.isMain&&v.value>=2),C=Q(()=>s.agentTasks?s.agentTasks.slice(0,3):[]),I=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),_=Q(()=>{if(s.agentTasks&&s.agentTasks.length===1)return s.agentTasks[0].childAgentId}),T=Q(()=>({thinking:"🧠",tool_executing:"⚙️",waiting_llm:"📡",waiting_child:"⏳"})[s.subStatus||""]||"🔄"),O=Q(()=>{var j;return{"rate-limit":"请求过快","token-limit":"Token 超限",timeout:"请求超时",quota:"余额不足",unknown:"发生错误"}[((j=s.error)==null?void 0:j.type)||"unknown"]||"发生错误"}),$=Q(()=>{var j;return{waiting_for_child:"等待子代理响应",self_busy:"自身处理中",unknown:"原因未明"}[((j=s.stuckWarning)==null?void 0:j.reason)||"unknown"]||"原因未明"}),x=Q(()=>{if(!s.stuckWarning)return null;const P=s.stuckWarning.reason,j=s.stuckWarning.idleSeconds;return P==="waiting_for_child"?j>180?"子代理响应时间过长,建议检查子代理状态或考虑终止任务":"子代理正在执行任务,请耐心等待":P==="self_busy"?j>120?"任务处理时间过长,可能遇到复杂问题或外部资源阻塞":"正在处理复杂任务,请稍候":null});function y(P){const j=P.split("/");return j[j.length-1]||P}function w(){i.value=!0}function G(P){l("navigate-agent",P),i.value=!1}return(P,j)=>{var Z;return c(),u("div",{class:nt(["agent-card",[`status-${t.agent.status}`,{"is-main":t.isMain}]]),onClick:j[4]||(j[4]=D=>P.$emit("click"))},[t.error||t.stuckWarning?(c(),u("div",{key:0,class:nt(["warning-indicator",{"has-error":t.error}]),onClick:le(w,["stop"])},[n("span",th,f(t.error?"⚠️":"⏳"),1),t.stuckWarning?(c(),u("span",eh,f(t.stuckWarning.idleSeconds)+"s",1)):M("",!0)],2)):M("",!0),n("div",sh,[n("div",nh,f(r.value),1),n("div",lh,[n("div",ih,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",oh,f(d.value),1)],2)]),t.isMain?(c(),u("div",ah,"PM")):M("",!0)]),n("div",rh,[t.modelInfo&&t.modelInfo.primary?(c(),u("div",ch,[j[5]||(j[5]=n("span",{class:"model-label"},"模型",-1)),n("span",uh,f(y(t.modelInfo.primary)),1),(Z=t.modelInfo.fallbacks)!=null&&Z.length?(c(),u("span",{key:0,class:"model-fallbacks",title:"备用: "+t.modelInfo.fallbacks.map(y).join(", ")},[(c(!0),u(Y,null,ct(t.modelInfo.fallbacks.slice(0,2),(D,K)=>(c(),u("span",{key:D,class:"fallback-tag"},f(y(D)),1))),128)),t.modelInfo.fallbacks.length>2?(c(),u("span",fh,"+"+f(t.modelInfo.fallbacks.length-2),1)):M("",!0)],8,dh)):M("",!0)])):M("",!0),S.value&&!p.value?(c(),u("div",hh,[j[7]||(j[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,ph),_.value?(c(),u("div",vh,[j[6]||(j[6]=n("span",{class:"child-arrow"},"→",-1)),n("span",gh,f(_.value),1)])):M("",!0)])):M("",!0),p.value?(c(),u("div",mh,[n("div",{class:"tasks-header",onClick:j[0]||(j[0]=le(D=>o.value=!o.value,["stop"]))},[j[8]||(j[8]=n("span",{class:"tasks-icon"},"📋",-1)),j[9]||(j[9]=n("span",{class:"tasks-label"},"并行任务",-1)),n("span",_h,f(v.value),1),n("span",yh,f(o.value?"▲":"▼"),1)]),n("div",{class:nt(["tasks-list",{expanded:o.value}])},[(c(!0),u(Y,null,ct(C.value,D=>(c(),u("div",{key:D.id,class:nt(["task-item",`task-status-${D.status}`])},[j[10]||(j[10]=n("span",{class:"task-status-dot"},null,-1)),n("span",{class:"task-name",title:D.name},f(D.name),9,bh),D.childAgentId?(c(),u("span",$h,"→ "+f(D.childAgentId),1)):M("",!0)],2))),128)),I.value>0?(c(),u("div",kh," +"+f(I.value)+" 更多任务 ",1)):M("",!0)],2)])):M("",!0),t.agent.status==="working"&&t.currentAction?(c(),u("div",{key:3,class:nt(["status-detail",`sub-status-${t.subStatus}`])},[n("span",wh,f(T.value),1),n("span",Ch,f(t.currentAction),1)],2)):t.agent.status==="idle"?(c(),u("div",Th," 空闲中,等待任务... ")):M("",!0)]),(c(),Gt(Po,{to:"body"},[i.value?(c(),u("div",{key:0,class:"warning-modal-overlay",onClick:j[3]||(j[3]=le(D=>i.value=!1,["self"]))},[n("div",Sh,[n("div",xh,[n("span",Ah,f(t.error?"⚠️":"⏳"),1),n("span",Ih,f(t.error?"异常详情":"卡顿分析"),1),n("button",{class:"modal-close",onClick:j[1]||(j[1]=D=>i.value=!1)},"×")]),n("div",Mh,[t.error?(c(),u(Y,{key:0},[n("div",Rh,[j[11]||(j[11]=n("span",{class:"detail-label"},"类型",-1)),n("span",Eh,f(O.value),1)]),n("div",Ph,[j[12]||(j[12]=n("span",{class:"detail-label"},"信息",-1)),n("span",Dh,f(t.error.message),1)])],64)):t.stuckWarning?(c(),u(Y,{key:1},[n("div",Fh,[j[13]||(j[13]=n("span",{class:"detail-label"},"等待时间",-1)),n("span",Lh,f(t.stuckWarning.idleSeconds)+" 秒",1)]),t.stuckWarning.reason?(c(),u("div",Oh,[j[14]||(j[14]=n("span",{class:"detail-label"},"原因",-1)),n("span",Nh,f($.value),1)])):M("",!0),t.stuckWarning.reasonDetail?(c(),u("div",jh,[j[15]||(j[15]=n("span",{class:"detail-label"},"详情",-1)),n("span",Uh,f(t.stuckWarning.reasonDetail),1)])):M("",!0),t.stuckWarning.waitingFor?(c(),u("div",Vh,[j[16]||(j[16]=n("span",{class:"detail-label"},"等待对象",-1)),n("span",{class:"detail-value agent-link",onClick:j[2]||(j[2]=D=>G(t.stuckWarning.waitingFor.agentId))},[At(f(t.stuckWarning.waitingFor.agentId)+" ",1),t.stuckWarning.waitingFor.task?(c(),u("span",Wh,"("+f(t.stuckWarning.waitingFor.task)+")",1)):M("",!0)])])):M("",!0),x.value?(c(),u("div",Hh,[j[17]||(j[17]=n("span",{class:"suggestion-icon"},"💡",-1)),n("span",null,f(x.value),1)])):M("",!0)],64)):M("",!0)])])])):M("",!0)]))],2)}}}),Kh=Ct(Bh,[["__scopeId","data-v-04c4a970"]]),qh={class:"collaboration-flow-section"},Gh={class:"section-header"},zh={class:"header-right"},Jh={key:0,class:"flow-legend flow-legend-inline"},Qh={class:"legend-name"},Yh={class:"indicator-text"},Xh={class:"flow-container",ref:"flowContainerRef"},Zh={key:0,class:"loading-state"},tp={key:1,class:"error-state"},ep={key:2,class:"empty-state"},sp={key:3,class:"flow-layout"},np={class:"level-header"},lp={class:"level-badge"},ip={class:"level-title"},op={class:"level-cards"},ap=["onClick"],rp=["d"],cp={key:0,r:"5",fill:"url(#lightGradient)"},up={dur:"2s",repeatCount:"1",rotate:"0"},dp=["href"],fp={key:0,class:"model-panel"},hp={class:"model-toggle-icon"},pp={class:"model-panel-body"},vp={class:"model-name"},gp={class:"model-dots"},mp=["title","onClick"],_p={class:"model-count"},yp={class:"call-detail-modal"},bp={class:"call-detail-header"},$p={class:"call-detail-body"},kp={class:"call-detail-row"},wp={class:"value"},Cp={class:"call-detail-row"},Tp={class:"value"},Sp={class:"call-detail-row"},xp={class:"value"},Ap={class:"call-detail-row"},Ip={class:"value"},Mp={class:"call-detail-row trigger"},Rp={class:"value"},Ep=1500,Pp=wt({__name:"CollaborationFlowSection",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t,{emit:e}){const s=t,l=e,{connectionState:i,subscribe:o}=Li(),a=W([]),r=W([]),d=W([]),v=W({}),p=W([]),C=W(!0),I=W(null),S=W(null),_=W({}),T=W({}),O=W(""),$=W(!0),x=W({}),y=W(null),w=W(null),G=W({});function P(g,m){m&&(G.value[g]=m)}const j=Q(()=>s.mainAgentId?s.mainAgentId:O.value?O.value:"main"),Z=Q(()=>a.value.filter(g=>g.type==="agent")),D=Q(()=>a.value.filter(g=>g.type==="model")),K=Q(()=>r.value.filter(g=>g.type==="delegates")),q=Q(()=>{const g={};for(const L of Z.value){const E=X(L.id);g[E]||(g[E]=[]),g[E].push(L)}const m={};return Object.keys(g).map(Number).sort((L,E)=>L-E).forEach(L=>{m[L]=g[L]}),m});function A(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===j.value?"#4a9eff":st[g]||"#64748b"}const F=Q(()=>Z.value.map(g=>g.id).filter(Boolean)),U=Q(()=>({connected:"已连接",connecting:"连接中...",disconnected:"未连接",error:"连接错误"})[i.value.status]||"未知");function X(g){return g===j.value?T.value[g]??0:T.value[g]??1}function it(g){const m=Z.value.find(L=>L.id===g);return(m==null?void 0:m.name)||g}function V(g){var E;const m=N=>N==="error"?"down":N,L=g.id===j.value?s.mainAgent:(E=s.subAgents)==null?void 0:E.find(N=>N.id===g.id);if(L&&g.type==="agent"){const N=ot(g.id);let k;const J=g.status==="idle"||g.status==="error";J||((N==null?void 0:N.length)===1?k=N[0].name:N&&N.length>1&&(k=`${N.length} 个任务进行中`));const z=J?void 0:L.currentTask;return{name:L.name,status:m(g.status),currentTask:k??z,lastActiveFormatted:L.lastActiveFormatted}}return L?{name:L.name,status:L.status,currentTask:L.currentTask,lastActiveFormatted:L.lastActiveFormatted}:{name:g.name,status:m(g.status)}}function H(g){if(g.type!=="agent")return;const m=v.value[g.id];if(m)return m;const L=g.id.toLowerCase();for(const[E,N]of Object.entries(v.value))if(E.toLowerCase()===L)return N}function ot(g){const m=x.value,L=m[g];if(L!=null&&L.length)return L;const E=g.toLowerCase();for(const[N,k]of Object.entries(m))if(N.toLowerCase()===E&&(k!=null&&k.length))return k}function lt(g){if(d.value.includes(g.id))return!0;const m=g.id.toLowerCase();return d.value.some(L=>L.toLowerCase()===m)}function ft(g){const m=d.value,L=E=>m.includes(E)||m.some(N=>N.toLowerCase()===E.toLowerCase());return L(g.source)&&L(g.target)}function tt(g){const m=G.value[g.source],L=G.value[g.target],E=y.value;if(!m||!L||!E)return"";const N=E.getBoundingClientRect(),k=m.getBoundingClientRect(),J=L.getBoundingClientRect(),z=k.left-N.left+k.width/2,et=k.top-N.top+k.height,at=J.left-N.left+J.width/2,dt=J.top-N.top,vt=(et+dt)/2;return`M ${z} ${et} C ${z} ${vt}, ${at} ${vt}, ${at} ${dt}`}function kt(){Me(()=>{if(!y.value||!w.value)return;const g=y.value.getBoundingClientRect();w.value.setAttribute("width",String(g.width)),w.value.setAttribute("height",String(g.height))})}const It=Q(()=>{const g={};for(const m of p.value){const L=m.model||"(unknown)";g[L]||(g[L]=[]),g[L].push(m)}return g});function Dt(g){var E;const m=((E=g.metadata)==null?void 0:E.modelId)||"",L=m.split("/").pop()||m;return It.value[m]||It.value[L]||[]}function _e(g){return Dt(g).length>0}async function ye(){C.value=!0,I.value=null;try{const g=await fetch("/api/collaboration");if(!g.ok)throw new Error("Failed to fetch collaboration data");const m=await g.json();a.value=m.nodes||[],r.value=m.edges||[],d.value=m.activePath||[],v.value=m.agentModels||{},p.value=m.recentCalls||[],m.hierarchy&&(_.value=m.hierarchy),m.depths&&(T.value=m.depths),m.mainAgentId&&(O.value=m.mainAgentId),m.agentActiveTasks&&(x.value=m.agentActiveTasks),Me(kt)}catch(g){I.value=g.message}finally{C.value=!1}}function Qt(){ye()}function Se(g){const m=g;a.value=m.nodes||[],r.value=m.edges||[],d.value=m.activePath||[],v.value=m.agentModels||{},p.value=m.recentCalls||[],m.hierarchy&&(_.value=m.hierarchy),m.depths&&(T.value=m.depths),m.mainAgentId&&(O.value=m.mainAgentId),m.agentActiveTasks&&(x.value=m.agentActiveTasks),Me(kt)}function h(g){d.value=g.activePath||[],p.value=g.recentCalls||[],g.agentActiveTasks&&(x.value=g.agentActiveTasks);const m=a.value.filter(k=>k.type==="agent");for(const k of m){if(k.id&&g.agentStatuses&&g.agentStatuses[k.id]!==void 0&&(k.status=g.agentStatuses[k.id]),k.id&&g.agentDynamicStatuses&&g.agentDynamicStatuses[k.id]){const J=g.agentDynamicStatuses[k.id];k.subStatus=J.subStatus,k.currentAction=J.currentAction,k.toolName=J.toolName,k.waitingFor=J.waitingFor}if(k.id&&g.agentDisplayStatuses&&g.agentDisplayStatuses[k.id]){const J=g.agentDisplayStatuses[k.id];k.currentAction=J.display,k.metadata||(k.metadata={}),k.metadata={...k.metadata,duration:J.duration,alert:J.alert},J.alert?k.stuckWarning={isStuck:!0,idleSeconds:J.duration,lastUpdate:Date.now(),reason:"self_busy",reasonDetail:J.display}:k.stuckWarning&&!k.stuckWaitingForChildAgent&&(k.stuckWarning=void 0)}}const L=new Set(a.value.filter(k=>k.type==="task").map(k=>k.id)),E=new Set((g.taskNodes||[]).map(k=>k.id));if(L.size!==E.size||[...E].some(k=>!L.has(k))){const k=a.value.filter(z=>z.type==="model"),J=r.value.filter(z=>z.type==="delegates");a.value=[...m,...g.taskNodes||[],...k],r.value=[...J,...g.taskEdges||[]],Me(kt)}else{const k=new Map((g.taskNodes||[]).map(J=>[J.id,J]));for(const J of a.value.filter(z=>z.type==="task")){const z=k.get(J.id);z&&(J.status=z.status,J.name=z.name,z.timestamp&&(J.timestamp=z.timestamp))}}}async function b(){if(!(C.value||a.value.length===0))try{const g=await fetch("/api/collaboration/dynamic");if(!g.ok)return;const m=await g.json();h(m)}catch{}}let R=null,B=null;return Bt([Z,$],()=>{Me(kt)}),Nt(()=>{ye(),R=o("collaboration",Se),B=setInterval(b,Ep),window.addEventListener("resize",kt)}),ae(()=>{R&&R(),B&&clearInterval(B),window.removeEventListener("resize",kt)}),(g,m)=>{var L;return c(),u("div",qh,[n("div",Gh,[m[4]||(m[4]=n("h2",null,"协作流程",-1)),n("div",zh,[Z.value.length>0?(c(),u("div",Jh,[(c(!0),u(Y,null,ct(F.value,E=>(c(),u("div",{key:E,class:"legend-item"},[n("span",{class:"legend-dot",style:St({background:mt(E)})},null,4),n("span",Qh,f(it(E)),1)]))),128))])):M("",!0),n("div",{class:nt(["connection-indicator",rs(i).status])},[m[3]||(m[3]=n("span",{class:"indicator-dot"},null,-1)),n("span",Yh,f(U.value),1)],2)])]),n("div",Xh,[C.value?(c(),u("div",Zh,[...m[5]||(m[5]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载中...",-1)])])):I.value?(c(),u("div",tp,[m[6]||(m[6]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(I.value),1),n("button",{onClick:Qt,class:"retry-btn"},"重试")])):a.value.length===0?(c(),u("div",ep,[...m[7]||(m[7]=[n("span",{class:"empty-icon"},"📭",-1),n("span",null,"暂无协作数据",-1)])])):(c(),u("div",sp,[n("div",{class:"agent-area",ref_key:"agentAreaRef",ref:y},[(c(!0),u(Y,null,ct(q.value,(E,N)=>(c(),u("div",{key:N,class:"level-section"},[n("div",np,[n("span",lp,"L"+f(N),1),n("span",ip,f(A(Number(N))),1)]),n("div",op,[(c(!0),u(Y,null,ct(E,k=>(c(),u("div",{key:k.id,class:nt(["agent-card-wrapper",{"main-agent":k.id===j.value,active:lt(k),[`status-${k.status}`]:!0}]),style:St({"--agent-color":mt(k.id)}),ref_for:!0,ref:J=>P(k.id,J),onClick:J=>l("agent-click",k)},[bt(Kh,{agent:V(k),"model-info":H(k),"is-main":k.id===j.value,"current-task":k.currentTask,error:k.error,"stuck-warning":k.stuckWarning,"hierarchy-depth":X(k.id),"agent-color":mt(k.id),"sub-status":k.subStatus,"current-action":k.currentAction,"tool-name":k.toolName,"waiting-for":k.waitingFor,"agent-tasks":ot(k.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,ap))),128))])]))),128)),(c(),u("svg",{class:"edges-svg",ref_key:"edgesSvgRef",ref:w},[m[8]||(m[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),u(Y,null,ct(K.value,E=>(c(),u("g",{key:E.id},[n("path",{d:tt(E),class:nt(["edge-path",{active:ft(E)}]),stroke:"#4a9eff","stroke-width":"2",fill:"none"},null,10,rp),ft(E)?(c(),u("circle",cp,[n("animateMotion",up,[n("mpath",{href:`#edge-${E.id}`},null,8,dp)])])):M("",!0)]))),128))],512))],512),D.value.length>0?(c(),u("div",fp,[n("div",{class:"model-panel-header",onClick:m[0]||(m[0]=E=>$.value=!$.value)},[m[9]||(m[9]=n("span",{class:"model-panel-title"},"🧠 模型",-1)),n("span",hp,f($.value?"▼":"▶"),1)]),Tt(n("div",pp,[(c(!0),u(Y,null,ct(D.value,E=>(c(),u("div",{key:E.id,class:nt(["model-card",{active:_e(E)}])},[n("div",vp,f(E.name),1),n("div",gp,[(c(!0),u(Y,null,ct(Dt(E).slice(0,8),N=>(c(),u("span",{key:N.id,class:"model-dot",style:St({background:mt(N.agentId)}),title:`${it(N.agentId)} @ ${N.model||"unknown"}`,onClick:le(k=>S.value=N,["stop"])},null,12,mp))),128))]),n("div",_p,f(Dt(E).length),1)],2))),128))],512),[[fs,$.value]])])):M("",!0)]))],512),S.value?(c(),u("div",{key:0,class:"call-detail-overlay",onClick:m[2]||(m[2]=le(E=>S.value=null,["self"]))},[n("div",yp,[n("div",bp,[m[10]||(m[10]=n("h3",null,"调用详情",-1)),n("button",{class:"close-btn",onClick:m[1]||(m[1]=E=>S.value=null)},"×")]),n("div",$p,[n("div",kp,[m[11]||(m[11]=n("span",{class:"label"},"Agent",-1)),n("span",wp,f(S.value.agentId),1)]),n("div",Cp,[m[12]||(m[12]=n("span",{class:"label"},"模型",-1)),n("span",Tp,f(S.value.model),1)]),n("div",Sp,[m[13]||(m[13]=n("span",{class:"label"},"时间",-1)),n("span",xp,f(S.value.time),1)]),n("div",Ap,[m[14]||(m[14]=n("span",{class:"label"},"Tokens",-1)),n("span",Ip,f(S.value.tokens),1)]),n("div",Mp,[m[15]||(m[15]=n("span",{class:"label"},"触发",-1)),n("div",Rp,f((L=S.value.trigger)==null?void 0:L.replace(/^【完成回传】/,"")),1)])])])])):M("",!0)])}}}),Dp=Ct(Pp,[["__scopeId","data-v-50bc0adc"]]),Fp={class:"collaboration-box"},Lp={class:"collaboration-box-body"},Op={class:"collaboration-error-fallback"},Np={class:"fallback-reason"},jp=wt({__name:"CollaborationFlowWrapper",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t){const e=W(null);return ci(s=>(e.value=s instanceof Error?s.message:String(s),!1)),(s,l)=>(c(),u("div",Fp,[l[3]||(l[3]=n("div",{class:"collaboration-box-header"},[n("h2",null,"协作流程"),n("span",{class:"collaboration-hint"},"展示主 Agent 与子 Agents 的协作关系")],-1)),n("div",Lp,[Tt(bt(Dp,{"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",Np,f(e.value),1),n("button",{onClick:l[1]||(l[1]=i=>e.value=null)},"重试")],512),[[fs,e.value]])])]))}}),Up=Ct(jp,[["__scopeId","data-v-ef9f8c73"]]),Vp={class:"task-status-section"},Wp={class:"section-header"},Hp={class:"summary-stats"},Bp={class:"stat total"},Kp={class:"filters-row"},qp={class:"search-box"},Gp={class:"filter-buttons"},zp=["onClick"],Jp={key:0,class:"loading-state"},Qp={key:1,class:"error-state"},Yp={key:2,class:"empty-state"},Xp={class:"task-list"},Zp=["onClick"],tv={class:"task-main"},ev={class:"task-name-short"},sv={key:0,class:"task-agent"},nv={key:1,class:"task-time"},lv={class:"task-detail-modal"},iv={class:"task-detail-header"},ov={class:"task-detail-body"},av={class:"detail-row"},rv={class:"detail-value task-content"},cv={key:0,class:"detail-row"},uv={class:"detail-value"},dv={class:"detail-row"},fv={class:"detail-value"},hv={key:1,class:"detail-row"},pv={class:"detail-value"},vv={key:2,class:"detail-row"},gv={class:"detail-value path-value"},mv={key:3,class:"detail-row"},_v={class:"detail-value"},yv={key:4,class:"detail-row"},bv={class:"detail-progress"},$v={class:"progress-bar"},kv={class:"progress-text"},wv={key:5,class:"detail-row"},Cv={class:"detail-value error"},Tv={key:6,class:"detail-row"},Sv={class:"generated-files-list"},xv={key:7,class:"detail-row"},Av={class:"detail-value output-content"},Iv={key:8,class:"detail-row"},Mv={class:"detail-subtasks"},Rv={key:0,class:"subtask-error-inline"},Ev={key:9,class:"detail-row"},Pv={class:"timeline-container"},Dv={class:"timeline"},Fv={class:"timeline-time"},Lv={class:"timeline-desc"},Ov=wt({__name:"TaskStatusSection",setup(t){const{subscribe:e}=Li(),s=W([]),l=W(!0),i=W(null),o=W(""),a=W([]),r=W(null),d=W(null),v=W([]),p=W(!1),C=[{value:"running",label:"执行中"},{value:"completed",label:"已完成"},{value:"failed",label:"失败"},{value:"pending",label:"待分配"}];zf(F=>{},300);const I=Q(()=>{let F=s.value;if(a.value.length>0&&(F=F.filter(U=>a.value.includes(U.status))),o.value){const U=o.value.toLowerCase();F=F.filter(X=>{var it;return X.name.toLowerCase().includes(U)||((it=X.agentName)==null?void 0:it.toLowerCase().includes(U))})}return F}),S=Q(()=>({total:s.value.length,running:s.value.filter(F=>F.status==="running").length,completed:s.value.filter(F=>F.status==="completed").length,failed:s.value.filter(F=>F.status==="failed").length,pending:s.value.filter(F=>F.status==="pending").length,cancelled:s.value.filter(F=>F.status==="cancelled").length}));function _(F){return{pending:"⏳",running:"🔄",completed:"✅",failed:"❌",cancelled:"🚫"}[F]||"📋"}function T(F){return s.value.filter(U=>U.status===F).length}function O(F){if(!F||!F.trim())return"未知";const U=F.trim().toLowerCase(),X={terminated:"任务被终止(可能是超时或被用户取消)",timeout:"任务执行超时",cancelled:"任务已取消",canceled:"任务已取消",killed:"任务被终止","subagent-error":"子任务执行异常"};for(const[it,V]of Object.entries(X))if(U.includes(it))return V;return F.trim()}function $(F){return!F||typeof F!="string"?"":F.replace(/\*\*/g,"").replace(/`([^`]+)`/g,"$1")}function x(F){if(!F.startTime)return"";const U=new Date(F.startTime).getTime(),X=F.endTime?new Date(F.endTime).getTime():Date.now(),it=Math.floor((X-U)/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 y(F){const U=a.value.indexOf(F);U===-1?a.value.push(F):a.value.splice(U,1)}function w(F){a.value.length===1&&a.value[0]===F?a.value=[]:a.value=[F]}function G(F){const X=$(F.task??F.name).split(`
|
|
24
|
-
`)[0].trim();return X.length<=60?X:X.slice(0,60)+"…"}function P(F){return{pending:"待分配",running:"执行中",completed:"已完成",failed:"失败",cancelled:"已取消"}[F]||F}async function j(){l.value=!0,i.value=null;try{const F=await fetch("/api/tasks");if(!F.ok)throw new Error("Failed to fetch tasks");const U=await F.json();s.value=(U.tasks||[]).map(X=>K(X))}catch(F){i.value=F.message}finally{l.value=!1}}function Z(F){return{pending:"pending",assigning:"pending",running:"running",in_progress:"running",active:"running",completed:"completed",success:"completed",failed:"failed",error:"failed",cancelled:"cancelled"}[F]||"pending"}function D(){j()}function K(F){const U=(F.subtasks||[]).map(X=>({id:X.id||X.name,name:X.name||"Unknown",task:X.task,status:Z(X.status),progress:X.progress??0,startTime:X.startTime,endTime:X.endTime,agentId:X.agentId,agentName:X.agentName,agentWorkspace:X.agentWorkspace,taskPath:X.taskPath,error:X.error,output:X.output,generatedFiles:X.generatedFiles}));return{id:F.id,name:F.name||"Unknown Task",task:F.task,status:Z(F.status),progress:F.progress??0,startTime:F.startTime,endTime:F.endTime,agentId:F.agentId,agentName:F.agentName,agentWorkspace:F.agentWorkspace,taskPath:F.taskPath,error:F.error,output:F.output,generatedFiles:F.generatedFiles,subtasks:U.length?U:void 0}}function q(F){const X=(Array.isArray(F)?F:F&&typeof F=="object"&&"tasks"in F?F.tasks??[]:[]).map(it=>K(it));X.length===0&&s.value.length>0||(s.value=X)}function A(F){return F?new Date(F).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}async function st(F){if(!F){v.value=[];return}p.value=!0;try{const U=await fetch(`/api/tasks/${F}/timeline`);if(U.ok){const X=await U.json();v.value=X.timeline||[]}}catch(U){console.error("Failed to fetch timeline:",U),v.value=[]}finally{p.value=!1}}Bt(r,F=>{F?st(F.id):v.value=[]});let mt=null;return Nt(()=>{j(),mt=e("tasks",q)}),ae(()=>{mt&&mt()}),(F,U)=>{var X,it;return c(),u("div",Vp,[n("div",Wp,[U[6]||(U[6]=n("h2",null,"任务状态",-1)),n("div",Hp,[n("span",{class:nt(["stat running clickable",{active:a.value.includes("running")}]),onClick:U[0]||(U[0]=V=>w("running"))},"执行中: "+f(S.value.running),3),n("span",{class:nt(["stat completed clickable",{active:a.value.includes("completed")}]),onClick:U[1]||(U[1]=V=>w("completed"))},"已完成: "+f(S.value.completed),3),n("span",{class:nt(["stat failed clickable",{active:a.value.includes("failed")}]),onClick:U[2]||(U[2]=V=>w("failed"))},"失败: "+f(S.value.failed),3),n("span",Bp,"总计: "+f(S.value.total),1)])]),n("div",Kp,[n("div",qp,[Tt(n("input",{"onUpdate:modelValue":U[3]||(U[3]=V=>o.value=V),type:"text",placeholder:"搜索任务...",class:"search-input"},null,512),[[jn,o.value]])]),n("div",Gp,[(c(),u(Y,null,ct(C,V=>n("button",{key:V.value,class:nt(["filter-btn",{active:a.value.includes(V.value)}]),onClick:H=>y(V.value)},f(V.label)+" ("+f(T(V.value))+") ",11,zp)),64))])]),l.value?(c(),u("div",Jp,[...U[7]||(U[7]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载任务数据...",-1)])])):i.value?(c(),u("div",Qp,[U[8]||(U[8]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(i.value),1),n("button",{onClick:D,class:"retry-btn"},"重试")])):I.value.length===0?(c(),u("div",Yp,[U[9]||(U[9]=n("span",{class:"empty-icon"},"📭",-1)),n("span",null,f(o.value?"无匹配任务":"暂无任务数据"),1)])):(c(),u("div",{key:3,class:"task-list-container",ref_key:"containerRef",ref:d},[n("div",Xp,[(c(!0),u(Y,null,ct(I.value,V=>(c(),u("div",{key:V.id,class:"task-item",onClick:H=>r.value=V},[n("span",{class:nt(["task-status-icon",V.status])},f(_(V.status)),3),n("div",tv,[n("div",ev,f(G(V)),1)]),V.agentName?(c(),u("span",sv,f(V.agentName),1)):M("",!0),V.startTime?(c(),u("span",nv,f(x(V)),1)):M("",!0),U[10]||(U[10]=n("span",{class:"task-detail-hint"},"详情 ›",-1))],8,Zp))),128))])],512)),r.value?(c(),u("div",{key:4,class:"task-detail-overlay",onClick:U[5]||(U[5]=le(V=>r.value=null,["self"]))},[n("div",lv,[n("div",iv,[U[11]||(U[11]=n("h3",null,"任务详情",-1)),n("button",{class:"close-btn",onClick:U[4]||(U[4]=V=>r.value=null)},"×")]),n("div",ov,[n("div",av,[U[12]||(U[12]=n("span",{class:"detail-label"},"任务",-1)),n("span",rv,f($(r.value.task??r.value.name)),1)]),r.value.taskPath?(c(),u("div",cv,[U[13]||(U[13]=n("span",{class:"detail-label"},"项目路径",-1)),n("span",uv,f($(r.value.taskPath)),1)])):M("",!0),n("div",dv,[U[14]||(U[14]=n("span",{class:"detail-label"},"状态",-1)),n("span",fv,[n("span",{class:nt(["task-status-icon",r.value.status])},f(_(r.value.status)),3),At(" "+f(P(r.value.status)),1)])]),r.value.agentName?(c(),u("div",hv,[U[15]||(U[15]=n("span",{class:"detail-label"},"执行者",-1)),n("span",pv,f(r.value.agentName),1)])):M("",!0),r.value.agentWorkspace?(c(),u("div",vv,[U[16]||(U[16]=n("span",{class:"detail-label"},"Agent 工作区路径",-1)),n("span",gv,f(r.value.agentWorkspace),1)])):M("",!0),r.value.startTime?(c(),u("div",mv,[U[17]||(U[17]=n("span",{class:"detail-label"},"耗时",-1)),n("span",_v,f(x(r.value)),1)])):M("",!0),r.value.status==="running"?(c(),u("div",yv,[U[18]||(U[18]=n("span",{class:"detail-label"},"进度",-1)),n("div",bv,[n("div",$v,[n("div",{class:"progress-fill",style:St({width:`${r.value.progress}%`})},null,4)]),n("span",kv,f(r.value.progress)+"%",1)])])):M("",!0),r.value.status==="failed"?(c(),u("div",wv,[U[19]||(U[19]=n("span",{class:"detail-label"},"失败原因",-1)),n("span",Cv,f(O(r.value.error)),1)])):M("",!0),r.value.status==="completed"&&((X=r.value.generatedFiles)!=null&&X.length)?(c(),u("div",Tv,[U[20]||(U[20]=n("span",{class:"detail-label"},"生成的文件",-1)),n("ul",Sv,[(c(!0),u(Y,null,ct(r.value.generatedFiles,V=>(c(),u("li",{key:V,class:"file-path-item"},f(V),1))),128))])])):M("",!0),r.value.status==="completed"&&r.value.output?(c(),u("div",xv,[U[21]||(U[21]=n("span",{class:"detail-label"},"Agent 输出",-1)),n("div",Av,f($(r.value.output)),1)])):M("",!0),(it=r.value.subtasks)!=null&&it.length?(c(),u("div",Iv,[U[22]||(U[22]=n("span",{class:"detail-label"},"子任务",-1)),n("div",Mv,[(c(!0),u(Y,null,ct(r.value.subtasks,V=>(c(),u("div",{key:V.id,class:"subtask-row"},[n("span",{class:nt(["task-status-icon",V.status])},f(_(V.status)),3),n("span",null,f(V.name),1),V.status==="failed"?(c(),u("span",Rv,f(O(V.error)),1)):M("",!0)]))),128))])])):M("",!0),v.value.length>0?(c(),u("div",Ev,[U[24]||(U[24]=n("span",{class:"detail-label"},"执行时间线",-1)),n("div",Pv,[n("div",Dv,[(c(!0),u(Y,null,ct(v.value,(V,H)=>(c(),u("div",{key:H,class:nt(["timeline-item",V.type])},[n("span",Fv,f(A(V.time)),1),U[23]||(U[23]=n("span",{class:"timeline-dot"},null,-1)),n("span",Lv,f(V.description),1)],2))),128))])])])):M("",!0)])])])):M("",!0)])}}}),Nv=Ct(Ov,[["__scopeId","data-v-5d944098"]]),jv={class:"performance-section"},Uv={class:"section-header"},Vv={class:"time-range-selector"},Wv=["onClick"],Hv={key:0,class:"loading-state"},Bv={key:1,class:"error-state"},Kv={class:"metrics-grid"},qv={class:"metric-card primary"},Gv={class:"metric-content"},zv={class:"metric-value"},Jv={key:0,class:"metric-alert"},Qv={class:"metric-card"},Yv={class:"metric-content"},Xv={class:"metric-value"},Zv={class:"metric-card highlight"},tg={class:"metric-content"},eg={class:"metric-value"},sg={class:"metric-unit"},ng={class:"metric-card highlight"},lg={class:"metric-content"},ig={class:"metric-value"},og={class:"metric-unit"},ag={class:"charts-stack"},rg={class:"chart-card"},cg={class:"chart-header"},ug={class:"chart-datetime"},dg={class:"chart-container"},fg={class:"chart-bars"},hg=["title","onClick"],pg={class:"bar-value"},vg={class:"bar-time-label"},gg={class:"chart-card"},mg={class:"chart-header"},_g={class:"chart-datetime"},yg={class:"chart-container"},bg={class:"chart-bars rpm"},$g=["title","onClick"],kg={class:"bar-value"},wg={class:"bar-time-label"},Cg={class:"summary-section"},Tg={class:"summary-grid"},Sg={class:"summary-item"},xg={class:"summary-value"},Ag={class:"summary-item"},Ig={class:"summary-value"},Mg={key:0,class:"summary-sub"},Rg={class:"summary-item highlight"},Eg={class:"summary-value"},Pg={class:"detail-modal"},Dg={class:"detail-modal-header"},Fg={class:"detail-modal-body"},Lg={key:0,class:"detail-loading"},Og={key:1,class:"detail-calls"},Ng={class:"detail-summary"},jg={class:"detail-filters"},Ug=["value"],Vg={key:0,class:"detail-call-hint"},Wg={class:"call-header"},Hg={class:"call-agent"},Bg={class:"call-time"},Kg={class:"call-tokens"},qg=["title"],Gg={key:0,class:"call-trigger-badge"},zg={key:0,class:"call-meta"},Jg={key:2,class:"detail-empty"},Qg={key:1,class:"alerts-panel"},Yg={class:"alerts-list"},Xg={class:"alert-message"},Zg={class:"alert-value"},tm={class:"alert-time"},em=["onClick"],sm=wt({__name:"PerformanceSection",setup(t){const e=W(!0),s=W(null),l=W("20m"),i=W([]),o=W(!1),a=W(!1),r=W(null),d=W(""),v=W(""),p=W(""),C=W("tokens_desc"),I=Q(()=>{var H;if(!((H=r.value)!=null&&H.calls))return[];const V=new Set(r.value.calls.map(ot=>ot.agentId));return Array.from(V).sort()}),S=Q(()=>{var H;if(!((H=r.value)!=null&&H.calls))return[];let V=[...r.value.calls];if(v.value){const ot=v.value.toLowerCase();V=V.filter(lt=>{var ft;return(ft=lt.trigger)==null?void 0:ft.toLowerCase().includes(ot)})}switch(p.value&&(V=V.filter(ot=>ot.agentId===p.value)),C.value){case"tokens_desc":V.sort((ot,lt)=>lt.tokens-ot.tokens);break;case"tokens_asc":V.sort((ot,lt)=>ot.tokens-lt.tokens);break;case"time_asc":V.sort((ot,lt)=>ot.time.localeCompare(lt.time));break;case"time_desc":V.sort((ot,lt)=>lt.time.localeCompare(ot.time));break}return V}),_=Q(()=>S.value.reduce((V,H)=>V+H.tokens,0)),T=W({current:{tpm:0,rpm:0,windowTotal:{tokens:0,requests:0}},history:{tpm:[],rpm:[],timestamps:[]},statistics:{avgTpm:0,peakTpm:0,peakTime:""}}),O=[{value:"20m",label:"20分钟"},{value:"1h",label:"1小时"},{value:"24h",label:"24小时"}],$=Q(()=>{const V=O.find(H=>H.value===l.value);return V?`最近 ${V.label}`:""}),x=Q(()=>{switch(l.value){case"20m":return 20;case"1h":return 60;case"24h":return 24;default:return 20}}),y=Q(()=>{const V=T.value.history,H=x.value;if(V.tpm.length===0){const ot=l.value==="24h"?36e5:6e4;return Array.from({length:H},(lt,ft)=>({timestamp:Date.now()-(H-ft-1)*ot,tpm:0,rpm:0}))}return V.tpm.map((ot,lt)=>({timestamp:V.timestamps[lt]||Date.now()-lt*6e4,tpm:ot,rpm:V.rpm[lt]||0}))});function w(V){const H=y.value.map(lt=>lt[V]);return Math.max(...H,1)*1.2}function G(V,H){return Math.max(V/H*100,5)}function P(V){return V>=1e6?(V/1e6).toFixed(1)+"M":V>=1e3?(V/1e3).toFixed(1)+"K":V.toString()}const j=W(Date.now());function Z(V){const H=V??Date.now(),ot=typeof H=="number"?H:Number(H);if(isNaN(ot))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=ot<1e12?ot*1e3:ot,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 D(V){if(V==null)return"--:--";if(typeof V=="string"){const lt=V.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 V}const H=Number(V);if(isNaN(H))return"--:--";const ot=new Date(H);return isNaN(ot.getTime())?"--:--":l.value==="24h"?ot.toLocaleString("zh-CN",{hour:"2-digit",hour12:!1})+":00":ot.toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function K(V){return i.value.some(H=>H.type===V&&!H.acknowledged)}function q(V){const H=i.value.find(ot=>ot.id===V);H&&(H.acknowledged=!0)}async function A(){var V,H,ot,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:((V=h.current)==null?void 0:V.tpm)??0,rpm:((H=h.current)==null?void 0:H.rpm)??0,windowTotal:{tokens:((lt=(ot=h.current)==null?void 0:ot.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)??""}},j.value=Date.now(),st()}catch(Se){s.value=Se.message}finally{e.value=!1}}function st(){const{current:V}=T.value;V.tpm>1e5&&i.value.push({id:`high_tpm_${Date.now()}`,type:"high_tpm",message:"TPM 过高",value:V.tpm,threshold:1e5,timestamp:Date.now(),acknowledged:!1}),i.value=i.value.slice(-10)}function mt(){A()}async function F(V){let H;if(typeof V.timestamp=="number")H=V.timestamp<1e12?V.timestamp*1e3:V.timestamp;else if(typeof V.timestamp=="string"){const lt=V.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),H=new Date(Date.UTC(ft.getUTCFullYear(),ft.getUTCMonth(),tt,lt[0],lt[1],0,0)).getTime()}else return}else return;const ot=l.value==="24h"?"hour":"minute";o.value=!0,d.value=`${D(V.timestamp)} 调用详情`,r.value=null,a.value=!0,v.value="",p.value="",C.value="tokens_desc";try{const lt=await fetch(`/api/performance/details?timestamp=${H}&granularity=${ot}`),ft=await lt.json();lt.ok?(r.value=ft,d.value=`${ft.timeWindow||D(V.timestamp)} 调用详情`):r.value={timeWindow:D(V.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}catch{r.value={timeWindow:D(V.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}finally{a.value=!1}}let U=null;function X(){it();const V=l.value==="24h"?3e5:3e4;U=setInterval(A,V)}function it(){U&&(clearInterval(U),U=null)}return Nt(()=>{A(),X()}),ae(()=>{it()}),Bt(l,()=>{A(),X()}),(V,H)=>{var ot,lt,ft;return c(),u("div",jv,[n("div",Uv,[H[5]||(H[5]=n("h2",null,"性能数据",-1)),n("div",Vv,[(c(),u(Y,null,ct(O,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,Wv)),64))])]),e.value?(c(),u("div",Hv,[...H[6]||(H[6]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载性能数据...",-1)])])):s.value?(c(),u("div",Bv,[H[7]||(H[7]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(s.value),1),n("button",{onClick:mt,class:"retry-btn"},"重试")])):(c(),u(Y,{key:2},[n("div",Kv,[n("div",qv,[H[10]||(H[10]=n("div",{class:"metric-icon"},"⚡",-1)),n("div",Gv,[H[8]||(H[8]=n("div",{class:"metric-label"},"TPM",-1)),n("div",zv,f(P(T.value.current.tpm)),1),H[9]||(H[9]=n("div",{class:"metric-unit"},"Tokens/分钟",-1))]),K("high_tpm")?(c(),u("div",Jv,"⚠️")):M("",!0)]),n("div",Qv,[H[13]||(H[13]=n("div",{class:"metric-icon"},"🔄",-1)),n("div",Yv,[H[11]||(H[11]=n("div",{class:"metric-label"},"RPM",-1)),n("div",Xv,f(P(T.value.current.rpm)),1),H[12]||(H[12]=n("div",{class:"metric-unit"},"Requests/分钟",-1))])]),n("div",Zv,[H[15]||(H[15]=n("div",{class:"metric-icon"},"📊",-1)),n("div",tg,[H[14]||(H[14]=n("div",{class:"metric-label"},"总 Token",-1)),n("div",eg,f(P(T.value.current.windowTotal.tokens)),1),n("div",sg,f($.value),1)])]),n("div",ng,[H[17]||(H[17]=n("div",{class:"metric-icon"},"🔢",-1)),n("div",lg,[H[16]||(H[16]=n("div",{class:"metric-label"},"总请求",-1)),n("div",ig,f(P(T.value.current.windowTotal.requests)),1),n("div",og,f($.value),1)])])]),n("div",ag,[n("div",rg,[n("div",cg,[H[18]||(H[18]=n("h3",null,"TPM 趋势",-1)),n("span",ug,f(Z(j.value)),1)]),n("div",dg,[n("div",fg,[(c(!0),u(Y,null,ct(y.value,(tt,kt)=>(c(),u("div",{key:kt,class:"chart-bar clickable",style:St({height:`${G(tt.tpm,w("tpm"))}%`}),title:`${D(tt.timestamp)}: ${P(tt.tpm)} TPM - 点击查看详情`,onClick:It=>F(tt)},[n("span",pg,f(P(tt.tpm)),1),n("span",vg,f(D(tt.timestamp)),1)],12,hg))),128))])])]),n("div",gg,[n("div",mg,[H[19]||(H[19]=n("h3",null,"RPM 趋势",-1)),n("span",_g,f(Z(j.value)),1)]),n("div",yg,[n("div",bg,[(c(!0),u(Y,null,ct(y.value,(tt,kt)=>(c(),u("div",{key:kt,class:"chart-bar clickable",style:St({height:`${G(tt.rpm,w("rpm"))}%`}),title:`${D(tt.timestamp)}: ${tt.rpm} RPM - 点击查看调用详情`,onClick:It=>F(tt)},[n("span",kg,f(tt.rpm),1),n("span",wg,f(D(tt.timestamp)),1)],12,$g))),128))])])])]),n("div",Cg,[H[23]||(H[23]=n("h3",null,"统计摘要",-1)),n("div",Tg,[n("div",Sg,[H[20]||(H[20]=n("span",{class:"summary-label"},"平均 TPM",-1)),n("span",xg,f(P(T.value.statistics.avgTpm)),1)]),n("div",Ag,[H[21]||(H[21]=n("span",{class:"summary-label"},"峰值 TPM",-1)),n("span",Ig,f(P(T.value.statistics.peakTpm)),1),T.value.statistics.peakTime?(c(),u("span",Mg,"峰值时间: "+f(T.value.statistics.peakTime),1)):M("",!0)]),n("div",Rg,[H[22]||(H[22]=n("span",{class:"summary-label"},"时间窗口",-1)),n("span",Eg,f($.value),1)])])]),o.value?(c(),u("div",{key:0,class:"detail-modal-overlay",onClick:H[4]||(H[4]=le(tt=>o.value=!1,["self"]))},[n("div",Pg,[n("div",Dg,[n("h3",null,f(d.value),1),n("button",{class:"close-btn",onClick:H[0]||(H[0]=tt=>o.value=!1)},"×")]),n("div",Fg,[a.value?(c(),u("div",Lg,"加载详情...")):(lt=(ot=r.value)==null?void 0:ot.calls)!=null&<.length?(c(),u("div",Og,[n("div",Ng,f(S.value.length)+" / "+f(r.value.totalCalls)+" 次调用 · "+f(P(_.value))+" Tokens · 平均 "+f(P(((ft=r.value.summary)==null?void 0:ft.avgTokens)||0))+" Tokens/调用 ",1),n("div",jg,[Tt(n("input",{"onUpdate:modelValue":H[1]||(H[1]=tt=>v.value=tt),type:"text",class:"search-input",placeholder:"搜索触发内容..."},null,512),[[jn,v.value]]),Tt(n("select",{"onUpdate:modelValue":H[2]||(H[2]=tt=>p.value=tt),class:"agent-filter"},[H[24]||(H[24]=n("option",{value:""},"全部 Agent",-1)),(c(!0),u(Y,null,ct(I.value,tt=>(c(),u("option",{key:tt,value:tt},f(tt),9,Ug))),128))],512),[[Pe,p.value]]),Tt(n("select",{"onUpdate:modelValue":H[3]||(H[3]=tt=>C.value=tt),class:"sort-select"},[...H[25]||(H[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(),u("div",Vg,[...H[26]||(H[26]=[n("span",{class:"hint-badge"},"完成回传",-1),n("span",{class:"hint-text"},"此时间戳为子任务完成后的回传时间,不是派发时间",-1)])])):M("",!0),(c(!0),u(Y,null,ct(S.value,(tt,kt)=>{var It,Dt;return c(),u("div",{key:kt,class:"detail-call-item"},[n("div",Wg,[n("span",Hg,f(tt.agentId),1),n("span",Bg,f(tt.time),1),n("span",Kg,f(P(tt.tokens))+" tokens",1)]),n("div",{class:"call-trigger",title:tt.trigger},[(It=tt.trigger)!=null&&It.startsWith("【完成回传】")?(c(),u("span",Gg,"完成回传")):M("",!0),At(" "+f((Dt=tt.trigger)==null?void 0:Dt.replace(/^【完成回传】/,"")),1)],8,qg),tt.model?(c(),u("div",zg,"模型: "+f(tt.model),1)):M("",!0)])}),128))])):(c(),u("div",Jg,"该时段无调用记录"))])])])):M("",!0),i.value.length>0?(c(),u("div",Qg,[H[27]||(H[27]=n("h3",null,"⚠️ 性能告警",-1)),n("div",Yg,[(c(!0),u(Y,null,ct(i.value,tt=>(c(),u("div",{key:tt.id,class:nt(["alert-item",tt.type])},[n("span",Xg,f(tt.message),1),n("span",Zg,f(P(tt.value))+" (阈值: "+f(P(tt.threshold))+")",1),n("span",tm,f(D(tt.timestamp)),1),n("button",{class:"ack-btn",onClick:kt=>q(tt.id)},"确认",8,em)],2))),128))])])):M("",!0)],64))])}}}),nm=Ct(sm,[["__scopeId","data-v-6508c9b4"]]),lm={class:"token-analysis"},im={class:"section-header"},om={class:"time-range-selector"},am=["onClick"],rm={key:0,class:"loading-state"},cm={key:1,class:"error-state"},um={class:"summary-cards"},dm={class:"summary-card"},fm={class:"card-content"},hm={class:"card-value"},pm={class:"summary-card"},vm={class:"card-content"},gm={class:"card-value"},mm={class:"summary-card highlight"},_m={class:"card-content"},ym={class:"card-value"},bm={class:"card-sub"},$m={class:"summary-card"},km={class:"card-content"},wm={class:"card-value"},Cm={class:"summary-card cost"},Tm={class:"card-content"},Sm={class:"card-value"},xm={key:0,class:"card-sub saved"},Am={key:0,class:"trend-section"},Im={class:"trend-chart"},Mm={class:"trend-bars"},Rm={key:0,class:"bar-tooltip"},Em={key:0,class:"bar-tooltip"},Pm={class:"trend-time"},Dm={class:"view-toggle"},Fm={key:1,class:"by-agent-table"},Lm={class:"agent-name"},Om={class:"total-col"},Nm={class:"percent-bar"},jm={class:"percent-text"},Um={class:"total-col"},Vm={key:2,class:"by-agent-chart"},Wm={class:"bar-chart"},Hm={class:"bar-label"},Bm={class:"bar-container"},Km={class:"bar-value"},qm={class:"bar-percent"},Gm=wt({__name:"TokenAnalysisPanel",setup(t){const e=W({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=W(!1),l=W(""),i=W("table"),o=W("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),d=Q(()=>{if(!e.value.trend)return 1;const O=[...e.value.trend.input,...e.value.trend.output];return Math.max(...O,1)}),v=Q(()=>[...e.value.byAgent||[]].sort((O,$)=>$.total-O.total));function p(O,$){return Math.max(O/$*100,2)}function C(O){const $=new Date(O);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 I(O){return O==null?"0":O>=1e6?(O/1e6).toFixed(2)+"M":O>=1e3?(O/1e3).toFixed(1)+"K":O.toLocaleString()}function S(O){return O==null?"0%":(O*100).toFixed(1)+"%"}function _(O){return O==null?"0.00":O>=1?O.toFixed(2):O.toFixed(4)}async function T(){s.value=!0,l.value="";try{const O=await fetch(`/api/tokens/analysis?range=${o.value}`);O.ok?e.value=await O.json():l.value="加载失败"}catch(O){l.value=String(O)}finally{s.value=!1}}return Nt(T),Bt(o,T),(O,$)=>{var x,y,w,G,P,j,Z,D,K,q,A,st,mt;return c(),u("section",lm,[n("div",im,[$[2]||($[2]=n("h2",null,"Token 分析",-1)),n("div",om,[(c(),u(Y,null,ct(a,F=>n("button",{key:F.value,class:nt(["range-btn",{active:o.value===F.value}]),onClick:U=>o.value=F.value},f(F.label),11,am)),64))])]),s.value?(c(),u("div",rm,[...$[3]||($[3]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载 Token 数据...",-1)])])):l.value?(c(),u("div",cm,[$[4]||($[4]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(l.value),1),n("button",{onClick:T,class:"retry-btn"},"重试")])):(c(),u(Y,{key:2},[n("div",um,[n("div",dm,[$[6]||($[6]=n("div",{class:"card-icon"},"📥",-1)),n("div",fm,[$[5]||($[5]=n("div",{class:"card-label"},"Input",-1)),n("div",hm,f(I((x=e.value.summary)==null?void 0:x.input)),1)])]),n("div",pm,[$[8]||($[8]=n("div",{class:"card-icon"},"📤",-1)),n("div",vm,[$[7]||($[7]=n("div",{class:"card-label"},"Output",-1)),n("div",gm,f(I((y=e.value.summary)==null?void 0:y.output)),1)])]),n("div",mm,[$[10]||($[10]=n("div",{class:"card-icon"},"💾",-1)),n("div",_m,[$[9]||($[9]=n("div",{class:"card-label"},"Cache Read",-1)),n("div",ym,f(I((w=e.value.summary)==null?void 0:w.cacheRead)),1),n("div",bm,"命中率 "+f(S((G=e.value.summary)==null?void 0:G.cacheHitRate)),1)])]),n("div",$m,[$[12]||($[12]=n("div",{class:"card-icon"},"📝",-1)),n("div",km,[$[11]||($[11]=n("div",{class:"card-label"},"Cache Write",-1)),n("div",wm,f(I((P=e.value.summary)==null?void 0:P.cacheWrite)),1)])]),n("div",Cm,[$[14]||($[14]=n("div",{class:"card-icon"},"💰",-1)),n("div",Tm,[$[13]||($[13]=n("div",{class:"card-label"},"估算成本",-1)),n("div",Sm,"$"+f(_((j=e.value.cost)==null?void 0:j.total)),1),((Z=e.value.cost)==null?void 0:Z.saved)>0?(c(),u("div",xm,"节省 $"+f(_((D=e.value.cost)==null?void 0:D.saved)),1)):M("",!0)])])]),e.value.trend&&r.value?(c(),u("div",Am,[$[16]||($[16]=n("h3",null,"Token 消耗趋势",-1)),n("div",Im,[n("div",Mm,[(c(!0),u(Y,null,ct(e.value.trend.timestamps,(F,U)=>(c(),u("div",{key:U,class:"trend-bar-group"},[n("div",{class:"trend-bar input",style:St({height:p(e.value.trend.input[U],d.value)+"%"})},[e.value.trend.input[U]>0?(c(),u("span",Rm,"In: "+f(I(e.value.trend.input[U])),1)):M("",!0)],4),n("div",{class:"trend-bar output",style:St({height:p(e.value.trend.output[U],d.value)+"%"})},[e.value.trend.output[U]>0?(c(),u("span",Em,"Out: "+f(I(e.value.trend.output[U])),1)):M("",!0)],4),n("span",Pm,f(C(F)),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",Dm,[n("button",{class:nt({active:i.value==="table"}),onClick:$[0]||($[0]=F=>i.value="table")},"📊 表格",2),n("button",{class:nt({active:i.value==="chart"}),onClick:$[1]||($[1]=F=>i.value="chart")},"📈 图表",2)]),i.value==="table"?(c(),u("div",Fm,[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),u(Y,null,ct(v.value,F=>(c(),u("tr",{key:F.agent},[n("td",Lm,f(F.agent),1),n("td",null,f(I(F.input)),1),n("td",null,f(I(F.output)),1),n("td",null,f(I(F.cacheRead+F.cacheWrite)),1),n("td",Om,f(I(F.total)),1),n("td",null,[n("div",Nm,[n("div",{class:"percent-fill",style:St({width:F.percent*100+"%"})},null,4),n("span",jm,f(S(F.percent)),1)])])]))),128))]),n("tfoot",null,[n("tr",null,[$[17]||($[17]=n("td",null,[n("strong",null,"合计")],-1)),n("td",null,f(I((K=e.value.summary)==null?void 0:K.input)),1),n("td",null,f(I((q=e.value.summary)==null?void 0:q.output)),1),n("td",null,f(I((((A=e.value.summary)==null?void 0:A.cacheRead)||0)+(((st=e.value.summary)==null?void 0:st.cacheWrite)||0))),1),n("td",Um,[n("strong",null,f(I((mt=e.value.summary)==null?void 0:mt.total)),1)]),$[18]||($[18]=n("td",null,"100%",-1))])])])])):(c(),u("div",Vm,[$[20]||($[20]=n("h3",null,"Token 消耗分布",-1)),n("div",Wm,[(c(!0),u(Y,null,ct(v.value,F=>(c(),u("div",{key:F.agent,class:"bar-row"},[n("div",Hm,f(F.agent),1),n("div",Bm,[n("div",{class:"bar",style:St({width:F.percent*100+"%"})},[n("span",Km,f(I(F.total)),1)],4)]),n("div",qm,f(S(F.percent)),1)]))),128))])]))],64))])}}}),zm=Ct(Gm,[["__scopeId","data-v-b98a8391"]]),Jm={class:"performance-panel"},Qm={class:"panel-header"},Ym={class:"tab-switcher"},Xm={class:"panel-content"},Zm=wt({__name:"PerformancePanel",setup(t){const e=W("tpm");return(s,l)=>(c(),u("div",Jm,[n("div",Qm,[l[2]||(l[2]=n("h2",null,"性能监控",-1)),n("div",Ym,[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",Xm,[Tt(bt(nm,null,null,512),[[fs,e.value==="tpm"]]),Tt(bt(zm,null,null,512),[[fs,e.value==="token"]])])]))}}),t1=Ct(Zm,[["__scopeId","data-v-7962ace4"]]),e1={class:"error-center"},s1={class:"header"},n1={class:"header-actions"},l1=["value"],i1=["value"],o1={class:"stats-row"},a1={class:"stat-card total"},r1={class:"stat-value"},c1={class:"stat-card session"},u1={class:"stat-value"},d1={class:"stat-card model"},f1={class:"stat-value"},h1={class:"stat-value"},p1={key:0,class:"trend-section"},v1={class:"trend-chart"},g1=["title"],m1={key:0,class:"bar-label"},_1={class:"trend-labels"},y1={key:1,class:"type-distribution"},b1={class:"type-bars"},$1={class:"type-bar-label"},k1={class:"type-bar-track"},w1={class:"type-count"},C1={key:2,class:"api-status-section"},T1={class:"api-status-grid"},S1={class:"api-header"},x1={class:"api-model"},A1={class:"api-provider"},I1={class:"api-status"},M1={class:"status-text"},R1={key:0,class:"api-last-error"},E1={class:"error-type"},P1={class:"error-time"},D1={key:1,class:"api-error-count"},F1={class:"error-lists"},L1={class:"error-group"},O1={class:"count-badge"},N1={key:0,class:"empty"},j1={key:1,class:"error-list"},U1=["onClick"],V1={class:"error-main"},W1={class:"error-agent"},H1={class:"error-msg"},B1={class:"error-time"},K1={class:"expand-icon"},q1={key:0,class:"error-detail"},G1={class:"detail-row"},z1={class:"detail-row"},J1={class:"detail-message"},Q1={class:"error-group"},Y1={class:"count-badge"},X1={key:0,class:"empty"},Z1={key:1,class:"error-list"},t_=["onClick"],e_={class:"error-main"},s_={class:"error-agent"},n_={class:"error-msg"},l_={class:"error-time"},i_={class:"expand-icon"},o_={key:0,class:"error-detail"},a_={class:"detail-row"},r_={class:"detail-row"},c_={class:"detail-message"},u_=wt({__name:"ErrorCenterPanel",setup(t){const e=W([]),s=W([]),l=W([]),i=W({totalCount:0,sessionErrorCount:0,modelFailureCount:0,byType:{},byAgent:{},hourlyTrend:[]}),o=W(!1),a=W(""),r=W(null),d=W(""),v=W(""),p=W([]),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"}},I=Q(()=>l.value.filter(D=>D.status==="healthy").length),S=Q(()=>{var D;return Math.max(...((D=i.value.hourlyTrend)==null?void 0:D.map(K=>K.count))||[1],1)});function _(D){return D/S.value*100}function T(D){const K=i.value.totalCount||1;return D/K*100}function O(D){var K;return((K=C[D])==null?void 0:K.color)||"#6b7280"}function $(D){const K=D.match(/(\d{2}):00/);return K?K[1]+"h":""}function x(D){if(!D)return"-";const q=Date.now()-D,A=Math.floor(q/6e4);if(A<1)return"刚刚";if(A<60)return`${A}分钟前`;const st=Math.floor(A/60);return st<24?`${st}小时前`:`${Math.floor(st/24)}天前`}function y(D,K){return D?D.length>K?D.slice(0,K)+"...":D:"-"}function w(D){return{healthy:"正常",degraded:"降级",down:"异常"}[D]||"未知"}function G(D){const K=p.value.find(q=>q.id===D);return K?K.name:D}function P(D){r.value=r.value===D?null:D}async function j(){try{const D=await fetch("/api/agents");if(D.ok){const K=await D.json();p.value=(Array.isArray(K)?K:[]).map(q=>({id:q.id,name:q.name||q.id}))}}catch(D){console.error("Failed to load agents:",D)}}async function Z(){o.value=!0,a.value="";try{const D=new URLSearchParams;d.value&&D.set("agent",d.value),v.value&&D.set("type",v.value);const[K,q]=await Promise.all([fetch(`/api/errors/summary?${D.toString()}`),fetch("/api/errors/stats")]);if(K.ok){const A=await K.json();e.value=A.sessionErrors||[],s.value=A.modelFailures||[],l.value=A.apiStatus||[]}q.ok&&(i.value=await q.json())}catch(D){a.value=String(D)}finally{o.value=!1}}return Nt(()=>{j(),Z()}),(D,K)=>{var q;return c(),u("section",e1,[n("div",s1,[K[4]||(K[4]=n("h2",null,"错误中心",-1)),n("div",n1,[Tt(n("select",{"onUpdate:modelValue":K[0]||(K[0]=A=>d.value=A),onChange:Z,class:"filter-select"},[K[2]||(K[2]=n("option",{value:""},"全部 Agent",-1)),(c(!0),u(Y,null,ct(p.value,A=>(c(),u("option",{key:A.id,value:A.id},f(A.name),9,l1))),128))],544),[[Pe,d.value]]),Tt(n("select",{"onUpdate:modelValue":K[1]||(K[1]=A=>v.value=A),onChange:Z,class:"filter-select"},[K[3]||(K[3]=n("option",{value:""},"全部类型",-1)),(c(),u(Y,null,ct(C,(A,st)=>n("option",{key:st,value:st},f(A.label),9,i1)),64))],544),[[Pe,v.value]]),n("button",{onClick:Z,class:"refresh-btn"},"刷新")])]),n("div",o1,[n("div",a1,[n("div",r1,f(i.value.totalCount),1),K[5]||(K[5]=n("div",{class:"stat-label"},"总错误数",-1))]),n("div",c1,[n("div",u1,f(i.value.sessionErrorCount),1),K[6]||(K[6]=n("div",{class:"stat-label"},"Session 错误",-1))]),n("div",d1,[n("div",f1,f(i.value.modelFailureCount),1),K[7]||(K[7]=n("div",{class:"stat-label"},"Model 错误",-1))]),n("div",{class:nt(["stat-card",I.value===l.value.length?"healthy":"warning"])},[n("div",h1,f(I.value)+"/"+f(l.value.length),1),K[8]||(K[8]=n("div",{class:"stat-label"},"API 健康",-1))],2)]),(q=i.value.hourlyTrend)!=null&&q.length?(c(),u("div",p1,[K[9]||(K[9]=n("h3",null,"24 小时错误趋势",-1)),n("div",v1,[(c(!0),u(Y,null,ct(i.value.hourlyTrend,(A,st)=>(c(),u("div",{key:st,class:"trend-bar",style:St({height:_(A.count)+"%"}),title:`${A.hour}: ${A.count} 个错误`},[A.count>0?(c(),u("span",m1,f(A.count),1)):M("",!0)],12,g1))),128))]),n("div",_1,[(c(!0),u(Y,null,ct(i.value.hourlyTrend,(A,st)=>(c(),u("span",{key:st,class:"trend-time"},f(st%4===0?$(A.hour):""),1))),128))])])):M("",!0),Object.keys(i.value.byType||{}).length?(c(),u("div",y1,[K[10]||(K[10]=n("h3",null,"错误类型分布",-1)),n("div",b1,[(c(!0),u(Y,null,ct(i.value.byType,(A,st)=>(c(),u("div",{key:st,class:"type-bar-item"},[n("div",$1,[n("span",{class:"type-dot",style:St({background:A.color})},null,4),At(" "+f(A.label),1)]),n("div",k1,[n("div",{class:"type-bar-fill",style:St({width:T(A.count)+"%",background:A.color})},null,4)]),n("span",w1,f(A.count),1)]))),128))])])):M("",!0),l.value.length?(c(),u("div",C1,[K[11]||(K[11]=n("h3",null,"API 状态",-1)),n("div",T1,[(c(!0),u(Y,null,ct(l.value,A=>(c(),u("div",{key:A.model,class:nt(["api-status-card",`status-${A.status}`])},[n("div",S1,[n("span",x1,f(A.model),1),n("span",A1,f(A.provider),1)]),n("div",I1,[n("span",{class:nt(["status-dot",`status-${A.status}`])},null,2),n("span",M1,f(w(A.status)),1)]),A.lastError?(c(),u("div",R1,[n("span",E1,f(A.lastError.type),1),n("span",P1,f(x(A.lastError.timestamp)),1)])):M("",!0),A.errorCount>0?(c(),u("div",D1," 错误: "+f(A.errorCount)+" 次 ",1)):M("",!0)],2))),128))])])):M("",!0),n("div",F1,[n("div",L1,[n("h3",null,[K[12]||(K[12]=At("Session 错误 ",-1)),n("span",O1,f(e.value.length),1)]),e.value.length?(c(),u("div",j1,[(c(!0),u(Y,null,ct(e.value,A=>(c(),u("div",{key:A.id,class:nt(["error-item",`severity-${A.severity}`]),onClick:st=>P(A.id)},[n("div",V1,[n("span",W1,f(G(A.agentId)),1),n("span",{class:"error-type",style:St({color:O(A.type)})},f(A.typeLabel),5),n("span",H1,f(y(A.message,80)),1),n("span",B1,f(x(A.timestamp)),1),n("span",K1,f(r.value===A.id?"▼":"▶"),1)]),r.value===A.id?(c(),u("div",q1,[n("div",G1,[K[13]||(K[13]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(A.datetime),1)]),n("div",z1,[K[14]||(K[14]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",J1,f(A.fullMessage||A.message),1)])])):M("",!0)],10,U1))),128))])):(c(),u("div",N1,"暂无错误"))]),n("div",Q1,[n("h3",null,[K[15]||(K[15]=At("Model Failures ",-1)),n("span",Y1,f(s.value.length),1)]),s.value.length?(c(),u("div",Z1,[(c(!0),u(Y,null,ct(s.value,A=>(c(),u("div",{key:A.id,class:nt(["error-item",`severity-${A.severity}`]),onClick:st=>P(A.id)},[n("div",e_,[n("span",s_,f(A.model),1),n("span",{class:"error-type",style:St({color:O(A.type)})},f(A.typeLabel),5),n("span",n_,f(y(A.message,80)),1),n("span",l_,f(x(A.timestamp)),1),n("span",i_,f(r.value===A.id?"▼":"▶"),1)]),r.value===A.id?(c(),u("div",o_,[n("div",a_,[K[16]||(K[16]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(A.datetime),1)]),n("div",r_,[K[17]||(K[17]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",c_,f(A.fullMessage||A.message),1)])])):M("",!0)],10,t_))),128))])):(c(),u("div",X1,"暂无错误"))])])])}}}),d_=Ct(u_,[["__scopeId","data-v-ca874c41"]]),f_={class:"version-display"},h_={key:0,class:"loading-text"},p_={key:1,class:"error-text"},v_={key:0,class:"tooltip"},g_={class:"tooltip-item"},m_={class:"tooltip-item"},__={class:"tooltip-item"},y_={key:0,class:"tooltip-item"},b_={key:1,class:"tooltip-item"},$_=wt({__name:"VersionDisplay",setup(t){const e=W(!0),s=W(!1),l=W({version:"",name:"",description:""}),i=W(!1),o=Q(()=>l.value.name&&l.value.version?`${l.value.name} v${l.value.version}`:l.value.version||"v?"),a=d=>{try{return new Date(d).toLocaleString("zh-CN")}catch{return d}},r=async()=>{try{e.value=!0,s.value=!1;const d=`${window.location.origin}/api/version`,v=await fetch(d,{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(d){console.error("获取版本信息失败:",d),s.value=!0}finally{e.value=!1}};return Nt(()=>{r()}),(d,v)=>(c(),u("div",f_,[e.value?(c(),u("span",h_,"加载中...")):s.value?(c(),u("span",p_,"版本信息获取失败")):(c(),u(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(),u("div",v_,[n("div",g_,[v[2]||(v[2]=n("strong",null,"名称:",-1)),At(" "+f(l.value.name),1)]),n("div",m_,[v[3]||(v[3]=n("strong",null,"版本:",-1)),At(" "+f(l.value.version),1)]),n("div",__,[v[4]||(v[4]=n("strong",null,"描述:",-1)),At(" "+f(l.value.description),1)]),l.value.build_date?(c(),u("div",y_,[v[5]||(v[5]=n("strong",null,"构建时间:",-1)),At(" "+f(a(l.value.build_date)),1)])):M("",!0),l.value.git_commit?(c(),u("div",b_,[v[6]||(v[6]=n("strong",null,"Git 提交:",-1)),At(" "+f(l.value.git_commit),1)])):M("",!0)])):M("",!0)],64))]))}}),k_=Ct($_,[["__scopeId","data-v-87a575a1"]]),w_={id:"app"},C_={class:"controls"},T_={class:"collaboration-section"},S_={class:"task-status-section"},x_={class:"performance-section"},A_={class:"error-center-section"},I_=wt({__name:"App",setup(t){const e=Fi(),s=Yf(),l=Zf();ks("realtimeManager",e),ks("stateManager",s),ks("eventDispatcher",l);const i=W([]),o=W(null),a=W(!1),r=W({status:"disconnected",reconnectAttempts:0}),d=Q(()=>{switch(r.value.status){case"connected":return"已连接";case"connecting":return"连接中...";case"disconnected":return"未连接";case"error":return"连接错误";default:return"未知"}}),v=W(null),p=W("main"),C=W([]);async function I(){try{const[w,G]=await Promise.all([fetch("/api/agents"),fetch("/api/config").catch(()=>null)]),P=await w.json();if(i.value=Array.isArray(P)?P:[],G!=null&&G.ok){const D=await G.json();p.value=D&&D.mainAgentId||"main"}const j=Array.isArray(i.value)?i.value:[],Z=j.find(D=>D.id===p.value);Z&&(v.value=Z),C.value=j.filter(D=>D.id!==p.value)}catch(w){console.error("刷新数据失败:",w)}}function S(w){o.value=w}function _(w){const G=w.id===p.value?v.value:C.value.find(P=>P.id===w.id);S(G||{id:w.id,name:w.name,role:w.id===p.value?"主 Agent":"子 Agent",status:w.status==="error"?"down":w.status})}function T(w){I()}function O(w){r.value=w}let $=null,x=null,y=null;return Nt(()=>{I(),e.connect(),$=e.onStateChange(O),x=e.subscribe("agents",w=>{if(Array.isArray(w)){i.value=w;const G=w.find(P=>P.id===p.value);v.value=G||null,C.value=w.filter(P=>P.id!==p.value)}}),y=e.subscribe("agents_update",w=>{if(Array.isArray(w)){w.forEach(P=>{const j=i.value.findIndex(Z=>Z.id===P.id);j>=0&&(i.value[j]={...i.value[j],...P})});const G=i.value.find(P=>P.id===p.value);G&&(v.value=G),C.value=i.value.filter(P=>P.id!==p.value)}})}),ae(()=>{$==null||$(),x==null||x(),y==null||y(),e.disconnect()}),(w,G)=>(c(),u("div",w_,[n("header",null,[G[3]||(G[3]=n("h1",null,"OpenClaw Agent Dashboard",-1)),n("div",C_,[bt(k_),n("button",{onClick:I},"刷新"),n("button",{onClick:G[0]||(G[0]=P=>a.value=!0)},"⚙️ 设置"),n("span",{class:nt(["connection-status",r.value.status])},f(d.value),3)])]),n("main",null,[n("section",T_,[bt(Up,{"main-agent":v.value,"sub-agents":C.value,"main-agent-id":p.value,onAgentClick:_},null,8,["main-agent","sub-agents","main-agent-id"])]),n("section",S_,[bt(Nv)]),n("section",x_,[bt(t1)]),n("section",A_,[bt(d_)])]),a.value?(c(),Gt(Gf,{key:0,onClose:G[1]||(G[1]=P=>a.value=!1),onSettingsChanged:T})):M("",!0),o.value?(c(),Gt(Df,{key:1,agent:o.value,onClose:G[2]||(G[2]=P=>o.value=null)},null,8,["agent"])):M("",!0)]))}}),M_=Ct(I_,[["__scopeId","data-v-543ef282"]]);er(M_).mount("#app");
|
|
23
|
+
...`:""),M=Q(()=>s.step.type!=="toolResult"||s.step.toolResultStatus!=="error"?"":s.step.toolResultError?s.step.toolResultError:s.step.toolResult||"工具执行失败"),_=Q(()=>{if(s.step.type!=="toolResult"||s.step.toolResultStatus!=="error")return null;const G=(s.step.toolResultError||s.step.toolResult||"").toLowerCase(),A=(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("增加超时时间","简化任务或检查网络"),A==="read"&&st.length===0&&st.push("检查路径是否在 workspace 内","确认文件编码正确"),A.includes("bash")&&st.length===0&&st.push("检查命令语法","确认依赖已安装","查看退出码"),st.length===0&&st.push("查看原始返回详情","尝试调整参数后重试"),st}),w=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,A=s.step.pairedToolResultId||s.step.id;l("highlight-pair",{callId:G,resultId:A})}P()}function P(){S.value&&(i.value=!i.value)}function N(G){return G?new Date(G).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Z(G){return G?G<1e3?`${G}ms`:G<6e4?`${(G/1e3).toFixed(1)}s`:`${(G/6e4).toFixed(1)}min`:"0ms"}function F(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,A)=>(c(),u("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),d.value?(c(),u("span",rr,f(d.value),1)):R("",!0),!i.value&&k.value?(c(),u("span",cr,f(k.value),1)):R("",!0),n("span",ur,f(N(t.step.timestamp)),1),t.step.duration&&t.step.duration>0?(c(),u("span",dr," +"+f(Z(t.step.duration)),1)):R("",!0),t.step.executionTime?(c(),u("span",fr," ⏱ "+f(Z(t.step.executionTime)),1)):R("",!0)]),n("div",hr,[t.step.tokens?(c(),u("span",pr,[A[2]||(A[2]=n("span",{class:"token-label"},"tokens:",-1)),At(" "+f(t.step.tokens.input+t.step.tokens.output),1)])):R("",!0),v.value?(c(),u("span",{key:1,class:"pair-indicator",title:I.value}," 🔗 ",8,vr)):R("",!0),S.value?(c(),u("span",gr,f(i.value?"▼":"▶"),1)):R("",!0)])]),S.value&&i.value?(c(),u("div",mr,[t.step.type==="user"&&t.step.content?(c(),u("div",_r,[n("pre",null,f(t.step.content),1)])):R("",!0),t.step.type==="thinking"&&t.step.thinking?(c(),u("div",yr,[A[3]||(A[3]=n("div",{class:"thinking-label"},"💭 思考过程",-1)),n("pre",null,f(t.step.thinking),1)])):R("",!0),t.step.type==="text"&&t.step.content?(c(),u("div",br,[n("pre",null,f(t.step.content),1)])):R("",!0),t.step.type==="toolCall"?(c(),u("div",$r,[t.step.toolArguments?(c(),u("div",kr,[A[4]||(A[4]=n("div",{class:"section-label"},"参数:",-1)),n("pre",wr,f(F(t.step.toolArguments)),1)])):R("",!0)])):R("",!0),t.step.type==="toolResult"?(c(),u("div",Cr,[n("div",Tr,[n("span",{class:nt(["result-status",t.step.toolResultStatus])},f(t.step.toolResultStatus==="ok"?"✅ 成功":"❌ 工具执行失败"),3),t.step.toolResult?(c(),u("button",{key:0,class:"copy-btn",onClick:q}," 复制 ")):R("",!0)]),t.step.toolResultStatus==="error"?(c(),u(Y,{key:0},[M.value?(c(),u("div",Sr,[n("div",xr,f(M.value),1),_.value?(c(),u("div",Ar,[A[5]||(A[5]=n("span",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),u(Y,null,ct(_.value,(st,mt)=>(c(),u("li",{key:mt},f(st),1))),128))])])):R("",!0)])):R("",!0),t.step.toolResult?(c(),u("div",Ir,[A[6]||(A[6]=n("div",{class:"section-label"},"原始返回:",-1)),n("pre",{class:nt({truncated:!o.value})},f(b.value),3),x.value?(c(),u("button",{key:0,class:"show-more-btn",onClick:A[0]||(A[0]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${T.value} 行)`),1)):R("",!0)])):R("",!0)],64)):(c(),u(Y,{key:1},[t.step.toolResult?(c(),u("div",Mr,[n("pre",{class:nt({truncated:!o.value})},f(b.value),3),x.value?(c(),u("button",{key:0,class:"show-more-btn",onClick:A[1]||(A[1]=le(st=>o.value=!o.value,["stop"]))},f(o.value?"收起":`展开全部 (${T.value} 行)`),1)):R("",!0)])):R("",!0)],64))])):R("",!0),t.step.type==="error"?(c(),u("div",Rr,[n("div",Er,f(t.step.errorType||"unknown"),1),n("div",Pr,f(t.step.errorMessage),1),w.value?(c(),u("div",Dr,[A[7]||(A[7]=n("div",{class:"suggestion-label"},"💡 建议:",-1)),n("ul",null,[(c(!0),u(Y,null,ct(w.value,(st,mt)=>(c(),u("li",{key:mt},f(st),1))),128))])])):R("",!0)])):R("",!0)])):R("",!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"]]),Lr={class:"timeline-connector"},Or=wt({__name:"TimelineConnector",setup(t){return(e,s)=>(c(),u("div",Lr,[...s[0]||(s[0]=[n("div",{class:"connector-line"},null,-1),n("div",{class:"connector-arrow"},"▼",-1)])]))}}),_n=Ct(Or,[["__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(),u("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(),u("span",Vr,f(t.round.tokens.input+t.round.tokens.output)+" tokens ",1)):R("",!0)]),n("div",Wr,[(c(!0),u(Y,null,ct(t.round.stepIds,(r,d)=>(c(),u(Y,{key:r},[d>0?(c(),Gt(_n,{key:0})):R("",!0),bt(mn,{step:i(r),prevStep:d>0?i(t.round.stepIds[d-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(),u("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(),u("span",Kr,f(e(t.executionTime)),1)):R("",!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,class:"empty-message"},lc={key:2},ic={key:3,class:"empty-hint"},oc={key:2,class:"timeline-content"},ac={key:0,class:"session-info"},rc={class:"session-id"},cc={key:0,class:"started-at"},uc={class:"steps-list"},dc={key:0,class:"tool-execution-label"},fc={class:"timeline-footer"},hc={class:"stats-grid"},pc={class:"stat-item"},vc={class:"stat-value"},gc={class:"stat-item"},mc={class:"stat-value"},_c={class:"stat-item"},yc={class:"stat-value"},bc={class:"stat-item"},$c={class:"stat-value"},kc=wt({__name:"TimelineView",props:{agentId:{},sessionKey:{},autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=W(null),l=W(!1),i=W(null),o=W(null),a=Q(()=>s.value?s.value.status:"empty"),r=Q(()=>({running:"🔄 进行中",completed:"✅ 已完成",error:"❌ 出错",empty:"空",no_sessions:"无会话"})[a.value]||"未知"),d=Q(()=>{var _;return((_=s.value)==null?void 0:_.roundMode)&&s.value.rounds&&s.value.rounds.length>0}),v=Q(()=>{var w;const _=new Map;if(!((w=s.value)!=null&&w.rounds))return _;for(const K of s.value.rounds)for(const P of K.stepIds)_.set(P,K);return _}),p=Q(()=>{if(!s.value||!d.value)return[];const _=[],w=new Set;for(const K of s.value.steps){if(w.has(K.id))continue;const P=v.value.get(K.id);P?(_.push({type:"round",data:P}),P.stepIds.forEach(N=>w.add(N))):(_.push({type:"step",data:K}),w.add(K.id))}return _});async function C(){if(e.agentId){l.value=!0,i.value=null;try{let _=`/api/timeline/${e.agentId}?limit=100`;e.sessionKey&&(_+=`&session_key=${encodeURIComponent(e.sessionKey)}`);const w=await fetch(_);if(!w.ok)throw new Error(`HTTP ${w.status}`);s.value=await w.json()}catch(_){i.value=_ instanceof Error?_.message:"加载失败",console.error("Timeline load error:",_)}finally{l.value=!1}}}function I(_){s.value&&s.value.steps[_]&&(s.value.steps[_].collapsed=!s.value.steps[_].collapsed)}function S(_){if(s.value){const w=s.value.steps.find(K=>K.id===_);w&&(w.collapsed=!w.collapsed)}}function k(_){o.value=_,setTimeout(()=>{o.value=null},3e3)}function x(_){return _?new Date(_).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function T(_){return _?_<1e3?`${_}ms`:_<6e4?`${(_/1e3).toFixed(1)}s`:`${(_/6e4).toFixed(1)}min`:"0ms"}function b(_){return _>=1e3?`${(_/1e3).toFixed(1)}k`:String(_)}Nt(C),Bt(()=>e.agentId,C);let M=null;return Bt([()=>e.autoRefresh,()=>e.refreshInterval],([_,w])=>{M&&(clearInterval(M),M=null),_&&w&&w>0&&(M=setInterval(C,w*1e3))},{immediate:!0}),(_,w)=>{var K,P,N,Z;return c(),u("div",Gr,[n("div",zr,[n("div",Jr,[w[0]||(w[0]=n("span",{class:"title"},"📊 实时执行时序",-1)),s.value?(c(),u("span",Qr,[At(f(s.value.agentName||s.value.agentId)+" ",1),s.value.model?(c(),u("span",Yr,"("+f(s.value.model)+")",1)):R("",!0)])):R("",!0)]),n("div",Xr,[n("span",{class:nt(["status-badge",`status-${a.value}`])},f(r.value),3),n("button",{class:"refresh-btn",onClick:C,disabled:l.value},f(l.value?"加载中...":"🔄 刷新"),9,Zr)])]),l.value&&!s.value?(c(),u("div",tc,[...w[1]||(w[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载时序数据...",-1)])])):!s.value||s.value.steps.length===0?(c(),u("div",ec,[w[2]||(w[2]=n("span",{class:"empty-icon"},"📭",-1)),((K=s.value)==null?void 0:K.status)==="no_sessions"&&((P=s.value)!=null&&P.isMainAgent)?(c(),u("span",sc," 主 Agent 暂无会话记录 ")):((N=s.value)==null?void 0:N.status)==="no_sessions"?(c(),u("span",nc," 该 Agent 是子代理,暂无独立会话记录 ")):(c(),u("span",lc,"暂无会话记录")),(Z=s.value)!=null&&Z.message?(c(),u("div",ic,f(s.value.message),1)):R("",!0)])):(c(),u("div",oc,[w[8]||(w[8]=Ii('<div class="timeline-legend" data-v-3b17c2f5><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>👤</span> 用户/回传</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🧠</span> LLM 思考</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🤖</span> LLM 回复</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>🔧</span> 工具调用</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>✅</span> 工具成功</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>❌</span> 工具失败</span><span class="legend-item" data-v-3b17c2f5><span class="legend-icon" data-v-3b17c2f5>⚠️</span> 错误</span></div>',1)),s.value.sessionId?(c(),u("div",ac,[n("span",rc,"Session: "+f(s.value.sessionId.slice(0,8))+"...",1),s.value.startedAt?(c(),u("span",cc," 开始: "+f(x(s.value.startedAt)),1)):R("",!0)])):R("",!0),n("div",uc,[d.value?(c(!0),u(Y,{key:0},ct(p.value,(F,q)=>{var G;return c(),u(Y,{key:(F.type==="round",F.data.id)},[q>0?(c(),Gt(_n,{key:0})):R("",!0),F.type==="round"?(c(),Gt(Br,{key:1,round:F.data,steps:s.value.steps,highlightedPair:o.value,onHighlightPair:k},null,8,["round","steps","highlightedPair"])):(c(),u(Y,{key:2},[F.data.type==="toolResult"?(c(),u("div",dc,[...w[3]||(w[3]=[n("span",{class:"label-line"},null,-1),n("span",{class:"label-text"},"⚡ 工具执行",-1),n("span",{class:"label-line"},null,-1)])])):R("",!0),F.data.type==="toolResult"&&F.data.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:F.data.toolResultStatus==="error",isActive:((G=o.value)==null?void 0:G.resultId)===F.data.id,executionTime:F.data.executionTime},null,8,["isError","isActive","executionTime"])):R("",!0),bt(mn,{step:F.data,highlightedPair:o.value,onToggleCollapse:A=>S(F.data.id),onHighlightPair:k},null,8,["step","highlightedPair","onToggleCollapse"])],64))],64)}),128)):(c(!0),u(Y,{key:1},ct(s.value.steps,(F,q)=>{var G;return c(),u(Y,{key:F.id},[q>0?(c(),Gt(_n,{key:0})):R("",!0),F.type==="toolResult"&&F.pairedToolCallId?(c(),Gt(Sl,{key:1,isError:F.toolResultStatus==="error",isActive:((G=o.value)==null?void 0:G.resultId)===F.id,executionTime:F.executionTime},null,8,["isError","isActive","executionTime"])):R("",!0),bt(mn,{step:F,prevStep:s.value.steps[q-1],highlightedPair:o.value,onToggleCollapse:A=>I(q),onHighlightPair:k},null,8,["step","prevStep","highlightedPair","onToggleCollapse"])],64)}),128))]),n("div",fc,[n("div",hc,[n("div",pc,[w[4]||(w[4]=n("span",{class:"stat-label"},"总耗时",-1)),n("span",vc,f(T(s.value.stats.totalDuration)),1)]),n("div",gc,[w[5]||(w[5]=n("span",{class:"stat-label"},"Token",-1)),n("span",mc,f(b(s.value.stats.totalInputTokens))+" / "+f(b(s.value.stats.totalOutputTokens)),1)]),n("div",_c,[w[6]||(w[6]=n("span",{class:"stat-label"},"工具调用",-1)),n("span",yc,f(s.value.stats.toolCallCount)+" 次",1)]),n("div",bc,[w[7]||(w[7]=n("span",{class:"stat-label"},"步骤数",-1)),n("span",$c,f(s.value.stats.stepCount),1)])])])]))])}}}),wc=Ct(kc,[["__scopeId","data-v-3b17c2f5"]]),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:"失败"}},Cc={class:"node-icon"},Tc={class:"node-info"},Sc={class:"node-name"},xc={class:"node-role"},Ac={class:"node-status"},Ic={key:0,class:"node-time"},Mc={key:1,class:"node-progress"},Rc=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(),u("div",{class:nt(["chain-node",[`status-${t.node.status}`,{selected:t.isSelected}]]),onClick:a[0]||(a[0]=r=>o.$emit("click"))},[n("div",Cc,f(s.value),1),n("div",Tc,[n("div",Sc,f(t.node.agentName),1),n("div",xc,f(t.node.role),1)]),n("div",Ac,f(l.value),1),t.node.startedAt?(c(),u("div",Ic,f(i(t.node.duration)),1)):R("",!0),t.node.status==="running"?(c(),u("div",Mc,[...a[1]||(a[1]=[n("div",{class:"progress-spinner"},null,-1)])])):R("",!0)],2))}}),Ec=Ct(Rc,[["__scopeId","data-v-973c6755"]]),Pc={width:"60",height:"20",viewBox:"0 0 60 20"},Dc={id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto"},Fc=["fill"],Lc=["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(),u("div",{class:nt(["chain-edge",o.value])},[(c(),u("svg",Pc,[n("defs",null,[n("marker",Dc,[n("polygon",{points:"0 0, 10 3.5, 0 7",fill:l.value},null,8,Fc)])]),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,Lc)]))],2))}}),Nc=Ct(Oc,[["__scopeId","data-v-c94ab96b"]]),jc={class:"chain-view"},Uc={class:"chain-header"},Vc={class:"header-left"},Wc={key:0,class:"project-info"},Hc={class:"header-right"},Bc=["disabled"],Kc={key:0,class:"loading-state"},qc={key:1,class:"empty-state"},Gc={key:2,class:"chain-content"},zc={key:0,class:"root-task"},Jc={class:"task-text"},Qc={class:"task-meta"},Yc={key:0},Xc={key:1,class:"chain-diagram"},Zc={class:"diagram-container"},tu={key:2,class:"chain-progress"},eu={class:"progress-bar"},su={class:"progress-text"},nu={key:3,class:"node-detail"},lu={class:"detail-header"},iu={class:"detail-title"},ou={class:"detail-content"},au={key:0,class:"detail-section"},ru={class:"section-value"},cu={class:"detail-row"},uu={class:"detail-item"},du={class:"item-value"},fu={class:"detail-item"},hu={class:"item-value"},pu={key:1,class:"detail-row"},vu={class:"detail-item"},gu={class:"item-value"},mu={class:"detail-item"},_u={class:"item-value"},yu={key:2,class:"detail-section"},bu={class:"section-value"},$u={key:3,class:"detail-section"},ku={class:"artifacts-list"},wu=wt({__name:"TaskChainView",props:{autoRefresh:{type:Boolean},refreshInterval:{}},setup(t){const e=t,s=W([]),l=W(null),i=W(null),o=W(!1),a=Q(()=>l.value?l.value:s.value.length>0?s.value[0]:null),r=Q(()=>{var T;return{running:"🔄 进行中",completed:"✅ 已完成",error:"❌ 出错",empty:"空"}[((T=a.value)==null?void 0:T.status)||"empty"]||"未知"}),d=Q(()=>{var b;const x=(b=a.value)==null?void 0:b.nodes;if(!x)return[];const T=["main","analyst","architect","devops"];return[...x].sort((M,_)=>{const w=T.findIndex(P=>M.role.includes(P)),K=T.findIndex(P=>_.role.includes(P));return w-K})});async function v(){o.value=!0;try{const x=await fetch("/api/chains?limit=10");if(x.ok){const T=await x.json();s.value=T.chains||[],l.value=T.activeChain||null}}catch(x){console.error("Chain load error:",x)}finally{o.value=!1}}function p(x){var T;i.value=((T=i.value)==null?void 0:T.agentId)===x.agentId?null:x}function C(x){return x?new Date(x).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"-"}function I(x){return x?x<1e3?`${x}ms`:x<6e4?`${(x/1e3).toFixed(1)}s`:`${(x/6e4).toFixed(1)}min`:"-"}function S(x){return x?x>=1e3?`${(x/1e3).toFixed(1)}k`:String(x):"0"}let k=null;return Nt(()=>{v(),e.autoRefresh&&e.refreshInterval&&(k=setInterval(v,e.refreshInterval*1e3))}),ae(()=>{k&&(clearInterval(k),k=null)}),(x,T)=>{var b,M;return c(),u("div",jc,[n("div",Uc,[n("div",Vc,[T[0]||(T[0]=n("span",{class:"title"},"🔗 任务执行链路",-1)),a.value?(c(),u("span",Wc,f(a.value.projectId||"当前任务"),1)):R("",!0)]),n("div",Hc,[n("span",{class:nt(["status-badge",`status-${((b=a.value)==null?void 0:b.status)||"empty"}`])},f(r.value),3),n("button",{class:"refresh-btn",onClick:v,disabled:o.value},f(o.value?"加载中...":"🔄 刷新"),9,Bc)])]),o.value&&!a.value?(c(),u("div",Kc,[...T[1]||(T[1]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载链路数据...",-1)])])):!a.value&&s.value.length===0?(c(),u("div",qc,[...T[2]||(T[2]=[n("span",{class:"empty-icon"},"🔗",-1),n("span",null,"暂无任务链路",-1),n("div",{class:"empty-hint"},"当 Main Agent 派发任务给子 Agent 时,这里会显示执行链路",-1)])])):(c(),u("div",Gc,[a.value?(c(),u("div",zc,[T[3]||(T[3]=n("div",{class:"task-label"},"根任务",-1)),n("div",Jc,f(a.value.rootTask),1),n("div",Qc,[a.value.startedAt?(c(),u("span",Yc,"开始: "+f(C(a.value.startedAt)),1)):R("",!0)])])):R("",!0),a.value?(c(),u("div",Xc,[n("div",Zc,[(c(!0),u(Y,null,ct(d.value,(_,w)=>{var K,P;return c(),u(Y,{key:_.agentId},[w>0?(c(),Gt(Nc,{key:0,"from-status":(K=d.value[w-1])==null?void 0:K.status,"to-status":_.status},null,8,["from-status","to-status"])):R("",!0),bt(Ec,{node:_,"is-selected":((P=i.value)==null?void 0:P.agentId)===_.agentId,onClick:N=>p(_)},null,8,["node","is-selected","onClick"])],64)}),128))])])):R("",!0),a.value?(c(),u("div",tu,[n("div",eu,[n("div",{class:"progress-fill",style:St({width:`${a.value.progress*100}%`})},null,4)]),n("div",su,f(Math.round(a.value.progress*100))+"% ("+f(a.value.completedNodes)+"/"+f(a.value.totalNodes)+" 完成) ",1)])):R("",!0),i.value?(c(),u("div",nu,[n("div",lu,[n("span",iu,f(i.value.agentName),1),n("span",{class:nt(["detail-status",`status-${i.value.status}`])},f(((M=rs(yn)[i.value.status])==null?void 0:M.label)||i.value.status),3)]),n("div",ou,[i.value.task?(c(),u("div",au,[T[4]||(T[4]=n("div",{class:"section-label"},"任务",-1)),n("div",ru,f(i.value.task),1)])):R("",!0),n("div",cu,[n("div",uu,[T[5]||(T[5]=n("span",{class:"item-label"},"开始时间",-1)),n("span",du,f(i.value.startedAt?C(i.value.startedAt):"-"),1)]),n("div",fu,[T[6]||(T[6]=n("span",{class:"item-label"},"耗时",-1)),n("span",hu,f(I(i.value.duration)),1)])]),i.value.tokenUsage?(c(),u("div",pu,[n("div",vu,[T[7]||(T[7]=n("span",{class:"item-label"},"Token 输入",-1)),n("span",gu,f(S(i.value.tokenUsage.input)),1)]),n("div",mu,[T[8]||(T[8]=n("span",{class:"item-label"},"Token 输出",-1)),n("span",_u,f(S(i.value.tokenUsage.output)),1)])])):R("",!0),i.value.toolCallCount>0?(c(),u("div",yu,[T[9]||(T[9]=n("div",{class:"section-label"},"工具调用",-1)),n("div",bu,f(i.value.toolCallCount)+" 次",1)])):R("",!0),i.value.artifacts&&i.value.artifacts.length>0?(c(),u("div",$u,[T[10]||(T[10]=n("div",{class:"section-label"},"产出物",-1)),n("div",ku,[(c(!0),u(Y,null,ct(i.value.artifacts,_=>(c(),u("div",{key:_,class:"artifact-item"}," 📄 "+f(_),1))),128))])])):R("",!0)])])):R("",!0)]))])}}}),Cu=Ct(wu,[["__scopeId","data-v-ee8c8661"]]),Tu={class:"agent-config-panel"},Su={class:"header"},xu=["disabled"],Au={key:0,class:"loading-state"},Iu={key:1,class:"error-state"},Mu={key:2,class:"config-content"},Ru={class:"config-section"},Eu={class:"info-grid"},Pu={class:"info-item"},Du={class:"value monospace"},Fu={class:"info-item"},Lu={class:"value"},Ou={class:"info-item full-width"},Nu={class:"value monospace"},ju={class:"info-item"},Uu={class:"config-section"},Vu={class:"model-config"},Wu={class:"model-field"},Hu={class:"model-select-wrapper"},Bu=["disabled"],Ku=["label"],qu=["value"],Gu={key:0,class:"current-model"},zu={class:"model-field"},Ju={class:"fallbacks-list"},Qu=["onUpdate:modelValue","disabled"],Yu=["label"],Xu=["value"],Zu=["onClick","disabled"],td=["disabled"],ed={class:"model-actions"},sd=["disabled"],nd=["disabled"],ld={key:0,class:"config-section"},id={class:"description-text"},od=wt({__name:"AgentConfigPanel",props:{agentId:{}},setup(t){const e=t,s=W(null),l=W([]),i=W(!1),o=W(!1),a=W(""),r=W(""),d=W([]),v=Q(()=>{const M={};for(const _ of l.value)M[_.provider]||(M[_.provider]=[]),M[_.provider].push(_);return Object.entries(M).map(([_,w])=>({provider:_,models:w}))}),p=Q(()=>{var _;if(!((_=s.value)!=null&&_.model))return!1;const M=s.value.model;return r.value!==M.primary||JSON.stringify(d.value.filter(w=>w))!==JSON.stringify(M.fallbacks||[])});function C(M){return{idle:"空闲",working:"工作中",down:"异常"}[M]||M}function I(M){if(!M)return"";const _=M.split("/");return _.length>1?_[_.length-1]:M}async function S(){var M;i.value=!0,a.value="";try{const[_,w]=await Promise.all([fetch(`/api/agent-config/${e.agentId}`),fetch("/api/available-models")]);if(_.ok?(s.value=await _.json(),(M=s.value)!=null&&M.model&&(r.value=s.value.model.primary||"",d.value=[...s.value.model.fallbacks||[]])):a.value="加载配置失败",w.ok){const K=await w.json();l.value=K.models||[]}}catch(_){a.value="加载失败: "+_.message}finally{i.value=!1}}function k(){d.value.length<3&&d.value.push("")}function x(M){d.value.splice(M,1)}function T(){var M;(M=s.value)!=null&&M.model&&(r.value=s.value.model.primary||"",d.value=[...s.value.model.fallbacks||[]])}async function b(){if(p.value){o.value=!0;try{const M=await fetch(`/api/agent-config/${e.agentId}/model`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({primary:r.value||null,fallbacks:d.value.filter(_=>_)||null})});if(M.ok){const _=await M.json();s.value&&_.model&&(s.value.model=_.model),alert("模型配置已保存!重启 Agent 后生效。")}else{const _=await M.json();alert("保存失败: "+(_.detail||"未知错误"))}}catch(M){alert("保存失败: "+M.message)}finally{o.value=!1}}}return Bt(()=>e.agentId,()=>{S()},{immediate:!0}),Nt(()=>{S()}),(M,_)=>{var w;return c(),u("div",Tu,[n("div",Su,[_[1]||(_[1]=n("h3",null,"⚙️ Agent 配置",-1)),n("button",{class:"refresh-btn",onClick:S,disabled:i.value},f(i.value?"加载中...":"刷新"),9,xu)]),i.value&&!s.value?(c(),u("div",Au," 加载配置... ")):a.value?(c(),u("div",Iu,f(a.value),1)):s.value?(c(),u("div",Mu,[n("div",Ru,[_[6]||(_[6]=n("h4",null,"基本信息",-1)),n("div",Eu,[n("div",Pu,[_[2]||(_[2]=n("span",{class:"label"},"ID",-1)),n("span",Du,f(s.value.id),1)]),n("div",Fu,[_[3]||(_[3]=n("span",{class:"label"},"名称",-1)),n("span",Lu,f(s.value.name),1)]),n("div",Ou,[_[4]||(_[4]=n("span",{class:"label"},"工作区",-1)),n("span",Nu,f(s.value.workspace||"未设置"),1)]),n("div",ju,[_[5]||(_[5]=n("span",{class:"label"},"状态",-1)),n("span",{class:nt(["value",`status-${s.value.status}`])},f(C(s.value.status)),3)])])]),n("div",Uu,[_[11]||(_[11]=n("h4",null,"模型配置",-1)),n("div",Vu,[n("div",Wu,[_[8]||(_[8]=n("label",null,"主模型 (Primary)",-1)),n("div",Hu,[Tt(n("select",{"onUpdate:modelValue":_[0]||(_[0]=K=>r.value=K),disabled:o.value,class:"model-select"},[_[7]||(_[7]=n("option",{value:""},"-- 选择模型 --",-1)),(c(!0),u(Y,null,ct(v.value,K=>(c(),u("optgroup",{key:K.provider,label:K.provider},[(c(!0),u(Y,null,ct(K.models,P=>(c(),u("option",{key:P.id,value:P.id},f(P.name),9,qu))),128))],8,Ku))),128))],8,Bu),[[Pe,r.value]]),(w=s.value.model)!=null&&w.primary?(c(),u("span",Gu," 当前: "+f(I(s.value.model.primary)),1)):R("",!0)])]),n("div",zu,[_[10]||(_[10]=n("label",null,"备选模型 (Fallbacks)",-1)),n("div",Ju,[(c(!0),u(Y,null,ct(d.value,(K,P)=>(c(),u("div",{key:P,class:"fallback-item"},[Tt(n("select",{"onUpdate:modelValue":N=>d.value[P]=N,disabled:o.value,class:"model-select small"},[_[9]||(_[9]=n("option",{value:""},"-- 选择 --",-1)),(c(!0),u(Y,null,ct(v.value,N=>(c(),u("optgroup",{key:N.provider,label:N.provider},[(c(!0),u(Y,null,ct(N.models,Z=>(c(),u("option",{key:Z.id,value:Z.id},f(Z.name),9,Xu))),128))],8,Yu))),128))],8,Qu),[[Pe,d.value[P]]]),n("button",{class:"remove-btn",onClick:N=>x(P),disabled:o.value},"×",8,Zu)]))),128)),n("button",{class:"add-fallback-btn",onClick:k,disabled:o.value||d.value.length>=3}," + 添加备选模型 ",8,td)])]),n("div",ed,[n("button",{class:"save-btn",onClick:b,disabled:o.value||!p.value},f(o.value?"保存中...":"保存修改"),9,sd),n("button",{class:"reset-btn",onClick:T,disabled:o.value}," 重置 ",8,nd)])])]),s.value.description?(c(),u("div",ld,[_[12]||(_[12]=n("h4",null,"描述",-1)),n("p",id,f(s.value.description),1)])):R("",!0)])):R("",!0)])}}}),ad=Ct(od,[["__scopeId","data-v-c0a2c245"]]),rd={class:"error-analysis-view"},cd={class:"header"},ud=["disabled"],dd={key:0,class:"agent-summary"},fd={class:"summary-card total"},hd={class:"count"},pd={key:0,class:"summary-card critical"},vd={class:"count"},gd={key:1,class:"summary-card high"},md={class:"count"},_d={key:2,class:"summary-card medium"},yd={class:"count"},bd={key:1,class:"loading-state"},$d={key:2,class:"empty-state"},kd={key:3,class:"errors-list"},wd=["onClick"],Cd={class:"error-header"},Td={class:"error-badges"},Sd={key:0,class:"badge archived",title:"已归档的子任务"},xd={key:1,class:"badge provider"},Ad={key:2,class:"badge model"},Id={class:"error-time"},Md={class:"error-message"},Rd={key:0,class:"error-detail"},Ed={class:"detail-section"},Pd={class:"error-full"},Dd={key:0,class:"detail-section"},Fd={class:"tool-chain"},Ld={class:"tool-index"},Od={class:"tool-name"},Nd={class:"tool-time"},jd={key:1,class:"detail-section"},Ud={class:"suggestions"},Vd={class:"detail-section meta"},Wd={key:4,class:"type-summary"},Hd={class:"type-bars"},Bd={class:"type-label"},Kd={class:"bar-container"},qd={class:"type-count"},Gd=wt({__name:"ErrorAnalysisView",props:{agentId:{}},setup(t){const e=t,s=W([]),l=W(null),i=W(!1),o=W(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 d(S){return S?new Date(S).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function v(S,k){return!S||S.length<=k?S||"":S.slice(0,k)+"..."}function p(S,k){return k?Math.round(S/k*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 I(){if(e.agentId){i.value=!0;try{const S=await fetch(`/api/error-analysis/${e.agentId}?session_limit=5`);if(S.ok){const k=await S.json();s.value=k.errors||[],l.value=k.summary||null}}catch(S){console.error("Failed to load error analysis:",S)}finally{i.value=!1}}}return Bt(()=>e.agentId,()=>{I()},{immediate:!0}),Nt(()=>{I()}),(S,k)=>{var x,T,b,M;return c(),u("div",rd,[n("div",cd,[k[0]||(k[0]=n("h3",null,"🔍 错误分析",-1)),n("button",{class:"refresh-btn",onClick:I,disabled:i.value},f(i.value?"分析中...":"刷新"),9,ud)]),l.value?(c(),u("div",dd,[n("div",fd,[n("span",hd,f(l.value.total||0),1),k[1]||(k[1]=n("span",{class:"label"},"错误数",-1))]),(x=l.value.bySeverity)!=null&&x.critical?(c(),u("div",pd,[n("span",vd,f(l.value.bySeverity.critical),1),k[2]||(k[2]=n("span",{class:"label"},"严重",-1))])):R("",!0),(T=l.value.bySeverity)!=null&&T.high?(c(),u("div",gd,[n("span",md,f(l.value.bySeverity.high),1),k[3]||(k[3]=n("span",{class:"label"},"高",-1))])):R("",!0),(b=l.value.bySeverity)!=null&&b.medium?(c(),u("div",_d,[n("span",yd,f(l.value.bySeverity.medium),1),k[4]||(k[4]=n("span",{class:"label"},"中",-1))])):R("",!0)])):R("",!0),i.value&&!s.value.length?(c(),u("div",bd," 正在分析错误... ")):s.value.length?(c(),u("div",kd,[(c(!0),u(Y,null,ct(s.value,(_,w)=>{var K,P;return c(),u("div",{key:w,class:nt(["error-item",`severity-${_.severity}`]),onClick:N=>C(w)},[n("div",Cd,[n("span",{class:"error-type",style:St({color:_.severityColor})},f(_.severityLabel)+" - "+f(_.errorTypeLabel),5),n("div",Td,[_.isArchived?(c(),u("span",Sd,"📦 归档")):R("",!0),_.provider?(c(),u("span",xd,f(_.provider),1)):R("",!0),_.model?(c(),u("span",Ad,f(_.model),1)):R("",!0)]),n("span",Id,f(d(_.timestamp)),1)]),n("div",Md,f(v(_.rawMessage,150)),1),o.value.has(w)?(c(),u("div",Rd,[n("div",Ed,[k[5]||(k[5]=n("h4",null,"错误信息",-1)),n("pre",Pd,f(_.rawMessage||"无详细信息"),1)]),(K=_.toolChain)!=null&&K.length?(c(),u("div",Dd,[k[6]||(k[6]=n("h4",null,"工具调用链(错误前)",-1)),n("div",Fd,[(c(!0),u(Y,null,ct(_.toolChain,(N,Z)=>(c(),u("div",{key:Z,class:"tool-item"},[n("span",Ld,f(Z+1),1),n("span",Od,f(N.toolName),1),n("span",Nd,f(d(N.timestamp)),1)]))),128))])])):R("",!0),(P=_.suggestions)!=null&&P.length?(c(),u("div",jd,[k[7]||(k[7]=n("h4",null,"修复建议",-1)),n("ul",Ud,[(c(!0),u(Y,null,ct(_.suggestions,(N,Z)=>(c(),u("li",{key:Z},f(N),1))),128))])])):R("",!0),n("div",Vd,[n("span",null,"Session: "+f(_.sessionFile),1),n("span",null,"Turn: "+f(_.turnIndex),1)])])):R("",!0)],10,wd)}),128))])):(c(),u("div",$d," ✅ 暂无错误记录 ")),(M=l.value)!=null&&M.byType&&Object.keys(l.value.byType).length>0?(c(),u("div",Wd,[k[8]||(k[8]=n("h4",null,"错误类型分布",-1)),n("div",Hd,[(c(!0),u(Y,null,ct(l.value.byType,(_,w)=>(c(),u("div",{key:w,class:"type-bar"},[n("span",Bd,f(r(w)),1),n("div",Kd,[n("div",{class:"bar-fill",style:St({width:p(_,l.value.total)})},null,4)]),n("span",qd,f(_),1)]))),128))])])):R("",!0)])}}}),zd=Ct(Gd,[["__scopeId","data-v-bc05715d"]]),Jd={class:"header"},Qd={class:"content"},Yd={class:"section"},Xd={class:"status-info"},Zd={class:"status-text"},tf={key:0,class:"section"},ef={key:1,class:"section"},sf={key:2,class:"section"},nf={class:"error-info"},lf={class:"error-type"},of={class:"error-message"},af={key:3,class:"section"},rf={class:"diagnostic-header"},cf={class:"diagnostic-icon"},uf={class:"diagnostic-title"},df={class:"diagnostic-content"},ff={class:"diagnostic-item"},hf={class:"item-value highlight"},pf={key:0,class:"diagnostic-item"},vf={class:"item-value"},gf={key:1,class:"diagnostic-item"},mf={class:"item-value"},_f={class:"diagnostic-actions"},yf={class:"section"},bf={class:"activity-list"},$f={key:0,class:"activity-item working"},kf={key:1,class:"activity-item idle"},wf={key:2,class:"activity-item down"},Cf={class:"section"},Tf={class:"view-tabs"},Sf={key:0,class:"timeline-container"},xf={key:1,class:"chain-container"},Af={key:2,class:"advanced-container"},If={class:"advanced-section"},Mf={class:"advanced-section"},Rf=5*60*1e3,Ef=15*60*1e3,Pf=wt({__name:"AgentDetailPanel",props:{agent:{}},emits:["close"],setup(t){const e=t,s=W("timeline"),l=W(null),i=W(Date.now());let o=null;const a=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[e.agent.status]||"未知"),r=Q(()=>{if(e.agent.status!=="working")return null;const T=e.agent.lastActiveAt||0,b=i.value-T;return b>Ef?{isStuck:!0,idleMinutes:Math.floor(b/6e4),severity:"critical",label:"严重卡顿"}:b>Rf?{isStuck:!0,idleMinutes:Math.floor(b/6e4),severity:"warning",label:"可能卡顿"}:null}),d=Q(()=>{var _;if(!((_=l.value)!=null&&_.archiveAtMs))return null;const T=l.value.archiveAtMs-i.value;if(T<=0)return"即将超时";const b=Math.floor(T/6e4),M=Math.floor(T%6e4/1e3);return`${b}分${M}秒`}),v=Q(()=>{if(!p.value.length)return null;const T=p.value[p.value.length-1];if(T.role==="toolResult"){const b=T.content[0];if(b){const M=b.text||b.content||"";return{tool:T.toolName||"未知工具",status:b.status||"completed",result:M.slice(0,100)||"(无输出)"}}}return null}),p=W([]),C=W(!1);async function I(){var T;if((T=e.agent)!=null&&T.id){C.value=!0;try{const b=await fetch(`/api/agents/${e.agent.id}/output?limit=30`);if(b.ok){const M=await b.json();p.value=M.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 T=await fetch("/api/chains?limit=10");if(T.ok){const M=(await T.json()).activeChain;if(M!=null&&M.nodes){const _=M.nodes.find(w=>w.agentId===e.agent.id);_&&_.status==="running"&&(l.value={runId:M.chainId,status:"running",startedAt:_.startedAt,archiveAtMs:M.archiveAtMs})}}}catch{}}async function k(){var T;if((T=l.value)!=null&&T.runId&&confirm("确定要取消这个任务吗?"))try{alert("取消功能需要 OpenClaw 支持,请使用命令行: openclaw subagents cancel "+l.value.runId)}catch(b){console.error("Cancel failed:",b)}}function x(){I(),S()}return Bt(()=>{var T;return(T=e.agent)==null?void 0:T.id},()=>{I(),S()},{immediate:!0}),Bt(()=>e.agent.status,S),Nt(()=>{o=setInterval(()=>{i.value=Date.now()},1e3)}),ae(()=>{o&&(clearInterval(o),o=null)}),(T,b)=>(c(),u("div",{class:"panel-overlay",onClick:b[5]||(b[5]=M=>T.$emit("close"))},[n("div",{class:"panel",onClick:b[4]||(b[4]=le(()=>{},["stop"]))},[n("div",Jd,[n("h2",null,f(t.agent.name),1),n("button",{class:"close-btn",onClick:b[0]||(b[0]=M=>T.$emit("close"))},"×")]),n("div",Qd,[n("div",Yd,[b[6]||(b[6]=n("h3",null,"状态",-1)),n("div",Xd,[n("span",{class:nt(["status-dot",`status-${t.agent.status}`])},null,2),n("span",Zd,f(a.value),1)])]),t.agent.currentTask?(c(),u("div",tf,[b[7]||(b[7]=n("h3",null,"当前任务",-1)),n("p",null,f(t.agent.currentTask),1)])):R("",!0),t.agent.lastActiveFormatted?(c(),u("div",ef,[b[8]||(b[8]=n("h3",null,"最后活跃",-1)),n("p",null,f(t.agent.lastActiveFormatted),1)])):R("",!0),t.agent.error?(c(),u("div",sf,[b[9]||(b[9]=n("h3",{class:"error-title"},"错误信息",-1)),n("div",nf,[n("div",lf,f(t.agent.error.type),1),n("div",of,f(t.agent.error.message),1)])])):R("",!0),r.value?(c(),u("div",af,[n("div",{class:nt(["diagnostic-panel",`severity-${r.value.severity}`])},[n("div",rf,[n("span",cf,f(r.value.severity==="critical"?"🚨":"⚠️"),1),n("span",uf,f(r.value.label)+"检测",1)]),n("div",df,[n("div",ff,[b[10]||(b[10]=n("span",{class:"item-label"},"无响应时间:",-1)),n("span",hf,f(r.value.idleMinutes)+" 分钟",1)]),v.value?(c(),u("div",pf,[b[11]||(b[11]=n("span",{class:"item-label"},"最后操作:",-1)),n("span",vf,f(v.value.tool)+" → "+f(v.value.result),1)])):R("",!0),d.value?(c(),u("div",gf,[b[12]||(b[12]=n("span",{class:"item-label"},"自动超时:",-1)),n("span",mf,f(d.value),1)])):R("",!0),b[13]||(b[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",_f,[l.value?(c(),u("button",{key:0,class:"action-btn primary",onClick:k}," 取消任务 ")):R("",!0),n("button",{class:"action-btn",onClick:x}," 刷新状态 ")])])],2)])):R("",!0),n("div",yf,[b[14]||(b[14]=n("h3",null,"最近活动",-1)),n("div",bf,[t.agent.status==="working"?(c(),u("div",$f," 💼 正在执行任务... ")):t.agent.status==="idle"?(c(),u("div",kf," 😴 空闲中 ")):t.agent.status==="down"?(c(),u("div",wf," ⚠️ 检测到错误 ")):R("",!0)])]),n("div",Cf,[n("div",Tf,[n("button",{class:nt(["tab-btn",{active:s.value==="timeline"}]),onClick:b[1]||(b[1]=M=>s.value="timeline")}," 📊 时序视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="chain"}]),onClick:b[2]||(b[2]=M=>s.value="chain")}," 🔗 链路视图 ",2),n("button",{class:nt(["tab-btn",{active:s.value==="advanced"}]),onClick:b[3]||(b[3]=M=>s.value="advanced")}," ⚙️ 高级 ",2)]),s.value==="timeline"?(c(),u("div",Sf,[bt(rs(wc),{agentId:t.agent.id,autoRefresh:!0,refreshInterval:3},null,8,["agentId"])])):s.value==="chain"?(c(),u("div",xf,[bt(rs(Cu),{autoRefresh:!0,refreshInterval:10})])):s.value==="advanced"?(c(),u("div",Af,[n("div",If,[b[15]||(b[15]=n("h4",null,"⚙️ 配置",-1)),bt(ad,{agentId:t.agent.id},null,8,["agentId"])]),n("div",Mf,[b[16]||(b[16]=n("h4",null,"🔍 错误分析",-1)),bt(zd,{agentId:t.agent.id},null,8,["agentId"])])])):R("",!0)])])])]))}}),Df=Ct(Pf,[["__scopeId","data-v-cceac268"]]),Ff={class:"settings-panel"},Lf={class:"header"},Of={class:"content"},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={class:"setting-item"},qf=wt({__name:"SettingsPanel",emits:["close"],setup(t,{emit:e}){const s=e,l=W(10),i=W(!0),o=W(!0),a=W(!0),r=W(!0),d=W(!1),v=W(100),p=W(!0);function C(){const S=localStorage.getItem("dashboard-settings");if(S)try{const k=JSON.parse(S);l.value=k.refreshInterval||10,i.value=k.autoRefreshEnabled!==!1,o.value=k.showTimestamps!==!1,a.value=k.showTokens!==!1,r.value=k.notifyOnError!==!1,d.value=k.notifyOnComplete||!1,v.value=k.logLines||100,p.value=k.autoScrollLog!==!1}catch(k){console.error("加载设置失败:",k)}}function I(){const S={refreshInterval:l.value,autoRefreshEnabled:i.value,showTimestamps:o.value,showTokens:a.value,notifyOnError:r.value,notifyOnComplete:d.value,logLines:v.value,autoScrollLog:p.value};localStorage.setItem("dashboard-settings",JSON.stringify(S)),s("settings-changed",S)}return Nt(()=>{C()}),(S,k)=>(c(),u("div",Ff,[n("div",Lf,[k[9]||(k[9]=n("h2",null,"设置",-1)),n("button",{class:"close-btn",onClick:k[0]||(k[0]=x=>S.$emit("close"))},"×")]),n("div",Of,[n("section",null,[k[12]||(k[12]=n("h3",null,"自动刷新",-1)),n("div",Nf,[k[10]||(k[10]=n("label",null,"刷新间隔(秒)",-1)),Tt(n("input",{type:"number","onUpdate:modelValue":k[1]||(k[1]=x=>l.value=x),min:"1",max:"300",onChange:I},null,544),[[jn,l.value,void 0,{number:!0}]])]),n("div",jf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[2]||(k[2]=x=>i.value=x),onChange:I},null,544),[[Le,i.value]]),k[11]||(k[11]=At(" 启用自动刷新 ",-1))])])]),n("section",null,[k[15]||(k[15]=n("h3",null,"显示选项",-1)),n("div",Uf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[3]||(k[3]=x=>o.value=x),onChange:I},null,544),[[Le,o.value]]),k[13]||(k[13]=At(" 显示时间戳 ",-1))])]),n("div",Vf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[4]||(k[4]=x=>a.value=x),onChange:I},null,544),[[Le,a.value]]),k[14]||(k[14]=At(" 显示 Token 消耗 ",-1))])])]),n("section",null,[k[18]||(k[18]=n("h3",null,"通知",-1)),n("div",Wf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[5]||(k[5]=x=>r.value=x),onChange:I},null,544),[[Le,r.value]]),k[16]||(k[16]=At(" Agent 异常时通知 ",-1))])]),n("div",Hf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[6]||(k[6]=x=>d.value=x),onChange:I},null,544),[[Le,d.value]]),k[17]||(k[17]=At(" 任务完成时通知 ",-1))])])]),n("section",null,[k[22]||(k[22]=n("h3",null,"日志查看",-1)),n("div",Bf,[k[20]||(k[20]=n("label",null,"日志行数",-1)),Tt(n("select",{"onUpdate:modelValue":k[7]||(k[7]=x=>v.value=x),onChange:I},[...k[19]||(k[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",Kf,[n("label",null,[Tt(n("input",{type:"checkbox","onUpdate:modelValue":k[8]||(k[8]=x=>p.value=x),onChange:I},null,544),[[Le,p.value]]),k[21]||(k[21]=At(" 自动滚动日志 ",-1))])])])])]))}}),Gf=Ct(qf,[["__scopeId","data-v-e5b26232"]]);function zf(t,e=300){const s=W(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 Jf{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 Jf(t)),tn}class Qf{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,W(s))}useStore(e,s){const l=this.state.get(e);if(l)return l;const i=W(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 Yf(){return en||(en=new Qf),en}class Xf{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 Zf(){return sn||(sn=new Xf),sn}function Li(){const t=Fi(),e=W(t.getConnectionState()),s=W(!1);let l=null;const i=(r,d)=>t.subscribe(r,d),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 th={class:"indicator-icon"},eh={key:0,class:"indicator-count"},sh={class:"card-header"},nh={class:"avatar"},lh={class:"header-info"},ih={class:"name"},oh={class:"status-text"},ah={key:0,class:"main-badge"},rh={class:"card-body"},ch={key:0,class:"model-row"},uh={class:"model-value"},dh=["title"],fh={key:0,class:"fallback-more"},hh={key:1,class:"current-task"},ph=["title"],vh={key:0,class:"task-child-info"},gh={class:"child-name"},mh={key:2,class:"multi-tasks"},_h={class:"tasks-count"},yh={class:"tasks-toggle"},bh=["title"],$h={key:0,class:"task-child-agent"},kh={key:0,class:"tasks-more"},wh={class:"action-icon"},Ch={class:"action-text"},Th={key:4,class:"idle-hint"},Sh={class:"warning-modal"},xh={class:"modal-header"},Ah={class:"modal-icon"},Ih={class:"modal-title"},Mh={class:"modal-body"},Rh={class:"detail-row"},Eh={class:"detail-value error-type-tag"},Ph={class:"detail-row"},Dh={class:"detail-value"},Fh={class:"detail-row"},Lh={class:"detail-value highlight"},Oh={key:0,class:"detail-row"},Nh={class:"detail-value"},jh={key:1,class:"detail-row"},Uh={class:"detail-value"},Vh={key:2,class:"detail-row"},Wh={key:0,class:"waiting-task"},Hh={key:3,class:"stuck-suggestion"},Bh=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=W(!1),o=W(!1),a=["🤖","👤","📊","🏗️","💻","🧪","🔧","📋","🎯","⚙️"],r=Q(()=>{const P=(s.agent.name||"").toLowerCase();if(P.includes("pm")||P.includes("project")||P.includes("主"))return"👨💼";if(P.includes("analyst")||P.includes("分析"))return"📊";if(P.includes("architect")||P.includes("架构"))return"🏗️";if(P.includes("dev")||P.includes("开发"))return"💻";if(P.includes("qa")||P.includes("test")||P.includes("测试"))return"🧪";if(P.includes("ops")||P.includes("运维"))return"🔧";if(P.includes("frontend")||P.includes("前端"))return"🎨";if(P.includes("backend")||P.includes("后端"))return"⚙️";let N=0;for(let Z=0;Z<P.length;Z++)N=(N<<5)-N+P.charCodeAt(Z);return a[Math.abs(N)%a.length]}),d=Q(()=>({idle:"空闲",working:"工作中",down:"异常"})[s.agent.status]||"未知"),v=Q(()=>{var P;return((P=s.agentTasks)==null?void 0:P.length)||0}),p=Q(()=>s.isMain&&v.value>=2),C=Q(()=>s.agentTasks?s.agentTasks.slice(0,3):[]),I=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),k=Q(()=>{if(s.agentTasks&&s.agentTasks.length===1)return s.agentTasks[0].childAgentId}),x=Q(()=>({thinking:"🧠",tool_executing:"⚙️",waiting_llm:"📡",waiting_child:"⏳"})[s.subStatus||""]||"🔄"),T=Q(()=>{var N;return{"rate-limit":"请求过快","token-limit":"Token 超限",timeout:"请求超时",quota:"余额不足",unknown:"发生错误"}[((N=s.error)==null?void 0:N.type)||"unknown"]||"发生错误"}),b=Q(()=>{var N;return{waiting_for_child:"等待子代理响应",self_busy:"自身处理中",unknown:"原因未明"}[((N=s.stuckWarning)==null?void 0:N.reason)||"unknown"]||"原因未明"}),M=Q(()=>{if(!s.stuckWarning)return null;const P=s.stuckWarning.reason,N=s.stuckWarning.idleSeconds;return P==="waiting_for_child"?N>180?"子代理响应时间过长,建议检查子代理状态或考虑终止任务":"子代理正在执行任务,请耐心等待":P==="self_busy"?N>120?"任务处理时间过长,可能遇到复杂问题或外部资源阻塞":"正在处理复杂任务,请稍候":null});function _(P){const N=P.split("/");return N[N.length-1]||P}function w(){i.value=!0}function K(P){l("navigate-agent",P),i.value=!1}return(P,N)=>{var Z;return c(),u("div",{class:nt(["agent-card",[`status-${t.agent.status}`,{"is-main":t.isMain}]]),onClick:N[4]||(N[4]=F=>P.$emit("click"))},[t.error||t.stuckWarning?(c(),u("div",{key:0,class:nt(["warning-indicator",{"has-error":t.error}]),onClick:le(w,["stop"])},[n("span",th,f(t.error?"⚠️":"⏳"),1),t.stuckWarning?(c(),u("span",eh,f(t.stuckWarning.idleSeconds)+"s",1)):R("",!0)],2)):R("",!0),n("div",sh,[n("div",nh,f(r.value),1),n("div",lh,[n("div",ih,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",oh,f(d.value),1)],2)]),t.isMain?(c(),u("div",ah,"PM")):R("",!0)]),n("div",rh,[t.modelInfo&&t.modelInfo.primary?(c(),u("div",ch,[N[5]||(N[5]=n("span",{class:"model-label"},"模型",-1)),n("span",uh,f(_(t.modelInfo.primary)),1),(Z=t.modelInfo.fallbacks)!=null&&Z.length?(c(),u("span",{key:0,class:"model-fallbacks",title:"备用: "+t.modelInfo.fallbacks.map(_).join(", ")},[(c(!0),u(Y,null,ct(t.modelInfo.fallbacks.slice(0,2),(F,q)=>(c(),u("span",{key:F,class:"fallback-tag"},f(_(F)),1))),128)),t.modelInfo.fallbacks.length>2?(c(),u("span",fh,"+"+f(t.modelInfo.fallbacks.length-2),1)):R("",!0)],8,dh)):R("",!0)])):R("",!0),S.value&&!p.value?(c(),u("div",hh,[N[7]||(N[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,ph),k.value?(c(),u("div",vh,[N[6]||(N[6]=n("span",{class:"child-arrow"},"→",-1)),n("span",gh,f(k.value),1)])):R("",!0)])):R("",!0),p.value?(c(),u("div",mh,[n("div",{class:"tasks-header",onClick:N[0]||(N[0]=le(F=>o.value=!o.value,["stop"]))},[N[8]||(N[8]=n("span",{class:"tasks-icon"},"📋",-1)),N[9]||(N[9]=n("span",{class:"tasks-label"},"并行任务",-1)),n("span",_h,f(v.value),1),n("span",yh,f(o.value?"▲":"▼"),1)]),n("div",{class:nt(["tasks-list",{expanded:o.value}])},[(c(!0),u(Y,null,ct(C.value,F=>(c(),u("div",{key:F.id,class:nt(["task-item",`task-status-${F.status}`])},[N[10]||(N[10]=n("span",{class:"task-status-dot"},null,-1)),n("span",{class:"task-name",title:F.name},f(F.name),9,bh),F.childAgentId?(c(),u("span",$h,"→ "+f(F.childAgentId),1)):R("",!0)],2))),128)),I.value>0?(c(),u("div",kh," +"+f(I.value)+" 更多任务 ",1)):R("",!0)],2)])):R("",!0),t.agent.status==="working"&&t.currentAction?(c(),u("div",{key:3,class:nt(["status-detail",`sub-status-${t.subStatus}`])},[n("span",wh,f(x.value),1),n("span",Ch,f(t.currentAction),1)],2)):t.agent.status==="idle"?(c(),u("div",Th," 空闲中,等待任务... ")):R("",!0)]),(c(),Gt(Po,{to:"body"},[i.value?(c(),u("div",{key:0,class:"warning-modal-overlay",onClick:N[3]||(N[3]=le(F=>i.value=!1,["self"]))},[n("div",Sh,[n("div",xh,[n("span",Ah,f(t.error?"⚠️":"⏳"),1),n("span",Ih,f(t.error?"异常详情":"卡顿分析"),1),n("button",{class:"modal-close",onClick:N[1]||(N[1]=F=>i.value=!1)},"×")]),n("div",Mh,[t.error?(c(),u(Y,{key:0},[n("div",Rh,[N[11]||(N[11]=n("span",{class:"detail-label"},"类型",-1)),n("span",Eh,f(T.value),1)]),n("div",Ph,[N[12]||(N[12]=n("span",{class:"detail-label"},"信息",-1)),n("span",Dh,f(t.error.message),1)])],64)):t.stuckWarning?(c(),u(Y,{key:1},[n("div",Fh,[N[13]||(N[13]=n("span",{class:"detail-label"},"等待时间",-1)),n("span",Lh,f(t.stuckWarning.idleSeconds)+" 秒",1)]),t.stuckWarning.reason?(c(),u("div",Oh,[N[14]||(N[14]=n("span",{class:"detail-label"},"原因",-1)),n("span",Nh,f(b.value),1)])):R("",!0),t.stuckWarning.reasonDetail?(c(),u("div",jh,[N[15]||(N[15]=n("span",{class:"detail-label"},"详情",-1)),n("span",Uh,f(t.stuckWarning.reasonDetail),1)])):R("",!0),t.stuckWarning.waitingFor?(c(),u("div",Vh,[N[16]||(N[16]=n("span",{class:"detail-label"},"等待对象",-1)),n("span",{class:"detail-value agent-link",onClick:N[2]||(N[2]=F=>K(t.stuckWarning.waitingFor.agentId))},[At(f(t.stuckWarning.waitingFor.agentId)+" ",1),t.stuckWarning.waitingFor.task?(c(),u("span",Wh,"("+f(t.stuckWarning.waitingFor.task)+")",1)):R("",!0)])])):R("",!0),M.value?(c(),u("div",Hh,[N[17]||(N[17]=n("span",{class:"suggestion-icon"},"💡",-1)),n("span",null,f(M.value),1)])):R("",!0)],64)):R("",!0)])])])):R("",!0)]))],2)}}}),Kh=Ct(Bh,[["__scopeId","data-v-04c4a970"]]),qh={class:"collaboration-flow-section"},Gh={class:"section-header"},zh={class:"header-right"},Jh={key:0,class:"flow-legend flow-legend-inline"},Qh={class:"legend-name"},Yh={class:"indicator-text"},Xh={class:"flow-container",ref:"flowContainerRef"},Zh={key:0,class:"loading-state"},tp={key:1,class:"error-state"},ep={key:2,class:"empty-state"},sp={key:3,class:"flow-layout"},np={class:"level-header"},lp={class:"level-badge"},ip={class:"level-title"},op={class:"level-cards"},ap=["onClick"],rp=["d"],cp={key:0,r:"5",fill:"url(#lightGradient)"},up={dur:"2s",repeatCount:"1",rotate:"0"},dp=["href"],fp={key:0,class:"model-panel"},hp={class:"model-toggle-icon"},pp={class:"model-panel-body"},vp={class:"model-name"},gp={class:"model-dots"},mp=["title","onClick"],_p={class:"model-count"},yp={class:"call-detail-modal"},bp={class:"call-detail-header"},$p={class:"call-detail-body"},kp={class:"call-detail-row"},wp={class:"value"},Cp={class:"call-detail-row"},Tp={class:"value"},Sp={class:"call-detail-row"},xp={class:"value"},Ap={class:"call-detail-row"},Ip={class:"value"},Mp={class:"call-detail-row trigger"},Rp={class:"value"},Ep=1500,Pp=wt({__name:"CollaborationFlowSection",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t,{emit:e}){const s=t,l=e,{connectionState:i,subscribe:o}=Li(),a=W([]),r=W([]),d=W([]),v=W({}),p=W([]),C=W(!0),I=W(null),S=W(null),k=W({}),x=W({}),T=W(""),b=W(!0),M=W({}),_=W(null),w=W(null),K=W({});function P(g,m){m&&(K.value[g]=m)}const N=Q(()=>s.mainAgentId?s.mainAgentId:T.value?T.value:"main"),Z=Q(()=>a.value.filter(g=>g.type==="agent")),F=Q(()=>a.value.filter(g=>g.type==="model")),q=Q(()=>r.value.filter(g=>g.type==="delegates")),G=Q(()=>{const g={};for(const O of Z.value){const D=X(O.id);g[D]||(g[D]=[]),g[D].push(O)}const m={};return Object.keys(g).map(Number).sort((O,D)=>O-D).forEach(O=>{m[O]=g[O]}),m});function A(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===N.value?"#4a9eff":st[g]||"#64748b"}const L=Q(()=>Z.value.map(g=>g.id).filter(Boolean)),U=Q(()=>({connected:"已连接",connecting:"连接中...",disconnected:"未连接",error:"连接错误"})[i.value.status]||"未知");function X(g){return g===N.value?x.value[g]??0:x.value[g]??1}function it(g){const m=Z.value.find(O=>O.id===g);return(m==null?void 0:m.name)||g}function V(g){var D;const m=j=>j==="error"?"down":j,O=g.id===N.value?s.mainAgent:(D=s.subAgents)==null?void 0:D.find(j=>j.id===g.id);if(O&&g.type==="agent"){const j=ot(g.id);let $;const J=g.status==="idle"||g.status==="error";J||((j==null?void 0:j.length)===1?$=j[0].name:j&&j.length>1&&($=`${j.length} 个任务进行中`));const z=J?void 0:O.currentTask;return{name:O.name,status:m(g.status),currentTask:$??z,lastActiveFormatted:O.lastActiveFormatted}}return O?{name:O.name,status:O.status,currentTask:O.currentTask,lastActiveFormatted:O.lastActiveFormatted}:{name:g.name,status:m(g.status)}}function H(g){if(g.type!=="agent")return;const m=v.value[g.id];if(m)return m;const O=g.id.toLowerCase();for(const[D,j]of Object.entries(v.value))if(D.toLowerCase()===O)return j}function ot(g){const m=M.value,O=m[g];if(O!=null&&O.length)return O;const D=g.toLowerCase();for(const[j,$]of Object.entries(m))if(j.toLowerCase()===D&&($!=null&&$.length))return $}function lt(g){if(d.value.includes(g.id))return!0;const m=g.id.toLowerCase();return d.value.some(O=>O.toLowerCase()===m)}function ft(g){const m=d.value,O=D=>m.includes(D)||m.some(j=>j.toLowerCase()===D.toLowerCase());return O(g.source)&&O(g.target)}function tt(g){const m=K.value[g.source],O=K.value[g.target],D=_.value;if(!m||!O||!D)return"";const j=D.getBoundingClientRect(),$=m.getBoundingClientRect(),J=O.getBoundingClientRect(),z=$.left-j.left+$.width/2,et=$.top-j.top+$.height,at=J.left-j.left+J.width/2,dt=J.top-j.top,vt=(et+dt)/2;return`M ${z} ${et} C ${z} ${vt}, ${at} ${vt}, ${at} ${dt}`}function kt(){Me(()=>{if(!_.value||!w.value)return;const g=_.value.getBoundingClientRect();w.value.setAttribute("width",String(g.width)),w.value.setAttribute("height",String(g.height))})}const It=Q(()=>{const g={};for(const m of p.value){const O=m.model||"(unknown)";g[O]||(g[O]=[]),g[O].push(m)}return g});function Dt(g){var D;const m=((D=g.metadata)==null?void 0:D.modelId)||"",O=m.split("/").pop()||m;return It.value[m]||It.value[O]||[]}function _e(g){return Dt(g).length>0}async function ye(){C.value=!0,I.value=null;try{const g=await fetch("/api/collaboration");if(!g.ok)throw new Error("Failed to fetch collaboration data");const m=await g.json();a.value=m.nodes||[],r.value=m.edges||[],d.value=m.activePath||[],v.value=m.agentModels||{},p.value=m.recentCalls||[],m.hierarchy&&(k.value=m.hierarchy),m.depths&&(x.value=m.depths),m.mainAgentId&&(T.value=m.mainAgentId),m.agentActiveTasks&&(M.value=m.agentActiveTasks),Me(kt)}catch(g){I.value=g.message}finally{C.value=!1}}function Qt(){ye()}function Se(g){const m=g;a.value=m.nodes||[],r.value=m.edges||[],d.value=m.activePath||[],v.value=m.agentModels||{},p.value=m.recentCalls||[],m.hierarchy&&(k.value=m.hierarchy),m.depths&&(x.value=m.depths),m.mainAgentId&&(T.value=m.mainAgentId),m.agentActiveTasks&&(M.value=m.agentActiveTasks),Me(kt)}function h(g){d.value=g.activePath||[],p.value=g.recentCalls||[],g.agentActiveTasks&&(M.value=g.agentActiveTasks);const m=a.value.filter($=>$.type==="agent");for(const $ of m){if($.id&&g.agentStatuses&&g.agentStatuses[$.id]!==void 0&&($.status=g.agentStatuses[$.id]),$.id&&g.agentDynamicStatuses&&g.agentDynamicStatuses[$.id]){const J=g.agentDynamicStatuses[$.id];$.subStatus=J.subStatus,$.currentAction=J.currentAction,$.toolName=J.toolName,$.waitingFor=J.waitingFor}if($.id&&g.agentDisplayStatuses&&g.agentDisplayStatuses[$.id]){const J=g.agentDisplayStatuses[$.id];$.currentAction=J.display,$.metadata||($.metadata={}),$.metadata={...$.metadata,duration:J.duration,alert:J.alert},J.alert?$.stuckWarning={isStuck:!0,idleSeconds:J.duration,lastUpdate:Date.now(),reason:"self_busy",reasonDetail:J.display}:$.stuckWarning&&!$.stuckWaitingForChildAgent&&($.stuckWarning=void 0)}}const O=new Set(a.value.filter($=>$.type==="task").map($=>$.id)),D=new Set((g.taskNodes||[]).map($=>$.id));if(O.size!==D.size||[...D].some($=>!O.has($))){const $=a.value.filter(z=>z.type==="model"),J=r.value.filter(z=>z.type==="delegates");a.value=[...m,...g.taskNodes||[],...$],r.value=[...J,...g.taskEdges||[]],Me(kt)}else{const $=new Map((g.taskNodes||[]).map(J=>[J.id,J]));for(const J of a.value.filter(z=>z.type==="task")){const z=$.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 m=await g.json();h(m)}catch{}}let E=null,B=null;return Bt([Z,b],()=>{Me(kt)}),Nt(()=>{ye(),E=o("collaboration",Se),B=setInterval(y,Ep),window.addEventListener("resize",kt)}),ae(()=>{E&&E(),B&&clearInterval(B),window.removeEventListener("resize",kt)}),(g,m)=>{var O;return c(),u("div",qh,[n("div",Gh,[m[4]||(m[4]=n("h2",null,"协作流程",-1)),n("div",zh,[Z.value.length>0?(c(),u("div",Jh,[(c(!0),u(Y,null,ct(L.value,D=>(c(),u("div",{key:D,class:"legend-item"},[n("span",{class:"legend-dot",style:St({background:mt(D)})},null,4),n("span",Qh,f(it(D)),1)]))),128))])):R("",!0),n("div",{class:nt(["connection-indicator",rs(i).status])},[m[3]||(m[3]=n("span",{class:"indicator-dot"},null,-1)),n("span",Yh,f(U.value),1)],2)])]),n("div",Xh,[C.value?(c(),u("div",Zh,[...m[5]||(m[5]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载中...",-1)])])):I.value?(c(),u("div",tp,[m[6]||(m[6]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(I.value),1),n("button",{onClick:Qt,class:"retry-btn"},"重试")])):a.value.length===0?(c(),u("div",ep,[...m[7]||(m[7]=[n("span",{class:"empty-icon"},"📭",-1),n("span",null,"暂无协作数据",-1)])])):(c(),u("div",sp,[n("div",{class:"agent-area",ref_key:"agentAreaRef",ref:_},[(c(!0),u(Y,null,ct(G.value,(D,j)=>(c(),u("div",{key:j,class:"level-section"},[n("div",np,[n("span",lp,"L"+f(j),1),n("span",ip,f(A(Number(j))),1)]),n("div",op,[(c(!0),u(Y,null,ct(D,$=>(c(),u("div",{key:$.id,class:nt(["agent-card-wrapper",{"main-agent":$.id===N.value,active:lt($),[`status-${$.status}`]:!0}]),style:St({"--agent-color":mt($.id)}),ref_for:!0,ref:J=>P($.id,J),onClick:J=>l("agent-click",$)},[bt(Kh,{agent:V($),"model-info":H($),"is-main":$.id===N.value,"current-task":$.currentTask,error:$.error,"stuck-warning":$.stuckWarning,"hierarchy-depth":X($.id),"agent-color":mt($.id),"sub-status":$.subStatus,"current-action":$.currentAction,"tool-name":$.toolName,"waiting-for":$.waitingFor,"agent-tasks":ot($.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,ap))),128))])]))),128)),(c(),u("svg",{class:"edges-svg",ref_key:"edgesSvgRef",ref:w},[m[8]||(m[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),u(Y,null,ct(q.value,D=>(c(),u("g",{key:D.id},[n("path",{d:tt(D),class:nt(["edge-path",{active:ft(D)}]),stroke:"#4a9eff","stroke-width":"2",fill:"none"},null,10,rp),ft(D)?(c(),u("circle",cp,[n("animateMotion",up,[n("mpath",{href:`#edge-${D.id}`},null,8,dp)])])):R("",!0)]))),128))],512))],512),F.value.length>0?(c(),u("div",fp,[n("div",{class:"model-panel-header",onClick:m[0]||(m[0]=D=>b.value=!b.value)},[m[9]||(m[9]=n("span",{class:"model-panel-title"},"🧠 模型",-1)),n("span",hp,f(b.value?"▼":"▶"),1)]),Tt(n("div",pp,[(c(!0),u(Y,null,ct(F.value,D=>(c(),u("div",{key:D.id,class:nt(["model-card",{active:_e(D)}])},[n("div",vp,f(D.name),1),n("div",gp,[(c(!0),u(Y,null,ct(Dt(D).slice(0,8),j=>(c(),u("span",{key:j.id,class:"model-dot",style:St({background:mt(j.agentId)}),title:`${it(j.agentId)} @ ${j.model||"unknown"}`,onClick:le($=>S.value=j,["stop"])},null,12,mp))),128))]),n("div",_p,f(Dt(D).length),1)],2))),128))],512),[[fs,b.value]])])):R("",!0)]))],512),S.value?(c(),u("div",{key:0,class:"call-detail-overlay",onClick:m[2]||(m[2]=le(D=>S.value=null,["self"]))},[n("div",yp,[n("div",bp,[m[10]||(m[10]=n("h3",null,"调用详情",-1)),n("button",{class:"close-btn",onClick:m[1]||(m[1]=D=>S.value=null)},"×")]),n("div",$p,[n("div",kp,[m[11]||(m[11]=n("span",{class:"label"},"Agent",-1)),n("span",wp,f(S.value.agentId),1)]),n("div",Cp,[m[12]||(m[12]=n("span",{class:"label"},"模型",-1)),n("span",Tp,f(S.value.model),1)]),n("div",Sp,[m[13]||(m[13]=n("span",{class:"label"},"时间",-1)),n("span",xp,f(S.value.time),1)]),n("div",Ap,[m[14]||(m[14]=n("span",{class:"label"},"Tokens",-1)),n("span",Ip,f(S.value.tokens),1)]),n("div",Mp,[m[15]||(m[15]=n("span",{class:"label"},"触发",-1)),n("div",Rp,f((O=S.value.trigger)==null?void 0:O.replace(/^【完成回传】/,"")),1)])])])])):R("",!0)])}}}),Dp=Ct(Pp,[["__scopeId","data-v-50bc0adc"]]),Fp={class:"collaboration-box"},Lp={class:"collaboration-box-body"},Op={class:"collaboration-error-fallback"},Np={class:"fallback-reason"},jp=wt({__name:"CollaborationFlowWrapper",props:{mainAgent:{},subAgents:{},mainAgentId:{}},emits:["agent-click"],setup(t){const e=W(null);return ci(s=>(e.value=s instanceof Error?s.message:String(s),!1)),(s,l)=>(c(),u("div",Fp,[l[3]||(l[3]=n("div",{class:"collaboration-box-header"},[n("h2",null,"协作流程"),n("span",{class:"collaboration-hint"},"展示主 Agent 与子 Agents 的协作关系")],-1)),n("div",Lp,[Tt(bt(Dp,{"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",Np,f(e.value),1),n("button",{onClick:l[1]||(l[1]=i=>e.value=null)},"重试")],512),[[fs,e.value]])])]))}}),Up=Ct(jp,[["__scopeId","data-v-ef9f8c73"]]),Vp={class:"task-status-section"},Wp={class:"section-header"},Hp={class:"summary-stats"},Bp={class:"stat total"},Kp={class:"filters-row"},qp={class:"search-box"},Gp={class:"filter-buttons"},zp=["onClick"],Jp={key:0,class:"loading-state"},Qp={key:1,class:"error-state"},Yp={key:2,class:"empty-state"},Xp={class:"task-list"},Zp=["onClick"],tv={class:"task-main"},ev={class:"task-name-short"},sv={key:0,class:"task-agent"},nv={key:1,class:"task-time"},lv={class:"task-detail-modal"},iv={class:"task-detail-header"},ov={class:"task-detail-body"},av={class:"detail-row"},rv={class:"detail-value task-content"},cv={key:0,class:"detail-row"},uv={class:"detail-value"},dv={class:"detail-row"},fv={class:"detail-value"},hv={key:1,class:"detail-row"},pv={class:"detail-value"},vv={key:2,class:"detail-row"},gv={class:"detail-value path-value"},mv={key:3,class:"detail-row"},_v={class:"detail-value"},yv={key:4,class:"detail-row"},bv={class:"detail-progress"},$v={class:"progress-bar"},kv={class:"progress-text"},wv={key:5,class:"detail-row"},Cv={class:"detail-value error"},Tv={key:6,class:"detail-row"},Sv={class:"generated-files-list"},xv={key:7,class:"detail-row"},Av={class:"detail-value output-content"},Iv={key:8,class:"detail-row"},Mv={class:"detail-subtasks"},Rv={key:0,class:"subtask-error-inline"},Ev={key:9,class:"detail-row"},Pv={class:"timeline-container"},Dv={class:"timeline"},Fv={class:"timeline-time"},Lv={class:"timeline-desc"},Ov=wt({__name:"TaskStatusSection",setup(t){const{subscribe:e}=Li(),s=W([]),l=W(!0),i=W(null),o=W(""),a=W([]),r=W(null),d=W(null),v=W([]),p=W(!1),C=[{value:"running",label:"执行中"},{value:"completed",label:"已完成"},{value:"failed",label:"失败"},{value:"pending",label:"待分配"}];zf(L=>{},300);const I=Q(()=>{let L=s.value;if(a.value.length>0&&(L=L.filter(U=>a.value.includes(U.status))),o.value){const U=o.value.toLowerCase();L=L.filter(X=>{var it;return X.name.toLowerCase().includes(U)||((it=X.agentName)==null?void 0:it.toLowerCase().includes(U))})}return L}),S=Q(()=>({total:s.value.length,running:s.value.filter(L=>L.status==="running").length,completed:s.value.filter(L=>L.status==="completed").length,failed:s.value.filter(L=>L.status==="failed").length,pending:s.value.filter(L=>L.status==="pending").length,cancelled:s.value.filter(L=>L.status==="cancelled").length}));function k(L){return{pending:"⏳",running:"🔄",completed:"✅",failed:"❌",cancelled:"🚫"}[L]||"📋"}function x(L){return s.value.filter(U=>U.status===L).length}function T(L){if(!L||!L.trim())return"未知";const U=L.trim().toLowerCase(),X={terminated:"任务被终止(可能是超时或被用户取消)",timeout:"任务执行超时",cancelled:"任务已取消",canceled:"任务已取消",killed:"任务被终止","subagent-error":"子任务执行异常"};for(const[it,V]of Object.entries(X))if(U.includes(it))return V;return L.trim()}function b(L){return!L||typeof L!="string"?"":L.replace(/\*\*/g,"").replace(/`([^`]+)`/g,"$1")}function M(L){if(!L.startTime)return"";const U=new Date(L.startTime).getTime(),X=L.endTime?new Date(L.endTime).getTime():Date.now(),it=Math.floor((X-U)/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 _(L){const U=a.value.indexOf(L);U===-1?a.value.push(L):a.value.splice(U,1)}function w(L){a.value.length===1&&a.value[0]===L?a.value=[]:a.value=[L]}function K(L){const X=b(L.task??L.name).split(`
|
|
24
|
+
`)[0].trim();return X.length<=60?X:X.slice(0,60)+"…"}function P(L){return{pending:"待分配",running:"执行中",completed:"已完成",failed:"失败",cancelled:"已取消"}[L]||L}async function N(){l.value=!0,i.value=null;try{const L=await fetch("/api/tasks");if(!L.ok)throw new Error("Failed to fetch tasks");const U=await L.json();s.value=(U.tasks||[]).map(X=>q(X))}catch(L){i.value=L.message}finally{l.value=!1}}function Z(L){return{pending:"pending",assigning:"pending",running:"running",in_progress:"running",active:"running",completed:"completed",success:"completed",failed:"failed",error:"failed",cancelled:"cancelled"}[L]||"pending"}function F(){N()}function q(L){const U=(L.subtasks||[]).map(X=>({id:X.id||X.name,name:X.name||"Unknown",task:X.task,status:Z(X.status),progress:X.progress??0,startTime:X.startTime,endTime:X.endTime,agentId:X.agentId,agentName:X.agentName,agentWorkspace:X.agentWorkspace,taskPath:X.taskPath,error:X.error,output:X.output,generatedFiles:X.generatedFiles}));return{id:L.id,name:L.name||"Unknown Task",task:L.task,status:Z(L.status),progress:L.progress??0,startTime:L.startTime,endTime:L.endTime,agentId:L.agentId,agentName:L.agentName,agentWorkspace:L.agentWorkspace,taskPath:L.taskPath,error:L.error,output:L.output,generatedFiles:L.generatedFiles,subtasks:U.length?U:void 0}}function G(L){const X=(Array.isArray(L)?L:L&&typeof L=="object"&&"tasks"in L?L.tasks??[]:[]).map(it=>q(it));X.length===0&&s.value.length>0||(s.value=X)}function A(L){return L?new Date(L).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}async function st(L){if(!L){v.value=[];return}p.value=!0;try{const U=await fetch(`/api/tasks/${L}/timeline`);if(U.ok){const X=await U.json();v.value=X.timeline||[]}}catch(U){console.error("Failed to fetch timeline:",U),v.value=[]}finally{p.value=!1}}Bt(r,L=>{L?st(L.id):v.value=[]});let mt=null;return Nt(()=>{N(),mt=e("tasks",G)}),ae(()=>{mt&&mt()}),(L,U)=>{var X,it;return c(),u("div",Vp,[n("div",Wp,[U[6]||(U[6]=n("h2",null,"任务状态",-1)),n("div",Hp,[n("span",{class:nt(["stat running clickable",{active:a.value.includes("running")}]),onClick:U[0]||(U[0]=V=>w("running"))},"执行中: "+f(S.value.running),3),n("span",{class:nt(["stat completed clickable",{active:a.value.includes("completed")}]),onClick:U[1]||(U[1]=V=>w("completed"))},"已完成: "+f(S.value.completed),3),n("span",{class:nt(["stat failed clickable",{active:a.value.includes("failed")}]),onClick:U[2]||(U[2]=V=>w("failed"))},"失败: "+f(S.value.failed),3),n("span",Bp,"总计: "+f(S.value.total),1)])]),n("div",Kp,[n("div",qp,[Tt(n("input",{"onUpdate:modelValue":U[3]||(U[3]=V=>o.value=V),type:"text",placeholder:"搜索任务...",class:"search-input"},null,512),[[jn,o.value]])]),n("div",Gp,[(c(),u(Y,null,ct(C,V=>n("button",{key:V.value,class:nt(["filter-btn",{active:a.value.includes(V.value)}]),onClick:H=>_(V.value)},f(V.label)+" ("+f(x(V.value))+") ",11,zp)),64))])]),l.value?(c(),u("div",Jp,[...U[7]||(U[7]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载任务数据...",-1)])])):i.value?(c(),u("div",Qp,[U[8]||(U[8]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(i.value),1),n("button",{onClick:F,class:"retry-btn"},"重试")])):I.value.length===0?(c(),u("div",Yp,[U[9]||(U[9]=n("span",{class:"empty-icon"},"📭",-1)),n("span",null,f(o.value?"无匹配任务":"暂无任务数据"),1)])):(c(),u("div",{key:3,class:"task-list-container",ref_key:"containerRef",ref:d},[n("div",Xp,[(c(!0),u(Y,null,ct(I.value,V=>(c(),u("div",{key:V.id,class:"task-item",onClick:H=>r.value=V},[n("span",{class:nt(["task-status-icon",V.status])},f(k(V.status)),3),n("div",tv,[n("div",ev,f(K(V)),1)]),V.agentName?(c(),u("span",sv,f(V.agentName),1)):R("",!0),V.startTime?(c(),u("span",nv,f(M(V)),1)):R("",!0),U[10]||(U[10]=n("span",{class:"task-detail-hint"},"详情 ›",-1))],8,Zp))),128))])],512)),r.value?(c(),u("div",{key:4,class:"task-detail-overlay",onClick:U[5]||(U[5]=le(V=>r.value=null,["self"]))},[n("div",lv,[n("div",iv,[U[11]||(U[11]=n("h3",null,"任务详情",-1)),n("button",{class:"close-btn",onClick:U[4]||(U[4]=V=>r.value=null)},"×")]),n("div",ov,[n("div",av,[U[12]||(U[12]=n("span",{class:"detail-label"},"任务",-1)),n("span",rv,f(b(r.value.task??r.value.name)),1)]),r.value.taskPath?(c(),u("div",cv,[U[13]||(U[13]=n("span",{class:"detail-label"},"项目路径",-1)),n("span",uv,f(b(r.value.taskPath)),1)])):R("",!0),n("div",dv,[U[14]||(U[14]=n("span",{class:"detail-label"},"状态",-1)),n("span",fv,[n("span",{class:nt(["task-status-icon",r.value.status])},f(k(r.value.status)),3),At(" "+f(P(r.value.status)),1)])]),r.value.agentName?(c(),u("div",hv,[U[15]||(U[15]=n("span",{class:"detail-label"},"执行者",-1)),n("span",pv,f(r.value.agentName),1)])):R("",!0),r.value.agentWorkspace?(c(),u("div",vv,[U[16]||(U[16]=n("span",{class:"detail-label"},"Agent 工作区路径",-1)),n("span",gv,f(r.value.agentWorkspace),1)])):R("",!0),r.value.startTime?(c(),u("div",mv,[U[17]||(U[17]=n("span",{class:"detail-label"},"耗时",-1)),n("span",_v,f(M(r.value)),1)])):R("",!0),r.value.status==="running"?(c(),u("div",yv,[U[18]||(U[18]=n("span",{class:"detail-label"},"进度",-1)),n("div",bv,[n("div",$v,[n("div",{class:"progress-fill",style:St({width:`${r.value.progress}%`})},null,4)]),n("span",kv,f(r.value.progress)+"%",1)])])):R("",!0),r.value.status==="failed"?(c(),u("div",wv,[U[19]||(U[19]=n("span",{class:"detail-label"},"失败原因",-1)),n("span",Cv,f(T(r.value.error)),1)])):R("",!0),r.value.status==="completed"&&((X=r.value.generatedFiles)!=null&&X.length)?(c(),u("div",Tv,[U[20]||(U[20]=n("span",{class:"detail-label"},"生成的文件",-1)),n("ul",Sv,[(c(!0),u(Y,null,ct(r.value.generatedFiles,V=>(c(),u("li",{key:V,class:"file-path-item"},f(V),1))),128))])])):R("",!0),r.value.status==="completed"&&r.value.output?(c(),u("div",xv,[U[21]||(U[21]=n("span",{class:"detail-label"},"Agent 输出",-1)),n("div",Av,f(b(r.value.output)),1)])):R("",!0),(it=r.value.subtasks)!=null&&it.length?(c(),u("div",Iv,[U[22]||(U[22]=n("span",{class:"detail-label"},"子任务",-1)),n("div",Mv,[(c(!0),u(Y,null,ct(r.value.subtasks,V=>(c(),u("div",{key:V.id,class:"subtask-row"},[n("span",{class:nt(["task-status-icon",V.status])},f(k(V.status)),3),n("span",null,f(V.name),1),V.status==="failed"?(c(),u("span",Rv,f(T(V.error)),1)):R("",!0)]))),128))])])):R("",!0),v.value.length>0?(c(),u("div",Ev,[U[24]||(U[24]=n("span",{class:"detail-label"},"执行时间线",-1)),n("div",Pv,[n("div",Dv,[(c(!0),u(Y,null,ct(v.value,(V,H)=>(c(),u("div",{key:H,class:nt(["timeline-item",V.type])},[n("span",Fv,f(A(V.time)),1),U[23]||(U[23]=n("span",{class:"timeline-dot"},null,-1)),n("span",Lv,f(V.description),1)],2))),128))])])])):R("",!0)])])])):R("",!0)])}}}),Nv=Ct(Ov,[["__scopeId","data-v-5d944098"]]),jv={class:"performance-section"},Uv={class:"section-header"},Vv={class:"time-range-selector"},Wv=["onClick"],Hv={key:0,class:"loading-state"},Bv={key:1,class:"error-state"},Kv={class:"metrics-grid"},qv={class:"metric-card primary"},Gv={class:"metric-content"},zv={class:"metric-value"},Jv={key:0,class:"metric-alert"},Qv={class:"metric-card"},Yv={class:"metric-content"},Xv={class:"metric-value"},Zv={class:"metric-card highlight"},tg={class:"metric-content"},eg={class:"metric-value"},sg={class:"metric-unit"},ng={class:"metric-card highlight"},lg={class:"metric-content"},ig={class:"metric-value"},og={class:"metric-unit"},ag={class:"charts-stack"},rg={class:"chart-card"},cg={class:"chart-header"},ug={class:"chart-datetime"},dg={class:"chart-container"},fg={class:"chart-bars"},hg=["title","onClick"],pg={class:"bar-value"},vg={class:"bar-time-label"},gg={class:"chart-card"},mg={class:"chart-header"},_g={class:"chart-datetime"},yg={class:"chart-container"},bg={class:"chart-bars rpm"},$g=["title","onClick"],kg={class:"bar-value"},wg={class:"bar-time-label"},Cg={class:"summary-section"},Tg={class:"summary-grid"},Sg={class:"summary-item"},xg={class:"summary-value"},Ag={class:"summary-item"},Ig={class:"summary-value"},Mg={key:0,class:"summary-sub"},Rg={class:"summary-item highlight"},Eg={class:"summary-value"},Pg={class:"detail-modal"},Dg={class:"detail-modal-header"},Fg={class:"detail-modal-body"},Lg={key:0,class:"detail-loading"},Og={key:1,class:"detail-calls"},Ng={class:"detail-summary"},jg={class:"detail-filters"},Ug=["value"],Vg={key:0,class:"detail-call-hint"},Wg={class:"call-header"},Hg={class:"call-agent"},Bg={class:"call-time"},Kg={class:"call-tokens"},qg=["title"],Gg={key:0,class:"call-trigger-badge"},zg={key:0,class:"call-meta"},Jg={key:2,class:"detail-empty"},Qg={key:1,class:"alerts-panel"},Yg={class:"alerts-list"},Xg={class:"alert-message"},Zg={class:"alert-value"},tm={class:"alert-time"},em=["onClick"],sm=wt({__name:"PerformanceSection",setup(t){const e=W(!0),s=W(null),l=W("20m"),i=W([]),o=W(!1),a=W(!1),r=W(null),d=W(""),v=W(""),p=W(""),C=W("tokens_desc"),I=Q(()=>{var H;if(!((H=r.value)!=null&&H.calls))return[];const V=new Set(r.value.calls.map(ot=>ot.agentId));return Array.from(V).sort()}),S=Q(()=>{var H;if(!((H=r.value)!=null&&H.calls))return[];let V=[...r.value.calls];if(v.value){const ot=v.value.toLowerCase();V=V.filter(lt=>{var ft;return(ft=lt.trigger)==null?void 0:ft.toLowerCase().includes(ot)})}switch(p.value&&(V=V.filter(ot=>ot.agentId===p.value)),C.value){case"tokens_desc":V.sort((ot,lt)=>lt.tokens-ot.tokens);break;case"tokens_asc":V.sort((ot,lt)=>ot.tokens-lt.tokens);break;case"time_asc":V.sort((ot,lt)=>ot.time.localeCompare(lt.time));break;case"time_desc":V.sort((ot,lt)=>lt.time.localeCompare(ot.time));break}return V}),k=Q(()=>S.value.reduce((V,H)=>V+H.tokens,0)),x=W({current:{tpm:0,rpm:0,windowTotal:{tokens:0,requests:0}},history:{tpm:[],rpm:[],timestamps:[]},statistics:{avgTpm:0,peakTpm:0,peakTime:""}}),T=[{value:"20m",label:"20分钟"},{value:"1h",label:"1小时"},{value:"24h",label:"24小时"}],b=Q(()=>{const V=T.find(H=>H.value===l.value);return V?`最近 ${V.label}`:""}),M=Q(()=>{switch(l.value){case"20m":return 20;case"1h":return 60;case"24h":return 24;default:return 20}}),_=Q(()=>{const V=x.value.history,H=M.value;if(V.tpm.length===0){const ot=l.value==="24h"?36e5:6e4;return Array.from({length:H},(lt,ft)=>({timestamp:Date.now()-(H-ft-1)*ot,tpm:0,rpm:0}))}return V.tpm.map((ot,lt)=>({timestamp:V.timestamps[lt]||Date.now()-lt*6e4,tpm:ot,rpm:V.rpm[lt]||0}))});function w(V){const H=_.value.map(lt=>lt[V]);return Math.max(...H,1)*1.2}function K(V,H){return Math.max(V/H*100,5)}function P(V){return V>=1e6?(V/1e6).toFixed(1)+"M":V>=1e3?(V/1e3).toFixed(1)+"K":V.toString()}const N=W(Date.now());function Z(V){const H=V??Date.now(),ot=typeof H=="number"?H:Number(H);if(isNaN(ot))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=ot<1e12?ot*1e3:ot,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 F(V){if(V==null)return"--:--";if(typeof V=="string"){const lt=V.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 V}const H=Number(V);if(isNaN(H))return"--:--";const ot=new Date(H);return isNaN(ot.getTime())?"--:--":l.value==="24h"?ot.toLocaleString("zh-CN",{hour:"2-digit",hour12:!1})+":00":ot.toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function q(V){return i.value.some(H=>H.type===V&&!H.acknowledged)}function G(V){const H=i.value.find(ot=>ot.id===V);H&&(H.acknowledged=!0)}async function A(){var V,H,ot,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();x.value={current:{tpm:((V=h.current)==null?void 0:V.tpm)??0,rpm:((H=h.current)==null?void 0:H.rpm)??0,windowTotal:{tokens:((lt=(ot=h.current)==null?void 0:ot.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)??""}},N.value=Date.now(),st()}catch(Se){s.value=Se.message}finally{e.value=!1}}function st(){const{current:V}=x.value;V.tpm>1e5&&i.value.push({id:`high_tpm_${Date.now()}`,type:"high_tpm",message:"TPM 过高",value:V.tpm,threshold:1e5,timestamp:Date.now(),acknowledged:!1}),i.value=i.value.slice(-10)}function mt(){A()}async function L(V){let H;if(typeof V.timestamp=="number")H=V.timestamp<1e12?V.timestamp*1e3:V.timestamp;else if(typeof V.timestamp=="string"){const lt=V.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),H=new Date(Date.UTC(ft.getUTCFullYear(),ft.getUTCMonth(),tt,lt[0],lt[1],0,0)).getTime()}else return}else return;const ot=l.value==="24h"?"hour":"minute";o.value=!0,d.value=`${F(V.timestamp)} 调用详情`,r.value=null,a.value=!0,v.value="",p.value="",C.value="tokens_desc";try{const lt=await fetch(`/api/performance/details?timestamp=${H}&granularity=${ot}`),ft=await lt.json();lt.ok?(r.value=ft,d.value=`${ft.timeWindow||F(V.timestamp)} 调用详情`):r.value={timeWindow:F(V.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}catch{r.value={timeWindow:F(V.timestamp),calls:[],totalCalls:0,totalTokens:0,summary:{avgTokens:0}}}finally{a.value=!1}}let U=null;function X(){it();const V=l.value==="24h"?3e5:3e4;U=setInterval(A,V)}function it(){U&&(clearInterval(U),U=null)}return Nt(()=>{A(),X()}),ae(()=>{it()}),Bt(l,()=>{A(),X()}),(V,H)=>{var ot,lt,ft;return c(),u("div",jv,[n("div",Uv,[H[5]||(H[5]=n("h2",null,"性能数据",-1)),n("div",Vv,[(c(),u(Y,null,ct(T,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,Wv)),64))])]),e.value?(c(),u("div",Hv,[...H[6]||(H[6]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载性能数据...",-1)])])):s.value?(c(),u("div",Bv,[H[7]||(H[7]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(s.value),1),n("button",{onClick:mt,class:"retry-btn"},"重试")])):(c(),u(Y,{key:2},[n("div",Kv,[n("div",qv,[H[10]||(H[10]=n("div",{class:"metric-icon"},"⚡",-1)),n("div",Gv,[H[8]||(H[8]=n("div",{class:"metric-label"},"TPM",-1)),n("div",zv,f(P(x.value.current.tpm)),1),H[9]||(H[9]=n("div",{class:"metric-unit"},"Tokens/分钟",-1))]),q("high_tpm")?(c(),u("div",Jv,"⚠️")):R("",!0)]),n("div",Qv,[H[13]||(H[13]=n("div",{class:"metric-icon"},"🔄",-1)),n("div",Yv,[H[11]||(H[11]=n("div",{class:"metric-label"},"RPM",-1)),n("div",Xv,f(P(x.value.current.rpm)),1),H[12]||(H[12]=n("div",{class:"metric-unit"},"Requests/分钟",-1))])]),n("div",Zv,[H[15]||(H[15]=n("div",{class:"metric-icon"},"📊",-1)),n("div",tg,[H[14]||(H[14]=n("div",{class:"metric-label"},"总 Token",-1)),n("div",eg,f(P(x.value.current.windowTotal.tokens)),1),n("div",sg,f(b.value),1)])]),n("div",ng,[H[17]||(H[17]=n("div",{class:"metric-icon"},"🔢",-1)),n("div",lg,[H[16]||(H[16]=n("div",{class:"metric-label"},"总请求",-1)),n("div",ig,f(P(x.value.current.windowTotal.requests)),1),n("div",og,f(b.value),1)])])]),n("div",ag,[n("div",rg,[n("div",cg,[H[18]||(H[18]=n("h3",null,"TPM 趋势",-1)),n("span",ug,f(Z(N.value)),1)]),n("div",dg,[n("div",fg,[(c(!0),u(Y,null,ct(_.value,(tt,kt)=>(c(),u("div",{key:kt,class:"chart-bar clickable",style:St({height:`${K(tt.tpm,w("tpm"))}%`}),title:`${F(tt.timestamp)}: ${P(tt.tpm)} TPM - 点击查看详情`,onClick:It=>L(tt)},[n("span",pg,f(P(tt.tpm)),1),n("span",vg,f(F(tt.timestamp)),1)],12,hg))),128))])])]),n("div",gg,[n("div",mg,[H[19]||(H[19]=n("h3",null,"RPM 趋势",-1)),n("span",_g,f(Z(N.value)),1)]),n("div",yg,[n("div",bg,[(c(!0),u(Y,null,ct(_.value,(tt,kt)=>(c(),u("div",{key:kt,class:"chart-bar clickable",style:St({height:`${K(tt.rpm,w("rpm"))}%`}),title:`${F(tt.timestamp)}: ${tt.rpm} RPM - 点击查看调用详情`,onClick:It=>L(tt)},[n("span",kg,f(tt.rpm),1),n("span",wg,f(F(tt.timestamp)),1)],12,$g))),128))])])])]),n("div",Cg,[H[23]||(H[23]=n("h3",null,"统计摘要",-1)),n("div",Tg,[n("div",Sg,[H[20]||(H[20]=n("span",{class:"summary-label"},"平均 TPM",-1)),n("span",xg,f(P(x.value.statistics.avgTpm)),1)]),n("div",Ag,[H[21]||(H[21]=n("span",{class:"summary-label"},"峰值 TPM",-1)),n("span",Ig,f(P(x.value.statistics.peakTpm)),1),x.value.statistics.peakTime?(c(),u("span",Mg,"峰值时间: "+f(x.value.statistics.peakTime),1)):R("",!0)]),n("div",Rg,[H[22]||(H[22]=n("span",{class:"summary-label"},"时间窗口",-1)),n("span",Eg,f(b.value),1)])])]),o.value?(c(),u("div",{key:0,class:"detail-modal-overlay",onClick:H[4]||(H[4]=le(tt=>o.value=!1,["self"]))},[n("div",Pg,[n("div",Dg,[n("h3",null,f(d.value),1),n("button",{class:"close-btn",onClick:H[0]||(H[0]=tt=>o.value=!1)},"×")]),n("div",Fg,[a.value?(c(),u("div",Lg,"加载详情...")):(lt=(ot=r.value)==null?void 0:ot.calls)!=null&<.length?(c(),u("div",Og,[n("div",Ng,f(S.value.length)+" / "+f(r.value.totalCalls)+" 次调用 · "+f(P(k.value))+" Tokens · 平均 "+f(P(((ft=r.value.summary)==null?void 0:ft.avgTokens)||0))+" Tokens/调用 ",1),n("div",jg,[Tt(n("input",{"onUpdate:modelValue":H[1]||(H[1]=tt=>v.value=tt),type:"text",class:"search-input",placeholder:"搜索触发内容..."},null,512),[[jn,v.value]]),Tt(n("select",{"onUpdate:modelValue":H[2]||(H[2]=tt=>p.value=tt),class:"agent-filter"},[H[24]||(H[24]=n("option",{value:""},"全部 Agent",-1)),(c(!0),u(Y,null,ct(I.value,tt=>(c(),u("option",{key:tt,value:tt},f(tt),9,Ug))),128))],512),[[Pe,p.value]]),Tt(n("select",{"onUpdate:modelValue":H[3]||(H[3]=tt=>C.value=tt),class:"sort-select"},[...H[25]||(H[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(),u("div",Vg,[...H[26]||(H[26]=[n("span",{class:"hint-badge"},"完成回传",-1),n("span",{class:"hint-text"},"此时间戳为子任务完成后的回传时间,不是派发时间",-1)])])):R("",!0),(c(!0),u(Y,null,ct(S.value,(tt,kt)=>{var It,Dt;return c(),u("div",{key:kt,class:"detail-call-item"},[n("div",Wg,[n("span",Hg,f(tt.agentId),1),n("span",Bg,f(tt.time),1),n("span",Kg,f(P(tt.tokens))+" tokens",1)]),n("div",{class:"call-trigger",title:tt.trigger},[(It=tt.trigger)!=null&&It.startsWith("【完成回传】")?(c(),u("span",Gg,"完成回传")):R("",!0),At(" "+f((Dt=tt.trigger)==null?void 0:Dt.replace(/^【完成回传】/,"")),1)],8,qg),tt.model?(c(),u("div",zg,"模型: "+f(tt.model),1)):R("",!0)])}),128))])):(c(),u("div",Jg,"该时段无调用记录"))])])])):R("",!0),i.value.length>0?(c(),u("div",Qg,[H[27]||(H[27]=n("h3",null,"⚠️ 性能告警",-1)),n("div",Yg,[(c(!0),u(Y,null,ct(i.value,tt=>(c(),u("div",{key:tt.id,class:nt(["alert-item",tt.type])},[n("span",Xg,f(tt.message),1),n("span",Zg,f(P(tt.value))+" (阈值: "+f(P(tt.threshold))+")",1),n("span",tm,f(F(tt.timestamp)),1),n("button",{class:"ack-btn",onClick:kt=>G(tt.id)},"确认",8,em)],2))),128))])])):R("",!0)],64))])}}}),nm=Ct(sm,[["__scopeId","data-v-6508c9b4"]]),lm={class:"token-analysis"},im={class:"section-header"},om={class:"time-range-selector"},am=["onClick"],rm={key:0,class:"loading-state"},cm={key:1,class:"error-state"},um={class:"summary-cards"},dm={class:"summary-card"},fm={class:"card-content"},hm={class:"card-value"},pm={class:"summary-card"},vm={class:"card-content"},gm={class:"card-value"},mm={class:"summary-card highlight"},_m={class:"card-content"},ym={class:"card-value"},bm={class:"card-sub"},$m={class:"summary-card"},km={class:"card-content"},wm={class:"card-value"},Cm={class:"summary-card cost"},Tm={class:"card-content"},Sm={class:"card-value"},xm={key:0,class:"card-sub saved"},Am={key:0,class:"trend-section"},Im={class:"trend-chart"},Mm={class:"trend-bars"},Rm={key:0,class:"bar-tooltip"},Em={key:0,class:"bar-tooltip"},Pm={class:"trend-time"},Dm={class:"view-toggle"},Fm={key:1,class:"by-agent-table"},Lm={class:"agent-name"},Om={class:"total-col"},Nm={class:"percent-bar"},jm={class:"percent-text"},Um={class:"total-col"},Vm={key:2,class:"by-agent-chart"},Wm={class:"bar-chart"},Hm={class:"bar-label"},Bm={class:"bar-container"},Km={class:"bar-value"},qm={class:"bar-percent"},Gm=wt({__name:"TokenAnalysisPanel",setup(t){const e=W({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=W(!1),l=W(""),i=W("table"),o=W("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),d=Q(()=>{if(!e.value.trend)return 1;const T=[...e.value.trend.input,...e.value.trend.output];return Math.max(...T,1)}),v=Q(()=>[...e.value.byAgent||[]].sort((T,b)=>b.total-T.total));function p(T,b){return Math.max(T/b*100,2)}function C(T){const b=new Date(T);return o.value==="24h"?b.toLocaleString("zh-CN",{hour:"2-digit",hour12:!1})+":00":b.toLocaleString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function I(T){return T==null?"0":T>=1e6?(T/1e6).toFixed(2)+"M":T>=1e3?(T/1e3).toFixed(1)+"K":T.toLocaleString()}function S(T){return T==null?"0%":(T*100).toFixed(1)+"%"}function k(T){return T==null?"0.00":T>=1?T.toFixed(2):T.toFixed(4)}async function x(){s.value=!0,l.value="";try{const T=await fetch(`/api/tokens/analysis?range=${o.value}`);T.ok?e.value=await T.json():l.value="加载失败"}catch(T){l.value=String(T)}finally{s.value=!1}}return Nt(x),Bt(o,x),(T,b)=>{var M,_,w,K,P,N,Z,F,q,G,A,st,mt;return c(),u("section",lm,[n("div",im,[b[2]||(b[2]=n("h2",null,"Token 分析",-1)),n("div",om,[(c(),u(Y,null,ct(a,L=>n("button",{key:L.value,class:nt(["range-btn",{active:o.value===L.value}]),onClick:U=>o.value=L.value},f(L.label),11,am)),64))])]),s.value?(c(),u("div",rm,[...b[3]||(b[3]=[n("div",{class:"spinner"},null,-1),n("span",null,"加载 Token 数据...",-1)])])):l.value?(c(),u("div",cm,[b[4]||(b[4]=n("span",{class:"error-icon"},"⚠️",-1)),n("span",null,f(l.value),1),n("button",{onClick:x,class:"retry-btn"},"重试")])):(c(),u(Y,{key:2},[n("div",um,[n("div",dm,[b[6]||(b[6]=n("div",{class:"card-icon"},"📥",-1)),n("div",fm,[b[5]||(b[5]=n("div",{class:"card-label"},"Input",-1)),n("div",hm,f(I((M=e.value.summary)==null?void 0:M.input)),1)])]),n("div",pm,[b[8]||(b[8]=n("div",{class:"card-icon"},"📤",-1)),n("div",vm,[b[7]||(b[7]=n("div",{class:"card-label"},"Output",-1)),n("div",gm,f(I((_=e.value.summary)==null?void 0:_.output)),1)])]),n("div",mm,[b[10]||(b[10]=n("div",{class:"card-icon"},"💾",-1)),n("div",_m,[b[9]||(b[9]=n("div",{class:"card-label"},"Cache Read",-1)),n("div",ym,f(I((w=e.value.summary)==null?void 0:w.cacheRead)),1),n("div",bm,"命中率 "+f(S((K=e.value.summary)==null?void 0:K.cacheHitRate)),1)])]),n("div",$m,[b[12]||(b[12]=n("div",{class:"card-icon"},"📝",-1)),n("div",km,[b[11]||(b[11]=n("div",{class:"card-label"},"Cache Write",-1)),n("div",wm,f(I((P=e.value.summary)==null?void 0:P.cacheWrite)),1)])]),n("div",Cm,[b[14]||(b[14]=n("div",{class:"card-icon"},"💰",-1)),n("div",Tm,[b[13]||(b[13]=n("div",{class:"card-label"},"估算成本",-1)),n("div",Sm,"$"+f(k((N=e.value.cost)==null?void 0:N.total)),1),((Z=e.value.cost)==null?void 0:Z.saved)>0?(c(),u("div",xm,"节省 $"+f(k((F=e.value.cost)==null?void 0:F.saved)),1)):R("",!0)])])]),e.value.trend&&r.value?(c(),u("div",Am,[b[16]||(b[16]=n("h3",null,"Token 消耗趋势",-1)),n("div",Im,[n("div",Mm,[(c(!0),u(Y,null,ct(e.value.trend.timestamps,(L,U)=>(c(),u("div",{key:U,class:"trend-bar-group"},[n("div",{class:"trend-bar input",style:St({height:p(e.value.trend.input[U],d.value)+"%"})},[e.value.trend.input[U]>0?(c(),u("span",Rm,"In: "+f(I(e.value.trend.input[U])),1)):R("",!0)],4),n("div",{class:"trend-bar output",style:St({height:p(e.value.trend.output[U],d.value)+"%"})},[e.value.trend.output[U]>0?(c(),u("span",Em,"Out: "+f(I(e.value.trend.output[U])),1)):R("",!0)],4),n("span",Pm,f(C(L)),1)]))),128))]),b[15]||(b[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))])])):R("",!0),n("div",Dm,[n("button",{class:nt({active:i.value==="table"}),onClick:b[0]||(b[0]=L=>i.value="table")},"📊 表格",2),n("button",{class:nt({active:i.value==="chart"}),onClick:b[1]||(b[1]=L=>i.value="chart")},"📈 图表",2)]),i.value==="table"?(c(),u("div",Fm,[n("table",null,[b[19]||(b[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),u(Y,null,ct(v.value,L=>(c(),u("tr",{key:L.agent},[n("td",Lm,f(L.agent),1),n("td",null,f(I(L.input)),1),n("td",null,f(I(L.output)),1),n("td",null,f(I(L.cacheRead+L.cacheWrite)),1),n("td",Om,f(I(L.total)),1),n("td",null,[n("div",Nm,[n("div",{class:"percent-fill",style:St({width:L.percent*100+"%"})},null,4),n("span",jm,f(S(L.percent)),1)])])]))),128))]),n("tfoot",null,[n("tr",null,[b[17]||(b[17]=n("td",null,[n("strong",null,"合计")],-1)),n("td",null,f(I((q=e.value.summary)==null?void 0:q.input)),1),n("td",null,f(I((G=e.value.summary)==null?void 0:G.output)),1),n("td",null,f(I((((A=e.value.summary)==null?void 0:A.cacheRead)||0)+(((st=e.value.summary)==null?void 0:st.cacheWrite)||0))),1),n("td",Um,[n("strong",null,f(I((mt=e.value.summary)==null?void 0:mt.total)),1)]),b[18]||(b[18]=n("td",null,"100%",-1))])])])])):(c(),u("div",Vm,[b[20]||(b[20]=n("h3",null,"Token 消耗分布",-1)),n("div",Wm,[(c(!0),u(Y,null,ct(v.value,L=>(c(),u("div",{key:L.agent,class:"bar-row"},[n("div",Hm,f(L.agent),1),n("div",Bm,[n("div",{class:"bar",style:St({width:L.percent*100+"%"})},[n("span",Km,f(I(L.total)),1)],4)]),n("div",qm,f(S(L.percent)),1)]))),128))])]))],64))])}}}),zm=Ct(Gm,[["__scopeId","data-v-b98a8391"]]),Jm={class:"performance-panel"},Qm={class:"panel-header"},Ym={class:"tab-switcher"},Xm={class:"panel-content"},Zm=wt({__name:"PerformancePanel",setup(t){const e=W("tpm");return(s,l)=>(c(),u("div",Jm,[n("div",Qm,[l[2]||(l[2]=n("h2",null,"性能监控",-1)),n("div",Ym,[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",Xm,[Tt(bt(nm,null,null,512),[[fs,e.value==="tpm"]]),Tt(bt(zm,null,null,512),[[fs,e.value==="token"]])])]))}}),t1=Ct(Zm,[["__scopeId","data-v-7962ace4"]]),e1={class:"error-center"},s1={class:"header"},n1={class:"header-actions"},l1=["value"],i1=["value"],o1={class:"stats-row"},a1={class:"stat-card total"},r1={class:"stat-value"},c1={class:"stat-card session"},u1={class:"stat-value"},d1={class:"stat-card model"},f1={class:"stat-value"},h1={class:"stat-value"},p1={key:0,class:"trend-section"},v1={class:"trend-chart"},g1=["title"],m1={key:0,class:"bar-label"},_1={class:"trend-labels"},y1={key:1,class:"type-distribution"},b1={class:"type-bars"},$1={class:"type-bar-label"},k1={class:"type-bar-track"},w1={class:"type-count"},C1={key:2,class:"api-status-section"},T1={class:"api-status-grid"},S1={class:"api-header"},x1={class:"api-model"},A1={class:"api-provider"},I1={class:"api-status"},M1={class:"status-text"},R1={key:0,class:"api-last-error"},E1={class:"error-type"},P1={class:"error-time"},D1={key:1,class:"api-error-count"},F1={class:"error-lists"},L1={class:"error-group"},O1={class:"count-badge"},N1={key:0,class:"empty"},j1={key:1,class:"error-list"},U1=["onClick"],V1={class:"error-main"},W1={class:"error-agent"},H1={class:"error-msg"},B1={class:"error-time"},K1={class:"expand-icon"},q1={key:0,class:"error-detail"},G1={class:"detail-row"},z1={class:"detail-row"},J1={class:"detail-message"},Q1={class:"error-group"},Y1={class:"count-badge"},X1={key:0,class:"empty"},Z1={key:1,class:"error-list"},t_=["onClick"],e_={class:"error-main"},s_={class:"error-agent"},n_={class:"error-msg"},l_={class:"error-time"},i_={class:"expand-icon"},o_={key:0,class:"error-detail"},a_={class:"detail-row"},r_={class:"detail-row"},c_={class:"detail-message"},u_=wt({__name:"ErrorCenterPanel",setup(t){const e=W([]),s=W([]),l=W([]),i=W({totalCount:0,sessionErrorCount:0,modelFailureCount:0,byType:{},byAgent:{},hourlyTrend:[]}),o=W(!1),a=W(""),r=W(null),d=W(""),v=W(""),p=W([]),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"}},I=Q(()=>l.value.filter(F=>F.status==="healthy").length),S=Q(()=>{var F;return Math.max(...((F=i.value.hourlyTrend)==null?void 0:F.map(q=>q.count))||[1],1)});function k(F){return F/S.value*100}function x(F){const q=i.value.totalCount||1;return F/q*100}function T(F){var q;return((q=C[F])==null?void 0:q.color)||"#6b7280"}function b(F){const q=F.match(/(\d{2}):00/);return q?q[1]+"h":""}function M(F){if(!F)return"-";const G=Date.now()-F,A=Math.floor(G/6e4);if(A<1)return"刚刚";if(A<60)return`${A}分钟前`;const st=Math.floor(A/60);return st<24?`${st}小时前`:`${Math.floor(st/24)}天前`}function _(F,q){return F?F.length>q?F.slice(0,q)+"...":F:"-"}function w(F){return{healthy:"正常",degraded:"降级",down:"异常"}[F]||"未知"}function K(F){const q=p.value.find(G=>G.id===F);return q?q.name:F}function P(F){r.value=r.value===F?null:F}async function N(){try{const F=await fetch("/api/agents");if(F.ok){const q=await F.json();p.value=(Array.isArray(q)?q:[]).map(G=>({id:G.id,name:G.name||G.id}))}}catch(F){console.error("Failed to load agents:",F)}}async function Z(){o.value=!0,a.value="";try{const F=new URLSearchParams;d.value&&F.set("agent",d.value),v.value&&F.set("type",v.value);const[q,G]=await Promise.all([fetch(`/api/errors/summary?${F.toString()}`),fetch("/api/errors/stats")]);if(q.ok){const A=await q.json();e.value=A.sessionErrors||[],s.value=A.modelFailures||[],l.value=A.apiStatus||[]}G.ok&&(i.value=await G.json())}catch(F){a.value=String(F)}finally{o.value=!1}}return Nt(()=>{N(),Z()}),(F,q)=>{var G;return c(),u("section",e1,[n("div",s1,[q[4]||(q[4]=n("h2",null,"错误中心",-1)),n("div",n1,[Tt(n("select",{"onUpdate:modelValue":q[0]||(q[0]=A=>d.value=A),onChange:Z,class:"filter-select"},[q[2]||(q[2]=n("option",{value:""},"全部 Agent",-1)),(c(!0),u(Y,null,ct(p.value,A=>(c(),u("option",{key:A.id,value:A.id},f(A.name),9,l1))),128))],544),[[Pe,d.value]]),Tt(n("select",{"onUpdate:modelValue":q[1]||(q[1]=A=>v.value=A),onChange:Z,class:"filter-select"},[q[3]||(q[3]=n("option",{value:""},"全部类型",-1)),(c(),u(Y,null,ct(C,(A,st)=>n("option",{key:st,value:st},f(A.label),9,i1)),64))],544),[[Pe,v.value]]),n("button",{onClick:Z,class:"refresh-btn"},"刷新")])]),n("div",o1,[n("div",a1,[n("div",r1,f(i.value.totalCount),1),q[5]||(q[5]=n("div",{class:"stat-label"},"总错误数",-1))]),n("div",c1,[n("div",u1,f(i.value.sessionErrorCount),1),q[6]||(q[6]=n("div",{class:"stat-label"},"Session 错误",-1))]),n("div",d1,[n("div",f1,f(i.value.modelFailureCount),1),q[7]||(q[7]=n("div",{class:"stat-label"},"Model 错误",-1))]),n("div",{class:nt(["stat-card",I.value===l.value.length?"healthy":"warning"])},[n("div",h1,f(I.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(),u("div",p1,[q[9]||(q[9]=n("h3",null,"24 小时错误趋势",-1)),n("div",v1,[(c(!0),u(Y,null,ct(i.value.hourlyTrend,(A,st)=>(c(),u("div",{key:st,class:"trend-bar",style:St({height:k(A.count)+"%"}),title:`${A.hour}: ${A.count} 个错误`},[A.count>0?(c(),u("span",m1,f(A.count),1)):R("",!0)],12,g1))),128))]),n("div",_1,[(c(!0),u(Y,null,ct(i.value.hourlyTrend,(A,st)=>(c(),u("span",{key:st,class:"trend-time"},f(st%4===0?b(A.hour):""),1))),128))])])):R("",!0),Object.keys(i.value.byType||{}).length?(c(),u("div",y1,[q[10]||(q[10]=n("h3",null,"错误类型分布",-1)),n("div",b1,[(c(!0),u(Y,null,ct(i.value.byType,(A,st)=>(c(),u("div",{key:st,class:"type-bar-item"},[n("div",$1,[n("span",{class:"type-dot",style:St({background:A.color})},null,4),At(" "+f(A.label),1)]),n("div",k1,[n("div",{class:"type-bar-fill",style:St({width:x(A.count)+"%",background:A.color})},null,4)]),n("span",w1,f(A.count),1)]))),128))])])):R("",!0),l.value.length?(c(),u("div",C1,[q[11]||(q[11]=n("h3",null,"API 状态",-1)),n("div",T1,[(c(!0),u(Y,null,ct(l.value,A=>(c(),u("div",{key:A.model,class:nt(["api-status-card",`status-${A.status}`])},[n("div",S1,[n("span",x1,f(A.model),1),n("span",A1,f(A.provider),1)]),n("div",I1,[n("span",{class:nt(["status-dot",`status-${A.status}`])},null,2),n("span",M1,f(w(A.status)),1)]),A.lastError?(c(),u("div",R1,[n("span",E1,f(A.lastError.type),1),n("span",P1,f(M(A.lastError.timestamp)),1)])):R("",!0),A.errorCount>0?(c(),u("div",D1," 错误: "+f(A.errorCount)+" 次 ",1)):R("",!0)],2))),128))])])):R("",!0),n("div",F1,[n("div",L1,[n("h3",null,[q[12]||(q[12]=At("Session 错误 ",-1)),n("span",O1,f(e.value.length),1)]),e.value.length?(c(),u("div",j1,[(c(!0),u(Y,null,ct(e.value,A=>(c(),u("div",{key:A.id,class:nt(["error-item",`severity-${A.severity}`]),onClick:st=>P(A.id)},[n("div",V1,[n("span",W1,f(K(A.agentId)),1),n("span",{class:"error-type",style:St({color:T(A.type)})},f(A.typeLabel),5),n("span",H1,f(_(A.message,80)),1),n("span",B1,f(M(A.timestamp)),1),n("span",K1,f(r.value===A.id?"▼":"▶"),1)]),r.value===A.id?(c(),u("div",q1,[n("div",G1,[q[13]||(q[13]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(A.datetime),1)]),n("div",z1,[q[14]||(q[14]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",J1,f(A.fullMessage||A.message),1)])])):R("",!0)],10,U1))),128))])):(c(),u("div",N1,"暂无错误"))]),n("div",Q1,[n("h3",null,[q[15]||(q[15]=At("Model Failures ",-1)),n("span",Y1,f(s.value.length),1)]),s.value.length?(c(),u("div",Z1,[(c(!0),u(Y,null,ct(s.value,A=>(c(),u("div",{key:A.id,class:nt(["error-item",`severity-${A.severity}`]),onClick:st=>P(A.id)},[n("div",e_,[n("span",s_,f(A.model),1),n("span",{class:"error-type",style:St({color:T(A.type)})},f(A.typeLabel),5),n("span",n_,f(_(A.message,80)),1),n("span",l_,f(M(A.timestamp)),1),n("span",i_,f(r.value===A.id?"▼":"▶"),1)]),r.value===A.id?(c(),u("div",o_,[n("div",a_,[q[16]||(q[16]=n("span",{class:"detail-label"},"时间:",-1)),n("span",null,f(A.datetime),1)]),n("div",r_,[q[17]||(q[17]=n("span",{class:"detail-label"},"完整信息:",-1)),n("span",c_,f(A.fullMessage||A.message),1)])])):R("",!0)],10,t_))),128))])):(c(),u("div",X1,"暂无错误"))])])])}}}),d_=Ct(u_,[["__scopeId","data-v-ca874c41"]]),f_={class:"version-display"},h_={key:0,class:"loading-text"},p_={key:1,class:"error-text"},v_={key:0,class:"tooltip"},g_={class:"tooltip-item"},m_={class:"tooltip-item"},__={class:"tooltip-item"},y_={key:0,class:"tooltip-item"},b_={key:1,class:"tooltip-item"},$_=wt({__name:"VersionDisplay",setup(t){const e=W(!0),s=W(!1),l=W({version:"",name:"",description:""}),i=W(!1),o=Q(()=>l.value.name&&l.value.version?`${l.value.name} v${l.value.version}`:l.value.version||"v?"),a=d=>{try{return new Date(d).toLocaleString("zh-CN")}catch{return d}},r=async()=>{try{e.value=!0,s.value=!1;const d=`${window.location.origin}/api/version`,v=await fetch(d,{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(d){console.error("获取版本信息失败:",d),s.value=!0}finally{e.value=!1}};return Nt(()=>{r()}),(d,v)=>(c(),u("div",f_,[e.value?(c(),u("span",h_,"加载中...")):s.value?(c(),u("span",p_,"版本信息获取失败")):(c(),u(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(),u("div",v_,[n("div",g_,[v[2]||(v[2]=n("strong",null,"名称:",-1)),At(" "+f(l.value.name),1)]),n("div",m_,[v[3]||(v[3]=n("strong",null,"版本:",-1)),At(" "+f(l.value.version),1)]),n("div",__,[v[4]||(v[4]=n("strong",null,"描述:",-1)),At(" "+f(l.value.description),1)]),l.value.build_date?(c(),u("div",y_,[v[5]||(v[5]=n("strong",null,"构建时间:",-1)),At(" "+f(a(l.value.build_date)),1)])):R("",!0),l.value.git_commit?(c(),u("div",b_,[v[6]||(v[6]=n("strong",null,"Git 提交:",-1)),At(" "+f(l.value.git_commit),1)])):R("",!0)])):R("",!0)],64))]))}}),k_=Ct($_,[["__scopeId","data-v-87a575a1"]]),w_={id:"app"},C_={class:"controls"},T_={class:"collaboration-section"},S_={class:"task-status-section"},x_={class:"performance-section"},A_={class:"error-center-section"},I_=wt({__name:"App",setup(t){const e=Fi(),s=Yf(),l=Zf();ks("realtimeManager",e),ks("stateManager",s),ks("eventDispatcher",l);const i=W([]),o=W(null),a=W(!1),r=W({status:"disconnected",reconnectAttempts:0}),d=Q(()=>{switch(r.value.status){case"connected":return"已连接";case"connecting":return"连接中...";case"disconnected":return"未连接";case"error":return"连接错误";default:return"未知"}}),v=W(null),p=W("main"),C=W([]);async function I(){try{const[w,K]=await Promise.all([fetch("/api/agents"),fetch("/api/config").catch(()=>null)]),P=await w.json();if(i.value=Array.isArray(P)?P:[],K!=null&&K.ok){const F=await K.json();p.value=F&&F.mainAgentId||"main"}const N=Array.isArray(i.value)?i.value:[],Z=N.find(F=>F.id===p.value);Z&&(v.value=Z),C.value=N.filter(F=>F.id!==p.value)}catch(w){console.error("刷新数据失败:",w)}}function S(w){o.value=w}function k(w){const K=w.id===p.value?v.value:C.value.find(P=>P.id===w.id);S(K||{id:w.id,name:w.name,role:w.id===p.value?"主 Agent":"子 Agent",status:w.status==="error"?"down":w.status})}function x(w){I()}function T(w){r.value=w}let b=null,M=null,_=null;return Nt(()=>{I(),e.connect(),b=e.onStateChange(T),M=e.subscribe("agents",w=>{if(Array.isArray(w)){i.value=w;const K=w.find(P=>P.id===p.value);v.value=K||null,C.value=w.filter(P=>P.id!==p.value)}}),_=e.subscribe("agents_update",w=>{if(Array.isArray(w)){w.forEach(P=>{const N=i.value.findIndex(Z=>Z.id===P.id);N>=0&&(i.value[N]={...i.value[N],...P})});const K=i.value.find(P=>P.id===p.value);K&&(v.value=K),C.value=i.value.filter(P=>P.id!==p.value)}})}),ae(()=>{b==null||b(),M==null||M(),_==null||_(),e.disconnect()}),(w,K)=>(c(),u("div",w_,[n("header",null,[K[3]||(K[3]=n("h1",null,"OpenClaw Agent Dashboard",-1)),n("div",C_,[bt(k_),n("button",{onClick:I},"刷新"),n("button",{onClick:K[0]||(K[0]=P=>a.value=!0)},"⚙️ 设置"),n("span",{class:nt(["connection-status",r.value.status])},f(d.value),3)])]),n("main",null,[n("section",T_,[bt(Up,{"main-agent":v.value,"sub-agents":C.value,"main-agent-id":p.value,onAgentClick:k},null,8,["main-agent","sub-agents","main-agent-id"])]),n("section",S_,[bt(Nv)]),n("section",x_,[bt(t1)]),n("section",A_,[bt(d_)])]),a.value?(c(),Gt(Gf,{key:0,onClose:K[1]||(K[1]=P=>a.value=!1),onSettingsChanged:x})):R("",!0),o.value?(c(),Gt(Df,{key:1,agent:o.value,onClose:K[2]||(K[2]=P=>o.value=null)},null,8,["agent"])):R("",!0)]))}}),M_=Ct(I_,[["__scopeId","data-v-543ef282"]]);er(M_).mount("#app");
|