@vuagent/console 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Rc(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ne={},Qo=[],qn=()=>{},$p=()=>!1,pa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ha=e=>e.startsWith("onUpdate:"),at=Object.assign,Ec=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},K_=Object.prototype.hasOwnProperty,Ke=(e,t)=>K_.call(e,t),xe=Array.isArray,Ao=e=>Vi(e)==="[object Map]",vo=e=>Vi(e)==="[object Set]",nd=e=>Vi(e)==="[object Date]",Te=e=>typeof e=="function",et=e=>typeof e=="string",Rn=e=>typeof e=="symbol",We=e=>e!==null&&typeof e=="object",Cp=e=>(We(e)||Te(e))&&Te(e.then)&&Te(e.catch),Ap=Object.prototype.toString,Vi=e=>Ap.call(e),W_=e=>Vi(e).slice(8,-1),Sp=e=>Vi(e)==="[object Object]",Dc=e=>et(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,di=Rc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),va=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},V_=/-\w/g,Ut=va(e=>e.replace(V_,t=>t.slice(1).toUpperCase())),q_=/\B([A-Z])/g,_o=va(e=>e.replace(q_,"-$1").toLowerCase()),ma=va(e=>e.charAt(0).toUpperCase()+e.slice(1)),gl=va(e=>e?`on${ma(e)}`:""),Dt=(e,t)=>!Object.is(e,t),Or=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Rp=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},qi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},H_=e=>{const t=et(e)?Number(e):NaN;return isNaN(t)?e:t};let od;const _a=()=>od||(od=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Le(e){if(xe(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=et(o)?Y_(o):Le(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(et(e)||We(e))return e}const J_=/;(?![^(]*\))/g,G_=/:([^]+)/,Z_=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Y_(e){const t={};return e.replace(Z_,n=>n.startsWith("/*")?"":n).split(J_).forEach(n=>{if(n){const o=n.split(G_);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ye(e){let t="";if(et(e))t=e;else if(xe(e))for(let n=0;n<e.length;n++){const o=ye(e[n]);o&&(t+=o+" ")}else if(We(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function X_(e){if(!e)return null;let{class:t,style:n}=e;return t&&!et(t)&&(e.class=ye(t)),n&&(e.style=Le(n)),e}const Q_="itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",eg=Rc(Q_);function Ep(e){return!!e||e===""}function tg(e,t,n){if(e.length!==t.length)return!1;let o=!0;for(let s=0;o&&s<e.length;s++)o=En(e[s],t[s],n);return o}function sd(e,t,n){if(e.size!==t.size)return!1;const o=Array.from(t),s=new Uint8Array(o.length);for(const i of e){let r=-1;for(let a=0;a<o.length;a++)if(!s[a]&&En(i,o[a],n)){r=a;break}if(r<0)return!1;s[r]=1}return!0}function ng(e,t,n){let o=Ao(e),s=Ao(t);if(o||s||(o=vo(e),s=vo(t),o||s))return o&&s?sd(e,t,n):!1;const i=Object.keys(e).length,r=Object.keys(t).length;if(i!==r)return!1;for(const a in e){const l=e.hasOwnProperty(a),c=t.hasOwnProperty(a);if(l&&!c||!l&&c||!En(e[a],t[a],n))return!1}return String(e)===String(t)}function id(e,t,n,o){n||(n=[new Map,new Map]);const[s,i]=n;if(s.has(e)||i.has(t))return s.get(e)===t&&i.get(t)===e;s.set(e,t),i.set(t,e);const r=o(e,t,n);return s.delete(e),i.delete(t),r}function En(e,t,n){if(e===t)return!0;let o=nd(e),s=nd(t);return o||s?o&&s?e.getTime()===t.getTime():!1:(o=Rn(e),s=Rn(t),o||s?e===t:(o=xe(e),s=xe(t),o||s?o&&s?id(e,t,n,tg):!1:(o=We(e),s=We(t),o||s?!o||!s?!1:id(e,t,n,ng):String(e)===String(t))))}function Tc(e,t){return e.findIndex(n=>En(n,t))}const Dp=e=>!!(e&&e.__v_isRef===!0),A=e=>et(e)?e:e==null?"":xe(e)||We(e)&&(e.toString===Ap||!Te(e.toString))?Dp(e)?A(e.value):JSON.stringify(e,Tp,2):String(e),Tp=(e,t)=>Dp(t)?Tp(e,t.value):Ao(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[bl(o,i)+" =>"]=s,n),{})}:vo(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>bl(n))}:Rn(t)?bl(t):We(t)&&!xe(t)&&!Sp(t)?String(t):t,bl=(e,t="")=>{var n;return Rn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Et;class og{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Et&&(Et.active?(this.parent=Et,this.index=(Et.scopes||(Et.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}const o=this.effects.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}}run(t){if(this._active){const n=Et;try{return Et=this,t()}finally{Et=n}}}on(){++this._on===1&&(this.prevScope=Et,Et=this)}off(){if(this._on>0&&--this._on===0){if(Et===this)Et=this.prevScope;else{let t=Et;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const s=this.scopes.slice();for(n=0,o=s.length;n<o;n++)s[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function sg(){return Et}let Xe;const yl=new WeakSet;class Ip{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Et&&(Et.active?Et.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yl.has(this)&&(yl.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Mp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rd(this),Op(this);const t=Xe,n=Sn;Xe=this,Sn=!0;try{return this.fn()}finally{Pp(this),Xe=t,Sn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mc(t);this.deps=this.depsTail=void 0,rd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yl.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ql(this)&&this.run()}get dirty(){return ql(this)}}let Fp=0,fi,pi;function Mp(e,t=!1){if(e.flags|=8,t){e.next=pi,pi=e;return}e.next=fi,fi=e}function Ic(){Fp++}function Fc(){if(--Fp>0)return;if(pi){let t=pi;for(pi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;fi;){let t=fi;for(fi=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Op(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Pp(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Mc(o),ig(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function ql(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Lp(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Lp(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===wi)||(e.globalVersion=wi,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ql(e))))return;e.flags|=2;const t=e.dep,n=Xe,o=Sn;Xe=e,Sn=!0;try{Op(e);const s=e.fn(e._value);(t.version===0||Dt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Xe=n,Sn=o,Pp(e),e.flags&=-3}}function Mc(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Mc(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ig(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Sn=!0;const Bp=[];function Hn(){Bp.push(Sn),Sn=!1}function Jn(){const e=Bp.pop();Sn=e===void 0?!0:e}function rd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Xe;Xe=void 0;try{t()}finally{Xe=n}}}let wi=0;class rg{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ga{constructor(t){this.computed=t,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(t){if(!Xe||!Sn||Xe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Xe)n=this.activeLink=new rg(Xe,this),Xe.deps?(n.prevDep=Xe.depsTail,Xe.depsTail.nextDep=n,Xe.depsTail=n):Xe.deps=Xe.depsTail=n,jp(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Xe.depsTail,n.nextDep=void 0,Xe.depsTail.nextDep=n,Xe.depsTail=n,Xe.deps===n&&(Xe.deps=o)}return n}trigger(t){this.version++,wi++,this.notify(t)}notify(t){Ic();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Fc()}}}function jp(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)jp(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hl=new WeakMap,es=Symbol(""),Jl=Symbol(""),xi=Symbol("");function jt(e,t,n){if(Sn&&Xe){let o=Hl.get(e);o||Hl.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new ga),s.map=o,s.key=n),s.track()}}function so(e,t,n,o,s,i){const r=Hl.get(e);if(!r){wi++;return}const a=l=>{l&&l.trigger()};if(Ic(),t==="clear")r.forEach(a);else{const l=xe(e),c=l&&Dc(n);if(l&&n==="length"){const u=Number(o);r.forEach((d,_)=>{(_==="length"||_===xi||!Rn(_)&&_>=u)&&a(d)})}else switch((n!==void 0||r.has(void 0))&&a(r.get(n)),c&&a(r.get(xi)),t){case"add":l?c&&a(r.get("length")):(a(r.get(es)),Ao(e)&&a(r.get(Jl)));break;case"delete":l||(a(r.get(es)),Ao(e)&&a(r.get(Jl)));break;case"set":Ao(e)&&a(r.get(es));break}}Fc()}function _s(e){const t=Ue(e);return t===e||(jt(t,"iterate",xi),vn(e))?t:Gn(e)?So(e)?t.map(n=>To(_n(n))):t.map(To):t.map(_n)}function ba(e){return jt(e=Ue(e),"iterate",xi),e}function Nn(e,t){return Gn(e)?To(So(e)?_n(t):t):_n(t)}const ag={__proto__:null,[Symbol.iterator](){return kl(this,Symbol.iterator,e=>Nn(this,e))},concat(...e){return _s(this).concat(...e.map(t=>xe(t)?_s(t):t))},entries(){return kl(this,"entries",e=>(e[1]=Nn(this,e[1]),e))},every(e,t){return to(this,"every",e,t,void 0,arguments)},filter(e,t){return to(this,"filter",e,t,n=>n.map(o=>Nn(this,o)),arguments)},find(e,t){return to(this,"find",e,t,n=>Nn(this,n),arguments)},findIndex(e,t){return to(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return to(this,"findLast",e,t,n=>Nn(this,n),arguments)},findLastIndex(e,t){return to(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return to(this,"forEach",e,t,void 0,arguments)},includes(...e){return wl(this,"includes",e)},indexOf(...e){return wl(this,"indexOf",e)},join(e){return _s(this).join(e)},lastIndexOf(...e){return wl(this,"lastIndexOf",e)},map(e,t){return to(this,"map",e,t,void 0,arguments)},pop(){return Xs(this,"pop")},push(...e){return Xs(this,"push",e)},reduce(e,...t){return ld(this,"reduce",e,t)},reduceRight(e,...t){return ld(this,"reduceRight",e,t)},shift(){return Xs(this,"shift")},some(e,t){return to(this,"some",e,t,void 0,arguments)},splice(...e){return Xs(this,"splice",e)},toReversed(){return _s(this).toReversed()},toSorted(e){return _s(this).toSorted(e)},toSpliced(...e){return _s(this).toSpliced(...e)},unshift(...e){return Xs(this,"unshift",e)},values(){return kl(this,"values",e=>Nn(this,e))}};function kl(e,t,n){const o=ba(e),s=o[t],i=s.call(o);if(o!==e&&!vn(e)){if(i[Symbol.toStringTag]==="Array Iterator"){const r=Object.create(Object.getPrototypeOf(i));return r.next=()=>ad(i.next(),n),s!==Np[t]&&Object.defineProperties(r,{return:{get(){const a=i.return;return typeof a=="function"?a.bind(i):a}},throw:{get(){const a=i.throw;return typeof a=="function"?a.bind(i):a}}}),r}i._next=i.next,i.next=()=>ad(i._next(),n)}return i}function ad(e,t){return e.done||(e.value=t(e.value)),e}const Np=Array.prototype;function to(e,t,n,o,s,i){const r=ba(e),a=r!==e&&!vn(e),l=r[t];if(l!==Np[t]){const d=l.apply(e,i);return a?_n(d):d}let c=n;r!==e&&(a?c=function(d,_){return n.call(this,Nn(e,d),_,e)}:n.length>2&&(c=function(d,_){return n.call(this,d,_,e)}));const u=l.call(r,c,o);return a&&s?s(u):u}function ld(e,t,n,o){const s=ba(e),i=s!==e&&!vn(e);let r=n,a=!1;s!==e&&(i?(a=o.length===0,r=function(c,u,d){return a&&(a=!1,c=Nn(e,c)),n.call(this,c,Nn(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const l=s[t](r,...o);return a?Nn(e,l):l}function wl(e,t,n){const o=Ue(e);jt(o,"iterate",xi);const s=o[t](...n);return(s===-1||s===!1)&&Lc(n[0])?(n[0]=Ue(n[0]),o[t](...n)):s}function Xs(e,t,n=[]){Hn(),Ic();const o=Ue(e)[t].apply(e,n);return Fc(),Jn(),o}const lg=Rc("__proto__,__v_isRef,__isVue"),Up=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Rn));function cg(e){Rn(e)||(e=String(e));const t=Ue(this);return jt(t,"has",e),t.hasOwnProperty(e)}class zp{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?bg:qp:i?Vp:Wp).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xe(t);if(!s){let l;if(r&&(l=ag[n]))return l;if(n==="hasOwnProperty")return cg}const a=Reflect.get(t,n,ut(t)?t:o);if((Rn(n)?Up.has(n):lg(n))||(s||jt(t,"get",n),i))return a;if(ut(a)){const l=r&&Dc(n)?a:a.value;return s&&We(l)?Zl(l):l}return We(a)?s?Zl(a):mn(a):a}}class Kp extends zp{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xe(t)&&Dc(n);if(!this._isShallow){const c=Gn(i);if(!vn(o)&&!Gn(o)&&(i=Ue(i),o=Ue(o)),!r&&ut(i)&&!ut(o))return c||(i.value=o),!0}const a=r?Number(n)<t.length:Ke(t,n),l=Reflect.set(t,n,o,ut(t)?t:s);return t===Ue(s)&&l&&(a?Dt(o,i)&&so(t,"set",n,o):so(t,"add",n,o)),l}deleteProperty(t,n){const o=Ke(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&so(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Rn(n)||!Up.has(n))&&jt(t,"has",n),o}ownKeys(t){return jt(t,"iterate",xe(t)?"length":es),Reflect.ownKeys(t)}}class ug extends zp{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const dg=new Kp,fg=new ug,pg=new Kp(!0);const Gl=e=>e,gr=e=>Reflect.getPrototypeOf(e);function hg(e,t,n){return function(...o){const s=this.__v_raw,i=Ue(s),r=Ao(i),a=e==="entries"||e===Symbol.iterator&&r,l=e==="keys"&&r,c=s[e](...o),u=n?Gl:t?To:_n;return!t&&jt(i,"iterate",l?Jl:es),at(Object.create(c),{next(){const{value:d,done:_}=c.next();return _?{value:d,done:_}:{value:a?[u(d[0]),u(d[1])]:u(d),done:_}}})}}function br(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function vg(e,t){const n={get(s){const i=this.__v_raw,r=Ue(i),a=Ue(s);e||(Dt(s,a)&&jt(r,"get",s),jt(r,"get",a));const{has:l}=gr(r),c=t?Gl:e?To:_n;if(l.call(r,s))return c(i.get(s));if(l.call(r,a))return c(i.get(a));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&jt(Ue(s),"iterate",es),s.size},has(s){const i=this.__v_raw,r=Ue(i),a=Ue(s);return e||(Dt(s,a)&&jt(r,"has",s),jt(r,"has",a)),s===a?i.has(s):i.has(s)||i.has(a)},forEach(s,i){const r=this,a=r.__v_raw,l=Ue(a),c=t?Gl:e?To:_n;return!e&&jt(l,"iterate",es),a.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return at(n,e?{add:br("add"),set:br("set"),delete:br("delete"),clear:br("clear")}:{add(s){const i=Ue(this),r=gr(i),a=Ue(s),l=!t&&!vn(s)&&!Gn(s)?a:s;return r.has.call(i,l)||Dt(s,l)&&r.has.call(i,s)||Dt(a,l)&&r.has.call(i,a)||(i.add(l),so(i,"add",l,l)),this},set(s,i){!t&&!vn(i)&&!Gn(i)&&(i=Ue(i));const r=Ue(this),{has:a,get:l}=gr(r);let c=a.call(r,s);c||(s=Ue(s),c=a.call(r,s));const u=l.call(r,s);return r.set(s,i),c?Dt(i,u)&&so(r,"set",s,i):so(r,"add",s,i),this},delete(s){const i=Ue(this),{has:r,get:a}=gr(i);let l=r.call(i,s);l||(s=Ue(s),l=r.call(i,s)),a&&a.call(i,s);const c=i.delete(s);return l&&so(i,"delete",s,void 0),c},clear(){const s=Ue(this),i=s.size!==0,r=s.clear();return i&&so(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=hg(s,e,t)}),n}function Oc(e,t){const n=vg(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_isShallow"?t:s==="__v_raw"?o:Reflect.get(Ke(n,s)&&s in o?n:o,s,i)}const mg={get:Oc(!1,!1)},_g={get:Oc(!1,!0)},gg={get:Oc(!0,!1)};const Wp=new WeakMap,Vp=new WeakMap,qp=new WeakMap,bg=new WeakMap;function yg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function mn(e){return Gn(e)?e:Pc(e,!1,dg,mg,Wp)}function kg(e){return Pc(e,!1,pg,_g,Vp)}function Zl(e){return Pc(e,!0,fg,gg,qp)}function Pc(e,t,n,o,s){if(!We(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=yg(W_(e));if(r===0)return e;const a=new Proxy(e,r===2?o:n);return s.set(e,a),a}function So(e){return Gn(e)?So(e.__v_raw):!!(e&&e.__v_isReactive)}function Gn(e){return!!(e&&e.__v_isReadonly)}function vn(e){return!!(e&&e.__v_isShallow)}function Lc(e){return e?!!e.__v_raw:!1}function Ue(e){const t=e&&e.__v_raw;return t?Ue(t):e}function wg(e){return!Ke(e,"__v_skip")&&Object.isExtensible(e)&&Rp(e,"__v_skip",!0),e}const _n=e=>We(e)?mn(e):e,To=e=>We(e)?Zl(e):e;function ut(e){return e?e.__v_isRef===!0:!1}function P(e){return Jp(e,!1)}function Hp(e){return Jp(e,!0)}function Jp(e,t){return ut(e)?e:new xg(e,t)}class xg{constructor(t,n){this.dep=new ga,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ue(t),this._value=n?t:_n(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||vn(t)||Gn(t);t=o?t:Ue(t),Dt(t,n)&&(this._rawValue=t,this._value=o?t:_n(t),this.dep.trigger())}}function p(e){return ut(e)?e.value:e}const $g={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return ut(s)&&!ut(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function Gp(e){return So(e)?e:new Proxy(e,$g)}class Cg{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ga,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Ag(e){return new Cg(e)}class Sg{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ga(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Xe!==this)return Mp(this,!0),!0}get value(){const t=this.dep.track();return Lp(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Rg(e,t,n=!1){let o,s;return Te(e)?o=e:(o=e.get,s=e.set),new Sg(o,s,n)}const yr={},zr=new WeakMap;let Zo;function Eg(e,t=!1,n=Zo){if(n){let o=zr.get(n);o||zr.set(n,o=[]),o.push(e)}}function Dg(e,t,n=Ne){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:a,call:l}=n,c=C=>s?C:vn(C)||s===!1||s===0?io(C,1):io(C);let u,d,_,v,g=!1,m=!1;if(ut(e)?(d=()=>e.value,g=vn(e)):So(e)?(d=()=>c(e),g=!0):xe(e)?(m=!0,g=e.some(C=>So(C)||vn(C)),d=()=>e.map(C=>{if(ut(C))return C.value;if(So(C))return c(C);if(Te(C))return l?l(C,2):C()})):Te(e)?t?d=l?()=>l(e,2):e:d=()=>{if(_){Hn();try{_()}finally{Jn()}}const C=Zo;Zo=u;try{return l?l(e,3,[v]):e(v)}finally{Zo=C}}:d=qn,t&&s){const C=d,R=s===!0?1/0:s;d=()=>io(C(),R)}const y=sg(),x=()=>{u.stop(),y&&y.active&&Ec(y.effects,u)};if(i&&t){const C=t;t=(...R)=>{try{return C(...R)}finally{x()}}}let $=m?new Array(e.length).fill(yr):yr;const w=C=>{if(!(!(u.flags&1)||!u.dirty&&!C))if(t){const R=u.run();if(C||s||g||(m?R.some((O,B)=>Dt(O,$[B])):Dt(R,$))){const O=Zo;Hn();try{_&&_(),Zo=u;const B=[R,$===yr?void 0:m&&$[0]===yr?[]:$,v];$=R,l?l(t,3,B):t(...B)}finally{Zo=O,Jn()}}}else u.run()};return a&&a(w),u=new Ip(d),u.scheduler=r?()=>r(w,!1):w,v=C=>Eg(C,!1,u),_=u.onStop=()=>{const C=zr.get(u);if(C){if(l)l(C,4);else for(const R of C)R();zr.delete(u)}},t?o?w(!0):$=u.run():r?r(w.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function io(e,t=1/0,n){if(t<=0||!We(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ut(e))io(e.value,t,n);else if(xe(e))for(let o=0;o<e.length;o++)io(e[o],t,n);else if(vo(e)||Ao(e))e.forEach(o=>{io(o,t,n)});else if(Sp(e)){for(const o in e)io(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&io(e[o],t,n)}return e}function Hi(e,t,n,o){try{return o?e(...o):e()}catch(s){ya(s,t,n)}}function gn(e,t,n,o){if(Te(e)){const s=Hi(e,t,n,o);return s&&Cp(s)&&s.catch(i=>{ya(i,t,n,void 0,!0)}),s}if(xe(e)){const s=[];for(let i=0;i<e.length;i++)s.push(gn(e[i],t,n,o));return s}}function ya(e,t,n,o=!0,s=!1){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||Ne;if(t){let l=t.parent;const c=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const d=l.ec;if(d&&!l.isUnmounted&&(!s||l.scope.active)){for(let _=0;_<d.length;_++)if(d[_](e,c,u)===!1)return}l=l.parent}if(r){Hn(),Hi(r,null,10,[e,c,u]),Jn();return}}Tg(e,n,i,o,a)}function Tg(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Vt=[];let An=-1;const Un=[];let $o=null,ys=0;const Zp=Promise.resolve();let Kr=null;function it(e){const t=Kr||Zp;return e?t.then(this?e.bind(this):e):t}function Ig(e){let t=An+1,n=Vt.length;for(;t<n;){const o=t+n>>>1,s=Vt[o],i=$i(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function ka(e){if(!(e.flags&1)){const t=$i(e),n=Vt[Vt.length-1];!n||!(e.flags&2)&&t>=$i(n)?Vt.push(e):Vt.splice(Ig(t),0,e),e.flags|=1,Yp()}}function Yp(){Kr||(Kr=Zp.then(eh))}function Fg(e){if(!xe(e))$o&&e.id===-1?$o.splice(ys+1,0,e):e.flags&1||(Un.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Un.push(e[t]);Yp()}function Xp(e,t,n,o=An+1){for(;o<Vt.length;o++){const s=Vt[o];if(s&&s.flags&2){if(e&&s.id!==e.uid||t!==void 0&&!(s.id>=t))continue;Vt.splice(o,1),o=e?o-1:An,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Qp(e,t,n=0){if(Un.length){let o=Un,s=0;if(t){o=[];for(let r=0;r<Un.length;r++){const a=Un[r];(a.i!==void 0?!a.i||a.i.uid<n:t.has(a))?Un[s++]=a:o.push(a)}}const i=[...new Set(o)].sort((r,a)=>$i(r)-$i(a));if(Un.length=s,$o){for(let r=0;r<i.length;r++)$o.push(i[r]);return}for($o=i,ys=0;ys<$o.length;ys++){const r=$o[ys];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}$o=null,ys=0}}let xl=!1;function Mg(e,t){if(xl){e();return}const n=t===void 0?void 0:new Set(Un);e(),xl=!0;try{Xp(void 0,t),Qp(void 0,n,t)}finally{xl=!1}}const $i=e=>e.id==null?e.flags&2?-1:1/0:e.id;function eh(e){try{for(An=0;An<Vt.length;An++){const t=Vt[An];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hi(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;An<Vt.length;An++){const t=Vt[An];t&&(t.flags&=-2)}An=-1,Vt.length=0,Qp(),Kr=null,(Vt.length||Un.length)&&eh()}}let Tt=null,th=null;function Wr(e){const t=Tt;return Tt=e,th=e&&e.type.__scopeId||null,t}function we(e,t=Tt,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Gr(-1);const i=Wr(t),r=po.length;let a;try{a=e(...s)}finally{for(let l=po.length;l>r;l--)Vc();Wr(i),o._d&&Gr(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function Ve(e,t){if(Tt===null)return e;const n=Ra(Tt),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,a,l=Ne]=t[s];i&&(Te(i)&&(i={mounted:i,updated:i}),i.deep&&io(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:a,modifiers:l}))}return e}function qo(e,t,n,o){let s=e;if(o==="beforeMount")e._mount=e;else if(o==="beforeUpdate"){const a=t&&t._mount;a&&(a._latest=e,e._mount=a)}else if(o==="mounted"){const a=e._latest;e._mount=e._latest=void 0,a&&(s=a,a._mount=void 0)}const i=s.dirs,r=t&&t.dirs;for(let a=0;a<i.length;a++){let l=i[a];r?l.oldValue=r[a].value:o==="mounted"&&l.oldValue!==void 0&&(l=at({},l,{oldValue:void 0}));let c=l.dir[o];c&&(Hn(),gn(c,n,8,[e.el,l,s,t]),Jn())}}function Og(e,t){if(Nt){let n=Nt.provides;const o=Nt.parent&&Nt.parent.provides;o===n&&(n=Nt.provides=Object.create(o)),n[e]=t}}function hi(e,t,n=!1){const o=Oo();if(o||$s){let s=$s?$s._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Te(t)?t.call(o&&o.proxy):t}}const Pg=Symbol.for("v-scx"),Lg=()=>hi(Pg);function Bg(e,t){return wa(e,null,t)}function jg(e,t){return wa(e,null,{flush:"sync"})}function Ee(e,t,n){return wa(e,t,n)}function wa(e,t,n=Ne){const{immediate:o,deep:s,flush:i,once:r}=n,a=at({},n),l=t&&o||!t&&i!=="post";let c;if(Di){if(i==="sync"){const v=Lg();c=v.__watcherHandles||(v.__watcherHandles=[])}else if(!l){const v=()=>{};return v.stop=qn,v.resume=qn,v.pause=qn,v}}const u=Nt;a.call=(v,g,m)=>gn(v,u,g,m);let d=!1;i==="post"?a.scheduler=v=>{v.i=u,Bt(v,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(v,g)=>{g?v():ka(v)}),a.augmentJob=v=>{t&&(v.flags|=4),d&&(v.flags|=2,u&&(v.id=u.uid,v.i=u))};const _=Dg(e,t,a);return Di&&(c?c.push(_):l&&_()),_}function Ng(e,t,n){const o=this.proxy,s=et(e)?e.includes(".")?nh(o,e):()=>o[e]:e.bind(o,o);let i;Te(t)?i=t:(i=t.handler,n=t);const r=Gi(this),a=wa(s,i.bind(o),n);return r(),a}function nh(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const wo=new WeakMap,oh=Symbol("_vte"),xa=e=>e.__isTeleport,Yo=e=>e&&(e.disabled||e.disabled===""),Ug=e=>e&&(e.defer||e.defer===""),cd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ud=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Yl=(e,t)=>{const n=e&&e.to;return et(n)?t?t(n):null:n},zg={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,a,l,c){const{mc:u,pc:d,pbc:_,o:{insert:v,querySelector:g,createText:m,createComment:y,parentNode:x}}=c,$=Yo(t.props);let{dynamicChildren:w}=t;const C=(B,J,Q)=>{B.shapeFlag&16&&u(B.children,J,Q,s,i,r,a,l)},R=(B=t)=>{const J=Yo(B.props),Q=B.target=Yl(B.props,g),re=Xl(Q,B,m,v);Q&&(r!=="svg"&&cd(Q)?r="svg":r!=="mathml"&&ud(Q)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(Q),J||(C(B,Q,re),ri(B,!1)))},O=B=>{const J=()=>{if(wo.get(B)===J){if(wo.delete(B),Yo(B.props)){const Q=x(B.el)||n;C(B,Q,B.anchor),ri(B,!0)}R(B)}};wo.set(B,J),Bt(J,i)};if(e==null){const B=t.el=m(""),J=t.anchor=m("");if(v(B,n,o),v(J,n,o),Ug(t.props)||i&&i.pendingBranch){O(t);return}$&&(C(t,n,J),ri(t,!0)),R()}else{t.el=e.el;const B=t.anchor=e.anchor,J=wo.get(e);if(J){J.flags|=8,wo.delete(e),O(t);return}t.targetStart=e.targetStart;const Q=t.target=e.target,re=t.targetAnchor=e.targetAnchor,ee=Yo(e.props),z=ee?n:Q,K=ee?B:re;if(r==="svg"||cd(Q)?r="svg":(r==="mathml"||ud(Q))&&(r="mathml"),w?(_(e.dynamicChildren,w,z,s,i,r,a),Wc(e,t,!0)):l||d(e,t,z,K,s,i,r,a,!1),$)ee?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kr(t,n,B,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const se=Yl(t.props,g);se&&(t.target=se,kr(t,se,null,c,0))}else ee&&kr(t,Q,re,c,1);ri(t,$)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:_}=e,v=Yo(_),g=i||!v,m=wo.get(e);if(m&&(m.flags|=8,wo.delete(e)),d&&(s(c),s(u)),i&&s(l),!m&&(v||d)&&r&16)for(let y=0;y<a.length;y++){const x=a[y];o(x,t,n,g,!!x.dynamicChildren)}},move:kr,hydrate:Kg};function kr(e,t,n,{o:{insert:o},m:s},i=2){i===0&&(e.targetStart&&o(e.targetStart,t,n),o(e.targetAnchor,t,n),n=e.targetAnchor);const{el:r,anchor:a,shapeFlag:l,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!wo.has(e)&&(!d||Yo(u))&&l&16)for(let _=0;_<c.length;_++)s(c[_],t,n,2);d&&o(a,t,n)}function Kg(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:a,querySelector:l,insert:c,createText:u}},d){function _(y,x){let $=x;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,y._lpa=t.targetAnchor&&r(t.targetAnchor);break}}$=r($)}}function v(y,x){x.anchor=d(r(y),x,a(y),n,o,s,i)}const g=t.target=Yl(t.props,l),m=Yo(t.props);if(g){const y=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(v(e,t),_(g,y),t.targetAnchor||Xl(g,t,u,c,a(e)===g?e:null)):(t.anchor=r(e),_(g,y),t.targetAnchor||Xl(g,t,u,c),d(y&&r(y),t,g,n,o,s,i))),ri(t,m)}else m&&t.shapeFlag&16&&(v(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Bc=zg;function ri(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Xl(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[oh]=r,e&&(o(i,e,s),o(r,e,s)),r}const dn=Symbol("_leaveCb"),Qs=Symbol("_enterCb");function sh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ct(()=>{e.isMounted=!0}),vt(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],ih={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},Wg={name:"BaseTransition",props:ih,setup(e,{slots:t}){const n=Oo(),o=sh();return()=>{const s=t.default&&jc(t.default(),!0),i=s&&s.length?rh(s):n.subTree?E():void 0;if(!i)return;const r=Ue(e),{mode:a}=r;if(o.isLeaving)return $l(i);const l=Vr(i);if(!l)return $l(i);const c=Ci(l,r,o,n);l.type!==It&&fo(l,c);let u=n.subTree&&Vr(n.subTree);if(u&&u.type!==It&&!Xo(u,l)&&Ai(n.subTree)){let d=Ci(u,r,o,n);if(fo(u,d),a==="out-in"&&l.type!==It)return o.isLeaving=!0,d.afterLeave=()=>{if(o.isLeaving=!1,!(n.job.flags&8))if(n.effect.flags&2){const _=()=>{n.job.flags&8||n.update()};_.i=n,ka(_)}else n.update();delete d.afterLeave,u=void 0},$l(i);a==="in-out"&&l.type!==It?d.delayLeave=(_,v,g)=>{const m=ah(o,u);m[String(u.key)]=u,_[dn]=()=>{v(),_[dn]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function rh(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==It){t=n;break}}return t}const Vg=Wg;function ah(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Ci(e,t,n,o){const{appear:s,mode:i,persisted:r=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:_,onAfterLeave:v,onLeaveCancelled:g,onBeforeAppear:m,onAppear:y,onAfterAppear:x,onAppearCancelled:$}=t,w=String(e.key),C=ah(n,e),R=(J,Q)=>{J&&gn(J,o,9,Q)},O=(J,Q)=>{const re=Q[1];R(J,Q),xe(J)?J.every(ee=>ee.length<=1)&&re():J.length<=1&&re()},B={mode:i,persisted:r,beforeEnter(J){let Q=a;if(!n.isMounted)if(s)Q=m||a;else return;J[dn]&&J[dn](!0);const re=C[w];if(re&&Xo(e,re)){let ee=re.el[dn];if(!ee){const z=Ai(re);ee=z&&z.el[dn]}ee&&ee()}R(Q,[J])},enter(J){if(C[w]===e)return;let Q=l,re=c,ee=u;if(!n.isMounted)if(s)Q=y||l,re=x||c,ee=$||u;else return;let z=!1;J[Qs]=se=>{z||(z=!0,se?R(ee,[J]):R(re,[J]),B.delayedLeave&&B.delayedLeave(),J[Qs]=void 0)};const K=J[Qs].bind(null,!1);Q?O(Q,[J,K]):K()},leave(J,Q){const re=String(e.key);if(J[Qs]&&J[Qs](!0),n.isUnmounting)return Q();R(d,[J]);let ee=!1;J[dn]=K=>{ee||(ee=!0,Q(),K?R(g,[J]):R(v,[J]),J[dn]=void 0,C[re]===e&&delete C[re])};const z=J[dn].bind(null,!1);C[re]=e,_?O(_,[J,z]):z()},clone(J){const Q=Ci(J,t,n,o);return Q.afterLeave=()=>{B.afterLeave&&B.afterLeave()},Q.delayLeave=(re,ee,z)=>{B.delayLeave?B.delayLeave(re,ee,z):z()},Q.delayedLeave=()=>{B.delayedLeave&&B.delayedLeave()},Q}};return B}function $l(e){if($a(e))return e=Io(e),e.children=null,e}function Vr(e){if(!$a(e))return xa(e.type)&&e.children?rh(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Te(n.default))return n.default()}}function fo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;fo(xa(n.type)&&Vr(n)||n,t)}else if(e.shapeFlag&128){const n=e.suspense;if(n){const o=n.isHydrating?n.pendingBranch:n.activeBranch;o&&fo(o,t.clone(o))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===G&&xe(e.children)){const n=bh(e.children,!1);n&&fo(n,t)}}function jc(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const a=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===G?(r.patchFlag&128&&s++,o=o.concat(jc(r.children,t,a))):(t||r.type!==It)&&o.push(a!=null?Io(r,{key:a}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ai(e){if(e.component)return Ai(e.component.subTree);if(e.type===G){const t=xe(e.children)&&bh(e.children,!1);return t?Ai(t):void 0}if(e.type!==It)return e}function Ce(e,t){return Te(e)?at({name:e.name},t,{setup:e}):e}function Ji(){const e=Oo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function lh(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rt(e){const t=Oo(),n=Hp(null);if(t){const s=t.refs===Ne?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function dd(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const qr=new WeakMap;function vi(e,t,n,o,s=!1){if(xe(e)){e.forEach((m,y)=>vi(m,t&&(xe(t)?t[y]:t),n,o,s));return}if(xs(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&vi(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Ra(o.component):o.el,r=s?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ne?a.refs={}:a.refs,d=a.setupState,_=Ue(d),v=d===Ne?$p:m=>dd(u,m)?!1:Ke(_,m),g=(m,y)=>!(y&&dd(u,y));if(c!=null&&c!==l){if(fd(t),et(c))u[c]=null,v(c)&&(d[c]=null);else if(ut(c)){const m=t;g(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Te(l))Hi(l,a,12,[r,u]);else{const m=et(l),y=ut(l);if(m||y){const x=()=>{if(e.f){const $=m?v(l)?d[l]:u[l]:g()||!e.k?l.value:u[e.k];if(s)xe($)&&Ec($,i);else if(xe($))$.includes(i)||$.push(i);else if(m)u[l]=[i],v(l)&&(d[l]=u[l]);else{const w=[i];g(l,e.k)&&(l.value=w),e.k&&(u[e.k]=w)}}else m?(u[l]=r,v(l)&&(d[l]=r)):y&&(g(l,e.k)&&(l.value=r),e.k&&(u[e.k]=r))};if(r){const $=()=>{x(),qr.delete(e)};$.id=-1,qr.set(e,$),Bt($,n)}else fd(e),x()}}}function fd(e){const t=qr.get(e);t&&(t.flags|=8,qr.delete(e))}_a().requestIdleCallback;_a().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,$a=e=>e.type.__isKeepAlive;function qg(e,t){ch(e,"a",t)}function Hg(e,t){ch(e,"da",t)}function ch(e,t,n=Nt){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Si(t,o,n),n){let s=n.parent;for(;s&&s.parent;)$a(s.parent.vnode)&&Jg(o,t,n,s),s=s.parent}}function Jg(e,t,n,o){const s=Si(t,e,o,!0),i=Si("um",()=>Ec(o[t],s),n);i.flags=16}function Si(e,t,n=Nt,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Hn();const a=Gi(n),l=gn(t,n,e,r);return a(),Jn(),l});return o?s.unshift(i):s.push(i),i}}const go=e=>(t,n=Nt)=>{(!Di||e==="sp")&&Si(e,(...o)=>t(...o),n)},Gg=go("bm"),Ct=go("m"),Zg=go("bu"),uh=go("u"),vt=go("bum"),Nc=go("um"),Yg=go("sp"),Xg=go("rtg"),Qg=go("rtc");function e1(e,t=Nt){Si("ec",e,t)}const t1="components",dh=Symbol.for("v-ndc");function Uc(e){return et(e)?n1(t1,e,!1)||e:e||dh}function n1(e,t,n=!0,o=!1){const s=Tt||Nt;if(s){const i=s.type;{const a=j1(i,!1);if(a&&(a===t||a===Ut(t)||a===ma(Ut(t))))return i}const r=pd(s[e]||i[e],t)||pd(s.appContext[e],t);return!r&&o?i:r}}function pd(e,t){return e&&(e[t]||e[Ut(t)]||e[ma(Ut(t))])}function me(e,t,n,o){let s;const i=n,r=xe(e);if(r||et(e)){const a=r&&So(e);let l=!1,c=!1;a&&(l=!vn(e),c=Gn(e),e=ba(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(l?c?To(_n(e[u])):_n(e[u]):e[u],u,void 0,i)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)s=[];else{s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,i)}else if(We(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,i));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];s[l]=t(e[u],u,l,i)}}else s=[];return s}function o1(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(xe(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function Je(e,t,n,o,s,i){if(n==null&&(n={}),Tt.ce||Tt.parent&&xs(Tt.parent)&&Tt.parent.ce){const c=n,u=Object.keys(c).length>0;return t!=="default"&&(c.name=t),h(),ce(G,null,[j("slot",c,o&&o())],u?-2:64)}let r=e[t];r&&r._c&&(r._d=!1);const a=po.length;h();let l;try{const c=r&&fh(r(n)),u=n.key||i||c&&c.key;l=ce(G,{key:(u&&!Rn(u)?u:`_${t}`)+(!c&&o?"_fb":"")},c||(o?o():[]),c&&e._===1?64:-2)}catch(c){for(let u=po.length;u>a;u--)Vc();throw c}finally{r&&r._c&&(r._d=!0)}return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),l}function fh(e){return e.some(t=>Rs(t)?!(t.type===It||t.type===G&&!fh(t.children)):!0)?e:null}const Ql=e=>e?Oh(e)?Ra(e):Ql(e.parent):null,mi=at(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ql(e.parent),$root:e=>Ql(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>vh(e),$forceUpdate:e=>e.f||(e.f=()=>{ka(e.update)}),$nextTick:e=>e.n||(e.n=it.bind(e.proxy)),$watch:e=>Ng.bind(e)}),Cl=(e,t)=>e!==Ne&&!e.__isScriptSetup&&Ke(e,t),s1={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:a,appContext:l}=e;if(t[0]!=="$"){const _=r[t];if(_!==void 0)switch(_){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(Cl(o,t))return r[t]=1,o[t];if(s!==Ne&&Ke(s,t))return r[t]=2,s[t];if(Ke(i,t))return r[t]=3,i[t];if(n!==Ne&&Ke(n,t))return r[t]=4,n[t];ec&&(r[t]=0)}}const c=mi[t];let u,d;if(c)return t==="$attrs"&&jt(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ne&&Ke(n,t))return r[t]=4,n[t];if(d=l.config.globalProperties,Ke(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return Cl(s,t)?(s[t]=n,!0):o!==Ne&&Ke(o,t)?(o[t]=n,!0):Ke(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},a){let l;return!!(n[a]||e!==Ne&&a[0]!=="$"&&Ke(e,a)||Cl(t,a)||Ke(i,a)||Ke(o,a)||Ke(mi,a)||Ke(s.config.globalProperties,a)||(l=r.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ke(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ph(){return i1().slots}function i1(e){const t=Oo();return t.setupContext||(t.setupContext=Bh(t))}function Hr(e){return xe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Ss(e,t){return!e||!t?e||t:xe(e)&&xe(t)?e.concat(t):at({},Hr(e),Hr(t))}let ec=!0;function r1(e){const t=vh(e),n=e.proxy,o=e.ctx;ec=!1,t.beforeCreate&&hd(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:_,beforeUpdate:v,updated:g,activated:m,deactivated:y,beforeDestroy:x,beforeUnmount:$,destroyed:w,unmounted:C,render:R,renderTracked:O,renderTriggered:B,errorCaptured:J,serverPrefetch:Q,expose:re,inheritAttrs:ee,components:z,directives:K,filters:se}=t;if(c&&a1(c,o,null),r)for(const ve in r){const fe=r[ve];Te(fe)&&(o[ve]=fe.bind(n))}if(s){const ve=s.call(n,n);We(ve)&&(e.data=mn(ve))}if(ec=!0,i)for(const ve in i){const fe=i[ve],L=Te(fe)?fe.bind(n,n):Te(fe.get)?fe.get.bind(n,n):qn,H=!Te(fe)&&Te(fe.set)?fe.set.bind(n):qn,W=T({get:L,set:H});Object.defineProperty(o,ve,{enumerable:!0,configurable:!0,get:()=>W.value,set:Y=>W.value=Y})}if(a)for(const ve in a)hh(a[ve],o,n,ve);if(l){const ve=Te(l)?l.call(n):l;Reflect.ownKeys(ve).forEach(fe=>{Og(fe,ve[fe])})}u&&hd(u,e,"c");function ae(ve,fe){xe(fe)?fe.forEach(L=>ve(L.bind(n))):fe&&ve(fe.bind(n))}if(ae(Gg,d),ae(Ct,_),ae(Zg,v),ae(uh,g),ae(qg,m),ae(Hg,y),ae(e1,J),ae(Qg,O),ae(Xg,B),ae(vt,$),ae(Nc,C),ae(Yg,Q),xe(re))if(re.length){const ve=e.exposed||(e.exposed={});re.forEach(fe=>{Object.defineProperty(ve,fe,{get:()=>n[fe],set:L=>n[fe]=L,enumerable:!0})})}else e.exposed||(e.exposed={});R&&e.render===qn&&(e.render=R),ee!=null&&(e.inheritAttrs=ee),z&&(e.components=z),K&&(e.directives=K),Q&&lh(e)}function a1(e,t,n=qn){xe(e)&&(e=tc(e));for(const o in e){const s=e[o];let i;We(s)?"default"in s?i=hi(s.from||o,s.default,!0):i=hi(s.from||o):i=hi(s),ut(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function hd(e,t,n){gn(xe(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function hh(e,t,n,o){let s=o.includes(".")?nh(n,o):()=>n[o];if(et(e)){const i=t[e];Te(i)&&Ee(s,i)}else if(Te(e))Ee(s,e.bind(n));else if(We(e))if(xe(e))e.forEach(i=>hh(i,t,n,o));else{const i=Te(e.handler)?e.handler.bind(n):t[e.handler];Te(i)&&Ee(s,i,e)}}function vh(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,a=i.get(t);let l;return a?l=a:!s.length&&!n&&!o?l=t:(l={},s.length&&s.forEach(c=>Jr(l,c,r,!0)),Jr(l,t,r)),We(t)&&i.set(t,l),l}function Jr(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Jr(e,i,n,!0),s&&s.forEach(r=>Jr(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const a=l1[r]||n&&n[r];e[r]=a?a(e[r],t[r]):t[r]}return e}const l1={data:vd,props:md,emits:md,methods:ai,computed:ai,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:ai,directives:ai,watch:u1,provide:vd,inject:c1};function vd(e,t){return t?e?function(){return at(Te(e)?e.call(this,this):e,Te(t)?t.call(this,this):t)}:t:e}function c1(e,t){return ai(tc(e),tc(t))}function tc(e){if(xe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Kt(e,t){return e?[...new Set([].concat(e,t))]:t}function ai(e,t){return e?at(Object.create(null),e,t):t}function md(e,t){return e?xe(e)&&xe(t)?[...new Set([...e,...t])]:at(Object.create(null),Hr(e),Hr(t??{})):t}function u1(e,t){if(!e)return t;if(!t)return e;const n=at(Object.create(null),e);for(const o in t)n[o]=Kt(e[o],t[o]);return n}function mh(){return{app:null,config:{isNativeTag:$p,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 d1=0;function f1(e,t){return function(o,s=null){Te(o)||(o=at({},o)),s!=null&&!We(s)&&(s=null);const i=mh(),r=new WeakSet,a=[];let l=!1;const c=i.app={_uid:d1++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:U1,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Te(u.install)?(r.add(u),u.install(c,...d)):Te(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,_){if(!l){const v=c._ceVNode||j(o,s);return v.appContext=i,_===!0?_="svg":_===!1&&(_=void 0),e(v,u,_),l=!0,c._container=u,u.__vue_app__=c,Ra(v.component)}},onUnmount(u){a.push(u)},unmount(){l&&(gn(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=$s;$s=c;try{return u()}finally{$s=d}}};return c}}let $s=null;function Ca(e,t,n=Ne){const o=Oo(),s=Ut(t),i=_o(t),r=_h(e,s),a=Ag((l,c)=>{let u,d=Ne,_;return jg(()=>{const v=e[s];Dt(u,v)&&(u=v,c())}),{get(){return l(),n.get?n.get(u):u},set(v){const g=n.set?n.set(v):v;if(!Dt(g,u)&&!(d!==Ne&&Dt(v,d)))return;const m=o.vnode.props,y=!!(m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m));y||(u=v,c()),o.emit(`update:${t}`,g),Dt(v,d)&&(Dt(v,g)&&!Dt(g,_)||y&&d!==Ne&&!Dt(g,u))&&c(),d=v,_=g}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?r||Ne:a,done:!1}:{done:!0}}}},a}const _h=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ut(t)}Modifiers`]||e[`${_o(t)}Modifiers`];function p1(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Ne;let s=n;const i=t.startsWith("update:"),r=i&&_h(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>et(u)?u.trim():u)),r.number&&(s=s.map(qi)));let a,l=o[a=gl(t)]||o[a=gl(Ut(t))];!l&&i&&(l=o[a=gl(_o(t))]),l&&gn(l,e,6,s);const c=o[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,gn(c,e,6,s)}}const h1=new WeakMap;function gh(e,t,n=!1){const o=n?h1:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},a=!1;if(!Te(e)){const l=c=>{const u=gh(c,t,!0);u&&(a=!0,at(r,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!a?(We(e)&&o.set(e,null),null):(xe(i)?i.forEach(l=>r[l]=null):at(r,i),We(e)&&o.set(e,r),r)}function Aa(e,t){return!e||!pa(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ke(e,t[0].toLowerCase()+t.slice(1))||Ke(e,_o(t))||Ke(e,t))}function _d(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:a,emit:l,render:c,renderCache:u,props:d,data:_,setupState:v,ctx:g,inheritAttrs:m}=e,y=Wr(e);let x,$;try{if(n.shapeFlag&4){const C=s||o,R=C;x=zn(c.call(R,C,u,d,v,_,g)),$=a}else{const C=t;x=zn(C.length>1?C(d,{attrs:a,slots:r,emit:l}):C(d,null)),$=t.props?a:v1(a)}}catch(C){po.length=0,ya(C,e,1),x=j(It)}let w=x;if($&&m!==!1){const C=Object.keys($),{shapeFlag:R}=w;C.length&&R&7&&(i&&C.some(ha)&&($=m1($,i)),w=Io(w,$,!1,!0))}if(n.dirs&&(w=Io(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition){const C=xa(w.type)&&Vr(w)||w;fo(C,n.transition)}return x=w,Wr(y),x}function bh(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Rs(s)){if(s.type!==It||s.children==="v-if"){if(n)return;n=s}}else return}return n}const v1=e=>{let t;for(const n in e)(n==="class"||n==="style"||pa(n))&&((t||(t={}))[n]=e[n]);return t},m1=(e,t)=>{const n={};for(const o in e)(!ha(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function _1(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return o?gd(o,r,c):!!r;if(l&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const _=u[d];if(yh(r,o,_)&&!Aa(c,_))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:o===r?!1:o?r?gd(o,r,c):!0:!!r;return!1}function gd(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(!Ke(e,i)||yh(t,e,i)&&!Aa(n,i))return!0}return!1}function yh(e,t,n){const o=e[n],s=t[n];return n==="style"&&We(o)&&We(s)?!En(o,s):o!==s}function g1({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const kh={},wh=()=>Object.create(kh),xh=e=>Object.getPrototypeOf(e)===kh;function b1(e,t,n,o=!1){const s={},i=wh();e.propsDefaults=Object.create(null),$h(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:kg(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function y1(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,a=Ue(s),[l]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let _=u[d];if(Aa(e.emitsOptions,_))continue;const v=t[_];if(l)if(Ke(i,_))v!==i[_]&&(i[_]=v,c=!0);else{const g=Ut(_);s[g]=nc(l,a,g,v,e,!1)}else v!==i[_]&&(i[_]=v,c=!0)}}}else{$h(e,t,s,i)&&(c=!0);let u;for(const d in a)(!t||!Ke(t,d)&&((u=_o(d))===d||!Ke(t,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=nc(l,a,d,void 0,e,!0)):delete s[d]);if(i!==a)for(const d in i)(!t||!Ke(t,d))&&(delete i[d],c=!0)}c&&so(e.attrs,"set","")}function $h(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,a;if(t)for(let l in t){if(di(l))continue;const c=t[l];let u;s&&Ke(s,u=Ut(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:Aa(e.emitsOptions,l)||(!(l in o)||c!==o[l])&&(o[l]=c,r=!0)}if(i){const l=Ue(n),c=a||Ne;for(let u=0;u<i.length;u++){const d=i[u];n[d]=nc(s,l,d,c[d],e,!Ke(c,d))}}return r}function nc(e,t,n,o,s,i){const r=e[n];if(r!=null){const a=Ke(r,"default");if(a&&o===void 0){const l=r.default;if(r.type!==Function&&!r.skipFactory&&Te(l)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Gi(s);o=c[n]=l.call(null,t),u()}}else o=l;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!a?o=!1:r[1]&&(o===""||o===_o(n))&&(o=!0))}return o}const k1=new WeakMap;function Ch(e,t,n=!1){const o=n?k1:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},a=[];let l=!1;if(!Te(e)){const u=d=>{l=!0;const[_,v]=Ch(d,t,!0);at(r,_),v&&a.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!l)return We(e)&&o.set(e,Qo),Qo;if(xe(i))for(let u=0;u<i.length;u++){const d=Ut(i[u]);bd(d)&&(r[d]=Ne)}else if(i)for(const u in i){const d=Ut(u);if(bd(d)){const _=i[u],v=r[d]=xe(_)||Te(_)?{type:_}:at({},_),g=v.type;let m=!1,y=!0;if(xe(g))for(let x=0;x<g.length;++x){const $=g[x],w=Te($)&&$.name;if(w==="Boolean"){m=!0;break}else w==="String"&&(y=!1)}else m=Te(g)&&g.name==="Boolean";v[0]=m,v[1]=y,(m||Ke(v,"default"))&&a.push(d)}}const c=[r,a];return We(e)&&o.set(e,c),c}function bd(e){return e[0]!=="$"&&!di(e)}const zc=e=>e==="_"||e==="_ctx"||e==="$stable",Kc=e=>xe(e)?e.map(zn):[zn(e)],w1=(e,t,n)=>{if(t._n)return t;const o=we((...s)=>Kc(t(...s)),n);return o._c=!1,o},Ah=(e,t,n)=>{const o=e._ctx;for(const s in e){if(zc(s))continue;const i=e[s];if(Te(i))t[s]=w1(s,i,o);else if(i!=null){const r=Kc(i);t[s]=()=>r}}},Sh=(e,t)=>{const n=Kc(t);e.slots.default=()=>n},Rh=(e,t,n)=>{for(const o in t)(n||!zc(o))&&(e[o]=t[o])},x1=(e,t,n)=>{const o=e.slots=wh();if(e.vnode.shapeFlag&32){const s=t._;s?(Rh(o,t,n),n&&Rp(o,"_",s,!0)):Ah(t,o)}else t&&Sh(e,t)},$1=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Ne;if(o.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:Rh(s,t,n):(i=!t.$stable,Ah(t,s)),r=t}else t&&(Sh(e,t),r={default:1});if(i)for(const a in s)!zc(a)&&r[a]==null&&delete s[a]},Bt=D1;function C1(e){return A1(e)}function A1(e,t){const n=_a();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:_,setScopeId:v=qn,insertStaticContent:g}=e,m=(S,M,Z,ie=null,te=null,oe=null,de=void 0,ue=null,F=!!M.dynamicChildren)=>{if(S===M)return;S&&!Xo(S,M)&&(ie=he(S),Y(S,te,oe,!0),S=null),M.patchFlag===-2&&(F=!1,M.dynamicChildren=null),M.dynamicChildren&&S&&S.dynamicChildren&&S.dynamicChildren.hasOnce&&(M.dynamicChildren===Qo&&(M.dynamicChildren=[]),M.dynamicChildren.hasOnce=!0);const{type:U,ref:_e,shapeFlag:D}=M;switch(U){case Sa:y(S,M,Z,ie);break;case It:x(S,M,Z,ie);break;case Sl:S==null&&$(M,Z,ie,de);break;case G:z(S,M,Z,ie,te,oe,de,ue,F);break;default:D&1?R(S,M,Z,ie,te,oe,de,ue,F):D&6?K(S,M,Z,ie,te,oe,de,ue,F):(D&64||D&128)&&U.process(S,M,Z,ie,te,oe,de,ue,F,Xt)}_e!=null&&te?vi(_e,S&&S.ref,oe,M||S,!M):_e==null&&S&&S.ref!=null&&vi(S.ref,null,oe,S,!0)},y=(S,M,Z,ie)=>{if(S==null)o(M.el=a(M.children),Z,ie);else{const te=M.el=S.el;M.children!==S.children&&c(te,M.children)}},x=(S,M,Z,ie)=>{S==null?o(M.el=l(M.children||""),Z,ie):M.el=S.el},$=(S,M,Z,ie)=>{[S.el,S.anchor]=g(S.children,M,Z,ie,S.el,S.anchor)},w=({el:S,anchor:M},Z,ie)=>{let te;for(;S&&S!==M;)te=_(S),o(S,Z,ie),S=te;o(M,Z,ie)},C=({el:S,anchor:M})=>{let Z;for(;S&&S!==M;)Z=_(S),s(S),S=Z;s(M)},R=(S,M,Z,ie,te,oe,de,ue,F)=>{if(M.type==="svg"?de="svg":M.type==="math"&&(de="mathml"),S==null)O(M,Z,ie,te,oe,de,ue,F);else{const U=S.el&&S.el._isVueCE?S.el:null;try{U&&U._beginPatch(),Q(S,M,te,oe,de,ue,F)}finally{U&&U._endPatch()}}},O=(S,M,Z,ie,te,oe,de,ue)=>{let F,U;const{props:_e,shapeFlag:D,transition:V,dirs:ne}=S;if(F=S.el=r(S.type,oe,_e&&_e.is,_e),D&8?u(F,S.children):D&16&&J(S.children,F,null,ie,te,Al(S,oe),de,ue),ne&&qo(S,null,ie,"created"),B(F,S,S.scopeId,de,ie),_e){for(const Pe in _e)Pe!=="value"&&!di(Pe)&&i(F,Pe,null,_e[Pe],oe,ie);"value"in _e&&i(F,"value",null,_e.value,oe),(U=_e.onVnodeBeforeMount)&&Bn(U,ie,S)}ne&&qo(S,null,ie,"beforeMount");const ge=S1(te,V);ge?V.beforeEnter(F):V&&!V.persisted&&(F[E1]=!0),o(F,M,Z),((U=_e&&_e.onVnodeMounted)||ge||ne)&&Bt(()=>{U&&Bn(U,ie,S),ge&&V.enter(F),ne&&qo(S,null,ie,"mounted")},te)},B=(S,M,Z,ie,te)=>{if(Z&&v(S,Z),ie)for(let oe=0;oe<ie.length;oe++)v(S,ie[oe]);if(te){let oe=te.subTree;if(M===oe||Dh(oe.type)&&(oe.ssContent===M||oe.ssFallback===M)){const de=te.vnode;B(S,de,de.scopeId,de.slotScopeIds,te.parent)}}},J=(S,M,Z,ie,te,oe,de,ue,F=0)=>{for(let U=F;U<S.length;U++){const _e=S[U]=ue?oo(S[U]):zn(S[U]);m(null,_e,M,Z,ie,te,oe,de,ue)}},Q=(S,M,Z,ie,te,oe,de)=>{const ue=M.el=S.el;let{patchFlag:F,dynamicChildren:U,dirs:_e}=M;F|=S.patchFlag&16;const D=S.props||Ne,V=M.props||Ne;let ne;if(Z&&Ho(Z,!1),(ne=V.onVnodeBeforeUpdate)&&Bn(ne,Z,M,S),_e&&qo(M,S,Z,"beforeUpdate"),Z&&Ho(Z,!0),U&&(!S.dynamicChildren||S.dynamicChildren.length!==U.length)&&(F=0,de=!1,U=null),(D.innerHTML&&V.innerHTML==null||D.textContent&&V.textContent==null)&&u(ue,""),U?re(S.dynamicChildren,U,ue,Z,ie,Al(M,te),oe):de||fe(S,M,ue,null,Z,ie,Al(M,te),oe,!1),F>0){if(F&16)ee(ue,D,V,Z,te);else if(F&2&&D.class!==V.class&&i(ue,"class",null,V.class,te),F&4&&i(ue,"style",D.style,V.style,te),F&8){const ge=M.dynamicProps;for(let Pe=0;Pe<ge.length;Pe++){const Re=ge[Pe],nt=D[Re],ct=V[Re];(ct!==nt||Re==="value")&&i(ue,Re,nt,ct,te,Z)}}F&1&&S.children!==M.children&&u(ue,M.children)}else!de&&U==null&&ee(ue,D,V,Z,te);((ne=V.onVnodeUpdated)||_e)&&Bt(()=>{ne&&Bn(ne,Z,M,S),_e&&qo(M,S,Z,"updated")},ie)},re=(S,M,Z,ie,te,oe,de)=>{for(let ue=0;ue<M.length;ue++){const F=S[ue],U=M[ue],_e=F.el||_i(F),D=_e&&(F.type===G||!Xo(F,U)||F.shapeFlag&198)?d(_e):Z;m(F,U,D,null,ie,te,oe,de,!0)}},ee=(S,M,Z,ie,te)=>{if(M!==Z){if(M!==Ne)for(const oe in M)!di(oe)&&!(oe in Z)&&i(S,oe,M[oe],null,te,ie);for(const oe in Z){if(di(oe))continue;const de=Z[oe],ue=M[oe];de!==ue&&oe!=="value"&&i(S,oe,ue,de,te,ie)}"value"in Z&&i(S,"value",M.value,Z.value,te)}},z=(S,M,Z,ie,te,oe,de,ue,F)=>{const U=M.el=S?S.el:a(""),_e=M.anchor=S?S.anchor:a("");let{patchFlag:D,dynamicChildren:V,slotScopeIds:ne}=M;ne&&(ue=ue?ue.concat(ne):ne),S==null?(o(U,Z,ie),o(_e,Z,ie),J(M.children||[],Z,_e,te,oe,de,ue,F)):D>0&&D&64&&V&&S.dynamicChildren&&S.dynamicChildren.length===V.length?(re(S.dynamicChildren,V,Z,te,oe,de,ue),(M.key!=null||te&&M===te.subTree)&&Wc(S,M,!0)):fe(S,M,Z,_e,te,oe,de,ue,F)},K=(S,M,Z,ie,te,oe,de,ue,F)=>{M.slotScopeIds=ue,S==null?M.shapeFlag&512?te.ctx.activate(M,Z,ie,de,F):se(M,Z,ie,te,oe,de,F):le(S,M,F)},se=(S,M,Z,ie,te,oe,de)=>{const ue=S.component=O1(S,ie,te);if($a(S)&&(ue.ctx.renderer=Xt),P1(ue,!1,de),ue.asyncDep){if(te&&te.registerDep(ue,ae,de,oe),!S.el){const F=ue.subTree=j(It);x(null,F,M,Z),S.placeholder=F.el}}else ae(ue,S,M,Z,te,oe,de)},le=(S,M,Z)=>{const ie=M.component=S.component;if(_1(S,M,Z))if(ie.asyncDep&&!ie.asyncResolved){M.el=S.el,M.placeholder=S.placeholder,ve(ie,M,Z);return}else ie.next=M,ie.update();else M.el=S.el,M.placeholder=S.placeholder,ie.vnode=M},ae=(S,M,Z,ie,te,oe,de)=>{const ue=()=>{if(S.isMounted){let{next:D,bu:V,u:ne,parent:ge,vnode:Pe}=S;{const rn=Eh(S);if(rn){D&&(D.el=Pe.el,ve(S,D,de)),rn.asyncDep.then(()=>{const wn=()=>{S.job.flags&8||(te&&te.pendingBranch?Bt(wn,te):U())};wn.flags=48,Bt(wn,te)});return}}let Re=D,nt;Ho(S,!1),D?(D.el=Pe.el,ve(S,D,de)):D=Pe,V&&Or(V),(nt=D.props&&D.props.onVnodeBeforeUpdate)&&Bn(nt,ge,D,Pe),Ho(S,!0);const ct=_d(S),ot=S.subTree;S.subTree=ct,m(ot,ct,d(ot.el||_i(ot)),he(ot),S,te,oe),D.el=ct.el,Re===null&&g1(S,ct.el),ne&&Bt(ne,te),(nt=D.props&&D.props.onVnodeUpdated)&&Bt(()=>Bn(nt,ge,D,Pe),te)}else{let D;const{el:V,props:ne}=M,{bm:ge,m:Pe,parent:Re,root:nt,type:ct}=S,ot=xs(M);Ho(S,!1),ge&&Or(ge),!ot&&(D=ne&&ne.onVnodeBeforeMount)&&Bn(D,Re,M),Ho(S,!0);{nt.ce&&nt.ce._hasShadowRoot()&&nt.ce._injectChildStyle(ct,S.parent?S.parent.type:void 0);const rn=S.subTree=_d(S);m(null,rn,Z,ie,S,te,oe),M.el=rn.el}if(Pe&&Bt(Pe,te),!ot&&(D=ne&&ne.onVnodeMounted)){const rn=M;Bt(()=>Bn(D,Re,rn),te)}(M.shapeFlag&256||Re&&xs(Re.vnode)&&Re.vnode.shapeFlag&256)&&S.a&&Bt(S.a,te),S.isMounted=!0,M=Z=ie=null}};S.scope.on();const F=S.effect=new Ip(ue);S.scope.off();const U=S.update=F.run.bind(F),_e=S.job=F.runIfDirty.bind(F);_e.i=S,_e.id=S.uid,F.scheduler=()=>ka(_e),Ho(S,!0),U()},ve=(S,M,Z)=>{M.component=S;const ie=S.vnode.props;S.vnode=M,S.next=null,y1(S,M.props,ie,Z),$1(S,M.children,Z),Hn(),Xp(S),Jn()},fe=(S,M,Z,ie,te,oe,de,ue,F=!1)=>{const U=S&&S.children,_e=S?S.shapeFlag:0,D=M.children,{patchFlag:V,shapeFlag:ne}=M;if(V>0){if(V&128){H(U,D,Z,ie,te,oe,de,ue,F);return}else if(V&256){L(U,D,Z,ie,te,oe,de,ue,F);return}}ne&8?(_e&16&&Ie(U,te,oe),D!==U&&u(Z,D)):_e&16?ne&16?H(U,D,Z,ie,te,oe,de,ue,F):Ie(U,te,oe,!0):(_e&8&&u(Z,""),ne&16&&J(D,Z,ie,te,oe,de,ue,F))},L=(S,M,Z,ie,te,oe,de,ue,F)=>{S=S||Qo,M=M||Qo;const U=S.length,_e=M.length,D=Math.min(U,_e);let V;for(V=0;V<D;V++){const ne=M[V]=F?oo(M[V]):zn(M[V]);m(S[V],ne,Z,null,te,oe,de,ue,F)}U>_e?Ie(S,te,oe,!0,!1,D):J(M,Z,ie,te,oe,de,ue,F,D)},H=(S,M,Z,ie,te,oe,de,ue,F)=>{let U=0;const _e=M.length;let D=S.length-1,V=_e-1;for(;U<=D&&U<=V;){const ne=S[U],ge=M[U]=F?oo(M[U]):zn(M[U]);if(Xo(ne,ge))m(ne,ge,Z,null,te,oe,de,ue,F);else break;U++}for(;U<=D&&U<=V;){const ne=S[D],ge=M[V]=F?oo(M[V]):zn(M[V]);if(Xo(ne,ge))m(ne,ge,Z,null,te,oe,de,ue,F);else break;D--,V--}if(U>D){if(U<=V){const ne=V+1,ge=ne<_e?M[ne].el:ie;for(;U<=V;)m(null,M[U]=F?oo(M[U]):zn(M[U]),Z,ge,te,oe,de,ue,F),U++}}else if(U>V)for(;U<=D;)Y(S[U],te,oe,!0),U++;else{const ne=U,ge=U,Pe=new Map;for(U=ge;U<=V;U++){const Lt=M[U]=F?oo(M[U]):zn(M[U]);Lt.key!=null&&Pe.set(Lt.key,U)}let Re,nt=0;const ct=V-ge+1;let ot=!1,rn=0;const wn=new Array(ct);for(U=0;U<ct;U++)wn[U]=0;for(U=ne;U<=D;U++){const Lt=S[U];if(nt>=ct){Y(Lt,te,oe,!0);continue}let an;if(Lt.key!=null)an=Pe.get(Lt.key);else for(Re=ge;Re<=V;Re++)if(wn[Re-ge]===0&&Xo(Lt,M[Re])){an=Re;break}an===void 0?Y(Lt,te,oe,!0):(wn[an-ge]=U+1,an>=rn?rn=an:ot=!0,m(Lt,M[an],Z,null,te,oe,de,ue,F),nt++)}const cr=ot?R1(wn):Qo;for(Re=cr.length-1,U=ct-1;U>=0;U--){const Lt=ge+U,an=M[Lt],ur=M[Lt+1],dr=Lt+1<_e?ur.el||_i(ur):ie;wn[U]===0?m(null,an,Z,dr,te,oe,de,ue,F):ot&&(Re<0||U!==cr[Re]?W(an,Z,dr,2):Re--)}}},W=(S,M,Z,ie,te=null)=>{const{el:oe,type:de,transition:ue,children:F,shapeFlag:U}=S;if(U&6){W(S.component.subTree,M,Z,ie);return}if(U&128){S.suspense.move(M,Z,ie);return}if(U&64){de.move(S,M,Z,Xt);return}if(de===G){o(oe,M,Z);for(let D=0;D<F.length;D++)W(F[D],M,Z,ie);o(S.anchor,M,Z);return}if(de===Sl){w(S,M,Z);return}if(ie!==2&&U&1&&ue)if(ie===0)ue.persisted&&!oe[dn]?o(oe,M,Z):(ue.beforeEnter(oe),o(oe,M,Z),Bt(()=>ue.enter(oe),te));else{const{leave:D,delayLeave:V,afterLeave:ne}=ue,ge=()=>{S.ctx.isUnmounted?s(oe):o(oe,M,Z)},Pe=()=>{const Re=oe._isLeaving||!!oe[dn];oe._isLeaving&&oe[dn](!0),ue.persisted&&!Re?ge():D(oe,()=>{ge(),ne&&ne()})};V?V(oe,ge,Pe):Pe()}else o(oe,M,Z)},Y=(S,M,Z,ie=!1,te=!1)=>{const{type:oe,props:de,ref:ue,children:F,dynamicChildren:U,shapeFlag:_e,patchFlag:D,dirs:V,cacheIndex:ne,memo:ge}=S;if((D===-2||U&&U.hasOnce)&&(te=!1),ue!=null&&(Hn(),vi(ue,null,Z,S,!0),Jn()),ne!=null&&(!S.ctx||S.ctx===M)&&(M.renderCache[ne]=void 0),_e&256&&M.ctx.deactivate(S))return;const Pe=_e&1&&V,Re=!xs(S);let nt;if(Re&&(nt=de&&de.onVnodeBeforeUnmount)&&Bn(nt,M,S),_e&6)Ze(S.component,Z,ie);else{if(_e&128){S.suspense.unmount(Z,ie);return}Pe&&qo(S,null,M,"beforeUnmount"),_e&64?S.type.remove(S,M,Z,Xt,ie):U&&!U.hasOnce&&(oe!==G||D>0&&D&64)?Ie(U,M,Z,!1,!0):(oe===G&&D&384||!te&&_e&16)&&Ie(F,M,Z),ie&&Ae(S)}const ct=ge!=null&&ne==null;(Re&&(nt=de&&de.onVnodeUnmounted)||Pe||ct)&&Bt(()=>{nt&&Bn(nt,M,S),Pe&&qo(S,null,M,"unmounted"),ct&&(S.el=null)},Z)},Ae=S=>{const{type:M,el:Z,anchor:ie,transition:te}=S,oe=M===G;if(oe&&!te){ze(Z,ie);return}if(M===Sl){C(S),te&&!te.persisted&&te.afterLeave&&te.afterLeave();return}const de=oe?Ai(S):S,ue=()=>{oe?d(Z)&&ze(Z,ie):s(Z),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(de&&de.shapeFlag&1&&te&&!te.persisted){const{leave:F,delayLeave:U}=te,_e=de.el,D=()=>F(_e,ue);U?U(_e,ue,D):D()}else ue()},ze=(S,M)=>{let Z;for(;S!==M;)Z=_(S),s(S),S=Z;s(M)},Ze=(S,M,Z)=>{const{bum:ie,scope:te,job:oe,subTree:de,um:ue,m:F,a:U}=S;yd(F),yd(U),ie&&Or(ie),te.stop(),oe?(oe.flags|=8,Y(de,S,M,Z)):de&&(de.transition=S.vnode.transition,Y(de,S,M,Z)),ue&&Bt(ue,M);const _e=()=>{S.isUnmounted=!0};_e.flags=16,Bt(_e,M)},Ie=(S,M,Z,ie=!1,te=!1,oe=0)=>{for(let de=oe;de<S.length;de++)Y(S[de],M,Z,ie,te)},he=S=>{if(S.shapeFlag&6)return he(S.component.subTree);if(S.shapeFlag&128)return S.suspense.next();const M=_(S.anchor||S.el),Z=M&&M[oh];return Z?_(Z):M},Rt=(S,M,Z)=>{const ie=S&&M._vnode?void 0:S&&S.component?S.component.uid:M1();Mg(()=>{S==null?M._vnode&&Y(M._vnode,null,null,!0):m(M._vnode||null,S,M,null,null,null,Z),M._vnode=S},ie)},Xt={p:m,um:Y,m:W,r:Ae,mt:se,mc:J,pc:fe,pbc:re,n:he,o:e};return{render:Rt,hydrate:void 0,createApp:f1(Rt)}}function Al({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ho({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function S1(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wc(e,t,n=!1){const o=e.children,s=t.children;if(xe(o)&&xe(s))for(let i=0;i<o.length;i++){const r=o[i];let a=s[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[i]=oo(s[i]),a.el=r.el),!n&&a.patchFlag!==-2&&Wc(r,a)),a.type===Sa&&(a.patchFlag===-1&&(a=s[i]=oo(a)),a.el=r.el),a.type===It&&!a.el&&(a.el=r.el)}}function R1(e){const t=e.slice(),n=[0];let o,s,i,r,a;const l=e.length;for(o=0;o<l;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)a=i+r>>1,e[n[a]]<c?i=a+1:r=a;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function Eh(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Eh(t)}function yd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _i(e){if(e.placeholder)return e.placeholder;const t=e.component;if(t)return _i(t.subTree);const n=e.suspense;return n&&n.activeBranch?_i(n.activeBranch):null}const Dh=e=>e.__isSuspense,E1=Symbol("_deferredEnter");function D1(e,t){t&&t.pendingBranch?xe(e)?t.effects.push(...e):t.effects.push(e):Fg(e)}const G=Symbol.for("v-fgt"),Sa=Symbol.for("v-txt"),It=Symbol.for("v-cmt"),Sl=Symbol.for("v-stc"),po=[];let Qt=null;function h(e=!1){po.push(Qt=e?null:[])}function Vc(){po.pop(),Qt=po[po.length-1]||null}let Ri=1;function Gr(e,t=!1){Ri+=e,e<0&&Qt&&t&&(Qt.hasOnce=!0)}function Th(e){return e.dynamicChildren=Ri>0?Qt||Qo:null,Vc(),Ri>0&&Qt&&Qt.push(e),e}function b(e,t,n,o,s,i){return Th(f(e,t,n,o,s,i,!0))}function ce(e,t,n,o,s){return Th(j(e,t,n,o,s,!0))}function Rs(e){return e?e.__v_isVNode===!0:!1}function Xo(e,t){return e.type===t.type&&e.key===t.key}const Ih=({key:e})=>e??null,Pr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?et(e)||ut(e)||Te(e)?{i:Tt,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,o=0,s=null,i=e===G?0:1,r=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ih(t),ref:t&&Pr(t),scopeId:th,slotScopeIds:null,children:n,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:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Tt};return a?(Zr(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=et(n)?8:16),Ri>0&&!r&&Qt&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&Qt.push(l),l}const j=T1;function T1(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===dh)&&(e=It),Rs(e)){const a=Io(e,t,!0);return n&&Zr(a,n),Ri>0&&!i&&Qt&&(a.shapeFlag&6?Qt[Qt.indexOf(e)]=a:Qt.push(a)),a.patchFlag=-2,a}if(N1(e)&&(e=e.__vccOpts),t){t=I1(t);let{class:a,style:l}=t;a&&!et(a)&&(t.class=ye(a)),We(l)&&(Lc(l)&&!xe(l)&&(l=at({},l)),t.style=Le(l))}const r=et(e)?1:Dh(e)?128:xa(e)?64:We(e)?4:Te(e)?2:0;return f(e,t,n,o,s,r,i,!0)}function I1(e){return e?Lc(e)?at({},e):xh(e)?at({},e[Lh]||e):e:null}function Io(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:a,transition:l}=e,c=t?Fh(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ih(c),ref:t&&t.ref?n&&i?xe(i)?i.concat(Pr(t)):[i,Pr(t)]:Pr(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==G?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Io(e.ssContent),ssFallback:e.ssFallback&&Io(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return l&&o&&fo(u,l.clone(u)),u}function pe(e=" ",t=0){return j(Sa,null,e,t)}function E(e="",t=!1){return t?(h(),ce(It,null,e)):j(It,null,e)}function zn(e){return e==null||typeof e=="boolean"?j(It):xe(e)?j(G,null,e.slice()):Rs(e)?oo(e):j(Sa,null,String(e))}function oo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Io(e)}function Zr(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(xe(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),Zr(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!xh(t)?t._ctx=Tt:s===3&&Tt&&(Tt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Te(t)){if(o&65){Zr(e,{default:t});return}t={default:t,_ctx:Tt},n=32}else t=String(t),o&64?(n=16,t=[pe(t)]):n=8;e.children=t,e.shapeFlag|=n}function Fh(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=ye([t.class,o.class]));else if(s==="style")t.style=Le([t.style,o.style]);else if(pa(s)){const i=t[s],r=o[s];r&&i!==r&&!(xe(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!ha(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Bn(e,t,n,o=null){gn(e,t,7,[n,o])}const F1=mh();let Mh=0;function M1(){return Mh}function O1(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||F1,i={uid:Mh++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new og(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ch(o,s),emitsOptions:gh(o,s),emit:null,emitted:null,propsDefaults:Ne,inheritAttrs:o.inheritAttrs,ctx:Ne,data:Ne,props:Ne,attrs:Ne,slots:Ne,refs:Ne,setupState:Ne,setupContext:null,suspense:n,suspenseId:n?n.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 i.ctx={_:i},i.root=t?t.root:i,i.emit=p1.bind(null,i),e.ce&&e.ce(i),i}let Nt=null;const Oo=()=>Nt||Tt;let Yr,Ei;{const e=_a(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};Yr=t("__VUE_INSTANCE_SETTERS__",n=>Nt=n),Ei=t("__VUE_SSR_SETTERS__",n=>Di=n)}const Gi=e=>{const t=Nt;return Yr(e),e.scope.on(),()=>{e.scope.off(),Yr(t)}},kd=()=>{Nt&&Nt.scope.off(),Yr(null)};function Oh(e){return e.vnode.shapeFlag&4}let Di=!1;function P1(e,t=!1,n=!1){t&&Ei(t);const{props:o,children:s}=e.vnode,i=Oh(e);b1(e,o,i,t),x1(e,s,n||t);const r=i?L1(e,t):void 0;return t&&Ei(!1),r}function L1(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,s1);const{setup:o}=n;if(o){Hn();const s=e.setupContext=o.length>1?Bh(e):null,i=Gi(e),r=Hi(o,e,0,[e.props,s]),a=Cp(r);if(Jn(),i(),(a||e.sp)&&!xs(e)&&lh(e),a){if(r.then(kd,kd),t)return r.then(l=>{Ei(!0);try{wd(e,l,t)}finally{Ei(!1)}}).catch(l=>{ya(l,e,0,void 0,!0),e.ssrRender=(c,u)=>u("<!---->")});e.asyncDep=r}else wd(e,r)}else Ph(e)}function wd(e,t,n){Te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:We(t)&&(e.setupState=Gp(t)),Ph(e)}function Ph(e,t,n){const o=e.type;e.render||(e.render=o.render||qn);{const s=Gi(e);Hn();try{r1(e)}finally{Jn(),s()}}}const Lh=Symbol(),B1={get(e,t){return jt(e,"get",""),t===Lh?e:e[t]}};function Bh(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,B1),slots:e.slots,emit:e.emit,expose:t}}function Ra(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Gp(wg(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in mi)return mi[n](e)},has(t,n){return n in t||n in mi}})):e.proxy}function j1(e,t=!0){return Te(e)?e.displayName||e.name:e.name||t&&e.__name}function N1(e){return Te(e)&&"__vccOpts"in e}const T=(e,t)=>Rg(e,t,Di);function pn(e,t,n){try{Gr(-1);const o=arguments.length;return o===2?We(t)&&!xe(t)?Rs(t)?j(e,null,[t]):j(e,t):j(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Rs(n)&&(n=[n]),j(e,t,n))}finally{Gr(1)}}const U1="3.5.45";let oc;const xd=typeof window<"u"&&window.trustedTypes;if(xd)try{oc=xd.createPolicy("vue",{createHTML:e=>e})}catch{}const jh=oc?e=>oc.createHTML(e):e=>e,z1="http://www.w3.org/2000/svg",K1="http://www.w3.org/1998/Math/MathML",no=typeof document<"u"?document:null,$d=no&&no.createElement("template"),W1={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?no.createElementNS(z1,e):t==="mathml"?no.createElementNS(K1,e):n?no.createElement(e,{is:n}):no.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>no.createTextNode(e),createComment:e=>no.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>no.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{$d.innerHTML=jh(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const a=$d.content;if(o==="svg"||o==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ko="transition",ei="animation",Es=Symbol("_vtc"),Nh={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Uh=at({},ih,Nh),V1=e=>(e.displayName="Transition",e.props=Uh,e),ts=V1((e,{slots:t})=>pn(Vg,zh(e),t)),Jo=(e,t=[])=>{xe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Cd=e=>e?xe(e)?e.some(t=>t.length>1):e.length>1:!1;function zh(e){const t={};for(const z in e)z in Nh||(t[z]=e[z]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=r,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,g=q1(s),m=g&&g[0],y=g&&g[1],{onBeforeEnter:x,onEnter:$,onEnterCancelled:w,onLeave:C,onLeaveCancelled:R,onBeforeAppear:O=x,onAppear:B=$,onAppearCancelled:J=w}=t,Q=(z,K,se,le)=>{z._enterCancelled=le,xo(z,K?u:a),xo(z,K?c:r),se&&se()},re=(z,K)=>{z._isLeaving=!1,xo(z,d),xo(z,v),xo(z,_),K&&K()},ee=z=>(K,se)=>{const le=z?B:$,ae=()=>Q(K,z,se);Jo(le,[K,ae]),Ad(()=>{xo(K,z?l:i),jn(K,z?u:a),Cd(le)||Sd(K,o,m,ae)})};return at(t,{onBeforeEnter(z){Jo(x,[z]),jn(z,i),jn(z,r)},onBeforeAppear(z){Jo(O,[z]),jn(z,l),jn(z,c)},onEnter:ee(!1),onAppear:ee(!0),onLeave(z,K){z._isLeaving=!0;const se=()=>re(z,K);jn(z,d),z._enterCancelled?(jn(z,_),sc(z)):(sc(z),jn(z,_)),Ad(()=>{z._isLeaving&&(xo(z,d),jn(z,v),Cd(C)||Sd(z,o,y,se))}),Jo(C,[z,se])},onEnterCancelled(z){Q(z,!1,void 0,!0),Jo(w,[z])},onAppearCancelled(z){Q(z,!0,void 0,!0),Jo(J,[z])},onLeaveCancelled(z){re(z),Jo(R,[z])}})}function q1(e){if(e==null)return null;if(We(e))return[Rl(e.enter),Rl(e.leave)];{const t=Rl(e);return[t,t]}}function Rl(e){return H_(e)}function jn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Es]||(e[Es]=new Set)).add(t)}function xo(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Es];n&&(n.delete(t),n.size||(e[Es]=void 0))}function Ad(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let H1=0;function Sd(e,t,n,o){const s=e._endId=++H1,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:a,propCount:l}=Kh(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,_),i()},_=v=>{v.target===e&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),e.addEventListener(c,_)}function Kh(e,t){const n=window.getComputedStyle(e),o=g=>(n[g]||"").split(", "),s=o(`${ko}Delay`),i=o(`${ko}Duration`),r=Rd(s,i),a=o(`${ei}Delay`),l=o(`${ei}Duration`),c=Rd(a,l);let u=null,d=0,_=0;t===ko?r>0&&(u=ko,d=r,_=i.length):t===ei?c>0&&(u=ei,d=c,_=l.length):(d=Math.max(r,c),u=d>0?r>c?ko:ei:null,_=u?u===ko?i.length:l.length:0);const v=u===ko&&/\b(?:transform|all)(?:,|$)/.test(o(`${ko}Property`).toString());return{type:u,timeout:d,propCount:_,hasTransform:v}}function Rd(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Ed(n)+Ed(e[o])))}function Ed(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function sc(e){return(e?e.ownerDocument:document).body.offsetHeight}function J1(e,t,n){const o=e[Es];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Xr=Symbol("_vod"),qc=Symbol("_vsh"),ic={name:"show",beforeMount(e,{value:t},{transition:n}){e[Xr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ti(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),ti(e,!0),o.enter(e)):o.leave(e,()=>{ti(e,!1)}):ti(e,t))},beforeUnmount(e,{value:t}){ti(e,t)}};function ti(e,t){e.style.display=t?e[Xr]:"none",e[qc]=!t}const G1=Symbol(""),Z1=/(?:^|;)\s*display\s*:/;function Y1(e,t,n){const o=e.style,s=et(n);let i=!1;if(n&&!s){if(t)if(et(t))for(const r of t.split(";")){const a=r.slice(0,r.indexOf(":")).trim();n[a]==null&&li(o,a,"")}else for(const r in t)n[r]==null&&li(o,r,"");for(const r in n){r==="display"&&(i=!0);const a=n[r];a!=null?Q1(e,r,!et(t)&&t?t[r]:void 0,a)||li(o,r,a):li(o,r,"")}}else if(s){if(t!==n){const r=o[G1];r&&(n+=";"+r),o.cssText=n,i=Z1.test(n)}}else t&&e.removeAttribute("style");Xr in e&&((!s||t!==n)&&(e[Xr]=i?o.display:""),e[qc]&&(o.display="none"))}const wr=/\s*!important$/;function li(e,t,n){if(xe(n))n.forEach(o=>li(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))wr.test(n)?e.setProperty(t,n.replace(wr,""),"important"):e.setProperty(t,n);else{const o=X1(e,t);wr.test(n)?e.setProperty(_o(o),n.replace(wr,""),"important"):e[o]=n}}const Dd=["Webkit","Moz","ms"],El={};function X1(e,t){const n=El[t];if(n)return n;let o=Ut(t);if(o!=="filter"&&o in e)return El[t]=o;o=ma(o);for(let s=0;s<Dd.length;s++){const i=Dd[s]+o;if(i in e)return El[t]=i}return t}function Q1(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&et(o)&&n===o}const Td="http://www.w3.org/1999/xlink";function Id(e,t,n,o,s,i=eg(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Td,t.slice(6,t.length)):e.setAttributeNS(Td,t,n):n==null||i&&!Ep(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Rn(n)?String(n):n)}function Fd(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?jh(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Ep(n):n==null&&a==="string"?(n="",r=!0):a==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function ro(e,t,n,o){e.addEventListener(t,n,o)}function e0(e,t,n,o){e.removeEventListener(t,n,o)}const Md=Symbol("_vei");function t0(e,t,n,o,s=null){const i=e[Md]||(e[Md]={}),r=i[t];if(o&&r)r.value=o;else{const[a,l]=s0(t);if(o){const c=i[t]=a0(o,s);ro(e,a,c,l)}else r&&(e0(e,a,r,l),i[t]=void 0)}}const n0=/(Once|Passive|Capture)$/,o0=/^on:?(?:Once|Passive|Capture)$/;function s0(e){let t,n;for(;(n=e.match(n0))&&!o0.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):_o(e.slice(2)),t]}let Dl=0;const i0=Promise.resolve(),r0=()=>Dl||(i0.then(()=>Dl=0),Dl=Date.now());function a0(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(xe(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),a=[o];for(let l=0;l<r.length&&!o._stopped;l++){const c=r[l];c&&gn(c,t,5,a)}}else gn(s,t,5,[o])};return n.value=e,n.attached=r0(),n}const Od=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,l0=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?J1(e,o,r):t==="style"?Y1(e,n,o):pa(t)?ha(t)||t0(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):c0(e,t,o,r))?(Fd(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Id(e,t,o,r,i,t!=="value")):e._isVueCE&&(u0(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!et(o)))?Fd(e,Ut(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Id(e,t,o,r))};function c0(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Od(t)&&Te(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Od(t)&&et(n)?!1:t in e}function u0(e,t){const n=e._def.props;if(!n)return!1;const o=Ut(t);return Array.isArray(n)?n.some(s=>Ut(s)===o):Object.keys(n).some(s=>Ut(s)===o)}const Wh=new WeakMap,Vh=new WeakMap,Qr=Symbol("_moveCb"),Pd=Symbol("_enterCb"),rc=new WeakMap,d0=e=>(delete e.props.mode,e),f0=d0({name:"TransitionGroup",props:at({},Uh,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Oo(),o=sh();let s,i,r,a;const l=()=>(a===void 0&&(a=s.length>0&&b0(s[0].el,n.vnode.el,Ld(e))),a);return uh(()=>{if(rc.delete(n),!l()){s=[],r=void 0;return}const c=Ld(e);s.forEach(p0);const u=r&&g0(r,n.vnode.el);r=void 0,s.forEach(_=>h0(_,u));const d=s.filter(v0);sc(n.vnode.el),d.forEach(_=>{const v=_.el,g=v.style;jn(v,c),g.transform=g.webkitTransform=g.transitionDuration="";const m=v[Qr]=y=>{y&&y.target!==v||(!y||y.propertyName.endsWith("transform"))&&(v.removeEventListener("transitionend",m),v[Qr]=null,xo(v,c))};v.addEventListener("transitionend",m)}),s=[]}),()=>{const c=Ue(e),u=zh(c);let d=c.tag||G;if(s=[],a=void 0,i)for(let _=0;_<i.length;_++){const v=i[_];v.el&&v.el instanceof Element&&!v.el[qc]&&(s.push(v),fo(v,Ci(v,u,o,n)),Wh.set(v,Ea(v.el)))}i=t.default?jc(t.default()):[];for(let _=0;_<i.length;_++){const v=i[_];v.key!=null&&fo(v,Ci(v,u,o,n))}return s.length&&(r=m0(n),rc.set(n,l)),j(d,null,i)}}}),Ds=f0;function p0(e){const t=e.el;t[Qr]&&t[Qr](),t[Pd]&&t[Pd]()}function Ld(e){return e.moveClass||`${e.name||"v"}-move`}function h0(e,t){Vh.set(e,Ea(e.el,t))}function v0(e){const t=Wh.get(e),n=Vh.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,a=i.getBoundingClientRect();let l=1,c=1;return i.offsetWidth&&(l=a.width/i.offsetWidth),i.offsetHeight&&(c=a.height/i.offsetHeight),(!Number.isFinite(l)||l===0)&&(l=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(l-1)<.01&&(l=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/l}px,${s/c}px)`,r.transitionDuration="0s",e}}function Ea(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function m0(e){let t;for(let n=e.parent;n;n=n.parent){const o=rc.get(n);if(o){const s=_0(n.vnode.el,e.vnode.el);s&&(t||(t=[])).push(at(Ea(s),{item:s,willMove:o}))}}return t}function _0(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function g0(e,t){const n=e.find(o=>o.willMove()&&o.item.contains(t));return n&&Ea(n.item,n)}function b0(e,t,n){const o=e.cloneNode(),s=e[Es];s&&s.forEach(a=>{a.split(/\s+/).forEach(l=>l&&o.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&o.classList.add(a)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=Kh(o);return i.removeChild(o),r}const Fo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xe(t)?n=>Or(t,n):t};function y0(e){e.target.composing=!0}function Bd(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const en=Symbol("_assign"),xr=Symbol("_initialValue");function Tl(e,t,n){return t&&(e=e.trim()),n&&(e=qi(e)),e}const st={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e.parentNode&&(e.type==="text"?e[xr]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[xr]=e.defaultValue.replace(/\r\n?/g,`
|
|
2
|
+
`))),e[en]=Fo(s);const i=o||s.props&&s.props.type==="number";ro(e,t?"change":"input",r=>{r.target.composing||e[en](Tl(e.value,n,i))}),(n||i)&&ro(e,"change",()=>{e.value=Tl(e.value,n,i)}),t||(ro(e,"compositionstart",y0),ro(e,"compositionend",Bd),ro(e,"change",Bd))},mounted(e,{value:t,modifiers:{trim:n,number:o}}){const s=t??"",i=e[xr];delete e[xr],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[en](Tl(e.value,n,o)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[en]=Fo(r),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?qi(e.value):e.value,l=t??"";if(a===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===l)||(e.value=l)}},Hc={deep:!0,created(e,t,n){e[en]=Fo(n),ro(e,"change",()=>{const o=e._modelValue,s=Ts(e),i=e.checked,r=e[en];if(xe(o)){const a=Tc(o,s),l=a!==-1;if(i&&!l)r(o.concat(s));else if(!i&&l){const c=[...o];c.splice(a,1),r(c)}}else if(vo(o)){const a=new Set(o);i?a.add(s):a.delete(s),r(a)}else r(qh(e,i))})},mounted:jd,beforeUpdate(e,t,n){e[en]=Fo(n),jd(e,t,n)}};function jd(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xe(t))s=Tc(t,o.props.value)>-1;else if(vo(t))s=t.has(o.props.value);else{if(t===n)return;s=En(t,qh(e,!0))}e.checked!==s&&(e.checked=s)}const k0={created(e,{value:t},n){e.checked=En(t,n.props.value),e[en]=Fo(n),ro(e,"change",()=>{e[en](Ts(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[en]=Fo(o),t!==n&&(e.checked=En(t,o.props.value))}},w0={deep:!0,created(e,{value:t,modifiers:{number:n}},o){e._modelValue=t,ro(e,"change",()=>{const s=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>n?qi(Ts(l)):Ts(l)),i=e.multiple,r=i?vo(e._modelValue)?new Set(s):s:s[0],a=e._pendingValue=[i,i?xe(r)?s.slice():s:r];try{e[en](r)}finally{it(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[en]=Fo(o)},mounted(e,{value:t,modifiers:{number:n}}){Nd(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[en]=Fo(n)},updated(e,{value:t,modifiers:{number:n}}){const o=e._pendingValue;e._pendingValue=void 0,(!o||o[0]!==e.multiple||!x0(t,o[1],o[0]))&&Nd(e,t,n)}};function x0(e,t,n){if(!n||xe(e))return En(e,t);if(vo(e)){if(e.size!==t.length)return!1;for(const o of t)if(!e.has(o))return!1;return!0}return!1}function Nd(e,t,n=!1){const o=e.multiple,s=xe(t);if(!(o&&!s&&!vo(t))){for(let i=0,r=e.options.length;i<r;i++){const a=e.options[i],l=Ts(a);if(o)if(s){const c=typeof l;c==="string"||c==="number"?a.selected=t.some(u=>String(u)===String(l)):a.selected=Tc(t,l)>-1}else a.selected=t.has(l)||n&&typeof l=="string"&&t.has(qi(l));else if(En(Ts(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ts(e){return"_value"in e?e._value:e.value}function qh(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Hh={created(e,t,n){$r(e,t,n,null,"created")},mounted(e,t,n){$r(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){$r(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){$r(e,t,n,o,"updated")}};function $0(e,t){switch(e){case"SELECT":return w0;case"TEXTAREA":return st;default:switch(t){case"checkbox":return Hc;case"radio":return k0;default:return st}}}function $r(e,t,n,o,s){const r=$0(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}const C0=["ctrl","shift","alt","meta"],A0={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>C0.some(n=>e[`${n}Key`]&&!t.includes(n))},Fe=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const a=A0[t[r]];if(a&&a(s,t))return}return e(s,...i)}))},S0={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},xt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=_o(s.key);if(t.some(r=>r===i||S0[r]===i))return e(s)}))},R0=at({patchProp:l0},W1);let Ud;function E0(){return Ud||(Ud=C1(R0))}const D0=((...e)=>{const t=E0().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=I0(o);if(!s)return;const i=t._component;!Te(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,T0(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t});function T0(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function I0(e){return et(e)?document.querySelector(e):e}const F0=["type","disabled","aria-busy"],M0={key:0,class:"va-btn__icon"},O0={key:1,class:"va-btn__label"},P0={key:2,class:"va-btn__icon"},Cs=Ce({__name:"VaButton",props:{variant:{default:"primary"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},setup(e){return(t,n)=>(h(),b("button",{class:ye(["va-btn",[`va-btn--${e.variant}`,`va-btn--${e.size}`,{"va-btn--block":e.block,"va-btn--loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading,"aria-busy":e.loading||void 0},[t.$slots.icon?(h(),b("span",M0,[Je(t.$slots,"icon")])):E("",!0),t.$slots.default?(h(),b("span",O0,[Je(t.$slots,"default")])):E("",!0),t.$slots["icon-right"]?(h(),b("span",P0,[Je(t.$slots,"icon-right")])):E("",!0)],10,F0))}});function L0(e,t){const n=P(!1);let o=null,s;const i=T(()=>new Intl.NumberFormat(e.locale??void 0,e.format)),r=T(()=>i.value.format(e.value)),a=T(()=>{const c=[];let u=0,d=0;for(let _=r.value.length-1;_>=0;_--){const v=r.value[_];v>="0"&&v<="9"?c.unshift({key:`d${u++}`,digit:v.charCodeAt(0)-48}):c.unshift({key:`s${d++}`,char:v})}return c});function l(){n.value||(s=window.setTimeout(()=>n.value=!0,e.delay))}return Ct(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){n.value=!0;return}if(typeof IntersectionObserver>"u"){l();return}o=new IntersectionObserver(c=>{c.some(u=>u.isIntersecting)&&(l(),o?.disconnect(),o=null)},{threshold:.3}),o.observe(t.value)}),vt(()=>{o?.disconnect(),s!==void 0&&window.clearTimeout(s)}),{rolled:n,parts:a,formatted:r}}const B0=["aria-label"],j0=["data-static"],N0={key:1,class:"va-ticker__char"},zd=Ce({__name:"VaNumberTicker",props:{value:{},format:{},locale:{},duration:{default:900},delay:{default:0}},setup(e){const t=e,n=rt("root"),{rolled:o,parts:s,formatted:i}=L0(t,n);return(r,a)=>(h(),b("span",{ref_key:"root",ref:n,class:"va-ticker",role:"img","aria-label":p(i)},[(h(!0),b(G,null,me(p(s),l=>(h(),b("span",{key:l.key,class:"va-ticker__col","data-static":l.digit===void 0||void 0},[l.digit!==void 0?(h(),b("span",{key:0,class:"va-ticker__reel",style:Le({transform:p(o)?`translateY(${-l.digit/11*100}%)`:"translateY(0)",transitionDuration:`${e.duration}ms`})},[(h(),b(G,null,me(11,c=>f("span",{key:c,class:"va-ticker__num"},A((c-1)%10),1)),64))],4)):(h(),b("span",N0,A(l.char),1))],8,j0))),128))],8,B0))}}),lo=Ce({__name:"VaSkeleton",props:{width:{},height:{},radius:{},circle:{type:Boolean}},setup(e){const t=e,n=s=>{if(s!==void 0)return typeof s=="number"?`${s}px`:/^\d+(\.\d+)?$/.test(s)?`${s}px`:s},o=T(()=>{const s=n(t.width??"100%"),i=n(t.height??"12px");return{width:t.circle?i:s,height:i,borderRadius:t.circle?"50%":n(t.radius??"6px")}});return(s,i)=>(h(),b("span",{class:"va-skel",style:Le(o.value),"aria-hidden":"true"},null,4))}}),U0=Symbol("va-tool-call-group");function Jc(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t<10?t.toFixed(1):Math.round(t)}s`;const n=Math.floor(t/60);if(n<60)return`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`;const o=Math.floor(n/60);return o<24?`${o}h ${String(n%60).padStart(2,"0")}m`:`${Math.floor(o/24)}d ${o%24}h`}function Wt(e){if(!Number.isFinite(e)||e<0)return"0";if(e<1e3)return String(Math.round(e));if(e<1e6){const n=e/1e3;return`${n<100?n.toFixed(1).replace(/\.0$/,""):String(Math.round(n))}K`}const t=e/1e6;return t<100?t.toFixed(1).replace(/\.0$/,"")+"M":`${Math.round(t)}M`}function Kd(e){if(e==null)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function Da(e,t){const n=P(Date.now());let o;function s(){o!==void 0||typeof window>"u"||(n.value=Date.now(),o=window.setInterval(()=>n.value=Date.now(),e))}function i(){o!==void 0&&(window.clearInterval(o),o=void 0)}return Ee(t,r=>r?s():i(),{immediate:!0}),vt(i),n}function z0(e,t){const n=hi(U0,null),o=P(!1),s=P(!1),i=T(()=>e.open!==void 0?e.open:s.value?o.value:e.defaultOpen??!1);function r(R){s.value=!0,o.value=R,t(R)}const a=T(()=>e.status==="running"&&e.startedAt!=null),l=Da(200,a),c=P(void 0);Ee(a,R=>{R||(c.value=u.value||void 0)});const u=T(()=>e.startedAt!=null?Math.max(0,l.value-e.startedAt):0),d=T(()=>e.status==="running"?u.value:e.duration!=null?e.duration:c.value??0),_=T(()=>Jc(d.value)),v=P(!1);Ee(()=>e.status,(R,O)=>{!e.openOnError||s.value||(R==="error"&&O!=="error"&&!i.value?(r(!0),v.value=!0):O==="error"&&R!=="error"&&v.value&&(r(!1),v.value=!1))});function g(){r(!i.value)}const m=T(()=>Kd(e.args)),y=T(()=>e.status==="error"?"":Kd(e.result)),x=P({});function $(R){return R.length>400}const w=`va-tcl-${Math.random().toString(36).slice(2,8)}`,C=()=>({name:e.name,status:e.status,duration:e.status==="running"?void 0:e.duration??c.value,hasIcon:!0});return Ct(()=>{n?.register(C),e.status==="error"&&e.openOnError&&!i.value&&(r(!0),v.value=!0)}),vt(()=>{n?.unregister(C)}),{id:w,isOpen:i,timeLabel:_,timeMs:d,argsText:m,resultText:y,expanded:x,isLong:$,toggle:g}}const K0=["data-status"],W0=["id","aria-expanded"],V0=["data-status"],q0={key:0,class:"va-tcl__spin","aria-hidden":"true"},H0={class:"va-tcl__meta"},J0={class:"va-tcl__name"},G0={key:0,class:"va-tcl__summary"},Z0={class:"va-tcl__side"},Y0={class:"va-tcl__time"},X0={key:0,class:"va-tcl__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Q0={key:1,class:"va-tcl__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},eb=["aria-label"],tb={class:"va-tcl__inner"},nb={key:0,class:"va-tcl__error"},ob={class:"va-tcl__error-text"},sb={key:1,class:"va-tcl__sec"},ib={key:2,class:"va-tcl__sec"},rb=Ce({__name:"VaToolCallCard",props:{name:{},summary:{default:void 0},status:{},args:{default:void 0},result:{default:void 0},error:{default:void 0},startedAt:{default:void 0},duration:{default:void 0},maxCodeHeight:{default:220},openOnError:{type:Boolean,default:!0},defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["retry","update:open"],setup(e,{emit:t}){const n=e,o=t,{id:s,isOpen:i,timeLabel:r,argsText:a,resultText:l,expanded:c,isLong:u,toggle:d}=z0(n,_=>o("update:open",_));return(_,v)=>(h(),b("div",{class:ye(["va-tcl",[`va-tcl--${n.status}`,p(i)?"va-tcl--open":""]]),"data-status":n.status},[f("button",{id:p(s),class:"va-tcl__head",type:"button","aria-expanded":p(i),onClick:v[0]||(v[0]=(...g)=>p(d)&&p(d)(...g))},[f("span",{class:"va-tcl__tile","data-status":n.status},[Je(_.$slots,"icon",{},()=>[v[4]||(v[4]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M14.7 6.3a4.6 4.6 0 0 0-6.16 5.44L3.4 16.9a2 2 0 1 0 2.83 2.83l5.16-5.16a4.6 4.6 0 0 0 5.44-6.16l-2.6 2.6-2.3-.62-.62-2.3 2.6-2.6Z"})],-1))]),n.status==="running"?(h(),b("span",q0)):E("",!0)],8,V0),f("span",H0,[f("code",J0,A(n.name),1),n.summary?(h(),b("span",G0,A(n.summary),1)):E("",!0)]),f("span",Z0,[f("span",Y0,A(p(r)),1),n.status==="success"?(h(),b("svg",X0,[...v[5]||(v[5]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):n.status==="error"?(h(),b("svg",Q0,[...v[6]||(v[6]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):E("",!0),v[7]||(v[7]=f("svg",{class:"va-tcl__chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1))])],8,W0),f("div",{class:"va-tcl__body",role:"region","aria-label":`${n.name} 详情`},[f("div",tb,[n.error?(h(),b("div",nb,[f("span",ob,A(n.error),1),f("button",{class:"va-act va-act--sm va-act--danger va-tcl__retry",type:"button",onClick:v[1]||(v[1]=g=>o("retry"))},"↻ 重试")])):E("",!0),p(a)?(h(),b("section",sb,[v[8]||(v[8]=f("h4",{class:"va-tcl__sec-title"},"参数",-1)),f("pre",{class:ye(["va-tcl__code",{"va-tcl__code--capped":p(u)(p(a))&&!p(c).args}]),style:Le(p(c).args||!p(u)(p(a))?void 0:{maxHeight:`${n.maxCodeHeight}px`})},A(p(a)),7),p(u)(p(a))?(h(),b("button",{key:0,class:"va-tcl__more",type:"button",onClick:v[2]||(v[2]=g=>p(c).args=!p(c).args)},A(p(c).args?"收起":"显示全部"),1)):E("",!0)])):E("",!0),p(l)?(h(),b("section",ib,[v[9]||(v[9]=f("h4",{class:"va-tcl__sec-title"},"结果",-1)),f("pre",{class:ye(["va-tcl__code",{"va-tcl__code--capped":p(u)(p(l))&&!p(c).result}]),style:Le(p(c).result||!p(u)(p(l))?void 0:{maxHeight:`${n.maxCodeHeight}px`})},A(p(l)),7),p(u)(p(l))?(h(),b("button",{key:0,class:"va-tcl__more",type:"button",onClick:v[3]||(v[3]=g=>p(c).result=!p(c).result)},A(p(c).result?"收起":"显示全部"),1)):E("",!0)])):E("",!0)])],8,eb)],10,K0))}});function ab(e){const t=P({});Ee(()=>e.decisions,i=>{const r=new Set;for(const a of i)r.add(a.id),t.value[a.id]||(t.value[a.id]={open:!a.collapsed});for(const a of Object.keys(t.value))r.has(a)||delete t.value[a]},{immediate:!0,deep:!1});function n(i,r){const a=t.value[i.id];return!a||a.answered?!1:(a.answered=r,window.setTimeout(()=>{const l=t.value[i.id];l?.answered===r&&(l.gone=!0)},1e3),!0)}const o=T(()=>e.decisions.filter(i=>!t.value[i.id]?.gone)),s=T(()=>o.value.filter(i=>!t.value[i.id]?.answered));return{states:t,answer:n,visible:o,pending:s}}const lb=["data-empty"],cb={key:0,class:"va-dib__head",role:"status"},ub=["onClick"],db={class:"va-dib__fold-title"},fb={class:"va-dib__title"},pb={key:0,class:"va-dib__detail"},hb={key:1,class:"va-dib__confirm",role:"status"},vb={key:2,class:"va-dib__detail"},mb={key:3,class:"va-dib__actions"},_b=["onClick"],gb=["onClick"],bb=Ce({__name:"VaDecisionInbox",props:{decisions:{}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{states:s,answer:i,visible:r,pending:a}=ab(n);function l(c,u){i(c,u)&&o("decide",c,u)}return(c,u)=>(h(),b("div",{class:"va-dib","data-empty":!p(r).length||void 0},[p(r).length?(h(),b("p",cb,[u[0]||(u[0]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"})],-1)),pe(" "+A(p(a).length?`${p(a).length} 项待你拍板`:"全部已处理"),1)])):(h(),ce(Ds,{key:1,name:"va-dib-fade",tag:"div"},{default:we(()=>[...u[1]||(u[1]=[f("p",{key:"empty",class:"va-dib__empty va-fade-in"},"收件箱清空了,去忙别的吧。",-1)])]),_:1})),j(Ds,{name:"va-dib",tag:"div",class:"va-dib__list"},{default:we(()=>[(h(!0),b(G,null,me(p(r),d=>(h(),b("article",{key:d.id,class:ye(["va-dib__item",{"va-dib__item--folded":!p(s)[d.id]?.open,"va-dib__item--answered":p(s)[d.id]?.answered}])},[!p(s)[d.id]?.open&&!p(s)[d.id]?.answered?(h(),b("button",{key:0,class:"va-dib__fold",type:"button",onClick:_=>p(s)[d.id].open=!0},[f("span",db,A(d.title),1),u[2]||(u[2]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1))],8,ub)):(h(),b(G,{key:1},[f("h4",fb,A(d.title),1),d.detail?(h(),b("p",pb,A(d.detail),1)):E("",!0),p(s)[d.id]?.answered?(h(),b("div",hb,[u[3]||(u[3]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"M5.5 12.5l4 4L18.5 8"})],-1)),pe(" 已选择「"+A(p(s)[d.id]?.answered==="primary"?d.primary??"":d.secondary??"")+"」 ",1)])):!d.primary&&!d.secondary&&d.detail?(h(),b("p",vb,A(d.detail),1)):d.primary||d.secondary?(h(),b("div",mb,[d.primary?(h(),b("button",{key:0,class:"va-act va-act--ink va-dib__btn",type:"button",onClick:_=>l(d,"primary")},A(d.primary),9,_b)):E("",!0),d.secondary?(h(),b("button",{key:1,class:"va-act va-dib__btn",type:"button",onClick:_=>l(d,"secondary")},A(d.secondary),9,gb)):E("",!0)])):E("",!0)],64))],2))),128))]),_:1})],8,lb))}});function yb(e,t,n){const o=P(e.value);let s,i=0,r=0;function a(){s!==void 0&&(window.clearInterval(s),s=void 0)}function l(){a(),!(typeof window>"u")&&(o.value=e.value,!(o.value<=0)&&(i=Date.now()+o.value*1e3,r=Date.now(),s=window.setInterval(()=>{const c=Date.now();if(t.value){i+=c-r,r=c;return}r=c,o.value=Math.max(0,(i-c)/1e3),o.value<=0&&(a(),n())},100)))}return vt(a),{remaining:o,start:l,stop:a}}function kb(e,t){const n=e.status==="approved"||e.status==="denied"?e.status:null,o=e.reason&&e.reason.toLowerCase().includes("timeout")?"timeout":void 0,s=P(n),i=P(o),r=P(!1),a=P(e.defaultCollapsed??!!n);Ee(()=>e.status,w=>{w==="approved"||w==="denied"?(s.value=w,w==="denied"&&e.reason?.toLowerCase().includes("timeout")&&(i.value="timeout"),a.value=!0,d()):w==="pending"&&(s.value=null,a.value=!1,u())});const l=T(()=>s.value?0:e.countdown??0),{remaining:c,start:u,stop:d}=yb(l,r,()=>g("denied","timeout")),_=T(()=>({low:"低风险",medium:"中风险",high:"高风险"})[e.risk??"medium"]),v=T(()=>l.value>0?c.value/l.value*100:0);function g(w,C){s.value||(s.value=w,i.value=C,d(),a.value=!0,w==="approved"?t.approve():t.deny(C))}function m(){g("approved")}function y(){g("denied","manual")}function x(){a.value=!a.value}function $(w){if(s.value)return;const C=w.target?.closest?.("button")!=null;w.key==="Enter"&&!C?(w.preventDefault(),e.approveShortcut?m():y()):w.key==="Escape"&&(w.preventDefault(),y())}return n||u(),{result:s,denyReason:i,paused:r,remaining:c,percent:v,riskLabel:_,isCollapsed:a,toggleCollapse:x,onApprove:m,onDeny:y,onKeydown:$}}const wb=["aria-label","aria-describedby"],xb={key:0,class:"va-acd__count","aria-hidden":"true"},$b=["data-risk"],Cb={class:"va-acd__title"},Ab={key:0,class:"va-acd__timer",role:"timer","aria-live":"off"},Sb={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true"},Rb={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Eb=["title"],Db={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Tb={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Ib={class:"va-acd__main"},Fb=["id"],Mb={key:1,class:"va-acd__preview"},Ob={key:2,class:"va-acd__actions"},Pb={key:0,class:"va-acd__kbd-hint"},Lb={key:3,class:"va-acd__done",role:"status"},Bb={key:0,class:"va-acd__done-detail"},jb=Ce({__name:"VaApprovalCard",props:{title:{},detail:{default:void 0},risk:{default:"medium"},preview:{default:void 0},confirmLabel:{default:"批准"},denyLabel:{default:"拒绝"},countdown:{default:void 0},shortcuts:{type:Boolean,default:!0},approveShortcut:{type:Boolean,default:!1},status:{default:void 0},reason:{default:void 0},collapsible:{type:Boolean,default:!0},defaultCollapsed:{type:Boolean,default:void 0}},emits:["approve","deny"],setup(e,{emit:t}){const n=e,o=t,{result:s,denyReason:i,paused:r,percent:a,remaining:l,riskLabel:c,isCollapsed:u,toggleCollapse:d,onApprove:_,onDeny:v,onKeydown:g}=kb(n,{approve:()=>o("approve"),deny:w=>o("deny",w)}),m=P(null),y=Ji();Ct(()=>{s.value||m.value?.focus()});function x(w){w.target!==m.value&&(r.value=!0)}function $(w){w.relatedTarget&&m.value?.contains(w.relatedTarget)||(r.value=!1)}return(w,C)=>(h(),b("div",{ref_key:"rootEl",ref:m,class:ye(["va-acd",[`va-acd--${n.risk}`,p(s)?`va-acd--${p(s)}`:"",p(u)?"va-acd--collapsed":""]]),tabindex:"-1",role:"alertdialog","aria-modal":"true","aria-label":n.title,"aria-describedby":n.detail?p(y):void 0,onKeydown:C[4]||(C[4]=(...R)=>p(g)&&p(g)(...R)),onPointerenter:C[5]||(C[5]=R=>r.value=!0),onPointerleave:C[6]||(C[6]=R=>r.value=!1),onFocusin:x,onFocusout:$},[n.countdown&&!p(s)&&!p(u)?(h(),b("div",xb,[f("span",{class:"va-acd__count-fill",style:Le({width:`${p(a)}%`})},null,4)])):E("",!0),f("header",{class:ye(["va-acd__head",{"va-acd__head--clickable":n.collapsible!==!1}]),onClick:C[1]||(C[1]=R=>n.collapsible!==!1?p(d)():null)},[f("span",{class:"va-acd__risk","data-risk":n.risk},A(p(c)),9,$b),f("h3",Cb,A(n.title),1),n.countdown&&!p(s)?(h(),b("span",Ab,A(Math.ceil(p(l)))+"s 后自动拒绝 ",1)):p(s)?(h(),b("span",{key:1,class:ye(["va-acd__status-badge",`va-acd__status-badge--${p(s)}`])},[p(s)==="approved"?(h(),b("svg",Sb,[...C[7]||(C[7]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):(h(),b("svg",Rb,[...C[8]||(C[8]=[f("path",{d:"m7.5 7.5 9 9m0-9-9 9"},null,-1)])])),f("span",null,A(p(s)==="approved"?"已批准":p(i)==="timeout"?"超时已拒":"已拒绝"),1)],2)):E("",!0),n.collapsible!==!1?(h(),b("button",{key:2,class:"va-acd__collapse-btn",type:"button",title:p(u)?"展开详情":"收起卡片",onClick:C[0]||(C[0]=Fe((...R)=>p(d)&&p(d)(...R),["stop"]))},[p(u)?(h(),b("svg",Db,[...C[9]||(C[9]=[f("polyline",{points:"6 9 12 15 18 9"},null,-1)])])):(h(),b("svg",Tb,[...C[10]||(C[10]=[f("polyline",{points:"18 15 12 9 6 15"},null,-1)])]))],8,Eb)):E("",!0)],2),Ve(f("div",Ib,[n.detail?(h(),b("p",{key:0,id:p(y),class:"va-acd__detail"},A(n.detail),9,Fb)):E("",!0),n.preview?(h(),b("pre",Mb,A(n.preview),1)):E("",!0),p(s)?(h(),b("div",Lb,[f("span",null,A(p(s)==="approved"?"已批准执行该操作":p(i)==="timeout"?"超时未响应,已自动拒绝":"已拒绝执行该操作"),1),n.detail?(h(),b("span",Bb,A(n.detail),1)):E("",!0)])):(h(),b("div",Ob,[f("button",{class:"va-act va-acd__btn",type:"button",onClick:C[2]||(C[2]=Fe((...R)=>p(v)&&p(v)(...R),["stop"]))},A(n.denyLabel),1),f("button",{class:"va-act va-act--ink va-acd__btn",type:"button",onClick:C[3]||(C[3]=Fe((...R)=>p(_)&&p(_)(...R),["stop"]))},A(n.confirmLabel),1),n.shortcuts&&!p(s)?(h(),b("span",Pb,[n.approveShortcut?(h(),b(G,{key:0},[C[11]||(C[11]=f("kbd",null,"Enter",-1)),C[12]||(C[12]=pe(" 批准 · ",-1)),C[13]||(C[13]=f("kbd",null,"Esc",-1)),C[14]||(C[14]=pe(" 拒绝",-1))],64)):(h(),b(G,{key:1},[C[15]||(C[15]=f("kbd",null,"Enter / Esc",-1)),C[16]||(C[16]=pe(" 拒绝",-1))],64))])):E("",!0)]))],512),[[ic,!p(u)]])],42,wb))}}),Nb=["aria-label"],Ub={class:"va-chart-header"},zb={class:"va-chart-title"},Kb={class:"va-chart-summary"},Wb={class:"va-chart-max-val"},Vb={key:0,class:"va-chart-unit"},qb={class:"va-bar-container"},Hb={class:"va-bar-tooltip"},Jb={class:"va-bar-labels"},Gb=["title"],Zb={class:"va-line-container"},Yb={class:"va-line-svg",viewBox:"0 0 300 100",preserveAspectRatio:"none"},Xb=["d"],Qb=["points"],ey=["cx","cy"],ty={class:"va-bar-labels"},ny=["title"],Wd=Ce({__name:"VaMetricChart",props:{title:{},chartType:{default:"bar"},unit:{default:""},series:{default:()=>[]}},setup(e){const t=e,n=T(()=>{if(t.series.length===0)return 1;const a=Math.max(...t.series.map(l=>l.value));return a>0?a:1}),o=T(()=>t.series.length===0?0:t.series[t.series.length-1].value),s=T(()=>{const a=t.series.length;if(a<2)return[];const l=300,c=90,u=10,d=8,_=l-u*2,v=c-d*2;return t.series.map((g,m)=>{const y=u+m/(a-1)*_,x=c-d-g.value/n.value*v;return{x:y,y:x,...g}})}),i=T(()=>s.value.map(a=>`${a.x.toFixed(1)},${a.y.toFixed(1)}`).join(" ")),r=T(()=>{const a=s.value;if(a.length<2)return"";const l=a[0],c=a[a.length-1];return`M ${l.x},90 L ${i.value} L ${c.x},90 Z`});return(a,l)=>(h(),b("div",{class:"va-metric-chart",role:"region","aria-label":e.title},[f("header",Ub,[f("h4",zb,A(e.title),1),f("div",Kb,[f("span",Wb,A(o.value),1),e.unit?(h(),b("span",Vb,A(e.unit),1)):E("",!0)])]),e.chartType==="bar"?(h(),b(G,{key:0},[f("div",qb,[(h(!0),b(G,null,me(e.series,(c,u)=>(h(),b("div",{key:u,class:"va-bar-col"},[f("div",Hb,A(c.value)+A(e.unit),1),f("div",{class:"va-bar-pill",style:Le({height:`${Math.max(4,c.value/n.value*100)}%`})},null,4)]))),128))]),f("div",Jb,[(h(!0),b(G,null,me(e.series,(c,u)=>(h(),b("span",{key:u,class:"va-bar-label",title:c.label},A(c.label),9,Gb))),128))])],64)):e.chartType==="line"?(h(),b(G,{key:1},[f("div",Zb,[(h(),b("svg",Yb,[l[0]||(l[0]=f("defs",null,[f("linearGradient",{id:"va-line-gradient",x1:"0",y1:"0",x2:"0",y2:"1"},[f("stop",{offset:"0%","stop-color":"var(--va-accent, #c2410c)"}),f("stop",{offset:"100%","stop-color":"transparent"})])],-1)),f("path",{d:r.value,class:"va-line-area"},null,8,Xb),f("polyline",{points:i.value,class:"va-line-path"},null,8,Qb),(h(!0),b(G,null,me(s.value,(c,u)=>(h(),b("circle",{key:u,cx:c.x,cy:c.y,r:"3",class:"va-line-dot"},[f("title",null,A(c.label)+": "+A(c.value)+A(e.unit),1)],8,ey))),128))]))]),f("div",ty,[(h(!0),b(G,null,me(e.series,(c,u)=>(h(),b("span",{key:u,class:"va-bar-label",title:c.label},A(c.label),9,ny))),128))])],64)):E("",!0)],8,Nb))}});function oy(e,t){const n=T(()=>e.steps.some(x=>x.status==="running")),o=Da(500,n);function s(x){if(x.status==="running")return x.startedAt!=null?o.value-x.startedAt:void 0;if(x.status==="done")return x.duration}const i=T(()=>e.steps.filter(x=>x.status==="done").length),r=T(()=>e.steps.some(x=>x.status==="error"));let a=0;const l=P(null),c=P(""),u=P("");function d(x){t["update:steps"](x)}function _(x){l.value=x.id,c.value=x.title}function v(x){const $=c.value.trim();l.value=null,!(!$||$===x.title)&&d(e.steps.map(w=>w.id===x.id?{...w,title:$}:w))}function g(x,$){const w=x+$;if(w<0||w>=e.steps.length)return;const C=[...e.steps],[R]=C.splice(x,1);C.splice(w,0,R),d(C)}function m(x){d(e.steps.filter($=>$.id!==x.id))}function y(){const x=u.value.trim();x&&(d([...e.steps,{id:`step-${Date.now()}-${a++}`,title:x}]),u.value="")}return{now:o,elapsedOf:s,doneCount:i,anyError:r,editingId:l,draft:c,addDraft:u,startRename:_,rename:v,move:g,remove:m,add:y}}const sy={class:"va-plan__head"},iy={class:"va-plan__title"},ry=["data-error"],ay={key:1,class:"va-plan__progress"},ly=["data-status"],cy={key:0,class:"va-plan__edit-row"},uy={class:"va-plan__idx"},dy=["onKeydown","onBlur"],fy=["onClick"],py={class:"va-plan__ops"},hy=["disabled","onClick"],vy=["disabled","onClick"],my=["onClick"],_y={class:"va-plan__node","aria-hidden":"true"},gy={key:0,class:"va-plan__spin"},by={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},yy={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},ky={key:3,class:"va-plan__dot"},wy={class:"va-plan__body"},xy=["data-done"],$y={key:0,class:"va-plan__step-detail"},Cy={class:"va-plan__side"},Ay={key:0,class:"va-plan__time"},Sy=["onClick"],Ry={key:0,class:"va-plan__add"},Ey=["disabled"],Dy={key:1,class:"va-plan__collab"},Ty={key:0,class:"va-plan__errors",role:"alert"},Iy={class:"va-plan__collab-actions"},Fy=["disabled"],My=["disabled"],Oy=Ce({__name:"VaAgentPlan",props:{steps:{},editable:{type:Boolean,default:!1},title:{default:"执行计划"},collaborative:{type:Boolean},disabled:{type:Boolean},fieldErrors:{}},emits:["update:steps","retry","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{elapsedOf:s,doneCount:i,anyError:r,editingId:a,draft:l,addDraft:c,startRename:u,rename:d,move:_,remove:v,add:g}=oy(n,{"update:steps":x=>o("update:steps",x)}),m=T(()=>x=>{const $=s(x);return $===void 0?void 0:Jc($)}),y=T(()=>Object.entries(n.fieldErrors??{}).map(([x,$])=>`${x}:${$}`));return(x,$)=>(h(),b("div",{class:ye(["va-plan",n.editable?"va-plan--edit":""])},[f("header",sy,[f("h4",iy,A(n.title),1),!n.editable&&n.steps.length?(h(),b("span",{key:0,class:"va-plan__progress","data-error":p(r)||void 0},[pe(A(p(i))+"/"+A(n.steps.length)+" 步 ",1),p(r)?(h(),b(G,{key:0},[pe(" · 有失败")],64)):E("",!0)],8,ry)):n.editable?(h(),b("span",ay,"可调整后交给 agent 执行")):E("",!0)]),j(Ds,{tag:"ol",class:"va-plan__list",name:"va-plan"},{default:we(()=>[(h(!0),b(G,null,me(n.steps,(w,C)=>(h(),b("li",{key:w.id,class:"va-plan__item","data-status":w.status??"pending"},[n.editable?(h(),b("div",cy,[f("span",uy,A(C+1),1),p(a)===w.id?Ve((h(),b("input",{key:0,"onUpdate:modelValue":$[0]||($[0]=R=>ut(l)?l.value=R:null),class:"va-plan__input",type:"text",autofocus:"",onKeydown:[xt(R=>p(d)(w),["enter"]),$[1]||($[1]=xt(R=>a.value=null,["esc"]))],onBlur:R=>p(d)(w)},null,40,dy)),[[st,p(l)]]):(h(),b("button",{key:1,class:"va-plan__rename",type:"button",title:"点击重命名",onClick:R=>p(u)(w)},A(w.title),9,fy)),f("span",py,[f("button",{class:"va-act va-act--ghost va-plan__op",type:"button","aria-label":"上移",disabled:C===0,onClick:R=>p(_)(C,-1)},"↑",8,hy),f("button",{class:"va-act va-act--ghost va-plan__op",type:"button","aria-label":"下移",disabled:C===n.steps.length-1,onClick:R=>p(_)(C,1)},"↓",8,vy),f("button",{class:"va-act va-act--ghost va-plan__op va-plan__op--danger",type:"button","aria-label":"删除步骤",onClick:R=>p(v)(w)},"✕",8,my)])])):(h(),b(G,{key:1},[f("span",_y,[w.status==="running"?(h(),b("span",gy)):w.status==="done"?(h(),b("svg",by,[...$[7]||($[7]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):w.status==="error"?(h(),b("svg",yy,[...$[8]||($[8]=[f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):(h(),b("span",ky))]),f("div",wy,[f("span",{class:"va-plan__step-title","data-done":w.status==="done"||void 0},A(w.title),9,xy),w.detail?(h(),b("span",$y,A(w.detail),1)):E("",!0)]),f("div",Cy,[m.value(w)!==void 0?(h(),b("span",Ay,A(m.value(w)),1)):E("",!0),w.status==="error"?(h(),b("button",{key:1,class:"va-act va-act--sm va-act--danger va-plan__retry",type:"button",onClick:R=>o("retry",w)},"↻ 重试",8,Sy)):E("",!0)])],64))],8,ly))),128))]),_:1}),n.editable?(h(),b("div",Ry,[Ve(f("input",{"onUpdate:modelValue":$[2]||($[2]=w=>ut(c)?c.value=w:null),class:"va-plan__input",type:"text",placeholder:"添加步骤…",onKeydown:$[3]||($[3]=xt((...w)=>p(g)&&p(g)(...w),["enter"]))},null,544),[[st,p(c)]]),f("button",{class:"va-plan__add-btn",type:"button",disabled:!p(c).trim(),onClick:$[4]||($[4]=(...w)=>p(g)&&p(g)(...w))},"+ 添加",8,Ey)])):E("",!0),n.collaborative?(h(),b("footer",Dy,[y.value.length?(h(),b("div",Ty,[(h(!0),b(G,null,me(y.value,w=>(h(),b("span",{key:w,class:"va-plan__error"},A(w),1))),128))])):E("",!0),f("div",Iy,[f("button",{class:"va-plan__confirm",type:"button",disabled:n.disabled,onClick:$[5]||($[5]=w=>o("confirm"))},"确认计划",8,Fy),f("button",{class:"va-plan__giveup",type:"button",disabled:n.disabled,onClick:$[6]||($[6]=w=>o("cancel"))},"放弃",8,My)])])):E("",!0)],2))}}),ac={system:"系统提示",file:"文件",history:"对话历史",tools:"工具结果"};function Py(e){const t=T(()=>e.parts.reduce((l,c)=>l+c.tokens,0)),n=T(()=>Math.max(e.capacity,t.value,1)),o=T(()=>Math.min(100,t.value/e.capacity*100)),s=T(()=>e.parts.some(l=>l.kind==="history"));function i(l){return e.compacting&&l.kind==="history"}function r(l){return i(l)?"0%":`${Math.max(l.tokens/n.value*100,2)}%`}const a=T(()=>{const l=Object.keys(ac),c=new Set(e.parts.map(u=>u.kind));return l.filter(u=>c.has(u))});return{used:t,scale:n,percent:o,hasHistory:s,shrinking:i,widthOf:r,legendKinds:a}}const Ly=["aria-label"],By={class:"va-ctx__head"},jy={class:"va-ctx__used"},Ny={class:"va-ctx__pct"},Uy=["disabled"],zy={class:"va-ctx__bar","aria-hidden":"true"},Ky=["data-kind","data-shrink"],Wy=["aria-label","onClick","onKeydown"],Vy={class:"va-ctx__tip"},qy={class:"va-ctx__legend"},Hy=["data-kind"],Vd=Ce({__name:"VaContextWindow",props:{parts:{},capacity:{},compacting:{type:Boolean,default:!1},removable:{type:Boolean,default:!0}},emits:["remove","compact"],setup(e,{emit:t}){const n=e,o=t,{used:s,percent:i,hasHistory:r,shrinking:a,widthOf:l,legendKinds:c}=Py(n);return(u,d)=>(h(),b("div",{class:ye(["va-ctx",{"va-ctx--compacting":n.compacting}]),role:"img","aria-label":`上下文已用 ${p(Wt)(p(s))} / ${p(Wt)(n.capacity)}`},[f("header",By,[f("span",jy,[f("strong",null,A(p(Wt)(p(s))),1),pe(" / "+A(p(Wt)(n.capacity)),1)]),f("span",Ny,A(Math.round(p(i)))+"%",1),f("button",{class:"va-act va-act--sm va-ctx__compact",type:"button",disabled:n.compacting||!p(r),onClick:d[0]||(d[0]=_=>o("compact"))},A(n.compacting?"压缩中…":"压缩对话"),9,Uy)]),f("div",zy,[(h(!0),b(G,null,me(n.parts,_=>(h(),b("div",{key:_.id,class:"va-ctx__cell","data-kind":_.kind,"data-shrink":p(a)(_)||void 0,style:Le({width:p(l)(_)}),tabindex:"0"},[n.removable&&_.kind==="file"?(h(),b("button",{key:0,class:"va-ctx__remove",type:"button","aria-label":`移除 ${_.label}`,onClick:Fe(v=>o("remove",_),["stop"]),onKeydown:xt(Fe(v=>o("remove",_),["stop"]),["enter"])},"×",40,Wy)):E("",!0),f("span",Vy,[f("strong",null,A(_.label),1),f("em",null,A(p(ac)[_.kind])+" · "+A(p(Wt)(_.tokens))+" tokens",1)])],12,Ky))),128))]),f("footer",qy,[(h(!0),b(G,null,me(p(c),_=>(h(),b("span",{key:_,class:"va-ctx__legend-item"},[f("i",{"data-kind":_},null,8,Hy),pe(A(p(ac)[_]),1)]))),128))])],10,Ly))}}),Jy=/([\u4e00-\u9fff\u3400-\u4dbf\u3040-\u30ff\uac00-\ud7af])|([A-Za-z0-9][A-Za-z0-9'_-]*)|(\s+)|([\s\S])/g;function qd(e){const t=[];let n=!1;for(const o of e.matchAll(Jy)){if(o[3]!==void 0){n=!0;continue}t.push({t:o[0],sp:n&&t.length>0}),n=!1}return t}const Gy=1e6;function Zy(e,t){const n=qd(e),o=qd(t),s=n.length,i=o.length;if(s*i>Gy){const u=[];for(const d of n)u.push({type:"del",t:d.t,sp:d.sp});for(const d of o)u.push({type:"add",t:d.t,sp:d.sp});return u}const r=Array.from({length:s+1},()=>new Uint32Array(i+1));for(let u=s-1;u>=0;u--)for(let d=i-1;d>=0;d--)r[u][d]=n[u].t===o[d].t?r[u+1][d+1]+1:Math.max(r[u+1][d],r[u][d+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l].t===o[c].t?(a.push({type:"same",t:n[l].t,sp:n[l].sp}),l++,c++):r[l+1][c]>=r[l][c+1]?(a.push({type:"del",t:n[l].t,sp:n[l].sp}),l++):(a.push({type:"add",t:o[c].t,sp:o[c].sp}),c++);for(;l<s;)a.push({type:"del",t:n[l].t,sp:n[l].sp}),l++;for(;c<i;)a.push({type:"add",t:o[c].t,sp:o[c].sp}),c++;return a}const Yy=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Hd=e=>e==="";const Xy=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();const Jd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Qy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());const ek=e=>{const t=Qy(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ni={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const tk=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":o,strokeWidth:s,"stroke-width":i,size:r=ni.width,color:a=ni.stroke,...l},{slots:c})=>pn("svg",{...ni,...l,width:r,height:r,stroke:a,"stroke-width":Hd(n)||Hd(o)||n===!0||o===!0?Number(s||i||ni["stroke-width"])*24/Number(r):s||i||ni["stroke-width"],class:Xy("lucide",l.class,...e?[`lucide-${Jd(ek(e))}-icon`,`lucide-${Jd(e)}`]:["lucide-icon"]),...!c.default&&!Yy(l)&&{"aria-hidden":"true"}},[...t.map(u=>pn(...u)),...c.default?[c.default()]:[]]);const tt=(e,t)=>(n,{slots:o,attrs:s})=>pn(tk,{...s,...n,iconNode:t,name:e},o);const nk=tt("archive-restore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);const Gd=tt("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const ok=tt("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]);const gi=tt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const os=tt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Zd=tt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const sk=tt("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ik=tt("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const rk=tt("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);const ak=tt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Jh=tt("folder-closed",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]]);const lk=tt("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const ck=tt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const uk=tt("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);const lc=tt("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const Yd=tt("pin-off",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);const Cr=tt("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);const Lr=tt("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const dk=tt("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);const Gh=tt("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const fk=tt("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const pk=tt("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);const Ar=tt("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const hk=tt("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);const Ro=tt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Zh=tt("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),vk={class:"va-queuedock__tag"},mk=["onKeydown"],_k=["onClick"],gk=["title"],bk=["aria-label","disabled","onClick"],yk=["disabled","onClick"],kk=["disabled","onClick"],wk=Ce({__name:"VaQueueDock",props:{items:{},disabled:{type:Boolean,default:!1}},emits:["remove","sendNow","edit"],setup(e,{emit:t}){const n=e,o=t,s=P(null),i=P(""),r=rt("input");function a(u,d){n.disabled||(s.value=u,i.value=d,it(()=>r.value?.focus()))}function l(u){const d=i.value.trim();d&&d!==n.items[u]?.text&&o("edit",u,d),s.value=null}function c(){s.value=null}return(u,d)=>(h(),ce(Ds,{tag:"div",class:"va-queuedock",role:"list","aria-label":"排队消息","enter-active-class":"va-enter-up","leave-active-class":"va-exit-left","move-class":"va-queuedock-move"},{default:we(()=>[(h(!0),b(G,null,me(n.items,(_,v)=>(h(),b("div",{key:_.id,class:"va-queuedock__row",role:"listitem"},[f("span",vk,"排队 "+A(v+1),1),s.value===v?(h(),b(G,{key:0},[Ve(f("input",{ref_for:!0,ref:"input","onUpdate:modelValue":d[0]||(d[0]=g=>i.value=g),class:"va-queuedock__input",type:"text",maxlength:"2000",onKeydown:[xt(Fe(g=>l(v),["prevent"]),["enter"]),xt(Fe(c,["prevent"]),["escape"])]},null,40,mk),[[st,i.value]]),f("button",{class:"va-queuedock__op",type:"button","aria-label":"确认编辑",onClick:g=>l(v)},[j(p(gi),{size:13})],8,_k),f("button",{class:"va-queuedock__op",type:"button","aria-label":"取消编辑",onClick:c},[j(p(Ro),{size:13})])],64)):(h(),b(G,{key:1},[f("span",{class:"va-queuedock__text",title:_.text},A(_.text),9,gk),f("button",{class:"va-queuedock__op",type:"button","aria-label":`插队:立即发送第 ${v+1} 条`,title:"插队:run 结束后立即下发",disabled:n.disabled,onClick:g=>o("sendNow",v)},[j(p(Zh),{size:13})],8,bk),f("button",{class:"va-queuedock__op",type:"button","aria-label":"编辑",disabled:n.disabled,onClick:g=>a(v,_.text)},[j(p(lc),{size:12})],8,yk),f("button",{class:"va-queuedock__op",type:"button","aria-label":"移除排队",disabled:n.disabled,onClick:g=>o("remove",v)},[j(p(Ro),{size:13})],8,kk)],64))]))),128))]),_:1}))}});function xk(e,t,n,o){const s=P(!1);async function i(){const c=n.value;if(!c)return;c.style.height="auto",await it();const u=e.maxHeight??160;c.style.height=`${Math.min(c.scrollHeight,u)}px`}function r(c){t.value=c.target.value,i()}function a(){const c=t.value.trim();e.disabled||!e.allowEmpty&&!c||(o.send(c),t.value="",i())}function l(c){c.key!=="Enter"||c.shiftKey||s.value||(c.preventDefault(),a())}return Ct(()=>{t.value&&i()}),{composing:s,onInput:r,submit:a,onKeydown:l}}const $k=[{id:"claude",name:"Claude",tag:"推荐"},{id:"gpt",name:"GPT"},{id:"gemini",name:"Gemini"},{id:"deepseek",name:"DeepSeek"},{id:"qwen",name:"Qwen"}];function Ck(e,t,n){const o=T(()=>e.models?.length?e.models:$k),s=P(!1),i=P(0),r=T(()=>o.value.find(g=>g.id===t.value)??o.value[0]);function a(g){const m=n.value;m&&!m.contains(g.target)&&c()}function l(){s.value=!0,i.value=Math.max(0,o.value.findIndex(g=>g.id===t.value)),typeof document<"u"&&document.addEventListener("pointerdown",a,!0)}function c(){s.value=!1,typeof document<"u"&&document.removeEventListener("pointerdown",a,!0)}function u(){s.value?c():l()}function d(g){g.detail!==0&&u()}function _(g){t.value=g.id,c()}function v(g){if(g.key==="Escape"){g.preventDefault(),c();return}if(s.value){if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();const m=g.key==="ArrowDown"?1:-1;i.value=(i.value+m+o.value.length)%o.value.length}else if(g.key==="Enter"){g.preventDefault();const m=o.value[i.value];m&&_(m)}}}return Ct(()=>{o.value.some(g=>g.id===t.value)||(t.value=o.value[0]?.id??"")}),vt(c),{models:o,open:s,activeIdx:i,current:r,toggle:u,onTriggerClick:d,closeMenu:c,pick:_,onKeydown:v}}const Ak=["aria-expanded","aria-label"],Sk={class:"va-mpk__group-header"},Rk={class:"va-mpk__group-title"},Ek={class:"va-mpk__group-count"},Dk=["aria-label"],Tk=["aria-selected","onMouseenter","onClick"],Ik={class:"va-mpk__check","aria-hidden":"true"},Fk={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},Mk=["title"],Ok=["title"],Pk={key:1,class:"va-mpk__list",role:"listbox"},Lk=["aria-selected","onMouseenter","onClick"],Bk={class:"va-mpk__check","aria-hidden":"true"},jk={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},Nk=["title"],Uk=["title"],zk=Ce({__name:"VaModelPicker",props:Ss({models:{default:void 0},align:{default:"left"},ariaLabel:{default:"选择模型"}},{selected:{default:""},selectedModifiers:{}}),emits:["update:selected"],setup(e){const t=e,n=Ca(e,"selected"),o=rt("root"),{models:s,open:i,activeIdx:r,current:a,onTriggerClick:l,pick:c,onKeydown:u}=Ck(t,n,o),d=T(()=>{const g=[],m=new Map;return s.value.forEach((y,x)=>{let $=(y.provider||"").trim();!$&&y.tag&&y.tag.includes("·")&&($=y.tag.split("·")[0].trim());const w=$||"默认";let C=m.get(w);C||(C={provider:w,items:[]},m.set(w,C),g.push(C)),C.items.push({model:y,flatIndex:x})}),g}),_=T(()=>d.value.length>1||d.value.length===1&&d.value[0].provider!=="默认");function v(g,m){const y=g.model||(m&&g.tag?.includes("·")?g.tag.split("·").slice(1).join("·").trim():g.tag)||"";return y===g.name?"":y}return(g,m)=>(h(),b("div",{ref_key:"root",ref:o,class:"va-mpk",onKeydown:m[1]||(m[1]=(...y)=>p(u)&&p(u)(...y))},[Je(g.$slots,"trigger",{current:p(a),open:p(i),toggle:p(l)},()=>[f("button",{class:"va-mpk__btn",type:"button","aria-expanded":p(i),"aria-label":t.ariaLabel,onClick:m[0]||(m[0]=(...y)=>p(l)&&p(l)(...y))},[pe(A(p(a)?.name??"选择模型")+" ",1),m[2]||(m[2]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m7 9.5 5 5 5-5"})],-1))],8,Ak)]),j(ts,{name:"va-mpk"},{default:we(()=>[p(i)?(h(),b("div",{key:0,class:ye(["va-mpk__menu",`va-mpk__menu--${t.align}`]),role:"listbox"},[_.value?(h(!0),b(G,{key:0},me(d.value,y=>(h(),b("div",{key:y.provider,class:"va-mpk__group"},[f("div",Sk,[f("span",Rk,A(y.provider),1),f("span",Ek,A(y.items.length),1)]),f("ul",{class:"va-mpk__list",role:"group","aria-label":y.provider},[(h(!0),b(G,null,me(y.items,x=>(h(),b("li",{key:x.model.id},[f("button",{class:ye(["va-mpk__item",{"va-mpk__item--active":x.flatIndex===p(r),"va-mpk__item--selected":x.model.id===n.value}]),type:"button",role:"option","aria-selected":x.model.id===n.value,onMouseenter:$=>r.value=x.flatIndex,onClick:$=>p(c)(x.model)},[f("span",Ik,[x.model.id===n.value?(h(),b("svg",Fk,[...m[3]||(m[3]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):E("",!0)]),f("span",{class:"va-mpk__name",title:x.model.name},A(x.model.name),9,Mk),v(x.model,!0)?(h(),b("span",{key:0,class:"va-mpk__tag",title:x.model.tag||x.model.model},A(v(x.model,!0)),9,Ok)):E("",!0)],42,Tk)]))),128))],8,Dk)]))),128)):(h(),b("ul",Pk,[(h(!0),b(G,null,me(p(s),(y,x)=>(h(),b("li",{key:y.id},[f("button",{class:ye(["va-mpk__item",{"va-mpk__item--active":x===p(r),"va-mpk__item--selected":y.id===n.value}]),type:"button",role:"option","aria-selected":y.id===n.value,onMouseenter:$=>r.value=x,onClick:$=>p(c)(y)},[f("span",Bk,[y.id===n.value?(h(),b("svg",jk,[...m[4]||(m[4]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):E("",!0)]),f("span",{class:"va-mpk__name",title:y.name},A(y.name),9,Nk),v(y,!1)?(h(),b("span",{key:0,class:"va-mpk__tag",title:y.tag||y.model},A(v(y,!1)),9,Uk)):E("",!0)],42,Lk)]))),128))]))],2)):E("",!0)]),_:1})],544))}}),Kk={key:0,class:"va-cmp__atts"},Wk=["src"],Vk=["title"],qk={key:2,class:"va-cmp__att-size"},Hk=["aria-label","onClick"],Jk={key:1,class:"va-cmp__prefix"},Gk={class:"va-cmp__input-wrap"},Zk=["innerHTML"],Yk=["value","placeholder","disabled"],Xk={class:"va-cmp__foot"},Qk={class:"va-cmp__actions"},e2=["aria-expanded","aria-label","disabled","onClick"],t2={class:"va-cmp__seat-label"},n2={key:1,class:"va-cmp__seat-wrap"},o2=["aria-label","disabled"],s2={class:"va-cmp__seat-label"},i2={key:0,class:"va-cmp__menu",role:"menu","aria-label":"权限预设"},r2=["data-active","onClick"],a2={key:1,class:"va-cmp__menu-gap","aria-hidden":"true"},l2={class:"va-cmp__menu-col"},c2={class:"va-cmp__menu-name"},u2={key:0,class:"va-cmp__menu-desc"},d2=["disabled"],f2={key:3,class:"va-cmp__trailing"},p2=["disabled"],Xd=Ce({__name:"VaComposer",props:Ss({placeholder:{default:"给 agent 一个任务…"},disabled:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},maxHeight:{default:160},allowEmpty:{type:Boolean,default:!1},models:{default:()=>[]},model:{default:""},permissions:{default:()=>[]},permission:{default:""},attachable:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},attachments:{default:()=>[]},mentionPaths:{default:()=>[]}},{text:{default:""},textModifiers:{}}),emits:Ss(["update:text","send","stop","update:model","update:permission","removeAttachment","filesSelected"],["update:text"]),setup(e,{expose:t,emit:n}){const o=e,s=Ca(e,"text"),i=n,r=rt("area"),{composing:a,onInput:l,submit:c,onKeydown:u}=xk(o,s,r,{send:ae=>i("send",ae)}),d=T(()=>o.model||o.models[0]?.id||""),_=T(()=>o.permission||o.permissions[0]?.id||""),v=P(!1);function g(){v.value=!v.value}function m(ae){ae!==_.value&&i("update:permission",ae),v.value=!1}const y=T(()=>o.models.map(ae=>({id:ae.id,name:ae.label,tag:ae.meta,provider:ae.provider,model:ae.model})));function x(ae){ae!==d.value&&i("update:model",ae)}const $=T(()=>o.models.find(ae=>ae.id===d.value)?.label??d.value),w=T(()=>o.permissions.find(ae=>ae.id===_.value)?.label??_.value),C=rt("backdrop"),R=T(()=>new Set(o.mentionPaths??[]));function O(ae){return ae.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const B=T(()=>{const ae=s.value;if(!ae)return"";const ve=R.value;if(ve.size===0)return O(ae);let fe="",L=0;const H=/@[^\s@]+/g;let W;for(;(W=H.exec(ae))!==null;)ve.has(W[0].slice(1))&&(fe+=O(ae.slice(L,W.index)),fe+=`<mark class="va-cmp__hl">${O(W[0])}</mark>`,L=W.index+W[0].length);return fe+=O(ae.slice(L)),fe});function J(){const ae=r.value,ve=C.value;!ae||!ve||(ve.scrollTop=ae.scrollTop,ve.scrollLeft=ae.scrollLeft)}const Q=rt("file"),re=P(!1);function ee(){o.disabled||o.uploading||Q.value?.click()}function z(ae){const ve=ae.target.files;ve?.length&&i("filesSelected",Array.from(ve)),ae.target.value=""}function K(ae){if(re.value=!1,!o.attachable||o.disabled)return;const ve=ae.dataTransfer?.files;ve?.length&&i("filesSelected",Array.from(ve))}function se(ae){if(!o.attachable||o.disabled)return;const ve=ae.clipboardData?.files;ve?.length&&(ae.preventDefault(),i("filesSelected",Array.from(ve)))}function le(ae){return!ae&&ae!==0?"":ae<1024?`${ae} B`:ae<1024*1024?`${(ae/1024).toFixed(0)} KB`:`${(ae/1024/1024).toFixed(1)} MB`}return t({focus:()=>r.value?.focus()}),(ae,ve)=>(h(),b("div",{class:ye(["va-cmp",{"va-cmp--busy":o.busy,"va-cmp--drag":re.value}]),onDragover:ve[6]||(ve[6]=Fe(fe=>re.value=o.attachable,["prevent"])),onDragleave:ve[7]||(ve[7]=fe=>re.value=!1),onDrop:K},[o.attachments.length?(h(),b("div",Kk,[(h(!0),b(G,null,me(o.attachments,fe=>(h(),b("span",{key:fe.id,class:"va-cmp__att"},[fe.kind==="image"&&fe.previewUrl?(h(),b("img",{key:0,class:"va-cmp__att-thumb",src:fe.previewUrl,alt:""},null,8,Wk)):(h(),ce(p(ak),{key:1,size:13,"aria-hidden":"true"})),f("span",{class:"va-cmp__att-name",title:fe.name},A(fe.name),9,Vk),fe.size!==void 0?(h(),b("span",qk,A(le(fe.size)),1)):E("",!0),f("button",{class:"va-cmp__att-x",type:"button","aria-label":`移除附件 ${fe.name}`,onClick:L=>i("removeAttachment",fe.id)},[j(p(Ro),{size:11,"aria-hidden":"true"})],8,Hk)]))),128))])):E("",!0),ae.$slots.prefix?(h(),b("div",Jk,[Je(ae.$slots,"prefix")])):E("",!0),f("div",Gk,[f("div",{ref_key:"backdrop",ref:C,class:"va-cmp__backdrop","aria-hidden":"true",innerHTML:B.value},null,8,Zk),f("textarea",{ref_key:"area",ref:r,class:"va-cmp__area",value:s.value,placeholder:o.placeholder,disabled:o.disabled,rows:"1",onInput:ve[0]||(ve[0]=(...fe)=>p(l)&&p(l)(...fe)),onKeydown:ve[1]||(ve[1]=(...fe)=>p(u)&&p(u)(...fe)),onCompositionstart:ve[2]||(ve[2]=fe=>a.value=!0),onCompositionend:ve[3]||(ve[3]=fe=>a.value=!1),onPaste:se,onScroll:J},null,40,Yk)]),f("div",Xk,[f("div",Qk,[Je(ae.$slots,"actions"),o.models.length?(h(),ce(p(zk),{key:0,class:"va-cmp__seat-wrap",models:y.value,selected:d.value,align:"left","aria-label":`切换模型(当前 ${$.value})`,"onUpdate:selected":x},{trigger:we(({open:fe,toggle:L})=>[f("button",{class:"va-cmp__seat",type:"button","aria-expanded":fe,"aria-label":`切换模型(当前 ${$.value})`,disabled:o.disabled,onClick:Fe(L,["stop"])},[j(p(Zh),{size:12,"aria-hidden":"true"}),f("span",t2,A($.value),1),j(p(os),{size:11,"aria-hidden":"true"})],8,e2)]),_:1},8,["models","selected","aria-label"])):E("",!0),o.permissions.length?(h(),b("span",n2,[f("button",{class:"va-cmp__seat",type:"button","aria-label":`权限预设(当前 ${w.value})`,disabled:o.disabled,onClick:Fe(g,["stop"])},[j(p(fk),{size:12,"aria-hidden":"true"}),f("span",s2,A(w.value),1),j(p(os),{size:11,"aria-hidden":"true"})],8,o2),v.value?(h(),b("div",i2,[(h(!0),b(G,null,me(o.permissions,fe=>(h(),b("button",{key:fe.id,class:"va-cmp__menu-row",type:"button",role:"menuitem","data-active":fe.id===_.value||void 0,onClick:Fe(L=>m(fe.id),["stop"])},[fe.id===_.value?(h(),ce(p(gi),{key:0,size:13,"aria-hidden":"true"})):(h(),b("span",a2)),f("span",l2,[f("span",c2,A(fe.label),1),fe.desc?(h(),b("span",u2,A(fe.desc),1)):E("",!0)])],8,r2))),128))])):E("",!0)])):E("",!0),o.attachable?(h(),b("button",{key:2,class:"va-cmp__seat va-cmp__seat--icon",type:"button","aria-label":"上传附件",title:"上传附件(也可拖入/粘贴)",disabled:o.disabled||o.uploading,onClick:ee},[o.uploading?(h(),ce(p(ck),{key:0,size:12,class:"va-cmp__spin","aria-hidden":"true"})):(h(),ce(p(uk),{key:1,size:12,"aria-hidden":"true"}))],8,d2)):E("",!0),f("input",{ref:"file",class:"va-cmp__file",type:"file",multiple:"",hidden:"",onChange:z},null,544),ae.$slots.trailing?(h(),b("div",f2,[Je(ae.$slots,"trailing")])):E("",!0)]),o.busy?(h(),b("button",{key:0,class:"va-cmp__send va-cmp__send--stop",type:"button","aria-label":"停止运行",title:"停止(Esc)",onClick:ve[4]||(ve[4]=fe=>i("stop"))},[...ve[8]||(ve[8]=[f("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[f("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"})],-1)])])):(h(),b("button",{key:1,class:"va-cmp__send",type:"button",disabled:o.disabled||!o.allowEmpty&&!s.value.trim(),"aria-label":"发送",onClick:ve[5]||(ve[5]=(...fe)=>p(c)&&p(c)(...fe))},[...ve[9]||(ve[9]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M12 19V5M5.5 11.5 12 5l6.5 6.5"})],-1)])],8,p2))])],34))}});function h2(e,t){const n=P(!1),o=P(new Set),s=P(!1);let i=null;function r(c){return!n.value||o.value.has(c)}const a=T(()=>!n.value||s.value);async function l(){await it();const c=e.value;if(!(!c||!i)){if(i.disconnect(),!s.value){const u=c.querySelector(".va-traj__lanes");u&&i.observe(u)}for(const u of c.querySelectorAll(".va-traj__row[data-id]")){const d=u.dataset.id;d&&!o.value.has(d)&&i.observe(u)}}}return Ct(()=>{e.value&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||typeof IntersectionObserver>"u"||(n.value=!0,i=new IntersectionObserver(u=>{for(const d of u){if(!d.isIntersecting)continue;const _=d.target;if(_.classList.contains("va-traj__lanes"))s.value=!0;else if(_.dataset.id){const v=new Set(o.value);v.add(_.dataset.id),o.value=v}i?.unobserve(_)}},{threshold:.15}),l()))}),Ee(t,()=>{n.value&&l()}),vt(()=>{i?.disconnect(),i=null}),{active:n,rowVisible:r,blocksVisible:a}}const v2=["data-reveal"],m2={class:"va-traj__panel"},_2={class:"va-traj__bar"},g2={class:"va-traj__chip"},b2={class:"va-traj__chip"},y2={class:"va-traj__chip"},k2={class:"va-traj__chip"},w2={class:"va-traj__search"},x2={class:"va-traj__lanes"},$2={class:"va-traj__lane-label"},C2={class:"va-traj__track"},A2=["data-lane","data-shown","title"],S2={key:0,class:"va-traj__empty"},R2=["data-id","data-shown","title","data-open","data-selected","onClick","onKeydown"],E2={class:"va-traj__rail"},D2={key:0,class:"va-traj__turn"},T2=["data-role"],I2=["data-tool"],F2={class:"va-traj__toolname"},M2={key:0,class:"va-traj__detail"},O2={class:"va-traj__detail-head"},P2=["data-role"],L2={class:"va-traj__detail-meta"},B2={class:"va-traj__detail-title"},j2={key:0},N2={key:1},U2={key:2,class:"va-traj__detail-none"},cc=Ce({__name:"VaTrajectory",props:{events:{type:Array,required:!0},ledgerMaxHeight:{type:Number,default:void 0},bordered:{type:Boolean,default:!0},splitDetail:{type:Boolean,default:!1}},emits:["toggle","select"],setup(e,{emit:t}){const n=e,o=t,s=T(()=>n.events[0]?.at??0),i=T(()=>{const K=n.events.at(-1);return K?Math.max(K.endAt??K.at,n.events[0]?.at??0):0}),r=T(()=>Math.max(i.value-s.value,1)),a=T(()=>({durationMs:Math.max(i.value-s.value,0),turns:new Set(n.events.map(K=>K.turn)).size,calls:n.events.filter(K=>K.lane==="tool").length,subcalls:0})),l=K=>K<1e3?`${K}ms`:`${(K/1e3).toFixed(1)}s`,c=[{key:"input",label:"输入"},{key:"model",label:"模型"},{key:"tool",label:"工具"}],u=K=>n.events.filter(se=>se.lane===K);function d(K){const se=(K.at-s.value)/r.value*100;return{left:`${Math.min(Math.max(se,0),99)}%`}}const _=P(""),v=P(new Set);function g(K){const se=!v.value.has(K),le=new Set(v.value);se?le.add(K):le.delete(K),v.value=le,o("toggle",K,se)}const m=P(null),y=T(()=>n.events.find(K=>K.id===m.value)??null);function x(K){m.value=m.value===K?null:K,o("select",m.value)}function $(){m.value=null,o("select",null)}function w(K){n.splitDetail?x(K.id):g(K.id)}const C=T(()=>{const K=_.value.trim().toLowerCase();return K?n.events.filter(se=>se.title.toLowerCase().includes(K)||(se.detail??"").toLowerCase().includes(K)||(se.result??"").toLowerCase().includes(K)):n.events}),R=T(()=>{const K=new Set,se=new Set;for(const le of C.value)K.has(le.turn)||(K.add(le.turn),se.add(le.id));return se}),O=K=>new Date(K).toLocaleTimeString("zh-CN",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),B=P(null),{active:J,rowVisible:Q,blocksVisible:re}=h2(B,C),ee={user:"用户",assistant:"助手",tool:"工具",system:"系统",context:"上下文"};function z(K){if(K.lane==="tool"){const se=K.detail&&K.detail.length>240?`${K.detail.slice(0,240)}…`:K.detail??"",le=K.result&&K.result.length>240?`${K.result.slice(0,240)}…`:K.result??"";return se?`${se} → ${le}`:le}return K.title}return(K,se)=>(h(),b("div",{ref_key:"rootEl",ref:B,class:ye(["va-traj",{"va-traj--plain":n.bordered===!1,"va-traj--split":n.splitDetail}]),"data-reveal":p(J)?"on":void 0},[f("div",m2,[f("div",_2,[f("span",g2,[j(p(rk),{size:12,"aria-hidden":"true"}),pe("时长 "+A(l(a.value.durationMs)),1)]),f("span",b2,[j(p(dk),{size:12,"aria-hidden":"true"}),pe("轮次 "+A(a.value.turns),1)]),f("span",y2,[j(p(hk),{size:12,"aria-hidden":"true"}),pe("调用 "+A(a.value.calls),1)]),f("span",k2,[j(p(lk),{size:12,"aria-hidden":"true"}),pe("子调用 "+A(a.value.subcalls),1)]),se[1]||(se[1]=f("span",{class:"va-traj__spacer"},null,-1)),f("label",w2,[j(p(Gh),{size:13,"aria-hidden":"true"}),Ve(f("input",{"onUpdate:modelValue":se[0]||(se[0]=le=>_.value=le),type:"text",placeholder:"搜索","aria-label":"搜索轨迹事件"},null,512),[[st,_.value]])])]),f("div",x2,[(h(),b(G,null,me(c,le=>f("div",{key:le.key,class:"va-traj__lane"},[f("span",$2,A(le.label),1),f("div",C2,[(h(!0),b(G,null,me(u(le.key),ae=>(h(),b("span",{key:ae.id,class:"va-traj__block","data-lane":le.key,"data-shown":p(re)?"true":void 0,style:Le(d(ae)),title:`${O(ae.at)} ${ae.title}`},null,12,A2))),128))])])),64))]),f("div",{class:"va-traj__ledger",style:Le(n.ledgerMaxHeight?{maxHeight:`${n.ledgerMaxHeight}px`}:void 0)},[C.value.length?E("",!0):(h(),b("p",S2,A(n.events.length?"没有匹配的事件。":"还没有轨迹。发一条任务,这里会按轮记录全部事件。"),1)),(h(!0),b(G,null,me(C.value,le=>(h(),b("div",{key:le.id,class:"va-traj__row","data-id":le.id,"data-shown":p(Q)(le.id)?"true":void 0,title:`${O(le.at)}${le.endAt?` · ${l(le.endAt-le.at)}`:""}`,"data-open":!n.splitDetail&&v.value.has(le.id)||void 0,"data-selected":n.splitDetail&&m.value===le.id||void 0,role:"button",tabindex:"0",onClick:ae=>w(le),onKeydown:xt(Fe(ae=>w(le),["prevent"]),["enter"])},[f("span",E2,[R.value.has(le.id)?(h(),b("span",D2,"第"+A(le.turn)+"轮",1)):E("",!0),se[2]||(se[2]=f("i",{class:"va-traj__dot","aria-hidden":"true"},null,-1))]),f("span",{class:"va-traj__role","data-role":le.role},A(ee[le.role]??le.role),9,T2),f("span",{class:"va-traj__content","data-tool":le.lane==="tool"||void 0},[le.lane==="tool"?(h(),b(G,{key:0},[f("b",F2,A(le.title),1),pe(" "+A(z(le)),1)],64)):(h(),b(G,{key:1},[pe(A(le.title),1)],64))],8,I2)],40,R2))),128))],4)]),n.splitDetail&&y.value?(h(),b("aside",M2,[f("header",O2,[f("span",{class:"va-traj__role","data-role":y.value.role},A(ee[y.value.role]??y.value.role),9,P2),f("span",L2,[pe(A(O(y.value.at)),1),y.value.endAt?(h(),b(G,{key:0},[pe(" · "+A(l(y.value.endAt-y.value.at)),1)],64)):E("",!0),pe(" · 第"+A(y.value.turn)+"轮 ",1)]),f("button",{class:"va-traj__detail-close",type:"button",title:"关闭详情","aria-label":"关闭详情",onClick:$},[j(p(Ro),{size:14})])]),f("div",B2,A(y.value.title),1),y.value.detail?(h(),b("section",j2,[se[3]||(se[3]=f("h4",null,"输入 / 参数",-1)),f("pre",null,A(y.value.detail),1)])):E("",!0),y.value.result?(h(),b("section",N2,[se[4]||(se[4]=f("h4",null,"结果 / 输出",-1)),f("pre",null,A(y.value.result),1)])):E("",!0),!y.value.detail&&!y.value.result?(h(),b("p",U2," 该事件没有更多详情 ")):E("",!0)])):E("",!0)],10,v2))}}),z2={class:"va-hero va-enter-up"},K2={class:"va-hero__badge","aria-hidden":"true"},W2={class:"va-hero__title"},V2={class:"va-hero__desc"},q2={class:"va-hero__cards"},H2=["disabled","title","onClick"],J2={class:"va-hero__card-name"},G2={key:0,class:"va-hero__card-path"},Z2=["disabled"],Y2=Ce({__name:"VaEmptyHero",props:{workspaces:{default:()=>[]},creating:{type:Boolean,default:!1},title:{default:"开始一个任务"},description:{default:"选择一个工作区开启会话;agent 的文件读写都限定在其目录内。"}},emits:["createWorkspace","createSession"],setup(e,{emit:t}){const n=e,o=t;return(s,i)=>(h(),b("div",z2,[f("div",K2,[Je(s.$slots,"icon",{},()=>[j(p(pk),{size:20,class:"va-hero__icon"})])]),f("h3",W2,A(n.title),1),f("p",V2,A(n.description),1),f("div",q2,[(h(!0),b(G,null,me(n.workspaces,r=>(h(),b("button",{key:r.id,class:"va-hero__card",type:"button",disabled:n.creating,title:r.path||r.name,onClick:a=>o("createSession",r.id)},[j(p(Jh),{size:18,"aria-hidden":"true"}),f("span",J2,A(r.name),1),r.path?(h(),b("span",G2,A(r.path),1)):E("",!0)],8,H2))),128)),f("button",{class:"va-hero__card va-hero__card--new",type:"button",disabled:n.creating,onClick:i[0]||(i[0]=r=>o("createWorkspace"))},[j(p(Lr),{size:18,"aria-hidden":"true"}),i[1]||(i[1]=f("span",{class:"va-hero__card-name"},"新建工作区",-1)),i[2]||(i[2]=f("span",{class:"va-hero__card-path"},"弹出系统文件夹选择框",-1))],8,Z2)])]))}}),X2=["data-hover-ops"],Q2=["disabled","title"],ew={key:0,class:"va-stree__ws-create"},tw=["onKeydown"],nw=["disabled"],ow={key:2,class:"va-stree__search"},sw=["data-current"],iw={class:"va-stree__head"},rw=["aria-label","onClick"],aw=["title"],lw={class:"va-stree__ws-icon","aria-hidden":"true"},cw={class:"va-stree__ws-name"},uw={class:"va-stree__count"},dw={key:0,class:"va-stree__tag"},fw=["disabled","onClick"],pw=["data-danger","aria-label","disabled","onClick"],hw={key:0,class:"va-stree__confirm"},vw={key:0,class:"va-stree__list"},mw={class:"va-stree__list-clip"},_w=["data-active"],gw=["onKeydown"],bw=["title","onClick"],yw={key:0,class:"va-stree__dot va-stree__dot--warn","aria-hidden":"true"},kw={key:1,class:"va-stree__dot va-stree__dot--run","aria-hidden":"true"},ww={class:"va-stree__session-title"},xw={key:3,class:"va-stree__warn-tag"},$w={class:"va-stree__time"},Cw=["aria-label","disabled","onClick"],Aw=["disabled","onClick"],Sw=["disabled","onClick"],Rw=["data-danger","aria-label","disabled","onClick"],Ew={key:0,class:"va-stree__confirm"},Dw={key:0,class:"va-stree__empty va-fade-in"},Tw={key:3,class:"va-stree__empty va-stree__search-empty va-fade-in"},Iw={key:4,class:"va-stree__group"},Fw={class:"va-stree__head"},Mw={class:"va-stree__ws"},Ow={class:"va-stree__count"},Pw={class:"va-stree__list"},Lw={class:"va-stree__list-clip"},Bw=["data-active"],jw=["onKeydown"],Nw=["title","onClick"],Uw={key:0,class:"va-stree__dot va-stree__dot--warn","aria-hidden":"true"},zw={key:1,class:"va-stree__dot va-stree__dot--run","aria-hidden":"true"},Kw={class:"va-stree__session-title"},Ww={key:3,class:"va-stree__warn-tag"},Vw={class:"va-stree__time"},qw=["aria-label","disabled","onClick"],Hw=["disabled","onClick"],Jw=["disabled","onClick"],Gw=["data-danger","aria-label","disabled","onClick"],Zw={key:0,class:"va-stree__confirm"},Yw={key:5,class:"va-stree__archived"},Xw={key:0,class:"va-stree__list"},Qw={class:"va-stree__list-clip"},ex={class:"va-stree__session-main va-stree__session-main--static"},tx={class:"va-stree__session-title"},nx={class:"va-stree__time"},ox=["disabled","onClick"],sx=["data-danger","aria-label","disabled","onClick"],ix={key:0,class:"va-stree__confirm"},rx={key:6,class:"va-stree__footer"},ax=Ce({__name:"VaSessionTree",props:{workspaces:{},sessions:{},archived:{},currentWorkspaceId:{},currentSessionId:{},disabled:{type:Boolean,default:!1},workspaceCreateMode:{default:"input"},newSession:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!1},hoverOps:{type:Boolean,default:!1},confirmMode:{default:"inline"}},emits:["createWorkspace","createWorkspacePick","selectSession","createSession","removeWorkspace","togglePin","rename","archive","remove"],setup(e,{emit:t}){const n=e,o=t,s=mn(new Set);Ee(()=>n.workspaces.map(L=>L.id).join(","),L=>{if(n.collapsible)for(const H of L.split(","))H&&s.add(H)},{immediate:!0});function i(L){s.has(L)?s.delete(L):s.add(L)}const r=L=>!n.collapsible||s.has(L);function a(){n.disabled||!n.currentWorkspaceId||o("createSession",n.currentWorkspaceId)}const l=P(""),c=L=>!l.value.trim()||(L.title||"未命名会话").toLowerCase().includes(l.value.trim().toLowerCase()),u=T(()=>l.value.trim().length>0),d=P(!1),_=P("");function v(){if(!n.disabled){if(n.workspaceCreateMode==="picker"){o("createWorkspacePick");return}d.value=!0,_.value=""}}function g(){const L=_.value.trim();L&&o("createWorkspace",L),d.value=!1}function m(){d.value=!1}const y=P(null),x=P("");function $(L){n.disabled||(y.value=L.id,x.value=L.title||"未命名会话")}function w(){if(y.value){const L=x.value.trim(),H=[...n.sessions,...n.archived].find(W=>W.id===y.value)?.title??"";L&&L!==H&&o("rename",y.value,L)}y.value=null}function C(){y.value=null}const R=P(null);let O;function B(L,H,W,Y){if(n.confirmMode==="none"){Y();return}L===W?(Y(),H(null)):(H(W),window.clearTimeout(O),O=window.setTimeout(()=>H(null),3e3))}function J(L){n.disabled||B(R.value,H=>R.value=H,L,()=>o("remove",L))}const Q=P(null);function re(L){n.disabled||B(Q.value,H=>Q.value=H,L,()=>o("removeWorkspace",L))}const ee=T(()=>n.workspaces.map(L=>({workspace:L,sessions:n.sessions.filter(H=>(H.workspaceId??"")===L.id&&c(H))}))),z=T(()=>n.sessions.filter(L=>!K(L)&&c(L)));function K(L){return n.workspaces.some(H=>H.id===(L.workspaceId??""))}const se=P(!1),le=L=>L.title||"未命名会话";function ae(L){const H=Date.now()-L;return H<6e4?"刚刚":H<36e5?`${Math.floor(H/6e4)} 分钟前`:H<864e5?`${Math.floor(H/36e5)} 小时前`:H<7*864e5?`${Math.floor(H/864e5)} 天前`:new Date(L).toLocaleDateString("zh-CN")}function ve(L){n.disabled||L.id!==n.currentSessionId&&o("selectSession",L.id)}function fe(L){n.disabled||o("createSession",L)}return(L,H)=>(h(),b("div",{class:"va-stree","data-hover-ops":n.hoverOps||void 0},[n.newSession?(h(),b("button",{key:0,class:"va-stree__new-session",type:"button",disabled:n.disabled||!n.currentWorkspaceId,title:n.currentWorkspaceId?`在「${n.workspaces.find(W=>W.id===n.currentWorkspaceId)?.name??""}」新建会话`:"先选择或新建工作区",onClick:a},[j(p(Lr),{size:15,"aria-hidden":"true"}),H[5]||(H[5]=pe("新建会话",-1))],8,Q2)):E("",!0),j(ts,{name:"va-stree-pop"},{default:we(()=>[d.value?(h(),b("div",ew,[Ve(f("input",{"onUpdate:modelValue":H[0]||(H[0]=W=>_.value=W),class:"va-stree__input",type:"text",placeholder:"本地文件夹路径,如 ~/code/my-proj",maxlength:"60",onKeydown:[xt(Fe(g,["prevent"]),["enter"]),xt(Fe(m,["prevent"]),["escape"])]},null,40,tw),[[st,_.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认创建",onClick:g},[j(p(gi),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:m},[j(p(Ro),{size:14})])])):E("",!0)]),_:1}),d.value?E("",!0):(h(),b("button",{key:1,class:"va-stree__new",type:"button",disabled:n.disabled,onClick:v},[j(p(Lr),{size:15,"aria-hidden":"true"}),H[6]||(H[6]=pe("新建工作区",-1))],8,nw)),n.searchable?(h(),b("label",ow,[j(p(Gh),{size:13,"aria-hidden":"true"}),Ve(f("input",{"onUpdate:modelValue":H[1]||(H[1]=W=>l.value=W),type:"text",placeholder:"搜索会话","aria-label":"搜索会话"},null,512),[[st,l.value]])])):E("",!0),(h(!0),b(G,null,me(ee.value,W=>(h(),b("section",{key:W.workspace.id,class:"va-stree__group","data-current":W.workspace.id===n.currentWorkspaceId||void 0},[f("div",iw,[n.collapsible?(h(),b("button",{key:0,class:"va-stree__toggle",type:"button","aria-label":r(W.workspace.id)?`收起 ${W.workspace.name} 的会话`:`展开 ${W.workspace.name} 的会话`,onClick:Fe(Y=>i(W.workspace.id),["stop"])},[r(W.workspace.id)?(h(),ce(p(os),{key:0,size:13,"aria-hidden":"true"})):(h(),ce(p(Zd),{key:1,size:13,"aria-hidden":"true"}))],8,rw)):E("",!0),f("span",{class:"va-stree__ws",title:W.workspace.description||W.workspace.name},[f("span",lw,[j(p(Jh),{size:14})]),f("span",cw,A(W.workspace.name),1),f("span",uw,A(W.sessions.length),1),W.workspace.id===n.currentWorkspaceId?(h(),b("span",dw,"当前")):E("",!0)],8,aw),f("button",{class:"va-stree__op",type:"button","aria-label":"在此工作区新建会话",disabled:n.disabled,onClick:Fe(Y=>fe(W.workspace.id),["stop"])},[j(p(Lr),{size:14})],8,fw),f("button",{class:"va-stree__op",type:"button","data-danger":Q.value===W.workspace.id||void 0,"aria-label":Q.value===W.workspace.id?"确认删除工作区":"删除工作区",disabled:n.disabled,onClick:Fe(Y=>re(W.workspace.id),["stop"])},[Q.value===W.workspace.id?(h(),b("span",hw,"确认?")):(h(),ce(p(Ar),{key:1,size:13}))],8,pw)]),j(ts,{name:"va-stree-fold"},{default:we(()=>[r(W.workspace.id)?(h(),b("div",vw,[f("div",mw,[(h(!0),b(G,null,me(W.sessions,Y=>(h(),b("div",{key:Y.id,class:"va-stree__session","data-active":Y.id===n.currentSessionId||void 0},[y.value===Y.id?(h(),b(G,{key:0},[Ve(f("input",{"onUpdate:modelValue":H[2]||(H[2]=Ae=>x.value=Ae),class:"va-stree__input",type:"text",onKeydown:[xt(Fe(w,["prevent"]),["enter"]),xt(Fe(C,["prevent"]),["escape"])]},null,40,gw),[[st,x.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认重命名",onClick:w},[j(p(gi),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:C},[j(p(Ro),{size:14})])],64)):(h(),b(G,{key:1},[f("button",{class:"va-stree__session-main",type:"button",title:le(Y),onClick:Ae=>ve(Y)},[Y.waitingApproval?(h(),b("span",yw)):Y.running?(h(),b("span",kw)):Y.pinned?(h(),ce(p(Cr),{key:2,class:"va-stree__pin",size:11,"aria-hidden":"true"})):E("",!0),f("span",ww,A(le(Y)),1),Y.waitingApproval?(h(),b("span",xw,"待审批")):E("",!0),f("span",$w,A(ae(Y.updatedAt)),1)],8,bw),f("button",{class:"va-stree__op",type:"button","aria-label":Y.pinned?"取消置顶":"置顶",disabled:n.disabled,onClick:Fe(Ae=>o("togglePin",Y.id),["stop"])},[Y.pinned?(h(),ce(p(Yd),{key:0,size:13})):(h(),ce(p(Cr),{key:1,size:13}))],8,Cw),f("button",{class:"va-stree__op",type:"button","aria-label":"重命名",disabled:n.disabled,onClick:Fe(Ae=>$(Y),["stop"])},[j(p(lc),{size:13})],8,Aw),f("button",{class:"va-stree__op",type:"button","aria-label":"归档",disabled:n.disabled,onClick:Fe(Ae=>o("archive",Y.id,!0),["stop"])},[j(p(Gd),{size:13})],8,Sw),f("button",{class:"va-stree__op",type:"button","data-danger":R.value===Y.id||void 0,"aria-label":R.value===Y.id?"确认删除":"删除",disabled:n.disabled,onClick:Fe(Ae=>J(Y.id),["stop"])},[R.value===Y.id?(h(),b("span",Ew,"确认?")):(h(),ce(p(Ar),{key:1,size:13}))],8,Rw)],64))],8,_w))),128)),W.sessions.length===0?(h(),b("p",Dw,A(u.value?"无匹配会话":"暂无会话"),1)):E("",!0)])])):E("",!0)]),_:2},1024)],8,sw))),128)),u.value&&ee.value.every(W=>W.sessions.length===0)&&z.value.length===0?(h(),b("p",Tw," 没有匹配「"+A(l.value.trim())+"」的会话 ",1)):E("",!0),z.value.length?(h(),b("section",Iw,[f("div",Fw,[f("span",Mw,[H[7]||(H[7]=f("span",{class:"va-stree__ws-name"},"未分组",-1)),f("span",Ow,A(z.value.length),1)])]),f("div",Pw,[f("div",Lw,[(h(!0),b(G,null,me(z.value,W=>(h(),b("div",{key:W.id,class:"va-stree__session","data-active":W.id===n.currentSessionId||void 0},[y.value===W.id?(h(),b(G,{key:0},[Ve(f("input",{"onUpdate:modelValue":H[3]||(H[3]=Y=>x.value=Y),class:"va-stree__input",type:"text",onKeydown:[xt(Fe(w,["prevent"]),["enter"]),xt(Fe(C,["prevent"]),["escape"])]},null,40,jw),[[st,x.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认重命名",onClick:w},[j(p(gi),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:C},[j(p(Ro),{size:14})])],64)):(h(),b(G,{key:1},[f("button",{class:"va-stree__session-main",type:"button",title:le(W),onClick:Y=>ve(W)},[W.waitingApproval?(h(),b("span",Uw)):W.running?(h(),b("span",zw)):W.pinned?(h(),ce(p(Cr),{key:2,class:"va-stree__pin",size:11,"aria-hidden":"true"})):E("",!0),f("span",Kw,A(le(W)),1),W.waitingApproval?(h(),b("span",Ww,"待审批")):E("",!0),f("span",Vw,A(ae(W.updatedAt)),1)],8,Nw),f("button",{class:"va-stree__op",type:"button","aria-label":W.pinned?"取消置顶":"置顶",disabled:n.disabled,onClick:Fe(Y=>o("togglePin",W.id),["stop"])},[W.pinned?(h(),ce(p(Yd),{key:0,size:13})):(h(),ce(p(Cr),{key:1,size:13}))],8,qw),f("button",{class:"va-stree__op",type:"button","aria-label":"重命名",disabled:n.disabled,onClick:Fe(Y=>$(W),["stop"])},[j(p(lc),{size:13})],8,Hw),f("button",{class:"va-stree__op",type:"button","aria-label":"归档",disabled:n.disabled,onClick:Fe(Y=>o("archive",W.id,!0),["stop"])},[j(p(Gd),{size:13})],8,Jw),f("button",{class:"va-stree__op",type:"button","data-danger":R.value===W.id||void 0,"aria-label":R.value===W.id?"确认删除":"删除",disabled:n.disabled,onClick:Fe(Y=>J(W.id),["stop"])},[R.value===W.id?(h(),b("span",Zw,"确认?")):(h(),ce(p(Ar),{key:1,size:13}))],8,Gw)],64))],8,Bw))),128))])])])):E("",!0),n.archived.length&&!u.value?(h(),b("div",Yw,[f("button",{class:"va-stree__archived-toggle",type:"button",onClick:H[4]||(H[4]=W=>se.value=!se.value)},[pe(" 已归档("+A(n.archived.length)+") ",1),se.value?(h(),ce(p(os),{key:0,size:14,"aria-hidden":"true"})):(h(),ce(p(Zd),{key:1,size:14,"aria-hidden":"true"}))]),j(ts,{name:"va-stree-fold"},{default:we(()=>[se.value?(h(),b("div",Xw,[f("div",Qw,[(h(!0),b(G,null,me(n.archived,W=>(h(),b("div",{key:W.id,class:"va-stree__session","data-archived":"true"},[f("span",ex,[f("span",tx,A(le(W)),1),f("span",nx,A(ae(W.updatedAt)),1)]),f("button",{class:"va-stree__op",type:"button","aria-label":"恢复",disabled:n.disabled,onClick:Fe(Y=>o("archive",W.id,!1),["stop"])},[j(p(nk),{size:13})],8,ox),f("button",{class:"va-stree__op",type:"button","data-danger":R.value===W.id||void 0,"aria-label":R.value===W.id?"确认删除":"删除",disabled:n.disabled,onClick:Fe(Y=>J(W.id),["stop"])},[R.value===W.id?(h(),b("span",ix,"确认?")):(h(),ce(p(Ar),{key:1,size:13}))],8,sx)]))),128))])])):E("",!0)]),_:1})])):E("",!0),L.$slots.footer?(h(),b("footer",rx,[Je(L.$slots,"footer")])):E("",!0)],8,X2))}}),lx=["不够准确","太啰嗦","没听懂指令"];function Gc(e,t){const n=P(!1);let o;async function s(){const i=e();try{if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(i);else if(typeof document<"u"){const r=document.createElement("textarea");r.value=i,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}}catch{}n.value=!0,t?.(i),o!==void 0&&window.clearTimeout(o),o=window.setTimeout(()=>n.value=!1,1500)}return vt(()=>{o!==void 0&&window.clearTimeout(o)}),{copied:n,copy:s}}function cx(e,t,n){const{copied:o,copy:s}=Gc(()=>e.text??"",y=>n.copy(y)),i=P(null),r=P(!1),a=T(()=>e.reasons??lx),l=P("");function c(y){if(y==="up"){i.value=i.value==="up"?null:"up",r.value=!1,n.feedback(i.value);return}if(r.value){r.value=!1;return}i.value="down",r.value=!0,l.value=""}function u(y){i.value="down",r.value=!1,n.feedback("down",y||void 0)}function d(){i.value=null,r.value=!1,n.feedback(null)}const _=T(()=>typeof e.versions=="number"?Math.max(1,e.versions):1),v=T(()=>_.value>=2),g=T(()=>{const y=t.value;return y==null||y<0||y>=_.value?_.value-1:y});function m(y){const x=Math.min(_.value-1,Math.max(0,g.value+y));t.value=x,n.versionChange(x)}return{copied:o,copy:s,chosen:i,panelOpen:r,reasons:a,customReason:l,thumb:c,sendDown:u,takeBack:d,count:_,effective:g,showVersions:v,go:m}}const ux={class:"va-msg__bar"},dx=["aria-label"],fx=["aria-label"],px={key:0,class:"va-msg__versions"},hx=["disabled"],vx={class:"va-msg__ver-label"},mx=["disabled"],_x=["aria-pressed"],gx=["aria-pressed"],bx={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",style:{transform:"rotate(180deg)"}},yx={key:0,class:"va-msg__panel"},kx={class:"va-msg__reasons"},wx=["onClick"],xx={class:"va-msg__other"},$x=["disabled"],Cx=Ce({__name:"VaMessageActions",props:Ss({text:{default:void 0},versions:{default:void 0},regenerating:{type:Boolean,default:!1},quiet:{type:Boolean,default:!1},reasons:{default:void 0}},{version:{},versionModifiers:{}}),emits:Ss(["copy","regenerate","versionChange","feedback"],["update:version"]),setup(e,{emit:t}){const n=e,o=t,s=Ca(e,"version"),{copied:i,copy:r,chosen:a,panelOpen:l,reasons:c,customReason:u,thumb:d,sendDown:_,takeBack:v,count:g,effective:m,showVersions:y,go:x}=cx(n,s,{copy:$=>o("copy",$),regenerate:()=>o("regenerate"),versionChange:$=>o("versionChange",$),feedback:($,w)=>o("feedback",$,w)});return($,w)=>(h(),b("div",{class:ye(["va-msg",{"va-msg--quiet":n.quiet,"va-msg--panel":p(l)}])},[f("div",ux,[f("button",{class:"va-msg__act",type:"button","aria-label":p(i)?"已复制":"复制",onClick:w[0]||(w[0]=(...C)=>p(r)&&p(r)(...C))},[f("span",{class:ye(["va-copy",{"va-copy--done":p(i)}]),"aria-hidden":"true"},[...w[10]||(w[10]=[f("svg",{class:"va-copy__idle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round"},[f("path",{d:"M9 9.5A1.5 1.5 0 0 1 10.5 8h8A1.5 1.5 0 0 1 20 9.5v9a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 9 18.5zM15 8V5.5A1.5 1.5 0 0 0 13.5 4h-8A1.5 1.5 0 0 0 4 5.5v9A1.5 1.5 0 0 0 5.5 16H9"})],-1),f("svg",{class:"va-copy__done",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},[f("path",{d:"M5.5 12.5l4 4L18.5 8"})],-1)])],2)],8,dx),f("button",{class:"va-msg__act",type:"button","aria-label":n.regenerating?"再生成中":"再生成",onClick:w[1]||(w[1]=C=>o("regenerate"))},[(h(),b("svg",{class:ye({"va-msg__spin":n.regenerating}),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...w[11]||(w[11]=[f("path",{d:"M19.5 12a7.5 7.5 0 1 1-2.2-5.3L19.5 9M19.5 4.5V9H15"},null,-1)])],2))],8,fx),p(y)?(h(),b("span",px,[f("button",{class:"va-msg__act",type:"button","aria-label":"上一版本",disabled:p(m)<=0,onClick:w[2]||(w[2]=C=>p(x)(-1))},[...w[12]||(w[12]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m14.5 7-5 5 5 5"})],-1)])],8,hx),f("span",vx,A(p(m)+1)+" / "+A(p(g)),1),f("button",{class:"va-msg__act",type:"button","aria-label":"下一版本",disabled:p(m)>=p(g)-1,onClick:w[3]||(w[3]=C=>p(x)(1))},[...w[13]||(w[13]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1)])],8,mx)])):E("",!0),w[16]||(w[16]=f("span",{class:"va-msg__sep","aria-hidden":"true"},null,-1)),f("button",{class:ye(["va-msg__act",{"va-msg__act--on":p(a)==="up"}]),type:"button","aria-label":"赞","aria-pressed":p(a)==="up",onClick:w[4]||(w[4]=C=>p(d)("up"))},[...w[14]||(w[14]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M7.5 10.5v9M7.5 10.5l3.3-6a1.8 1.8 0 0 1 3.3 1.2l-.6 3.8H18a2 2 0 0 1 2 2.3l-1.2 6.4a2 2 0 0 1-2 1.8H5a1 1 0 0 1-1-1v-7.5a1 1 0 0 1 1-1z"})],-1)])],10,_x),f("button",{class:ye(["va-msg__act",{"va-msg__act--on":p(a)==="down"}]),type:"button","aria-label":"踩","aria-pressed":p(a)==="down",onClick:w[5]||(w[5]=C=>p(d)("down"))},[(h(),b("svg",bx,[...w[15]||(w[15]=[f("path",{d:"M7.5 10.5v9M7.5 10.5l3.3-6a1.8 1.8 0 0 1 3.3 1.2l-.6 3.8H18a2 2 0 0 1 2 2.3l-1.2 6.4a2 2 0 0 1-2 1.8H5a1 1 0 0 1-1-1v-7.5a1 1 0 0 1 1-1z"},null,-1)])]))],10,gx)]),j(ts,{name:"va-msg-panel"},{default:we(()=>[p(l)?(h(),b("div",yx,[w[17]||(w[17]=f("p",{class:"va-msg__panel-title"},"哪里不满意?",-1)),f("div",kx,[(h(!0),b(G,null,me(p(c),C=>(h(),b("button",{key:C,class:"va-msg__reason",type:"button",onClick:R=>p(_)(C)},A(C),9,wx))),128))]),f("div",xx,[Ve(f("input",{"onUpdate:modelValue":w[6]||(w[6]=C=>ut(u)?u.value=C:null),class:"va-msg__other-input",type:"text",placeholder:"其他原因…",onKeydown:w[7]||(w[7]=xt(C=>p(_)(p(u)),["enter"]))},null,544),[[st,p(u)]]),f("button",{class:"va-msg__reason va-msg__reason--go",type:"button",disabled:!p(u).trim(),onClick:w[8]||(w[8]=C=>p(_)(p(u)))},"发送",8,$x),f("button",{class:"va-msg__reason",type:"button",onClick:w[9]||(w[9]=(...C)=>p(v)&&p(v)(...C))},"撤回反馈")])])):E("",!0)]),_:1})],2))}});function Ax(e,t,n){const o=P({left:0,width:0}),s=T(()=>Math.max(0,e.options.findIndex(c=>c.value===t.value)));function i(){const c=n.value;if(!c||typeof window>"u")return;const u=c.querySelector(`[data-idx="${s.value}"]`);u&&(o.value={left:u.offsetLeft,width:u.offsetWidth})}function r(){i()}Ee(()=>[e.options,t.value],()=>{it(i)},{deep:!1}),Ct(()=>{it(i),typeof window<"u"&&window.addEventListener("resize",r)}),vt(()=>{typeof window<"u"&&window.removeEventListener("resize",r)});function a(c){t.value=c}function l(c){const u=e.options,d=s.value,_=c.key==="ArrowRight"||c.key==="ArrowDown"?1:c.key==="ArrowLeft"||c.key==="ArrowUp"?-1:0;if(_===0&&c.key!=="Home"&&c.key!=="End")return;let v=c.key==="Home"?0:c.key==="End"?u.length-1:(d+_+u.length)%u.length,g=u.length;for(;u[v]?.disabled&&g-- >0;)v=(v+_+u.length)%u.length;const m=u[v];!m||m.disabled||(c.preventDefault(),t.value=m.value,n.value?.querySelector(`[data-idx="${v}"]`)?.focus())}return{indicator:o,activeIdx:s,select:a,onKeydown:l}}const Sx=["aria-label"],Rx=["data-idx","data-active","aria-checked","tabindex","disabled","onClick"],Yh=Ce({__name:"VaSegmentedControl",props:Ss({options:{},size:{default:"md"},fullWidth:{type:Boolean,default:!1},ariaLabel:{default:void 0}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Ca(e,"modelValue"),o=rt("root"),{indicator:s,activeIdx:i,select:r,onKeydown:a}=Ax(t,n,o);return(l,c)=>(h(),b("div",{ref_key:"root",ref:o,class:ye(["va-seg",[`va-seg--${t.size}`,{"va-seg--full":t.fullWidth}]]),role:"radiogroup","aria-label":t.ariaLabel,onKeydown:c[0]||(c[0]=(...u)=>p(a)&&p(a)(...u))},[f("span",{class:"va-seg__thumb","aria-hidden":"true",style:Le({transform:`translateX(${p(s).left}px)`,width:`${p(s).width}px`})},null,4),(h(!0),b(G,null,me(t.options,(u,d)=>(h(),b("button",{key:u.value,class:"va-seg__btn","data-idx":d,"data-active":n.value===u.value||void 0,type:"button",role:"radio","aria-checked":n.value===u.value,tabindex:d===p(i)?0:-1,disabled:u.disabled,onClick:_=>p(r)(u.value)},A(u.label),9,Rx))),128))],42,Sx))}}),ea=mn({toasts:[]});let Ex=0;function Xh(e){const t=ea.toasts.findIndex(n=>n.id===e);t>=0&&ea.toasts.splice(t,1)}function Dx(e){const t={id:++Ex,kind:"info",duration:4200,...e};return ea.toasts.push(t),t.duration>0&&typeof window<"u"&&window.setTimeout(()=>Xh(t.id),t.duration),t.id}const De={state:ea,add:Dx,dismiss:Xh},Tx=["data-kind"],Ix={class:"va-toast__icon","aria-hidden":"true"},Fx={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Mx={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Ox={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},Px={key:3,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Lx={class:"va-toast__body"},Bx={class:"va-toast__title"},jx={key:0,class:"va-toast__desc"},Nx=["onClick"],Ux=Ce({__name:"VaToaster",props:{position:{default:"bottom-right"}},setup(e){const t=new Map;let n=new Set;return Ee(()=>De.state.toasts.map(o=>o.id),o=>{let s=0;for(const i of o)n.has(i)||(t.set(i,Math.min(s,8)*40),s++);n=new Set(o);for(const i of[...t.keys()])n.has(i)||t.delete(i)},{immediate:!0}),(o,s)=>(h(),b("div",{class:ye(["va-toast",`va-toast--${e.position}`]),"aria-live":"polite",role:"status"},[j(Ds,{name:"va-toast"},{default:we(()=>[(h(!0),b(G,null,me(p(De).state.toasts,i=>(h(),b("div",{key:i.id,class:"va-toast__item","data-kind":i.kind,style:Le({"--va-toast-stagger":`${p(t).get(i.id)??0}ms`})},[f("span",Ix,[i.kind==="success"?(h(),b("svg",Fx,[...s[0]||(s[0]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):i.kind==="danger"?(h(),b("svg",Mx,[...s[1]||(s[1]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):i.kind==="warning"?(h(),b("svg",Ox,[...s[2]||(s[2]=[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"},null,-1)])])):(h(),b("svg",Px,[...s[3]||(s[3]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 11v5M12 8h.01"},null,-1)])]))]),f("div",Lx,[f("p",Bx,A(i.title),1),i.description?(h(),b("p",jx,A(i.description),1)):E("",!0)]),f("button",{class:"va-toast__close",type:"button","aria-label":"关闭通知",onClick:r=>p(De).dismiss(i.id)},"×",8,Nx)],12,Tx))),128))]),_:1})],2))}});function Qd(e){if(e==="")return[];const t=e.replace(/\r\n?/g,`
|
|
3
|
+
`).split(`
|
|
4
|
+
`);return t[t.length-1]===""&&e.endsWith(`
|
|
5
|
+
`)&&t.pop(),t}const zx=4e6;function Kx(e,t){const n=Qd(e),o=Qd(t),s=n.length,i=o.length;if(s*i>zx)return[...n.map((d,_)=>({type:"del",oldNo:_+1,text:d})),...o.map((d,_)=>({type:"add",newNo:_+1,text:d}))];const r=Array.from({length:s+1},()=>new Uint32Array(i+1));for(let d=s-1;d>=0;d--)for(let _=i-1;_>=0;_--)r[d][_]=n[d]===o[_]?r[d+1][_+1]+1:Math.max(r[d+1][_],r[d][_+1]);const a=[];let l=0,c=0;const u=()=>a.push({type:"same",oldNo:l+1,newNo:c+1,text:n[l]});for(;l<s&&c<i;)n[l]===o[c]?(u(),l++,c++):r[l+1][c]>=r[l][c+1]?(a.push({type:"del",oldNo:l+1,text:n[l]}),l++):(a.push({type:"add",newNo:c+1,text:o[c]}),c++);for(;l<s;)a.push({type:"del",oldNo:l+1,text:n[l]}),l++;for(;c<i;)a.push({type:"add",newNo:c+1,text:o[c]}),c++;return a}function Wx(e){const t=[];for(const n of e){const o=n.sp&&t.length>0?" ":"",s=t[t.length-1];s&&s.kind===n.type?s.text+=o+n.t:t.push({kind:n.type,text:o+n.t})}return t}function Vx(e,t=!0){const n=new Array(e.length).fill(void 0);if(!t)return n;let o=0;for(;o<e.length;){if(e[o].type!=="del"){o++;continue}const s=o;for(;o<e.length&&e[o].type==="del";)o++;const i=o,r=o;for(;o<e.length&&e[o].type==="add";)o++;const a=o,l=Math.min(i-s,a-r);for(let c=0;c<l;c++){const u=e[s+c].text,d=e[r+c].text;if(u===d)continue;const _=[],v=[];for(const g of Wx(Zy(u,d)))(g.kind==="del"||g.kind==="same")&&_.push({kind:g.kind,text:g.text}),(g.kind==="add"||g.kind==="same")&&v.push({kind:g.kind,text:g.text});n[s+c]={del:_,add:v}}}return n}function Qh(e){return`${e.from}-${e.to}`}function qx(e,t=3,n,o){const s=new Uint8Array(e.length);e.forEach((a,l)=>{if(a.type!=="same")for(let c=Math.max(0,l-t);c<=Math.min(e.length-1,l+t);c++)s[c]=1});const i=[];let r=0;for(;r<e.length;){if(s[r]){const _=e[r];i.push(_.type==="same"?{kind:"row",row:_}:{kind:"row",row:_,inline:n?.[r]}),r++;continue}const a=r;for(;r<e.length&&!s[r];)r++;const l=e[a].oldNo??e[a].newNo??a+1,c=e[r-1],u=c.oldNo??c.newNo??r,d=Qh({from:l,to:u});if(o?.has(d))for(let _=a;_<r;_++){const v=e[_];i.push(v.type==="same"?{kind:"row",row:v}:{kind:"row",row:v,inline:n?.[_]})}else i.push({kind:"expand",count:r-a,from:l,to:u})}return i}function Hx(e){const t=T(()=>e.defaultExpandAll?Number.POSITIVE_INFINITY:e.context??3),n=T(()=>Kx(e.oldText,e.newText)),o=T(()=>Vx(n.value,e.wordLevel!==!1)),s=T(()=>{let d=0,_=0;for(const v of n.value)v.type==="add"?d++:v.type==="del"&&_++;return{additions:d,deletions:_}}),i=P(new Set);Ee([()=>e.oldText,()=>e.newText],()=>{i.value=new Set});const r=T(()=>qx(n.value,t.value,o.value,i.value)),a=T(()=>r.value.some(d=>d.kind==="expand")),l=P(e.defaultExpandAll??!1);Ee(l,d=>{d||(i.value=new Set)});function c(d){const _=new Set(i.value);_.add(Qh(d)),i.value=_}const u=T(()=>n.value.length===0||s.value.additions+s.value.deletions===0);return{render:r,stats:s,hasCollapsed:a,expandAll:l,toggleExpand:c,empty:u,rows:n,inline:o}}const Jx={class:"va-cdiff"},Gx={class:"va-cdiff__head"},Zx={key:0,class:"va-cdiff__file"},Yx={class:"va-cdiff__stats",role:"status"},Xx=["aria-pressed"],Qx=["aria-label"],e$=["aria-label"],t$={key:0,class:"va-cdiff__empty"},n$={key:1,class:"va-cdiff__side"},o$=["data-type"],s$={class:"va-cdiff__no","aria-hidden":"true"},i$=["data-side"],r$=["data-kind"],a$={class:"va-cdiff__no","aria-hidden":"true"},l$=["data-side"],c$=["data-kind"],u$=["data-type"],d$={class:"va-cdiff__no","aria-hidden":"true"},f$={class:"va-cdiff__no","aria-hidden":"true"},p$={class:"va-cdiff__sign","aria-hidden":"true"},h$={class:"va-cdiff__code"},v$=["data-seg"],m$=["title","onClick"],ef=Ce({__name:"VaCodeDiff",props:{oldText:{},newText:{},fileName:{},context:{},wordLevel:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean},maxHeight:{},layout:{default:"unified"}},emits:["copy"],setup(e,{emit:t}){const n=e,o=t,{render:s,stats:i,hasCollapsed:r,expandAll:a,toggleExpand:l,empty:c,rows:u,inline:d}=Hx(n),{copied:_,copy:v}=Gc(()=>n.newText,y=>o("copy",y)),g=y=>y==="add"?"+":y==="del"?"−":"",m=T(()=>{if(n.layout!=="side")return[];const y=u.value,x=d.value,$=[];let w=0;const C=(R,O)=>{const B=x[O];return R.type==="del"&&B?{no:R.oldNo,text:R.text,segs:B.del}:R.type==="add"&&B?{no:R.newNo,text:R.text,segs:B.add}:{no:R.oldNo??R.newNo,text:R.text}};for(;w<y.length;){if(y[w].type==="same"){$.push({type:"eq",left:C(y[w],w),right:C(y[w],w)}),w++;continue}const R=w;for(;w<y.length&&y[w].type==="del";)w++;const O=w,B=w;for(;w<y.length&&y[w].type==="add";)w++;const J=w,Q=O-R,re=J-B,ee=Math.max(Q,re);for(let z=0;z<ee;z++){const K=R+z,se=B+z;$.push({type:K<O&&se<J?"pair":K<O?"del":"add",left:K<O?C(y[K],K):void 0,right:se<J?C(y[se],se):void 0})}}return $});return(y,x)=>(h(),b("figure",Jx,[f("header",Gx,[n.fileName?(h(),b("span",Zx,A(n.fileName),1)):E("",!0),f("span",Yx,[p(c)?(h(),b(G,{key:1},[pe("无变更")],64)):(h(),b(G,{key:0},[pe("+"+A(p(i).additions)+" −"+A(p(i).deletions),1)],64))]),x[3]||(x[3]=f("span",{class:"va-cdiff__spacer"},null,-1)),p(r)?(h(),b("button",{key:1,class:"va-act va-act--sm va-cdiff__btn",type:"button","aria-pressed":p(a),onClick:x[0]||(x[0]=$=>a.value=!p(a))},A(p(a)?"折叠上下文":"全部展开"),9,Xx)):E("",!0),f("button",{class:"va-act va-act--sm va-cdiff__btn",type:"button","aria-label":p(_)?"已复制":"复制新文件内容",onClick:x[1]||(x[1]=(...$)=>p(v)&&p(v)(...$))},[f("span",{class:ye(["va-copy",{"va-copy--done":p(_)}]),"aria-hidden":"true"},[...x[2]||(x[2]=[f("span",{class:"va-copy__idle"},"复制新文件",-1),f("span",{class:"va-copy__done"},"已复制 ✓",-1)])],2)],8,Qx)]),f("div",{class:"va-cdiff__body",style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0),tabindex:"0",role:"region","aria-label":`代码差异${n.fileName?`:${n.fileName}`:""}`},[p(c)?(h(),b("p",t$,"两个版本内容一致。")):E("",!0),!p(c)&&n.layout==="side"?(h(),b("div",n$,[(h(!0),b(G,null,me(m.value,($,w)=>(h(),b("div",{key:w,class:"va-cdiff__srow","data-type":$.type},[f("span",s$,A($.left?.no??""),1),f("code",{class:"va-cdiff__code va-cdiff__code--half","data-side":$.left?"old":"empty"},[$.left?.segs?(h(!0),b(G,{key:0},me($.left.segs,(C,R)=>(h(),b("span",{key:R,class:"va-cdiff__seg","data-kind":C.kind},A(C.text),9,r$))),128)):(h(),b(G,{key:1},[pe(A($.left?.text??""),1)],64))],8,i$),f("span",a$,A($.right?.no??""),1),f("code",{class:"va-cdiff__code va-cdiff__code--half","data-side":$.right?"new":"empty"},[$.right?.segs?(h(!0),b(G,{key:0},me($.right.segs,(C,R)=>(h(),b("span",{key:R,class:"va-cdiff__seg","data-kind":C.kind},A(C.text),9,c$))),128)):(h(),b(G,{key:1},[pe(A($.right?.text??""),1)],64))],8,l$)],8,o$))),128))])):E("",!0),!p(c)&&n.layout!=="side"?(h(!0),b(G,{key:2},me(p(s),($,w)=>(h(),b(G,{key:w},[$.kind==="row"?(h(),b("div",{key:0,class:"va-cdiff__row","data-type":$.row.type},[f("span",d$,A($.row.oldNo??""),1),f("span",f$,A($.row.newNo??""),1),f("span",p$,A(g($.row.type)),1),f("code",h$,[$.inline?(h(!0),b(G,{key:0},me($.row.type==="del"?$.inline.del:$.inline.add,(C,R)=>(h(),b("span",{key:R,class:"va-cdiff__seg","data-seg":C.kind},A(C.text),9,v$))),128)):(h(),b(G,{key:1},[pe(A($.row.text),1)],64))])],8,u$)):(h(),b("button",{key:1,class:"va-cdiff__expand",type:"button","aria-expanded":!1,title:`展开第 ${$.from}–${$.to} 行`,onClick:C=>p(l)($)}," ⋯ 展开隐藏的 "+A($.count)+" 行 ",9,m$))],64))),128)):E("",!0)],12,e$)]))}}),uc={modified:"M",added:"A",deleted:"D",untracked:"U"};function _$(e,t){const n=[],o=(s,i)=>{for(const r of s){const a=r.type==="dir"||(r.children?.length??0)>0,l=a&&t(r.path);n.push({node:r,level:i,isDir:a,expanded:l}),l&&r.children?.length&&o(r.children,i+1)}};return o(e,1),n}function dc(e){return e.children?.length?e.children.reduce((t,n)=>t+dc(n),0):e.status?1:0}function g$(e){const t=P(new Set);Ee(()=>e.tree,d=>{const _=new Set,v=e.defaultExpandDepth??1,g=(m,y)=>{for(const x of m)x.children?.length&&y<=v&&(_.add(x.path),g(x.children,y+1))};g(d,1),t.value=_},{immediate:!0});function n(d,_){const v=new Set(t.value),g=_??!v.has(d);return g?v.add(d):v.delete(d),t.value=v,g}const o=P(!1),s=P(e.defaultSelected),i=T(()=>e.selected!==void 0||o.value?e.selected:s.value);function r(d){return o.value=!0,s.value=d,d}const a=T(()=>_$(e.tree,d=>t.value.has(d))),l=P(a.value[0]?.node.path);Ee(a,d=>{d.some(_=>_.node.path===l.value)||(l.value=d[0]?.node.path)});function c(d){const _=a.value,v=_.findIndex(m=>m.node.path===l.value),g=_[Math.min(_.length-1,Math.max(0,v+d))];g&&(l.value=g.node.path)}function u(d){return l.value===d}return{expanded:t,toggleDir:n,currentSelected:i,select:r,rows:a,focusedPath:l,moveFocus:c,isActive:u}}const b$={class:"va-ftree"},y$={key:0,class:"va-ftree__head"},k$=["aria-label"],w$=["aria-level","aria-expanded","aria-selected","data-active","tabindex","onClick","onKeydown"],x$=["data-open"],$$={key:1,class:"va-ftree__dot","aria-hidden":"true"},C$={class:"va-ftree__name"},A$={key:2,class:"va-ftree__count","aria-label":"含变更文件"},S$=["data-status","title"],R$={key:0,class:"va-ftree__empty va-fade-in"},fc=Ce({__name:"VaFileTree",props:{tree:{},defaultExpandDepth:{},selected:{},defaultSelected:{},title:{},maxHeight:{},lazy:{type:Boolean,default:!1}},emits:["update:selected","select","toggle","load","open"],setup(e,{emit:t}){const n=e,o=t,s={modified:"已修改",added:"新增",deleted:"删除",untracked:"未跟踪"},{toggleDir:i,currentSelected:r,select:a,rows:l,moveFocus:c,isActive:u}=g$(n),d=P(null);function _(x){n.lazy&&x.isDir&&!x.expanded&&x.node.children===void 0&&o("load",x.node)}function v(x){if(x.isDir){_(x);const $=i(x.node.path);o("toggle",x.node,$);return}o("update:selected",a(x.node.path)),o("select",x.node),o("open",x.node)}function g(){it(()=>d.value?.querySelector("[data-active='true']")?.focus())}function m(x,$){switch(x.key){case"ArrowUp":x.preventDefault(),c(-1),g();break;case"ArrowDown":x.preventDefault(),c(1),g();break;case"ArrowRight":$.isDir&&!$.expanded&&(x.preventDefault(),_($),o("toggle",$.node,i($.node.path,!0)));break;case"ArrowLeft":if($.isDir&&$.expanded)x.preventDefault(),o("toggle",$.node,i($.node.path,!1));else{const w=$.node.path.split("/").slice(0,-1).join("/");w&&(x.preventDefault(),y(w))}break;case"Enter":case" ":x.preventDefault(),v($);break}}function y(x){const $=l.value.findIndex(w=>w.node.path===x);if($>=0){const w=l.value.findIndex(C=>u(C.node.path));w>=0&&c($-w),g()}}return(x,$)=>(h(),b("div",b$,[n.title?(h(),b("header",y$,A(n.title),1)):E("",!0),f("div",{ref_key:"rootEl",ref:d,class:"va-ftree__body",role:"tree","aria-label":n.title||"文件树",style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[(h(!0),b(G,null,me(p(l),w=>(h(),b("div",{key:w.node.path,role:"treeitem","aria-level":w.level,"aria-expanded":w.isDir?w.expanded:void 0,"aria-selected":w.isDir?void 0:p(r)===w.node.path,"data-active":p(u)(w.node.path),tabindex:p(u)(w.node.path)?0:-1,class:ye(["va-ftree__row",{"va-ftree__row--dir":w.isDir,"va-ftree__row--selected":!w.isDir&&p(r)===w.node.path}]),style:Le({paddingLeft:`${(w.level-1)*16+8}px`}),onClick:C=>v(w),onKeydown:C=>m(C,w)},[w.isDir?(h(),b("span",{key:0,class:"va-ftree__caret","aria-hidden":"true","data-open":w.expanded||void 0},[j(p(os),{size:12})],8,x$)):(h(),b("span",$$)),f("span",C$,A(w.node.path.split("/").pop()),1),$[0]||($[0]=f("span",{class:"va-ftree__spacer"},null,-1)),w.isDir&&p(dc)(w.node)?(h(),b("span",A$,A(p(dc)(w.node)),1)):E("",!0),w.node.status?(h(),b("span",{key:3,class:"va-ftree__status","data-status":w.node.status,title:`${p(uc)[w.node.status]} · ${s[w.node.status]}`},A(p(uc)[w.node.status]),9,S$)):E("",!0)],46,w$))),128)),p(l).length?E("",!0):(h(),b("p",R$,"没有文件。"))],12,k$)]))}}),Br=["#4f5b66","#e06c75","#98c379","#e5c07b","#61afef","#c678dd","#56b6c2","#abb2bf","#5c6370","#e06c75","#98c379","#e5c07b","#61afef","#c678dd","#56b6c2","#ffffff"];function E$(e){if(e<16)return Br[e];if(e<232){const n=e-16,o=[0,95,135,175,215,255],s=o[Math.floor(n/36)%6],i=o[Math.floor(n/6)%6],r=o[n%6];return`rgb(${s}, ${i}, ${r})`}const t=8+(e-232)*10;return`rgb(${t}, ${t}, ${t})`}const tf=/\x1b\[([0-9;:]*)([A-Za-z])/g,D$=/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g;function T$(e,t){let n=0;for(;n<t.length;){const o=t[n];if(o===0)e.color=e.bgColor=void 0,e.bold=e.dim=e.italic=e.underline=void 0;else if(o===1)e.bold=!0;else if(o===2)e.dim=!0;else if(o===3)e.italic=!0;else if(o===4)e.underline=!0;else if(o===22)e.bold=e.dim=void 0;else if(o===23)e.italic=void 0;else if(o===24)e.underline=void 0;else if(o>=30&&o<=37)e.color=Br[o-30];else if(o===38||o===48){const s=t[n+1],i=o===38?"color":"bgColor";s===5&&t[n+2]!==void 0?(e[i]=E$(t[n+2]),n+=2):s===2&&t[n+4]!==void 0&&(e[i]=`rgb(${t[n+2]}, ${t[n+3]}, ${t[n+4]})`,n+=4)}else o===39?e.color=void 0:o===49?e.bgColor=void 0:o>=90&&o<=97?e.color=Br[o-90+8]:o>=100&&o<=107&&(e.bgColor=Br[o-100+8]);n++}}function nf(e,t,n){const o=n.color||n.bgColor||n.bold||n.dim||n.italic||n.underline;e.push(o?{text:t,...n}:{text:t})}function I$(e){const t=e.split("\r");let n=t[t.length-1]??"";n=n.replace(D$,"");const o=[],s={};let i="",r=0;tf.lastIndex=0;for(const a of n.matchAll(tf)){if(a.index>r&&(i+=n.slice(r,a.index)),r=a.index+a[0].length,a[2]!=="m")continue;i&&(nf(o,i,s),i="");const l=(a[1]??"").split(";").map(c=>c===""?0:Number.parseInt(c,10));T$(s,l.length?l:[0])}return r<n.length&&(i+=n.slice(r)),i&&nf(o,i,s),o}function F$(e,t){const n=T(()=>{const c=e.maxLines??1e3,u=e.lines.map((d,_)=>typeof d=="string"?{text:d,id:String(_)}:{id:String(_),...d});return u.length>c?u.slice(u.length-c):u}),o=T(()=>n.value.map(c=>c.text.includes("\x1B")?I$(c.text):[{text:c.text}])),s=c=>o.value[c].map(u=>u.text).join(""),i=P(!0);function r(){const c=t.value;c&&(i.value=c.scrollTop+c.clientHeight>=c.scrollHeight-32)}function a(){const c=t.value;if(!c)return;const u=typeof window<"u"&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1);c.scrollTo({top:c.scrollHeight,behavior:u?"auto":"smooth"})}Ee(()=>e.lines.length,()=>{!e.autoScroll||!i.value||it(a)});let l;return Ct(()=>{const c=t.value;c&&e.autoScroll&&(c.scrollTop=c.scrollHeight),typeof ResizeObserver<"u"&&c&&(l=new ResizeObserver(()=>{i.value&&e.autoScroll&&(c.scrollTop=c.scrollHeight)}),l.observe(c))}),vt(()=>l?.disconnect()),{rows:n,spans:o,plainText:s,onScroll:r}}const M$={class:"va-term"},O$={class:"va-term__head"},P$={class:"va-term__title"},L$={key:0,class:"va-term__count"},B$=["aria-label"],j$={key:0,class:"va-term__empty"},N$=["data-kind"],U$={key:0,class:"va-term__no","aria-hidden":"true"},z$={class:"va-term__code"},K$=["aria-label","onClick"],W$=Ce({__name:"VaTerminalLog",props:{lines:{},title:{},autoScroll:{type:Boolean,default:!0},maxLines:{},showLineNumbers:{type:Boolean},maxHeight:{}},emits:["copy"],setup(e,{emit:t}){const n=e,o=t,s=rt("body"),{rows:i,spans:r,plainText:a,onScroll:l}=F$(n,s),c=P(null),{copied:u,copy:d}=Gc(()=>c.value!==null?a(c.value):"");Ee(u,g=>{g&&c.value!==null&&o("copy",a(c.value))});function _(g,m){m.stopPropagation(),c.value=g,d()}const v=(g,m)=>({color:g,backgroundColor:m});return(g,m)=>(h(),b("figure",M$,[f("header",O$,[m[1]||(m[1]=f("span",{class:"va-term__dots","aria-hidden":"true"},[f("i"),f("i"),f("i")],-1)),f("span",P$,A(n.title??"terminal"),1),m[2]||(m[2]=f("span",{class:"va-term__spacer"},null,-1)),p(i).length?(h(),b("span",L$,A(p(i).length)+" 行",1)):E("",!0)]),f("div",{ref:"body",class:ye(["va-term__body",{"va-term__body--scroll":n.maxHeight}]),style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0),tabindex:"0",role:"log","aria-label":`${n.title??"终端"}输出`,onScroll:m[0]||(m[0]=(...y)=>p(l)&&p(l)(...y))},[p(i).length?E("",!0):(h(),b("p",j$,"等待输出…")),(h(!0),b(G,null,me(p(i),(y,x)=>(h(),b("div",{key:y.id,class:"va-term__row","data-kind":y.kind??"out"},[n.showLineNumbers?(h(),b("span",U$,A(x+1),1)):E("",!0),f("code",z$,[(h(!0),b(G,null,me(p(r)[x],($,w)=>(h(),b("span",{key:w,style:Le(v($.color,$.bgColor)),class:ye({"va-term__b":$.bold,"va-term__i":$.italic,"va-term__u":$.underline,"va-term__dim":$.dim})},A($.text),7))),128))]),f("button",{class:"va-term__copy",type:"button","aria-label":p(u)&&c.value===x?`第 ${x+1} 行已复制`:`复制第 ${x+1} 行`,onClick:$=>_(x,$)},[f("span",{class:ye(["va-copy",{"va-copy--done":p(u)&&c.value===x}]),"aria-hidden":"true"},[...m[3]||(m[3]=[f("span",{class:"va-copy__idle"},"⧉",-1),f("span",{class:"va-copy__done"},"✓",-1)])],2)],8,K$)],8,N$))),128))],46,B$)]))}});function ev(e,t=Date.now()){const n=Math.max(0,t-e),o=Math.floor(n/6e4);if(o<1)return"刚刚";if(o<60)return`${o} 分钟前`;const s=new Date(e),i=`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`,r=new Date(t),a=new Date(t-864e5);return s.toDateString()===r.toDateString()?`今天 ${i}`:s.toDateString()===a.toDateString()?`昨天 ${i}`:`${s.getMonth()+1}-${s.getDate()} ${i}`}const V$={class:"va-cmt"},q$={key:0,class:"va-cmt__empty va-fade-in"},H$=["src","alt"],J$={class:"va-cmt__main"},G$={class:"va-cmt__head"},Z$={class:"va-cmt__author"},Y$=["data-agent"],X$={key:1,class:"va-cmt__time"},Q$={class:"va-cmt__text"},eC={key:0,class:"va-cmt__pending-ops"},tC=["onClick"],nC=["onClick"],oC=["onClick"],sC=["placeholder"],iC=["disabled"],rC=Ce({__name:"VaCommentThread",props:{comments:{},placeholder:{},busy:{type:Boolean},composer:{type:Boolean,default:!0},maxHeight:{}},emits:["submit","adopt","rewrite","discard"],setup(e,{emit:t}){const n=e,o=t,s=T(()=>n.comments.length>0),i=Da(3e4,s),r=P(""),a=rt("area");function l(){const v=r.value.trim();!v||n.busy||(o("submit",v),r.value="",requestAnimationFrame(()=>a.value?.focus()))}function c(v){v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),l())}const u=[16,145,210,268,34,190],d=v=>({background:`hsl(${u[v.length%u.length]} 45% 88%)`,color:`hsl(${u[v.length%u.length]} 45% 30%)`}),_=(v,g)=>g??v.slice(0,1).toUpperCase();return(v,g)=>(h(),b("div",V$,[f("div",{class:"va-cmt__list",style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[n.comments.length?E("",!0):(h(),b("p",q$,"还没有评论,说点什么吧。")),(h(!0),b(G,null,me(n.comments,m=>(h(),b("article",{key:m.id,class:ye(["va-cmt__item",{"va-cmt__item--pending":m.pending}])},[m.avatar?(h(),b("img",{key:0,class:"va-cmt__avatar",src:m.avatar,alt:m.author},null,8,H$)):(h(),b("span",{key:1,class:"va-cmt__avatar va-cmt__avatar--text",style:Le(d(m.author)),"aria-hidden":"true"},A(_(m.author,m.initials)),5)),f("div",J$,[f("header",G$,[f("span",Z$,A(m.author),1),m.role?(h(),b("span",{key:0,class:"va-cmt__role","data-agent":m.pending??!1},A(m.role),9,Y$)):E("",!0),m.createdAt?(h(),b("span",X$,A(p(ev)(m.createdAt,p(i))),1)):E("",!0)]),f("p",Q$,A(m.text),1),m.pending?(h(),b("footer",eC,[f("button",{class:"va-act va-act--sm va-act--primary va-cmt__op",type:"button",onClick:y=>o("adopt",m.id)},"以此发布",8,tC),f("button",{class:"va-act va-act--sm va-cmt__op",type:"button",onClick:y=>o("rewrite",m.id)},"让 agent 重写",8,nC),f("button",{class:"va-act va-act--sm va-act--ghost va-cmt__op va-cmt__op--discard",type:"button",onClick:y=>o("discard",m.id)},"丢弃",8,oC)])):E("",!0)])],2))),128))],4),n.composer?(h(),b("form",{key:0,class:"va-cmt__composer",onSubmit:Fe(l,["prevent"])},[Ve(f("textarea",{ref_key:"area",ref:a,"onUpdate:modelValue":g[0]||(g[0]=m=>r.value=m),class:"va-cmt__area",rows:"1",placeholder:n.placeholder??"写下评论…","aria-label":"评论输入",onKeydown:c},null,40,sC),[[st,r.value]]),f("button",{class:"va-act va-act--primary va-cmt__send",type:"submit",disabled:!r.value.trim()||n.busy},A(n.busy?"发布中…":"发布"),9,iC)],32)):E("",!0)]))}}),aC=["data-level"],lC={class:"va-usage__head"},cC={class:"va-usage__amount"},uC={class:"va-usage__limit"},dC={class:"va-usage__period"},fC=["aria-valuemax","aria-valuenow","aria-label"],pC={key:0,class:"va-usage__alert",role:"status"},hC={key:1,class:"va-usage__legend"},vC={class:"va-usage__label"},mC={class:"va-usage__value"},_C={class:"va-usage__pct"},of=Ce({__name:"VaUsageMeter",props:{segments:{},limit:{},unit:{},period:{},warnAt:{},barHeight:{}},emits:["manage"],setup(e,{emit:t}){const n=e,o=t,s=["var(--va-info)","var(--va-accent)","var(--va-success)","var(--va-warning)"],i=T(()=>n.segments.reduce((d,_)=>d+_.used,0)),r=T(()=>n.limit>0?i.value/n.limit:0),a=T(()=>n.warnAt??.8),l=T(()=>r.value>=1?"exceeded":r.value>=a.value?"warn":"ok"),c=d=>d.toLocaleString("en-US"),u=(d,_)=>({width:n.limit>0?`${Math.min(100,_/n.limit*100)}%`:"0%",background:n.segments[d].color??s[d%s.length]});return(d,_)=>(h(),b("div",{class:"va-usage","data-level":l.value},[f("header",lC,[f("span",cC,[f("strong",null,A(c(i.value)),1),f("span",uC,"/ "+A(c(n.limit))+" "+A(n.unit??""),1)]),f("span",dC,A(n.period),1)]),f("div",{class:"va-usage__bar",role:"meter","aria-valuemin":0,"aria-valuemax":n.limit,"aria-valuenow":i.value,"aria-label":`已用 ${c(i.value)} / ${c(n.limit)} ${n.unit??""}`,style:Le({height:`${n.barHeight??10}px`})},[(h(!0),b(G,null,me(n.segments,(v,g)=>(h(),b("span",{key:v.label,class:"va-usage__seg",style:Le(u(g,v.used))},null,4))),128))],12,fC),l.value!=="ok"?(h(),b("p",pC,[l.value==="exceeded"?(h(),b(G,{key:0},[pe("已超出限额,新任务将被限流")],64)):(h(),b(G,{key:1},[pe("已用 "+A(Math.round(r.value*100))+"%,接近本期限额",1)],64)),f("button",{class:"va-act va-act--sm va-usage__manage",type:"button",onClick:_[0]||(_[0]=v=>o("manage"))},"管理额度")])):(h(),b("ul",hC,[(h(!0),b(G,null,me(n.segments,(v,g)=>(h(),b("li",{key:v.label,class:"va-usage__item"},[f("span",{class:"va-usage__swatch",style:Le({background:v.color??s[g%s.length]})},null,4),f("span",vC,A(v.label),1),f("span",mC,A(c(v.used)),1),f("span",_C,A(n.limit>0?Math.round(v.used/n.limit*100):0)+"%",1)]))),128))]))],8,aC))}});function gC(e,t,n,o){const s=P(!1),i=P(e.defaultOpen??!1),r=T(()=>e.open!==void 0||s.value?e.open:i.value);let a=null;function l(){s.value=!0,i.value=!0,o["update:open"](!0)}function c(){s.value=!0,i.value=!1,o["update:open"](!1)}Ee(r,C=>{C?(typeof document<"u"&&(a=document.activeElement),u.value="",g.value=0,it(()=>t.value?.focus())):a&&typeof a.focus=="function"&&(a.focus(),a=null)});const u=P(""),d=T(()=>{const C=u.value.trim().toLowerCase();return C?e.commands.filter(R=>R.label.toLowerCase().includes(C)||R.keywords?.toLowerCase().includes(C)):e.commands}),_=T(()=>{const C=[];for(const R of d.value){const O=C[C.length-1];O&&O.group===R.group?O.items.push(R):C.push({group:R.group,items:[R]})}return C}),v=T(()=>_.value.flatMap(C=>C.items)),g=P(0);Ee(d,()=>{g.value=0});function m(C){const R=v.value.length;R&&(g.value=(g.value+C+R)%R,it(()=>{n.value?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"})}))}function y(C){C.disabled||(o.select(C),c())}function x(C){if(C.key==="ArrowDown")C.preventDefault(),m(1);else if(C.key==="ArrowUp")C.preventDefault(),m(-1);else if(C.key==="Enter"){C.preventDefault();const R=v.value[g.value];R&&y(R)}else C.key==="Escape"&&(C.preventDefault(),c())}function $(C){C.key==="Tab"&&(C.preventDefault(),t.value?.focus())}function w(){c()}return{isOpen:r,openMenu:l,closeMenu:c,query:u,filtered:d,flat:v,groups:_,activeIdx:g,onInputKeydown:x,trapTab:$,onBackdropClick:w,pick:y}}const bC={class:"va-cmd"},yC=["aria-expanded"],kC={key:0,class:"va-cmd__kbd"},wC={class:"va-cmd__search"},xC=["aria-activedescendant","placeholder"],$C={id:"va-cmd-list",class:"va-cmd__list",role:"listbox","aria-label":"命令列表"},CC={key:0,class:"va-cmd__empty va-fade-in"},AC={key:0,class:"va-cmd__group","aria-hidden":"true"},SC=["id","aria-selected","aria-disabled","data-active","data-danger","disabled","onClick","onMousemove"],RC={class:"va-cmd__label"},EC={key:0,class:"va-cmd__kbd"},DC=Ce({__name:"VaCommandMenu",props:{commands:{},open:{type:Boolean},defaultOpen:{type:Boolean},placeholder:{},hotkey:{},triggerLabel:{},hideTrigger:{type:Boolean},emptyLabel:{},maxHeight:{}},emits:["update:open","select"],setup(e,{emit:t}){const n=e,o=t,s=rt("input"),i=rt("panel"),{isOpen:r,openMenu:a,query:l,flat:c,groups:u,activeIdx:d,onInputKeydown:_,trapTab:v,onBackdropClick:g,pick:m}=gC(n,s,i,{"update:open":x=>o("update:open",x),select:x=>o("select",x)});function y(x){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a())}return(x,$)=>(h(),b("span",bC,[n.hideTrigger?E("",!0):(h(),b("button",{key:0,class:"va-cmd__trigger",type:"button","aria-expanded":p(r),"aria-haspopup":"dialog",onClick:$[0]||($[0]=(...w)=>p(a)&&p(a)(...w)),onKeydown:y},[$[5]||($[5]=f("span",{class:"va-cmd__icon","aria-hidden":"true"},"⌘",-1)),pe(" "+A(n.triggerLabel??"命令")+" ",1),n.hotkey?(h(),b("kbd",kC,A(n.hotkey),1)):E("",!0)],40,yC)),(h(),ce(Bc,{to:"body"},[p(r)?(h(),b("div",{key:0,class:"va-cmd__backdrop",onClick:$[1]||($[1]=(...w)=>p(g)&&p(g)(...w)),onKeydown:$[2]||($[2]=(...w)=>p(v)&&p(v)(...w))},null,32)):E("",!0),p(r)?(h(),b("div",{key:1,ref:"panel",class:"va-cmd__panel",role:"dialog","aria-modal":"true","aria-label":"命令面板",style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[f("div",wC,[$[6]||($[6]=f("span",{class:"va-cmd__mag","aria-hidden":"true"},"⌕",-1)),Ve(f("input",{ref:"input","onUpdate:modelValue":$[3]||($[3]=w=>ut(l)?l.value=w:null),class:"va-cmd__input",type:"text",role:"combobox","aria-expanded":"true","aria-controls":"va-cmd-list","aria-activedescendant":p(c)[p(d)]?`va-cmd-opt-${p(c)[p(d)].id}`:void 0,placeholder:n.placeholder??"输入命令或搜索…","aria-label":"搜索命令",autocomplete:"off",onKeydown:$[4]||($[4]=(...w)=>p(_)&&p(_)(...w))},null,40,xC),[[st,p(l)]]),$[7]||($[7]=f("kbd",{class:"va-cmd__kbd va-cmd__kbd--fixed"},"esc",-1))]),f("div",$C,[p(c).length?E("",!0):(h(),b("p",CC,A(n.emptyLabel??"没有匹配的命令"),1)),(h(!0),b(G,null,me(p(u),w=>(h(),b(G,{key:w.group??""},[w.group?(h(),b("div",AC,A(w.group),1)):E("",!0),(h(!0),b(G,null,me(w.items,C=>(h(),b("button",{id:`va-cmd-opt-${C.id}`,key:C.id,class:"va-cmd__item",type:"button",role:"option","aria-selected":p(c)[p(d)]?.id===C.id,"aria-disabled":C.disabled,"data-active":p(c)[p(d)]?.id===C.id,"data-danger":C.danger,disabled:C.disabled,onClick:R=>p(m)(C),onMousemove:R=>d.value=p(c).findIndex(O=>O.id===C.id)},[f("span",RC,A(C.label),1),C.hint?(h(),b("kbd",EC,A(C.hint),1)):E("",!0)],40,SC))),128))],64))),128))])],4)):E("",!0)]))]))}}),TC=8,tv=6;function sf(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function nv(e){const[t,n]=e.split("-");return{side:t,align:n??"center"}}function rf(e,t){return t==="center"?e:`${e}-${t}`}function af(e,t,n){return e==="start"?t.left:e==="end"?t.right-n:t.left+t.width/2-n/2}function IC(e,t,n,o,s){switch(e){case"bottom":return{x:af(t,n,o.width),y:n.bottom+s};case"top":return{x:af(t,n,o.width),y:n.top-o.height-s};case"right":return{x:n.right+s,y:n.top+n.height/2-o.height/2};case"left":return{x:n.left-o.width-s,y:n.top+n.height/2-o.height/2}}}function FC(e,t,n,o,s,i){const{side:r,align:a}=nv(e);if(r!=="top"&&r!=="bottom")return e;const l=n.height+s,c=o.height-t.bottom-i,u=t.top-i;return r==="bottom"&&l>c&&l<=u?rf("top",a):r==="top"&&l>u&&l<=c?rf("bottom",a):e}function MC(e,t,n,o,s){return{x:sf(e,s,o.width-n.width-s),y:sf(t,s,o.height-n.height-s)}}function OC(e){const t=e.offset??tv,n=e.padding??TC,o=FC(e.placement,e.anchorRect,e.floatingSize,e.viewport,t,n),{side:s,align:i}=nv(o),r=IC(s,i,e.anchorRect,e.floatingSize,t),{x:a,y:l}=MC(r.x,r.y,e.floatingSize,e.viewport,n);return{x:a,y:l,placement:o,minWidth:e.matchAnchorWidth?e.anchorRect.width:void 0}}const gs=[];let PC=0;const lf=()=>typeof window<"u"&&typeof document<"u";function cf(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function LC(e,t){return e?e instanceof Element&&e.contains(t):!1}function BC(e){const t=++PC,n=P({x:0,y:0}),o=P(e.placement.value),s=P(null),i=P(!1);let r=null,a=!1,l=null;function c(){if(!lf()||!e.open.value)return;const x=e.anchor.value,$=e.floating.value;if(!x||!$)return;const w=OC({anchorRect:cf(x.getBoundingClientRect()),floatingSize:cf($.getBoundingClientRect()),placement:e.placement.value,offset:e.offset.value,viewport:{width:window.innerWidth,height:window.innerHeight},matchAnchorWidth:e.matchAnchorWidth.value});n.value={x:w.x,y:w.y},o.value=w.placement,s.value=w.minWidth??null,i.value=!0}function u(){if(typeof requestAnimationFrame!="function"){c();return}r===null&&(r=requestAnimationFrame(()=>{r=null,c()}))}const d=()=>u(),_=x=>{if(!e.open.value||!e.closeOnOutsideClick.value)return;const $=x.target;if(!$)return;const w=e.floating.value;w&&w.contains($)||LC(e.anchor.value,$)||e.onRequestClose()},v=x=>{x.key==="Escape"&&(!e.open.value||!e.closeOnEscape.value||gs[gs.length-1]===t&&e.onRequestClose())};function g(){if(!lf()||a)return;a=!0,window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),document.addEventListener("mousedown",_),document.addEventListener("keydown",v),gs.includes(t)||gs.push(t);const x=e.floating.value;x&&typeof ResizeObserver=="function"&&(l=new ResizeObserver(()=>u()),l.observe(x))}function m(){if(!a)return;a=!1,window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),l?.disconnect(),l=null,document.removeEventListener("mousedown",_),document.removeEventListener("keydown",v);const x=gs.indexOf(t);x>=0&&gs.splice(x,1),r!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(r),r=null)}return Ee(e.open,async x=>{x?(await it(),c(),g()):(m(),i.value=!1)},{flush:"post"}),Ee([e.placement,e.offset,e.anchor,e.matchAnchorWidth],()=>{e.open.value&&u()}),Ct(()=>{e.open.value&&(c(),g())}),vt(m),{floatingStyle:T(()=>({position:"fixed",top:`${n.value.y}px`,left:`${n.value.x}px`,...s.value!=null?{minWidth:`${s.value}px`}:{},visibility:i.value?"visible":"hidden"})),actualPlacement:o,measured:i,update:c}}const jC=["data-open","data-disabled"],NC=["data-placement"],ho=Ce({__name:"VaPopover",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},anchor:{},placement:{},offset:{},matchAnchorWidth:{type:Boolean},closeOnOutsideClick:{type:Boolean,default:void 0},closeOnEscape:{type:Boolean,default:void 0},disabled:{type:Boolean},teleportTo:{}},emits:["update:open","open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=P(o.defaultOpen??!1),r=T(()=>o.open??i.value);function a(O){O!==r.value&&(i.value=O,s("update:open",O),s(O?"open":"close"))}function l(){o.disabled||a(!0)}function c(){a(!1)}function u(){r.value?c():l()}Ee(()=>o.disabled,O=>{O&&c()});const d=T(()=>o.placement??"bottom-start"),_=T(()=>o.offset??tv),v=T(()=>o.matchAnchorWidth??!1),g=T(()=>o.closeOnOutsideClick??!0),m=T(()=>o.closeOnEscape??!0),y=rt("trigger"),x=rt("floating"),$=T(()=>o.anchor??y.value??null),{floatingStyle:w,actualPlacement:C,update:R}=BC({anchor:$,floating:x,open:r,placement:d,offset:_,matchAnchorWidth:v,closeOnOutsideClick:g,closeOnEscape:m,onRequestClose:c});return t({open:l,close:c,toggle:u,update:R}),(O,B)=>(h(),b(G,null,[O.$slots.trigger?(h(),b("span",{key:0,ref:"trigger",class:"va-pop__trigger","data-open":r.value,"data-disabled":o.disabled||void 0,onClick:u},[Je(O.$slots,"trigger",{open:r.value,toggle:u})],8,jC)):E("",!0),(h(),ce(Bc,{to:o.teleportTo??"body"},[j(ts,{name:"va-pop"},{default:we(()=>[r.value?(h(),b("div",{key:0,ref:"floating",class:"va-pop",style:Le(p(w)),"data-placement":p(C)},[Je(O.$slots,"default",{close:c})],12,NC)):E("",!0)]),_:3})],8,["to"]))],64))}});function UC(e,t,n){const s=`va-sel-${Ji()}-list`,i=P(e.defaultOpen??!1),r=P(""),a=P(-1),l=P(e.defaultValue??(e.multiple?[]:void 0)),c=T(()=>e.modelValue??l.value??(e.multiple?[]:"")),u=T(()=>Array.isArray(c.value)?c.value:c.value?[c.value]:[]),d=T(()=>e.options.filter(L=>u.value.includes(L.value))),_=T(()=>u.value.length>0);function v(L){return u.value.includes(L.value)}const g=T(()=>{const L=r.value.trim().toLowerCase();return L?e.options.filter(H=>H.label.toLowerCase().includes(L)||H.value.toLowerCase().includes(L)):e.options}),m=T(()=>{const L=g.value.filter(Y=>!Y.group),H=[];for(const Y of g.value)Y.group&&!H.includes(Y.group)&&H.push(Y.group);return[...L,...H.flatMap(Y=>g.value.filter(Ae=>Ae.group===Y))].map((Y,Ae)=>({option:Y,index:Ae,domId:`${s}-opt-${Ae}`}))}),y=T(()=>{const L=[];for(const H of m.value){const W=H.option.group;if(W){let Y=L[L.length-1];(!Y||Y.type!=="group"||Y.label!==W)&&(Y={type:"group",label:W,titleId:`${s}-group-${L.length}`,items:[]},L.push(Y)),Y.items.push(H)}else{let Y=L[L.length-1];(!Y||Y.type!=="plain")&&(Y={type:"plain",items:[]},L.push(Y)),Y.items.push(H)}}return L});function x(L){i.value!==L&&(i.value=L,n.visibleChange(L))}function $(){e.disabled||i.value||x(!0)}function w(){x(!1)}function C(){i.value?w():$()}function R(){t.trigger.value?.focus()}Ee(i,L=>{if(L){r.value="";const H=m.value,W=H.findIndex(Ae=>v(Ae.option)&&!Ae.option.disabled),Y=H.findIndex(Ae=>!Ae.option.disabled);a.value=W>=0?W:Y,it(()=>{e.searchable&&t.search.value?.focus(),re()})}else r.value="",a.value=-1});function O(L,H){l.value=L,n["update:modelValue"](L),n.change(L,H)}function B(L){if(!L.disabled)if(e.multiple){const H=[...u.value],W=H.indexOf(L.value);W>=0?H.splice(W,1):H.push(L.value),O(H,L),r.value=""}else O(L.value,L),w(),R()}const J=T(()=>!!(e.clearable&&_.value&&!e.disabled&&!e.loading));function Q(L){L.stopPropagation();const H=e.multiple?[]:"";l.value=H,n["update:modelValue"](H),n.clear(),R()}function re(){if(typeof document>"u")return;const L=m.value[a.value];L&&document.getElementById(L.domId)?.scrollIntoView?.({block:"nearest"})}function ee(L){const H=m.value,W=H.length;if(!W)return;let Y=a.value;for(let Ae=0;Ae<W;Ae++)if(Y=(Y+L+W)%W,!H[Y].option.disabled){a.value=Y,re();return}}function z(L){const H=m.value,Y=(L==="first"?H:[...H].reverse()).find(Ae=>!Ae.option.disabled);Y&&(a.value=Y.index,re())}function K(L){const H=m.value,W=H.length;if(!W)return;const Y=L.toLowerCase();for(let Ae=1;Ae<=W;Ae++){const ze=(a.value+Ae)%W,Ze=H[ze];if(!Ze.option.disabled&&Ze.option.label.toLowerCase().startsWith(Y)){a.value=ze,re();return}}}function se(){const L=m.value[a.value];L&&B(L.option)}const le=T(()=>i.value&&a.value>=0?m.value[a.value]?.domId:void 0);function ae(L){if(!e.disabled){if(!i.value){(L.key==="ArrowDown"||L.key==="ArrowUp"||L.key==="Enter"||L.key===" ")&&(L.preventDefault(),$());return}switch(L.key){case"ArrowDown":L.preventDefault(),ee(1);break;case"ArrowUp":L.preventDefault(),ee(-1);break;case"Home":L.preventDefault(),z("first");break;case"End":L.preventDefault(),z("last");break;case"Enter":case" ":L.preventDefault(),se();break;case"Escape":L.preventDefault(),L.stopPropagation(),w(),R();break;case"Tab":w();break;default:L.key.length===1&&!L.ctrlKey&&!L.metaKey&&!L.altKey&&K(L.key)}}}function ve(L){L.key===" "&&L.preventDefault()}function fe(L){switch(L.key){case"ArrowDown":L.preventDefault(),ee(1);break;case"ArrowUp":L.preventDefault(),ee(-1);break;case"Home":L.preventDefault(),z("first");break;case"End":L.preventDefault(),z("last");break;case"Enter":L.preventDefault(),se();break;case"Escape":L.preventDefault(),L.stopPropagation(),w(),R();break}}return Ee(m,L=>{if(i.value){if(!L.length){a.value=-1;return}(a.value<0||a.value>=L.length)&&(a.value=L.findIndex(H=>!H.option.disabled))}}),{listId:s,open:i,query:r,activeIdx:a,value:c,values:u,selectedOptions:d,hasValue:_,isSelected:v,filtered:g,flatItems:m,renderEntries:y,showClear:J,activeDomId:le,setOpen:x,openMenu:$,closeMenu:w,toggleMenu:C,focusTrigger:R,pick:B,onClear:Q,move:ee,onTriggerKeydown:ae,onTriggerKeyup:ve,onSearchKeydown:fe}}const zC=["data-disabled","data-loading","data-clearable"],KC=["aria-expanded","aria-controls","aria-invalid","aria-label","aria-activedescendant","disabled"],WC=["data-placeholder"],VC={class:"va-sel__indicators","aria-hidden":"true"},qC={key:0,class:"va-sel__spinner"},HC={key:1,class:"va-sel__chev",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},JC={class:"va-sel__panel"},GC={key:0,class:"va-sel__search"},ZC=["aria-controls","aria-activedescendant"],YC=["id","aria-multiselectable","aria-label"],XC=["aria-labelledby"],QC=["id"],eA=["id","aria-selected","aria-disabled","data-active","onClick","onMousemove"],tA=["data-checked"],nA={class:"va-sel__opt-main"},oA={class:"va-sel__opt-label"},sA={key:0,class:"va-sel__opt-desc"},iA={key:1,class:"va-sel__opt-tick","aria-hidden":"true"},rA=["id","aria-selected","aria-disabled","data-active","onClick","onMousemove"],aA=["data-checked"],lA={class:"va-sel__opt-main"},cA={class:"va-sel__opt-label"},uA={key:0,class:"va-sel__opt-desc"},dA={key:1,class:"va-sel__opt-tick","aria-hidden":"true"},fA={key:2,class:"va-sel__empty va-fade-in"},ta=Ce({__name:"VaSelect",props:{options:{},modelValue:{},defaultValue:{},multiple:{type:Boolean},searchable:{type:Boolean},clearable:{type:Boolean},size:{default:"md"},disabled:{type:Boolean},invalid:{type:Boolean},loading:{type:Boolean},placeholder:{default:"请选择"},emptyLabel:{default:"无匹配项"},label:{},defaultOpen:{type:Boolean}},emits:["update:modelValue","change","clear","visibleChange"],setup(e,{emit:t}){const n=e,o=t,s=rt("trigger"),i=rt("search"),{listId:r,open:a,query:l,activeIdx:c,values:u,selectedOptions:d,hasValue:_,isSelected:v,flatItems:g,renderEntries:m,showClear:y,activeDomId:x,setOpen:$,pick:w,onClear:C,onTriggerKeydown:R,onTriggerKeyup:O,onSearchKeydown:B}=UC(n,{trigger:s,search:i},{"update:modelValue":re=>o("update:modelValue",re),change:(re,ee)=>o("change",re,ee),clear:()=>o("clear"),visibleChange:re=>o("visibleChange",re)}),J=T(()=>{const re=ee=>n.options.find(z=>z.value===ee)?.label??ee;return u.value.map(re).join("、")}),Q=T(()=>["va-sel",`va-sel--${n.size}`,{"va-sel--open":a.value,"va-sel--disabled":n.disabled,"va-sel--invalid":n.invalid,"va-sel--multiple":n.multiple}]);return(re,ee)=>(h(),ce(p(ho),{open:p(a),disabled:n.disabled,"match-anchor-width":"",placement:"bottom-start","onUpdate:open":p($)},{trigger:we(()=>[f("span",{class:ye(Q.value),"data-disabled":n.disabled||void 0,"data-loading":n.loading||void 0,"data-clearable":p(y)||void 0},[f("button",{ref:"trigger",type:"button",class:"va-sel__trigger",role:"combobox","aria-expanded":p(a),"aria-haspopup":"listbox","aria-controls":p(r),"aria-invalid":n.invalid||void 0,"aria-label":n.label??"选择","aria-activedescendant":n.searchable?void 0:p(x),disabled:n.disabled,onKeydown:ee[0]||(ee[0]=(...z)=>p(R)&&p(R)(...z)),onKeyup:ee[1]||(ee[1]=(...z)=>p(O)&&p(O)(...z))},[f("span",{class:"va-sel__value","data-placeholder":!p(_)||void 0},[Je(re.$slots,"value",{options:p(d),values:p(u)},()=>[pe(A(p(_)?J.value:n.placeholder),1)])],8,WC),f("span",VC,[n.loading?(h(),b("span",qC)):(h(),b("svg",HC,[...ee[7]||(ee[7]=[f("polyline",{points:"6 9 12 15 18 9"},null,-1)])]))])],40,KC),p(y)?(h(),b("button",{key:0,type:"button",class:"va-sel__clear","aria-label":"清除选择",title:"清除",onClick:ee[2]||(ee[2]=(...z)=>p(C)&&p(C)(...z)),onMousedown:ee[3]||(ee[3]=Fe(()=>{},["stop"]))}," × ",32)):E("",!0)],10,zC)]),default:we(()=>[f("div",JC,[n.searchable?(h(),b("div",GC,[Ve(f("input",{ref:"search","onUpdate:modelValue":ee[4]||(ee[4]=z=>ut(l)?l.value=z:null),type:"text",class:"va-sel__search-input",placeholder:"搜索…","aria-label":"搜索选项","aria-controls":p(r),"aria-activedescendant":n.searchable?p(x):void 0,autocomplete:"off",onKeydown:ee[5]||(ee[5]=(...z)=>p(B)&&p(B)(...z))},null,40,ZC),[[st,p(l)]])])):E("",!0),p(g).length?(h(),b("div",{key:1,id:p(r),class:"va-sel__list",role:"listbox","aria-multiselectable":n.multiple||void 0,"aria-label":n.label??"选项列表",onMousedown:ee[6]||(ee[6]=Fe(()=>{},["prevent"]))},[(h(!0),b(G,null,me(p(m),z=>(h(),b(G,{key:z.type==="group"?z.titleId:`plain-${z.items[0]?.index??0}`},[z.type==="group"?(h(),b("div",{key:0,class:"va-sel__group",role:"group","aria-labelledby":z.titleId},[f("div",{id:z.titleId,class:"va-sel__group-title"},A(z.label),9,QC),(h(!0),b(G,null,me(z.items,K=>(h(),b("div",{id:K.domId,key:K.domId,class:"va-sel__opt",role:"option","aria-selected":p(v)(K.option),"aria-disabled":K.option.disabled||void 0,"data-active":K.index===p(c)||void 0,onClick:se=>p(w)(K.option),onMousemove:se=>!K.option.disabled&&(c.value=K.index)},[n.multiple?(h(),b("span",{key:0,class:"va-sel__check","data-checked":p(v)(K.option)||void 0,"aria-hidden":"true"},null,8,tA)):E("",!0),f("span",nA,[Je(re.$slots,"option",{option:K.option,selected:p(v)(K.option),active:K.index===p(c)},()=>[f("span",oA,A(K.option.label),1),K.option.description?(h(),b("span",sA,A(K.option.description),1)):E("",!0)])]),!n.multiple&&p(v)(K.option)?(h(),b("span",iA,"✓")):E("",!0)],40,eA))),128))],8,XC)):E("",!0),(h(!0),b(G,null,me(z.type==="plain"?z.items:[],K=>(h(),b("div",{id:K.domId,key:K.domId,class:"va-sel__opt",role:"option","aria-selected":p(v)(K.option),"aria-disabled":K.option.disabled||void 0,"data-active":K.index===p(c)||void 0,onClick:se=>p(w)(K.option),onMousemove:se=>!K.option.disabled&&(c.value=K.index)},[n.multiple?(h(),b("span",{key:0,class:"va-sel__check","data-checked":p(v)(K.option)||void 0,"aria-hidden":"true"},null,8,aA)):E("",!0),f("span",lA,[Je(re.$slots,"option",{option:K.option,selected:p(v)(K.option),active:K.index===p(c)},()=>[f("span",cA,A(K.option.label),1),K.option.description?(h(),b("span",uA,A(K.option.description),1)):E("",!0)])]),!n.multiple&&p(v)(K.option)?(h(),b("span",dA,"✓")):E("",!0)],40,rA))),128))],64))),128))],40,YC)):(h(),b("div",fA,[Je(re.$slots,"empty",{},()=>[pe(A(n.emptyLabel),1)])]))])]),_:3},8,["open","disabled","onUpdate:open"]))}}),Sr=()=>typeof window<"u"&&typeof document<"u";function uf(e){const t=[];let n;return e.forEach((o,s)=>{if(o.divider){t.push({type:"divider",key:`divider-${s}`}),n=void 0;return}o.group&&o.group!==n&&t.push({type:"group",key:`group-${s}`,label:o.group}),n=o.group,t.push({type:"item",key:`item-${o.id}-${s}`,item:o})}),t}function pA(e,t){return{getBoundingClientRect:()=>({x:e,y:t,top:t,left:e,right:e,bottom:t,width:0,height:0})}}function hA(e,t,n){const o=Ji(),s=`va-dd-${o}-menu`,i=`va-dd-${o}-submenu`,r=P(e.defaultOpen??!1),a=T(()=>e.open??r.value),l=P(a.value?re(e.items.filter(F=>!F.divider)):null),c=P(null),u=P(null),d=P(null),_=P(null);let v=!1;const g=T(()=>e.trigger==="contextmenu"?_.value??void 0:void 0),m=T(()=>e.items.filter(F=>!F.divider)),y=T(()=>uf(e.items)),x=T(()=>c.value?e.items.find(F=>F.id===c.value)?.children??[]:[]),$=T(()=>x.value.filter(F=>!F.divider)),w=T(()=>uf(x.value)),C=T(()=>c.value!==null),R=T(()=>e.items.find(F=>F.id===c.value)?.label??"子菜单"),O=T(()=>m.value.find(F=>F.id===l.value)??null),B=F=>String(F).replace(/[^\w-]+/g,"-"),J=F=>`${s}-i-${B(F)}`,Q=(F,U)=>`${i}-${B(F)}-${B(U)}`;function re(F){return F.find(U=>!U.disabled)?.id??F[0]?.id??null}function ee(F){!Sr()||!F||document.getElementById(F)?.focus()}function z(){if(t.trigger.value){t.trigger.value.focus();return}t.triggerWrap.value?.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")?.focus()}function K(F){a.value!==F&&(r.value=F,n["update:open"](F),F?n.open():n.close())}function se(){e.disabled||a.value||K(!0)}function le(F={}){a.value&&(v=!!F.restoreFocus,K(!1))}function ae(){a.value?le():se()}Ee(a,async F=>{if(F)c.value=null,u.value=null,d.value=null,l.value=re(m.value),await it(),ee(l.value?J(l.value):null);else{c.value=null,u.value=null,d.value=null,_.value=null,l.value=null;const U=v;v=!1,await it(),U&&z()}});function ve(F,U,_e){const D=F.length;if(!D)return null;let V=U?F.findIndex(ne=>ne.id===U):-1;V<0&&(V=_e>0?-1:0);for(let ne=0;ne<D;ne++)if(V=(V+_e+D)%D,!F[V].disabled)return F[V].id;return U}function fe(F,U){return(U==="first"?F:[...F].reverse()).find(D=>!D.disabled)?.id??null}function L(F){l.value=F}function H(F){u.value=F}function W(F){const U=ve(m.value,l.value,F);U&&(l.value=U,ee(J(U)))}function Y(F){const U=fe(m.value,F);U&&(l.value=U,ee(J(U)))}function Ae(F){const U=c.value;if(!U)return;const _e=ve($.value,u.value,F);_e&&(u.value=_e,ee(Q(U,_e)))}function ze(F){const U=c.value;if(!U)return;const _e=fe($.value,F);_e&&(u.value=_e,ee(Q(U,_e)))}function Ze(F){const U=e.items.find(_e=>_e.id===F);!U?.children?.length||c.value===F||(d.value=Sr()?document.getElementById(J(F)):null,c.value=F,u.value=re(U.children.filter(_e=>!_e.divider)),it(()=>{c.value&&u.value&&ee(Q(c.value,u.value))}))}function Ie(F={}){const U=c.value;c.value=null,u.value=null,d.value=null,F.focusParent&&U&&(l.value=U,it(()=>ee(J(U))))}function he(F,U=!0){if(!(F.disabled||F.divider)){if(U&&F.children?.length){Ze(F.id);return}n.select(F),e.keepOpenOnSelect||le({restoreFocus:!0})}}function Rt(F){F.disabled||(l.value=F.id,he(F))}function Xt(F){F.disabled||(u.value=F.id,he(F,!1))}function Me(F){e.trigger!=="click"&&F.stopPropagation()}function S(F){e.trigger!=="contextmenu"||e.disabled||(F.preventDefault(),F.stopPropagation(),_.value=pA(F.clientX,F.clientY),a.value||se())}function M(F){if(!(e.disabled||e.trigger==="manual")){if(!a.value){(F.key==="ArrowDown"||F.key==="ArrowUp"||F.key==="Enter"||F.key===" ")&&(F.preventDefault(),se());return}(F.key==="ArrowDown"||F.key==="ArrowUp")&&(F.preventDefault(),W(F.key==="ArrowDown"?1:-1))}}function Z(F){F.key===" "&&F.preventDefault()}function ie(F){if(!a.value)return;const U=O.value;switch(F.key){case"ArrowDown":F.preventDefault(),W(1);break;case"ArrowUp":F.preventDefault(),W(-1);break;case"Home":F.preventDefault(),Y("first");break;case"End":F.preventDefault(),Y("last");break;case"Enter":case" ":if(!U)return;F.preventDefault(),he(U);break;case"ArrowRight":U?.children?.length&&(F.preventDefault(),Ze(U.id));break;case"ArrowLeft":c.value&&(F.preventDefault(),Ie({focusParent:!0}));break;case"Tab":le();break}}function te(F){if(!c.value)return;const U=$.value.find(_e=>_e.id===u.value)??null;switch(F.key){case"ArrowDown":F.preventDefault(),Ae(1);break;case"ArrowUp":F.preventDefault(),Ae(-1);break;case"Home":F.preventDefault(),ze("first");break;case"End":F.preventDefault(),ze("last");break;case"Enter":case" ":if(!U)return;F.preventDefault(),he(U,!1);break;case"ArrowLeft":F.preventDefault(),Ie({focusParent:!0});break;case"ArrowRight":F.preventDefault();break;case"Tab":le();break}}function oe(F){return[t.trigger.value,t.triggerWrap.value,t.menu.value,t.submenu.value].some(U=>!!U&&U.contains(F))}function de(F){if(!a.value)return;const U=F.target;!U||oe(U)||le()}function ue(F){F.key!=="Escape"||!a.value||(F.preventDefault(),le({restoreFocus:!0}))}return Ct(()=>{Sr()&&(document.addEventListener("mousedown",de),document.addEventListener("keydown",ue),a.value&&ee(l.value?J(l.value):null))}),vt(()=>{Sr()&&(document.removeEventListener("mousedown",de),document.removeEventListener("keydown",ue))}),{menuId:s,submenuId:i,isOpen:a,activeId:l,openSubId:c,subActiveId:u,submenuAnchor:d,submenuOpen:C,submenuLabel:R,popoverAnchor:g,entries:y,subEntries:w,navItems:m,subNavItems:$,activeItem:O,itemDomId:J,subItemDomId:Q,setActive:L,setSubActive:H,openMenu:se,closeMenu:le,toggleMenu:ae,setOpen:K,onTriggerClick:Me,onTriggerKeydown:M,onTriggerKeyup:Z,onTriggerContextmenu:S,onMenuKeydown:ie,onSubKeydown:te,onItemClick:Rt,onSubItemClick:Xt,openSub:Ze,closeSub:Ie}}const vA=["aria-expanded","aria-controls","aria-label","disabled"],mA={key:0,class:"va-dd__icon","aria-hidden":"true"},_A={key:1,class:"va-dd__label"},gA={key:2,class:"va-dd__chev","aria-hidden":"true"},bA=["id","aria-label"],yA={key:0,class:"va-dd__group",role:"presentation"},kA={key:1,class:"va-dd__divider",role:"separator"},wA=["id","aria-haspopup","aria-expanded","aria-disabled","data-active","data-checked","data-danger","disabled","onClick","onMouseenter","onFocus"],xA={class:"va-dd__check","aria-hidden":"true"},$A={key:0,class:"va-dd__item-icon","aria-hidden":"true"},CA={class:"va-dd__item-label"},AA={key:1,class:"va-dd__shortcut"},SA={key:2,class:"va-dd__sub-arrow","aria-hidden":"true"},RA=["id","aria-label"],EA={key:0,class:"va-dd__group",role:"presentation"},DA={key:1,class:"va-dd__divider",role:"separator"},TA=["id","aria-disabled","data-active","data-checked","data-danger","disabled","onClick","onMouseenter","onFocus"],IA={class:"va-dd__check","aria-hidden":"true"},FA={key:0,class:"va-dd__item-icon","aria-hidden":"true"},MA={class:"va-dd__item-label"},OA={key:1,class:"va-dd__shortcut"},PA=Ce({__name:"VaDropdown",props:{items:{},trigger:{default:"click"},placement:{default:"bottom-end"},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},triggerLabel:{},triggerIcon:{},hideChevron:{type:Boolean,default:!1},keepOpenOnSelect:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ariaLabel:{}},emits:["update:open","select","open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=rt("trigger"),r=rt("triggerWrap"),a=rt("menu"),l=rt("submenu"),{menuId:c,submenuId:u,isOpen:d,activeId:_,openSubId:v,subActiveId:g,submenuAnchor:m,submenuOpen:y,submenuLabel:x,popoverAnchor:$,entries:w,subEntries:C,itemDomId:R,subItemDomId:O,setActive:B,setSubActive:J,openMenu:Q,closeMenu:re,toggleMenu:ee,setOpen:z,onTriggerClick:K,onTriggerKeydown:se,onTriggerKeyup:le,onTriggerContextmenu:ae,onMenuKeydown:ve,onSubKeydown:fe,onItemClick:L,onSubItemClick:H}=hA(o,{trigger:i,triggerWrap:r,menu:a,submenu:l},{"update:open":Ze=>s("update:open",Ze),open:()=>s("open"),close:()=>s("close"),select:Ze=>s("select",Ze)}),W=T(()=>o.triggerIcon!==void 0?o.triggerIcon!=="":!o.triggerLabel),Y=T(()=>!!o.triggerLabel&&!W.value),Ae=T(()=>o.triggerIcon??"⋮"),ze=T(()=>o.ariaLabel??o.triggerLabel??"更多操作");return t({open:Q,close:re,toggle:ee,setOpen:z}),(Ze,Ie)=>(h(),ce(p(ho),{open:p(d),anchor:p($),placement:o.placement,disabled:o.disabled,"close-on-outside-click":!1,"close-on-escape":!1,"onUpdate:open":p(z)},{trigger:we(()=>[f("span",{ref_key:"triggerWrap",ref:r,class:"va-dd",onClick:Ie[0]||(Ie[0]=(...he)=>p(K)&&p(K)(...he)),onKeydown:Ie[1]||(Ie[1]=(...he)=>p(se)&&p(se)(...he)),onKeyup:Ie[2]||(Ie[2]=(...he)=>p(le)&&p(le)(...he)),onContextmenu:Ie[3]||(Ie[3]=(...he)=>p(ae)&&p(ae)(...he))},[Je(Ze.$slots,"trigger",{open:p(d),toggle:p(ee)},()=>[f("button",{ref:"trigger",type:"button",class:"va-dd__trigger","aria-haspopup":"menu","aria-expanded":p(d),"aria-controls":p(d)?p(c):void 0,"aria-label":Y.value?void 0:ze.value,disabled:o.disabled},[W.value?(h(),b("span",mA,A(Ae.value),1)):E("",!0),Y.value?(h(),b("span",_A,A(o.triggerLabel),1)):E("",!0),o.hideChevron?E("",!0):(h(),b("span",gA,"▾"))],8,vA)])],544)]),default:we(()=>[f("div",{id:p(c),ref:"menu",class:"va-dd__menu",role:"menu","aria-label":o.ariaLabel??"动作菜单",onKeydown:Ie[5]||(Ie[5]=(...he)=>p(ve)&&p(ve)(...he)),onMousedown:Ie[6]||(Ie[6]=Fe(()=>{},["prevent"]))},[(h(!0),b(G,null,me(p(w),he=>(h(),b(G,{key:he.key},[he.type==="group"?(h(),b("div",yA,A(he.label),1)):he.type==="divider"?(h(),b("div",kA)):he.type==="item"?(h(),b("button",{key:2,id:p(R)(he.item.id),type:"button",class:"va-dd__item",role:"menuitem",tabindex:"-1","aria-haspopup":he.item.children?.length?"menu":void 0,"aria-expanded":he.item.children?.length?p(v)===he.item.id:void 0,"aria-disabled":he.item.disabled||void 0,"data-active":p(_)===he.item.id||void 0,"data-checked":he.item.checked||void 0,"data-danger":he.item.danger||void 0,disabled:he.item.disabled,onClick:Rt=>p(L)(he.item),onKeyup:Ie[4]||(Ie[4]=xt(Fe(()=>{},["prevent"]),["space"])),onMouseenter:Rt=>p(B)(he.item.id),onFocus:Rt=>p(B)(he.item.id)},[Je(Ze.$slots,"item",{item:he.item,active:p(_)===he.item.id,checked:!!he.item.checked,disabled:!!he.item.disabled},()=>[f("span",xA,A(he.item.checked?"✓":""),1),he.item.icon?(h(),b("span",$A,A(he.item.icon),1)):E("",!0),f("span",CA,A(he.item.label),1),he.item.shortcut?(h(),b("span",AA,A(he.item.shortcut),1)):E("",!0),he.item.children?.length?(h(),b("span",SA,"›")):E("",!0)])],40,wA)):E("",!0)],64))),128))],40,bA),j(p(ho),{open:p(y),anchor:p(m),placement:"right",offset:2,"close-on-outside-click":!1,"close-on-escape":!1},{default:we(()=>[f("div",{id:p(u),ref:"submenu",class:"va-dd__menu va-dd__submenu",role:"menu","aria-label":p(x),onKeydown:Ie[8]||(Ie[8]=(...he)=>p(fe)&&p(fe)(...he)),onMousedown:Ie[9]||(Ie[9]=Fe(()=>{},["prevent"]))},[(h(!0),b(G,null,me(p(C),he=>(h(),b(G,{key:he.key},[he.type==="group"?(h(),b("div",EA,A(he.label),1)):he.type==="divider"?(h(),b("div",DA)):he.type==="item"?(h(),b("button",{key:2,id:p(O)(p(v),he.item.id),type:"button",class:"va-dd__item",role:"menuitem",tabindex:"-1","aria-disabled":he.item.disabled||void 0,"data-active":p(g)===he.item.id||void 0,"data-checked":he.item.checked||void 0,"data-danger":he.item.danger||void 0,disabled:he.item.disabled,onClick:Rt=>p(H)(he.item),onKeyup:Ie[7]||(Ie[7]=xt(Fe(()=>{},["prevent"]),["space"])),onMouseenter:Rt=>p(J)(he.item.id),onFocus:Rt=>p(J)(he.item.id)},[Je(Ze.$slots,"item",{item:he.item,active:p(g)===he.item.id,checked:!!he.item.checked,disabled:!!he.item.disabled},()=>[f("span",IA,A(he.item.checked?"✓":""),1),he.item.icon?(h(),b("span",FA,A(he.item.icon),1)):E("",!0),f("span",MA,A(he.item.label),1),he.item.shortcut?(h(),b("span",OA,A(he.item.shortcut),1)):E("",!0)])],40,TA)):E("",!0)],64))),128))],40,RA)]),_:3},8,["open","anchor"])]),_:3},8,["open","anchor","placement","disabled","onUpdate:open"]))}}),LA=["data-disabled"],BA=["data-variant"],jA="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",ov=Ce({__name:"VaTooltip",props:{content:{},placement:{default:"top"},delay:{default:300},hideDelay:{default:80},disabled:{type:Boolean,default:!1},maxWidth:{default:280},variant:{default:"inverse"}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=ph(),r=`va-tip-${Ji()}`,a=P(!1),l=rt("trigger");let c=null,u=null;function d(){c!=null&&(clearTimeout(c),c=null)}function _(){u!=null&&(clearTimeout(u),u=null)}function v(){return!!o.content||!!i.content}function g(){d(),_(),!(o.disabled||a.value||!v())&&(a.value=!0,s("show"))}function m(){d(),_(),a.value&&(a.value=!1,s("hide"))}function y(){o.disabled||(_(),!(a.value||c!=null)&&(c=setTimeout(()=>{c=null,g()},o.delay)))}function x(){d(),!(!a.value||u!=null)&&(u=setTimeout(()=>{u=null,m()},o.hideDelay))}function $(B){B||m()}Ee(()=>o.disabled,B=>{B&&m()});function w(){const B=l.value;return B?B.querySelector(jA)??B.firstElementChild??B:null}let C=null;function R(){const B=w();if(!B||B.hasAttribute("aria-label"))return;const J=(B.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);J.includes(r)||(B.setAttribute("aria-describedby",[...J,r].join(" ")),C=B)}function O(){const B=C;if(C=null,!B)return;const Q=(B.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean).filter(re=>re!==r);Q.length?B.setAttribute("aria-describedby",Q.join(" ")):B.removeAttribute("aria-describedby")}return Ee(a,B=>{B?R():O()}),vt(()=>{d(),_(),O()}),t({show:g,hide:m}),(B,J)=>(h(),b(G,null,[f("span",{ref:"trigger",class:"va-tip__trigger","data-disabled":o.disabled||void 0,onMouseenter:y,onMouseleave:x,onFocusin:y,onFocusout:x},[Je(B.$slots,"default")],40,LA),j(p(ho),{open:a.value,anchor:l.value,placement:o.placement,disabled:o.disabled,"close-on-outside-click":!0,"close-on-escape":!0,"onUpdate:open":$},{default:we(()=>[f("div",{id:r,class:"va-tip",role:"tooltip","data-variant":o.variant,style:Le({maxWidth:`${o.maxWidth}px`})},[Je(B.$slots,"content",{},()=>[pe(A(o.content),1)])],12,BA)]),_:3},8,["open","anchor","placement","disabled"])],64))}}),NA=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","object","embed","[contenteditable]","[tabindex]"].join(",");function UA(e){if(e.hasAttribute("disabled")||e.tabIndex<0||e.getAttribute("aria-hidden")==="true")return!1;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function df(e){return Array.from(e.querySelectorAll(NA)).filter(UA)}function zA(e){let t=null;async function n(){if(typeof document>"u")return;t=document.activeElement,await it();const i=e.container.value;if(!i)return;(e.initialFocus?.()??df(i)[0]??i).focus({preventScroll:!0})}function o(i){const r=e.container.value;if(!r||typeof document>"u")return;const a=df(r);if(a.length===0){i.preventDefault(),r.focus();return}const l=a[0],c=a[a.length-1],u=document.activeElement;if(!r.contains(u)){i.preventDefault(),(i.shiftKey?c:l).focus();return}i.shiftKey&&u===l?(i.preventDefault(),c.focus()):!i.shiftKey&&u===c&&(i.preventDefault(),l.focus())}function s(){const i=t;if(t=null,!(!i||typeof document>"u"))try{document.contains(i)&&i.focus({preventScroll:!0})}catch{}}return vt(()=>{t=null}),{activate:n,handleTab:o,deactivate:s}}const KA=["data-state","aria-hidden"],WA=["role","aria-labelledby","aria-describedby","aria-label"],VA={key:0,class:"va-dlg__header"},qA={class:"va-dlg__body"},HA={key:1,class:"va-dlg__footer"},bs=[];let JA=0,bi=0,ci=null;function GA(){if(!(typeof document>"u")){if(bi===0){const e=document.body,t=window.innerWidth-document.documentElement.clientWidth;if(ci={overflow:e.style.overflow,paddingRight:e.style.paddingRight},e.style.overflow="hidden",t>0){const n=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${n+t}px`}}bi++}}function ff(){typeof document>"u"||(bi=Math.max(0,bi-1),bi===0&&ci&&(document.body.style.overflow=ci.overflow,document.body.style.paddingRight=ci.paddingRight,ci=null))}const Zc=Ce({__name:"VaDialog",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},title:{},description:{},ariaLabel:{},role:{},size:{},closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},closeOnEscape:{type:Boolean,default:void 0},lockScroll:{type:Boolean,default:void 0},teleportTo:{},initialFocus:{},destroyOnClose:{type:Boolean}},emits:["update:open","close","opened","closed"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=ph(),r=P(o.defaultOpen??!1),a=T(()=>o.open??r.value);function l(Me){Me!==a.value&&(r.value=Me,s("update:open",Me))}function c(){s("close"),l(!1)}function u(){l(!0)}const d=T(()=>o.closable??!0),_=T(()=>o.maskClosable??!0),v=T(()=>o.closeOnEscape??!0),g=T(()=>o.lockScroll??!0),m=T(()=>o.destroyOnClose??!1),y=T(()=>o.size??"md"),x=T(()=>o.role??"dialog"),$=P(a.value),w=P(a.value?"open":"closed"),C=++JA,R=()=>bs[bs.length-1]===C;let O=!1,B=!1;const J=200;function Q(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}let re=0;function ee(Me){const S=++re;if(Q()){Me();return}setTimeout(()=>{S===re&&Me()},J)}const z=rt("panel");function K(){const Me=o.initialFocus;if(Me!=null)return typeof Me=="string"?z.value?.querySelector(Me)??void 0:Me}const se=zA({container:z,initialFocus:K}),le=Me=>{if(R()){if(Me.key==="Escape"&&v.value){c();return}Me.key==="Tab"&&se.handleTab(Me)}};function ae(Me){Me.target===Me.currentTarget&&(!R()||!_.value||c())}function ve(){typeof document>"u"||O||(O=!0,document.addEventListener("keydown",le),bs.includes(C)||bs.push(C),g.value&&!B&&(GA(),B=!0))}function fe(){if(!O)return;O=!1,document.removeEventListener("keydown",le);const Me=bs.indexOf(C);Me>=0&&bs.splice(Me,1)}const L=Ji(),H=`va-dlg-title-${L}`,W=`va-dlg-desc-${L}`,Y=T(()=>!!o.title||!!i.title),Ae=T(()=>Y.value?H:void 0),ze=T(()=>o.description?W:void 0),Ze=T(()=>Y.value?void 0:o.ariaLabel);let Ie=!1;function he(){Ie||typeof console>"u"||!Y.value&&!o.ariaLabel&&(Ie=!0,console.warn("[VaDialog] 缺少可访问名称:未提供 title / title 插槽时,请通过 aria-label 传入弹窗名称。"))}async function Rt(){$.value=!0,he(),ve(),await it(),w.value="open",await se.activate(),ee(()=>s("opened"))}function Xt(){w.value="closed",fe(),ee(()=>{se.deactivate(),B&&(ff(),B=!1),m.value&&($.value=!1),s("closed")})}return Ee(a,(Me,S)=>{Me!==S&&(Me?Rt():Xt())},{flush:"post"}),Ct(()=>{a.value&&Rt()}),vt(()=>{re++,fe(),B&&(ff(),B=!1),a.value&&se.deactivate()}),t({open:u,close:c}),(Me,S)=>(h(),ce(Bc,{to:o.teleportTo??"body"},[$.value?(h(),b("div",{key:0,class:"va-dlg__overlay","data-state":w.value,"aria-hidden":w.value==="closed"?"true":void 0,onMousedown:ae},[f("div",{ref:"panel",class:ye(["va-dlg",`va-dlg--${y.value}`]),role:x.value,"aria-modal":"true","aria-labelledby":Ae.value,"aria-describedby":ze.value,"aria-label":Ze.value,tabindex:"-1"},[Me.$slots.header||Y.value||o.description?(h(),b("div",VA,[Je(Me.$slots,"header",{close:c},()=>[Y.value?(h(),b("h2",{key:0,id:H,class:"va-dlg__title"},[Je(Me.$slots,"title",{},()=>[pe(A(o.title),1)])])):E("",!0),o.description?(h(),b("p",{key:1,id:W,class:"va-dlg__desc"},A(o.description),1)):E("",!0)])])):E("",!0),f("div",qA,[Je(Me.$slots,"default",{close:c})]),Me.$slots.footer?(h(),b("div",HA,[Je(Me.$slots,"footer",{close:c})])):E("",!0),d.value?(h(),b("button",{key:2,type:"button",class:"va-dlg__close","aria-label":"关闭",onClick:c},[j(p(Ro),{size:16})])):E("",!0)],10,WA)],40,KA)):E("",!0)],8,["to"]))}}),ZA={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Eo=mn({queue:[],details:null}),pc=new Map;let YA=0,na=0,hc=!1;const XA="确认",QA="取消";function eS(){try{return ZA?.DEV??!0}catch{return!0}}function tS(e){const t=e.tone??"default";return{id:++YA,title:e.title,description:e.description,tone:t,confirmText:e.confirmText??XA,cancelText:e.cancelText??QA,icon:e.icon??!1,requireText:e.requireText,checkboxLabel:e.checkboxLabel}}function nS(e){if(na===0)return eS()&&!hc&&(hc=!0,console.warn("[VaConfirm] 未找到已挂载的 <VaConfirmHost />:vaConfirm() 将直接 resolve(false)。请在应用根节点挂载宿主组件。")),Eo.details={ok:!1,checked:!1},Promise.resolve(!1);const t=tS(e),n=new Promise(o=>{pc.set(t.id,{resolve:o})});return Eo.queue.push(t),n}function sv(e,t,n=!1){const o=pc.get(e);if(!o)return;pc.delete(e),Eo.details={ok:t,checked:n};const s=Eo.queue.findIndex(i=>i.id===e);s>=0&&Eo.queue.splice(s,1),o.resolve(t)}function oS(){for(const e of[...Eo.queue])sv(e.id,!1,!1)}function sS(){na+=1,hc=!1}function iS(){na=Math.max(0,na-1)}const iv=Object.assign(nS,{state:Eo,closeAll:oS});Object.defineProperty(iv,"details",{get:()=>Eo.details,enumerable:!0});const co=iv,rS=["data-tone"],aS={key:0,class:"va-confirm__icon","aria-hidden":"true"},lS={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},cS={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},uS={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},dS={class:"va-confirm__title"},fS={class:"va-confirm__body"},pS={key:0,class:"va-confirm__field"},hS={class:"va-confirm__hint"},vS={class:"va-confirm__need"},mS=["placeholder"],_S={key:1,class:"va-confirm__check"},gS=["disabled"],bS=Ce({__name:"VaConfirmHost",setup(e){const t=P(null),n=P(!1),o=P(!1),s=P(""),i=T(()=>{const v=t.value?.requireText;return!!v&&s.value!==v}),r=T(()=>!i.value),a=T(()=>{const v=t.value;if(v)return v.requireText?".va-confirm__input":v.tone==="danger"||v.tone==="warning"?".va-confirm__btn--cancel":".va-confirm__btn--confirm"});function l(){o.value=!1,s.value=""}function c(){const v=co.state.queue[0];!v||t.value||(l(),t.value=v,it(()=>{n.value=!0}))}Ee(()=>[co.state.queue[0]?.id??null,t.value?.id??null],([v,g])=>{g===null&&v!==null&&c()},{flush:"post"}),Ee(()=>t.value?co.state.queue.some(v=>v.id===t.value.id):!0,v=>{!v&&t.value&&n.value&&(n.value=!1)},{flush:"post"});function u(v){const g=t.value;g&&(sv(g.id,v,o.value),n.value=!1)}function d(){t.value&&(t.value=null)}function _(){r.value&&u(!0)}return Ct(sS),vt(()=>{iS(),co.closeAll()}),(v,g)=>t.value?(h(),ce(Zc,{key:0,open:n.value,title:t.value.title,description:t.value.description,"initial-focus":a.value,closable:!1,role:"alertdialog",size:"sm",onClose:g[4]||(g[4]=m=>u(!1)),onClosed:d},{title:we(()=>[f("span",{class:"va-confirm__heading","data-tone":t.value.tone},[t.value.icon?(h(),b("span",aS,[t.value.tone==="danger"?(h(),b("svg",lS,[...g[5]||(g[5]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):t.value.tone==="warning"?(h(),b("svg",cS,[...g[6]||(g[6]=[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"},null,-1)])])):(h(),b("svg",uS,[...g[7]||(g[7]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M9.6 9.3a2.4 2.4 0 0 1 4.7.5c0 1.6-2.3 2-2.3 3.4"},null,-1),f("path",{d:"M12 16.5h.01"},null,-1)])]))])):E("",!0),f("span",dS,A(t.value.title),1)],8,rS)]),footer:we(()=>[f("button",{type:"button",class:"va-act va-confirm__btn va-confirm__btn--cancel",onClick:g[2]||(g[2]=m=>u(!1))},A(t.value.cancelText),1),f("button",{type:"button",class:ye(["va-act va-confirm__btn va-confirm__btn--confirm",{"va-act--primary":t.value.tone==="default","va-confirm__btn--danger":t.value.tone==="danger","va-confirm__btn--warning":t.value.tone==="warning"}]),disabled:!r.value,onClick:g[3]||(g[3]=m=>u(!0))},A(t.value.confirmText),11,gS)]),default:we(()=>[f("div",fS,[t.value.requireText?(h(),b("label",pS,[f("span",hS,[g[8]||(g[8]=pe(" 请输入 ",-1)),f("code",vS,A(t.value.requireText),1),g[9]||(g[9]=pe(" 以确认 ",-1))]),Ve(f("input",{"onUpdate:modelValue":g[0]||(g[0]=m=>s.value=m),class:"va-confirm__input",type:"text",autocomplete:"off",spellcheck:"false",placeholder:t.value.requireText,onKeydown:xt(_,["enter"])},null,40,mS),[[st,s.value]])])):E("",!0),t.value.checkboxLabel?(h(),b("label",_S,[Ve(f("input",{"onUpdate:modelValue":g[1]||(g[1]=m=>o.value=m),type:"checkbox"},null,512),[[Hc,o.value]]),f("span",null,A(t.value.checkboxLabel),1)])):E("",!0)])]),_:1},8,["open","title","description","initial-focus"])):E("",!0)}});function yS(e={}){const t=e.stepMs??40,n=e.maxItems??8,o=e.disabled??!1,s=typeof window<"u"&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1);function i(r){return s||o?{"animation-delay":"0ms"}:{"animation-delay":`${Math.min(Math.max(r,0),n)*t}ms`}}return{delayStyle:i}}function rv(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function oa(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),rv(n.getTime())}function pf(e){const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function hf(e,t){const n=new Date(e,t,1),o=(n.getDay()+6)%7,s=oa(n.getTime(),-o);return Array.from({length:42},(i,r)=>{const a=oa(s,r),l=new Date(a);return{ts:a,day:l.getDate(),inMonth:l.getMonth()===t}})}const kS=[{id:"today",label:"今天",from:0,to:0},{id:"7d",label:"近 7 天",from:-6,to:0},{id:"30d",label:"近 30 天",from:-29,to:0}];function wS(e,t){const n=P(!1),o=P((()=>{const y=e.end??e.start??Date.now(),x=new Date(y);return[x.getFullYear(),x.getMonth()]})()),s=T(()=>[...kS,...e.presets??[]]),i=T(()=>hf(o.value[0],o.value[1])),r=T(()=>{const[y,x]=o.value;return hf(x===11?y+1:y,x===11?0:x+1)}),a=y=>{const[x,$]=o.value,w=$+y;return`${w<0?x-1:w>11?x+1:x} 年 ${(w%12+12)%12+1} 月`};function l(y){const[x,$]=o.value,w=$+y;o.value=[w<0?x-1:w>11?x+1:x,(w%12+12)%12]}const c=T(()=>e.start!==void 0&&e.end!==void 0?`${pf(e.start)} → ${pf(e.end)}`:e.placeholder??"选择日期范围"),u=P(null),d=P(null);function _(y,x){if(u.value===null)u.value=y,x.start(y),x.end(y),x.change({start:y,end:y});else{const[$,w]=u.value<=y?[u.value,y]:[y,u.value];u.value=null,x.start($),x.end(w),x.change({start:$,end:w}),n.value=!1}}function v(y,x){const $=rv(Date.now()),w=oa($,y.from),C=oa($,y.to);u.value=null,x.start(w),x.end(C),x.change({start:w,end:C}),n.value=!1}function g(y){const x=u.value??e.start,$=u.value!==null?d.value:e.end;return x!==void 0&&y===x?"start":$!=null&&y===$?"end":x!==void 0&&$!==null&&$!==void 0&&y>x&&y<$?"in":""}const m=y=>{n.value&&t.value&&!t.value.contains(y.target)&&(n.value=!1)};return Ct(()=>{typeof document<"u"&&document.addEventListener("mousedown",m)}),vt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",m)}),Ee(()=>[e.start,e.end],()=>{(e.start===void 0||e.end===void 0)&&(u.value=e.start??null)},{immediate:!0}),{open:n,anchor:o,presets:s,leftGrid:i,rightGrid:r,monthLabel:a,summary:c,shiftMonth:l,onPick:_,applyPreset:v,hoverTs:d,cellState:g}}const xS={ref:"root",class:"va-drp"},$S=["aria-expanded"],CS={key:0,class:"va-drp__panel",role:"dialog","aria-label":"选择日期范围"},AS={class:"va-drp__presets"},SS=["onClick"],RS={class:"va-drp__calendars"},ES={class:"va-drp__cal"},DS={class:"va-drp__month"},TS=["aria-label"],IS=["data-state","data-out","data-today","aria-label","onClick","onMouseenter"],FS={key:0,class:"va-drp__cal"},MS={class:"va-drp__month"},OS=["aria-label"],PS=["data-state","data-out","data-today","aria-label","onClick","onMouseenter"],LS={class:"va-drp__foot"},BS=Ce({__name:"VaDateRangePicker",props:{start:{},end:{},presets:{},placeholder:{},months:{}},emits:["update:start","update:end","change"],setup(e,{emit:t}){const n=e,o=t,s=rt("root"),i={start:C=>o("update:start",C),end:C=>o("update:end",C),change:C=>o("change",C)},{open:r,presets:a,leftGrid:l,rightGrid:c,monthLabel:u,summary:d,shiftMonth:_,onPick:v,applyPreset:g,hoverTs:m,cellState:y}=wS(n,s),x=["一","二","三","四","五","六","日"],$=new Date,w=new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime();return(C,R)=>(h(),b("div",xS,[f("button",{class:"va-drp__trigger",type:"button","aria-expanded":p(r),"aria-haspopup":"dialog",onClick:R[0]||(R[0]=O=>r.value=!p(r))},[R[6]||(R[6]=f("span",{"aria-hidden":"true"},"▤",-1)),pe(" "+A(p(d)),1)],8,$S),p(r)?(h(),b("div",CS,[f("div",AS,[(h(!0),b(G,null,me(p(a),O=>(h(),b("button",{key:O.id,class:"va-act va-act--sm va-drp__preset",type:"button",onClick:B=>p(g)(O,i)},A(O.label),9,SS))),128))]),f("div",RS,[f("div",ES,[f("header",DS,[f("button",{class:"va-drp__nav",type:"button","aria-label":"上一个月",onClick:R[1]||(R[1]=O=>p(_)(-1))},"‹"),f("span",null,A(p(u)(0)),1)]),f("div",{class:"va-drp__grid",role:"grid","aria-label":p(u)(0)},[(h(),b(G,null,me(x,O=>f("span",{key:O,class:"va-drp__wd","aria-hidden":"true"},A(O),1)),64)),(h(!0),b(G,null,me(p(l),O=>(h(),b("button",{key:O.ts,class:"va-drp__day",type:"button","data-state":p(y)(O.ts),"data-out":!O.inMonth,"data-today":O.ts===p(w),"aria-label":new Date(O.ts).toLocaleDateString(),onClick:B=>p(v)(O.ts,i),onMouseenter:B=>m.value=O.ts,onMouseleave:R[2]||(R[2]=B=>m.value=null)},A(O.day),41,IS))),128))],8,TS)]),n.months!==1?(h(),b("div",FS,[f("header",MS,[f("span",null,A(p(u)(1)),1),f("button",{class:"va-drp__nav",type:"button","aria-label":"下一个月",onClick:R[3]||(R[3]=O=>p(_)(1))},"›")]),f("div",{class:"va-drp__grid",role:"grid","aria-label":p(u)(1)},[(h(),b(G,null,me(x,O=>f("span",{key:O,class:"va-drp__wd","aria-hidden":"true"},A(O),1)),64)),(h(!0),b(G,null,me(p(c),O=>(h(),b("button",{key:O.ts,class:"va-drp__day",type:"button","data-state":p(y)(O.ts),"data-out":!O.inMonth,"data-today":O.ts===p(w),"aria-label":new Date(O.ts).toLocaleDateString(),onClick:B=>p(v)(O.ts,i),onMouseenter:B=>m.value=O.ts,onMouseleave:R[4]||(R[4]=B=>m.value=null)},A(O.day),41,PS))),128))],8,OS)])):E("",!0)]),f("footer",LS,[R[7]||(R[7]=f("span",{class:"va-drp__hint"},"点击两个日期确定范围",-1)),f("button",{class:"va-drp__clear",type:"button",onClick:R[5]||(R[5]=O=>{i.start(Date.now()),i.end(Date.now()),r.value=!1})},"跳到今天")])])):E("",!0)],512))}}),jS=["aria-label"],NS={class:"va-ns__head"},US={class:"va-ns__title"},zS={key:0,class:"va-ns__count"},KS={key:0,class:"va-ns__empty va-fade-in"},WS=["data-kind","data-unread"],VS=["onClick"],qS={class:"va-ns__icon","aria-hidden":"true"},HS={class:"va-ns__text"},JS={class:"va-ns__t"},GS={key:0,class:"va-ns__b"},ZS={key:1,class:"va-ns__time"},YS={key:0,class:"va-ns__dot","aria-label":"未读"},XS=Ce({__name:"VaNotificationStack",props:{notifications:{},title:{},relativeTime:{type:Boolean,default:!0},emptyLabel:{},maxHeight:{}},emits:["open","read","allRead"],setup(e,{emit:t}){const n=e,o=t,s=T(()=>n.notifications.length>0),i=Da(3e4,s),r=T(()=>n.notifications.filter(c=>c.unread).length),a={info:"i",success:"✓",warning:"!",danger:"✕",agent:"✦"};function l(c){const u=n.notifications.find(d=>d.id===c);u&&(u.unread&&o("read",c),o("open",u))}return(c,u)=>(h(),b("section",{class:"va-ns","aria-label":n.title??"通知"},[f("header",NS,[f("h3",US,[pe(A(n.title??"通知")+" ",1),r.value?(h(),b("span",zS,A(r.value),1)):E("",!0)]),r.value?(h(),b("button",{key:0,class:"va-ns__allread",type:"button",onClick:u[0]||(u[0]=d=>o("allRead"))},"全部已读")):E("",!0)]),n.notifications.length?(h(),ce(Ds,{key:1,tag:"ul",name:"va-ns",class:"va-ns__list",style:Le(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},{default:we(()=>[(h(!0),b(G,null,me(n.notifications,d=>(h(),b("li",{key:d.id,class:"va-ns__item","data-kind":d.kind??"info","data-unread":d.unread??!1},[f("button",{class:"va-ns__main",type:"button",onClick:_=>l(d.id)},[f("span",qS,A(a[d.kind??"info"]),1),f("span",HS,[f("span",JS,A(d.title),1),d.body?(h(),b("span",GS,A(d.body),1)):E("",!0),d.createdAt&&n.relativeTime?(h(),b("span",ZS,A(p(ev)(d.createdAt,p(i))),1)):E("",!0)])],8,VS),d.unread?(h(),b("span",YS)):E("",!0)],8,WS))),128))]),_:1},8,["style"])):(h(),b("p",KS,A(n.emptyLabel??"没有新通知"),1))],8,jS))}}),QS={class:"va-cs va-enter-up","aria-label":"变更摘要"},e3={class:"va-cs__head"},t3={class:"va-cs__title"},n3={class:"va-cs__stats",role:"status"},o3={class:"va-cs__add"},s3={class:"va-cs__del"},i3={class:"va-cs__files"},r3=["onClick"],a3=["data-status"],l3={class:"va-cs__path"},c3={key:1,class:"va-cs__diff"},u3={class:"va-cs__add"},d3={class:"va-cs__del"},f3=Ce({__name:"VaChangeSummary",props:{title:{},files:{},duration:{},toolCalls:{},finishedAt:{},maxFiles:{}},emits:["openFile","toggleAll"],setup(e,{emit:t}){const n=e,o=t,s=T(()=>n.files.reduce((c,u)=>({additions:c.additions+(u.additions??0),deletions:c.deletions+(u.deletions??0)}),{additions:0,deletions:0})),i=P(!0),r=T(()=>n.maxFiles!==void 0?Math.max(0,n.files.length-n.maxFiles):0),a=T(()=>r.value&&i.value?n.files.slice(0,n.maxFiles):n.files),{delayStyle:l}=yS();return(c,u)=>(h(),b("section",QS,[f("header",e3,[f("span",t3,A(n.title??"本轮变更"),1),f("span",n3,[pe(A(e.files.length)+" 个文件 ",1),s.value.additions||s.value.deletions?(h(),b(G,{key:0},[u[1]||(u[1]=pe(" · ",-1)),f("b",o3,"+"+A(s.value.additions),1),u[2]||(u[2]=pe()),f("b",s3,"−"+A(s.value.deletions),1)],64)):E("",!0),n.duration?(h(),b(G,{key:1},[pe(" · "+A(p(Jc)(n.duration)),1)],64)):E("",!0),n.toolCalls?(h(),b(G,{key:2},[pe(" · "+A(n.toolCalls)+" 次工具调用",1)],64)):E("",!0)])]),f("ul",i3,[(h(!0),b(G,null,me(a.value,(d,_)=>(h(),b("li",{key:d.path,class:"va-enter-up",style:Le(p(l)(_))},[f("button",{class:"va-cs__file",type:"button",onClick:v=>o("openFile",d)},[d.status?(h(),b("span",{key:0,class:"va-cs__status","data-status":d.status},A(p(uc)[d.status]),9,a3)):E("",!0),f("span",l3,A(d.path),1),d.additions||d.deletions?(h(),b("span",c3,[f("b",u3,"+"+A(d.additions??0),1),f("b",d3,"−"+A(d.deletions??0),1)])):E("",!0)],8,r3)],4))),128))]),r.value?(h(),b("button",{key:0,class:"va-cs__more",type:"button",onClick:u[0]||(u[0]=d=>{i.value=!i.value,o("toggleAll")})},A(i.value?`展开其余 ${r.value} 个文件`:`收起,只看前 ${n.maxFiles} 个`),1)):E("",!0)]))}}),p3=["aria-label"],h3=["onClick"],v3={class:"va-bdc__label"},m3={class:"va-bdc__track","aria-hidden":"true"},_3={class:"va-bdc__value"},g3={class:"va-bdc__pct"},b3=Ce({__name:"VaBreakdownChart",props:{items:{},total:{},unit:{},barScale:{},maxRows:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,s=["var(--va-info)","var(--va-accent)","var(--va-success)","var(--va-warning)","var(--va-muted)"],i=(c,u)=>u?.color??s[c%s.length],r=T(()=>{const c=[...n.items].sort((_,v)=>v.value-_.value);let u=c;if(n.maxRows!==void 0&&c.length>n.maxRows){const _=c.slice(0,n.maxRows-1),v=c.slice(n.maxRows-1);u=[..._,{label:"其他",value:v.reduce((g,m)=>g+m.value,0)}]}const d=n.total??c.reduce((_,v)=>_+v.value,0);return u.map(_=>({..._,pct:d>0?_.value/d:0}))}),a=T(()=>Math.max(1,...r.value.map(c=>c.value))),l=c=>c.toLocaleString("en-US");return(c,u)=>(h(),b("div",{class:"va-bdc",role:"img","aria-label":`分布:${r.value.map(d=>`${d.label} ${Math.round(d.pct*100)}%`).join(",")}`},[(h(!0),b(G,null,me(r.value,(d,_)=>(h(),b("button",{key:d.label,class:"va-bdc__row",type:"button",onClick:v=>o("select",d)},[f("span",{class:"va-bdc__swatch",style:Le({background:i(_,d.label==="其他"?void 0:d)}),"aria-hidden":"true"},null,4),f("span",v3,A(d.label),1),f("span",m3,[f("span",{class:"va-bdc__bar",style:Le({width:`${(n.barScale==="total"?d.pct:d.value/a.value)*100}%`,background:i(_,d.label==="其他"?void 0:d)})},null,4)]),f("span",_3,A(l(d.value))+A(n.unit?` ${n.unit}`:""),1),f("span",g3,A(Math.round(d.pct*100))+"%",1)],8,h3))),128))],8,p3))}});function y3(e,t,n){return{nodes:T(()=>{const s=e(),i=t(),r=[],a=/\[(\d+)\]/g;let l=0,c;for(;(c=a.exec(s))!==null;){c.index>l&&r.push(c[0]?pn("span",s.slice(l,c.index)):pn("span"));const u=Number(c[1])-1;i[u]?r.push(pn("button",{class:"va-ans__cite",type:"button","aria-label":`查看来源 ${c[1]}`,onClick:()=>n(u)},c[1])):r.push(pn("span",c[0])),l=c.index+c[0].length}return l<s.length&&r.push(pn("span",s.slice(l))),r})}}const k3=["data-streaming"],w3={key:0,class:"va-ans__q"},x3={class:"va-ans__body"},$3={key:0,class:"va-ans__cursor","aria-hidden":"true"},C3={key:1,class:"va-ans__sr"},A3={key:1,class:"va-ans__sources"},S3={class:"va-ans__list"},R3=["onClick"],E3={class:"va-ans__no","aria-hidden":"true"},D3={class:"va-ans__src-main"},T3={class:"va-ans__src-title-text"},I3={key:0,class:"va-ans__origin"},F3=Ce({__name:"VaAiAnswer",props:{question:{},answer:{},sources:{},streaming:{type:Boolean},streamingLabel:{}},emits:["source"],setup(e,{emit:t}){const n=e,o=t;function s(r){const a=n.sources[r];a&&o("source",a)}const{nodes:i}=y3(()=>n.answer,()=>n.sources,s);return(r,a)=>(h(),b("article",{class:"va-ans","data-streaming":n.streaming??!1},[n.question?(h(),b("p",w3,A(n.question),1)):E("",!0),f("div",x3,[(h(!0),b(G,null,me(p(i),(l,c)=>(h(),ce(Uc(l),{key:c}))),128)),n.streaming?(h(),b("span",$3)):E("",!0),n.streaming?(h(),b("span",C3,A(n.streamingLabel??"正在生成回答"),1)):E("",!0)]),n.sources.length?(h(),b("footer",A3,[a[0]||(a[0]=f("h4",{class:"va-ans__src-title"},"来源",-1)),f("ol",S3,[(h(!0),b(G,null,me(n.sources,(l,c)=>(h(),b("li",{key:l.id},[f("button",{class:"va-ans__src",type:"button",onClick:u=>o("source",l)},[f("span",E3,A(c+1),1),f("span",D3,[f("span",T3,A(l.title),1),l.origin?(h(),b("span",I3,A(l.origin),1)):E("",!0)])],8,R3)]))),128))])])):E("",!0)],8,k3))}}),M3={key:0,class:"va-form__head"},O3={key:0,class:"va-form__title"},P3={key:1,class:"va-form__desc"},L3={class:"va-form__fields"},B3=["for"],j3={key:0,class:"va-form__req","aria-hidden":"true"},N3={key:1,class:"va-form__badge"},U3=["id"],z3={key:0,class:"va-form__req","aria-hidden":"true"},K3={key:1,class:"va-form__badge"},W3={class:"va-form__control-row"},V3=["id","onUpdate:modelValue","placeholder","disabled","aria-invalid","aria-describedby","onInput"],q3={key:2,class:"va-form__switch"},H3=["id","checked","disabled","onChange"],J3=["id","onUpdate:modelValue","type","placeholder","disabled","step","aria-invalid","aria-describedby","onInput"],G3={key:1,class:"va-form__unit"},Z3=["id"],Y3={key:3,class:"va-form__hint"},X3={class:"va-form__actions"},Q3=Ce({__name:"VaForm",props:{title:{default:void 0},description:{default:void 0},fields:{},submitLabel:{default:"提交"},cancelLabel:{default:"取消"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fieldErrors:{default:void 0}},emits:["submit","cancel"],setup(e,{emit:t}){const n=e,o=t;function s($){const w=$.default;switch($.type){case"number":return typeof w=="number"&&Number.isFinite(w)?w:void 0;case"boolean":return typeof w=="boolean"?w:!1;case"select":return typeof w=="string"?w:"";default:return typeof w=="string"?w:""}}const i=P({}),r=P({}),a=P({}),l=P({});Ee(()=>n.fields.map($=>`${$.key}:${$.type}`).join("|"),()=>{const $={},w=n.fields.filter(C=>!/^(?:__proto__|constructor|prototype)$/.test(C.key));for(const C of w)$[C.key]=s(C);i.value=$,r.value={},a.value={},l.value={}},{immediate:!0});const d=$=>{if(r.value[$]=!0,l.value[$]=!0,a.value[$]){const{[$]:w,...C}=a.value;a.value=C}},_=$=>{if(a.value[$])return a.value[$];if(!l.value[$])return n.fieldErrors?.[$]},v=P({}),g=$=>$.type==="number"?"number":$.type==="date"?"date":$.secret?v.value[$.key]?"text":"password":"text",m=$=>$==null||typeof $=="string"&&$.trim()==="",y=()=>{const $={},w={};for(const C of n.fields){if(/^(?:__proto__|constructor|prototype)$/.test(C.key))continue;const R=i.value[C.key];if(C.type==="boolean"){$[C.key]=R===!0;continue}if(m(R)){C.required&&(w[C.key]="必填项"),$[C.key]=C.type==="number"?void 0:"";continue}if(C.type==="number"){const O=typeof R=="number"?R:Number(String(R).trim());if(!Number.isFinite(O)){w[C.key]="必须是数字",$[C.key]=void 0;continue}$[C.key]=O;continue}$[C.key]=String(R).trim()}return{values:$,errors:w}},x=()=>{if(n.disabled||n.loading)return;const{values:$,errors:w}=y();if(Object.keys(w).length>0){a.value=w;return}a.value={},l.value={},o("submit",$,Object.keys(r.value))};return($,w)=>(h(),b("section",{class:ye(["va-form",{"va-form--disabled":e.disabled}])},[e.title||e.description?(h(),b("header",M3,[e.title?(h(),b("h4",O3,A(e.title),1)):E("",!0),e.description?(h(),b("p",P3,A(e.description),1)):E("",!0)])):E("",!0),f("div",L3,[(h(!0),b(G,null,me(e.fields,C=>(h(),b("div",{key:C.key,class:"va-form__field"},[C.type!=="select"?(h(),b("label",{key:0,for:`va-form-${C.key}`,class:"va-form__label"},[pe(A(C.label)+" ",1),C.required?(h(),b("span",j3,"*")):E("",!0),C.secret?(h(),b("span",N3,"敏感")):E("",!0)],8,B3)):(h(),b("span",{key:1,id:`va-form-lbl-${C.key}`,class:"va-form__label"},[pe(A(C.label)+" ",1),C.required?(h(),b("span",z3,"*")):E("",!0),C.secret?(h(),b("span",K3,"敏感")):E("",!0)],8,U3)),f("div",W3,[C.type==="textarea"?Ve((h(),b("textarea",{key:0,id:`va-form-${C.key}`,"onUpdate:modelValue":R=>i.value[C.key]=R,class:ye(["va-form__control va-form__control--area",{"va-form__control--error":_(C.key)}]),placeholder:C.placeholder,disabled:e.disabled,rows:"3",maxlength:"2000","aria-invalid":_(C.key)?"true":void 0,"aria-describedby":_(C.key)?`va-form-err-${C.key}`:void 0,onInput:R=>d(C.key)},null,42,V3)),[[st,i.value[C.key]]]):C.type==="select"?(h(),ce(p(ta),{key:1,class:"va-form__select","model-value":i.value[C.key]||"",options:C.options||[],disabled:e.disabled,invalid:!!_(C.key),placeholder:C.placeholder||"请选择",label:C.label,"onUpdate:modelValue":R=>{i.value[C.key]=R,d(C.key)}},null,8,["model-value","options","disabled","invalid","placeholder","label","onUpdate:modelValue"])):C.type==="boolean"?(h(),b("label",q3,[f("input",{id:`va-form-${C.key}`,type:"checkbox",checked:i.value[C.key]===!0,disabled:e.disabled,onChange:R=>{i.value[C.key]=R.target.checked,d(C.key)}},null,40,H3),f("span",null,A(i.value[C.key]===!0?"是":"否"),1)])):(h(),b(G,{key:3},[Ve(f("input",{id:`va-form-${C.key}`,"onUpdate:modelValue":R=>i.value[C.key]=R,class:ye(["va-form__control",{"va-form__control--error":_(C.key)}]),type:g(C),placeholder:C.placeholder,disabled:e.disabled,step:C.type==="number"?"any":void 0,maxlength:"2000","aria-invalid":_(C.key)?"true":void 0,"aria-describedby":_(C.key)?`va-form-err-${C.key}`:void 0,onInput:R=>d(C.key)},null,42,J3),[[Hh,i.value[C.key]]]),C.secret?(h(),ce(p(Cs),{key:0,variant:"ghost",size:"sm",disabled:e.disabled,onClick:R=>v.value[C.key]=!v.value[C.key]},{default:we(()=>[pe(A(v.value[C.key]?"隐藏":"显示"),1)]),_:2},1032,["disabled","onClick"])):E("",!0),C.unit?(h(),b("span",G3,A(C.unit),1)):E("",!0)],64))]),_(C.key)?(h(),b("p",{key:2,id:`va-form-err-${C.key}`,class:"va-form__error"},A(_(C.key)),9,Z3)):C.description?(h(),b("p",Y3,A(C.description),1)):E("",!0)]))),128))]),f("footer",X3,[j(p(Cs),{variant:"primary",disabled:e.disabled||e.loading,onClick:x},{default:we(()=>[pe(A(e.submitLabel),1)]),_:1},8,["disabled"]),j(p(Cs),{variant:"secondary",disabled:e.disabled,onClick:w[0]||(w[0]=C=>o("cancel"))},{default:we(()=>[pe(A(e.cancelLabel),1)]),_:1},8,["disabled"])]),Je($.$slots,"after-actions")],2))}}),eR=64;function tR(e,t){const n=eR,o=P(!0);let s=null,i=!1;function r(){const u=e.value;u&&(o.value=u.scrollHeight-u.scrollTop-u.clientHeight<n)}function a(){r()}function l(u){u?.force&&(i=!0),s===null&&(s=requestAnimationFrame(()=>{s=null;const d=i;if(i=!1,!d&&!o.value)return;const _=e.value;_&&(_.scrollTop=_.scrollHeight)}))}function c(){s!==null&&(cancelAnimationFrame(s),s=null,i=!1)}return Oo()&&vt(c),{isPinned:o,onScroll:a,updatePinned:r,scrollToBottom:l,dispose:c}}const nR={class:"va-board",role:"list","aria-label":"任务看板"},oR=["aria-label"],sR={class:"va-board__col-head"},iR={class:"va-board__col-title"},rR={class:"va-board__count"},aR={class:"va-board__cards"},lR={key:0,class:"va-board__none"},cR=["data-selected","onClick"],uR={class:"va-board__card-title"},dR={class:"va-board__card-foot"},fR=["data-priority","aria-label"],pR={key:1,class:"va-board__meta"},hR=["aria-label"],vR=Ce({__name:"VaTaskBoard",props:{columns:{},tasks:{},selected:{},defaultSelected:{}},emits:["update:selected","open"],setup(e,{emit:t}){const n=e,o=t,s=P(!1),i=P(n.defaultSelected),r=T(()=>n.selected!==void 0||s.value?n.selected:i.value),a=c=>n.tasks.filter(u=>u.columnId===c);function l(c){s.value=!0,i.value=c.id,o("update:selected",c.id),o("open",c)}return(c,u)=>(h(),b("div",nR,[(h(!0),b(G,null,me(n.columns,d=>(h(),b("section",{key:d.id,class:"va-board__col","aria-label":d.title},[f("header",sR,[f("span",iR,A(d.title),1),f("span",rR,A(d.hint??a(d.id).length),1)]),f("div",aR,[a(d.id).length?E("",!0):(h(),b("p",lR,"空")),(h(!0),b(G,null,me(a(d.id),_=>(h(),b("button",{key:_.id,class:"va-board__card",type:"button","data-selected":_.id===r.value,onClick:v=>l(_)},[f("span",uR,A(_.title),1),f("span",dR,[_.priority?(h(),b("span",{key:0,class:"va-board__prio","data-priority":_.priority,"aria-label":`优先级:${_.priority}`},null,8,fR)):E("",!0),_.meta?(h(),b("span",pR,A(_.meta),1)):E("",!0),_.assignee?(h(),b("span",{key:2,class:"va-board__assignee","aria-label":`负责人 ${_.assignee}`},A(_.assignee.slice(0,1)),9,hR)):E("",!0)])],8,cR))),128))])],8,oR))),128))]))}}),mR=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n};function _R(e,t){const o=(t+e).replace(/\r\n|\r/g,`
|
|
6
|
+
`).split(`
|
|
7
|
+
|
|
8
|
+
`),s=o.pop()??"",i=[];for(const r of o){const a=[];for(const l of r.split(`
|
|
9
|
+
`))l.startsWith("data:")&&a.push(l.replace(/^data:\s*/,""));a.length!==0&&i.push(a.join(`
|
|
10
|
+
`))}return{payloads:i,buffer:s}}async function gR(e){const n=(await e.open()).body?.getReader();if(!n)throw new Error("ReadableStream not supported or empty response");const o=new TextDecoder("utf-8");let s="",i=!1;try{for(;;){const{done:r,value:a}=await n.read();if(r)break;const{payloads:l,buffer:c}=_R(o.decode(a,{stream:!0}),s);s=c;for(const u of l){if(u==="[DONE]"){e.onDone?.();continue}try{e.onEvent(JSON.parse(u))}catch(d){e.onParseError?e.onParseError(u,d):console.warn("[vuagent-ui] 解析 SSE 块失败:",u,d)}}}}catch(r){if(r?.name==="AbortError"||e.signal?.aborted)i=!0;else throw r}return{aborted:i}}const vf={schedule(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):(e(),null)},cancel(e){typeof e=="number"&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)}};function bR(e){const t=e.scheduler??vf;let n="",o=null;const s=()=>{o=null;const i=n;n="",i&&e.commit(i)};return{push(i){if(n+=i,o!==null)return;if(t===vf&&typeof requestAnimationFrame!="function"){s();return}const r=t.schedule(()=>{o===r&&s()});o=r},flush(){o!==null&&(t.cancel(o),o=null),s()},drop(){o!==null&&(t.cancel(o),o=null),n=""},get pendingText(){return n}}}const vc=Hp(new Map);function yR(e,t){const n=new Map(vc.value);n.set(e,t),vc.value=n}function av(e){return vc.value.get(e)}const mf={};function kR(e){let t=mf[e];if(t)return t;t=mf[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function Is(e,t){typeof t!="string"&&(t=Is.defaultChars);const n=kR(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const a=parseInt(o.slice(i+1,i+3),16);if(a<128){s+=n[a];continue}if((a&224)===192&&i+3<r){const l=parseInt(o.slice(i+4,i+6),16);if((l&192)===128){const c=a<<6&1984|l&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((a&240)===224&&i+6<r){const l=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((l&192)===128&&(c&192)===128){const u=a<<12&61440|l<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((a&248)===240&&i+9<r){const l=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((l&192)===128&&(c&192)===128&&(u&192)===128){let d=a<<18&1835008|l<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}Is.defaultChars=";/?:@&=+$,#";Is.componentChars="";const _f={};function wR(e){let t=_f[e];if(t)return t;t=_f[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ao(e,t,n){typeof t!="string"&&(n=t,t=ao.defaultChars),typeof n>"u"&&(n=!0);const o=wR(t);let s="";for(let i=0,r=e.length;i<r;i++){const a=e.charCodeAt(i);if(n&&a===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(a<128){s+=o[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1<r){const l=e.charCodeAt(i+1);if(l>=56320&&l<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}ao.defaultChars=";/?:@&=+$,-_.!~*'()#";ao.componentChars="-_.!~*'()";function mc(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function sa(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const xR=/^([a-z0-9.+-]+:)/i,$R=/:[0-9]*$/,CR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,AR=["<",">",'"',"`"," ","\r",`
|
|
11
|
+
`," "],SR=["{","}","|","\\","^","`"].concat(AR),RR=["'"].concat(SR),gf=["%","/","?",";","#"].concat(RR),bf=["/","?","#"],ER=255,yf=/^[+a-z0-9A-Z_-]{0,63}$/,DR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,kf={javascript:!0,"javascript:":!0},wf={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function _c(e,t){if(e&&e instanceof sa)return e;const n=new sa;return n.parse(e,t),n}sa.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=CR.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=xR.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&kf[r])&&(i=i.substr(2),this.slashes=!0)),!kf[r]&&(s||r&&!wf[r])){let c=-1;for(let g=0;g<bf.length;g++)o=i.indexOf(bf[g]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let g=0;g<gf.length;g++)o=i.indexOf(gf[g]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const _=i.slice(0,c);i=i.slice(c),this.parseHost(_),this.hostname=this.hostname||"";const v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v){const g=this.hostname.split(/\./);for(let m=0,y=g.length;m<y;m++){const x=g[m];if(x&&!x.match(yf)){let $="";for(let w=0,C=x.length;w<C;w++)x.charCodeAt(w)>127?$+="x":$+=x[w];if(!$.match(yf)){const w=g.slice(0,m),C=g.slice(m+1),R=x.match(DR);R&&(w.push(R[1]),C.unshift(R[2])),C.length&&(i=C.join(".")+i),this.hostname=w.join(".");break}}}}this.hostname.length>ER&&(this.hostname=""),v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=i.indexOf("#");a!==-1&&(this.hash=i.substr(a),i=i.slice(0,a));const l=i.indexOf("?");return l!==-1&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),wf[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};sa.prototype.parseHost=function(e){let t=$R.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const TR=Object.freeze(Object.defineProperty({__proto__:null,decode:Is,encode:ao,format:mc,parse:_c},Symbol.toStringTag,{value:"Module"})),lv=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,cv=/[\0-\x1F\x7F-\x9F]/,IR=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Yc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,uv=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,dv=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,FR=Object.freeze(Object.defineProperty({__proto__:null,Any:lv,Cc:cv,Cf:IR,P:Yc,S:uv,Z:dv},Symbol.toStringTag,{value:"Module"})),MR=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function OR(e){return e===0||e>=55296&&e<=57343||e>1114111}function PR(e){return OR(e)?65533:e>=128&&e<=159&&MR[e-128]||e}function LR(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(PR(e))}const Cn=(()=>{const e=new Uint8Array(127);let t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function BR(e,t,n,o,s,i){const a=e.length,l=i*90;let c=0;const u=()=>{const Q=Cn[e.charCodeAt(c++)];return Q<i?Q:Q*91-l+Cn[e.charCodeAt(c++)]},d=n-o,_=n+s,v=new Int32Array(_);v.fill(-1,o,i),v.fill(-1,i+d,_);const g=new Int32Array(_),m=new Int32Array(_);function y(Q,re){let ee=0,z=re;const K=re+Q;for(;z<K;){const se=Cn[e.charCodeAt(c++)];if(se<89)ee+=se,v[z++]=ee;else if(se===89){let le=Cn[e.charCodeAt(c++)]+2;for(;le--;)v[z++]=++ee}else{const le=Cn[e.charCodeAt(c++)];ee+=89+(le<90?le*91+Cn[e.charCodeAt(c++)]:Cn[e.charCodeAt(c++)]*8281+Cn[e.charCodeAt(c++)]*91+Cn[e.charCodeAt(c++)]),v[z++]=ee}}}y(o,0),y(d,i);const x=new Int32Array(s*2);let $=0,w=0;function C(Q,re){for(let ee=0;ee<Q;ee++){const z=re+ee,K=u(),se=u();x[w*2]=K,x[w*2+1]=se,w+=1,g[z]=$;const le=(v[K]<0?m[K]:1)+(v[se]<0?m[se]:1);m[z]=le,$+=le}}C(s-i+o,i+d),C(i-o,o);const R=new Uint16Array($);let O=0;for(let Q=0;Q<w;Q++)for(let re=0;re<2;re++){const ee=x[Q*2+re],z=v[ee];if(z<0){let K=g[ee];const se=K+m[ee];for(;K<se;)R[O++]=R[K++]}else R[O++]=z}const B=new Uint16Array(t);let J=0;for(;c<a;){let Q=Cn[e.charCodeAt(c++)];Q>=i&&(Q=Q*91-l+Cn[e.charCodeAt(c++)]);const re=v[Q];if(re<0){let ee=g[Q];const z=ee+m[Q];for(;ee<z;)B[J++]=R[ee++]}else B[J++]=re}return B}const jR=BR("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var wt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(wt||(wt={}));var qt;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(qt||(qt={}));const ia=32,fv=21,NR=2097151,gc=2047;let pv=0;function UR(e){const t=e>>>fv;return t===gc?pv:t}function zR(e){return e-qt.ZERO>>>0<=9}function KR(e){return(e|ia)-qt.LOWER_A>>>0<=5}function WR(e){return(e|ia)-qt.LOWER_A>>>0<=25}var xf;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(xf||(xf={}));var $f;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})($f||($f={}));function VR(e,t,n,o){const s=(t&wt.BRANCH_LENGTH)>>7,i=t&wt.JUMP_TABLE;if(i){if(s===0)return o===i?n:-1;const l=o-i;if(l>>>0>=s)return-1;const c=e[n+l];return c===0?-1:n+s+c-1&65535}if(s===0)return-1;const r=s+1>>1,a=n+r+s;for(let l=0;l<s;l++){const u=e[n+(l>>1)]>>((l&1)<<3)&255;if(u===o){const d=n+r+l;return a+e[d]&65535}if(u>o)return-1}return-1}function Cf(e,t,n){return n===1?String.fromCharCode(e[t]&wt.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function qR(e,t,n){let o=t+1,s=0,i=o;if(o<n&&(e.charCodeAt(o)|ia)===qt.LOWER_X)for(o+=1,i=o;o<n;){const a=e.charCodeAt(o);if(zR(a))s=s*16+(a-qt.ZERO);else if(KR(a))s=s*16+((a|ia)-qt.LOWER_A+10);else break;o+=1}else for(;o<n;){const a=e.charCodeAt(o)-qt.ZERO;if(a>>>0>9)break;s=s*10+a,o+=1}if(o===i)return 0;o<n&&e.charCodeAt(o)===qt.SEMI&&(o+=1),s>1114111&&(s=1114112);let r=o-t;return r>=gc&&(pv=r,r=gc),r<<fv|s}function HR(e,t,n){const o=jR;let s=e.indexOf("&");if(s<0)return e;const i=e.length;let r=0,a="";const l=o[0],c=l&wt.JUMP_TABLE,u=(l&wt.BRANCH_LENGTH)>>7;do{const d=s+1,_=e.charCodeAt(d);let v,g;if(_===qt.NUM){const m=qR(e,d,i);v=UR(m),v>0&&e.charCodeAt(d+v-1)!==qt.SEMI&&(v=0),g=v===0?"":LR(m&NR)}else if(WR(_)){v=0,g="";const m=_-c;let y;if(m>>>0<u){const R=o[1+m];y=R===0?-1:u+R&65535}else y=-1;let x=0,$=0,w=y<0?0:o[y],C=d+1;e:for(;C<i;){for(;(w&(wt.VALUE_LENGTH|wt.FLAG13))===0&&(w&wt.JUMP_TABLE)!==0;){const J=w&wt.JUMP_TABLE,Q=(w&wt.BRANCH_LENGTH)>>7;if(Q===0){if(e.charCodeAt(C)!==J)break e;y+=1}else{const re=e.charCodeAt(C)-J;if(re>>>0>=Q)break e;const ee=o[y+1+re];if(ee===0)break e;y=y+Q+ee&65535}if(w=o[y],C+=1,C>=i)break e}if((w&(wt.VALUE_LENGTH|wt.FLAG13))===wt.FLAG13){const J=(w&wt.BRANCH_LENGTH)>>7;if(e.charCodeAt(C)!==(w&wt.JUMP_TABLE))break;C+=1;const Q=J-1;let re=y+1,ee=0;for(;ee+1<Q;ee+=2){const z=o[re];if(e.charCodeAt(C)!==(z&255)||(C+=1,e.charCodeAt(C)!==(z>>8&255)))break e;C+=1,re+=1}if(ee<Q){if(e.charCodeAt(C)!==(o[re]&255))break;C+=1}y+=1+(J>>1),w=o[y];continue}const R=w>>>14,O=e.charCodeAt(C);if(R!==0){if(O===qt.SEMI){v=C-d+1,g=R===1?String.fromCharCode(w&wt.VALUE_MASK):Cf(o,y,R);break}if(R===1)break}const B=VR(o,w,y+(R||1),O);if(B<0)break;y=B,w=o[y],C+=1}g===""&&v>0&&(g=Cf(o,x,$))}else v=0,g="";v===0||n?s=d:(r<s&&(a+=e.slice(r,s)),a+=g,s=r=d+v),e.charCodeAt(s)!==qt.AMP&&(s=e.indexOf("&",s))}while(s>=0);return a+e.slice(r)}function hv(e){return HR(e,!0,!1)}var JR=class{src_Any=lv.source;src_Cc=cv.source;src_Z=dv.source;src_P=Yc.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const o=this.escapeRE(e),s=this.escapeRE(t),i=`(?:(?!${this.src_ZCc}|${o}|${s}).)`;let r=`${o}${i}{0,1000}${s}`;for(let a=2;a<=n;a++)r=`${o}(?:${i}|${r}){0,1000}${s}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Il={validate:(e,t,n)=>{const o=n.re.get_http_validator();o.lastIndex=t;const s=o.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)},GR={"http:":Il,"https:":Il,"ftp:":Il,"//":{validate:function(e,t,n){const o=n.re.get_relative_proto_validator();o.lastIndex=t;const s=o.exec(e);return s?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const o=n.re.get_mailto_validator();o.lastIndex=t;const s=o.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)}},ZR="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",YR="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function XR(){const e=YR.split("|");return ZR.split("|").forEach(t=>{const n=t.indexOf(":"),o=t.slice(0,n);for(const s of t.slice(n+1))e.push(o+s)}),e}var QR={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:XR(),urlAuth:!1,maxLength:1e4},Af=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}},e4=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...QR,...n},this.__schemas__={...GR},this.re=t||new JR,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(o,s)=>s.normalize(o),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const o=this.re.get_fuzzy_mail_host_search(),s=this.re.get_mail_name_validator();for(o.lastIndex=0;(t=o.exec(e))!==null;){const i=e.slice(Math.max(0,t.index-65),t.index);if(s.test(i))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let o,s,i,r,a,l,c=!1,u=!1,d=!1,_=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(o=this.re.get_fuzzy_link_search(),o.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(s=this.re.get_fuzzy_mail_host_search(),s.lastIndex=0,i=this.re.get_mail_name_validator());;){const v=Math.max(_-1,0);if(s&&i&&!d&&(!a||a.index<_))for(s.lastIndex<v&&(s.lastIndex=v);;){const $=s.exec(e);if(!$){d=!0,a=void 0;break}const w=i.exec(e.slice(Math.max(0,$.index-65),$.index));if(w){if(a={schema:"mailto:",index:$.index-w[1].length,lastIndex:$.index+$[0].length},a.index>=_)break;s.lastIndex<v&&(s.lastIndex=v)}}if(o&&!u&&(!r||r.index<_))for(o.lastIndex<v&&(o.lastIndex=v);;){const $=o.exec(e);if(!$){u=!0,r=void 0;break}if(r={schema:"",index:$.index+$[1].length,lastIndex:$.index+$[0].length},r.index>=_)break;o.lastIndex<v&&(o.lastIndex=v)}let g=a;(!g||r&&(r.index<g.index||r.index===g.index&&r.lastIndex>g.lastIndex))&&(g=r);let m;if(!c)for(;;){if(!l){n.lastIndex<v&&(n.lastIndex=v);const C=n.exec(e);if(!C){c=!0;break}l={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(l.index<_){l=void 0;continue}if(g&&l.index>g.index)break;const $=l;l=void 0;const w=this.testSchemaAt(e,$.schema,$.lastIndex);if(w){m={schema:$.schema,index:$.index,lastIndex:$.lastIndex+w};break}}let y=m;if((!y||a&&(a.index<y.index||a.index===y.index&&a.lastIndex>y.lastIndex))&&(y=a),(!y||r&&(r.index<y.index||r.index===y.index&&r.lastIndex>y.lastIndex))&&(y=r),!y)break;y===a?a=void 0:y===r&&(r=void 0);const x=new Af(e,y.schema,y.index,y.lastIndex);x.schema?this.__schemas__[x.schema].normalize(x,this):this.normalize(x),t.push(x),_=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const o=new Af(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[o.schema].normalize(o,this),o}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const As=2147483647,Wn=36,Xc=1,Ti=26,t4=38,n4=700,vv=72,mv=128,_v="-",o4=/^xn--/,s4=/[^\0-\x7F]/,i4=/[\x2E\u3002\uFF0E\uFF61]/g,r4={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fl=Wn-Xc,Vn=Math.floor,Ml=String.fromCharCode;function Co(e){throw new RangeError(r4[e])}function a4(e,t){const n=[];let o=e.length;for(;o--;)n[o]=t(e[o]);return n}function gv(e,t){const n=e.split("@");let o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(i4,".");const s=e.split("."),i=a4(s,t).join(".");return o+i}function bv(e){const t=[];let n=0;const o=e.length;for(;n<o;){const s=e.charCodeAt(n++);if(s>=55296&&s<=56319&&n<o){const i=e.charCodeAt(n++);(i&64512)==56320?t.push(((s&1023)<<10)+(i&1023)+65536):(t.push(s),n--)}else t.push(s)}return t}const l4=e=>String.fromCodePoint(...e),c4=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Wn},Sf=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},yv=function(e,t,n){let o=0;for(e=n?Vn(e/n4):e>>1,e+=Vn(e/t);e>Fl*Ti>>1;o+=Wn)e=Vn(e/Fl);return Vn(o+(Fl+1)*e/(e+t4))},kv=function(e){const t=[],n=e.length;let o=0,s=mv,i=vv,r=e.lastIndexOf(_v);r<0&&(r=0);for(let a=0;a<r;++a)e.charCodeAt(a)>=128&&Co("not-basic"),t.push(e.charCodeAt(a));for(let a=r>0?r+1:0;a<n;){const l=o;for(let u=1,d=Wn;;d+=Wn){a>=n&&Co("invalid-input");const _=c4(e.charCodeAt(a++));_>=Wn&&Co("invalid-input"),_>Vn((As-o)/u)&&Co("overflow"),o+=_*u;const v=d<=i?Xc:d>=i+Ti?Ti:d-i;if(_<v)break;const g=Wn-v;u>Vn(As/g)&&Co("overflow"),u*=g}const c=t.length+1;i=yv(o-l,c,l==0),Vn(o/c)>As-s&&Co("overflow"),s+=Vn(o/c),o%=c,t.splice(o++,0,s)}return String.fromCodePoint(...t)},wv=function(e){const t=[];e=bv(e);const n=e.length;let o=mv,s=0,i=vv;for(const l of e)l<128&&t.push(Ml(l));const r=t.length;let a=r;for(r&&t.push(_v);a<n;){let l=As;for(const u of e)u>=o&&u<l&&(l=u);const c=a+1;l-o>Vn((As-s)/c)&&Co("overflow"),s+=(l-o)*c,o=l;for(const u of e)if(u<o&&++s>As&&Co("overflow"),u===o){let d=s;for(let _=Wn;;_+=Wn){const v=_<=i?Xc:_>=i+Ti?Ti:_-i;if(d<v)break;const g=d-v,m=Wn-v;t.push(Ml(Sf(v+g%m,0))),d=Vn(g/m)}t.push(Ml(Sf(d,0))),i=yv(s,c,a===r),s=0,++a}++s,++o}return t.join("")},u4=function(e){return gv(e,function(t){return o4.test(t)?kv(t.slice(4).toLowerCase()):t})},d4=function(e){return gv(e,function(t){return s4.test(t)?"xn--"+wv(t):t})},Rf={version:"2.3.1",ucs2:{decode:bv,encode:l4},decode:kv,encode:wv,toASCII:d4,toUnicode:u4};var Ef=Object.defineProperty,xv=(e,t)=>{let n={};for(var o in e)Ef(n,o,{get:e[o],enumerable:!0});return Ef(n,Symbol.toStringTag,{value:"Module"}),n},f4=xv({arrayReplaceAt:()=>p4,asciiTrim:()=>Ia,callable:()=>$v,escapeHtml:()=>Mo,escapeRE:()=>x4,fromCodePoint:()=>Ii,isMdAsciiPunct:()=>Oi,isPunctChar:()=>Av,isPunctCharCode:()=>Mi,isSpace:()=>Qe,isValidEntityCode:()=>Qc,isWhiteSpace:()=>Fi,lib:()=>$4,normalizeReference:()=>Ta,unescapeAll:()=>Fs,unescapeMd:()=>_4});function $v(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function p4(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Qc(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Ii(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Cv=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,h4=new RegExp(`${Cv.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),v4=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function m4(e,t){if(t.charCodeAt(0)===35&&v4.test(t)){const o=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Qc(o)?Ii(o):e}const n=hv(e);return n!==e?n:e}function _4(e){return e.indexOf("\\")<0?e:e.replace(Cv,"$1")}function Fs(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(h4,function(t,n,o){return n||m4(t,o)})}var g4=/[&<>"]/,b4=/[&<>"]/g,y4={"&":"&","<":"<",">":">",'"':"""};function k4(e){return y4[e]}function Mo(e){return g4.test(e)?e.replace(b4,k4):e}var w4=/[.?*+^$[\]\\(){}|-]/g;function x4(e){return e.replace(w4,"\\$&")}function Qe(e){switch(e){case 9:case 32:return!0}return!1}function Fi(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Av(e){return Yc.test(e)||uv.test(e)}function Mi(e){return Av(Ii(e))}function Oi(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ta(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Df(e){return e===32||e===9||e===10||e===13}function Ia(e){let t=0;for(;t<e.length&&Df(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Df(e.charCodeAt(n));n--);return e.slice(t,n+1)}var $4={mdurl:TR,ucmicro:FR};function C4(e,t,n){let o,s,i,r;const a=e.posMax,l=e.pos;for(e.pos=t+1,o=1;e.pos<a;){if(i=e.src.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=l,-1}}let c=-1;return s&&(c=e.pos),e.pos=l,c}function A4(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Fs(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32){s++;continue}s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Fs(e.slice(t,s)),i.pos=s,i.ok=!0),i}function S4(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let a=e.charCodeAt(i);if(a!==34&&a!==39&&a!==40)return r;t++,i++,a===40&&(a=41),r.marker=a}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Fs(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Fs(e.slice(t,i)),r}var R4=xv({parseLinkDestination:()=>A4,parseLinkLabel:()=>C4,parseLinkTitle:()=>S4});function Pi(e){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pi(e)}function E4(e,t){if(Pi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(Pi(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D4(e){var t=E4(e,"string");return Pi(t)=="symbol"?t:t+""}function ke(e,t,n){return(t=D4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ns=class{constructor(e,t,n){ke(this,"map",null),ke(this,"level",0),ke(this,"children",null),ke(this,"content",""),ke(this,"markup",""),ke(this,"info",""),ke(this,"block",!1),ke(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Li=class{constructor(){ke(this,"__rules__",[]),ke(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[o].fn=t,this.__rules__[o].alt=n.alt||[],this.__cache__=null}before(e,t,n,o={}){const s=this.__find__(e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(s,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null}after(e,t,n,o={}){const s=this.__find__(e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(o=>{const s=this.__find__(o);if(s<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}this.__rules__[s].enabled=!0,n.push(o)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(o=>{const s=this.__find__(o);if(s<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}this.__rules__[s].enabled=!1,n.push(o)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Yn={};Yn.code_inline=function(e,t,n,o,s){const i=e[t];return`<code${s.renderAttrs(i)}>${Mo(i.content)}</code>`};Yn.code_block=function(e,t,n,o,s){const i=e[t];return`<pre${s.renderAttrs(i)}><code>${Mo(e[t].content)}</code></pre>
|
|
12
|
+
`};Yn.fence=function(e,t,n,o,s){const i=e[t],r=i.info?Fs(i.info).trim():"";let a="",l="";if(r){const u=r.split(/(\s+)/g);a=u[0],l=u.slice(2).join("")}let c;if(n.highlight?c=n.highlight(i.content,a,l)||Mo(i.content):c=Mo(i.content),c.indexOf("<pre")===0)return c+`
|
|
13
|
+
`;if(r){const u=i.attrIndex("class"),d=i.attrs?i.attrs.slice():[];u<0?d.push(["class",`${n.langPrefix}${a}`]):(d[u]=[d[u][0],d[u][1]],d[u][1]+=` ${n.langPrefix}${a}`);const _={attrs:d};return`<pre><code${s.renderAttrs(_)}>${c}</code></pre>
|
|
14
|
+
`}return`<pre><code${s.renderAttrs(i)}>${c}</code></pre>
|
|
15
|
+
`};Yn.image=function(e,t,n,o,s){const i=e[t];return i.attrs[i.attrIndex("alt")][1]=s.renderInlineAsText(i.children,n,o),s.renderToken(e,t,n)};Yn.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
16
|
+
`:`<br>
|
|
17
|
+
`};Yn.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
18
|
+
`:`<br>
|
|
19
|
+
`:`
|
|
20
|
+
`};Yn.text=function(e,t){return Mo(e[t].content)};Yn.html_block=function(e,t){return e[t].content};Yn.html_inline=function(e,t){return e[t].content};var Sv=class{constructor(){ke(this,"rules",Object.assign({},Yn))}renderAttrs(e){let t,n,o;if(!e.attrs)return"";for(o="",t=0,n=e.attrs.length;t<n;t++)o+=` ${Mo(e.attrs[t][0])}="${Mo(String(e.attrs[t][1]))}"`;return o}renderToken(e,t,n){const o=e[t];let s="";if(o.hidden)return"";let i=t-1;for(;i>=0&&e[i].hidden&&e[i].nesting===0;)i--;o.block&&o.nesting!==-1&&i>=0&&e[i].hidden&&e[i].nesting===-1&&(s+=`
|
|
21
|
+
`),s+=(o.nesting===-1?"</":"<")+o.tag,s+=this.renderAttrs(o),o.nesting===0&&n.xhtmlOut&&(s+=" /");let r=!1;if(o.block&&(r=!0,o.nesting===1)){let a=t+1;for(;a<e.length&&e[a].hidden&&e[a].nesting===0;)a++;if(a<e.length){const l=e[a];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===o.tag)&&(r=!1)}}return s+=r?`>
|
|
22
|
+
`:">",s}renderInline(e,t,n){let o="";const s=this.rules;for(let i=0,r=e.length;i<r;i++){const a=e[i].type;typeof s[a]<"u"?o+=s[a](e,i,t,n,this):o+=this.renderToken(e,i,t)}return o}renderInlineAsText(e,t,n){let o="";for(let s=0,i=e.length;s<i;s++)switch(e[s].type){case"text":case"code_inline":o+=e[s].content;break;case"image":o+=this.renderInlineAsText(e[s].children,t,n);break;case"html_inline":case"html_block":o+=e[s].content;break;case"softbreak":case"hardbreak":o+=`
|
|
23
|
+
`}return o}render(e,t,n){let o="";const s=this.rules;for(let i=0,r=e.length;i<r;i++){const a=e[i].type;a==="inline"?o+=this.renderInline(e[i].children,t,n):typeof s[a]<"u"?o+=s[a](e,i,t,n,this):o+=this.renderToken(e,i,t)}return o}},Rv=class{constructor(e,t,n){ke(this,"tokens",[]),ke(this,"inlineMode",!1),ke(this,"Token",ns),this.src=e,this.env=n,this.md=t}},T4=/\r\n?/g,I4=/\0/g;function F4(e){let t;t=e.src.replace(T4,`
|
|
24
|
+
`),t=t.replace(I4,"�"),e.src=t}function M4(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function O4(e){const t=e.tokens;let n=0;for(let o=0;o<t.length;o++)t[o].type!=="reference_definition"&&(o!==n&&(t[n]=t[o]),n++);t.length!==n&&(t.length=n)}function P4(e){const t=e.tokens;for(let n=0,o=t.length;n<o;n++){const s=t[n];s.type==="inline"&&e.md.inline.parse(s.content,e.md,e.env,s.children)}}function L4(e){return/^<a[>\s]/i.test(e)}function B4(e){return/^<\/a\s*>/i.test(e)}function j4(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,o=t.length;n<o;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;const s=t[n].children,i=[];let r=0;for(let a=s.length-1;a>=0;a--){const l=s[a];if(l.type==="link_close"){for(a--;s[a].level!==l.level&&s[a].type!=="link_open";)a--;continue}if(l.type==="html_inline"&&(L4(l.content)&&r>0&&r--,B4(l.content)&&r++),!(r>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let u=e.md.linkify.match(c);const d=[];let _=l.level,v=0;u.length>0&&u[0].index===0&&a>0&&s[a-1].type==="text_special"&&(u=u.slice(1));for(let g=0;g<u.length;g++){const m=u[g].url,y=e.md.normalizeLink(m);if(!e.md.validateLink(y))continue;let x=u[g].text;u[g].schema?u[g].schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText(`mailto:${x}`).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText(`http://${x}`).replace(/^http:\/\//,"");const $=u[g].index;if($>v){const O=new e.Token("text","",0);O.content=c.slice(v,$),O.level=_,d.push(O)}const w=new e.Token("link_open","a",1);w.attrs=[["href",y]],w.level=_++,w.markup="linkify",w.info="auto",d.push(w);const C=new e.Token("text","",0);C.content=x,C.level=_,d.push(C);const R=new e.Token("link_close","a",-1);R.level=--_,R.markup="linkify",R.info="auto",d.push(R),v=u[g].lastIndex}if(v<c.length){const g=new e.Token("text","",0);g.content=c.slice(v),g.level=_,d.push(g)}i.push({index:a,nodes:d})}}if(i.length>0){let a=s.length;for(const d of i)a+=d.nodes.length-1;const l=new Array(a);let c=0,u=0;i.reverse();for(let d=0;d<s.length;d++){const _=i[c];if(_?.index===d){for(const v of _.nodes)l[u++]=v;c++}else l[u++]=s[d]}t[n].children=l}}}var Ev=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,N4=/\((c|tm|r)\)/i,U4=/\((c|tm|r)\)/gi,z4={c:"©",r:"®",tm:"™"};function K4(e,t){return z4[t.toLowerCase()]}function W4(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(U4,K4)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function V4(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&Ev.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function q4(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(N4.test(e.tokens[t].content)&&W4(e.tokens[t].children),Ev.test(e.tokens[t].content)&&V4(e.tokens[t].children))}var H4=/['"]/,Tf=/['"]/g,If="’",J4=1e3;function Ff(e,t,n){for(;e.length>n;){const o=e.pop();o.isSingleQuote?t.single=o.prevSameQuoteIdx:t.double=o.prevSameQuoteIdx}}function Rr(e,t,n,o){e[t]||(e[t]=[]),e[t].push({pos:n,ch:o})}function G4(e,t){let n="",o=0;t.sort((s,i)=>s.pos-i.pos);for(let s=0;s<t.length;s++){const i=t[s];n+=e.slice(o,i.pos)+i.ch,o=i.pos+1}return n+e.slice(o)}function Z4(e,t){let n;const o=[],s={single:-1,double:-1},i={};for(let r=0;r<e.length;r++){const a=e[r],l=e[r].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(Ff(o,s,n+1),a.type!=="text")continue;const c=a.content;let u=0;const d=c.length;e:for(;u<d;){Tf.lastIndex=u;const _=Tf.exec(c);if(!_)break;let v=!0,g=!0;u=_.index+1;const m=_[0]==="'";let y=32;if(_.index-1>=0)y=c.charCodeAt(_.index-1);else for(n=r-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){y=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(u<d)x=c.charCodeAt(u);else for(n=r+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const $=Oi(y)||Mi(y),w=Oi(x)||Mi(x),C=Fi(y),R=Fi(x);if(R?v=!1:w&&(C||$||(v=!1)),C?g=!1:$&&(R||w||(g=!1)),x===34&&_[0]==='"'&&y>=48&&y<=57&&(g=v=!1),v&&g&&(v=$,g=w),!v&&!g){m&&Rr(i,r,_.index,If);continue}if(g&&(n=m?s.single:s.double,n>=0&&o[n].level===l)){const O=o[n];let B,J;m?(B=t.md.options.quotes[2],J=t.md.options.quotes[3]):(B=t.md.options.quotes[0],J=t.md.options.quotes[1]),Rr(i,r,_.index,J),Rr(i,O.tokenIdx,O.contentPos,B),Ff(o,s,n);continue e}if(v){if(o.length>=J4)return;o.push({tokenIdx:r,contentPos:_.index,isSingleQuote:m,level:l,prevSameQuoteIdx:m?s.single:s.double}),m?s.single=o.length-1:s.double=o.length-1}else g&&m&&Rr(i,r,_.index,If)}}Object.keys(i).forEach(function(r){const a=Number(r);e[a].content=G4(e[a].content,i[r])})}function Y4(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!H4.test(e.tokens[t].content)||Z4(e.tokens[t].children,e)}function X4(e){let t,n;const o=e.length;for(t=0;t<o;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<o;t++)e[t].type==="text"&&t+1<o&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function Q4(e){let t,n;const o=e.tokens,s=o.length;for(let i=0;i<s;i++){if(o[i].type!=="inline")continue;const r=o[i].children,a=r.length;for(t=0;t<a;t++)r[t].type==="text_special"&&(r[t].type="text"),r[t].children&&X4(r[t].children);for(t=n=0;t<a;t++)r[t].type==="text"&&t+1<a&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}}var Ol=[["normalize",F4],["block",M4],["strip_references",O4],["inline",P4],["linkify",j4],["replacements",q4],["smartquotes",Y4],["text_join",Q4]],Dv=class{constructor(){ke(this,"ruler",new Li),ke(this,"State",Rv);for(let e=0;e<Ol.length;e++)this.ruler.push(Ol[e][0],Ol[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,o=t.length;n<o;n++)t[n](e)}},Tv=class{constructor(e,t,n,o){ke(this,"bMarks",[]),ke(this,"eMarks",[]),ke(this,"tShift",[]),ke(this,"sCount",[]),ke(this,"bsCount",[]),ke(this,"blkIndent",0),ke(this,"line",0),ke(this,"lineMax",0),ke(this,"tight",!1),ke(this,"listIndent",-1),ke(this,"parentType","root"),ke(this,"level",0),ke(this,"Token",ns),this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;for(let i=0,r=0,a=0,l=0,c=s.length,u=!1;r<c;r++){const d=s.charCodeAt(r);if(!u)if(Qe(d)){a++,d===9?l+=4-l%4:l++;continue}else u=!0;(d===10||r===c-1)&&(d!==10&&r++,this.bMarks.push(i),this.eMarks.push(r),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),u=!1,a=0,l=0,i=r+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const o=new ns(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Qe(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Qe(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";const s=new Array(t-e);for(let i=0,r=e;r<t;r++,i++){let a=0;const l=this.bMarks[r];let c=l,u;for(r+1<t||o?u=this.eMarks[r]+1:u=this.eMarks[r];c<u&&a<n;){const d=this.src.charCodeAt(c);if(Qe(d))d===9?a+=4-(a+this.bsCount[r])%4:a++;else if(c-l<this.tShift[r])a++;else break;c++}a>n?s[i]=new Array(a-n+1).join(" ")+this.src.slice(c,u):s[i]=this.src.slice(c,u)}return s.join("")}},eE=65536;function Pl(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function Mf(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,a="";for(;o<n;)s===124&&(i?(a+=e.substring(r,o-1),r=o):(t.push(a+e.substring(r,o)),a="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(a+e.substring(r)),t}function tE(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58&&!Qe(a)||r===45&&Qe(a))return!1;for(;i<e.eMarks[s];){const C=e.src.charCodeAt(i);if(C!==124&&C!==45&&C!==58&&!Qe(C))return!1;i++}let l=Pl(e,t+1),c=l.split("|");const u=[];for(let C=0;C<c.length;C++){const R=c[C].trim();if(!R){if(C===0||C===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(R))return!1;R.charCodeAt(R.length-1)===58?u.push(R.charCodeAt(0)===58?"center":"right"):R.charCodeAt(0)===58?u.push("left"):u.push("")}if(l=Pl(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;c=Mf(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const _=e.parentType;e.parentType="table";const v=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),m=[t,0];g.map=m;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const x=e.push("tr_open","tr",1);x.map=[t,t+1];for(let C=0;C<c.length;C++){const R=e.push("th_open","th",1);u[C]&&(R.attrs=[["style",`text-align:${u[C]}`]]);const O=e.push("inline","",0);O.content=c[C].trim(),O.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let $,w=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let C=!1;for(let O=0,B=v.length;O<B;O++)if(v[O](e,s,n,!0)){C=!0;break}if(C||(l=Pl(e,s).trim(),!l)||e.sCount[s]-e.blkIndent>=4||(c=Mf(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),w+=d-c.length,w>eE))break;if(s===t+2){const O=e.push("tbody_open","tbody",1);O.map=$=[t+2,0]}const R=e.push("tr_open","tr",1);R.map=[s,s+1];for(let O=0;O<d;O++){const B=e.push("td_open","td",1);u[O]&&(B.attrs=[["style",`text-align:${u[O]}`]]);const J=e.push("inline","",0);J.content=c[O]?c[O].trim():"",J.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return $&&(e.push("tbody_close","tbody",-1),$[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=_,e.line=s,!0}function nE(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=e.getLines(t,s,4+e.blkIndent,!1)+`
|
|
25
|
+
`,i.map=[t,e.line],!0}function oE(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let a=s;s=e.skipChars(s,r);let l=s-a;if(l<3)return!1;const c=e.src.slice(a,s),u=e.src.slice(s,i);if(r===96&&u.indexOf(String.fromCharCode(r))>=0)return!1;if(o)return!0;let d=t,_=!1;for(;d++,!(d>=n||(s=a=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-a<l)&&(s=e.skipSpaces(s),!(s<i)))){_=!0;break}l=e.sCount[t],e.line=d+(_?1:0);const v=e.push("fence","code",0);return v.info=u,v.content=e.getLines(t+1,d,l,!0),v.markup=c,v.map=[t,e.line],!0}function sE(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];const r=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==62)return!1;if(o)return!0;const a=[],l=[],c=[],u=[],d=e.md.block.ruler.getRules("blockquote"),_=e.parentType;e.parentType="blockquote";let v=!1,g;for(g=t;g<n;g++){const w=e.sCount[g]<e.blkIndent;if(s=e.bMarks[g]+e.tShift[g],i=e.eMarks[g],s>=i)break;if(e.src.charCodeAt(s++)===62&&!w){let R=e.sCount[g]+1,O,B;e.src.charCodeAt(s)===32?(s++,R++,B=!1,O=!0):e.src.charCodeAt(s)===9?(O=!0,(e.bsCount[g]+R)%4===3?(s++,R++,B=!1):B=!0):O=!1;let J=R;for(a.push(e.bMarks[g]),e.bMarks[g]=s;s<i;){const Q=e.src.charCodeAt(s);if(Qe(Q))Q===9?J+=4-(J+e.bsCount[g]+(B?1:0))%4:J++;else break;s++}v=s>=i,l.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(O?1:0),c.push(e.sCount[g]),e.sCount[g]=J-R,u.push(e.tShift[g]),e.tShift[g]=s-e.bMarks[g];continue}if(v)break;let C=!1;for(let R=0,O=d.length;R<O;R++)if(d[R](e,g,n,!0)){C=!0;break}if(C){e.lineMax=g,e.blkIndent!==0&&(a.push(e.bMarks[g]),l.push(e.bsCount[g]),u.push(e.tShift[g]),c.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}a.push(e.bMarks[g]),l.push(e.bsCount[g]),u.push(e.tShift[g]),c.push(e.sCount[g]),e.sCount[g]=-1}const m=e.blkIndent;e.blkIndent=0;const y=e.push("blockquote_open","blockquote",1);y.markup=">";const x=[t,0];y.map=x,e.md.block.tokenize(e,t,g);const $=e.push("blockquote_close","blockquote",-1);$.markup=">",e.lineMax=r,e.parentType=_,x[1]=e.line;for(let w=0;w<u.length;w++)e.bMarks[w+t]=a[w],e.tShift[w+t]=u[w],e.sCount[w+t]=c[w],e.bsCount[w+t]=l[w];return e.blkIndent=m,!0}function iE(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let a=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!Qe(c))return!1;c===r&&a++}if(a<3)return!1;if(o)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(r)),!0}function Of(e,t){const n=e.eMarks[t];let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);return s!==42&&s!==45&&s!==43||o<n&&!Qe(e.src.charCodeAt(o))?-1:o}function Pf(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];let s=n;if(s+1>=o)return-1;let i=e.src.charCodeAt(s++);if(i<48||i>57)return-1;for(;;){if(s>=o)return-1;if(i=e.src.charCodeAt(s++),i>=48&&i<=57){if(s-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return s<o&&(i=e.src.charCodeAt(s),!Qe(i))?-1:s}function rE(e,t){const n=e.level+2;for(let o=t+2,s=e.tokens.length-2;o<s;o++)e.tokens[o].level===n&&e.tokens[o].type==="paragraph_open"&&(e.tokens[o+2].hidden=!0,e.tokens[o].hidden=!0,o+=2)}function aE(e,t,n,o){let s,i,r,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(u=!0);let d,_,v;if((v=Pf(e,l))>=0){if(d=!0,r=e.bMarks[l]+e.tShift[l],_=Number(e.src.slice(r,v-1)),u&&_!==1)return!1}else if((v=Of(e,l))>=0)d=!1;else return!1;if(u&&e.skipSpaces(v)>=e.eMarks[l])return!1;if(o)return!0;const g=e.src.charCodeAt(v-1),m=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),_!==1&&(a.attrs=[["start",_]])):a=e.push("bullet_list_open","ul",1);const y=[l,0];a.map=y,a.markup=String.fromCharCode(g);let x=!1;const $=e.md.block.ruler.getRules("list"),w=e.parentType;for(e.parentType="list";l<n;){i=v,s=e.eMarks[l];const C=e.sCount[l]+v-(e.bMarks[l]+e.tShift[l]);let R=C;for(;i<s;){const le=e.src.charCodeAt(i);if(le===9)R+=4-(R+e.bsCount[l])%4;else if(le===32)R++;else break;i++}const O=i;let B;O>=s?B=1:B=R-C,B>4&&(B=1);const J=C+B;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(g);const Q=[l,0];a.map=Q,d&&(a.info=e.src.slice(r,v-1));const re=e.tight,ee=e.tShift[l],z=e.sCount[l],K=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=J,e.tight=!0,e.tShift[l]=O-e.bMarks[l],e.sCount[l]=R,O>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n),(!e.tight||x)&&(c=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=K,e.tShift[l]=ee,e.sCount[l]=z,e.tight=re,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(g),l=e.line,Q[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let se=!1;for(let le=0,ae=$.length;le<ae;le++)if($[le](e,l,n,!0)){se=!0;break}if(se)break;if(d){if(v=Pf(e,l),v<0)break;r=e.bMarks[l]+e.tShift[l]}else if(v=Of(e,l),v<0)break;if(g!==e.src.charCodeAt(v-1))break}return d?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(g),y[1]=l,e.line=l,e.parentType=w,c&&rE(e,m),!0}var Ll=999;function lE(e){let t=e.length;for(let n=0;n<e.length-1;n++){const o=e.charCodeAt(n);if(o<55296||o>56319)continue;const s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(t--,n++)}return t}function oi(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Er(e,t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let o=!1;if(e.sCount[t]-e.blkIndent>3&&(o=!0),e.sCount[t]<0&&(o=!0),!o){const s=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let r=!1;for(let a=0,l=s.length;a<l;a++)if(s[a](e,t,n,!0)){r=!0;break}if(e.parentType=i,r)return-1}return e.bMarks[t]+e.tShift[t]}function cE(e,t,n,o){const s=e.src;let i=e.bMarks[t]+e.tShift[t],r=t+1;if(e.sCount[t]-e.blkIndent>=4||s.charCodeAt(i)!==91)return!1;let a=oi(e,t),l="",c=-1,u=++i;for(;i<a;){if(l.length+i-u>Ll*2)return!1;let O=s.charCodeAt(i);if(O===91)return!1;if(O===93){c=i;break}if(O===92&&(O=s.charCodeAt(++i)),O===10&&i<a){const B=Er(e,r);if(B<0)return!1;l+=s.slice(u,a),i=u=B,a=oi(e,r++);continue}i++}if(c<0||s.charCodeAt(c+1)!==58||(l+=s.slice(u,c),l.length>Ll&&lE(l)>Ll))return!1;for(i=c+2;i<a;){const O=s.charCodeAt(i);if(O===10){const B=Er(e,r);if(B<0)break;i=B,a=oi(e,r++)}else if(Qe(O))i++;else break}const d=e.md.helpers.parseLinkDestination(s,i,a);if(!d.ok)return!1;const _=e.md.normalizeLink(d.str);if(!e.md.validateLink(_))return!1;i=d.pos;const v=i,g=a,m=r;for(;i<a;){const O=s.charCodeAt(i);if(O===10){const B=Er(e,r);if(B<0)break;i=B,a=oi(e,r++)}else if(Qe(O))i++;else break}const y=i;let x=e.md.helpers.parseLinkTitle(s,i,a);for(;x.can_continue;){const O=Er(e,r);if(O<0)break;i=O,a=oi(e,r++),x=e.md.helpers.parseLinkTitle(s,i,a,x)}let $;for(y!==v&&x.ok?($=x.str,i=x.pos):($="",i=v,a=g,r=m);i<a&&Qe(s.charCodeAt(i));)i++;if(i<a&&s.charCodeAt(i)!==10&&$)for($="",i=v,a=g,r=m;i<a&&Qe(s.charCodeAt(i));)i++;if(i<a&&s.charCodeAt(i)!==10)return!1;const w=Ta(l);if(!w)return!1;if(o)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:$,href:_});const C=e.push("reference_definition","",0);C.map=[t,r],C.hidden=!0;const R=Object.create(null);return R.label=w,C.meta=R,e.line=r,!0}var uE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dE=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,fE="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Iv=new RegExp(`^(?:${dE}|${fE})`),Go=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${uE.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Iv.source}\\s*$`),/^$/,!1]];function pE(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),a=0;for(;a<Go.length&&!Go[a][0].test(r);a++);if(a===Go.length)return!1;if(o)return Go[a][2];let l=t+1;const c=Go[a][1].test("");if(!Go[a][1].test(r)){for(;l<n&&!(e.sCount[l]<e.blkIndent&&(c||!e.isEmpty(l)));l++)if(s=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],r=e.src.slice(s,i),Go[a][1].test(r)){r.length!==0&&l++;break}}e.line=l;const u=e.push("html_block","",0);return u.map=[t,l],u.content=e.getLines(t,l,e.blkIndent,!0),!0}function hE(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let r=e.src.charCodeAt(s);if(r!==35||s>=i)return!1;let a=1;for(r=e.src.charCodeAt(++s);r===35&&s<i&&a<=6;)a++,r=e.src.charCodeAt(++s);if(a>6||s<i&&!Qe(r))return!1;if(o)return!0;i=e.skipSpacesBack(i,s);const l=e.skipCharsBack(i,35,s);l>s&&Qe(e.src.charCodeAt(l-1))&&(i=l),e.line=t+1;const c=e.push("heading_open",`h${a}`,1);c.markup="########".slice(0,a),c.map=[t,e.line];const u=e.push("inline","",0);u.content=Ia(e.src.slice(s,i)),u.map=[t,e.line],u.children=[];const d=e.push("heading_close",`h${a}`,-1);return d.markup="########".slice(0,a),!0}function vE(e,t,n){const o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const s=e.parentType;e.parentType="paragraph";let i=0,r,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let v=e.bMarks[a]+e.tShift[a];const g=e.eMarks[a];if(v<g&&(r=e.src.charCodeAt(v),(r===45||r===61)&&(v=e.skipChars(v,r),v=e.skipSpaces(v),v>=g))){i=r===61?1:2;break}}if(e.sCount[a]<0)continue;let _=!1;for(let v=0,g=o.length;v<g;v++)if(o[v](e,a,n,!0)){_=!0;break}if(_)break}if(!i)return e.parentType=s,!1;const l=Ia(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const c=e.push("heading_open",`h${i}`,1);c.markup=String.fromCharCode(r),c.map=[t,e.line];const u=e.push("inline","",0);u.content=l,u.map=[t,e.line-1],u.children=[];const d=e.push("heading_close",`h${i}`,-1);return d.markup=String.fromCharCode(r),e.parentType=s,!0}function mE(e,t,n){const o=e.md.block.ruler.getRules("paragraph"),s=e.parentType;let i=t+1;for(e.parentType="paragraph";i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let c=!1;for(let u=0,d=o.length;u<d;u++)if(o[u](e,i,n,!0)){c=!0;break}if(c)break}const r=Ia(e.getLines(t,i,e.blkIndent,!1));e.line=i;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const l=e.push("inline","",0);return l.content=r,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}var Dr=[["table",tE,["paragraph","reference"]],["code",nE],["fence",oE,["paragraph","reference","blockquote","list"]],["blockquote",sE,["paragraph","reference","blockquote","list"]],["hr",iE,["paragraph","reference","blockquote","list"]],["list",aE,["paragraph","reference","blockquote"]],["reference",cE],["html_block",pE,["paragraph","reference","blockquote"]],["heading",hE,["paragraph","reference","blockquote"]],["lheading",vE],["paragraph",mE]],Fv=class{constructor(){ke(this,"ruler",new Li),ke(this,"State",Tv);for(let e=0;e<Dr.length;e++)this.ruler.push(Dr[e][0],Dr[e][1],{alt:(Dr[e][2]||[]).slice()})}tokenize(e,t,n){const o=this.ruler.getRules(""),s=o.length,i=e.md.options.maxNesting;let r=t,a=!1;for(;r<n&&(e.line=r=e.skipEmptyLines(r),!(r>=n||e.sCount[r]<e.blkIndent));){if(e.level>=i){e.line=n;break}const l=e.line;let c=!1;for(let u=0;u<s;u++)if(c=o[u](e,r,n,!1),c){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),r=e.line,r<n&&e.isEmpty(r)&&(a=!0,r++,e.line=r)}}parse(e,t,n,o){if(!e)return;const s=new this.State(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}},Mv=class{constructor(e,t,n,o){ke(this,"pos",0),ke(this,"level",0),ke(this,"pending",""),ke(this,"pendingLevel",0),ke(this,"cache",{}),ke(this,"backticks",{}),ke(this,"backticksScanned",!1),ke(this,"skipHtmlSpecial",!1),ke(this,"linkLevel",0),ke(this,"delimiters",[]),ke(this,"_prev_delimiters",[]),ke(this,"Token",ns),this.src=e,this.env=n,this.md=t,this.tokens=o,this.tokens_meta=Array(o.length),this.posMax=this.src.length}pushPending(){const e=new ns("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const o=new ns(e,t,n);let s;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const n=this.posMax,o=this.src.charCodeAt(e);let s;if(e===0)s=32;else if(e===1)s=this.src.charCodeAt(0),(s&63488)===55296&&(s=65533);else if(s=this.src.charCodeAt(e-1),(s&64512)===56320){const g=this.src.charCodeAt(e-2);s=(g&64512)===55296?65536+(g-55296<<10)+(s-56320):65533}else(s&64512)===55296&&(s=65533);let i=e;for(;i<n&&this.src.charCodeAt(i)===o;)i++;const r=i-e;let a=i<n?this.src.charCodeAt(i):32;if((a&64512)===55296){const g=this.src.charCodeAt(i+1);a=(g&64512)===56320?65536+(a-55296<<10)+(g-56320):65533}else(a&64512)===56320&&(a=65533);const l=Oi(s)||Mi(s),c=Oi(a)||Mi(a),u=Fi(s),d=Fi(a),_=!d&&(!c||u||l),v=!u&&(!l||d||c);return{can_open:_&&(t||!v||l),can_close:v&&(t||!_||c),length:r}}};function _E(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function gE(e,t){let n=e.pos;for(;n<e.posMax&&!_E(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function bE(e){return e>=65&&e<=90||e>=97&&e<=122}function yE(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function kE(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=n-Math.min(10,e.pending.length,n);let i=n;for(;i>s&&yE(e.src.charCodeAt(i-1));)i--;if(i===n||!bE(e.src.charCodeAt(i)))return!1;const r=n-i,a=e.md.linkify.matchAtStart(e.src.slice(i));if(!a)return!1;let l=a.url;if(l.length<=r)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-r);const d=e.push("link_open","a",1);d.attrs=[["href",u]],d.markup="linkify",d.info="auto";const _=e.push("text","",0);_.content=e.md.normalizeLinkText(l);const v=e.push("link_close","a",-1);v.markup="linkify",v.info="auto"}return e.pos+=l.length-r,!0}function wE(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<s&&Qe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var eu=[];for(let e=0;e<256;e++)eu.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){eu[e.charCodeAt(0)]=1});function xE(e,t){let n=e.pos;const o=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let s=e.src.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(s=e.src.charCodeAt(n),!!Qe(s));)n++;return e.pos=n,!0}if(s===32){if(!t){const a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let i=e.src[n];if(s>=55296&&s<=56319&&n+1<o){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(i+=e.src[n+1],n++)}const r="\\"+i;if(!t){const a=e.push("text_special","",0);s<256&&eu[s]!==0?a.content=i:a.content=r,a.markup=r,a.info="escape"}return e.pos=n+1,!0}function $E(e){const t={};let n=0;for(;(n=e.indexOf("`",n))!==-1;){const o=n;for(;e.charCodeAt(++n)===96;);t[n-o]=o}return t}function CE(e,t){var n;const o=e.pos;if(e.src.charCodeAt(o)!==96)return!1;const s=e.posMax;let i=o+1;for(;i<s&&e.src.charCodeAt(i)===96;)i++;const r=e.src.slice(o,i),a=r.length;if(e.backticksScanned||(e.backticks=$E(e.src),e.backticksScanned=!0),((n=e.backticks[a])!==null&&n!==void 0?n:-1)>=i){let l=i,c;for(;(c=e.src.indexOf("`",l))!==-1&&c<s;){for(l=c+1;e.src.charCodeAt(l)===96;)l++;if(l>s)break;if(l-c===a){if(!t){const u=e.push("code_inline","code",0);u.markup=r;let d=e.src.slice(i,c).replace(/\n/g," ");d.startsWith(" ")&&d.endsWith(" ")&&/[^ ]/.test(d)&&(d=d.slice(1,-1)),u.content=d}return e.pos=l,!0}}}return t||(e.pending+=r),e.pos=i,!0}function AE(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let a;i%2&&(a=e.push("text","",0),a.content=r,i--);for(let l=0;l<i;l+=2)a=e.push("text","",0),a.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Lf(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const a=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&o.push(a.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function SE(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lf(e,e.delimiters);for(let s=0;s<n;s++){var o;const i=(o=t[s])===null||o===void 0?void 0:o.delimiters;i&&Lf(e,i)}}var Ov={tokenize:AE,postProcess:SE};function RE(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Bf(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,a=String.fromCharCode(s.marker),l=e.tokens[s.token];l.type=r?"strong_open":"em_open",l.tag=r?"strong":"em",l.nesting=1,l.markup=r?a+a:a,l.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?a+a:a,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function EE(e){const t=e.tokens_meta,n=e.tokens_meta.length;Bf(e,e.delimiters);for(let s=0;s<n;s++){var o;const i=(o=t[s])===null||o===void 0?void 0:o.delimiters;i&&Bf(e,i)}}var Pv={tokenize:RE,postProcess:EE};function DE(e,t){let n,o,s,i,r="",a="",l=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,_=e.pos+1,v=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(v<0)return!1;let g=v+1;if(g<d&&e.src.charCodeAt(g)===40){for(c=!1,g++;g<d&&(n=e.src.charCodeAt(g),!(!Qe(n)&&n!==10));g++);if(g>=d)return!1;if(l=g,s=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?g=s.pos:r="",l=g;g<d&&(n=e.src.charCodeAt(g),!(!Qe(n)&&n!==10));g++);if(s=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<d&&l!==g&&s.ok)for(a=s.str,g=s.pos;g<d&&(n=e.src.charCodeAt(g),!(!Qe(n)&&n!==10));g++);}(g>=d||e.src.charCodeAt(g)!==41)&&(c=!0),g++}if(c){if(typeof e.env.references>"u")return!1;if(g<d&&e.src.charCodeAt(g)===91?(l=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?o=e.src.slice(l,g++):g=v+1):g=v+1,o||(o=e.src.slice(_,v)),o=Ta(o),i=e.env.references[o],!i)return e.pos=u,!1;r=i.href,a=i.title}if(!t){e.pos=_,e.posMax=v;const m=e.push("link_open","a",1),y=[["href",r]];if(m.attrs=y,a&&y.push(["title",a]),o){const x=Object.create(null);x.label=o,m.meta=x}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=d,!0}function TE(e,t){let n,o,s,i,r,a,l,c,u="";const d=e.pos,_=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const v=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(i=g+1,i<_&&e.src.charCodeAt(i)===40){for(i++;i<_&&(n=e.src.charCodeAt(i),!(!Qe(n)&&n!==10));i++);if(i>=_)return!1;for(c=i,a=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?i=a.pos:u=""),c=i;i<_&&(n=e.src.charCodeAt(i),!(!Qe(n)&&n!==10));i++);if(a=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<_&&c!==i&&a.ok)for(l=a.str,i=a.pos;i<_&&(n=e.src.charCodeAt(i),!(!Qe(n)&&n!==10));i++);else l="";if(i>=_||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<_&&e.src.charCodeAt(i)===91?(c=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?s=e.src.slice(c,i++):i=g+1):i=g+1,s||(s=e.src.slice(v,g)),s=Ta(s),r=e.env.references[s],!r)return e.pos=d,!1;u=r.href,l=r.title}if(!t){o=e.src.slice(v,g);const m=[];e.md.inline.parse(o,e.md,e.env,m);const y=e.push("image","img",0),x=[["src",u],["alt",""]];if(y.attrs=x,y.children=m,y.content=o,l&&x.push(["title",l]),s){const $=Object.create(null);$.label=s,y.meta=$}}return e.pos=i,e.posMax=_,!0}var IE=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,FE=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ME(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const o=e.pos,s=e.posMax;for(;;){if(++n>=s)return!1;const r=e.src.charCodeAt(n);if(r===60)return!1;if(r===62)break}const i=e.src.slice(o+1,n);if(FE.test(i)){const r=e.md.normalizeLink(i);if(!e.md.validateLink(r))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}if(IE.test(i)){const r=e.md.normalizeLink(`mailto:${i}`);if(!e.md.validateLink(r))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}return!1}function OE(e){return/^<a[>\s]/i.test(e)}function PE(e){return/^<\/a\s*>/i.test(e)}function Lv(e){const t=e|32;return t>=97&&t<=122}function LE(e,t){const n=e.src;let o,s;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;o=t+4,s="-->"}else if(n.startsWith("<![CDATA[",t))o=t+9,s="]]>";else if(n.charCodeAt(t+1)===63)o=t+2,s="?>";else if(Lv(n.charCodeAt(t+2)))o=t+3,s=">";else return-1;if(e.skipHtmlSpecial)return-1;const i=n.indexOf(s,o);return i<0?(e.skipHtmlSpecial=!0,-1):i+s.length}function BE(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=n)return!1;let s;const i=e.src.charCodeAt(o+1);if(i===33||i===63)s=LE(e,o);else if(i===47||Lv(i)){const r=e.src.slice(o).match(Iv);s=r?o+r[0].length:-1}else return!1;if(s<0)return!1;if(!t){const r=e.push("html_inline","",0);r.content=e.src.slice(o,s),OE(r.content)&&e.linkLevel++,PE(r.content)&&e.linkLevel--}return e.pos=s,!0}var jE=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,NE=/^&([a-z][a-z0-9]{1,31});/i;function UE(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=e.src.slice(n).match(jE);if(s){if(!t){const i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),r=e.push("text_special","",0);r.content=Qc(i)?Ii(i):Ii(65533),r.markup=s[0],r.info="entity"}return e.pos+=s[0].length,!0}}else{const s=e.src.slice(n).match(NE);if(s){const i=hv(s[0]);if(i!==s[0]){if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s[0],r.info="entity"}return e.pos+=s[0].length,!0}}}return!1}function jf(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const a=e[r];if(i.push(0),(e[o].marker!==a.marker||s!==a.token-1)&&(o=r),s=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[a.marker][(a.open?3:0)+a.length%3];let c=o-i[o]-1,u=c;for(;c>l;c-=i[c]+1){const d=e[c];if(d.marker===a.marker&&d.open&&d.end<0){let _=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(_=!0),!_){const v=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+v,i[c]=v,a.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=u)}}function zE(e){const t=e.tokens_meta,n=e.tokens_meta.length;jf(e.delimiters);for(let s=0;s<n;s++){var o;const i=(o=t[s])===null||o===void 0?void 0:o.delimiters;i&&jf(i)}}function KE(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++)s[t].nesting<0&&o--,s[t].level=o,s[t].nesting>0&&o++,s[t].type==="text"&&t+1<i&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}var Bl=[["text",gE],["linkify",kE],["newline",wE],["escape",xE],["backticks",CE],["strikethrough",Ov.tokenize],["emphasis",Pv.tokenize],["link",DE],["image",TE],["autolink",ME],["html_inline",BE],["entity",UE]],jl=[["balance_pairs",zE],["strikethrough",Ov.postProcess],["emphasis",Pv.postProcess],["fragments_join",KE]],Bv=class{constructor(){ke(this,"ruler",new Li),ke(this,"ruler2",new Li),ke(this,"State",Mv);for(let e=0;e<Bl.length;e++)this.ruler.push(Bl[e][0],Bl[e][1]);for(let e=0;e<jl.length;e++)this.ruler2.push(jl[e][0],jl[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),o=n.length,s=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let r=!1;if(e.level<s){for(let a=0;a<o;a++)if(e.level++,r=n[a](e,!0),e.level--,r){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,i[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,o=e.posMax,s=e.md.options.maxNesting;for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<s){for(let a=0;a<n;a++)if(r=t[a](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,o){const s=new this.State(e,t,n,o);this.tokenize(s);const i=this.ruler2.getRules(""),r=i.length;for(let a=0;a<r;a++)i[a](s)}},WE={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},VE=/^(vbscript|javascript|file|data):/,qE=/^data:image\/(gif|png|jpeg|webp);/,Nf=["http:","https:","mailto:"],Xn=class{validateLink(e){const t=e.trim().toLowerCase();return VE.test(t)?qE.test(t):!0}normalizeLink(e){const t=_c(e,!0);if(t.hostname&&(!t.protocol||Nf.indexOf(t.protocol)>=0))try{t.hostname=Rf.toASCII(t.hostname)}catch{}return t.auth&&(t.auth=ao(t.auth)),t.hostname&&(t.hostname=ao(t.hostname)),t.pathname&&(t.pathname=ao(t.pathname)),t.search&&(t.search=ao(t.search)),t.hash&&(t.hash=ao(t.hash)),mc(t)}normalizeLinkText(e){const t=_c(e,!0);if(t.hostname&&(!t.protocol||Nf.indexOf(t.protocol)>=0))try{t.hostname=Rf.toUnicode(t.hostname)}catch{}return Is(mc(t),Is.defaultChars+"%")}constructor(...e){ke(this,"inline",new Bv),ke(this,"block",new Fv),ke(this,"core",new Dv),ke(this,"renderer",new Sv),ke(this,"linkify",new e4),ke(this,"utils",f4),ke(this,"helpers",Object.assign({},R4));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const s=e;if(t=WE[s],!t)throw new Error(`Wrong 'markdown-it' preset "${s}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var o;["core","block","inline"].forEach(i=>{var r;const a=(r=n[i])===null||r===void 0?void 0:r.rules;a&&this[i].ruler.enableOnly(a)});const s=(o=n.inline)===null||o===void 0?void 0:o.rules2;s&&this.inline.ruler2.enableOnly(s)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(s=>{n=n.concat(this[s].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const o=e.filter(s=>n.indexOf(s)<0);if(o.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${o}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(s=>{n=n.concat(this[s].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const o=e.filter(s=>n.indexOf(s)<0);if(o.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${o}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};ke(Xn,"Token",ns);ke(Xn,"Ruler",Li);ke(Xn,"Renderer",Sv);ke(Xn,"ParserCore",Dv);ke(Xn,"StateCore",Rv);ke(Xn,"ParserBlock",Fv);ke(Xn,"StateBlock",Tv);ke(Xn,"ParserInline",Bv);ke(Xn,"StateInline",Mv);var HE=$v(Xn);const JE=["data-streaming"],GE=["innerHTML"],ZE={key:0,class:"va-md__caret","aria-hidden":"true"},YE=Ce({__name:"VaMarkdown",props:{content:{default:""},streaming:{type:Boolean,default:!1},linkify:{type:Boolean,default:!0},breaks:{type:Boolean,default:!0}},setup(e){const t=e,n=new HE({html:!1,linkify:t.linkify,breaks:t.breaks,typographer:!1}),o=T(()=>t.content?n.render(t.content):"");return(s,i)=>(h(),b("div",{class:"va-md","data-streaming":e.streaming||void 0},[f("div",{class:"va-md__body",innerHTML:o.value},null,8,GE),e.streaming?(h(),b("span",ZE)):E("",!0)],8,JE))}}),XE={key:1,class:"va-thought-box"},QE={class:"va-thought-box__title"},e5={key:0,class:"va-thought-box__duration"},t5={key:1,class:"va-thought-box__duration"},n5={key:0,class:"va-thought-box__content"},o5=Ce({__name:"VaThoughtBox",props:{thought:{default:""},expanded:{type:Boolean,default:!0},duration:{default:void 0},streaming:{type:Boolean,default:!1},summaryMode:{type:Boolean,default:!1},toolCount:{default:0}},emits:["update:expanded","update:summaryMode","toggle"],setup(e,{emit:t}){const n=e,o=t,s=T({get:()=>n.expanded,set:a=>{o("update:expanded",a),o("toggle",a)}});function i(){s.value=!s.value}function r(){o("update:summaryMode",!1),o("update:expanded",!0),o("toggle",!0)}return(a,l)=>n.summaryMode?(h(),b("button",{key:0,class:"va-thought-box__summary",type:"button",title:"展开过程详情",onClick:r},[j(p(ik),{size:14,class:"va-thought-box__summary-icon"}),f("span",null,[l[0]||(l[0]=pe(" 已完成",-1)),n.duration!=null?(h(),b(G,{key:0},[pe(" · 耗时 "+A(n.duration)+"s",1)],64)):E("",!0),n.toolCount?(h(),b(G,{key:1},[pe(" · "+A(n.toolCount)+" 次工具调用",1)],64)):E("",!0)]),j(p(os),{size:13,class:"va-thought-box__summary-chevron"})])):(h(),b("div",XE,[f("div",{class:"va-thought-box__header",onClick:i},[f("div",QE,[j(p(ok),{size:15,class:ye({"va-thought-box__pulse-icon":n.streaming})},null,8,["class"]),l[1]||(l[1]=f("span",null,"思考过程",-1)),n.duration!=null?(h(),b("span",e5,"· 耗时 "+A(n.duration)+"s",1)):n.streaming?(h(),b("span",t5,"· 正在深度思考…")):E("",!0)]),f("button",{class:"va-thought-box__btn",type:"button",onClick:Fe(i,["stop"])},[pe(A(s.value?"收起":"展开")+" ",1),s.value?(h(),ce(p(sk),{key:0,size:13})):(h(),ce(p(os),{key:1,size:13}))])]),s.value?(h(),b("div",n5,[Je(a.$slots,"default",{},()=>[pe(A(n.thought||(n.streaming?"正在拆解任务意图,规划工具调用序列与沙箱执行路径…":"暂无思考内容")),1)])])):E("",!0)]))}}),s5=["aria-label"],i5={class:"va-turn-rail__track","aria-hidden":"true"},r5=["aria-current","aria-label","onClick","onMouseenter","onFocus"],a5={class:"va-turn-rail__preview-index"},l5={class:"va-turn-rail__preview-text"},c5=96,Uf=1,u5=Ce({__name:"VaTurnRail",props:{items:{default:()=>[]},container:{default:null},anchorAttr:{default:"data-turn-id"},offset:{default:16},minItems:{default:1},preview:{type:Boolean,default:!0},floating:{type:Boolean,default:!0},activeId:{default:""},ariaLabel:{default:"对话轮次快速跳转"}},emits:["select","update:activeId"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=P(null),r=P([]),a=P(""),l=T(()=>o.activeId||a.value),c=T(()=>Math.max(0,o.items.findIndex(H=>H.id===l.value))),u=T(()=>o.items.length>o.minItems),d=T(()=>{const H=o.items.length;return H<=1?0:Math.min(1,Math.max(0,c.value/(H-1)))});function _(H,W){return(H.label??"").replace(/\s+/g," ").trim()||`第 ${W+1} 轮`}function v(H){return H.replace(/["\\]/g,"\\$&")}function g(H){const W=o.container;return W?W.querySelector(`[${o.anchorAttr}="${v(H)}"]`):null}let m=null,y=null,x=null;function $(){const H=o.container;if(!H||o.items.length===0)return;const W=H.getBoundingClientRect().top;let Y=o.items[0].id;if(H.scrollHeight-H.clientHeight>Uf&&H.scrollHeight-H.scrollTop-H.clientHeight<=Uf)Y=o.items[o.items.length-1].id;else for(const ze of o.items){const Ze=g(ze.id);if(Ze){if(Ze.getBoundingClientRect().top-W>c5)break;Y=ze.id}}Y!==a.value&&(a.value=Y,s("update:activeId",Y))}function w(){if(m===null){if(typeof requestAnimationFrame!="function"){$();return}m=requestAnimationFrame(()=>{m=null,$()})}}function C(){w()}function R(){y&&y.removeEventListener("scroll",C),y=null,x?.disconnect(),x=null,m!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(m),m=null)}function O(){R();const H=o.container;if(H){if(y=H,H.addEventListener("scroll",C,{passive:!0}),typeof ResizeObserver<"u"){x=new ResizeObserver(()=>w()),x.observe(H);const W=H.firstElementChild;W instanceof HTMLElement&&x.observe(W)}w()}}Ee(()=>o.container,O,{immediate:!0}),Ee(()=>o.items.map(H=>H.id).join("|"),()=>w()),vt(R);function B(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function J(H){const W=o.container,Y=g(H);if(!W||!Y)return;const Ae=W.scrollTop+(Y.getBoundingClientRect().top-W.getBoundingClientRect().top)-o.offset,ze=Math.max(0,Ae);if(typeof W.scrollTo=="function"){W.scrollTo({top:ze,behavior:B()?"auto":"smooth"});return}W.scrollTop=ze}function Q(H,W){a.value=H.id,s("update:activeId",H.id),s("select",H.id,W),J(H.id)}function re(H,W){r.value[W]=H??null}function ee(H){const W=o.items.length;if(W===0)return;let Y=-1;if(H.key==="Home"?Y=0:H.key==="End"?Y=W-1:H.key==="ArrowUp"?Y=Math.max(0,c.value-1):H.key==="ArrowDown"&&(Y=Math.min(W-1,c.value+1)),Y<0)return;H.preventDefault();const Ae=o.items[Y];Ae&&(Q(Ae,Y),r.value[Y]?.focus())}const z=P(""),K=P(""),se=T(()=>o.preview?z.value||K.value:""),le=T(()=>o.items.find(H=>H.id===se.value)??null),ae=T(()=>o.items.findIndex(H=>H.id===se.value)),ve=P(0);function fe(){const H=se.value,W=i.value,Y=r.value[ae.value];if(!H||!W||!Y)return;const Ae=Y.getBoundingClientRect(),ze=W.getBoundingClientRect();ve.value=Ae.top+Ae.height/2-ze.top}Ee(se,async()=>{await it(),fe()});function L(){se.value&&fe()}return t({measure:$,scrollTo:J,activeId:l}),(H,W)=>u.value?(h(),b("nav",{key:0,ref_key:"rootRef",ref:i,class:ye(["va-turn-rail",{"va-turn-rail--floating":o.floating}]),"aria-label":o.ariaLabel,onKeydown:ee},[f("div",i5,[f("span",{class:"va-turn-rail__track-fill",style:Le({transform:`scaleY(${d.value})`})},null,4)]),f("ol",{class:"va-turn-rail__list",onScrollPassive:L},[(h(!0),b(G,null,me(o.items,(Y,Ae)=>(h(),b("li",{key:Y.id,class:"va-turn-rail__item"},[f("button",{ref_for:!0,ref:ze=>re(ze,Ae),type:"button",class:ye(["va-turn-rail__dot",[`va-turn-rail__dot--${Y.role==="assistant"?"assistant":"user"}`,{"va-turn-rail__dot--active":Y.id===l.value,"va-turn-rail__dot--streaming":Y.status==="streaming","va-turn-rail__dot--error":Y.status==="error"}]]),"aria-current":Y.id===l.value?"true":void 0,"aria-label":`跳到${_(Y,Ae)}`,onClick:ze=>Q(Y,Ae),onMouseenter:ze=>z.value=Y.id,onMouseleave:W[0]||(W[0]=ze=>z.value=""),onFocus:ze=>K.value=Y.id,onBlur:W[1]||(W[1]=ze=>K.value="")},[...W[2]||(W[2]=[f("span",{class:"va-turn-rail__pip","aria-hidden":"true"},null,-1)])],42,r5)]))),128))],32),le.value?(h(),b("div",{key:0,class:"va-turn-rail__preview",role:"tooltip",style:Le({top:`${ve.value}px`})},[f("span",a5,"#"+A(ae.value+1),1),f("span",l5,A(_(le.value,ae.value)),1)],4)):E("",!0)],42,s5)):E("",!0)}});const d5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Tr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const f5=({size:e,strokeWidth:t=2,absoluteStrokeWidth:n,color:o,iconNode:s,name:i,class:r,...a},{slots:l})=>pn("svg",{...Tr,width:e||Tr.width,height:e||Tr.height,stroke:o||Tr.stroke,"stroke-width":n?Number(t)*24/Number(e):t,class:["lucide",`lucide-${d5(i??"icon")}`],...a},[...s.map(c=>pn(...c)),...l.default?[l.default()]:[]]);const Oe=(e,t)=>(n,{slots:o})=>pn(f5,{...n,iconNode:t,name:e},o);const p5=Oe("ArrowDownIcon",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const h5=Oe("BellIcon",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);const v5=Oe("BotIcon",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const zf=Oe("BriefcaseIcon",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);const ra=Oe("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Bi=Oe("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const jv=Oe("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const m5=Oe("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Kf=Oe("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const _5=Oe("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const g5=Oe("CpuIcon",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const b5=Oe("EllipsisIcon",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const y5=Oe("EyeOffIcon",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const k5=Oe("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const w5=Oe("GaugeIcon",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);const x5=Oe("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Wf=Oe("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const Vf=Oe("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const $5=Oe("KeyIcon",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);const qf=Oe("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const C5=Oe("ListTodoIcon",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);const ui=Oe("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const A5=Oe("LockIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const S5=Oe("MessageSquareTextIcon",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);const R5=Oe("MousePointerClickIcon",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);const jr=Oe("PanelRightIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Hf=Oe("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Nv=Oe("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const E5=Oe("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const D5=Oe("RouteIcon",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const T5=Oe("ServerIcon",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const Uv=Oe("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const I5=Oe("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const F5=Oe("ShieldCheckIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const M5=Oe("SlidersVerticalIcon",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);const bc=Oe("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const Jf=Oe("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const O5=Oe("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const aa=Oe("WrenchIcon",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Gf=Oe("ZapIcon",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),P5={class:"va-console__sidebar"},L5={key:0,class:"va-console__stree-skeleton","aria-label":"加载会话列表"},B5={class:"va-sidebar__foot"},j5={class:"va-console__bell",type:"button","aria-label":"通知"},N5={key:0,class:"va-console__bell-badge"},U5={class:"va-console__notif-panel"},z5=Ce({__name:"ConsoleSidebar",props:{workspaces:{},sessions:{},loading:{type:Boolean},activeWorkspaceId:{},activeSessionId:{},isNewChat:{type:Boolean},sessionRunningMap:{},notifications:{},notifOpen:{type:Boolean}},emits:["start-new-chat","select-session","pick-workspace","delete-workspace","rename-session","toggle-archive","toggle-pin","delete-session","open-settings","update:notifOpen","open-notification","read-notification","all-read"],setup(e,{emit:t}){const n=e,o=t,s=T(()=>(n.notifications??[]).filter(d=>d.unread).length),i=T(()=>[...n.sessions.filter(_=>!_.archived&&_.status!=="archived")].sort((_,v)=>Number(v.pinned??!1)-Number(_.pinned??!1))),r=T(()=>n.sessions.filter(d=>d.archived||d.status==="archived")),a=T(()=>i.value.map(d=>({id:d.id,title:d.title,createdAt:d.createdAt,updatedAt:d.updatedAt,archived:!1,workspaceId:d.workspaceId,running:n.sessionRunningMap.get(d.id)||d.isRunning,pinned:d.pinned}))),l=T(()=>r.value.map(d=>({id:d.id,title:d.title,createdAt:d.createdAt,updatedAt:d.updatedAt,archived:!0,workspaceId:d.workspaceId,pinned:d.pinned}))),c=T(()=>n.workspaces.map(d=>({id:d.id,name:d.name,description:d.rootPath})));function u(d){return n.sessions.find(_=>_.id===d)}return(d,_)=>(h(),b("aside",P5,[e.loading?(h(),b("div",L5,[(h(),b(G,null,me(6,v=>j(p(lo),{key:v,height:26,radius:"6px",width:v%2?"92%":"78%"},null,8,["width"])),64))])):(h(),ce(p(ax),{key:1,class:"va-console__stree",workspaces:c.value,sessions:a.value,archived:l.value,"current-workspace-id":e.activeWorkspaceId,"current-session-id":e.isNewChat?"":e.activeSessionId,"new-session":"",searchable:"",collapsible:"","hover-ops":"","workspace-create-mode":"picker","confirm-mode":"none",onCreateWorkspacePick:_[5]||(_[5]=v=>o("pick-workspace")),onCreateSession:_[6]||(_[6]=v=>o("start-new-chat",v)),onSelectSession:_[7]||(_[7]=v=>{const g=u(v);g&&o("select-session",g)}),onRemoveWorkspace:_[8]||(_[8]=v=>o("delete-workspace",v)),onRename:_[9]||(_[9]=(v,g)=>o("rename-session",v,g)),onArchive:_[10]||(_[10]=(v,g)=>o("toggle-archive",v,g)),onTogglePin:_[11]||(_[11]=v=>o("toggle-pin",v)),onRemove:_[12]||(_[12]=v=>o("delete-session",v))},{footer:we(()=>[f("div",B5,[j(p(ho),{open:n.notifOpen??!1,placement:"top-start",offset:8,"onUpdate:open":_[3]||(_[3]=v=>o("update:notifOpen",v))},{trigger:we(()=>[f("button",j5,[j(p(h5),{size:15}),s.value>0?(h(),b("span",N5,A(s.value>9?"9+":s.value),1)):E("",!0)])]),default:we(()=>[f("div",U5,[j(p(XS),{notifications:n.notifications??[],title:"通知","relative-time":"","empty-label":"暂无通知;审批到达与后台任务结束会出现在这里",onOpen:_[0]||(_[0]=v=>o("open-notification",v)),onRead:_[1]||(_[1]=v=>o("read-notification",v)),onAllRead:_[2]||(_[2]=v=>o("all-read"))},null,8,["notifications"])])]),_:1},8,["open"]),j(p(Cs),{variant:"ghost",size:"sm",block:"",onClick:_[4]||(_[4]=v=>o("open-settings"))},{icon:we(()=>[j(p(Uv),{size:15})]),default:we(()=>[_[13]||(_[13]=pe(" 设置 ",-1))]),_:1})])]),_:1},8,["workspaces","sessions","archived","current-workspace-id","current-session-id"]))]))}}),K5={class:"va-console__seat-btn",type:"button","aria-label":"输入辅助菜单"},Zf=48*1024,Yf=Ce({__name:"ComposerMenu",emits:["clear","refFile","insert","openCommandMenu"],setup(e,{emit:t}){const n=t,o=[{id:"clear",label:"清空输入",icon:"✕"},{id:"ref-file",label:"引用工作区文件…",icon:"@",shortcut:"@"},{id:"import-text",label:"导入文本文件…",icon:"📄"},{id:"d1",label:"",divider:!0},{id:"cmdk",label:"命令面板",icon:"⌘",shortcut:"⌘K"}];function s(a){switch(a.id){case"clear":n("clear");break;case"ref-file":n("refFile");break;case"import-text":i.value?.click();break;case"cmdk":n("openCommandMenu");break}}const i=P(null);function r(a){const l=a.target,c=l.files?.[0];if(l.value="",!c)return;const u=new FileReader;u.onload=()=>{let d=String(u.result??"");d.length>Zf&&(d=`${d.slice(0,Zf)}
|
|
26
|
+
…(超出 48KB 已截断)`),n("insert",`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
[${c.name}]
|
|
30
|
+
${d}
|
|
31
|
+
---
|
|
32
|
+
`)},u.readAsText(c)}return(a,l)=>(h(),b(G,null,[j(p(PA),{items:o,trigger:"click",placement:"top-end",offset:6,onSelect:s},{trigger:we(()=>[f("button",K5,[j(p(b5),{size:13})])]),_:1}),f("input",{ref_key:"fileInput",ref:i,type:"file",hidden:"",accept:".txt,.md,.markdown,.json,.csv,.log,.yml,.yaml,.ts,.js,.vue,text/*",onChange:r},null,544)],64))}}),W5={class:"va-usage"},V5={class:"va-usage__window"},q5={class:"va-usage__hint"},H5={key:0,class:"va-usage__loading","aria-label":"加载用量数据"},J5=["title"],G5={class:"va-usage__kpis"},Z5={class:"va-usage__kpi"},Y5={class:"va-usage__kpi-sub"},X5={class:"va-usage__kpi"},Q5={key:1,class:"va-usage__quota"},eD={key:2,class:"va-usage__quota"},tD={key:3,class:"va-usage__hint"},nD={key:4,class:"va-usage__breakdown"},oD={key:5,class:"va-console__rtab-empty"},sD=Ce({__name:"UsagePanel",props:{usage:{}},setup(e){const t=e,n=[{value:"24h",label:"24 小时"},{value:"7d",label:"7 天"},{value:"30d",label:"30 天"}],o=T(()=>t.usage.isCustom.value?"":t.usage.preset.value);function s(m){t.usage.setPreset(String(m))}function i(m){t.usage.setCustomRange(m.start,m.end)}const r=T(()=>{const m=t.usage.currentSessionCost.value;return m&&m.costUsd>0?m:null}),a=T(()=>t.usage.summary.value?.tokens??0),l=T(()=>t.usage.summary.value?.costUsd??0),c=T(()=>t.usage.summary.value?.recordCount??0),u=T(()=>Object.entries(t.usage.summary.value?.byModel??{}).map(([m,y])=>({label:m,value:Number(y.costUsd.toFixed(4))})).sort((m,y)=>y.value-m.value));function d(m){return m<36e5?`${Math.round(m/6e4)} 分钟`:m<864e5?`${Math.round(m/36e5)} 小时`:`${Math.round(m/864e5)} 天`}const _=T(()=>`准入窗口 · ${d(t.usage.limits.value.windowMs)} · 超限新请求 429`),v=T(()=>{const m=t.usage.limits.value.windowTokenLimit;return m>0?{limit:m,used:t.usage.quotaUsage.value?.tokens??0}:null}),g=T(()=>{const m=t.usage.limits.value.windowUsdLimit;return m>0?{limit:m,used:t.usage.quotaUsage.value?.costUsd??0}:null});return(m,y)=>(h(),b("div",W5,[f("div",V5,[j(p(Yh),{size:"sm","full-width":"","aria-label":"统计窗口",options:n,"model-value":o.value,"onUpdate:modelValue":s},null,8,["model-value"]),j(p(BS),{months:1,onChange:i})]),f("p",q5,[pe(A(e.usage.isCustom.value?"自定义日期区间":"滚动窗口 · 截止此刻")+" ",1),c.value>0?(h(),b(G,{key:0},[pe("· "+A(c.value)+" 轮",1)],64)):E("",!0)]),e.usage.loading.value&&!e.usage.summary.value?(h(),b("div",H5,[j(p(lo),{height:44,radius:"8px"}),j(p(lo),{height:44,radius:"8px"}),j(p(lo),{height:72,radius:"8px"})])):(h(),b(G,{key:1},[r.value?(h(),b("p",{key:0,class:"va-usage__session-cost",title:`近 30 天 · ${r.value.recordCount} 轮`}," 当前会话 · "+A(p(Wt)(r.value.tokens))+" tokens · $"+A(r.value.costUsd.toFixed(4)),9,J5)):E("",!0),f("div",G5,[f("div",Z5,[y[0]||(y[0]=f("span",{class:"va-usage__kpi-label"},"Tokens",-1)),j(p(zd),{class:"va-usage__kpi-value",value:a.value,format:{notation:"compact",maximumFractionDigits:1}},null,8,["value"]),f("span",Y5,A(p(Wt)(a.value)),1)]),f("div",X5,[y[1]||(y[1]=f("span",{class:"va-usage__kpi-label"},"Cost",-1)),j(p(zd),{class:"va-usage__kpi-value",value:l.value,format:{style:"currency",currency:"USD"}},null,8,["value"]),y[2]||(y[2]=f("span",{class:"va-usage__kpi-sub"},"USD · 计价表命中才记钱",-1))])]),v.value?(h(),b("div",Q5,[j(p(of),{segments:[{label:"Tokens",used:v.value.used}],limit:v.value.limit,unit:"tokens",period:_.value},null,8,["segments","limit","period"])])):E("",!0),g.value?(h(),b("div",eD,[j(p(of),{segments:[{label:"Cost",used:g.value.used}],limit:g.value.limit,unit:"USD",period:_.value},null,8,["segments","limit","period"])])):E("",!0),!v.value&&!g.value?(h(),b("p",tD," 未设配额(设置 → 执行 → 成本配额:设窗口 Token/费用上限,达到后新请求 429 拒绝) ")):E("",!0),u.value.length>0?(h(),b("div",nD,[j(p(b3),{items:u.value,unit:"USD","bar-scale":"max","max-rows":5},null,8,["items"])])):(h(),b("div",oD,[...y[3]||(y[3]=[f("p",null,"所选窗口内暂无用量记录",-1)])]))],64))]))}}),iD={},Zi={"Content-Type":"application/json"};function rD(){let e="";try{e=localStorage.getItem("vuagent_token")||""}catch{}return e||iD?.VITE_VUAGENT_TOKEN||""}function Mn(){const e=rD();return e?{Authorization:`Bearer ${e}`}:{}}async function On(e){const t=await fetch(e,{headers:Mn()});return t.ok?await t.json():null}async function Zt(e,t,n){const o=await fetch(e,{method:t,headers:{...Mn(),...n===void 0?{}:Zi},body:n===void 0?void 0:JSON.stringify(n)});if(!o.ok){const s=await o.json().catch(()=>({}));if(s?.error)throw new Error(s.error);return null}return await o.json()}const aD=11*6e4;function lD(){return On("/api/workspaces")}function cD(e){return Zt("/api/workspaces","POST",e)}function zv(e){return On(`/api/workspaces/${e}/files`)}function uD(e){return Zt(`/api/workspaces/${e}`,"DELETE")}async function dD(){let e;try{e=await fetch("/api/workspaces/pick-directory",{method:"POST",headers:Mn(),signal:AbortSignal.timeout(aD)})}catch(n){return{kind:"unavailable",error:n instanceof Error&&n.name==="TimeoutError"?"选择框等待超时":String(n),hint:"重试一次,或直接手动输入绝对路径。"}}const t=await e.json().catch(()=>null);return e.ok?t?.cancelled?{kind:"cancelled"}:{kind:"picked",workspace:t??{}}:e.status===409?{kind:"busy",error:t?.error??"已有一个文件夹选择框在等待操作"}:{kind:"unavailable",error:t?.error??`选择器调用失败(HTTP ${e.status})`,hint:t?.hint}}function fD(){return On("/api/sessions")}function pD(e){return On(`/api/sessions/${e}`)}function hD(e){return Zt("/api/sessions","POST",e)}function yi(e,t){return Zt(`/api/sessions/${e}`,"PATCH",t)}function vD(e){return Zt(`/api/sessions/${e}`,"DELETE")}async function mD(e){const t=await fetch(`/api/sessions/${e}/compact`,{method:"POST",headers:Mn()}),n=await t.json().catch(()=>({}));if(!t.ok)throw new Error(n?.error||`压缩请求失败 [${t.status}] ${t.statusText}`);return n}function _D(e,t){return Zt(`/api/settings/models/${e}`,"PATCH",t)}function gD(e){return Zt(`/api/settings/models/${e}`,"DELETE")}function bD(){return On("/api/settings/providers")}function yD(e){return Zt("/api/settings/providers","POST",e)}function kD(e,t){return Zt(`/api/settings/providers/${e}`,"PATCH",t)}async function wD(e,t=!1){const n=await fetch(`/api/settings/providers/${e}${t?"?cascade=true":""}`,{method:"DELETE",headers:Mn()});if(n.status===409){const o=await n.json().catch(()=>({}));return{success:!1,error:o.error,boundModels:o.boundModels,reason:o.reason}}return n.ok?await n.json():null}function xD(e,t){return Zt(`/api/settings/providers/${e}/models`,"POST",t)}function $D(e){return Zt(`/api/settings/models/${e}/verify-capabilities`,"POST",{})}function CD(e){return On(`/api/settings/providers/${e}/models/discover`)}async function Xf(e){const t=await fetch("/api/settings/models/test",{method:"POST",headers:{...Mn(),...Zi},body:JSON.stringify(e)});if(!t.ok)throw new Error(`探测请求失败 [${t.status}] ${t.statusText}`);return await t.json()}function Kv(){return On("/api/config")}function AD(e,t){return Zt(`/api/config/${encodeURIComponent(e)}`,"PATCH",t)}function SD(e){return Zt(`/api/config/${encodeURIComponent(e)}/reset`,"POST")}function RD(){return On("/api/tools")}function ED(e,t){return Zt(`/api/tools/${encodeURIComponent(e)}`,"PATCH",{enabled:t})}async function DD(){return On("/api/action/suspended")}async function TD(e,t){return(await fetch(`/api/action/${e}`,{method:"POST",headers:{...Mn(),...Zi},body:JSON.stringify(t)})).ok}async function Qf(e,t){const n=await fetch(`/api/action/${e}`,{method:"POST",headers:{...Mn(),...Zi},body:JSON.stringify(t)});if(n.status===422){const o=await n.json().catch(()=>null);if(o?.fieldErrors&&Object.keys(o.fieldErrors).length>0)return{ok:!1,status:422,fieldErrors:o.fieldErrors}}return{ok:n.ok,status:n.status}}async function ID(e){try{await fetch(`/api/sessions/${e}/abort`,{method:"POST",headers:Mn()})}catch{}}async function FD(e){const t=await fetch("/api/chat",{method:"POST",headers:{...Mn(),...Zi},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>null);throw new Error(n?.error||`服务器返回错误 [${t.status}] ${t.statusText}`)}return t}async function MD(e){const t=await fetch(`/api/sessions/${e}/stream`,{headers:Mn()});if(!t.ok)throw new Error(`服务器返回错误 [${t.status}] ${t.statusText}`);return t}function Nl(e={}){const t=new URLSearchParams;e.since&&e.until?(t.set("since",String(e.since)),t.set("until",String(e.until))):e.windowMs&&t.set("windowMs",String(e.windowMs));const n=t.toString()?`?${t.toString()}`:"";return On(`/api/finops/summary${n}`)}async function OD(e=720*36e5){return On(`/api/finops/by-session?windowMs=${e}`)}async function PD(){const t=(await Kv())?.namespaces.find(o=>o.id==="finops"),n=o=>typeof o=="number"&&Number.isFinite(o)&&o>0?o:0;return{windowTokenLimit:n(t?.values.windowTokenLimit),windowUsdLimit:n(t?.values.windowUsdLimit),windowMs:n(t?.values.windowMs)||864e5}}const Wv="vuagent:interaction-settings",LD=1;function ks(){return{autoCollapseThought:!0,autoCollapseToolCards:!0,showApprovals:!0,showFileTree:!0,showUsage:!0}}function BD(e){const t=ks();if(e===null||typeof e!="object")return t;const n=e,o={...t};for(const s of Object.keys(t)){const i=n[s];typeof i==typeof t[s]&&(o[s]=i)}return o}function jD(e){if(!e)return ks();try{const t=e.getItem(Wv);if(!t)return ks();const n=JSON.parse(t);return n===null||typeof n!="object"?ks():BD(n.settings)}catch{return ks()}}function ND(e,t){if(t)try{const n={version:LD,settings:{...e}};t.setItem(Wv,JSON.stringify(n))}catch{}}function UD(){try{return typeof localStorage<"u"?localStorage:void 0}catch{return}}function zD(e){const t=P(jD(e));Ee(t,s=>{ND(s,e)},{deep:!0});function n(s,i){t.value={...t.value,[s]:i}}function o(){t.value=ks()}return{settings:t,updateSetting:n,resetToDefaults:o}}let Ul=null;function Fa(){return Ul||(Ul=zD(UD())),Ul}const KD={class:"va-console__right-sidebar"},WD={class:"va-console__rtabs"},VD=["aria-selected","onClick"],qD={key:0,class:"va-console__rtab-badge"},HD={class:"va-console__rtab-body"},JD={key:1,class:"va-console__rtab-empty"},GD={key:0,class:"va-console__rtab-empty"},ZD={key:1,class:"va-rsb__skeleton","aria-label":"加载目录"},YD={key:2,class:"va-console__rtab-empty"},XD={key:0,class:"va-rsb__truncate-note"},QD={key:3,class:"va-console__rtab-empty"},eT=Ce({__name:"ConsoleRightSidebar",props:{decisions:{},workspaceId:{},usage:{}},emits:["collapse","decide"],setup(e,{emit:t}){const n=e,o=t,{settings:s}=Fa(),i=T(()=>{const _=[];return s.value.showApprovals&&_.push({key:"approvals",label:"审批"}),s.value.showFileTree&&_.push({key:"files",label:"文件"}),s.value.showUsage&&_.push({key:"usage",label:"用量"}),_}),r=P("approvals");Ee(i,_=>{_.some(v=>v.key===r.value)||(r.value=_[0]?.key??"approvals")});const a=P([]),l=P(!1),c=P(!1),u=P("");async function d(_){if(a.value=[],c.value=!1,u.value="",!_)return;l.value=!0;const v=await zv(_);if(l.value=!1,!v){u.value="目录读取失败";return}a.value=v.tree,c.value=v.truncated}return Ee(()=>n.workspaceId,_=>d(_),{immediate:!0}),(_,v)=>(h(),b("aside",KD,[f("div",WD,[(h(!0),b(G,null,me(i.value,g=>(h(),b("button",{key:g.key,class:ye(["va-console__rtab",{"va-console__rtab--active":r.value===g.key}]),type:"button","aria-selected":r.value===g.key,onClick:m=>r.value=g.key},[pe(A(g.label)+" ",1),g.key==="approvals"&&e.decisions.length>0?(h(),b("span",qD,A(e.decisions.length),1)):E("",!0)],10,VD))),128)),j(p(ov),{content:"收起侧栏",placement:"bottom"},{default:we(()=>[f("button",{class:"va-console__rtab-collapse",type:"button","aria-label":"收起侧栏",onClick:v[0]||(v[0]=g=>o("collapse"))},[j(p(jr),{size:14})])]),_:1})]),f("div",HD,[r.value==="approvals"?(h(),b(G,{key:0},[e.decisions.length>0?(h(),ce(p(bb),{key:0,decisions:e.decisions,onDecide:v[1]||(v[1]=(g,m)=>o("decide",g,m))},null,8,["decisions"])):(h(),b("div",JD,[j(p(jr),{size:20}),v[2]||(v[2]=f("p",null,"暂无待审批事项",-1))]))],64)):r.value==="files"?(h(),b(G,{key:1},[e.workspaceId?l.value?(h(),b("div",ZD,[j(p(lo),{height:14,radius:"4px"}),j(p(lo),{height:14,radius:"4px",width:"86%"}),j(p(lo),{height:14,radius:"4px",width:"72%"}),j(p(lo),{height:14,radius:"4px",width:"80%"})])):u.value?(h(),b("div",YD,[f("p",null,A(u.value),1)])):(h(),b(G,{key:3},[c.value?(h(),b("p",XD,"目录过大,仅展示前 2000 项")):E("",!0),j(p(fc),{tree:a.value,"default-expand-depth":1,"aria-label":"当前工作区文件目录"},null,8,["tree"])],64)):(h(),b("div",GD,[...v[3]||(v[3]=[f("p",null,"先选择或创建工作区",-1)])]))],64)):r.value==="usage"?(h(),ce(sD,{key:2,usage:e.usage},null,8,["usage"])):E("",!0),i.value.length===0?(h(),b("div",QD,[j(p(jr),{size:20}),v[4]||(v[4]=f("p",null,"侧栏内容已在「设置 → 交互」中全部隐藏",-1))])):E("",!0)])]))}}),tT={class:"va-console__docked-plan"},nT={class:"va-console__plan-bar-left"},oT={class:"va-console__plan-title"},sT={key:0,class:"va-console__plan-active-chip"},iT={class:"va-console__plan-bar-right"},rT={class:"va-console__plan-toggle-label"},aT={key:0,class:"va-console__plan-drawer"},lT={class:"va-console__plan-drawer-clip"},cT=Ce({__name:"DockedPlanBar",props:{steps:{},completed:{},running:{},expanded:{type:Boolean}},emits:["toggle"],setup(e){return(t,n)=>(h(),b("div",tT,[f("div",{class:"va-console__plan-bar",onClick:n[0]||(n[0]=o=>t.$emit("toggle"))},[f("div",nT,[j(p(C5),{size:15,class:"va-console__plan-icon"}),f("span",oT," 任务执行计划 ("+A(e.completed)+"/"+A(e.steps.length)+" 完成) ",1),e.running?(h(),b("span",sT,[j(p(ui),{size:11,class:"va-console__spin"}),pe(" 正在执行: "+A(e.running.title),1)])):E("",!0)]),f("div",iT,[f("span",rT,A(e.expanded?"折叠":"展开详情"),1),e.expanded?(h(),ce(p(Bi),{key:0,size:14})):(h(),ce(p(jv),{key:1,size:14}))])]),j(ts,{name:"va-drawer-fold"},{default:we(()=>[e.expanded?(h(),b("div",aT,[f("div",lT,[j(p(Oy),{steps:e.steps},null,8,["steps"])])])):E("",!0)]),_:1})]))}}),uT={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},fn=mn({open:!1,title:"",description:"",placeholder:"",value:"",confirmText:"确认",cancelText:"取消"});let ki=null,yc=0,ep=!1;function dT(){try{return uT?.DEV??!0}catch{return!0}}function fT(){return yc+=1,()=>{yc-=1}}function pT(){return fn}function hT(e){return yc===0?(dT()&&!ep&&(ep=!0,console.warn("[askText] 未找到已挂载的 <TextPromptHost />:askText() 将直接 resolve(null)。请在应用根节点挂载宿主组件。")),Promise.resolve(null)):(fn.title=e.title,fn.description=e.description??"",fn.placeholder=e.placeholder??"",fn.value=e.initialValue??"",fn.confirmText=e.confirmText??"确认",fn.cancelText=e.cancelText??"取消",fn.open=!0,ki&&ki(null),new Promise(t=>{ki=t}))}function tp(){if(!fn.open)return;const e=fn.value.trim();Vv(e||null)}function np(){fn.open&&Vv(null)}function Vv(e){fn.open=!1;const t=ki;ki=null,t?.(e)}const vT=["placeholder","aria-label","onKeydown"],mT=Ce({__name:"TextPromptHost",setup(e){const t=pT();let n=null;Ct(()=>{n=fT()}),Nc(()=>n?.());const o=P(null);Ee(()=>t.open,async i=>{i&&(await it(),o.value?.focus(),o.value?.select())});function s(i){i.isComposing||i.keyCode===229||tp()}return(i,r)=>(h(),ce(p(Zc),{open:p(t).open,size:"sm",title:p(t).title,description:p(t).description||void 0,"onUpdate:open":r[1]||(r[1]=a=>{a||p(np)()})},{footer:we(()=>[j(p(Cs),{variant:"secondary",size:"sm",onClick:p(np)},{default:we(()=>[pe(A(p(t).cancelText),1)]),_:1},8,["onClick"]),j(p(Cs),{variant:"primary",size:"sm",onClick:p(tp)},{default:we(()=>[pe(A(p(t).confirmText),1)]),_:1},8,["onClick"])]),default:we(()=>[Ve(f("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":r[0]||(r[0]=a=>p(t).value=a),class:"va-console__input",type:"text",placeholder:p(t).placeholder,"aria-label":p(t).title,onKeydown:xt(Fe(s,["prevent"]),["enter"])},null,40,vT),[[st,p(t).value]])]),_:1},8,["open","title","description"]))}}),_T=[{id:"models",title:"模型与 API",description:"供应商、模型与 API Key 配置"},{id:"interaction",title:"交互",description:"自动折叠等交互偏好"},{id:"tools",title:"工具",description:"内置工具的启用与停用"},{id:"execution",title:"执行",description:"步数上限、审批超时、上下文预算与成本配额"},{id:"security",title:"安全",description:"默认权限模式与网络边界"},{id:"prompt",title:"提示词",description:"系统提示组装块与全局自定义指令"}],gT=[{key:"autoCollapseThought",title:"自动折叠思考过程",description:"本轮输出结束后折叠思考过程;与下一项同时开启时收进「已完成」摘要条,点击可展开"},{key:"autoCollapseToolCards",title:"自动折叠工具执行卡片",description:"本轮输出结束后折叠工具调用;与上一项同时开启时收进「已完成」摘要条,只留文本结果;失败卡片始终展开"},{key:"showApprovals",title:"右侧边栏显示审批收件箱",description:"跨会话的人机协同 (HITL) 待审批决策;关闭后右侧边栏不再展示该分区"},{key:"showFileTree",title:"右侧边栏显示工作区文件树",description:"当前工作区的目录结构(只读预览,深度 4 层);关闭后右侧边栏不再展示该分区"},{key:"showUsage",title:"右侧边栏显示成本用量面板",description:"滚动窗口/自定义区间的 token 与费用、按模型分解与配额水位(TASK-075);关闭后右侧边栏不再展示该分区"}],op={high:{label:"高风险",className:"va-settings__tool-badge--high"},medium:{label:"中风险",className:"va-settings__tool-badge--medium"},low:{label:"低风险",className:"va-settings__tool-badge--low"}};function ws(e){return op[e]??op.medium}const bT={class:"va-settings__title"},yT={class:"va-settings__dlg-body"},kT={class:"va-settings__nav","aria-label":"设置导航"},wT=["aria-current","onClick"],xT={class:"va-settings__nav-text"},$T={class:"va-settings__nav-title"},CT={class:"va-settings__nav-desc"},AT={class:"va-settings__panel-area"},ST=Ce({__name:"SettingsModal",props:{open:{type:Boolean},activeTab:{default:"models"}},emits:["close","update:activeTab"],setup(e,{emit:t}){const n=e,o=t,s={models:g5,interaction:R5,tools:aa,execution:w5,security:F5,prompt:S5};function i(r){r||o("close")}return(r,a)=>(h(),ce(p(Zc),{open:n.open,size:"lg","aria-label":"设置",description:"管理模型供应商与交互偏好,后续可持续增加设置页","onUpdate:open":i},{title:we(()=>[f("span",bT,[j(p(Uv),{size:16,"aria-hidden":"true"}),a[0]||(a[0]=pe(" 设置 ",-1))])]),default:we(()=>[f("div",yT,[f("nav",kT,[(h(!0),b(G,null,me(p(_T),l=>(h(),b("button",{key:l.id,class:ye(["va-settings__nav-item",{"va-settings__nav-item--active":l.id===e.activeTab}]),type:"button","aria-current":l.id===e.activeTab?"true":void 0,onClick:c=>r.$emit("update:activeTab",l.id)},[(h(),ce(Uc(s[l.id]),{size:15,class:"va-settings__nav-icon"})),f("span",xT,[f("span",$T,A(l.title),1),f("span",CT,A(l.description),1)])],10,wT))),128))]),f("div",AT,[Je(r.$slots,e.activeTab)])])]),_:3},8,["open"]))}}),RT={text:"文本",image:"图片",audio:"音频",video:"视频",pdf:"PDF"};function ET(e){return e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function DT(e,t={}){if(!e)return[];const n="capabilities"in e||"contextWindow"in e?e.capabilities??{}:e,o="contextWindow"in e&&typeof e.contextWindow=="number"?e.contextWindow:void 0,s=[],i=n.contextWindow||o;i&&s.push(ET(i));for(const r of n.inputModalities||[])r==="text"&&!t.includeText||s.push(RT[r]??r);return n.reasoning?.supported&&s.push("推理"),n.supportedParameters?.includes("tools")&&s.push("工具"),s}const la=[{id:"deepseek",label:"DeepSeek(官方)",protocol:"openai",baseUrl:"https://api.deepseek.com/v1",authStyle:"bearer",keyEnv:"DEEPSEEK_API_KEY",domain:"api.deepseek.com",suggestedModel:"deepseek-chat",contextWindow:128e3,featured:!0,docsUrl:"https://api-docs.deepseek.com"},{id:"qwen",label:"通义千问 / 阿里云百炼",protocol:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",authStyle:"bearer",keyEnv:"DASHSCOPE_API_KEY",domain:"dashscope.aliyuncs.com",suggestedModel:"qwen-plus",contextWindow:128e3,featured:!0},{id:"anthropic",label:"Anthropic(Claude)",protocol:"anthropic",baseUrl:"https://api.anthropic.com/v1",authStyle:"x-api-key",keyEnv:"ANTHROPIC_API_KEY",domain:"api.anthropic.com",suggestedModel:"claude-sonnet-4-20250514",contextWindow:2e5,featured:!0},{id:"openai",label:"OpenAI",protocol:"openai",baseUrl:"https://api.openai.com/v1",authStyle:"bearer",keyEnv:"OPENAI_API_KEY",domain:"api.openai.com",suggestedModel:"gpt-4o",contextWindow:128e3,featured:!0},{id:"zhipu",label:"智谱 GLM",protocol:"openai",baseUrl:"https://open.bigmodel.cn/api/paas/v4",authStyle:"bearer",keyEnv:"ZHIPU_API_KEY",domain:"open.bigmodel.cn",suggestedModel:"glm-4-plus",contextWindow:128e3,featured:!0},{id:"moonshot",label:"Moonshot / Kimi(国内)",protocol:"openai",baseUrl:"https://api.moonshot.cn/v1",authStyle:"bearer",keyEnv:"MOONSHOT_API_KEY",domain:"api.moonshot.cn",suggestedModel:"moonshot-v1-8k",contextWindow:128e3,featured:!0},{id:"minimax",label:"MiniMax(Anthropic 兼容)",protocol:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",authStyle:"x-api-key",keyEnv:"MINIMAX_API_KEY",domain:"api.minimaxi.com",suggestedModel:"MiniMax-M2",contextWindow:2e5,note:"MiniMax 同时提供 OpenAI 兼容端点;此预设走其 Anthropic 兼容端点。",featured:!0},{id:"doubao",label:"豆包 / 火山方舟",protocol:"openai",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",authStyle:"bearer",keyEnv:"ARK_API_KEY",domain:"ark.cn-beijing.volces.com",suggestedModel:"doubao-pro-32k",contextWindow:32e3,note:"模型名需填「推理接入点 ID」(ep-xxxx)或已开通的模型名。",featured:!0},{id:"openrouter",label:"OpenRouter(聚合网关)",protocol:"openai",baseUrl:"https://openrouter.ai/api/v1",authStyle:"bearer",keyEnv:"OPENROUTER_API_KEY",domain:"openrouter.ai",suggestedModel:"anthropic/claude-sonnet-4",contextWindow:2e5,featured:!0,docsUrl:"https://openrouter.ai/docs"},{id:"opencode",label:"OpenCode Zen",protocol:"openai",baseUrl:"https://opencode.ai/inference/openai/v1",authStyle:"bearer",keyEnv:"OPENCODE_API_KEY",domain:"opencode.ai",suggestedModel:"claude-sonnet-4",contextWindow:2e5,note:"该网关按会话做路由:会自动附带 x-opencode-session 请求头(按域名规则注入)。"},{id:"siliconflow",label:"硅基流动 SiliconFlow",protocol:"openai",baseUrl:"https://api.siliconflow.cn/v1",authStyle:"bearer",keyEnv:"SILICONFLOW_API_KEY",domain:"api.siliconflow.cn",suggestedModel:"deepseek-ai/DeepSeek-V3",contextWindow:128e3,featured:!0},{id:"ollama",label:"Ollama(本地)",protocol:"openai",baseUrl:"http://localhost:11434/v1",authStyle:"none",domain:"localhost",suggestedModel:"qwen2.5-coder:7b",contextWindow:32e3},{id:"lmstudio",label:"LM Studio(本地)",protocol:"openai",baseUrl:"http://localhost:1234/v1",authStyle:"none",domain:"localhost",suggestedModel:"local-model",contextWindow:32e3},{id:"azure-openai",label:"Azure OpenAI",protocol:"azure",baseUrl:"https://YOUR-RESOURCE.openai.azure.com/openai/v1",authStyle:"api-key",keyEnv:"AZURE_OPENAI_API_KEY",domain:"openai.azure.com",suggestedModel:"gpt-4o",contextWindow:128e3,note:"端点填你的资源域名;鉴权用 api-key 头(域名规则自动切换)。部署名需与模型一致。"},{id:"gemini",label:"Google Gemini",protocol:"gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",authStyle:"bearer",keyEnv:"GEMINI_API_KEY",domain:"generativelanguage.googleapis.com",suggestedModel:"gemini-2.0-flash",contextWindow:1e6,note:"走 Gemini 的 OpenAI 兼容层(/v1beta/openai)。"},{id:"groq",label:"Groq",protocol:"openai",baseUrl:"https://api.groq.com/openai/v1",authStyle:"bearer",keyEnv:"GROQ_API_KEY",domain:"api.groq.com",suggestedModel:"llama-3.3-70b-versatile",contextWindow:128e3},{id:"mistral",label:"Mistral",protocol:"openai",baseUrl:"https://api.mistral.ai/v1",authStyle:"bearer",keyEnv:"MISTRAL_API_KEY",domain:"api.mistral.ai",suggestedModel:"mistral-large-latest",contextWindow:128e3},{id:"xai",label:"xAI Grok",protocol:"openai",baseUrl:"https://api.x.ai/v1",authStyle:"bearer",keyEnv:"XAI_API_KEY",domain:"api.x.ai",suggestedModel:"grok-2-latest",contextWindow:131072},{id:"moonshot-global",label:"Moonshot AI(国际站)",protocol:"openai",baseUrl:"https://api.moonshot.ai/v1",authStyle:"bearer",keyEnv:"MOONSHOT_API_KEY",domain:"api.moonshot.ai",suggestedModel:"moonshot-v1-8k",contextWindow:128e3},{id:"together",label:"Together AI",protocol:"openai",baseUrl:"https://api.together.ai/v1",authStyle:"bearer",keyEnv:"TOGETHER_API_KEY",domain:"api.together.ai",contextWindow:128e3},{id:"fireworks",label:"Fireworks AI",protocol:"openai",baseUrl:"https://api.fireworks.ai/inference/v1",authStyle:"bearer",keyEnv:"FIREWORKS_API_KEY",domain:"api.fireworks.ai",contextWindow:128e3},{id:"cerebras",label:"Cerebras",protocol:"openai",baseUrl:"https://api.cerebras.ai/v1",authStyle:"bearer",keyEnv:"CEREBRAS_API_KEY",domain:"api.cerebras.ai",contextWindow:128e3},{id:"bailian-intl",label:"阿里云百炼(国际站)",protocol:"openai",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",authStyle:"bearer",keyEnv:"DASHSCOPE_API_KEY",domain:"dashscope-intl.aliyuncs.com",suggestedModel:"qwen-plus",contextWindow:128e3},{id:"custom",label:"自定义(OpenAI 兼容)",protocol:"openai",baseUrl:"http://localhost:8000/v1",authStyle:"bearer",suggestedModel:"custom-model",contextWindow:32e3,note:"任何 OpenAI 兼容端点:自建 vLLM / Ollama / 中转网关都填这里。"}];Object.fromEntries(la.map(e=>[e.id,e]));function TT(e){return ht(e)&&!Yt(e)&&!Xi(e)&&Symbol.asyncIterator in e}function Yt(e){return Array.isArray(e)}function qv(e){return typeof e=="bigint"}function Yi(e){return typeof e=="boolean"}function tu(e){return e instanceof globalThis.Date}function IT(e){return typeof e=="function"}function FT(e){return ht(e)&&!Yt(e)&&!Xi(e)&&Symbol.iterator in e}function MT(e){return e===null}function Zn(e){return typeof e=="number"}function ht(e){return typeof e=="object"&&e!==null}function Hv(e){return e instanceof globalThis.RegExp}function dt(e){return typeof e=="string"}function OT(e){return typeof e=="symbol"}function Xi(e){return e instanceof globalThis.Uint8Array}function ft(e){return e===void 0}function PT(e){return e.map(t=>ca(t))}function LT(e){return new Date(e.getTime())}function BT(e){return new Uint8Array(e)}function jT(e){return new RegExp(e.source,e.flags)}function NT(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=ca(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=ca(e[n]);return t}function ca(e){return Yt(e)?PT(e):tu(e)?LT(e):Xi(e)?BT(e):Hv(e)?jT(e):ht(e)?NT(e):e}function tn(e){return ca(e)}function nu(e,t){return tn(t===void 0?e:{...t,...e})}function UT(e){return e!==null&&typeof e=="object"}function zT(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function KT(e){return e===void 0}function WT(e){return typeof e=="number"}var kc;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(r,a){return e.ExactOptionalPropertyTypes?a in r:r[a]!==void 0}e.IsExactOptionalProperty=t;function n(r){const a=UT(r);return e.AllowArrayObject?a:a&&!zT(r)}e.IsObjectLike=n;function o(r){return n(r)&&!(r instanceof Date)&&!(r instanceof Uint8Array)}e.IsRecordLike=o;function s(r){return e.AllowNaN?WT(r):Number.isFinite(r)}e.IsNumberLike=s;function i(r){const a=KT(r);return e.AllowNullVoid?a||r===null:a}e.IsVoidLike=i})(kc||(kc={}));function VT(e){return globalThis.Object.freeze(e).map(t=>ua(t))}function qT(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=ua(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=ua(e[n]);return globalThis.Object.freeze(t)}function ua(e){return Yt(e)?VT(e):tu(e)?e:Xi(e)?e:Hv(e)?e:ht(e)?qT(e):e}function be(e,t){const n=t!==void 0?{...t,...e}:e;switch(kc.InstanceMode){case"freeze":return ua(n);case"clone":return tn(n);default:return n}}class rs extends Error{constructor(t){super(t)}}const hn=Symbol.for("TypeBox.Transform"),Qi=Symbol.for("TypeBox.Readonly"),bo=Symbol.for("TypeBox.Optional"),Ma=Symbol.for("TypeBox.Hint"),Se=Symbol.for("TypeBox.Kind");function ou(e){return ht(e)&&e[Qi]==="Readonly"}function Po(e){return ht(e)&&e[bo]==="Optional"}function Jv(e){return Be(e,"Any")}function Gv(e){return Be(e,"Argument")}function Bs(e){return Be(e,"Array")}function Oa(e){return Be(e,"AsyncIterator")}function Pa(e){return Be(e,"BigInt")}function er(e){return Be(e,"Boolean")}function js(e){return Be(e,"Computed")}function Ns(e){return Be(e,"Constructor")}function HT(e){return Be(e,"Date")}function Us(e){return Be(e,"Function")}function zs(e){return Be(e,"Integer")}function yn(e){return Be(e,"Intersect")}function La(e){return Be(e,"Iterator")}function Be(e,t){return ht(e)&&Se in e&&e[Se]===t}function Zv(e){return Yi(e)||Zn(e)||dt(e)}function as(e){return Be(e,"Literal")}function ls(e){return Be(e,"MappedKey")}function sn(e){return Be(e,"MappedResult")}function tr(e){return Be(e,"Never")}function JT(e){return Be(e,"Not")}function su(e){return Be(e,"Null")}function Ks(e){return Be(e,"Number")}function Pn(e){return Be(e,"Object")}function Ba(e){return Be(e,"Promise")}function ja(e){return Be(e,"Record")}function Jt(e){return Be(e,"Ref")}function Yv(e){return Be(e,"RegExp")}function nr(e){return Be(e,"String")}function iu(e){return Be(e,"Symbol")}function cs(e){return Be(e,"TemplateLiteral")}function GT(e){return Be(e,"This")}function Na(e){return ht(e)&&hn in e}function us(e){return Be(e,"Tuple")}function ru(e){return Be(e,"Undefined")}function At(e){return Be(e,"Union")}function ZT(e){return Be(e,"Uint8Array")}function YT(e){return Be(e,"Unknown")}function XT(e){return Be(e,"Unsafe")}function QT(e){return Be(e,"Void")}function e8(e){return ht(e)&&Se in e&&dt(e[Se])}function Do(e){return Jv(e)||Gv(e)||Bs(e)||er(e)||Pa(e)||Oa(e)||js(e)||Ns(e)||HT(e)||Us(e)||zs(e)||yn(e)||La(e)||as(e)||ls(e)||sn(e)||tr(e)||JT(e)||su(e)||Ks(e)||Pn(e)||Ba(e)||ja(e)||Jt(e)||Yv(e)||nr(e)||iu(e)||cs(e)||GT(e)||us(e)||ru(e)||At(e)||ZT(e)||YT(e)||XT(e)||QT(e)||e8(e)}const t8=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Xv(e){try{return new RegExp(e),!0}catch{return!1}}function au(e){if(!dt(e))return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function Qv(e){return lu(e)||Mt(e)}function si(e){return ft(e)||qv(e)}function Ge(e){return ft(e)||Zn(e)}function lu(e){return ft(e)||Yi(e)}function He(e){return ft(e)||dt(e)}function n8(e){return ft(e)||dt(e)&&au(e)&&Xv(e)}function o8(e){return ft(e)||dt(e)&&au(e)}function em(e){return ft(e)||Mt(e)}function da(e){return ht(e)&&e[bo]==="Optional"}function Dn(e){return je(e,"Any")&&He(e.$id)}function s8(e){return je(e,"Argument")&&Zn(e.index)}function ds(e){return je(e,"Array")&&e.type==="array"&&He(e.$id)&&Mt(e.items)&&Ge(e.minItems)&&Ge(e.maxItems)&&lu(e.uniqueItems)&&em(e.contains)&&Ge(e.minContains)&&Ge(e.maxContains)}function cu(e){return je(e,"AsyncIterator")&&e.type==="AsyncIterator"&&He(e.$id)&&Mt(e.items)}function Ua(e){return je(e,"BigInt")&&e.type==="bigint"&&He(e.$id)&&si(e.exclusiveMaximum)&&si(e.exclusiveMinimum)&&si(e.maximum)&&si(e.minimum)&&si(e.multipleOf)}function fs(e){return je(e,"Boolean")&&e.type==="boolean"&&He(e.$id)}function i8(e){return je(e,"Computed")&&dt(e.target)&&Yt(e.parameters)&&e.parameters.every(t=>Mt(t))}function za(e){return je(e,"Constructor")&&e.type==="Constructor"&&He(e.$id)&&Yt(e.parameters)&&e.parameters.every(t=>Mt(t))&&Mt(e.returns)}function Ka(e){return je(e,"Date")&&e.type==="Date"&&He(e.$id)&&Ge(e.exclusiveMaximumTimestamp)&&Ge(e.exclusiveMinimumTimestamp)&&Ge(e.maximumTimestamp)&&Ge(e.minimumTimestamp)&&Ge(e.multipleOfTimestamp)}function Wa(e){return je(e,"Function")&&e.type==="Function"&&He(e.$id)&&Yt(e.parameters)&&e.parameters.every(t=>Mt(t))&&Mt(e.returns)}function yo(e){return je(e,"Integer")&&e.type==="integer"&&He(e.$id)&&Ge(e.exclusiveMaximum)&&Ge(e.exclusiveMinimum)&&Ge(e.maximum)&&Ge(e.minimum)&&Ge(e.multipleOf)}function tm(e){return ht(e)&&Object.entries(e).every(([t,n])=>au(t)&&Mt(n))}function ps(e){return je(e,"Intersect")&&!(dt(e.type)&&e.type!=="object")&&Yt(e.allOf)&&e.allOf.every(t=>Mt(t)&&!d8(t))&&He(e.type)&&(lu(e.unevaluatedProperties)||em(e.unevaluatedProperties))&&He(e.$id)}function uu(e){return je(e,"Iterator")&&e.type==="Iterator"&&He(e.$id)&&Mt(e.items)}function je(e,t){return ht(e)&&Se in e&&e[Se]===t}function nm(e){return Lo(e)&&dt(e.const)}function om(e){return Lo(e)&&Zn(e.const)}function sm(e){return Lo(e)&&Yi(e.const)}function Lo(e){return je(e,"Literal")&&He(e.$id)&&r8(e.const)}function r8(e){return Yi(e)||Zn(e)||dt(e)}function a8(e){return je(e,"MappedKey")&&Yt(e.keys)&&e.keys.every(t=>Zn(t)||dt(t))}function l8(e){return je(e,"MappedResult")&&tm(e.properties)}function Bo(e){return je(e,"Never")&&ht(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Ms(e){return je(e,"Not")&&Mt(e.not)}function du(e){return je(e,"Null")&&e.type==="null"&&He(e.$id)}function Ht(e){return je(e,"Number")&&e.type==="number"&&He(e.$id)&&Ge(e.exclusiveMaximum)&&Ge(e.exclusiveMinimum)&&Ge(e.maximum)&&Ge(e.minimum)&&Ge(e.multipleOf)}function lt(e){return je(e,"Object")&&e.type==="object"&&He(e.$id)&&tm(e.properties)&&Qv(e.additionalProperties)&&Ge(e.minProperties)&&Ge(e.maxProperties)}function fu(e){return je(e,"Promise")&&e.type==="Promise"&&He(e.$id)&&Mt(e.item)}function Ft(e){return je(e,"Record")&&e.type==="object"&&He(e.$id)&&Qv(e.additionalProperties)&&ht(e.patternProperties)&&(t=>{const n=Object.getOwnPropertyNames(t.patternProperties);return n.length===1&&Xv(n[0])&&ht(t.patternProperties)&&Mt(t.patternProperties[n[0]])})(e)}function c8(e){return je(e,"Ref")&&He(e.$id)&&dt(e.$ref)}function ji(e){return je(e,"RegExp")&&He(e.$id)&&dt(e.source)&&dt(e.flags)&&Ge(e.maxLength)&&Ge(e.minLength)}function Tn(e){return je(e,"String")&&e.type==="string"&&He(e.$id)&&Ge(e.minLength)&&Ge(e.maxLength)&&n8(e.pattern)&&o8(e.format)}function Ni(e){return je(e,"Symbol")&&e.type==="symbol"&&He(e.$id)}function Ui(e){return je(e,"TemplateLiteral")&&e.type==="string"&&dt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function u8(e){return je(e,"This")&&He(e.$id)&&dt(e.$ref)}function d8(e){return ht(e)&&hn in e}function Va(e){return je(e,"Tuple")&&e.type==="array"&&He(e.$id)&&Zn(e.minItems)&&Zn(e.maxItems)&&e.minItems===e.maxItems&&(ft(e.items)&&ft(e.additionalItems)&&e.minItems===0||Yt(e.items)&&e.items.every(t=>Mt(t)))}function ss(e){return je(e,"Undefined")&&e.type==="undefined"&&He(e.$id)}function mo(e){return je(e,"Union")&&He(e.$id)&&ht(e)&&Yt(e.anyOf)&&e.anyOf.every(t=>Mt(t))}function or(e){return je(e,"Uint8Array")&&e.type==="Uint8Array"&&He(e.$id)&&Ge(e.minByteLength)&&Ge(e.maxByteLength)}function In(e){return je(e,"Unknown")&&He(e.$id)}function f8(e){return je(e,"Unsafe")}function qa(e){return je(e,"Void")&&e.type==="void"&&He(e.$id)}function p8(e){return ht(e)&&Se in e&&dt(e[Se])&&!t8.includes(e[Se])}function Mt(e){return ht(e)&&(Dn(e)||s8(e)||ds(e)||fs(e)||Ua(e)||cu(e)||i8(e)||za(e)||Ka(e)||Wa(e)||yo(e)||ps(e)||uu(e)||Lo(e)||a8(e)||l8(e)||Bo(e)||Ms(e)||du(e)||Ht(e)||lt(e)||fu(e)||Ft(e)||c8(e)||ji(e)||Tn(e)||Ni(e)||Ui(e)||u8(e)||Va(e)||ss(e)||mo(e)||or(e)||In(e)||f8(e)||qa(e)||p8(e))}const h8="(true|false)",Nr="(0|[1-9][0-9]*)",im="(.*)",v8="(?!.*)",Os=`^${Nr}$`,Ps=`^${im}$`,m8=`^${v8}$`;function _8(e,t){return e.includes(t)}function g8(e){return[...new Set(e)]}function b8(e,t){return e.filter(n=>t.includes(n))}function y8(e,t){return e.reduce((n,o)=>b8(n,o),t)}function k8(e){return e.length===1?e[0]:e.length>1?y8(e.slice(1),e[0]):[]}function w8(e){const t=[];for(const n of e)t.push(...n);return t}function zi(e){return be({[Se]:"Any"},e)}function pu(e,t){return be({[Se]:"Array",type:"array",items:e},t)}function x8(e){return be({[Se]:"Argument",index:e})}function hu(e,t){return be({[Se]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function kt(e,t,n){return be({[Se]:"Computed",target:e,parameters:t},n)}function $8(e,t){const{[t]:n,...o}=e;return o}function nn(e,t){return t.reduce((n,o)=>$8(n,o),e)}function mt(e){return be({[Se]:"Never",not:{}},e)}function Ot(e){return be({[Se]:"MappedResult",properties:e})}function vu(e,t,n){return be({[Se]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function sr(e,t,n){return be({[Se]:"Function",type:"Function",parameters:e,returns:t},n)}function wc(e,t){return be({[Se]:"Union",anyOf:e},t)}function C8(e){return e.some(t=>Po(t))}function sp(e){return e.map(t=>Po(t)?A8(t):t)}function A8(e){return nn(e,[bo])}function S8(e,t){return C8(e)?Uo(wc(sp(e),t)):wc(sp(e),t)}function Ws(e,t){return e.length===1?be(e[0],t):e.length===0?mt(t):S8(e,t)}function Pt(e,t){return e.length===0?mt(t):e.length===1?be(e[0],t):wc(e,t)}class ip extends rs{}function R8(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function mu(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function uo(e,t){return mu(e,t,"(")}function Ki(e,t){return mu(e,t,")")}function rm(e,t){return mu(e,t,"|")}function E8(e){if(!(uo(e,0)&&Ki(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(uo(e,n)&&(t+=1),Ki(e,n)&&(t-=1),t===0&&n!==e.length-1)return!1;return!0}function D8(e){return e.slice(1,e.length-1)}function T8(e){let t=0;for(let n=0;n<e.length;n++)if(uo(e,n)&&(t+=1),Ki(e,n)&&(t-=1),rm(e,n)&&t===0)return!0;return!1}function I8(e){for(let t=0;t<e.length;t++)if(uo(e,t))return!0;return!1}function F8(e){let[t,n]=[0,0];const o=[];for(let i=0;i<e.length;i++)if(uo(e,i)&&(t+=1),Ki(e,i)&&(t-=1),rm(e,i)&&t===0){const r=e.slice(n,i);r.length>0&&o.push(Ls(r)),n=i+1}const s=e.slice(n);return s.length>0&&o.push(Ls(s)),o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"or",expr:o}}function M8(e){function t(s,i){if(!uo(s,i))throw new ip("TemplateLiteralParser: Index must point to open parens");let r=0;for(let a=i;a<s.length;a++)if(uo(s,a)&&(r+=1),Ki(s,a)&&(r-=1),r===0)return[i,a];throw new ip("TemplateLiteralParser: Unclosed group parens in expression")}function n(s,i){for(let r=i;r<s.length;r++)if(uo(s,r))return[i,r];return[i,s.length]}const o=[];for(let s=0;s<e.length;s++)if(uo(e,s)){const[i,r]=t(e,s),a=e.slice(i,r+1);o.push(Ls(a)),s=r}else{const[i,r]=n(e,s),a=e.slice(i,r);a.length>0&&o.push(Ls(a)),s=r-1}return o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"and",expr:o}}function Ls(e){return E8(e)?Ls(D8(e)):T8(e)?F8(e):I8(e)?M8(e):{type:"const",const:R8(e)}}function _u(e){return Ls(e.slice(1,e.length-1))}class O8 extends rs{}function P8(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function L8(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function B8(e){return e.type==="const"&&e.const===".*"}function Wi(e){return P8(e)||B8(e)?!1:L8(e)?!0:e.type==="and"?e.expr.every(t=>Wi(t)):e.type==="or"?e.expr.every(t=>Wi(t)):e.type==="const"?!0:(()=>{throw new O8("Unknown expression type")})()}function j8(e){const t=_u(e.pattern);return Wi(t)}class N8 extends rs{}function*am(e){if(e.length===1)return yield*e[0];for(const t of e[0])for(const n of am(e.slice(1)))yield`${t}${n}`}function*U8(e){return yield*am(e.expr.map(t=>[...Ha(t)]))}function*z8(e){for(const t of e.expr)yield*Ha(t)}function*K8(e){return yield e.const}function*Ha(e){return e.type==="and"?yield*U8(e):e.type==="or"?yield*z8(e):e.type==="const"?yield*K8(e):(()=>{throw new N8("Unknown expression")})()}function lm(e){const t=_u(e.pattern);return Wi(t)?[...Ha(t)]:[]}function pt(e,t){return be({[Se]:"Literal",const:e,type:typeof e},t)}function cm(e){return be({[Se]:"Boolean",type:"boolean"},e)}function gu(e){return be({[Se]:"BigInt",type:"bigint"},e)}function hs(e){return be({[Se]:"Number",type:"number"},e)}function is(e){return be({[Se]:"String",type:"string"},e)}function*W8(e){const t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield cm():t==="number"?yield hs():t==="bigint"?yield gu():t==="string"?yield is():yield(()=>{const n=t.split("|").map(o=>pt(o.trim()));return n.length===0?mt():n.length===1?n[0]:Ws(n)})()}function*V8(e){if(e[1]!=="{"){const t=pt("$"),n=xc(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if(e[t]==="}"){const n=W8(e.slice(2,t)),o=xc(e.slice(t+1));return yield*[...n,...o]}yield pt(e)}function*xc(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){const n=pt(e.slice(0,t)),o=V8(e.slice(t));return yield*[n,...o]}yield pt(e)}function q8(e){return[...xc(e)]}class H8 extends rs{}function J8(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function um(e,t){return cs(e)?e.pattern.slice(1,e.pattern.length-1):At(e)?`(${e.anyOf.map(n=>um(n,t)).join("|")})`:Ks(e)?`${t}${Nr}`:zs(e)?`${t}${Nr}`:Pa(e)?`${t}${Nr}`:nr(e)?`${t}${im}`:as(e)?`${t}${J8(e.const.toString())}`:er(e)?`${t}${h8}`:(()=>{throw new H8(`Unexpected Kind '${e[Se]}'`)})()}function rp(e){return`^${e.map(t=>um(t,"")).join("")}$`}function fa(e){const n=lm(e).map(o=>pt(o));return Ws(n)}function dm(e,t){const n=dt(e)?rp(q8(e)):rp(e);return be({[Se]:"TemplateLiteral",type:"string",pattern:n},t)}function G8(e){return lm(e).map(n=>n.toString())}function Z8(e){const t=[];for(const n of e)t.push(...jo(n));return t}function Y8(e){return[e.toString()]}function jo(e){return[...new Set(cs(e)?G8(e):At(e)?Z8(e.anyOf):as(e)?Y8(e.const):Ks(e)?["[number]"]:zs(e)?["[number]"]:[])]}function X8(e,t,n){const o={};for(const s of Object.getOwnPropertyNames(t))o[s]=Ja(e,jo(t[s]),n);return o}function Q8(e,t,n){return X8(e,t.properties,n)}function eI(e,t,n){const o=Q8(e,t,n);return Ot(o)}function fm(e,t){return e.map(n=>pm(n,t))}function tI(e){return e.filter(t=>!tr(t))}function nI(e,t){return _m(tI(fm(e,t)))}function oI(e){return e.some(t=>tr(t))?[]:e}function sI(e,t){return Ws(oI(fm(e,t)))}function iI(e,t){return t in e?e[t]:t==="[number]"?Ws(e):mt()}function rI(e,t){return t==="[number]"?e:mt()}function aI(e,t){return t in e?e[t]:mt()}function pm(e,t){return yn(e)?nI(e.allOf,t):At(e)?sI(e.anyOf,t):us(e)?iI(e.items??[],t):Bs(e)?rI(e.items,t):Pn(e)?aI(e.properties,t):mt()}function hm(e,t){return t.map(n=>pm(e,n))}function ap(e,t){return Ws(hm(e,t))}function Ja(e,t,n){if(Jt(e)||Jt(t)){const o="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Do(e)||!Do(t))throw new rs(o);return kt("Index",[e,t])}return sn(t)?eI(e,t,n):ls(t)?dI(e,t,n):be(Do(t)?ap(e,jo(t)):ap(e,t),n)}function lI(e,t,n){return{[t]:Ja(e,[t],tn(n))}}function cI(e,t,n){return t.reduce((o,s)=>({...o,...lI(e,s,n)}),{})}function uI(e,t,n){return cI(e,t.keys,n)}function dI(e,t,n){const o=uI(e,t,n);return Ot(o)}function bu(e,t){return be({[Se]:"Iterator",type:"Iterator",items:e},t)}function fI(e){return globalThis.Object.keys(e).filter(t=>!Po(e[t]))}function pI(e,t){const n=fI(e),o=n.length>0?{[Se]:"Object",type:"object",required:n,properties:e}:{[Se]:"Object",type:"object",properties:e};return be(o,t)}var $t=pI;function vm(e,t){return be({[Se]:"Promise",type:"Promise",item:e},t)}function hI(e){return be(nn(e,[Qi]))}function vI(e){return be({...e,[Qi]:"Readonly"})}function mI(e,t){return t===!1?hI(e):vI(e)}function No(e,t){const n=t??!0;return sn(e)?bI(e,n):mI(e,n)}function _I(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=No(e[o],t);return n}function gI(e,t){return _I(e.properties,t)}function bI(e,t){const n=gI(e,t);return Ot(n)}function Vs(e,t){return be(e.length>0?{[Se]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Se]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function mm(e,t){return e in t?un(e,t[e]):Ot(t)}function yI(e){return{[e]:pt(e)}}function kI(e){const t={};for(const n of e)t[n]=pt(n);return t}function wI(e,t){return _8(t,e)?yI(e):kI(t)}function xI(e,t){const n=wI(e,t);return mm(e,n)}function ii(e,t){return t.map(n=>un(e,n))}function $I(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(t))n[o]=un(e,t[o]);return n}function un(e,t){const n={...t};return Po(t)?Uo(un(e,nn(t,[bo]))):ou(t)?No(un(e,nn(t,[Qi]))):sn(t)?mm(e,t.properties):ls(t)?xI(e,t.keys):Ns(t)?vu(ii(e,t.parameters),un(e,t.returns),n):Us(t)?sr(ii(e,t.parameters),un(e,t.returns),n):Oa(t)?hu(un(e,t.items),n):La(t)?bu(un(e,t.items),n):yn(t)?zo(ii(e,t.allOf),n):At(t)?Pt(ii(e,t.anyOf),n):us(t)?Vs(ii(e,t.items??[]),n):Pn(t)?$t($I(e,t.properties),n):Bs(t)?pu(un(e,t.items),n):Ba(t)?vm(un(e,t.item),n):t}function CI(e,t){const n={};for(const o of e)n[o]=un(o,t);return n}function AI(e,t,n){const o=Do(e)?jo(e):e,s=t({[Se]:"MappedKey",keys:o}),i=CI(o,s);return $t(i,n)}function SI(e){return be(nn(e,[bo]))}function RI(e){return be({...e,[bo]:"Optional"})}function EI(e,t){return t===!1?SI(e):RI(e)}function Uo(e,t){const n=t??!0;return sn(e)?II(e,n):EI(e,n)}function DI(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Uo(e[o],t);return n}function TI(e,t){return DI(e.properties,t)}function II(e,t){const n=TI(e,t);return Ot(n)}function $c(e,t={}){const n=e.every(s=>Pn(s)),o=Do(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return be(t.unevaluatedProperties===!1||Do(t.unevaluatedProperties)||n?{...o,[Se]:"Intersect",type:"object",allOf:e}:{...o,[Se]:"Intersect",allOf:e},t)}function FI(e){return e.every(t=>Po(t))}function MI(e){return nn(e,[bo])}function lp(e){return e.map(t=>Po(t)?MI(t):t)}function OI(e,t){return FI(e)?Uo($c(lp(e),t)):$c(lp(e),t)}function _m(e,t={}){if(e.length===1)return be(e[0],t);if(e.length===0)return mt(t);if(e.some(n=>Na(n)))throw new Error("Cannot intersect transform types");return OI(e,t)}function zo(e,t){if(e.length===1)return be(e[0],t);if(e.length===0)return mt(t);if(e.some(n=>Na(n)))throw new Error("Cannot intersect transform types");return $c(e,t)}function ir(...e){const[t,n]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new rs("Ref: $ref must be a string");return be({[Se]:"Ref",$ref:t},n)}function PI(e,t){return kt("Awaited",[kt(e,t)])}function LI(e){return kt("Awaited",[ir(e)])}function BI(e){return zo(gm(e))}function jI(e){return Pt(gm(e))}function NI(e){return Ga(e)}function gm(e){return e.map(t=>Ga(t))}function Ga(e,t){return be(js(e)?PI(e.target,e.parameters):yn(e)?BI(e.allOf):At(e)?jI(e.anyOf):Ba(e)?NI(e.item):Jt(e)?LI(e.$ref):e,t)}function bm(e){const t=[];for(const n of e)t.push(yu(n));return t}function UI(e){const t=bm(e);return w8(t)}function zI(e){const t=bm(e);return k8(t)}function KI(e){return e.map((t,n)=>n.toString())}function WI(e){return["[number]"]}function VI(e){return globalThis.Object.getOwnPropertyNames(e)}function qI(e){return[]}function yu(e){return yn(e)?UI(e.allOf):At(e)?zI(e.anyOf):us(e)?KI(e.items??[]):Bs(e)?WI(e.items):Pn(e)?VI(e.properties):ja(e)?qI(e.patternProperties):[]}function HI(e,t){return kt("KeyOf",[kt(e,t)])}function JI(e){return kt("KeyOf",[ir(e)])}function GI(e,t){const n=yu(e),o=ZI(n),s=Ws(o);return be(s,t)}function ZI(e){return e.map(t=>t==="[number]"?hs():pt(t))}function ku(e,t){return js(e)?HI(e.target,e.parameters):Jt(e)?JI(e.$ref):sn(e)?QI(e,t):GI(e,t)}function YI(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=ku(e[o],tn(t));return n}function XI(e,t){return YI(e.properties,t)}function QI(e,t){const n=XI(e,t);return Ot(n)}function eF(e){const t=[];for(const n of e)t.push(...yu(n));return g8(t)}function tF(e){return e.filter(t=>!tr(t))}function nF(e,t){const n=[];for(const o of e)n.push(...hm(o,[t]));return tF(n)}function oF(e,t){const n={};for(const o of t)n[o]=_m(nF(e,o));return n}function sF(e,t){const n=eF(e),o=oF(e,n);return $t(o,t)}function ym(e){return be({[Se]:"Date",type:"Date"},e)}function km(e){return be({[Se]:"Null",type:"null"},e)}function wm(e){return be({[Se]:"Symbol",type:"symbol"},e)}function xm(e){return be({[Se]:"Undefined",type:"undefined"},e)}function $m(e){return be({[Se]:"Uint8Array",type:"Uint8Array"},e)}function Za(e){return be({[Se]:"Unknown"},e)}function iF(e){return e.map(t=>wu(t,!1))}function rF(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=No(wu(e[n],!1));return t}function Ir(e,t){return t===!0?e:No(e)}function wu(e,t){return TT(e)||FT(e)?Ir(zi(),t):Yt(e)?No(Vs(iF(e))):Xi(e)?$m():tu(e)?ym():ht(e)?Ir($t(rF(e)),t):IT(e)?Ir(sr([],Za()),t):ft(e)?xm():MT(e)?km():OT(e)?wm():qv(e)?gu():Zn(e)||Yi(e)||dt(e)?pt(e):$t({})}function aF(e,t){return be(wu(e,!0),t)}function lF(e,t){return Ns(e)?Vs(e.parameters,t):mt(t)}function cF(e,t){if(ft(e))throw new Error("Enum undefined or empty");const n=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),s=[...new Set(n)].map(i=>pt(i));return Pt(s,{...t,[Ma]:"Enum"})}class uF extends rs{}var X;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(X||(X={}));function bn(e){return e===X.False?e:X.True}function qs(e){throw new uF(e)}function _t(e){return Bo(e)||ps(e)||mo(e)||In(e)||Dn(e)}function gt(e,t){return Bo(t)?Sm():ps(t)?Ya(e,t):mo(t)?$u(e,t):In(t)?Tm():Dn(t)?xu():qs("StructuralRight")}function xu(e,t){return X.True}function dF(e,t){return ps(t)?Ya(e,t):mo(t)&&t.anyOf.some(n=>Dn(n)||In(n))?X.True:mo(t)?X.Union:In(t)||Dn(t)?X.True:X.Union}function fF(e,t){return In(e)?X.False:Dn(e)?X.Union:Bo(e)?X.True:X.False}function pF(e,t){return lt(t)&&Xa(t)?X.True:_t(t)?gt(e,t):ds(t)?bn(qe(e.items,t.items)):X.False}function hF(e,t){return _t(t)?gt(e,t):cu(t)?bn(qe(e.items,t.items)):X.False}function vF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):Ua(t)?X.True:X.False}function Cm(e,t){return sm(e)||fs(e)?X.True:X.False}function mF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):fs(t)?X.True:X.False}function _F(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):za(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((n,o)=>bn(qe(t.parameters[o],n))===X.True)?bn(qe(e.returns,t.returns)):X.False:X.False}function gF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):Ka(t)?X.True:X.False}function bF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Wa(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((n,o)=>bn(qe(t.parameters[o],n))===X.True)?bn(qe(e.returns,t.returns)):X.False:X.False}function Am(e,t){return Lo(e)&&Zn(e.const)||Ht(e)||yo(e)?X.True:X.False}function yF(e,t){return yo(t)||Ht(t)?X.True:_t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):X.False}function Ya(e,t){return t.allOf.every(n=>qe(e,n)===X.True)?X.True:X.False}function kF(e,t){return e.allOf.some(n=>qe(n,t)===X.True)?X.True:X.False}function wF(e,t){return _t(t)?gt(e,t):uu(t)?bn(qe(e.items,t.items)):X.False}function xF(e,t){return Lo(t)&&t.const===e.const?X.True:_t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):Tn(t)?Dm(e):Ht(t)?Rm(e):yo(t)?Am(e):fs(t)?Cm(e):X.False}function Sm(e,t){return X.False}function $F(e,t){return X.True}function cp(e){let[t,n]=[e,0];for(;Ms(t);)t=t.not,n+=1;return n%2===0?t:Za()}function CF(e,t){return Ms(e)?qe(cp(e),t):Ms(t)?qe(e,cp(t)):qs("Invalid fallthrough for Not")}function AF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):du(t)?X.True:X.False}function Rm(e,t){return om(e)||Ht(e)||yo(e)?X.True:X.False}function SF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):yo(t)||Ht(t)?X.True:X.False}function Gt(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function up(e){return Xa(e)}function dp(e){return Gt(e,0)||Gt(e,1)&&"description"in e.properties&&mo(e.properties.description)&&e.properties.description.anyOf.length===2&&(Tn(e.properties.description.anyOf[0])&&ss(e.properties.description.anyOf[1])||Tn(e.properties.description.anyOf[1])&&ss(e.properties.description.anyOf[0]))}function zl(e){return Gt(e,0)}function fp(e){return Gt(e,0)}function RF(e){return Gt(e,0)}function EF(e){return Gt(e,0)}function DF(e){return Xa(e)}function TF(e){const t=hs();return Gt(e,0)||Gt(e,1)&&"length"in e.properties&&bn(qe(e.properties.length,t))===X.True}function IF(e){return Gt(e,0)}function Xa(e){const t=hs();return Gt(e,0)||Gt(e,1)&&"length"in e.properties&&bn(qe(e.properties.length,t))===X.True}function FF(e){const t=sr([zi()],zi());return Gt(e,0)||Gt(e,1)&&"then"in e.properties&&bn(qe(e.properties.then,t))===X.True}function Em(e,t){return qe(e,t)===X.False||da(e)&&!da(t)?X.False:X.True}function zt(e,t){return In(e)?X.False:Dn(e)?X.Union:Bo(e)||nm(e)&&up(t)||om(e)&&zl(t)||sm(e)&&fp(t)||Ni(e)&&dp(t)||Ua(e)&&RF(t)||Tn(e)&&up(t)||Ni(e)&&dp(t)||Ht(e)&&zl(t)||yo(e)&&zl(t)||fs(e)&&fp(t)||or(e)&&DF(t)||Ka(e)&&EF(t)||za(e)&&IF(t)||Wa(e)&&TF(t)?X.True:Ft(e)&&Tn(Cc(e))?t[Ma]==="Record"?X.True:X.False:Ft(e)&&Ht(Cc(e))&&Gt(t,0)?X.True:X.False}function MF(e,t){return _t(t)?gt(e,t):Ft(t)?kn(e,t):lt(t)?(()=>{for(const n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!da(t.properties[n]))return X.False;if(da(t.properties[n]))return X.True;if(Em(e.properties[n],t.properties[n])===X.False)return X.False}return X.True})():X.False}function OF(e,t){return _t(t)?gt(e,t):lt(t)&&FF(t)?X.True:fu(t)?bn(qe(e.item,t.item)):X.False}function Cc(e){return Os in e.patternProperties?hs():Ps in e.patternProperties?is():qs("Unknown record key pattern")}function Ac(e){return Os in e.patternProperties?e.patternProperties[Os]:Ps in e.patternProperties?e.patternProperties[Ps]:qs("Unable to get record value schema")}function kn(e,t){const[n,o]=[Cc(t),Ac(t)];return nm(e)&&Ht(n)&&bn(qe(e,o))===X.True?X.True:or(e)&&Ht(n)||Tn(e)&&Ht(n)||ds(e)&&Ht(n)?qe(e,o):lt(e)?(()=>{for(const s of Object.getOwnPropertyNames(e.properties))if(Em(o,e.properties[s])===X.False)return X.False;return X.True})():X.False}function PF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?qe(Ac(e),Ac(t)):X.False}function LF(e,t){const n=ji(e)?is():e,o=ji(t)?is():t;return qe(n,o)}function Dm(e,t){return Lo(e)&&dt(e.const)||Tn(e)?X.True:X.False}function BF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):Tn(t)?X.True:X.False}function jF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):Ni(t)?X.True:X.False}function NF(e,t){return Ui(e)?qe(fa(e),t):Ui(t)?qe(e,fa(t)):qs("Invalid fallthrough for TemplateLiteral")}function UF(e,t){return ds(t)&&e.items!==void 0&&e.items.every(n=>qe(n,t.items)===X.True)}function zF(e,t){return Bo(e)?X.True:In(e)?X.False:Dn(e)?X.Union:X.False}function KF(e,t){return _t(t)?gt(e,t):lt(t)&&Xa(t)||ds(t)&&UF(e,t)?X.True:Va(t)?ft(e.items)&&!ft(t.items)||!ft(e.items)&&ft(t.items)?X.False:ft(e.items)&&!ft(t.items)||e.items.every((n,o)=>qe(n,t.items[o])===X.True)?X.True:X.False:X.False}function WF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):or(t)?X.True:X.False}function VF(e,t){return _t(t)?gt(e,t):lt(t)?zt(e,t):Ft(t)?kn(e,t):qa(t)?JF(e):ss(t)?X.True:X.False}function $u(e,t){return t.anyOf.some(n=>qe(e,n)===X.True)?X.True:X.False}function qF(e,t){return e.anyOf.every(n=>qe(n,t)===X.True)?X.True:X.False}function Tm(e,t){return X.True}function HF(e,t){return Bo(t)?Sm():ps(t)?Ya(e,t):mo(t)?$u(e,t):Dn(t)?xu():Tn(t)?Dm(e):Ht(t)?Rm(e):yo(t)?Am(e):fs(t)?Cm(e):ds(t)?fF(e):Va(t)?zF(e):lt(t)?zt(e,t):In(t)?X.True:X.False}function JF(e,t){return ss(e)||ss(e)?X.True:X.False}function GF(e,t){return ps(t)?Ya(e,t):mo(t)?$u(e,t):In(t)?Tm():Dn(t)?xu():lt(t)?zt(e,t):qa(t)?X.True:X.False}function qe(e,t){return Ui(e)||Ui(t)?NF(e,t):ji(e)||ji(t)?LF(e,t):Ms(e)||Ms(t)?CF(e,t):Dn(e)?dF(e,t):ds(e)?pF(e,t):Ua(e)?vF(e,t):fs(e)?mF(e,t):cu(e)?hF(e,t):za(e)?_F(e,t):Ka(e)?gF(e,t):Wa(e)?bF(e,t):yo(e)?yF(e,t):ps(e)?kF(e,t):uu(e)?wF(e,t):Lo(e)?xF(e,t):Bo(e)?$F():du(e)?AF(e,t):Ht(e)?SF(e,t):lt(e)?MF(e,t):Ft(e)?PF(e,t):Tn(e)?BF(e,t):Ni(e)?jF(e,t):Va(e)?KF(e,t):fu(e)?OF(e,t):or(e)?WF(e,t):ss(e)?VF(e,t):mo(e)?qF(e,t):In(e)?HF(e,t):qa(e)?GF(e,t):qs(`Unknown left type operand '${e[Se]}'`)}function rr(e,t){return qe(e,t)}function ZF(e,t,n,o,s){const i={};for(const r of globalThis.Object.getOwnPropertyNames(e))i[r]=Cu(e[r],t,n,o,tn(s));return i}function YF(e,t,n,o,s){return ZF(e.properties,t,n,o,s)}function XF(e,t,n,o,s){const i=YF(e,t,n,o,s);return Ot(i)}function QF(e,t,n,o){const s=rr(e,t);return s===X.Union?Pt([n,o]):s===X.True?n:o}function Cu(e,t,n,o,s){return sn(e)?XF(e,t,n,o,s):ls(e)?be(oM(e,t,n,o,s)):be(QF(e,t,n,o),s)}function eM(e,t,n,o,s){return{[e]:Cu(pt(e),t,n,o,tn(s))}}function tM(e,t,n,o,s){return e.reduce((i,r)=>({...i,...eM(r,t,n,o,s)}),{})}function nM(e,t,n,o,s){return tM(e.keys,t,n,o,s)}function oM(e,t,n,o,s){const i=nM(e,t,n,o,s);return Ot(i)}function sM(e,t){return Au(fa(e),t)}function iM(e,t){const n=e.filter(o=>rr(o,t)===X.False);return n.length===1?n[0]:Pt(n)}function Au(e,t,n={}){return cs(e)?be(sM(e,t),n):sn(e)?be(lM(e,t),n):be(At(e)?iM(e.anyOf,t):rr(e,t)!==X.False?mt():e,n)}function rM(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Au(e[o],t);return n}function aM(e,t){return rM(e.properties,t)}function lM(e,t){const n=aM(e,t);return Ot(n)}function cM(e,t){return Su(fa(e),t)}function uM(e,t){const n=e.filter(o=>rr(o,t)!==X.False);return n.length===1?n[0]:Pt(n)}function Su(e,t,n){return cs(e)?be(cM(e,t),n):sn(e)?be(pM(e,t),n):be(At(e)?uM(e.anyOf,t):rr(e,t)!==X.False?e:mt(),n)}function dM(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Su(e[o],t);return n}function fM(e,t){return dM(e.properties,t)}function pM(e,t){const n=fM(e,t);return Ot(n)}function hM(e,t){return Ns(e)?be(e.returns,t):mt(t)}function Im(e){return No(Uo(e))}function vs(e,t,n){return be({[Se]:"Record",type:"object",patternProperties:{[e]:t}},n)}function Ru(e,t,n){const o={};for(const s of e)o[s]=t;return $t(o,{...n,[Ma]:"Record"})}function vM(e,t,n){return j8(e)?Ru(jo(e),t,n):vs(e.pattern,t,n)}function mM(e,t,n){return Ru(jo(Pt(e)),t,n)}function _M(e,t,n){return Ru([e.toString()],t,n)}function gM(e,t,n){return vs(e.source,t,n)}function bM(e,t,n){const o=ft(e.pattern)?Ps:e.pattern;return vs(o,t,n)}function yM(e,t,n){return vs(Ps,t,n)}function kM(e,t,n){return vs(m8,t,n)}function wM(e,t,n){return $t({true:t,false:t},n)}function xM(e,t,n){return vs(Os,t,n)}function $M(e,t,n){return vs(Os,t,n)}function Fm(e,t,n={}){return At(e)?mM(e.anyOf,t,n):cs(e)?vM(e,t,n):as(e)?_M(e.const,t,n):er(e)?wM(e,t,n):zs(e)?xM(e,t,n):Ks(e)?$M(e,t,n):Yv(e)?gM(e,t,n):nr(e)?bM(e,t,n):Jv(e)?yM(e,t,n):tr(e)?kM(e,t,n):mt(n)}function Eu(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function CM(e){const t=Eu(e);return t===Ps?is():t===Os?hs():is({pattern:t})}function Mm(e){return e.patternProperties[Eu(e)]}function AM(e,t){return t.parameters=ar(e,t.parameters),t.returns=Fn(e,t.returns),t}function SM(e,t){return t.parameters=ar(e,t.parameters),t.returns=Fn(e,t.returns),t}function RM(e,t){return t.allOf=ar(e,t.allOf),t}function EM(e,t){return t.anyOf=ar(e,t.anyOf),t}function DM(e,t){return ft(t.items)||(t.items=ar(e,t.items)),t}function TM(e,t){return t.items=Fn(e,t.items),t}function IM(e,t){return t.items=Fn(e,t.items),t}function FM(e,t){return t.items=Fn(e,t.items),t}function MM(e,t){return t.item=Fn(e,t.item),t}function OM(e,t){const n=jM(e,t.properties);return{...t,...$t(n)}}function PM(e,t){const n=Fn(e,CM(t)),o=Fn(e,Mm(t)),s=Fm(n,o);return{...t,...s}}function LM(e,t){return t.index in e?e[t.index]:Za()}function BM(e,t){const n=ou(t),o=Po(t),s=Fn(e,t);return n&&o?Im(s):n&&!o?No(s):!n&&o?Uo(s):s}function jM(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:BM(e,t[o])}),{})}function ar(e,t){return t.map(n=>Fn(e,n))}function Fn(e,t){return Ns(t)?AM(e,t):Us(t)?SM(e,t):yn(t)?RM(e,t):At(t)?EM(e,t):us(t)?DM(e,t):Bs(t)?TM(e,t):Oa(t)?IM(e,t):La(t)?FM(e,t):Ba(t)?MM(e,t):Pn(t)?OM(e,t):ja(t)?PM(e,t):Gv(t)?LM(e,t):t}function NM(e,t){return Fn(t,nu(e))}function UM(e){return be({[Se]:"Integer",type:"integer"},e)}function zM(e,t,n){return{[e]:Hs(pt(e),t,tn(n))}}function KM(e,t,n){return e.reduce((s,i)=>({...s,...zM(i,t,n)}),{})}function WM(e,t,n){return KM(e.keys,t,n)}function VM(e,t,n){const o=WM(e,t,n);return Ot(o)}function qM(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}function HM(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}function JM(e){return e.toUpperCase()}function GM(e){return e.toLowerCase()}function ZM(e,t,n){const o=_u(e.pattern);if(!Wi(o))return{...e,pattern:Om(e.pattern,t)};const r=[...Ha(o)].map(c=>pt(c)),a=Pm(r,t),l=Pt(a);return dm([l],n)}function Om(e,t){return typeof e=="string"?t==="Uncapitalize"?qM(e):t==="Capitalize"?HM(e):t==="Uppercase"?JM(e):t==="Lowercase"?GM(e):e:e.toString()}function Pm(e,t){return e.map(n=>Hs(n,t))}function Hs(e,t,n={}){return ls(e)?VM(e,t,n):cs(e)?ZM(e,t,n):At(e)?Pt(Pm(e.anyOf,t),n):as(e)?pt(Om(e.const,t),n):be(e,n)}function YM(e,t={}){return Hs(e,"Capitalize",t)}function XM(e,t={}){return Hs(e,"Lowercase",t)}function QM(e,t={}){return Hs(e,"Uncapitalize",t)}function e6(e,t={}){return Hs(e,"Uppercase",t)}function t6(e,t,n){const o={};for(const s of globalThis.Object.getOwnPropertyNames(e))o[s]=Qa(e[s],t,tn(n));return o}function n6(e,t,n){return t6(e.properties,t,n)}function o6(e,t,n){const o=n6(e,t,n);return Ot(o)}function s6(e,t){return e.map(n=>Du(n,t))}function i6(e,t){return e.map(n=>Du(n,t))}function r6(e,t){const{[t]:n,...o}=e;return o}function a6(e,t){return t.reduce((n,o)=>r6(n,o),e)}function l6(e,t,n){const o=nn(e,[hn,"$id","required","properties"]),s=a6(n,t);return $t(s,o)}function c6(e){const t=e.reduce((n,o)=>Zv(o)?[...n,pt(o)]:n,[]);return Pt(t)}function Du(e,t){return yn(e)?zo(s6(e.allOf,t)):At(e)?Pt(i6(e.anyOf,t)):Pn(e)?l6(e,t,e.properties):$t({})}function Qa(e,t,n){const o=Yt(t)?c6(t):t,s=Do(t)?jo(t):t,i=Jt(e),r=Jt(t);return sn(e)?o6(e,s,n):ls(t)?p6(e,t,n):i&&r?kt("Omit",[e,o],n):!i&&r?kt("Omit",[e,o],n):i&&!r?kt("Omit",[e,o],n):be({...Du(e,s),...n})}function u6(e,t,n){return{[t]:Qa(e,[t],tn(n))}}function d6(e,t,n){return t.reduce((o,s)=>({...o,...u6(e,s,n)}),{})}function f6(e,t,n){return d6(e,t.keys,n)}function p6(e,t,n){const o=f6(e,t,n);return Ot(o)}function h6(e,t,n){const o={};for(const s of globalThis.Object.getOwnPropertyNames(e))o[s]=el(e[s],t,tn(n));return o}function v6(e,t,n){return h6(e.properties,t,n)}function m6(e,t,n){const o=v6(e,t,n);return Ot(o)}function _6(e,t){return e.map(n=>Tu(n,t))}function g6(e,t){return e.map(n=>Tu(n,t))}function b6(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function y6(e,t,n){const o=nn(e,[hn,"$id","required","properties"]),s=b6(n,t);return $t(s,o)}function k6(e){const t=e.reduce((n,o)=>Zv(o)?[...n,pt(o)]:n,[]);return Pt(t)}function Tu(e,t){return yn(e)?zo(_6(e.allOf,t)):At(e)?Pt(g6(e.anyOf,t)):Pn(e)?y6(e,t,e.properties):$t({})}function el(e,t,n){const o=Yt(t)?k6(t):t,s=Do(t)?jo(t):t,i=Jt(e),r=Jt(t);return sn(e)?m6(e,s,n):ls(t)?C6(e,t,n):i&&r?kt("Pick",[e,o],n):!i&&r?kt("Pick",[e,o],n):i&&!r?kt("Pick",[e,o],n):be({...Tu(e,s),...n})}function w6(e,t,n){return{[t]:el(e,[t],tn(n))}}function x6(e,t,n){return t.reduce((o,s)=>({...o,...w6(e,s,n)}),{})}function $6(e,t,n){return x6(e,t.keys,n)}function C6(e,t,n){const o=$6(e,t,n);return Ot(o)}function A6(e,t){return kt("Partial",[kt(e,t)])}function S6(e){return kt("Partial",[ir(e)])}function R6(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Uo(e[n]);return t}function E6(e,t){const n=nn(e,[hn,"$id","required","properties"]),o=R6(t);return $t(o,n)}function pp(e){return e.map(t=>Lm(t))}function Lm(e){return js(e)?A6(e.target,e.parameters):Jt(e)?S6(e.$ref):yn(e)?zo(pp(e.allOf)):At(e)?Pt(pp(e.anyOf)):Pn(e)?E6(e,e.properties):Pa(e)||er(e)||zs(e)||as(e)||su(e)||Ks(e)||nr(e)||iu(e)||ru(e)?e:$t({})}function Iu(e,t){return sn(e)?I6(e,t):be({...Lm(e),...t})}function D6(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Iu(e[o],tn(t));return n}function T6(e,t){return D6(e.properties,t)}function I6(e,t){const n=T6(e,t);return Ot(n)}function F6(e,t){return kt("Required",[kt(e,t)])}function M6(e){return kt("Required",[ir(e)])}function O6(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=nn(e[n],[bo]);return t}function P6(e,t){const n=nn(e,[hn,"$id","required","properties"]),o=O6(t);return $t(o,n)}function hp(e){return e.map(t=>Bm(t))}function Bm(e){return js(e)?F6(e.target,e.parameters):Jt(e)?M6(e.$ref):yn(e)?zo(hp(e.allOf)):At(e)?Pt(hp(e.anyOf)):Pn(e)?P6(e,e.properties):Pa(e)||er(e)||zs(e)||as(e)||su(e)||Ks(e)||nr(e)||iu(e)||ru(e)?e:$t({})}function Fu(e,t){return sn(e)?j6(e,t):be({...Bm(e),...t})}function L6(e,t){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Fu(e[o],t);return n}function B6(e,t){return L6(e.properties,t)}function j6(e,t){const n=B6(e,t);return Ot(n)}function N6(e,t){return t.map(n=>Jt(n)?Mu(e,n.$ref):on(e,n))}function Mu(e,t){return t in e?Jt(e[t])?Mu(e,e[t].$ref):on(e,e[t]):mt()}function U6(e){return Ga(e[0])}function z6(e){return Ja(e[0],e[1])}function K6(e){return ku(e[0])}function W6(e){return Iu(e[0])}function V6(e){return Qa(e[0],e[1])}function q6(e){return el(e[0],e[1])}function H6(e){return Fu(e[0])}function J6(e,t,n){const o=N6(e,n);return t==="Awaited"?U6(o):t==="Index"?z6(o):t==="KeyOf"?K6(o):t==="Partial"?W6(o):t==="Omit"?V6(o):t==="Pick"?q6(o):t==="Required"?H6(o):mt()}function G6(e,t){return pu(on(e,t))}function Z6(e,t){return hu(on(e,t))}function Y6(e,t,n){return vu(lr(e,t),on(e,n))}function X6(e,t,n){return sr(lr(e,t),on(e,n))}function Q6(e,t){return zo(lr(e,t))}function eO(e,t){return bu(on(e,t))}function tO(e,t){return $t(globalThis.Object.keys(t).reduce((n,o)=>({...n,[o]:on(e,t[o])}),{}))}function nO(e,t){const[n,o]=[on(e,Mm(t)),Eu(t)],s=nu(t);return s.patternProperties[o]=n,s}function oO(e,t){return Jt(t)?{...Mu(e,t.$ref),[hn]:t[hn]}:t}function sO(e,t){return Vs(lr(e,t))}function iO(e,t){return Pt(lr(e,t))}function lr(e,t){return t.map(n=>on(e,n))}function on(e,t){return Po(t)?be(on(e,nn(t,[bo])),t):ou(t)?be(on(e,nn(t,[Qi])),t):Na(t)?be(oO(e,t),t):Bs(t)?be(G6(e,t.items),t):Oa(t)?be(Z6(e,t.items),t):js(t)?be(J6(e,t.target,t.parameters)):Ns(t)?be(Y6(e,t.parameters,t.returns),t):Us(t)?be(X6(e,t.parameters,t.returns),t):yn(t)?be(Q6(e,t.allOf),t):La(t)?be(eO(e,t.items),t):Pn(t)?be(tO(e,t.properties),t):ja(t)?be(nO(e,t)):us(t)?be(sO(e,t.items||[]),t):At(t)?be(iO(e,t.anyOf),t):t}function rO(e,t){return t in e?on(e,e[t]):mt()}function aO(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:rO(e,n)}),{})}class lO{constructor(t){const n=aO(t),o=this.WithIdentifiers(n);this.$defs=o}Import(t,n){const o={...this.$defs,[t]:be(this.$defs[t],n)};return be({[Se]:"Import",$defs:o,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:{...t[o],$id:o}}),{})}}function cO(e){return new lO(e)}function uO(e,t){return be({[Se]:"Not",not:e},t)}function dO(e,t){return Us(e)?Vs(e.parameters,t):mt()}let fO=0;function pO(e,t={}){ft(t.$id)&&(t.$id=`T${fO++}`);const n=nu(e({[Se]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,be({[Ma]:"Recursive",...n},t)}function hO(e,t){const n=dt(e)?new globalThis.RegExp(e):e;return be({[Se]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}function vO(e){return yn(e)?e.allOf:At(e)?e.anyOf:us(e)?e.items??[]:[]}function mO(e){return vO(e)}function _O(e,t){return Us(e)?be(e.returns,t):mt(t)}class gO{constructor(t){this.schema=t}Decode(t){return new bO(this.schema,t)}}class bO{constructor(t,n){this.schema=t,this.decode=n}EncodeTransform(t,n){const i={Encode:r=>n[hn].Encode(t(r)),Decode:r=>this.decode(n[hn].Decode(r))};return{...n,[hn]:i}}EncodeSchema(t,n){const o={Decode:this.decode,Encode:t};return{...n,[hn]:o}}Encode(t){return Na(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}}function yO(e){return new gO(e)}function kO(e={}){return be({[Se]:e[Se]??"Unsafe"},e)}function wO(e){return be({[Se]:"Void",type:"void"},e)}const xO=Object.freeze(Object.defineProperty({__proto__:null,Any:zi,Argument:x8,Array:pu,AsyncIterator:hu,Awaited:Ga,BigInt:gu,Boolean:cm,Capitalize:YM,Composite:sF,Const:aF,Constructor:vu,ConstructorParameters:lF,Date:ym,Enum:cF,Exclude:Au,Extends:Cu,Extract:Su,Function:sr,Index:Ja,InstanceType:hM,Instantiate:NM,Integer:UM,Intersect:zo,Iterator:bu,KeyOf:ku,Literal:pt,Lowercase:XM,Mapped:AI,Module:cO,Never:mt,Not:uO,Null:km,Number:hs,Object:$t,Omit:Qa,Optional:Uo,Parameters:dO,Partial:Iu,Pick:el,Promise:vm,Readonly:No,ReadonlyOptional:Im,Record:Fm,Recursive:pO,Ref:ir,RegExp:hO,Required:Fu,Rest:mO,ReturnType:_O,String:is,Symbol:wm,TemplateLiteral:dm,Transform:yO,Tuple:Vs,Uint8Array:$m,Uncapitalize:QM,Undefined:xm,Union:Pt,Unknown:Za,Unsafe:kO,Uppercase:e6,Void:wO},Symbol.toStringTag,{value:"Module"})),k=xO;k.Object({filePath:k.String({description:"工作区相对路径或文件名"}),offset:k.Optional(k.Number({description:"1-based 起始行号;缺省从第 1 行读全量"})),limit:k.Optional(k.Number({description:"最多读取行数(仅 offset 给出时生效,缺省 2000)"}))},{$id:"fs_read"});k.Object({filePath:k.String({description:"工作区相对路径或文件名"}),content:k.String({description:"要写入的文件完整文本内容"})},{$id:"fs_write"});k.Object({filePath:k.String({description:"工作区相对路径(文件必须已存在)"}),oldString:k.String({description:"要替换的精确原文(字面文本,含缩进换行)"}),newString:k.String({description:"替换后的文本"}),replaceAll:k.Optional(k.Boolean({description:"oldString 多次出现时是否全部替换;默认 false(仅唯一匹配可替换)"}))},{$id:"fs_edit"});k.Object({command:k.String({description:"要执行的 Shell 命令(可用 &&、;、管道组合)"}),timeoutMs:k.Optional(k.Number({description:"执行超时毫秒数,默认 30000;超时进程被杀死"}))},{$id:"bash_run"});k.Object({pattern:k.String({description:"glob 模式,相对工作区根,如 src/**/*.ts"})},{$id:"glob"});k.Object({pattern:k.String({description:"正则表达式源(不带分隔符),如 function\\s+\\w+"}),flags:k.Optional(k.String({description:"正则 flags,如 'i' 忽略大小写;g 自动附加"})),include:k.Optional(k.String({description:"文件名 glob 过滤,如 *.ts"}))},{$id:"grep"});k.Object({url:k.String({description:"要抓取的完整 http(s) URL(含协议)"})},{$id:"web_fetch"});k.Object({summary:k.String({description:"本轮任务的完成摘要:做了什么、结果是什么"}),deliverables:k.Optional(k.Array(k.Object({kind:k.String({description:"产物类型,如 text / diff / chart / file"}),ref:k.Optional(k.String({description:"产物引用(文件路径 / 卡片 id / 链接)"}))}),{description:"交付物清单:模型自述的实质性产出"}))},{$id:"finish_task"});const $O=k.Union([k.Literal("text"),k.Literal("textarea"),k.Literal("number"),k.Literal("boolean"),k.Literal("select"),k.Literal("date")]),CO=k.Object({value:k.String({description:"机器值(回传 values 中的取值)"}),label:k.String({description:"人类文案(界面展示与摘要回映)"})}),AO=k.Object({key:k.String({description:"字段标识,回传 values 的 key"}),label:k.String({description:"字段显示名"}),type:$O,description:k.Optional(k.String({description:"字段含义说明——同时进入摘要词汇表"})),required:k.Optional(k.Boolean({description:"是否必填"})),default:k.Optional(k.Unknown({description:"预填默认值"})),options:k.Optional(k.Array(CO,{description:"select 类型的可选项(value 为机器值,label 为人类文案)"})),unit:k.Optional(k.String({description:"数值单位,摘要中附带"})),secret:k.Optional(k.Boolean({description:"敏感字段:值不进模型上下文,走 §5 敏感值通道"})),placeholder:k.Optional(k.String({description:"输入占位提示"}))});k.Object({title:k.String({description:"表单标题"}),description:k.Optional(k.String({description:"为什么需要这些信息(展示给用户)"})),fields:k.Array(AO,{minItems:1,maxItems:32,description:"表单字段列表(1-32 个字段)"}),submitLabel:k.Optional(k.String({description:"提交按钮文案"}))},{$id:"ui_form",description:"需要用户补充结构化信息(参数、配置、凭证)时调用:渲染表单并挂起等待填写提交"});const SO=k.Union([k.Literal("low"),k.Literal("medium"),k.Literal("high")]);k.Object({title:k.String({description:"审批标题文案,例如'Agent 申请执行终端命令'"}),detail:k.Optional(k.String({description:"补充背景或风险提示说明"})),risk:k.Optional(SO),preview:k.Optional(k.String({description:"命令、代码或关键操作详情预览(等宽展示)"})),confirmLabel:k.Optional(k.String({description:"批准按钮文案,默认为'批准'"})),denyLabel:k.Optional(k.String({description:"拒绝按钮文案,默认为'拒绝'"})),countdown:k.Optional(k.Number({description:"倒计时秒数,到期未确认自动拒绝;0 或不传表示不限时"})),shortcuts:k.Optional(k.Boolean({description:"是否显示键盘快捷键提示 (Enter / Esc)"}))},{$id:"ui_approval_card",description:"涉及敏感操作或高风险动作时调用此工具,挂起并等待人工审批决策"});k.Object({approved:k.Boolean({description:"用户是否批准执行"}),reason:k.Optional(k.Union([k.Literal("manual"),k.Literal("timeout")],{description:"决策成因(人工操作或超时)"})),note:k.Optional(k.String({description:"人工填写的驳回原因或附加备注"}))});const jm=k.Union([k.Literal("input"),k.Literal("model"),k.Literal("tool")]),Nm=k.Union([k.Literal("user"),k.Literal("assistant"),k.Literal("tool"),k.Literal("system"),k.Literal("context")]),RO=k.Object({id:k.String({description:"事件唯一 ID"}),at:k.Number({description:"开始时间戳 (毫秒)"}),endAt:k.Optional(k.Number({description:"结束时间戳 (毫秒)"})),lane:jm,role:Nm,title:k.String({description:"正文片段或调用的工具名"}),detail:k.Optional(k.String({description:"入参 JSON 或详细上下文"})),result:k.Optional(k.String({description:"工具执行结果或错误信息"})),turn:k.Number({description:"属于第几轮对话 (从 1 开始)"})});k.Object({events:k.Array(RO,{description:"轨迹流中的事件集合"}),ledgerMaxHeight:k.Optional(k.Number({description:"台账区最大高度 (px)"}))},{$id:"ui_trajectory",description:"多步骤复杂任务时展示三泳道执行时间线与台账流水"});k.Object({oldText:k.String({description:"原始内容文本"}),newText:k.String({description:"变更后的新文本"}),fileName:k.Optional(k.String({description:"文件路径或文件名"})),context:k.Optional(k.Number({description:"上下文折叠保留行数,默认 3"})),wordLevel:k.Optional(k.Boolean({description:"是否开启词级别精细高亮"})),defaultExpandAll:k.Optional(k.Boolean({description:"是否默认展开全部未变更行"})),maxHeight:k.Optional(k.Number({description:"容器最大高度 px"})),layout:k.Optional(k.Union([k.Literal("unified"),k.Literal("side")],{description:"展示模式:unified 统一行模式,side 左右并排模式"}))},{$id:"ui_code_diff",description:"向用户展示代码修改、文本配置变更或补丁对比"});const EO=k.Object({label:k.String({description:"数据项标签或时间点"}),value:k.Number({description:"具体数值"})});k.Object({title:k.String({description:"图表标题"}),chartType:k.Union([k.Literal("line"),k.Literal("bar")],{description:"图表类型:line 折线图,bar 柱状图"}),unit:k.Optional(k.String({description:"数值单位,如'ms'、'%'、'次'"})),series:k.Array(EO,{description:"数据序列"})},{$id:"ui_metric_chart",description:"展示统计趋势、KPI 指标、耗时或对比数据"});const Um=k.Union([k.Literal("pending"),k.Literal("running"),k.Literal("done"),k.Literal("error")]),zm=k.Object({id:k.String({description:"步骤 ID"}),title:k.String({description:"步骤名称"}),detail:k.Optional(k.String({description:"步骤详细说明"})),status:k.Optional(Um),startedAt:k.Optional(k.Number({description:"执行开始时间戳"})),duration:k.Optional(k.Number({description:"执行耗时毫秒"}))});k.Object({title:k.Optional(k.String({description:"执行计划标题"})),steps:k.Array(zm,{description:"计划任务步骤列表"}),editable:k.Optional(k.Boolean({description:"是否允许用户在界面编辑修改步骤"})),collaborative:k.Optional(k.Boolean({description:"计划需要用户协作修改时置 true:渲染后挂起等待用户增量编辑(patch)并显式确认/取消;缺省 false 保持纯展示语义不变"}))},{$id:"ui_agent_plan",description:"展示任务执行规划、待办清单或步骤进展"});k.Object({steps:k.Optional(k.Array(zm,{description:"用户协作修改后的计划步骤集合(全量步骤列表,服务端按 patch 增量合并)"})),retryStepId:k.Optional(k.String({description:"用户要求重试的步骤 ID(如提供)"}))});const Ur=k.Union([k.Literal("modified"),k.Literal("added"),k.Literal("deleted"),k.Literal("untracked")]),DO=k.Object({path:k.String({description:"相对路径或文件名"}),type:k.Optional(k.Union([k.Literal("file"),k.Literal("dir")])),status:k.Optional(Ur),children:k.Optional(k.Array(k.Object({path:k.String({description:"相对路径或文件名"}),type:k.Optional(k.Union([k.Literal("file"),k.Literal("dir")])),status:k.Optional(Ur),children:k.Optional(k.Array(k.Object({path:k.String({description:"相对路径或文件名"}),type:k.Optional(k.Union([k.Literal("file"),k.Literal("dir")])),status:k.Optional(Ur),children:k.Optional(k.Array(k.Any(),{description:"更深层级的子目录或文件节点列表"}))}),{description:"二级子目录或文件列表"}))}),{description:"子目录文件列表"}))});k.Object({title:k.Optional(k.String({description:"文件树卡片标题,如'工作区文件列表'或'变更文件概览'"})),tree:k.Array(DO,{description:"工作区目录树或文件节点数组"}),defaultExpandDepth:k.Optional(k.Number({description:"默认展开层数,默认 1"}))},{$id:"ui_file_tree",description:"展示工作区代码目录结构、项目文件树或近期修改的文件列表"});const TO=k.Object({id:k.String({description:"列 ID"}),title:k.String({description:"列标题,如'待办 / 进行中 / 已完成'"}),hint:k.Optional(k.String({description:"列头徽标文案,缺省自动为列内任务数"}))}),IO=k.Union([k.Literal("low"),k.Literal("medium"),k.Literal("high")]),FO=k.Object({id:k.String({description:"任务 ID"}),columnId:k.String({description:"所属列 ID"}),title:k.String({description:"任务标题"}),assignee:k.Optional(k.String({description:"负责人"})),priority:k.Optional(IO),meta:k.Optional(k.String({description:"截止/耗时等角标文案"}))});k.Object({columns:k.Array(TO,{description:"看板列定义"}),tasks:k.Array(FO,{description:"任务条目集合"})},{$id:"ui_task_board",description:"把任务拆解/分工/状态流转展示为多列看板(列 + 任务卡)"});const MO=k.Object({path:k.String({description:"文件相对路径"}),status:k.Optional(Ur),additions:k.Optional(k.Number({description:"新增行数"})),deletions:k.Optional(k.Number({description:"删除行数"}))});k.Object({title:k.Optional(k.String({description:"本轮工作标题,如'重构用户列表页'"})),files:k.Array(MO,{description:"本轮变更的文件清单"}),duration:k.Optional(k.Number({description:"总耗时毫秒"})),toolCalls:k.Optional(k.Number({description:"使用的工具调用次数"})),finishedAt:k.Optional(k.Number({description:"完成时间(毫秒时间戳)"}))},{$id:"ui_change_summary",description:"agent 一轮工作收尾时展示变更摘要卡:N 文件 +adds −dels、耗时与工具调用次数"});const OO=k.Object({id:k.String({description:"评论 ID"}),author:k.String({description:"作者名"}),avatar:k.Optional(k.String({description:"头像图片地址,缺省用首字母色块"})),initials:k.Optional(k.String({description:"首字母色块文案,缺省取 author 首字符"})),role:k.Optional(k.String({description:"身份标注,如 'Agent' / '工程师'"})),text:k.String({description:"评论正文(保留换行)"}),createdAt:k.Optional(k.Number({description:"创建时间(毫秒时间戳)"})),pending:k.Optional(k.Boolean({description:"agent 起草待审条目(展示采纳/重写操作条)"}))});k.Object({comments:k.Array(OO,{description:"评论线程(含 agent 草稿条目)"}),maxHeight:k.Optional(k.Number({description:"线程最大高度 px,超出滚动"}))},{$id:"ui_comment_thread",description:"展示 agent 起草的评论/评审意见线程,待审条目与正式评论视觉区分"});const PO=k.Object({id:k.String({description:"来源 ID,与正文 [n] 角标对应"}),title:k.String({description:"来源标题,如'Vuagent 文档 · 快速开始'"}),url:k.Optional(k.String({description:"链接,不设则为纯文本来源"})),origin:k.Optional(k.String({description:"域名/出处短标,如 'vuagent.dev'"}))});k.Object({question:k.Optional(k.String({description:"用户问题(小字展示在答案上方)"})),answer:k.String({description:"回答正文;支持引用标记 [1] [2](与 sources 下标对应)渲染为可点击上标角标"}),sources:k.Array(PO,{description:"引用来源列表"})},{$id:"ui_ai_answer",description:"结论性回答需要给出引用出处时使用:正文角标 + 来源列表"});const St=k.Optional(k.Number({description:"hub 广播序号(1 起),增量重连去重用(TASK-054)"})),LO=k.Object({id:k.String(),label:k.String(),tokens:k.Number(),kind:k.Union([k.Literal("system"),k.Literal("history"),k.Literal("tools")])}),BO=k.Object({id:k.String(),at:k.Number(),endAt:k.Optional(k.Number()),lane:jm,role:Nm,title:k.String(),detail:k.Optional(k.String()),result:k.Optional(k.String()),turn:k.Number(),durationMs:k.Optional(k.Number())}),jO=k.Object({type:k.Literal("thought_delta"),seq:St,messageId:k.Optional(k.String()),delta:k.String()}),NO=k.Object({type:k.Literal("text_delta"),seq:St,messageId:k.String(),delta:k.String()}),UO=k.Object({type:k.Literal("ui_agent_plan"),seq:St,title:k.String(),steps:k.Array(k.Object({id:k.String(),title:k.String(),status:Um,duration:k.Optional(k.Number()),startedAt:k.Optional(k.Number())}))}),zO=k.Object({type:k.Literal("ui_code_diff"),seq:St,file:k.String(),oldCode:k.String(),newCode:k.String(),additions:k.Optional(k.Number()),deletions:k.Optional(k.Number())}),KO=k.Object({type:k.Literal("ui_terminal_log"),seq:St,title:k.Optional(k.String()),lines:k.Array(k.Object({text:k.String(),kind:k.Optional(k.Union([k.Literal("cmd"),k.Literal("stdout"),k.Literal("stderr"),k.Literal("ok"),k.Literal("warn")]))}))}),WO=k.Object({type:k.Literal("ui_metric_chart"),seq:St,title:k.Optional(k.String()),points:k.Array(k.Object({time:k.String(),value:k.Number()}))}),VO=k.Object({type:k.Literal("tool_call_start"),seq:St,messageId:k.String(),toolCallId:k.String(),toolName:k.String()}),qO=k.Object({type:k.Literal("tool_call_args_delta"),seq:St,toolCallId:k.String(),partialArgs:k.Record(k.String(),k.Unknown())}),HO=k.Object({type:k.Literal("tool_call_executing"),seq:St,toolCallId:k.String(),toolName:k.String(),args:k.Record(k.String(),k.Unknown())}),JO=k.Object({type:k.Literal("tool_call_result"),seq:St,toolCallId:k.String(),toolName:k.String(),status:k.Union([k.Literal("done"),k.Literal("error")]),data:k.Optional(k.Unknown()),error:k.Optional(k.String())}),GO=k.Object({type:k.Literal("usage"),seq:St,promptTokens:k.Number(),completionTokens:k.Number(),totalTokens:k.Number(),contextWindow:k.Optional(k.Number()),parts:k.Optional(k.Array(LO)),reasoningTokens:k.Optional(k.Number()),cachedTokens:k.Optional(k.Number()),cacheCreationTokens:k.Optional(k.Number())}),ZO=k.Object({type:k.Literal("suspended"),seq:St,actionId:k.String(),toolName:k.String(),args:k.Record(k.String(),k.Unknown()),timeoutMs:k.Number()}),YO=k.Object({type:k.Literal("traj"),seq:St,event:BO}),XO=k.Object({type:k.Literal("resumed"),seq:St,actionId:k.String(),payload:k.Unknown()}),QO=k.Object({type:k.Literal("turn_end"),seq:St,stepCount:k.Number(),durationMs:k.Number()}),e9=k.Object({type:k.Literal("turn_start"),seq:St,turnId:k.String(),startedAt:k.Number()}),t9=k.Object({type:k.Literal("aborted"),seq:St,turnId:k.Optional(k.String()),reason:k.Union([k.Literal("user"),k.Literal("timeout"),k.Literal("preempt"),k.Literal("process_restart"),k.Literal("token_budget")])}),n9=k.Object({type:k.Literal("error"),seq:St,message:k.String(),code:k.Optional(k.String())});k.Union([jO,NO,UO,zO,KO,WO,VO,qO,HO,JO,GO,ZO,YO,XO,QO,e9,t9,n9]);const Kl=k.Object({editedFields:k.Optional(k.Array(k.String(),{description:"用户实际修改过的字段 key(区别于组件预填默认值)——模型据此区分『用户确认过』与『默认值透传』"})),durationMs:k.Optional(k.Number({description:"用户交互耗时(毫秒)"})),clientValidated:k.Optional(k.Boolean({description:"前端是否已过本地校验(服务端仍必须复核)"}))});k.Union([k.Object({kind:k.Literal("submit"),values:k.Record(k.String(),k.Unknown(),{description:"用户提交的字段值集合,形状由组件 resultSchema 约束"}),meta:k.Optional(Kl)}),k.Object({kind:k.Literal("cancel"),reason:k.Optional(k.String({description:"用户主动取消的原因(若界面提供输入)"})),meta:k.Optional(Kl)}),k.Object({kind:k.Literal("patch"),values:k.Record(k.String(),k.Unknown(),{description:"L3 预留:增量编辑值集合,不终结挂起"}),meta:k.Optional(Kl)})]);const Fr=[{id:"deepseek-v3",label:"DeepSeek V3",meta:"deepseek-chat",provider:"DeepSeek",model:"deepseek-chat"},{id:"qwen-2.5-72b",label:"Qwen 2.5 72B",meta:"qwen-2.5-72b",provider:"通义千问",model:"qwen-2.5-72b-instruct"},{id:"claude-3-7-sonnet",label:"Claude 3.7 Sonnet",meta:"claude-3-7-sonnet",provider:"Anthropic",model:"claude-3-7-sonnet-20250219"},{id:"ollama-local",label:"Ollama (Local)",meta:"llama3:8b",provider:"Ollama 本地",model:"llama3:8b"}],o9=[{id:"review",label:"严格审批 (Review)",desc:"写文件、命令执行等需人工确认"},{id:"auto",label:"自动执行 (Auto)",desc:"工具沙箱全自动运行"},{id:"readonly",label:"只读沙箱 (Read-Only)",desc:"禁止一切写入与执行操作"}],vp=Object.fromEntries(la.map(e=>[e.id,{name:e.label,model:e.suggestedModel??"custom-model",baseUrl:e.baseUrl,contextWindow:e.contextWindow??32e3}])),s9=[...la.filter(e=>e.featured),...la.filter(e=>!e.featured)].map(e=>({value:e.id,label:e.label})),i9={id:"",name:"",provider:"deepseek",model:"deepseek-chat",baseUrl:"https://api.deepseek.com/v1",apiKey:"",contextWindow:128e3,temperature:.2,isDefault:!1},r9={class:"va-settings__panel va-settings__panel--models"},a9={class:"va-console__modal-body"},l9={class:"va-console__modal-left"},c9={class:"va-console__modal-list-head"},u9={class:"va-console__modal-profile-list"},d9={key:0,class:"va-console__profile-card va-console__profile-card--active"},f9={class:"va-console__profile-card-top"},p9={class:"va-console__profile-name"},h9={class:"va-console__profile-card-sub"},v9={class:"va-console__provider-pill"},m9=["onClick"],_9={class:"va-console__profile-card-top"},g9={class:"va-console__profile-name"},b9={key:0,class:"va-prov-count-chip"},y9={class:"va-console__profile-card-sub"},k9={class:"va-console__provider-pill"},w9={key:0,class:"va-console__model-id"},x9={key:1,class:"va-console__empty-tip"},$9={class:"va-console__modal-right"},C9={class:"va-console__form-row"},A9={class:"va-console__form-group flex-1"},S9={class:"va-console__form-group flex-1"},R9={class:"va-console__form-group"},E9={class:"va-console__label"},D9={class:"va-console__form-group"},T9={class:"va-console__label"},I9={key:0,class:"va-console__profile-card-sub",style:{"margin-left":"6px"}},F9={class:"va-console__input-with-action"},M9=["type","placeholder"],O9={class:"va-prov-actions"},P9={class:"va-model-section"},L9={class:"va-model-section__head"},B9={class:"va-model-section__title"},j9={class:"va-model-section__count"},N9={key:0,class:"va-model-list"},U9=["onClick"],z9={class:"va-model-row__info"},K9={class:"va-model-row__name"},W9={key:0,class:"va-console__default-chip"},V9={class:"va-model-row__id"},q9={class:"va-model-row__badges"},H9=["title","disabled","onClick"],J9={class:"va-model-row__edit",type:"button"},G9=["onClick"],Z9={key:1,class:"va-console__empty-tip"},Y9={key:2,class:"va-model-editor"},X9={class:"va-model-editor__head"},Q9={class:"va-model-editor__title"},eP={class:"va-console__form-row"},tP={class:"va-console__form-group flex-1"},nP={class:"va-console__form-group flex-1"},oP={class:"va-console__model-input-row"},sP=["disabled"],iP={id:"va-discovered-models"},rP=["value"],aP={class:"va-cap-block"},lP={class:"va-cap-block__title"},cP=["disabled"],uP={key:0,class:"va-cap-verdicts"},dP=["data-ok","data-fail","title"],fP={class:"va-cap-verdict__mark"},pP={class:"va-cap-verdict__name"},hP={class:"va-cap-verdict__detail"},vP={class:"va-console__form-row"},mP={class:"va-console__form-group flex-1"},_P={class:"va-console__form-group flex-1"},gP={class:"va-console__form-group"},bP={class:"va-cap-chips"},yP=["onClick"],kP={class:"va-cap-toggles"},wP={class:"va-console__form-row"},xP={class:"va-console__form-group flex-1"},$P={class:"va-console__label"},CP={class:"va-console__form-group flex-1"},AP={class:"va-console__checkbox-row",style:{"margin-top":"22px"}},SP={class:"va-console__checkbox-label"},RP={class:"va-model-editor__foot"},EP={class:"va-console__modal-foot"},DP={class:"va-console__foot-left"},TP={class:"va-console__foot-right"},IP=["disabled","title"],FP=Ce({__name:"ModelProfilesPanel",props:{providers:{},selectedProviderId:{},isCreatingProvider:{type:Boolean},currentProvider:{},currentProviderModels:{},providerForm:{},modelDraft:{},isCreatingModel:{type:Boolean},showApiKey:{type:Boolean},isTestingConnection:{type:Boolean},testingProfileId:{},isDiscovering:{type:Boolean},testStatus:{},discoveredModels:{},discoveredItems:{},isVerifyingCapabilities:{type:Boolean},capabilityVerdicts:{}},emits:["close","select-provider","create-provider","delete-provider","create-model","edit-model","delete-model","cancel-model-edit","save-provider","save-model","test","discover","select-model","test-model","provider-kind-change","update:showApiKey","toggle-modality","toggle-reasoning","toggle-tool-use","verify-capabilities"],setup(e,{emit:t}){const n=e,o=t,s=P(!1),i=P(null);function r(){s.value=!s.value,i.value=s.value}const a=T(()=>n.discoveredItems.map(g=>({value:g.id,label:g.displayName?`${g.displayName} · ${g.id}`:g.id})));Ee(()=>[n.discoveredModels.length,n.isDiscovering],([g,m])=>{m||(g===0?s.value=!0:i.value!==!0&&(s.value=!1))});const l=[{id:"image",label:"图片",icon:Vf},{id:"pdf",label:"PDF",icon:null},{id:"audio",label:"音频",icon:null},{id:"video",label:"视频",icon:null}];function c(g){return DT({capabilities:g.capabilities,contextWindow:g.contextWindow})}function u(g){return(n.modelDraft?.capabilities?.inputModalities||["text"]).includes(g)}function d(){return!!n.modelDraft?.capabilities?.reasoning?.supported}function _(){return!!n.modelDraft?.capabilities?.supportedParameters?.includes("tools")}const v=T(()=>n.modelDraft?.id||"");return(g,m)=>(h(),b("div",r9,[f("div",a9,[f("div",l9,[f("div",c9,[f("span",null,"供应商 ("+A(e.providers.length)+")",1),f("button",{class:"va-console__btn-add-profile",type:"button",onClick:m[0]||(m[0]=y=>o("create-provider"))},[j(p(Hf),{size:13}),m[25]||(m[25]=pe(" 添加 ",-1))])]),f("div",u9,[e.isCreatingProvider?(h(),b("div",d9,[f("div",f9,[f("span",p9,A(e.providerForm.name||"新供应商"),1),m[26]||(m[26]=f("span",{class:"va-console__new-chip"},"新建中",-1))]),f("div",h9,[f("span",v9,A(e.providerForm.provider),1)])])):E("",!0),(h(!0),b(G,null,me(e.providers,y=>(h(),b("div",{key:y.id,class:ye(["va-console__profile-card",{"va-console__profile-card--active":y.id===e.selectedProviderId&&!e.isCreatingProvider}]),onClick:x=>o("select-provider",y.id)},[f("div",_9,[f("span",g9,A(y.name),1),(y.models||[]).length?(h(),b("span",b9,A((y.models||[]).length),1)):E("",!0)]),f("div",y9,[f("span",k9,A(y.provider),1),y.maskedApiKey?(h(),b("span",w9,A(y.maskedApiKey),1)):E("",!0)])],10,m9))),128)),e.providers.length===0&&!e.isCreatingProvider?(h(),b("p",x9," 还没有供应商,先添加一个端点与密钥。 ")):E("",!0)])]),f("div",$9,[m[45]||(m[45]=f("div",{class:"va-settings__panel-heading"},[f("p",{class:"va-console__modal-sub"}," 端点与密钥在此配置一次,其下所有模型共用;修改后立即对全部模型生效。 ")],-1)),f("div",C9,[f("div",A9,[m[27]||(m[27]=f("label",{class:"va-console__label"},"供应商名称",-1)),Ve(f("input",{"onUpdate:modelValue":m[1]||(m[1]=y=>e.providerForm.name=y),class:"va-console__input",type:"text",placeholder:"如 DeepSeek 官方"},null,512),[[st,e.providerForm.name]])]),f("div",S9,[m[28]||(m[28]=f("label",{class:"va-console__label"},"类型",-1)),j(p(ta),{"model-value":e.providerForm.provider,options:p(s9),label:"供应商类型","onUpdate:modelValue":m[2]||(m[2]=y=>o("provider-kind-change",Array.isArray(y)?String(y[0]??""):String(y)))},null,8,["model-value","options"])])]),f("div",R9,[f("label",E9,[j(p(x5),{size:12}),m[29]||(m[29]=pe(" API 基础地址",-1))]),Ve(f("input",{"onUpdate:modelValue":m[3]||(m[3]=y=>e.providerForm.baseUrl=y),class:"va-console__input font-mono",type:"text",placeholder:"如 https://api.deepseek.com/v1"},null,512),[[st,e.providerForm.baseUrl]])]),f("div",D9,[f("label",T9,[j(p($5),{size:12}),m[30]||(m[30]=pe(" API 密钥 ",-1)),e.providerForm.maskedApiKey?(h(),b("span",I9," 已配置 "+A(e.providerForm.maskedApiKey),1)):E("",!0)]),f("div",F9,[Ve(f("input",{"onUpdate:modelValue":m[4]||(m[4]=y=>e.providerForm.apiKey=y),class:"va-console__input font-mono",type:e.showApiKey?"text":"password",placeholder:e.providerForm.maskedApiKey?"留空保持原密钥":"sk-..."},null,8,M9),[[Hh,e.providerForm.apiKey]]),f("button",{class:"va-console__input-addon-btn",type:"button",onClick:m[5]||(m[5]=y=>o("update:showApiKey",!e.showApiKey))},[e.showApiKey?(h(),ce(p(y5),{key:0,size:14})):(h(),ce(p(k5),{key:1,size:14}))])])]),f("div",O9,[f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[6]||(m[6]=y=>o("save-provider"))},A(e.isCreatingProvider?"创建供应商":"保存供应商设置"),1)]),f("div",P9,[f("div",L9,[f("span",B9,[m[31]||(m[31]=pe(" 此供应商下的模型 ",-1)),f("span",j9,A(e.currentProviderModels.length),1)]),f("button",{class:"va-console__btn-add-profile",type:"button",onClick:m[7]||(m[7]=y=>o("create-model"))},[j(p(Hf),{size:12}),m[32]||(m[32]=pe(" 添加模型 ",-1))])]),e.currentProviderModels.length?(h(),b("div",N9,[(h(!0),b(G,null,me(e.currentProviderModels,y=>(h(),b("div",{key:y.id,class:ye(["va-model-row",{"va-model-row--editing":y.id===v.value}])},[f("div",{class:"va-model-row__main",onClick:x=>o("edit-model",y)},[f("div",z9,[f("span",K9,[pe(A(y.name)+" ",1),y.isDefault?(h(),b("span",W9,"默认")):E("",!0)]),f("span",V9,A(y.model),1)]),f("div",q9,[(h(!0),b(G,null,me(c(y),x=>(h(),b("span",{key:x,class:"va-prov-badge"},A(x),1))),128))]),f("button",{class:"va-model-row__edit",type:"button",title:e.testingProfileId===y.id?"探测中…":e.testingProfileId?"另有模型探测进行中":"不进编辑直接测试该模型连通性",disabled:!!e.testingProfileId,onClick:Fe(x=>o("test-model",y),["stop"])},[e.testingProfileId===y.id?(h(),ce(p(ui),{key:0,size:13,class:"va-console__spin"})):(h(),ce(p(Gf),{key:1,size:13}))],8,H9),f("button",J9,[y.id===v.value?(h(),ce(p(jv),{key:0,size:13})):(h(),ce(p(Bi),{key:1,size:13}))]),f("button",{class:"va-model-row__del",type:"button",title:"删除该模型",onClick:Fe(x=>o("delete-model",y.id),["stop"])},[j(p(Jf),{size:12})],8,G9)],8,U9)],2))),128))])):e.modelDraft?E("",!0):(h(),b("p",Z9,A(e.isCreatingProvider?"填写上方供应商信息后,点「添加模型」即可添加模型(将先保存供应商)。":"该供应商下还没有模型。点「添加模型」即可复用上面的端点与密钥。"),1)),e.modelDraft?(h(),b("div",Y9,[f("div",X9,[f("span",Q9,A(e.isCreatingModel?"添加模型":`编辑「${e.modelDraft.name||"未命名"}」`),1),f("button",{class:"va-model-editor__cancel",type:"button",onClick:m[8]||(m[8]=y=>o("cancel-model-edit"))}," 收起 ")]),f("div",eP,[f("div",tP,[m[33]||(m[33]=f("label",{class:"va-console__label"},"显示名称",-1)),Ve(f("input",{"onUpdate:modelValue":m[9]||(m[9]=y=>e.modelDraft.name=y),class:"va-console__input",type:"text",placeholder:"如 DeepSeek V3 生产"},null,512),[[st,e.modelDraft.name]])]),f("div",nP,[m[34]||(m[34]=f("label",{class:"va-console__label"},"模型标识 (Model ID)",-1)),f("div",oP,[s.value?Ve((h(),b("input",{key:1,"onUpdate:modelValue":m[11]||(m[11]=y=>e.modelDraft.model=y),class:"va-console__input font-mono",type:"text",placeholder:"如 deepseek-chat",list:"va-discovered-models"},null,512)),[[st,e.modelDraft.model]]):(h(),ce(p(ta),{key:0,class:"va-console__model-select","model-value":e.modelDraft.model||"",options:a.value,searchable:"",disabled:e.isDiscovering,placeholder:e.isDiscovering?"正在拉取模型列表…":a.value.length?"选择模型标识(可搜索)":"暂无候选:刷新或手动输入",label:"模型标识",invalid:!e.modelDraft.model?.trim(),"onUpdate:modelValue":m[10]||(m[10]=y=>y&&o("select-model",String(y)))},null,8,["model-value","options","disabled","placeholder","invalid"])),f("button",{class:"va-console__model-refresh-btn",type:"button",disabled:e.isDiscovering,title:"从供应商拉取可用模型列表",onClick:m[12]||(m[12]=y=>o("discover"))},[e.isDiscovering?(h(),ce(p(ui),{key:0,size:14,class:"va-console__spin"})):(h(),ce(p(Nv),{key:1,size:14}))],8,sP)]),f("button",{type:"button",class:"va-console__model-manual-toggle",onClick:r},A(s.value?"改为列表选择":"列表里没有?手动输入标识"),1),f("datalist",iP,[(h(!0),b(G,null,me(e.discoveredModels,y=>(h(),b("option",{key:y,value:y},null,8,rP))),128))])])]),f("div",aP,[f("div",lP,[j(p(bc),{size:12}),m[36]||(m[36]=pe(" 能力标记 ",-1)),m[37]||(m[37]=f("span",{class:"va-cap-block__hint"},"决定附件入口、上下文仪表等行为",-1)),e.modelDraft.id?(h(),b("button",{key:0,class:"va-console__btn-ghost va-cap-block__verify",type:"button",disabled:e.isVerifyingCapabilities,title:"按勾选能力逐项实测端点行为(产生少量真实 API 费用)",onClick:m[13]||(m[13]=y=>o("verify-capabilities"))},[e.isVerifyingCapabilities?(h(),ce(p(ui),{key:0,size:12,class:"va-console__spin"})):(h(),ce(p(Kf),{key:1,size:12})),m[35]||(m[35]=pe(" 验证能力 ",-1))],8,cP)):E("",!0)]),e.capabilityVerdicts.length?(h(),b("ul",uP,[(h(!0),b(G,null,me(e.capabilityVerdicts,y=>(h(),b("li",{key:y.capability,class:"va-cap-verdict","data-ok":y.ok===!0||void 0,"data-fail":y.ok===!1||void 0,title:y.detail},[f("span",fP,A(y.ok===!0?"✓":y.ok===!1?"✗":"?"),1),f("span",pP,A(y.capability==="image"?"图片输入":y.capability==="reasoning"?"推理档位":y.capability),1),f("span",hP,A(y.ok===!1?"端点拒绝,建议取消勾选":y.ok===null?"无法判定(鉴权/网络)":"通过"),1)],8,dP))),128))])):E("",!0),f("div",vP,[f("div",mP,[m[38]||(m[38]=f("label",{class:"va-console__label"},"上下文窗口 (tokens)",-1)),Ve(f("input",{"onUpdate:modelValue":m[14]||(m[14]=y=>e.modelDraft.contextWindow=y),class:"va-console__input font-mono",type:"number",step:"1000",placeholder:"128000"},null,512),[[st,e.modelDraft.contextWindow,void 0,{number:!0}]])]),f("div",_P,[m[39]||(m[39]=f("label",{class:"va-console__label"},"最大输出 (tokens)",-1)),Ve(f("input",{"onUpdate:modelValue":m[15]||(m[15]=y=>e.modelDraft.capabilities.maxOutputTokens=y),class:"va-console__input font-mono",type:"number",step:"1000",placeholder:"可选"},null,512),[[st,e.modelDraft.capabilities.maxOutputTokens,void 0,{number:!0}]])])]),f("div",gP,[m[41]||(m[41]=f("label",{class:"va-console__label"},"输入模态",-1)),f("div",bP,[m[40]||(m[40]=f("span",{class:"va-cap-chip va-cap-chip--locked"},"文本",-1)),(h(),b(G,null,me(l,y=>f("button",{key:y.id,class:ye(["va-cap-chip",{"va-cap-chip--on":u(y.id)}]),type:"button",onClick:x=>o("toggle-modality",y.id)},[y.id==="image"?(h(),ce(p(Vf),{key:0,size:11})):E("",!0),pe(" "+A(y.label),1)],10,yP)),64))])]),f("div",kP,[f("button",{class:ye(["va-cap-toggle",{"va-cap-toggle--on":d()}]),type:"button",onClick:m[16]||(m[16]=y=>o("toggle-reasoning"))},[j(p(bc),{size:12}),m[42]||(m[42]=f("span",null,"支持推理",-1)),d()?(h(),ce(p(ra),{key:0,size:12,class:"va-cap-toggle__check"})):E("",!0)],2),f("button",{class:ye(["va-cap-toggle",{"va-cap-toggle--on":_()}]),type:"button",onClick:m[17]||(m[17]=y=>o("toggle-tool-use"))},[j(p(aa),{size:12}),m[43]||(m[43]=f("span",null,"支持工具调用",-1)),_()?(h(),ce(p(ra),{key:0,size:12,class:"va-cap-toggle__check"})):E("",!0)],2)])]),f("div",wP,[f("div",xP,[f("label",$P,[j(p(M5),{size:12}),pe(" 默认温度 ("+A(e.modelDraft.temperature)+") ",1)]),Ve(f("input",{"onUpdate:modelValue":m[18]||(m[18]=y=>e.modelDraft.temperature=y),class:"va-console__range",type:"range",min:"0",max:"1",step:"0.05"},null,512),[[st,e.modelDraft.temperature,void 0,{number:!0}]])]),f("div",CP,[f("div",AP,[f("label",SP,[Ve(f("input",{"onUpdate:modelValue":m[19]||(m[19]=y=>e.modelDraft.isDefault=y),type:"checkbox"},null,512),[[Hc,e.modelDraft.isDefault]]),m[44]||(m[44]=f("span",null,"设为全局默认模型",-1))])])])]),f("div",RP,[f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[20]||(m[20]=y=>o("cancel-model-edit"))}," 取消 "),f("button",{class:"va-console__btn-primary",type:"button",onClick:m[21]||(m[21]=y=>o("save-model"))},A(e.isCreatingModel?"添加":"保存"),1)])])):E("",!0)]),e.testStatus?(h(),b("div",{key:0,class:ye(["va-console__test-status-box",{"va-console__test-status-box--ok":e.testStatus.ok,"va-console__test-status-box--err":!e.testStatus.ok}])},[e.testStatus.ok?(h(),ce(p(Kf),{key:0,size:14})):(h(),ce(p(m5),{key:1,size:14})),f("span",null,A(e.testStatus.message),1)],2)):E("",!0)])]),f("div",EP,[f("div",DP,[!e.isCreatingProvider&&e.currentProvider?(h(),b("button",{key:0,class:"va-console__btn-delete-profile",type:"button",onClick:m[22]||(m[22]=y=>o("delete-provider",e.currentProvider.id))},[j(p(Jf),{size:13}),m[46]||(m[46]=pe(" 删除供应商 ",-1))])):E("",!0)]),f("div",TP,[f("button",{class:"va-console__btn-ghost",disabled:e.isTestingConnection||!e.modelDraft?.model?.trim(),title:e.modelDraft?.model?.trim()?"向该模型发起最小探测(产生 1 token 费用)":"先选择或填写模型标识再测试",type:"button",onClick:m[23]||(m[23]=y=>o("test"))},[e.isTestingConnection?(h(),ce(p(ui),{key:0,size:13,class:"va-console__spin"})):(h(),ce(p(Gf),{key:1,size:13})),m[47]||(m[47]=f("span",null,"测试连通性",-1))],8,IP),f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[24]||(m[24]=y=>o("close"))},"关闭")])])]))}}),MP={class:"va-settings__panel va-settings__panel--interaction"},OP={class:"va-settings__section"},PP={class:"va-settings__toggle-list"},LP={class:"va-settings__toggle-text"},BP={class:"va-settings__toggle-title"},jP={class:"va-settings__toggle-desc"},NP=["aria-checked","aria-label","onClick"],UP=Ce({__name:"InteractionPanel",setup(e){const{settings:t,updateSetting:n}=Fa();function o(s){n(s,!t.value[s])}return(s,i)=>(h(),b("div",MP,[f("div",OP,[i[1]||(i[1]=f("div",null,[f("div",{class:"va-settings__section-title"},"会话交互与侧栏内容"),f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 对话折叠行为与右侧边栏的内容显隐,修改即时生效并本地记忆 ")],-1)),f("div",PP,[(h(!0),b(G,null,me(p(gT),r=>(h(),b("div",{key:r.key,class:"va-settings__toggle-row"},[f("div",LP,[f("span",BP,A(r.title),1),f("span",jP,A(r.description),1)]),f("button",{class:ye(["va-settings__switch",{"va-settings__switch--on":p(t)[r.key]}]),type:"button",role:"switch","aria-checked":p(t)[r.key],"aria-label":r.title,onClick:a=>o(r.key)},[...i[0]||(i[0]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,NP)]))),128))])])]))}}),zP={class:"va-settings__panel va-settings__panel--tools"},KP={key:0,class:"va-settings__tools-error"},WP={key:1,class:"va-settings__tools-loading"},VP={key:2,class:"va-settings__tools-loading"},qP={key:3,class:"va-settings__section"},HP={class:"va-settings__tool-filter-tabs"},JP={key:0,class:"va-settings__group-block"},GP={class:"va-settings__section-title"},ZP={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},YP={class:"va-settings__toggle-text"},XP={class:"va-settings__tool-headline"},QP={class:"va-settings__toggle-title"},e7={key:0,class:"va-settings__tool-write"},t7=["title"],n7=["aria-checked","aria-label","onClick"],o7={key:1,class:"va-settings__group-block",style:{"margin-top":"14px"}},s7={class:"va-settings__section-title"},i7={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},r7={class:"va-settings__toggle-text"},a7={class:"va-settings__tool-headline"},l7={class:"va-settings__toggle-title",style:{"font-family":"var(--va-font-mono, monospace)"}},c7={key:0,class:"va-settings__approval-badge",title:"调用此工具前将强制弹出 HITL 人工审批卡"},u7=["title"],d7=["aria-checked","aria-label","onClick"],f7={key:2,class:"va-settings__group-block",style:{"margin-top":"14px"}},p7={class:"va-settings__section-title"},h7={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},v7={class:"va-settings__toggle-text"},m7={class:"va-settings__tool-headline"},_7={class:"va-settings__toggle-title",style:{"font-family":"var(--va-font-mono, monospace)"}},g7={key:0,class:"va-settings__scene-ready",title:"前端 CardRegistry 已注册对应渲染器"},b7={key:1,class:"va-settings__scene-unbound",title:"前端未注册对应组件,将使用优雅降级容器渲染"},y7=["title"],k7=["aria-checked","aria-label","onClick"],w7=Ce({__name:"ToolsPanel",props:{tools:{},loading:{type:Boolean},loadError:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,o=t,s=P("all"),i=T(()=>n.tools.filter(c=>c.source==="builtin"||!c.source)),r=T(()=>n.tools.filter(c=>c.source==="custom")),a=T(()=>n.tools.filter(c=>c.source==="ui_component"));function l(c){return!!av(c)}return(c,u)=>(h(),b("div",zP,[e.loadError?(h(),b("p",KP,A(e.loadError),1)):e.loading?(h(),b("p",WP,"正在加载工具清单…")):e.tools.length===0?(h(),b("p",VP," 服务端暂无已注册工具 ")):(h(),b("div",qP,[f("div",HP,[f("button",{type:"button",class:ye(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":s.value==="all"}]),onClick:u[0]||(u[0]=d=>s.value="all")}," 全部 ("+A(e.tools.length)+") ",3),f("button",{type:"button",class:ye(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":s.value==="builtin"}]),onClick:u[1]||(u[1]=d=>s.value="builtin")},[j(p(aa),{size:12,style:{"vertical-align":"-1px","margin-right":"3px"}}),pe(" 系统基础 ("+A(i.value.length)+") ",1)],2),r.value.length>0?(h(),b("button",{key:0,type:"button",class:ye(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":s.value==="custom"}]),onClick:u[2]||(u[2]=d=>s.value="custom")},[j(p(zf),{size:12,style:{"vertical-align":"-1px","margin-right":"3px",color:"#0284c7"}}),pe(" 业务动作 ("+A(r.value.length)+") ",1)],2)):E("",!0),a.value.length>0?(h(),b("button",{key:1,type:"button",class:ye(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":s.value==="scene"}]),onClick:u[3]||(u[3]=d=>s.value="scene")},[j(p(qf),{size:12,style:{"vertical-align":"-1px","margin-right":"3px",color:"#7e22ce"}}),pe(" 场景组件 ("+A(a.value.length)+") ",1)],2)):E("",!0)]),s.value==="all"||s.value==="builtin"?(h(),b("div",JP,[f("div",null,[f("div",GP,[j(p(aa),{size:14,style:{"vertical-align":"-2px","margin-right":"4px"}}),u[4]||(u[4]=pe(" 内置系统基础工具 ",-1))]),u[5]||(u[5]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 底层文件读写、沙箱命令执行与文件检索工具。停用后 Agent 本轮起不再调用。 ",-1))]),f("div",ZP,[(h(!0),b(G,null,me(i.value,d=>(h(),b("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",YP,[f("div",XP,[f("span",QP,A(d.name),1),f("span",{class:ye(["va-settings__tool-badge",p(ws)(d.riskLevel).className])},A(p(ws)(d.riskLevel).label),3),d.writesWorkspace?(h(),b("span",e7,"写")):E("",!0)]),f("span",{class:"va-settings__toggle-desc",title:d.description},A(d.description),9,t7)]),f("button",{class:ye(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>o("toggle",d)},[...u[6]||(u[6]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,n7)]))),128))])])):E("",!0),(s.value==="all"||s.value==="custom")&&r.value.length>0?(h(),b("div",o7,[f("div",null,[f("div",s7,[j(p(zf),{size:14,style:{"vertical-align":"-2px","margin-right":"4px",color:"#0284c7"}}),u[7]||(u[7]=pe(" 业务扩展工具 (Custom Action Tools) ",-1))]),u[8]||(u[8]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 纯数据、逻辑与动作型业务扩展(数据库查询、Git 探针、CI 触发等)。执行结果直接作为上下文喂回大模型继续思考,高危操作可触发人工审批。 ",-1))]),f("div",i7,[(h(!0),b(G,null,me(r.value,d=>(h(),b("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",r7,[f("div",a7,[f("span",l7,A(d.name),1),u[10]||(u[10]=f("span",{class:"va-settings__custom-badge"},"业务工具",-1)),f("span",{class:ye(["va-settings__tool-badge",p(ws)(d.riskLevel).className])},A(p(ws)(d.riskLevel).label),3),d.requiresApproval?(h(),b("span",c7,[j(p(I5),{size:10,style:{"vertical-align":"-1px","margin-right":"2px"}}),u[9]||(u[9]=pe(" 人工审批 ",-1))])):E("",!0)]),f("span",{class:"va-settings__toggle-desc",title:d.description},A(d.description),9,u7)]),f("button",{class:ye(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>o("toggle",d)},[...u[11]||(u[11]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,d7)]))),128))])])):E("",!0),(s.value==="all"||s.value==="scene")&&a.value.length>0?(h(),b("div",f7,[f("div",null,[f("div",p7,[j(p(qf),{size:14,style:{"vertical-align":"-2px","margin-right":"4px",color:"#7e22ce"}}),u[12]||(u[12]=pe(" 场景组件工具 (Generative UI) ",-1))]),u[13]||(u[13]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 由 UIComponentRegistry 开放注册的特定业务场景可视化卡片。模型按需输出参数,前端同名组件动态挂载渲染。 ",-1))]),f("div",h7,[(h(!0),b(G,null,me(a.value,d=>(h(),b("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",v7,[f("div",m7,[f("span",_7,A(d.name),1),u[14]||(u[14]=f("span",{class:"va-settings__scene-badge"},"场景组件",-1)),l(d.name)?(h(),b("span",g7," ✨ 前端已就绪 ")):(h(),b("span",b7," 未绑定组件 "))]),f("span",{class:"va-settings__toggle-desc",title:d.description},A(d.description),9,y7)]),f("button",{class:ye(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>o("toggle",d)},[...u[15]||(u[15]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,k7)]))),128))])])):E("",!0)]))]))}}),x7={class:"va-settings__panel va-settings__panel--config"},$7={class:"va-settings__section"},C7={class:"va-settings__section-title"},A7={class:"va-console__modal-sub",style:{"margin-top":"2px"}},S7={key:0,class:"va-settings__tools-error"},R7={key:1,class:"va-settings__tools-loading"},E7={key:2,class:"va-settings__tools-loading"},D7={key:3,class:"va-settings__toggle-list"},T7={class:"va-settings__toggle-text"},I7={class:"va-settings__tool-headline"},F7={class:"va-settings__toggle-title"},M7=["title"],O7={class:"va-settings__toggle-desc"},P7={key:0,class:"va-settings__toggle-desc va-settings__config-lock-note"},L7=["aria-checked","aria-label","disabled","onClick"],B7=["value","min","max","disabled","aria-label","onInput","onChange"],j7=["value","maxlength","disabled","aria-label","onInput","onChange"],N7=["value","maxlength","disabled","aria-label","onInput","onChange"],U7={key:4,class:"va-settings__config-footer"},Mr=Ce({__name:"ConfigPanel",props:{namespace:{},loading:{type:Boolean},loadError:{}},emits:["patch","reset"],setup(e,{emit:t}){const n=e,o=t;function s(v){return n.namespace?.values?.[v.key]??v.default}const i=mn({});function r(v){return i[v.key]??String(s(v)??"")}function a(v,g){i[v.key]=g.target.value}const l=mn({});Ee(()=>n.namespace?.values,v=>{if(v){for(const[g,m]of Object.entries(i)){const y=String(v[g]??"");(y===m||y!==(l[g]??""))&&delete i[g]}for(const g of Object.keys(l))delete l[g];for(const[g,m]of Object.entries(v))l[g]=String(m??"")}},{deep:!0,immediate:!0}),Ee(()=>n.namespace?.isDefault,v=>{if(v)for(const g of Object.keys(i))delete i[g]});function c(v,g){const m=g.target;if(m.value.trim()===""){delete i[v.key],m.value=String(s(v));return}const y=Number(m.value);if(!Number.isFinite(y)){delete i[v.key],m.value=String(s(v));return}let x=y;v.min!==void 0&&(x=Math.max(v.min,x)),v.max!==void 0&&(x=Math.min(v.max,x)),x!==y&&(De.add({title:"已按取值范围钳制",description:`${v.title} 允许范围 ${v.min??"-∞"} ~ ${v.max??"+∞"},已调整为 ${x}`,kind:"warning"}),m.value=String(x)),i[v.key]=String(x),x!==s(v)&&o("patch",v.key,x)}function u(v,g){const y=g.target.value;y!==s(v)?o("patch",v.key,y):delete i[v.key]}function d(v,g){const m=Array.isArray(g)?String(g[0]??""):String(g);m!==s(v)&&o("patch",v.key,m)}function _(v){v.locked||o("patch",v.key,!s(v))}return(v,g)=>(h(),b("div",x7,[f("div",$7,[f("div",null,[f("div",C7,A(e.namespace?.title??""),1),f("p",A7,A(e.namespace?.description??"")+";修改即时生效并由服务端持久化 ",1)]),e.loadError?(h(),b("p",S7,A(e.loadError),1)):e.loading?(h(),b("p",R7,"正在加载配置…")):e.namespace?(h(),b("div",D7,[(h(!0),b(G,null,me(e.namespace.fields,m=>(h(),b("div",{key:m.key,class:"va-settings__toggle-row"},[f("div",T7,[f("div",I7,[f("span",F7,A(m.title),1),m.risk?(h(),b("span",{key:0,class:ye(["va-settings__tool-badge",p(ws)(m.risk).className])},A(p(ws)(m.risk).label),3)):E("",!0),m.locked?(h(),b("span",{key:1,class:"va-settings__config-lock",title:`由环境变量 ${m.envLock} 锁定`},[j(p(A5),{size:12}),g[1]||(g[1]=pe(" env 锁定 ",-1))],8,M7)):E("",!0)]),f("span",O7,A(m.description),1),m.locked?(h(),b("span",P7," 由环境变量 "+A(m.envLock)+" 显式设置锁定(部署级),不可在此修改 ",1)):E("",!0)]),m.type==="boolean"?(h(),b("button",{key:0,class:ye(["va-settings__switch",{"va-settings__switch--on":s(m)===!0}]),type:"button",role:"switch","aria-checked":s(m)===!0,"aria-label":m.title,disabled:m.locked,onClick:y=>_(m)},[...g[2]||(g[2]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,L7)):m.type==="number"?(h(),b("input",{key:1,class:"va-console__input va-settings__config-input",type:"number",value:r(m),min:m.min,max:m.max,disabled:m.locked,"aria-label":m.title,onInput:y=>a(m,y),onChange:y=>c(m,y)},null,40,B7)):m.type==="text"?(h(),b("textarea",{key:2,class:"va-console__input va-settings__config-textarea",value:r(m),maxlength:m.maxLength,disabled:m.locked,"aria-label":m.title,rows:"4",onInput:y=>a(m,y),onChange:y=>u(m,y)},null,40,j7)):m.type==="select"?(h(),ce(p(ta),{key:3,size:"sm","model-value":String(s(m)??""),options:m.options??[],disabled:m.locked,label:m.title,"onUpdate:modelValue":y=>d(m,y)},null,8,["model-value","options","disabled","label","onUpdate:modelValue"])):(h(),b("input",{key:4,class:"va-console__input va-settings__config-input",type:"text",value:r(m),maxlength:m.maxLength,disabled:m.locked,"aria-label":m.title,onInput:y=>a(m,y),onChange:y=>u(m,y)},null,40,N7))]))),128))])):(h(),b("p",E7,"配置不可用")),e.namespace&&!e.namespace.isDefault?(h(),b("div",U7,[f("button",{class:"va-console__btn-add-profile va-settings__config-reset",type:"button",onClick:g[0]||(g[0]=m=>o("reset"))},[j(p(E5),{size:13,style:{"vertical-align":"-2px","margin-right":"4px"}}),g[3]||(g[3]=pe(" 恢复默认 ",-1))])])):E("",!0)])]))}});function z7(e){return e.autoCollapseThought===!0}function mp(e){return e.autoCollapseThought===!0&&e.autoCollapseToolCards===!0}function K7(e,t){return e.autoCollapseToolCards?t.status==="error"?!1:t.turnStreaming:t.status==="streaming"}const W7={class:"va-console__card-item"},V7={key:9,class:"va-custom-card-fallback",style:{padding:"10px 14px",border:"1px dashed var(--va-color-border, #cbd5e1)","border-radius":"8px","font-size":"13px",margin:"4px 0"}},q7={style:{"font-weight":"600","margin-bottom":"4px",color:"var(--va-color-text-subtle, #64748b)"}},H7={style:{margin:"0","font-size":"11px","overflow-x":"auto","max-height":"160px",background:"var(--va-color-bg-subtle, #f8fafc)",padding:"8px","border-radius":"4px"}},J7=Ce({__name:"CardRenderer",props:{card:{},turnStreaming:{type:Boolean}},emits:["approve","deny"],setup(e){const t=e,n=T(()=>{const x=t.card.data?.status;return x==="error"?"error":x==="done"?"success":"running"}),o=T(()=>{const x=t.card.data?.status;return x==="streaming"?"生成调用参数中…":x==="executing"?"沙箱执行中…":x==="error"?"执行失败":"执行完成"}),{settings:s}=Fa(),i=T(()=>K7(s.value,{turnStreaming:t.turnStreaming,status:t.card.data?.status})),r=T(()=>{const x=t.card.data?.status;if(x==="approved"||x==="denied")return;const $=t.card.data?.expiresAt;return typeof $=="number"&&$>0?Math.max(1,Math.ceil(($-Date.now())/1e3)):t.card.data?.expiresInSec}),a=new Set(["ui_code_diff","ui_metric_chart","ui_file_tree","ui_trajectory","ui_task_board","ui_change_summary","ui_comment_thread","ui_ai_answer"]),l=T(()=>t.card.data?.props||{}),c=T(()=>String(t.card.data?.component||"")),u=T(()=>a.has(c.value)),d=T(()=>av(c.value)),_=P({}),v=T(()=>{const x=t.card.data?.formArgs?.fields;return Array.isArray(x)?x:[]}),g=P(!1),m=async(x,$)=>{if(!g.value){_.value={},g.value=!0;try{const w=await Qf(t.card.data.actionId,{kind:"submit",values:x,meta:{editedFields:$}});w.ok?t.card.data.status="done":w.fieldErrors?_.value=w.fieldErrors:De.add({title:`表单提交失败(HTTP ${w.status})`,description:"请稍后重试;若持续失败请查看服务端日志",kind:"warning"})}catch(w){De.add({title:"表单提交网络异常",description:w instanceof Error?w.message:String(w),kind:"warning"})}finally{g.value=!1}}},y=async()=>{if(!g.value){_.value={},g.value=!0;try{const x=await Qf(t.card.data.actionId,{kind:"cancel"});x.ok?t.card.data.status="done":De.add({title:`取消失败(HTTP ${x.status})`,description:"请稍后重试",kind:"warning"})}catch(x){De.add({title:"取消请求网络异常",description:x instanceof Error?x.message:String(x),kind:"warning"})}finally{g.value=!1}}};return(x,$)=>(h(),b("div",W7,[e.card.type==="ui"?(h(),b(G,{key:0},[d.value?(h(),ce(Uc(d.value),X_(Fh({key:0},l.value)),null,16)):u.value&&c.value==="ui_code_diff"?(h(),ce(p(ef),{key:1,"file-name":l.value.fileName,"old-text":l.value.oldText,"new-text":l.value.newText,layout:l.value.layout||"unified","max-height":l.value.maxHeight},null,8,["file-name","old-text","new-text","layout","max-height"])):u.value&&c.value==="ui_metric_chart"?(h(),ce(p(Wd),{key:2,title:l.value.title,series:l.value.series},null,8,["title","series"])):u.value&&c.value==="ui_file_tree"?(h(),ce(p(fc),{key:3,title:l.value.title,tree:l.value.tree,"default-expand-depth":l.value.defaultExpandDepth},null,8,["title","tree","default-expand-depth"])):u.value&&c.value==="ui_trajectory"?(h(),ce(p(cc),{key:4,events:l.value.events,"ledger-max-height":l.value.ledgerMaxHeight},null,8,["events","ledger-max-height"])):u.value&&c.value==="ui_task_board"?(h(),ce(p(vR),{key:5,columns:l.value.columns,tasks:l.value.tasks},null,8,["columns","tasks"])):u.value&&c.value==="ui_change_summary"?(h(),ce(p(f3),{key:6,title:l.value.title,files:l.value.files,duration:l.value.duration,"tool-calls":l.value.toolCalls,"finished-at":l.value.finishedAt},null,8,["title","files","duration","tool-calls","finished-at"])):u.value&&c.value==="ui_comment_thread"?(h(),ce(p(rC),{key:7,comments:l.value.comments,"max-height":l.value.maxHeight,composer:!1},null,8,["comments","max-height"])):u.value&&c.value==="ui_ai_answer"?(h(),ce(p(F3),{key:8,question:l.value.question,answer:l.value.answer,sources:l.value.sources},null,8,["question","answer","sources"])):(h(),b("div",V7,[f("div",q7,"[场景组件: "+A(c.value)+"]",1),f("pre",H7,A(JSON.stringify(l.value,null,2)),1)]))],64)):e.card.type==="toolcall"?(h(),ce(p(rb),{key:1,name:e.card.data.toolName,summary:o.value,status:n.value,args:e.card.data.args,result:e.card.data.result,error:e.card.data.error,"started-at":e.card.data.startedAt,duration:e.card.data.duration,"default-open":i.value,"open-on-error":!0},null,8,["name","summary","status","args","result","error","started-at","duration","default-open"])):E("",!0),e.card.type==="approval"?(h(),ce(p(jb),{key:2,title:e.card.data.title||`申请执行: ${e.card.data.toolName||"工具"}`,risk:e.card.data.risk,preview:e.card.data.command,detail:e.card.data.detail,status:e.card.data.status||"pending",reason:e.card.data.reason,countdown:r.value,collapsible:!0,"default-collapsed":e.card.data.status==="approved"||e.card.data.status==="denied",onApprove:$[0]||($[0]=w=>x.$emit("approve")),onDeny:$[1]||($[1]=w=>x.$emit("deny",w))},null,8,["title","risk","preview","detail","status","reason","countdown","default-collapsed"])):e.card.type==="form"?(h(),ce(p(Q3),{key:3,title:e.card.data.formArgs?.title,description:e.card.data.formArgs?.description,fields:v.value,"submit-label":e.card.data.formArgs?.submitLabel,disabled:e.card.data.status!=="pending",loading:g.value,"field-errors":_.value,onSubmit:m,onCancel:y},o1({_:2},[e.card.data.status==="timeout"?{name:"after-actions",fn:we(()=>[$[2]||($[2]=f("p",{class:"va-console__form-note"},"⏱ 表单已超时关闭(按用户放弃处理,可在对话中重新发起)",-1))]),key:"0"}:e.card.data.status==="done"?{name:"after-actions",fn:we(()=>[$[3]||($[3]=f("p",{class:"va-console__form-note"},"✅ 表单已提交,agent 正在继续执行",-1))]),key:"1"}:void 0]),1032,["title","description","fields","submit-label","disabled","loading","field-errors"])):e.card.type==="diff"?(h(),ce(p(ef),{key:4,"file-name":e.card.data.file,"old-text":e.card.data.oldCode,"new-text":e.card.data.newCode,layout:e.card.data.view||"unified"},null,8,["file-name","old-text","new-text","layout"])):e.card.type==="terminal"?(h(),ce(p(W$),{key:5,title:e.card.data.title,lines:e.card.data.lines},null,8,["title","lines"])):e.card.type==="metric"?(h(),ce(p(Wd),{key:6,title:e.card.data.title,series:e.card.data.series},null,8,["title","series"])):e.card.type==="tree"?(h(),ce(p(fc),{key:7,title:e.card.data.title,tree:e.card.data.tree,"default-expand-depth":e.card.data.defaultExpandDepth},null,8,["title","tree","default-expand-depth"])):e.card.type==="trajectory"?(h(),ce(p(cc),{key:8,events:e.card.data.events,"ledger-max-height":e.card.data.ledgerMaxHeight},null,8,["events","ledger-max-height"])):E("",!0)]))}}),G7={class:"va-console__assistant-turn"},Z7={class:"va-console__agent-avatar"},Y7={class:"va-console__turn-body"},X7={key:0,class:"va-console__markdown-content"},Q7={key:1,class:"va-console__action-cards"},eL={key:2,class:"va-console__streaming-indicator"},tL=["title"],nL=Ce({__name:"AssistantTurn",props:{turn:{}},emits:["approve","deny","regenerate","feedback"],setup(e){const t=e,n=T(()=>{switch(t.turn.abortedReason){case"user":return"手动停止";case"timeout":return"看门狗超时";case"preempt":return"被新请求顶替";case"process_restart":return"服务重启中断";case"token_budget":return"token 预算熔断";default:return""}}),{settings:o}=Fa(),s=P(!1),i=P(null),r=T(()=>!!t.turn.thought||(t.turn.cards||[]).some(u=>u.type==="toolcall")),a=T(()=>(t.turn.cards||[]).filter(u=>u.type==="toolcall").length);Ee(()=>t.turn.isStreaming,(u,d)=>{d!==!0||u!==!1||(z7(o.value)&&(t.turn.thoughtExpanded=!1),mp(o.value)&&r.value&&(i.value=Math.round((Date.now()-t.turn.timestamp)/100)/10,s.value=!0))}),Ct(()=>{!t.turn.isStreaming&&r.value&&mp(o.value)&&(s.value=!0)});const l=T(()=>{const u={};for(const d of t.turn.cards||[])u[d.id]=d;return u}),c=T(()=>{const u=t.turn;if(u.blocks&&u.blocks.length)return u.blocks;const d=[];u.content&&d.push({kind:"text",content:u.content});for(const _ of u.cards||[])d.push({kind:"card",cardId:_.id});return d});return(u,d)=>(h(),b("div",G7,[f("div",Z7,[j(p(v5),{size:18})]),f("div",Y7,[r.value||e.turn.isStreaming&&!e.turn.content?(h(),ce(p(o5),{key:0,thought:e.turn.thought,expanded:e.turn.thoughtExpanded,duration:i.value??e.turn.thoughtDuration,streaming:e.turn.isStreaming&&!e.turn.content,"summary-mode":s.value,"tool-count":a.value,"onUpdate:expanded":d[0]||(d[0]=_=>e.turn.thoughtExpanded=_),"onUpdate:summaryMode":d[1]||(d[1]=_=>s.value=_)},null,8,["thought","expanded","duration","streaming","summary-mode","tool-count"])):E("",!0),(h(!0),b(G,null,me(c.value,(_,v)=>(h(),b(G,{key:`${_.kind}-${v}`},[_.kind==="text"&&_.content?(h(),b("div",X7,[j(p(YE),{content:_.content,streaming:e.turn.isStreaming&&v===c.value.length-1},null,8,["content","streaming"])])):!s.value&&_.kind==="card"&&l.value[_.cardId]?(h(),b("div",Q7,[j(J7,{card:l.value[_.cardId],"turn-streaming":e.turn.isStreaming,onApprove:g=>u.$emit("approve",l.value[_.cardId].data.actionId),onDeny:g=>u.$emit("deny",l.value[_.cardId].data.actionId,g)},null,8,["card","turn-streaming","onApprove","onDeny"])])):E("",!0)],64))),128)),!e.turn.isStreaming&&e.turn.content?(h(),ce(p(Cx),{key:1,text:e.turn.content,quiet:"",class:"va-console__message-actions",onRegenerate:d[2]||(d[2]=_=>u.$emit("regenerate",e.turn.id)),onFeedback:d[3]||(d[3]=(_,v)=>u.$emit("feedback",_,v))},null,8,["text"])):E("",!0),e.turn.isStreaming?(h(),b("div",eL,[...d[4]||(d[4]=[f("span",{class:"va-console__cursor-dot"},null,-1),f("span",null,"Agent 正在分析中…",-1)])])):E("",!0),e.turn.abortedReason?(h(),b("div",{key:3,class:"va-console__abort-badge",title:`中止成因:${n.value}`},[d[5]||(d[5]=pe(" ⏹ 任务已中止",-1)),n.value?(h(),b(G,{key:0},[pe("("+A(n.value)+")",1)],64)):E("",!0)],8,tL)):E("",!0)])]))}}),oL=["data-turn-id"],sL={class:"va-console__user-bubble-container"},iL={class:"va-console__user-bubble"},rL={key:0,class:"va-console__user-atts"},aL=["href","title"],lL=["src","alt"],cL=["title"],uL={class:"va-console__user-text"},dL={class:"va-console__user-avatar"},fL=["data-turn-id"],pL=Ce({__name:"TurnList",props:{turns:{}},emits:["approve","deny","regenerate","feedback"],setup(e){return(t,n)=>(h(!0),b(G,null,me(e.turns,o=>(h(),b(G,{key:o.id},[o.role==="user"?(h(),b("div",{key:0,class:"va-console__turn-row","data-turn-id":o.id},[f("div",sL,[f("div",iL,[o.attachments?.length?(h(),b("div",rL,[(h(!0),b(G,null,me(o.attachments,(s,i)=>(h(),b(G,{key:`${s.name}:${s.size}:${i}`},[s.kind==="image"&&s.dataUrl?(h(),b("a",{key:0,href:s.dataUrl,target:"_blank",rel:"noopener",class:"va-console__user-att-img-link",title:`${s.name}(点击新窗口查看原图)`},[f("img",{src:s.dataUrl,alt:s.name,class:"va-console__user-att-img"},null,8,lL)],8,aL)):(h(),b("span",{key:1,class:"va-console__user-att-chip",title:s.size?`${s.name} · ${s.size} B`:s.name},A(s.kind==="image"?`[图] ${s.name}`:`[附件] ${s.name}`),9,cL))],64))),128))])):E("",!0),f("p",uL,A(o.content),1)]),f("div",dL,[j(p(O5),{size:16})])])],8,oL)):(h(),b("div",{key:1,class:"va-console__turn-row","data-turn-id":o.id},[j(nL,{turn:o,onApprove:n[0]||(n[0]=s=>t.$emit("approve",s)),onDeny:n[1]||(n[1]=(s,i)=>t.$emit("deny",s,i)),onRegenerate:n[2]||(n[2]=s=>t.$emit("regenerate",s)),onFeedback:n[3]||(n[3]=(s,i)=>t.$emit("feedback",s,i))},null,8,["turn"])],8,fL))],64))),128))}}),hL=["aria-label"],vL={class:"va-console__seat-text"},mL={class:"va-console__effort-menu",role:"menu","aria-label":"推理档位"},_L=["data-active","onClick"],gL={key:1,class:"va-console__effort-gap","aria-hidden":"true"},_p=Ce({__name:"ReasoningEffortMenu",props:{options:{},modelValue:{}},emits:["select"],setup(e,{emit:t}){const n=t;return(o,s)=>(h(),ce(p(ho),{placement:"top-start",offset:8},{trigger:we(()=>[f("button",{class:"va-console__seat-btn",type:"button","aria-label":`推理档位(当前 ${e.modelValue})`},[j(p(bc),{size:12,"aria-hidden":"true"}),f("span",vL,"思考: "+A(e.modelValue),1),j(p(Bi),{size:11,"aria-hidden":"true"})],8,hL)]),default:we(({close:i})=>[f("div",mL,[(h(!0),b(G,null,me(e.options,r=>(h(),b("button",{key:r,class:"va-console__effort-item",type:"button",role:"menuitem","data-active":r===e.modelValue||void 0,onClick:a=>{n("select",r),i()}},[r===e.modelValue?(h(),ce(p(ra),{key:0,size:13,"aria-hidden":"true"})):(h(),b("span",gL)),f("span",null,A(r),1)],8,_L))),128))])]),_:1}))}});function Km(e,t,n,o){return new Promise(s=>{const i=new FileReader;i.onload=()=>{if(o.has(e)){const r=/^data:([^;]+);base64,(.+)$/.exec(String(i.result??""));r&&n.set(e,{name:t.name,mediaType:r[1],data:r[2]}),o.delete(e)}s()},i.onerror=()=>{o.delete(e),s()},i.readAsDataURL(t)})}function bL(e){if(e.atts.length===0)return;const t={atts:[...e.atts],texts:new Map,images:new Map,files:new Map};for(const n of e.atts){const o=e.texts.get(n.id);o!==void 0&&(t.texts.set(n.id,o),e.texts.delete(n.id));const s=e.images.get(n.id);s&&(t.images.set(n.id,s),e.images.delete(n.id));const i=e.files.get(n.id);i&&(t.files.set(n.id,i),e.files.delete(n.id))}return t}function gp(e){const t=e.atts.filter(o=>o.kind!=="image");if(t.length===0)return"";const n=[];for(const o of t){const s=e.texts.get(o.id);n.push(s?`---
|
|
33
|
+
[${o.name}]
|
|
34
|
+
${s}
|
|
35
|
+
---`:`[附件] ${o.name}(文件)`)}return n.join(`
|
|
36
|
+
|
|
37
|
+
`)+`
|
|
38
|
+
|
|
39
|
+
`}function yL(e){return e.atts.map(t=>{const n=t.size??0;if(t.kind!=="image")return{name:t.name,kind:"file",size:n};const o=e.images.get(t.id);return{name:t.name,kind:"image",size:n,...o?{dataUrl:`data:${o.mediaType};base64,${o.data}`}:{}}})}async function kL(e){const t=e.atts.filter(o=>o.kind==="image");if(t.length===0)return;await Promise.all(t.filter(o=>!e.images.has(o.id)&&e.files.has(o.id)).map(o=>Km(o.id,e.files.get(o.id),e.images,e.files)));const n=t.map(o=>e.images.get(o.id)).filter(o=>!!o);return n.length>0?n:void 0}function Wl(e){for(const t of e.atts)t.previewUrl&&URL.revokeObjectURL(t.previewUrl),e.texts.delete(t.id),e.images.delete(t.id),e.files.delete(t.id)}function wL(e){function t(o,s,i,r){for(const a of o){if(!a.cards)continue;const l=a.cards.find(c=>c.data?.actionId===s||c.id===s||c.id===`approval-${s}`);l&&(l.data.status=i?"approved":"denied",l.data.reason=r)}}async function n(o,s,i){let r=!1;try{r=await TD(o,{approved:s,note:i})}catch(a){console.error("提交审批失败:",a);return}if(r){t(e.chatTurns.value,o,s,i);for(const[,a]of e.sessionTurnsCache.entries())t(a,o,s,i)}}return{submitApproval:n}}function xL(e){const t=P([]),n=P(!1),o=P("");async function s(){n.value=!0,o.value="";try{const v=await RD();if(v===null){o.value="工具清单加载失败,请检查服务端连接后重试";return}t.value=v}catch(v){console.error("拉取工具清单失败:",v),o.value="工具清单加载失败,请检查服务端连接后重试"}finally{n.value=!1}}async function i(v){const g=!v.enabled,m=v.enabled;v.enabled=g;try{const y=await ED(v.name,g);if(!y){v.enabled=m,De.add({title:"工具启停保存失败",description:`${v.name} 的状态未能持久化,已恢复原状态`,kind:"danger"});return}v.enabled=y.enabled,De.add({title:y.enabled?`已启用 ${v.name}`:`已停用 ${v.name}`,kind:"success"})}catch(y){v.enabled=m,console.error("工具启停提交失败:",y),De.add({title:"工具启停保存失败",description:y instanceof Error?y.message:String(y),kind:"danger"})}}const r=P([]),a=P(!1),l=P("");function c(v){return r.value.find(g=>g.id===v)??null}async function u(){a.value=!0,l.value="";try{const v=await Kv();if(v===null){l.value="配置加载失败,请检查服务端连接后重试";return}r.value=v.namespaces;const g=c("security")?.values?.defaultPermissionMode;typeof g=="string"&&g&&(e.defaultPermission.value=g,e.isNewChat.value&&(e.activePermission.value=g))}catch(v){console.error("拉取配置中心失败:",v),l.value="配置加载失败,请检查服务端连接后重试"}finally{a.value=!1}}async function d(v,g,m){const y=c(v);if(!y)return;const x=y.values[g];y.values[g]=m;try{const $=await AD(v,{[g]:m});if(!$){y.values[g]=x,De.add({title:"配置保存失败",description:"服务端拒绝了本次修改(字段可能被 env 锁定),已恢复原值",kind:"danger"});return}y.values=$.values,y.isDefault=!1,v==="security"&&typeof $.values.defaultPermissionMode=="string"&&(e.defaultPermission.value=$.values.defaultPermissionMode)}catch($){y.values[g]=x,console.error("配置提交失败:",$),De.add({title:"配置保存失败",description:$ instanceof Error?$.message:String($),kind:"danger"})}}async function _(v){const g=c(v);if(g)try{const m=await SD(v);if(!m){De.add({title:"恢复默认失败",description:"请检查服务端连接后重试",kind:"danger"});return}g.values=m.values,g.isDefault=!0,v==="security"&&typeof m.values.defaultPermissionMode=="string"&&(e.defaultPermission.value=m.values.defaultPermissionMode),De.add({title:`已恢复「${g.title}」默认配置`,kind:"success"})}catch(m){console.error("配置 reset 失败:",m),De.add({title:"恢复默认失败",description:m instanceof Error?m.message:String(m),kind:"danger"})}}return{tools:t,toolsLoading:n,toolsError:o,fetchTools:s,onToggleTool:i,configNamespaces:r,configLoading:a,configError:l,configNs:c,fetchConfig:u,onConfigPatch:d,onConfigReset:_}}function Wm(e){return e.cards=e.cards||[],e.cards}function $L(e,t){const n=Wm(e),o=n.find(s=>s.id===t.id);return o||(n.push(t),t)}function bp(e,t){if(!t)return;e.blocks||(e.blocks=[]);const n=e.blocks[e.blocks.length-1];n&&n.kind==="text"?n.content+=t:e.blocks.push({kind:"text",content:t})}function Sc(e,t){e.blocks||(e.blocks=[]),!e.blocks.some(n=>n.kind==="card"&&n.cardId===t)&&e.blocks.push({kind:"card",cardId:t})}function Kn(e,t){const n=$L(e,t);return Sc(e,n.id),n}function CL(e,t,n,o){const s=t;if(!s||typeof s!="object"||!s.component)return;const i=s.props||{};switch(s.component){case"ui_code_diff":Kn(e,{id:`diff-${n}`,type:"diff",data:{file:i.fileName||"untitled.ts",oldCode:i.oldText||"",newCode:i.newText||"",view:i.layout||"unified"}});break;case"ui_metric_chart":Kn(e,{id:`metric-${n}`,type:"metric",data:{title:i.title||"指标图表",series:Array.isArray(i.series)?i.series:[]}});break;case"ui_agent_plan":Array.isArray(i.steps)&&o.setPlanSteps(i.steps);break;case"ui_file_tree":Kn(e,{id:`tree-${n}`,type:"tree",data:{title:i.title,tree:Array.isArray(i.tree)?i.tree:[],defaultExpandDepth:i.defaultExpandDepth}});break;case"ui_trajectory":Kn(e,{id:`traj-${n}`,type:"trajectory",data:{events:Array.isArray(i.events)?i.events:[],ledgerMaxHeight:i.ledgerMaxHeight}});break;case"ui_approval_card":break;default:Kn(e,{id:`ui-${n}`,type:"ui",data:{component:s.component,props:i}});break}}function AL(e,t){const n=t.seq;typeof n=="number"&&(e.lastSeq=n)}function yp(e,t,n,o){switch(t.type){case"turn_start":e.isStreaming=!0;break;case"aborted":e.abortedReason=t.reason,e.isStreaming=!1;break;case"text_delta":e.content+=t.delta||"",bp(e,t.delta||"");break;case"thought_delta":e.thought=(e.thought||"")+(t.delta||"");break;case"error":{const s=`
|
|
40
|
+
|
|
41
|
+
⚠️ **执行提示**:${t.message||"请求执行遇到错误"}`;e.content+=(e.content?`
|
|
42
|
+
|
|
43
|
+
`:"")+s.trimStart(),bp(e,s)}break;case"ui_agent_plan":t.steps&&Array.isArray(t.steps)&&n.isActiveSession&&o.setPlanSteps(t.steps);break;case"ui_code_diff":Kn(e,{id:`diff-${Date.now()}`,type:"diff",data:{file:t.file||"untitled.ts",additions:t.additions||0,deletions:t.deletions||0,oldCode:t.oldCode||"",newCode:t.newCode||"",view:"side-by-side"}});break;case"ui_terminal_log":Kn(e,{id:`term-${Date.now()}`,type:"terminal",data:{title:t.title||"沙箱命令执行",lines:t.lines||[{text:"$ npm run build",kind:"cmd"},{text:"Build finished successfully in 410ms.",kind:"stdout"}]}});break;case"ui_metric_chart":Kn(e,{id:`metric-${Date.now()}`,type:"metric",data:{title:t.title||"指标图表",series:Array.isArray(t.points)?t.points.map(s=>({label:s.time,value:s.value})):[]}});break;case"suspended":{const s=Wm(e);if(!s.some(i=>i.data?.actionId===t.actionId)){if(t.toolName==="ui_form"){const r={id:t.actionId,type:"form",data:{actionId:t.actionId,toolName:t.toolName,formArgs:t.args||{},status:"pending",timeoutMs:t.timeoutMs,expiresAt:Date.now()+(t.timeoutMs||0)}};s.push(r),Sc(e,r.id);break}const i={id:t.actionId,type:"approval",data:{actionId:t.actionId,risk:"high",title:t.toolName?`工具 [${t.toolName}] 申请权限`:"高风险操作介入确认",command:JSON.stringify(t.args||{},null,2),status:"pending",expiresInSec:Math.round((t.timeoutMs||6e4)/1e3),expiresAt:Date.now()+(t.timeoutMs||6e4)}};s.push(i),Sc(e,i.id)}break}case"resumed":{if(e.cards&&t.actionId){const s=e.cards.find(i=>i.data?.actionId===t.actionId||i.id===t.actionId||i.id===`approval-${t.actionId}`);if(s){if(s.type==="form"){const r=(t.payload||{}).reason;s.data.status=r==="timeout"?"timeout":"done";break}const i=t.payload||{};s.data.status=i.approved?"approved":"denied",s.data.reason=i.note||i.reason}}break}case"tool_call_start":Kn(e,{id:`call-${t.toolCallId}`,type:"toolcall",data:{toolName:t.toolName,status:"streaming",args:{},startedAt:Date.now()}});break;case"tool_call_args_delta":{const s=e.cards?.find(i=>i.id===`call-${t.toolCallId}`);s&&s.type==="toolcall"&&(s.data.args=t.partialArgs||{});break}case"tool_call_executing":{const s=e.cards?.find(i=>i.id===`call-${t.toolCallId}`);s&&s.type==="toolcall"&&(s.data.status="executing",s.data.args=t.args||{});break}case"tool_call_result":{const s=e.cards?.find(i=>i.id===`call-${t.toolCallId}`);if(s&&s.type==="toolcall"&&(s.data.status=t.status==="error"?"error":"done",s.data.result=t.data,s.data.error=t.error,s.data.duration=s.data.startedAt?Date.now()-s.data.startedAt:void 0),t.toolName==="bash_run"){Kn(e,{id:`term-${t.toolCallId}`,type:"terminal",data:{title:`终端执行: ${t.toolName}`,lines:[{text:`$ [状态: ${t.status}]`,kind:"cmd"},{text:typeof t.data=="string"?t.data:JSON.stringify(t.data||t.error||""),kind:t.status==="error"?"err":"stdout"}]}});break}CL(e,t.data,t.toolCallId,o);break}}}function SL(e){const t=mn(new Map),n=new Map,o=new Map;function s(c){return!c||c===e()}function i(c,u){t.set(c,!0),n.set(c,u)}function r(c){t.set(c,!1),n.delete(c)}function a(c,u){o.set(c,u)}function l(c){return n.get(c)}return{sessionRunningMap:t,sessionAbortControllers:n,sessionTurnsCache:o,isActiveSession:s,markRunning:i,markStopped:r,cacheTurns:a,getAbortController:l}}function RL(e,t){return e.value.push(t),e.value[e.value.length-1]}function EL(e){const t=P(0),n=P(128e3),o=P(0),s=mn(new Map),i=P([]);function r(l,c){t.value=l.promptTokens+l.completionTokens;const u=c||e();s.set(u,(s.get(u)??0)+l.promptTokens+l.completionTokens),(!c||c===e())&&(o.value+=l.promptTokens+l.completionTokens),l.contextWindow&&(n.value=l.contextWindow),i.value=l.parts?.length?l.parts:[{id:"history",label:"对话历史",tokens:t.value,kind:"history"}]}function a(){t.value=0,i.value=[],o.value=0}return{contextUsed:t,contextLimit:n,sessionTokensUsed:o,sessionTokensUsedMap:s,ctxParts:i,applyUsageEvent:r,reset:a}}function DL(){const e=P([]),t=P(!0),n=T(()=>e.value.length>0),o=T(()=>e.value.filter(a=>a.status==="done").length),s=T(()=>e.value.find(a=>a.status==="running"));function i(a){e.value=a,t.value=!0}function r(){e.value=[],t.value=!0}return{planSteps:e,isPlanExpanded:t,isPlanVisible:n,completedStepsCount:o,currentRunningStep:s,setPlanSteps:i,reset:r}}function TL(e){async function t(){const n=e.getActiveSessionId();if(n){await ID(n);const o=e.registry.getAbortController(n);e.registry.markStopped(n),o?.abort()}e.onStopped()}return{stopExecution:t}}function IL(e){const t=P([]),n=SL(e.getActiveSessionId),o=EL(e.getActiveSessionId),s=DL(),i=P(!1),r=P(null);function a(y){return n.isActiveSession(y)}const l=new WeakMap;function c(y){l.get(y)?.flush()}function u(y){l.delete(y)}function d(){t.value=[],s.reset(),o.reset()}function _(y,x,$){if(AL(x,y),y.type==="usage"){o.applyUsageEvent(y,$);return}if(y.type==="traj"){x.trajEvents||(x.trajEvents=[]),x.trajEvents.push(y.event);return}if(y.type==="text_delta"){let w=l.get(x);w||(w=bR({commit:C=>{yp(x,{type:"text_delta",delta:C},{isActiveSession:a($)},{setPlanSteps:s.setPlanSteps}),e.scrollToBottom()}}),l.set(x,w)),w.push(y.delta);return}c(x),yp(x,y,{isActiveSession:a($)},{setPlanSteps:s.setPlanSteps}),e.scrollToBottom()}async function v(y,x,$,w){const C=new AbortController;n.markRunning(y,C),e.getActiveSessionId()===y&&(i.value=!0,r.value=C);const R=Date.now();u(x);try{const{aborted:O}=await gR({open:()=>$?FD(w):MD(y),signal:C.signal,onEvent:B=>_(B,x,y),onDone:()=>{c(x),x.isStreaming=!1}});O&&(c(x),x.abortedReason??="user")}catch(O){c(x);const B=O?.message||String(O);x.content+=`
|
|
44
|
+
|
|
45
|
+
*(调用出错: ${B})*`}finally{c(x),u(x),x.isStreaming=!1,x.thoughtDuration=Math.round((Date.now()-R)/100)/10,n.markStopped(y),e.getActiveSessionId()===y&&(i.value=!1,r.value=null,e.scrollToBottom()),await e.refreshSessions()}}async function g(y,x){const $={id:`turn-user-${Date.now()}`,role:"user",content:y,...x.attachments?.length?{attachments:x.attachments}:{},timestamp:Date.now()};t.value.push($);const w={id:`turn-asst-${Date.now()}`,role:"assistant",content:"",thought:"",thoughtExpanded:!0,thoughtDuration:0,isStreaming:!0,cards:[],blocks:[],trajEvents:[],timestamp:Date.now()};n.cacheTurns(x.sessionId,t.value);const C=RL(t,w);e.scrollToBottom({force:!0}),v(x.sessionId,C,!0,{sessionId:x.sessionId,workspaceId:x.workspaceId,prompt:y,modelProfileId:x.modelProfileId,permission:x.permission,reasoningEffort:x.reasoningEffort,images:x.images,attachments:x.attachments?.length?x.attachments.map(({name:R,kind:O,size:B})=>({name:R,kind:O,size:B})):void 0})}const{stopExecution:m}=TL({getActiveSessionId:e.getActiveSessionId,registry:n,onStopped:()=>{i.value=!1,r.value=null}});return{chatTurns:t,planSteps:s.planSteps,isPlanVisible:s.isPlanVisible,isPlanExpanded:s.isPlanExpanded,completedStepsCount:s.completedStepsCount,currentRunningStep:s.currentRunningStep,isRunning:i,activeAbortController:r,contextUsed:o.contextUsed,contextLimit:o.contextLimit,sessionTokensUsed:o.sessionTokensUsed,sessionTokensUsedMap:o.sessionTokensUsedMap,ctxParts:o.ctxParts,sessionTurnsCache:n.sessionTurnsCache,sessionRunningMap:n.sessionRunningMap,sessionAbortControllers:n.sessionAbortControllers,resetTurns:d,sendPrompt:g,connectToSessionStream:v,stopExecution:m}}const kp=()=>({name:"",provider:"deepseek",baseUrl:"",apiKey:"",parameters:{temperature:.2}});function FL(e={}){const t=P([...Fr]),n=P("deepseek-v3"),o=P(""),s=P(!1),i=P([]),r=P([]),a=P(""),l=P(!1),c=P(kp()),u=P(null),d=P(!1),_=P(!1),v=P(!1),g=P(null),m=P(!1),y=P([]),x=P(""),$=P([]),w=T(()=>t.value.find(D=>D.id===n.value)||t.value[0]),C=T(()=>r.value.find(D=>D.id===n.value)?.capabilities),R=T(()=>{const D=C.value?.inputModalities;return Array.isArray(D)&&D.includes("image")}),O=T(()=>C.value?.reasoning),B=T(()=>{const D=O.value;return D?.supported&&Array.isArray(D.supportedEfforts)&&D.supportedEfforts.length?D.supportedEfforts:[]}),J=mn(new Map),Q=T(()=>{const D=B.value;if(D.length===0)return"";const V=J.get(e.getSessionId?.()??"");if(V&&D.includes(V))return V;const ne=O.value?.defaultEffort;return ne&&D.includes(ne)?ne:D[0]});function re(D){J.set(e.getSessionId?.()??"",D)}function ee(D,V){if(!V||D===V)return;const ne=J.get(D);ne!==void 0&&(J.has(V)||J.set(V,ne),J.delete(D))}const z=T(()=>i.value.find(D=>D.id===a.value)),K=T(()=>z.value?.models||[]);async function se(){try{const D=await bD();if(!D)return;i.value=D;const V=D.find(ne=>ne.id===a.value);V?c.value={...c.value,id:V.id,name:V.name,provider:V.provider,baseUrl:V.baseUrl||"",maskedApiKey:V.maskedApiKey}:D.length>0?H(D[0].id):a.value="",ae(D)}catch(D){console.error("加载供应商失败:",D)}}async function le(){try{await se()}catch(D){console.error("加载模型列表失败:",D)}}function ae(D){const V=new Map;for(const Re of D)V.set(Re.id,Re);const ne=[],ge=[];for(const Re of D){const nt=Re.name?.trim()||Re.provider||"默认供应商",ct=Re.models??[];for(const ot of ct)ne.push(ot),ge.push({id:ot.id,label:ot.name,meta:ot.model,provider:nt,model:ot.model,contextWindow:ot.contextWindow||ot.capabilities?.contextWindow||128e3})}if(r.value=ne,ne.length===0){t.value=[...Fr],o.value="",Fr.some(Re=>Re.id===n.value)||(n.value=Fr[0]?.id??"");return}t.value=ge;const Pe=ne.find(Re=>Re.isDefault)||ne[0];o.value=Pe.id,(!n.value||!ne.some(Re=>Re.id===n.value))&&(n.value=Pe.id)}function ve(){o.value&&(n.value=o.value)}async function fe(){e.closeMenus?.(),s.value=!0,g.value=null,u.value=null,d.value=!1,await se(),i.value.length===0&&W()}function L(){s.value=!1,g.value=null,u.value=null,d.value=!1}function H(D){const V=i.value.find(ne=>ne.id===D);V&&(l.value=!1,a.value=D,u.value=null,d.value=!1,g.value=null,y.value=[],$.value=[],c.value={id:V.id,name:V.name,provider:V.provider,baseUrl:V.baseUrl||"",apiKey:"",maskedApiKey:V.maskedApiKey,parameters:{...V.parameters||{}}})}function W(){l.value=!0,a.value="",u.value=null,d.value=!1,g.value=null,y.value=[],$.value=[],c.value={...kp(),name:"新供应商"}}function Y(D){if(c.value.provider=D,!l.value)return;const V=vp[D];V&&(c.value.name=V.name,c.value.baseUrl=V.baseUrl)}async function Ae(){const D=c.value;if(!D.name.trim())return De.add({title:"请填写供应商名称",kind:"warning"}),null;const V={name:D.name.trim(),provider:D.provider,baseUrl:D.baseUrl?.trim()||void 0,apiKey:D.apiKey?.trim()||void 0,parameters:D.parameters};try{if(l.value){const ne=await yD(V);return ne?(await se(),H(ne.id),g.value={ok:!0,message:"供应商已创建,可在下方添加模型"},ne):(g.value={ok:!1,message:"保存失败:服务器未返回创建结果"},null)}else if(D.id){const ne=await kD(D.id,V);return ne?(await se(),H(D.id),g.value={ok:!0,message:"供应商已更新,其下所有模型立即生效"},ne):(g.value={ok:!1,message:"保存失败:服务器未返回更新结果"},null)}return null}catch(ne){return g.value={ok:!1,message:`保存失败: ${ne.message||String(ne)}`},null}}async function ze(D){const V=i.value.find(Re=>Re.id===D),ne=V?.models?.length??0;if(!await co({title:ne>0?`删除「${V?.name}」及其 ${ne} 个模型?`:"删除这个供应商?",description:ne>0?"该供应商下的模型配置会一并移除,此操作不可撤销。":`「${V?.name||"未命名供应商"}」将被移除,此操作不可撤销。`,confirmText:ne>0?"全部删除":"删除",tone:"danger",icon:!0}))return;const Pe=await wD(D,ne>0);Pe?.success?(await se(),i.value.length>0?H(i.value[0].id):W()):De.add({title:Pe?.error||"删除失败",kind:"danger"})}async function Ze(){let D=z.value;if(!D&&l.value&&(D=await Ae()??void 0,!D))return;if(!D){De.add({title:"请先保存供应商",kind:"warning"});return}d.value=!0,y.value=[],$.value=[],g.value=null;const V=vp[D.provider];u.value={...i9,id:"",providerId:D.id,provider:D.provider,name:"",model:"",contextWindow:V?.contextWindow||128e3,capabilities:{source:"declared"},isDefault:!1},Me({silent:!0})}function Ie(D){d.value=!1,ie.value=[],y.value=[],$.value=[],g.value=null,u.value={id:D.id,providerId:D.providerId,name:D.name,provider:D.provider,model:D.model,baseUrl:D.baseUrl||"",apiKey:"",maskedApiKey:D.maskedApiKey,contextWindow:D.contextWindow||D.capabilities?.contextWindow||128e3,capabilities:D.capabilities?{...D.capabilities}:{source:"declared"},temperature:D.temperature??.2,isDefault:!!D.isDefault},Me({silent:!0})}function he(){u.value=null,d.value=!1,ie.value=[],y.value=[],$.value=[],g.value=null}async function Rt(){const D=u.value;if(!D)return;if(!D.name.trim()||!D.model.trim()){De.add({title:"请填写模型名称与模型标识",kind:"warning"});return}const V={...D.capabilities||{},contextWindow:D.contextWindow||void 0,source:D.capabilities?.source||"declared"},ne={name:D.name.trim(),model:D.model.trim(),contextWindow:D.contextWindow||void 0,capabilities:V,temperature:D.temperature,isDefault:D.isDefault};try{const ge=d.value;(ge?await xD(D.providerId||a.value,ne):await _D(D.id,ne))&&(await se(),he(),g.value={ok:!0,message:ge?"模型已添加":"模型已更新"})}catch(ge){g.value={ok:!1,message:`保存失败: ${ge.message||String(ge)}`}}}async function Xt(D){const V=r.value.find(ge=>ge.id===D);if(await co({title:"删除这个模型?",description:`「${V?.name||"未命名模型"}」将被移除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0}))try{await gD(D)&&(u.value?.id===D&&he(),await se())}catch(ge){console.error("删除模型失败:",ge)}}async function Me(D){const V=D?.silent===!0,ne=z.value?.id;if(!ne){V||De.add({title:"请先保存供应商,再拉取模型列表",kind:"warning"});return}if(!(V&&x.value===ne&&y.value.length>0)){m.value=!0;try{const ge=await CD(ne);if(ge?.ok&&ge.models){y.value=ge.models,$.value=ge.items??[],x.value=ne;const Pe=$.value.filter(Re=>Re.capabilities).length;V||De.add({title:`已拉取 ${ge.models.length} 个可用模型`,description:Pe>0?`其中 ${Pe} 个可自动填充能力信息`:"该供应商未提供能力信息,需手动填写",kind:"success"})}else V||De.add({title:`拉取失败:${ge?.error||"端点无响应"}`,kind:"warning"})}catch(ge){V||De.add({title:`拉取失败: ${ge.message||String(ge)}`,kind:"warning"})}finally{m.value=!1}}}function S(D){const V=u.value;if(!V)return;const ne=D.capabilities,ge={...V.capabilities||{},...ne||{},source:ne?"detected":V.capabilities?.source||"declared"};u.value={...V,model:D.id,name:D.displayName||D.id,contextWindow:ne?.contextWindow||V.contextWindow,capabilities:ge}}function M(D){const V=$.value.find(ge=>ge.id===D);if(V){S(V);return}const ne=u.value;ne&&(u.value={...ne,model:D,name:D})}const Z=P(!1),ie=P([]);async function te(){const D=u.value;if(!D?.id||Z.value)return;const V=(D.capabilities?.inputModalities?.includes("image")?1:0)+(D.capabilities?.reasoning?.supported?1:0);if(V===0){De.add({title:"未勾选可探测能力",kind:"info"});return}if(await co({title:`发起 ${V} 次最小探测请求?`,description:"将按勾选能力逐项实测端点行为(max_tokens=1 压成本),产生少量真实 API 费用。",confirmText:"开始验证",tone:"default",icon:!0})){Z.value=!0,ie.value=[];try{const ge=await $D(D.id);ge&&(ie.value=ge.results??[],ie.value.length===0&&De.add({title:ge.note||"未勾选可探测能力",kind:"info"}))}catch(ge){De.add({title:`验证失败: ${ge instanceof Error?ge.message:String(ge)}`,kind:"danger"})}finally{Z.value=!1}}}const oe=P("");async function de(D){if(!oe.value){oe.value=D.id;try{const V=await Xf({profileId:D.id,model:D.model});V.ok?De.add({title:`「${D.name||D.model}」连通正常`,description:`首响应 ${V.latencyMs}ms · ${V.model}`,kind:"success"}):De.add({title:`「${D.name||D.model}」探测失败`,description:V.error||"端点无响应",kind:"warning"})}catch(V){De.add({title:"探测请求失败",description:V.message||String(V),kind:"warning"})}finally{oe.value=""}}}async function ue(){if(!u.value?.model?.trim()){g.value={ok:!1,message:"请先选择或填写模型标识(点输入框右侧按钮可从供应商拉取列表)"};return}v.value=!0,g.value=null;try{const D=u.value,V=await Xf({profileId:D?.id||void 0,providerId:D&&D.providerId||z.value?.id,model:D?.model?.trim()});g.value=V.ok?{ok:!0,message:`连通性正常:${V.model} @ ${V.endpoint}(首响应 ${V.latencyMs}ms)`}:{ok:!1,message:`探测失败(${V.latencyMs}ms):${V.error||"端点无响应"}`}}catch(D){g.value={ok:!1,message:`探测失败: ${D.message||String(D)}`}}finally{v.value=!1}}function F(D){const V=u.value;if(!V)return;const ne=V.capabilities||{},ge=new Set(ne.inputModalities||["text"]);ge.has(D)?ge.delete(D):ge.add(D),ge.add("text"),u.value={...V,capabilities:{...ne,inputModalities:[...ge]}}}function U(){const D=u.value;if(!D)return;const V=D.capabilities||{},ne=!V.reasoning?.supported;u.value={...D,capabilities:{...V,reasoning:ne?{supported:!0,supportedEfforts:["low","medium","high"],defaultEffort:"medium"}:{supported:!1}}}}function _e(){const D=u.value;if(!D)return;const V=D.capabilities||{},ne=new Set(V.supportedParameters||["temperature"]);ne.has("tools")?ne.delete("tools"):ne.add("tools"),u.value={...D,capabilities:{...V,supportedParameters:[...ne]}}}return{availableModels:t,activeModel:n,activeModelObj:w,activeModelCapabilities:C,supportsImageInput:R,reasoningEffort:Q,setReasoningEffort:re,migrateSessionEffort:ee,reasoningEffortOptions:B,defaultModelId:o,resetModelToDefault:ve,isModelSettingsOpen:s,providers:i,modelProfiles:r,selectedProviderId:a,isCreatingProvider:l,currentProvider:z,currentProviderModels:K,providerForm:c,modelDraft:u,isCreatingModel:d,showApiKey:_,isTestingConnection:v,isDiscovering:m,testStatus:g,discoveredModels:y,discoveredItems:$,loadProviders:se,fetchModelProfiles:le,openModelSettings:fe,closeModelSettings:L,selectProvider:H,startCreateProvider:W,onProviderKindChange:Y,saveProvider:Ae,deleteProvider:ze,startCreateModel:Ze,editModel:Ie,cancelModelEdit:he,saveModel:Rt,deleteModel:Xt,isVerifyingCapabilities:Z,capabilityVerdicts:ie,verifyCapabilities:te,discoverModels:Me,applyDetected:S,selectDiscoveredModel:M,discoveredForProvider:x,testProfileConnection:de,testingProfileId:oe,testModelConnection:ue,toggleModality:F,toggleReasoning:U,toggleToolUse:_e}}function ML(e,t){const n=[];let o=0;const s=t.filter(i=>typeof i.data?.contentOffset=="number").sort((i,r)=>i.data.contentOffset-r.data.contentOffset);for(const i of s){const r=Math.min(Math.max(i.data.contentOffset,0),e.length);r>o&&n.push({kind:"text",content:e.slice(o,r)}),n.push({kind:"card",cardId:i.id}),o=Math.max(o,r)}(e.length>o||n.length===0)&&n.push({kind:"text",content:e.slice(o)});for(const i of t)typeof i.data?.contentOffset!="number"&&n.push({kind:"card",cardId:i.id});return n}function OL(e){const{chat:t}=e,n=P([]),o=P(""),s=T(()=>n.value.filter(m=>!m.archived&&m.status!=="archived")),i=T(()=>n.value.filter(m=>m.archived||m.status==="archived")),r=P(!1);async function a(m){const y=m?.silent??n.value.length>0;y||(r.value=!0);try{const x=await fD();x&&(n.value=x)}catch(x){console.error("加载会话失败:",x)}finally{y||(r.value=!1)}}async function l(m){try{const y=await hD(m);return y&&(n.value.unshift(y),o.value=y.id),y}catch(y){return console.error("创建会话记录失败:",y),null}}async function c(m){o.value&&t.chatTurns.value.length>0&&t.sessionTurnsCache.set(o.value,[...t.chatTurns.value]),o.value=m.id,e.activeWorkspaceId.value=m.workspaceId,e.isNewChat.value=!1,e.activePermission.value=m.permission||"review",t.planSteps.value=[],t.contextUsed.value=0,t.sessionTokensUsed.value=t.sessionTokensUsedMap.get(m.id)??0;const y=!!t.sessionRunningMap.get(m.id);if(t.sessionTurnsCache.has(m.id)&&y){t.chatTurns.value=t.sessionTurnsCache.get(m.id),t.isRunning.value=!0,t.activeAbortController.value=t.sessionAbortControllers.get(m.id)||null,e.scrollToBottom({force:!0});return}try{const x=await pD(m.id);if(x){const $=[];if(x.turns&&x.turns.length>0){t.sessionTokensUsed.value=0;for(const w of x.turns){const C=w.telemetry?.totalTokens;if(typeof C=="number"&&C>0&&(t.sessionTokensUsed.value+=C),w.role)$.push({id:w.id||`turn-${Date.now()}`,role:w.role,content:w.content||"",thought:w.thought||"",thoughtExpanded:!1,thoughtDuration:w.thoughtDuration||0,cards:w.cards||[],timestamp:w.timestamp||Date.now()});else{const R=w.telemetry?.contextTokens;typeof R=="number"&&R>0&&(t.contextUsed.value=R),w.prompt&&$.push({id:`turn-user-${w.id}`,role:"user",content:w.prompt,...Array.isArray(w.attachments)&&w.attachments.length?{attachments:w.attachments}:{},timestamp:w.createdAt||Date.now()});let O=w.content;if(!O&&w.checkpoints&&w.checkpoints.length>0){const J=w.checkpoints[w.checkpoints.length-1];if(J&&Array.isArray(J.messagesSnapshot)){const Q=[...J.messagesSnapshot].reverse().find(re=>re.role==="assistant"&&re.content);Q&&(O=Q.content)}}O||(w.status==="error"?O="⚠️ *(此轮执行遇到错误或被中止)*":O=`*(本轮任务已执行完毕${w.telemetry?.durationMs?`,耗时 ${Math.round(w.telemetry.durationMs/100)/10}s`:""})*`);const B=(w.cards||[]).map(J=>J.type==="ui"&&J.data?.component==="ui_form"?{id:J.data.actionId||J.id,type:"form",data:{actionId:J.data.actionId,toolName:"ui_form",formArgs:J.data.props||{},status:J.data.status||"done"}}:J.type==="toolcall"&&(J.data?.status==="streaming"||J.data?.status==="executing")?{...J,data:{...J.data,status:"error",error:"执行被中止"}}:J);$.push({id:`turn-asst-${w.id}`,role:"assistant",content:O,thought:w.thought||"",thoughtExpanded:!1,thoughtDuration:w.telemetry?.durationMs?Math.round(w.telemetry.durationMs/100)/10:0,cards:B,blocks:ML(O,B),abortedReason:w.abortedReason??(w.errorMessage==="process_restart"?"process_restart":void 0),trajEvents:w.telemetry?.events||[],timestamp:w.completedAt||w.createdAt||Date.now()}),w.plan?.steps&&(t.planSteps.value=w.plan.steps)}}}if(x.isRunning){t.sessionRunningMap.set(m.id,!0),t.isRunning.value=!0;const w=x.activeRun?.prompt||"正在后台执行的任务…";$.push({id:`turn-user-live-${Date.now()}`,role:"user",content:w,timestamp:x.activeRun?.startedAt||Date.now()});const C={id:`turn-asst-live-${Date.now()}`,role:"assistant",content:"",thought:"",thoughtExpanded:!0,thoughtDuration:0,isStreaming:!0,cards:[],blocks:[],timestamp:Date.now()};$.push(C),t.chatTurns.value=$,t.sessionTurnsCache.set(m.id,t.chatTurns.value);const R=t.chatTurns.value[t.chatTurns.value.length-1];t.connectToSessionStream(m.id,R,!1)}else t.sessionRunningMap.set(m.id,!1),t.isRunning.value=!1,$.length===0&&$.push({id:`turn-seed-${m.id}`,role:"assistant",content:`已加载会话「${m.title}」。工作区绑定至 \`${e.getWorkspaceRootPath()}\`。随时可以输入任务指令或向 Agent 提问。`,timestamp:m.updatedAt}),t.chatTurns.value=$,t.sessionTurnsCache.set(m.id,t.chatTurns.value)}}catch(x){console.error("加载会话详情失败:",x)}e.scrollToBottom({force:!0})}async function u(m,y){try{await yi(m,{archived:y,status:y?"archived":"active"});const x=n.value.find($=>$.id===m);x&&(x.archived=y,x.status=y?"archived":"active")}catch(x){console.error("归档操作失败:",x)}}async function d(m){const y=n.value.find($=>$.id===m);if(!y)return;const x=!y.pinned;try{await yi(m,{pinned:x}),y.pinned=x}catch($){console.error("置顶操作失败:",$)}}async function _(m,y){const x=y.trim();if(x)try{if(await yi(m,{title:x})){const w=n.value.find(C=>C.id===m);w&&(w.title=x)}}catch($){console.error("重命名会话失败:",$)}}async function v(m){const y=n.value.find($=>$.id===m);await co({title:"删除这个会话?",description:`「${y?.title||"未命名会话"}」的全部消息与工具调用记录将被清除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0})&&await g(m)}async function g(m){try{await vD(m),n.value=n.value.filter(y=>y.id!==m),o.value===m&&e.onActiveDeleted()}catch(y){console.error("删除会话失败:",y)}}return{sessions:n,activeSessionId:o,activeSessions:s,archivedSessions:i,fetchSessions:a,sessionsLoading:r,createSessionForPrompt:l,selectSession:c,renameSession:_,toggleArchiveSession:u,togglePinSession:d,askDeleteSession:v,deleteSession:g}}function PL(e={}){const t=P([]),n=P(""),o=T(()=>t.value.find(d=>d.id===n.value)||t.value[0]||null);async function s(){try{const d=await lD();d&&(t.value=d,t.value.length>0&&!n.value&&(n.value=t.value[0].id))}catch(d){console.error("加载工作区失败:",d)}}function i(d){n.value=d,e.onWorkspaceActivated?.()}async function r(){e.closeMenus?.();const d=await dD();if(d.kind==="cancelled")return;if(d.kind==="busy"){De.add({title:"选择框已打开",description:d.error,kind:"warning"});return}if(d.kind==="picked"){await s(),d.workspace.id&&i(d.workspace.id);return}console.warn("系统文件夹选择框不可用:",d.error),De.add({title:"无法打开系统文件夹选择框",description:d.hint?`${d.error}——${d.hint}`:d.error,kind:"warning"});const _=await hT({title:"手动输入工作区路径",description:`${d.error}${d.hint?`(${d.hint})`:""}
|
|
46
|
+
也可以直接输入本地项目文件夹的绝对路径。`,placeholder:"/Users/username/project",confirmText:"创建"});if(_?.trim())try{const v=await cD({name:_.trim().split(/[\\/]/).filter(Boolean).pop()||"workspace",rootPath:_.trim(),permission:"read-write"});v&&(await s(),i(v.id))}catch(v){De.add({title:"创建工作区失败",description:String(v),kind:"danger"})}}function a(d){n.value=d,e.closeWorkspaceMenu?.()}async function l(d){const _=t.value.find(g=>g.id===d);await co({title:"删除这个工作区?",description:`「${_?.name||"未命名工作区"}」及其下的全部会话将被删除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0})&&await c(d)}async function c(d){try{await uD(d)&&(t.value=t.value.filter(v=>v.id!==d),n.value===d&&(n.value=t.value[0]?.id||""),await e.refreshSessions?.())}catch(_){console.error("删除工作区失败:",_)}}async function u(){if(!n.value){if(t.value.length>0)n.value=t.value[0].id;else if(await r(),!n.value)return!1}return!0}return{workspaces:t,activeWorkspaceId:n,currentWorkspace:o,fetchWorkspaces:s,pickAndCreateWorkspace:r,activateWorkspace:i,selectWorkspace:a,askDeleteWorkspace:l,deleteWorkspace:c,ensureActiveWorkspace:u}}const Vm="vuagent:theme",LL=["light","dark","system"];function BL(){try{return typeof localStorage<"u"?localStorage:void 0}catch{return}}function jL(e){try{const t=e?.getItem(Vm);return LL.includes(t)?t:"system"}catch{return"system"}}function NL(e=BL()){const t=P(jL(e)),n=P("light"),o=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function s(){const r=t.value==="dark"||t.value==="system"&&!!o?.matches;n.value=r?"dark":"light",typeof document<"u"&&(document.documentElement.dataset.theme=n.value,document.documentElement.style.colorScheme=n.value)}o&&o.addEventListener("change",()=>{t.value==="system"&&s()});function i(){try{e?.setItem(Vm,t.value)}catch{}}return Bg(()=>{i(),s()}),{preference:t,resolved:n,setPreference(r){t.value=r,i(),s()}}}let Vl=null;function UL(){return Vl||(Vl=NL()),Vl}const zL={"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function KL(e){return e+864e5}function WL(e={}){const t=P("24h"),n=P(null),o=T(()=>{const $=e.getSessionId?.()??"";return $?n.value?.bySession[$]??null:null}),s=P(null),i=P(null),r=P(null),a=P({windowTokenLimit:0,windowUsdLimit:0,windowMs:864e5}),l=P(!1),c=P(null),u=T(()=>s.value!=null&&i.value!=null),d=T(()=>Object.entries(r.value?.byModel??{}).map(([$,w])=>({label:$,value:w.tokens})).sort(($,w)=>w.value-$.value));async function _(){l.value=!0;try{r.value=u.value?await Nl({since:s.value,until:KL(i.value)}):await Nl({windowMs:zL[t.value]}),g(),v()}finally{l.value=!1}}async function v(){n.value=await OD().catch(()=>null)}async function g(){const $=a.value.windowTokenLimit>0||a.value.windowUsdLimit>0;c.value=$?await Nl({windowMs:a.value.windowMs}):null}function m($){t.value=$,s.value=null,i.value=null,_()}function y($,w){s.value=$,i.value=w,_()}async function x(){a.value=await PD(),await g()}return{preset:t,customStart:s,customEnd:i,isCustom:u,summary:r,limits:a,quotaUsage:c,loading:l,byModelTokens:d,sessionCosts:n,currentSessionCost:o,refresh:_,setPreset:m,setCustomRange:y,refreshLimits:x}}const VL={class:"va-console"},qL={class:"va-console__main"},HL={class:"va-console__mention",role:"listbox","aria-label":"引用工作区文件"},JL={key:0,class:"va-console__mention-loading"},GL=["aria-selected","onMouseenter","onClick"],ZL={class:"va-console__mention-path"},YL={key:2,class:"va-console__mention-empty"},XL={key:0,class:"va-console__welcome-view"},QL={class:"va-console__welcome-hero"},eB={class:"va-console__welcome-composer-box"},tB={class:"va-console__seat-btn",type:"button"},nB={class:"va-console__seat-text"},oB={class:"va-console__seat-text",title:"会话累计消耗(计费口径:Σ各步 prompt+completion,含压缩前所有轮次)"},sB={class:"va-console__ctx-panel"},iB={class:"va-console__suggestions"},rB={key:1,class:"va-console__chat-layout"},aB={class:"va-console__chat-view"},lB={class:"va-console__stream-wrap"},cB={class:"va-console__traj-view"},uB={key:1,class:"va-console__traj-empty"},dB={class:"va-console__bottom-composer"},fB={class:"va-console__seat-btn",type:"button"},pB={class:"va-console__seat-text"},hB={class:"va-console__seat-text",title:"会话累计消耗(计费口径:Σ各步 prompt+completion,含压缩前所有轮次)"},vB={class:"va-console__ctx-panel"},mB={key:0,class:"va-console__rsb-badge","aria-label":"待审批数"},wp=48*1024,_B=5*1024*1024,xp=4,gB=Ce({__name:"Console",setup(e){const t=P(!0),n=P("chat"),o=P(!0),s=P(""),i=P("review"),r=P(i.value),a=o9,{tools:l,toolsLoading:c,toolsError:u,fetchTools:d,onToggleTool:_,configLoading:v,configError:g,configNs:m,fetchConfig:y,onConfigPatch:x,onConfigReset:$}=xL({defaultPermission:i,activePermission:r,isNewChat:t}),w=rt("chatScrollRef"),C=rt("composerRef"),{isPinned:R,onScroll:O,scrollToBottom:B}=tR(w),J=PL({refreshSessions:()=>Q.fetchSessions(),onWorkspaceActivated:()=>Zs()});let Q;const re=FL({getSessionId:()=>Q?.activeSessionId?.value??""}),ee=IL({getActiveSessionId:()=>Q.activeSessionId.value,refreshSessions:()=>Q.fetchSessions({silent:!0}),scrollToBottom:B});Q=OL({chat:ee,isNewChat:t,activeWorkspaceId:J.activeWorkspaceId,activePermission:r,getWorkspaceRootPath:()=>J.currentWorkspace.value?.rootPath||"",scrollToBottom:B,onActiveDeleted:()=>Zs()});const z=P([]);let K;function se(N){const q=Object.entries(N).map(([$e,Ye])=>`${$e}: ${typeof Ye=="string"?Ye:JSON.stringify(Ye)}`).join(", ");return q.length>120?`${q.slice(0,120)}…`:q||"(无参数)"}async function le(){try{const N=await DD();z.value=(N||[]).map((I,q)=>{if(I.toolName==="ui_form"){const $e=typeof I.args?.title=="string"?I.args.title:"";return{id:I.actionId,title:$e?`表单待填写:${$e}`:"表单待填写",detail:"请在对应会话中填写并提交表单(取消/超时按用户放弃处理)",collapsed:q!==0}}return{id:I.actionId,title:`${I.toolName} 请求执行`,detail:se(I.args),primary:"批准执行",secondary:"驳回",collapsed:q!==0}})}catch(N){console.error("拉取待审批列表失败:",N)}}async function ae(N,I){await ve(N.id,I==="primary"),De.add({title:I==="primary"?"已批准执行":"已驳回操作",description:N.title,kind:I==="primary"?"success":"warning"}),await le()}const{submitApproval:ve}=wL({chatTurns:ee.chatTurns,sessionTurnsCache:ee.sessionTurnsCache}),{workspaces:fe,activeWorkspaceId:L,activateWorkspace:H,fetchWorkspaces:W,pickAndCreateWorkspace:Y,askDeleteWorkspace:Ae,ensureActiveWorkspace:ze}=J,{availableModels:Ze,activeModel:Ie,isModelSettingsOpen:he,providers:Rt,selectedProviderId:Xt,isCreatingProvider:Me,currentProvider:S,currentProviderModels:M,providerForm:Z,modelDraft:ie,isCreatingModel:te,showApiKey:oe,isTestingConnection:de,isDiscovering:ue,isVerifyingCapabilities:F,capabilityVerdicts:U,verifyCapabilities:_e,testStatus:D,discoveredModels:V,discoveredItems:ne,activeModelObj:ge,supportsImageInput:Pe,reasoningEffort:Re,setReasoningEffort:nt,migrateSessionEffort:ct,reasoningEffortOptions:ot,fetchModelProfiles:rn,resetModelToDefault:wn,openModelSettings:cr,closeModelSettings:Lt,selectProvider:an,startCreateProvider:ur,onProviderKindChange:dr,saveProvider:qm,deleteProvider:Hm,startCreateModel:Jm,editModel:Gm,cancelModelEdit:Zm,saveModel:Ym,deleteModel:Xm,discoverModels:Qm,selectDiscoveredModel:e_,testModelConnection:t_,testProfileConnection:n_,testingProfileId:o_,toggleModality:s_,toggleReasoning:i_,toggleToolUse:r_}=re,tl=P("models");function a_(N="models"){tl.value=N,cr()}const{sessions:xn,sessionsLoading:l_,activeSessionId:Qn,fetchSessions:c_,createSessionForPrompt:u_,selectSession:nl,renameSession:d_,toggleArchiveSession:f_,togglePinSession:p_,askDeleteSession:h_}=Q,ol=WL({getSessionId:()=>Q?.activeSessionId?.value??""}),v_=UL(),Ko=P(!1);function Ou(N){(N.metaKey||N.ctrlKey)&&(N.key==="k"||N.key==="K")&&(N.preventDefault(),Ko.value=!Ko.value)}const m_=T(()=>{const N=[];N.push({id:"new-chat",label:"新建会话",group:"会话"});for(const q of xn.value.filter($e=>!$e.archived&&$e.status!=="archived").slice(0,8))N.push({id:`session:${q.id}`,label:`打开会话:${q.title}`,group:"会话",keywords:q.title});for(const q of fe.value)N.push({id:`ws:${q.id}`,label:`切换工作区:${q.name}`,group:"工作区",keywords:q.name});for(const q of a)N.push({id:`perm:${q.id}`,label:`权限档:${q.label}`,group:"权限",keywords:q.id});const I=[["light","亮色"],["dark","暗色"],["system","跟随系统"]];for(const[q,$e]of I)N.push({id:`theme:${q}`,label:`主题:${$e}`,group:"外观"});return N.push({id:"open-settings",label:"打开设置",group:"操作"}),N.push({id:"usage-panel",label:"展开右侧用量面板",group:"操作"}),N.push({id:"compact",label:"压缩当前会话上下文",group:"操作",disabled:t.value||eo.value}),N.push({id:"stop",label:"中止当前运行",group:"操作",danger:!0,disabled:!eo.value}),N});function __(N){const I=N.id;if(I==="new-chat")Zs();else if(I.startsWith("session:")){const q=xn.value.find($e=>$e.id===I.slice(8));q&&nl(q)}else I.startsWith("ws:")?Zs(I.slice(3)):I.startsWith("perm:")?ml(I.slice(5)):I.startsWith("theme:")?v_.setPreference(I.slice(6)):I==="open-settings"?he.value=!0:I==="usage-panel"?o.value=!1:I==="compact"?vl():I==="stop"&&Uu();Ko.value=!1}const ms=P([]),sl=P(!1);function Pu(N){ms.value.unshift(N),ms.value.length>20&&(ms.value.length=20)}const Lu=new Set;Ee(z,N=>{for(const I of N){const q=String(I.id);!q||Lu.has(q)||(Lu.add(q),Pu({id:`approval-${q}`,title:"待审批决策",body:I.detail||I.title||"有操作等待你的批准",kind:"warning",createdAt:Date.now(),unread:!0}),sl.value=!0)}},{deep:!0});const Bu=new Map;Ee(()=>[...ee.sessionRunningMap.entries()],N=>{for(const[I,q]of N){const $e=Bu.get(I);if(Bu.set(I,q),$e===!0&&q===!1&&I!==Qn.value){const Ye=xn.value.find(bt=>bt.id===I);Pu({id:`done-${I}`,title:"任务已结束",body:`会话「${Ye?.title??I}」运行完成,点击查看`,kind:"success",createdAt:Date.now(),unread:!0})}}});function g_(N){if(N.unread=!1,N.id.startsWith("approval-"))o.value=!1;else if(N.id.startsWith("done-")){const I=xn.value.find(q=>q.id===N.id.slice(5));I&&nl(I)}}function b_(N){const I=ms.value.find(q=>q.id===N);I&&(I.unread=!1)}function y_(){for(const N of ms.value)N.unread=!1}const{chatTurns:Wo,planSteps:k_,isPlanVisible:w_,isPlanExpanded:il,completedStepsCount:x_,currentRunningStep:$_,isRunning:eo,sessionRunningMap:C_,contextUsed:fr,contextLimit:pr,sessionTokensUsed:ju,ctxParts:rl,resetTurns:A_,sendPrompt:Nu,stopExecution:Uu}=ee,zu=T(()=>Ze.value.map(N=>({id:N.id,label:N.label,meta:N.meta,provider:N.provider,model:N.model}))),Ku=T(()=>a.map(N=>({id:N.id,label:N.label,desc:N.desc}))),Wu=T(()=>rl.value.length>0?rl.value:[{id:"history",label:"对话历史",tokens:fr.value,kind:"history"}]),Js=P(!1),Ln=P([]),al=new Map;function S_(N){const I={id:`q-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,text:N};return Ln.value.push(I),De.add({title:"已加入队列",description:"当前会话运行中,结束后自动发送",kind:"info"}),I}function ll(N){const I=al.get(N);return I&&al.delete(N),I}function R_(N){const[I]=Ln.value.splice(N,1),q=I?ll(I.id):void 0;q&&Wl(q)}function E_(N){const[I]=Ln.value.splice(N,1);if(I){if(!eo.value){Ys(I.text,I.id);return}Ln.value.unshift(I)}}function D_(N,I){Ln.value[N]&&(Ln.value[N].text=I)}Ee(eo,(N,I)=>{if(I===!0&&N===!1&&Ln.value.length>0&&!t.value){const q=Ln.value.shift();q&&setTimeout(()=>{Ys(q.text,q.id)},400)}});const $n=P(!1),cl=P(""),Gs=P([]),ul=P(!1),Vo=P(0),dl=new Set;let Vu="";const hr=T(()=>{const N=cl.value.toLowerCase();return(N?Gs.value.filter(q=>q.toLowerCase().includes(N)):Gs.value).slice(0,50)}),T_=T(()=>$n.value?I_():null);function I_(){for(const N of Array.from(document.querySelectorAll(".va-console__main .va-cmp")))if(N.offsetParent!==null)return N;return null}async function qu(N){if(!(!N||Vu===N)){ul.value=!0;try{const I=await zv(N),q=[],$e=Ye=>{for(const bt of Ye??[])bt.type==="dir"&&Array.isArray(bt.children)?$e(bt.children):q.push(bt.path)};$e(I?.tree??[]),Gs.value=q,Vu=N}finally{ul.value=!1}}}Ee(s,N=>{const I=/(?:^|\s)@([^\s@]*)$/.exec(N);I&&L.value?(cl.value=I[1]??"",$n.value||($n.value=!0,Vo.value=0,qu(L.value))):$n.value&&($n.value=!1)});function Hu(N){s.value=s.value.replace(/(?:^|\s)@([^\s@]*)$/,I=>I.startsWith("@")?`@${N} `:` @${N} `),dl.add(N),$n.value=!1,C.value?.focus()}function Ju(){const N=s.value;/@([^\s@]*)$/.test(N)?(cl.value="",$n.value=!0):s.value=N&&!N.endsWith(" ")&&!N.endsWith(`
|
|
47
|
+
`)?`${N} @`:`${N}@`,qu(L.value),it(()=>C.value?.focus())}function Gu(N){if(!$n.value)return;const I=hr.value.length;if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault(),N.stopImmediatePropagation();const q=N.key==="ArrowDown"?1:-1;Vo.value=I>0?(Vo.value+q+I)%I:0}else if(N.key==="Enter"||N.key==="Tab"){const q=hr.value[Vo.value];q&&(N.preventDefault(),N.stopImmediatePropagation(),Hu(q))}else N.key==="Escape"&&(N.preventDefault(),N.stopImmediatePropagation(),$n.value=!1)}const ln=P([]),fl=new Map,pl=new Map,vr=new Map;function hl(){return{atts:ln.value,texts:fl,images:pl,files:vr}}const F_=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function Zu(N){for(const I of N.slice(0,6)){const q=`att-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,$e=I.type.startsWith("image/");if($e&&!Pe.value){De.add({title:"当前模型未声明支持图片输入",description:"在「模型设置 → 能力标记」中勾选图片后即可上传",kind:"warning"});continue}if($e){if(!F_.has(I.type)){De.add({title:`不支持的图片类型 ${I.type||"(未知)"}`,description:"支持 png / jpeg / webp / gif",kind:"warning"});continue}if(I.size>_B){De.add({title:`图片「${I.name}」超过 5MB 上限`,kind:"warning"});continue}if(ln.value.filter(bt=>bt.kind==="image").length>=xp){De.add({title:`单轮最多 ${xp} 张图片`,kind:"warning"});continue}}if(ln.value.push({id:q,name:I.name,size:I.size,kind:$e?"image":"file",previewUrl:$e?URL.createObjectURL(I):void 0}),$e){vr.set(q,I),Km(q,I,pl,vr);continue}const Ye=new FileReader;Ye.onload=()=>{if(!ln.value.some(_r=>_r.id===q))return;let bt=String(Ye.result??"");bt.length>wp&&(bt=`${bt.slice(0,wp)}
|
|
48
|
+
…(超出 48KB 已截断)`),fl.set(q,bt)},Ye.readAsText(I)}}function M_(){Wl(hl()),ln.value=[]}function Yu(N){const I=ln.value.find(q=>q.id===N);I?.previewUrl&&URL.revokeObjectURL(I.previewUrl),fl.delete(N),pl.delete(N),vr.delete(N),ln.value=ln.value.filter(q=>q.id!==N)}async function vl(){if(Js.value)return;const N=Qn.value;if(!N||t.value){De.add({title:"新会话暂无历史可压缩",kind:"info"});return}if(eo.value){De.add({title:"会话执行中,请等待本轮结束后再压缩",kind:"warning"});return}Js.value=!0;try{const I=await mD(N);if(!I.compacted){De.add({title:"历史较少,暂无需压缩",description:`当前占用 ${Wt(I.totalTokens)} tokens`,kind:"info"});return}fr.value=I.totalTokens,rl.value=I.parts?.length?I.parts:[{id:"history",label:"对话历史",tokens:I.totalTokens,kind:"history"}],De.add({title:`已压缩,释放 ${Wt(I.freed)} tokens`,description:`${I.compactedTurnCount} 轮早期历史已折叠为摘要`,kind:"success"})}catch(I){De.add({title:"压缩失败",description:I instanceof Error?I.message:String(I),kind:"danger"})}finally{Js.value=!1}}const O_=T(()=>fe.value.map(N=>({id:N.id,name:N.name,path:N.rootPath})));function P_(N){H(N)}const Xu=T(()=>Wo.value.flatMap(N=>N.trajEvents||[])),L_=T(()=>Wo.value.flatMap((N,I)=>{if(N.role!=="user")return[];const q=Wo.value[I+1],$e=(N.content||"").replace(/\s+/g," ").trim(),Ye=N.attachments?.length??0,bt=$e?$e.length>48?`${$e.slice(0,48)}…`:$e:Ye?`[附件 ×${Ye}]`:"(空消息)";return[{id:N.id,label:bt,role:"user",status:q?.role==="assistant"&&q.isStreaming?"streaming":void 0}]}));Ee(()=>ge.value?.contextWindow,N=>{N&&(ee.contextLimit.value=N)},{immediate:!0}),Ct(async()=>{De.state.toasts=[],window.addEventListener("keydown",Ou),window.addEventListener("keydown",Gu,!0),await le(),K=setInterval(()=>{le()},1e4),await y(),await W(),await c_(),await rn(),d(),ol.refresh(),ol.refreshLimits();const N=xn.value.find(I=>I.isRunning);N&&await Qu(N)}),Nc(()=>{window.removeEventListener("keydown",Ou),window.removeEventListener("keydown",Gu,!0),K!==void 0&&clearInterval(K)});function B_(N,I){N!==null&&De.add({title:N==="up"?"感谢认可!":"已记录反馈",description:I,kind:"success"})}function j_(N){if(eo.value)return;const I=Wo.value.findIndex($e=>$e.id===N);if(I<0)return;let q="";for(let $e=I-1;$e>=0;$e--)if(Wo.value[$e].role==="user"){q=Wo.value[$e].content;break}!q||!Qn.value||Nu(q,{sessionId:Qn.value,workspaceId:L.value,modelProfileId:Ie.value,permission:r.value,reasoningEffort:Re.value||void 0})}function Zs(N){N&&(L.value=N),Qn.value="",t.value=!0,n.value="chat",r.value=i.value,wn(),A_(),s.value="",it(()=>C.value?.focus())}async function Qu(N){n.value="chat",await nl(N);const I=N.activeModelProfileId;I&&Ze.value.some(q=>q.id===I)&&(Ie.value=I)}async function ml(N){r.value=N;const I=Qn.value;if(!(!I||t.value))try{const q=await yi(I,{permission:N});if(q){const $e=xn.value.findIndex(Ye=>Ye.id===I);$e>=0&&(xn.value[$e]=q)}}catch(q){console.error("持久化权限模式失败:",q)}}async function ed(N){Ie.value=N;const I=Qn.value;if(!(!I||t.value))try{const q=await yi(I,{activeModelProfileId:N});if(q){const $e=xn.value.findIndex(Ye=>Ye.id===I);$e>=0&&(xn.value[$e]=q)}}catch(q){console.error("持久化模型档失败:",q)}}async function Ys(N,I){if(eo.value){const yt=(N??s.value).trim();if(!yt)return;const td=I?ll(I):N?void 0:bL(hl()),z_=S_(yt);td&&(al.set(z_.id,td),!I&&!N&&(ln.value=[]));return}let q=(N??s.value).trim();const $e=[...dl].filter(yt=>q.includes(`@${yt}`));if($e.length>0){q+=$e.map(yt=>`
|
|
49
|
+
|
|
50
|
+
[@引用文件] ${yt}`).join("");for(const yt of $e)dl.delete(yt)}const Ye=I?ll(I):void 0,bt=Ye??hl(),_r=!!N&&!Ye,N_=_r?void 0:await kL(bt),U_=_r?void 0:yL(bt);if(!N&&ln.value.length>0){const yt=gp(bt);q=q?`${yt}${q}`:yt.trim(),M_()}else if(Ye){const yt=gp(Ye);yt&&(q=q?`${yt}${q}`:yt.trim()),Wl(Ye)}if(!q||!await ze())return;let _l=Qn.value;if(t.value||!_l){const yt=await u_({workspaceId:L.value,title:q.slice(0,24),activeModelProfileId:Ie.value,permission:r.value});yt&&(_l=yt.id,t.value=!1,ct("",yt.id))}s.value="",n.value="chat",await Nu(q,{sessionId:_l,workspaceId:L.value,modelProfileId:Ie.value,permission:r.value,reasoningEffort:Re.value||void 0,images:N_,attachments:U_})}function mr(N){s.value=N,Ys()}return(N,I)=>(h(),b("div",VL,[j(z5,{workspaces:p(fe),sessions:p(xn),loading:p(l_)&&p(xn).length===0,"active-workspace-id":p(L),"active-session-id":p(Qn),"is-new-chat":t.value,"session-running-map":p(C_),onStartNewChat:Zs,onSelectSession:Qu,onPickWorkspace:p(Y),onDeleteWorkspace:p(Ae),onRenameSession:p(d_),onToggleArchive:p(f_),onTogglePin:p(p_),onDeleteSession:p(h_),onOpenSettings:a_,notifications:ms.value,"notif-open":sl.value,"onUpdate:notifOpen":I[0]||(I[0]=q=>sl.value=q),onOpenNotification:g_,onReadNotification:b_,onAllRead:y_},null,8,["workspaces","sessions","loading","active-workspace-id","active-session-id","is-new-chat","session-running-map","onPickWorkspace","onDeleteWorkspace","onRenameSession","onToggleArchive","onTogglePin","onDeleteSession","notifications","notif-open"]),f("main",qL,[j(p(ho),{open:$n.value,"onUpdate:open":I[1]||(I[1]=q=>$n.value=q),anchor:T_.value,placement:"top-start",offset:6,"close-on-outside-click":!0,"close-on-escape":!1},{default:we(()=>[f("div",HL,[ul.value?(h(),b("div",JL,[(h(),b(G,null,me(3,q=>j(p(lo),{key:q,height:22,radius:"6px",width:q===2?"84%":"100%"},null,8,["width"])),64))])):hr.value.length>0?(h(!0),b(G,{key:1},me(hr.value,(q,$e)=>(h(),b("button",{key:q,class:ye(["va-console__mention-item",{"va-console__mention-item--active":$e===Vo.value}]),type:"button",role:"option","aria-selected":$e===Vo.value,onMouseenter:Ye=>Vo.value=$e,onClick:Ye=>Hu(q)},[f("span",ZL,A(q),1)],42,GL))),128)):(h(),b("p",YL," 无匹配文件(输入 @路径关键词 过滤工作区文件) "))])]),_:1},8,["open","anchor"]),j(p(DC),{open:Ko.value,"onUpdate:open":I[2]||(I[2]=q=>Ko.value=q),commands:m_.value,"trigger-label":"命令",hotkey:"⌘K","hide-trigger":"",onSelect:__},null,8,["open","commands"]),t.value?(h(),b("section",XL,[f("div",QL,[j(p(Y2),{workspaces:O_.value,title:"准备好开启新任务了吗?",description:"面向工程任务的自主 Agent 工作台:支持代码修改、工具执行与丰富场景卡片",onCreateSession:P_,onCreateWorkspace:p(Y)},null,8,["workspaces","onCreateWorkspace"]),f("div",eB,[j(p(Xd),{ref_key:"composerRef",ref:C,text:s.value,"onUpdate:text":I[6]||(I[6]=q=>s.value=q),placeholder:"给 Agent 一个任务(如:重构认证模块并编写单元测试)…",disabled:p(eo),"max-height":180,models:zu.value,model:p(Ie),permissions:Ku.value,permission:r.value,attachable:"",attachments:ln.value,"mention-paths":Gs.value,onSend:I[7]||(I[7]=()=>Ys()),"onUpdate:model":ed,"onUpdate:permission":ml,onFilesSelected:Zu,onRemoveAttachment:Yu},{actions:we(()=>[j(p(ho),{placement:"top-start",offset:8},{trigger:we(()=>[f("button",tB,[j(p(Wf),{size:12}),f("span",nB,"Context: "+A(p(Wt)(p(fr)))+" / "+A(p(Wt)(p(pr))),1),f("span",oB,"· Session: "+A(p(Wt)(p(ju))),1),j(p(Bi),{size:11})])]),default:we(()=>[f("div",sB,[j(p(Vd),{parts:Wu.value,capacity:p(pr),removable:!1,compacting:Js.value,onCompact:vl},null,8,["parts","capacity","compacting"])])]),_:1}),p(ot).length?(h(),ce(_p,{key:0,options:p(ot),"model-value":p(Re),onSelect:p(nt)},null,8,["options","model-value","onSelect"])):E("",!0)]),trailing:we(()=>[j(Yf,{"workspace-id":p(L),onRefFile:Ju,onClear:I[3]||(I[3]=q=>s.value=""),onInsert:I[4]||(I[4]=q=>s.value+=q),onOpenCommandMenu:I[5]||(I[5]=q=>Ko.value=!0)},null,8,["workspace-id"])]),_:1},8,["text","disabled","models","model","permissions","permission","attachments","mention-paths"]),f("div",iB,[I[35]||(I[35]=f("span",{class:"va-console__sug-label"},"试着运行:",-1)),f("button",{class:"va-console__chip",type:"button",onClick:I[8]||(I[8]=q=>mr("重构 auth 认证模块,抽取 JWT 校验并编写单元测试"))}," 重构认证模块并补全测试 "),f("button",{class:"va-console__chip",type:"button",onClick:I[9]||(I[9]=q=>mr("分析项目中所有涉及文件修改的代码,做一次安全合规检查"))}," 代码安全与依赖审计 "),f("button",{class:"va-console__chip",type:"button",onClick:I[10]||(I[10]=q=>mr("创建端到端自动化测试脚本并生成报告"))}," 生成自动化测试用例 "),f("button",{class:"va-console__chip",type:"button",onClick:I[11]||(I[11]=q=>mr("请分析当前项目的架构设计、核心模块划分与潜在代码风险"))}," 分析项目架构与潜在风险 ")])])])])):(h(),b("div",rB,[f("section",aB,[j(p(Yh),{modelValue:n.value,"onUpdate:modelValue":I[12]||(I[12]=q=>n.value=q),options:[{value:"chat",label:"对话"},{value:"traj",label:"轨迹"}],"aria-label":"主区视图"},null,8,["modelValue"]),Ve(f("div",lB,[f("div",{ref_key:"chatScrollRef",ref:w,class:"va-console__messages-stream",onScrollPassive:I[15]||(I[15]=(...q)=>p(O)&&p(O)(...q))},[j(pL,{turns:p(Wo),onApprove:I[13]||(I[13]=q=>p(ve)(q,!0)),onDeny:I[14]||(I[14]=(q,$e)=>p(ve)(q,!1,$e)),onRegenerate:j_,onFeedback:B_},null,8,["turns"])],544),j(p(u5),{items:L_.value,container:w.value,class:"va-console__turn-rail"},null,8,["items","container"]),p(R)?E("",!0):(h(),b("button",{key:0,class:"va-console__scroll-bottom",type:"button",onClick:I[16]||(I[16]=q=>p(B)({force:!0}))},[j(p(p5),{size:13}),I[36]||(I[36]=f("span",null,"回到底部",-1))]))],512),[[ic,n.value==="chat"]]),Ve(f("div",cB,[Xu.value.length>0?(h(),ce(p(cc),{key:0,events:Xu.value,"ledger-max-height":void 0,bordered:!1,"split-detail":""},null,8,["events"])):(h(),b("div",uB,[j(p(D5),{size:20}),I[37]||(I[37]=f("p",null,"本轮会话还没有轨迹",-1)),I[38]||(I[38]=f("small",null,"发送任务后,执行步骤将实时显示在这里",-1))]))],512),[[ic,n.value==="traj"]]),p(w_)?(h(),ce(cT,{key:0,steps:p(k_),completed:p(x_),running:p($_),expanded:p(il),onToggle:I[17]||(I[17]=q=>il.value=!p(il))},null,8,["steps","completed","running","expanded"])):E("",!0),f("div",dB,[Ln.value.length>0?(h(),ce(p(wk),{key:0,class:"va-console__queuedock",items:Ln.value,onRemove:R_,onSendNow:E_,onEdit:D_},null,8,["items"])):E("",!0),j(p(Xd),{ref_key:"composerRef",ref:C,text:s.value,"onUpdate:text":I[21]||(I[21]=q=>s.value=q),placeholder:"继续指令或追问…",busy:p(eo),models:zu.value,model:p(Ie),permissions:Ku.value,permission:r.value,attachable:"",attachments:ln.value,"mention-paths":Gs.value,onSend:I[22]||(I[22]=()=>Ys()),onStop:p(Uu),"onUpdate:model":ed,"onUpdate:permission":ml,onFilesSelected:Zu,onRemoveAttachment:Yu},{actions:we(()=>[j(p(ho),{placement:"top-start",offset:8},{trigger:we(()=>[f("button",fB,[j(p(Wf),{size:12}),f("span",pB,"Context: "+A(p(Wt)(p(fr)))+" / "+A(p(Wt)(p(pr))),1),f("span",hB,"· Session: "+A(p(Wt)(p(ju))),1),j(p(Bi),{size:11})])]),default:we(()=>[f("div",vB,[j(p(Vd),{parts:Wu.value,capacity:p(pr),removable:!1,compacting:Js.value,onCompact:vl},null,8,["parts","capacity","compacting"])])]),_:1}),p(ot).length?(h(),ce(_p,{key:0,options:p(ot),"model-value":p(Re),onSelect:p(nt)},null,8,["options","model-value","onSelect"])):E("",!0)]),trailing:we(()=>[j(Yf,{"workspace-id":p(L),onRefFile:Ju,onClear:I[18]||(I[18]=q=>s.value=""),onInsert:I[19]||(I[19]=q=>s.value+=q),onOpenCommandMenu:I[20]||(I[20]=q=>Ko.value=!0)},null,8,["workspace-id"])]),_:1},8,["text","busy","models","model","permissions","permission","attachments","mention-paths","onStop"])])]),o.value?(h(),ce(p(ov),{key:1,content:"展开侧栏",placement:"left"},{default:we(()=>[f("button",{class:"va-console__rsb-reopen",type:"button","aria-label":"展开侧栏",onClick:I[24]||(I[24]=q=>o.value=!1)},[j(p(jr),{size:15}),z.value.length>0?(h(),b("span",mB,A(z.value.length),1)):E("",!0)])]),_:1})):(h(),ce(eT,{key:0,decisions:z.value,"workspace-id":p(L),usage:p(ol),onDecide:ae,onCollapse:I[23]||(I[23]=q=>o.value=!0)},null,8,["decisions","workspace-id","usage"]))]))]),j(ST,{open:p(he),"active-tab":tl.value,"onUpdate:activeTab":I[34]||(I[34]=q=>tl.value=q),onClose:p(Lt)},{models:we(()=>[j(FP,{providers:p(Rt),"selected-provider-id":p(Xt),"is-creating-provider":p(Me),"current-provider":p(S),"current-provider-models":p(M),"provider-form":p(Z),"model-draft":p(ie),"is-creating-model":p(te),"show-api-key":p(oe),"is-testing-connection":p(de),"testing-profile-id":p(o_),onTestModel:p(n_),"is-discovering":p(ue),"test-status":p(D),"discovered-models":p(V),"discovered-items":p(ne),"is-verifying-capabilities":p(F),"capability-verdicts":p(U),onClose:p(Lt),onSelectProvider:p(an),onCreateProvider:p(ur),onDeleteProvider:p(Hm),onCreateModel:p(Jm),onEditModel:p(Gm),onDeleteModel:p(Xm),onCancelModelEdit:p(Zm),onSaveProvider:p(qm),onSaveModel:p(Ym),onTest:p(t_),onDiscover:p(Qm),onSelectModel:p(e_),onProviderKindChange:p(dr),"onUpdate:showApiKey":I[25]||(I[25]=q=>oe.value=q),onToggleModality:p(s_),onToggleReasoning:p(i_),onToggleToolUse:p(r_),onVerifyCapabilities:p(_e)},null,8,["providers","selected-provider-id","is-creating-provider","current-provider","current-provider-models","provider-form","model-draft","is-creating-model","show-api-key","is-testing-connection","testing-profile-id","onTestModel","is-discovering","test-status","discovered-models","discovered-items","is-verifying-capabilities","capability-verdicts","onClose","onSelectProvider","onCreateProvider","onDeleteProvider","onCreateModel","onEditModel","onDeleteModel","onCancelModelEdit","onSaveProvider","onSaveModel","onTest","onDiscover","onSelectModel","onProviderKindChange","onToggleModality","onToggleReasoning","onToggleToolUse","onVerifyCapabilities"])]),interaction:we(()=>[j(UP)]),tools:we(()=>[j(w7,{tools:p(l),loading:p(c),"load-error":p(u),onToggle:p(_)},null,8,["tools","loading","load-error","onToggle"])]),execution:we(()=>[j(Mr,{namespace:p(m)("execution"),loading:p(v),"load-error":p(g),onPatch:I[26]||(I[26]=(q,$e)=>p(x)("execution",q,$e)),onReset:I[27]||(I[27]=q=>p($)("execution"))},null,8,["namespace","loading","load-error"]),j(Mr,{namespace:p(m)("finops"),loading:p(v),"load-error":p(g),onPatch:I[28]||(I[28]=(q,$e)=>p(x)("finops",q,$e)),onReset:I[29]||(I[29]=q=>p($)("finops"))},null,8,["namespace","loading","load-error"])]),security:we(()=>[j(Mr,{namespace:p(m)("security"),loading:p(v),"load-error":p(g),onPatch:I[30]||(I[30]=(q,$e)=>p(x)("security",q,$e)),onReset:I[31]||(I[31]=q=>p($)("security"))},null,8,["namespace","loading","load-error"])]),prompt:we(()=>[j(Mr,{namespace:p(m)("prompt"),loading:p(v),"load-error":p(g),onPatch:I[32]||(I[32]=(q,$e)=>p(x)("prompt",q,$e)),onReset:I[33]||(I[33]=q=>p($)("prompt"))},null,8,["namespace","loading","load-error"])]),_:1},8,["open","active-tab","onClose"]),j(p(Ux)),j(p(bS)),j(mT)]))}}),bB={class:"va-deploy-card"},yB={class:"va-deploy-card__header"},kB={class:"va-deploy-card__title-row"},wB={class:"va-deploy-card__icon-wrap"},xB={class:"va-deploy-card__name-block"},$B={class:"va-deploy-card__name"},CB={class:"va-deploy-card__version"},AB={class:"va-deploy-card__status-row"},SB={class:"va-deploy-card__metrics"},RB={class:"va-deploy-card__metric-item"},EB={class:"va-deploy-card__metric-val"},DB={class:"va-deploy-card__metric-item"},TB={class:"va-deploy-card__metric-val"},IB={class:"va-deploy-card__metric-item"},FB={class:"va-deploy-card__metric-val"},MB={key:0,class:"va-deploy-card__section"},OB={class:"va-deploy-card__endpoints"},PB=["title"],LB=["title","onClick"],BB={key:1,class:"va-deploy-card__commit"},jB={class:"va-deploy-card__commit-hash"},NB={class:"va-deploy-card__commit-msg"},UB={key:0,class:"va-deploy-card__commit-author"},zB={class:"va-deploy-card__footer"},KB=["disabled"],WB=Ce({__name:"DeployStatusCard",props:{serviceName:{},environment:{},version:{},status:{},endpoints:{default:()=>[]},metrics:{default:()=>({cpu:"12%",memory:"256 MB",replicas:"2/2 Ready"})},commit:{}},setup(e){const t=e,n=P(null),o=P(!1),s=T(()=>{switch(t.status){case"healthy":return{label:"健康运行",color:"#16a34a",bg:"#f0fdf4",border:"#bbf7d0",pulse:!0};case"deploying":return{label:"部署更新中",color:"#2563eb",bg:"#eff6ff",border:"#bfdbfe",spin:!0};case"degraded":return{label:"性能降级",color:"#d97706",bg:"#fffbeb",border:"#fde68a"};case"failed":return{label:"服务异常",color:"#dc2626",bg:"#fef2f2",border:"#fecaca"};default:return{label:t.status,color:"#64748b",bg:"#f8fafc",border:"#e2e8f0"}}}),i=T(()=>{switch(t.environment){case"production":return{label:"PROD 生产",bg:"#fee2e2",color:"#991b1b"};case"staging":return{label:"STAGE 预发",bg:"#e0e7ff",color:"#3730a3"};case"preview":return{label:"PREVIEW 预览",bg:"#f3e8ff",color:"#6b21a8"};default:return{label:t.environment.toUpperCase(),bg:"#f1f5f9",color:"#334155"}}});async function r(l){try{await navigator.clipboard.writeText(l),n.value=l,setTimeout(()=>{n.value===l&&(n.value=null)},2e3)}catch{}}function a(){o.value=!0,setTimeout(()=>{o.value=!1},800)}return(l,c)=>(h(),b("div",bB,[f("div",yB,[f("div",kB,[f("div",wB,[j(p(T5),{size:16})]),f("div",xB,[f("span",$B,A(e.serviceName),1),f("span",CB,A(e.version),1)]),c[0]||(c[0]=f("span",{class:"va-deploy-card__badge-scene"},"场景组件 UI",-1))]),f("div",AB,[f("span",{class:"va-deploy-card__env",style:Le({backgroundColor:i.value.bg,color:i.value.color})},A(i.value.label),5),f("span",{class:"va-deploy-card__status",style:Le({backgroundColor:s.value.bg,color:s.value.color,borderColor:s.value.border})},[f("span",{class:ye(["va-deploy-card__status-dot",{"va-deploy-card__status-dot--pulse":s.value.pulse}]),style:Le({backgroundColor:s.value.color})},null,6),pe(" "+A(s.value.label),1)],4)])]),f("div",SB,[f("div",RB,[c[1]||(c[1]=f("span",{class:"va-deploy-card__metric-label"},"实例副本",-1)),f("span",EB,A(e.metrics?.replicas||"1/1"),1)]),f("div",DB,[c[2]||(c[2]=f("span",{class:"va-deploy-card__metric-label"},"CPU 负载",-1)),f("span",TB,A(e.metrics?.cpu||"8%"),1)]),f("div",IB,[c[3]||(c[3]=f("span",{class:"va-deploy-card__metric-label"},"内存占用",-1)),f("span",FB,A(e.metrics?.memory||"180 MB"),1)])]),e.endpoints&&e.endpoints.length>0?(h(),b("div",MB,[c[4]||(c[4]=f("span",{class:"va-deploy-card__sec-title"},"服务访问入口",-1)),f("div",OB,[(h(!0),b(G,null,me(e.endpoints,u=>(h(),b("div",{key:u,class:"va-deploy-card__endpoint-row"},[f("span",{class:"va-deploy-card__endpoint-url",title:u},A(u),9,PB),f("button",{type:"button",class:"va-deploy-card__btn-copy",title:n.value===u?"已复制":"复制端点",onClick:d=>r(u)},[n.value===u?(h(),ce(p(ra),{key:0,size:12,style:{color:"#16a34a"}})):(h(),ce(p(_5),{key:1,size:12}))],8,LB)]))),128))])])):E("",!0),e.commit?(h(),b("div",BB,[f("span",jB,"#"+A(e.commit.hash),1),f("span",NB,A(e.commit.message),1),e.commit.author?(h(),b("span",UB,"by "+A(e.commit.author),1)):E("",!0)])):E("",!0),f("div",zB,[f("button",{type:"button",class:"va-deploy-card__action-btn",disabled:o.value,onClick:a},[j(p(Nv),{size:12,class:ye({"va-spin":o.value})},null,8,["class"]),f("span",null,A(o.value?"正在探针巡检…":"探针巡检"),1)],8,KB),c[5]||(c[5]=f("span",{class:"va-deploy-card__footer-hint"},"由 @vuagent/ui CardRegistry 动态挂载",-1))])]))}}),VB=mR(WB,[["__scopeId","data-v-15bb3b4f"]]);function qB(){yR("ui_deploy_status",VB)}function HB(e,t={}){t.registerBuiltins!==!1&&qB();const n=D0(gB);return n.mount(e),n}HB("#app");
|