sensorium-mcp 3.0.36 → 3.0.38

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.
@@ -49,27 +49,27 @@
49
49
  * @vue/shared v3.5.31
50
50
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
51
51
  * @license MIT
52
- **/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const xe={},Dt=[],st=()=>{},po=()=>!1,Es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),As=e=>e.startsWith("onUpdate:"),Ae=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},yr=Object.prototype.hasOwnProperty,ce=(e,t)=>yr.call(e,t),Z=Array.isArray,Rt=e=>us(e)==="[object Map]",Bt=e=>us(e)==="[object Set]",In=e=>us(e)==="[object Date]",X=e=>typeof e=="function",Ce=e=>typeof e=="string",ot=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object",mo=e=>(fe(e)||X(e))&&X(e.then)&&X(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),br=e=>us(e).slice(8,-1),ho=e=>us(e)==="[object Object]",un=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=an(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Is=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=Is(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=Is(e=>e.replace(wr,"-$1").toLowerCase()),Ps=Is(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=Is(e=>e?`on${Ps(e)}`:""),tt=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Ms=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Pn;const Os=()=>Pn||(Pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Lt(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],o=Ce(n)?$r(n):Lt(n);if(o)for(const l in o)t[l]=o[l]}return t}else if(Ce(e)||fe(e))return e}const kr=/;(?![^(]*\))/g,Sr=/:([^]+)/,Cr=/\/\*[^]*?\*\//g;function $r(e){const t={};return e.replace(Cr,"").split(kr).forEach(s=>{if(s){const n=s.split(Sr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function J(e){let t="";if(Ce(e))t=e;else if(Z(e))for(let s=0;s<e.length;s++){const n=J(e[s]);n&&(t+=n+" ")}else if(fe(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Er=an(Tr);function vo(e){return!!e||e===""}function Ar(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Kt(e[n],t[n]);return s}function Kt(e,t){if(e===t)return!0;let s=In(e),n=In(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=ot(e),n=ot(t),s||n)return e===t;if(s=Z(e),n=Z(t),s||n)return s&&n?Ar(e,t):!1;if(s=fe(e),n=fe(t),s||n){if(!s||!n)return!1;const o=Object.keys(e).length,l=Object.keys(t).length;if(o!==l)return!1;for(const a in e){const c=e.hasOwnProperty(a),u=t.hasOwnProperty(a);if(c&&!u||!c&&u||!Kt(e[a],t[a]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Kt(s,t))}const yo=e=>!!(e&&e.__v_isRef===!0),_=e=>Ce(e)?e:e==null?"":Z(e)||fe(e)&&(e.toString===xo||!X(e.toString))?yo(e)?_(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>yo(t)?bo(e,t.value):Rt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],l)=>(s[Fs(n,l)+" =>"]=o,s),{})}:Bt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Fs(s))}:ot(t)?Fs(t):fe(t)&&!Z(t)&&!ho(t)?String(t):t,Fs=(e,t="")=>{var s;return ot(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
52
+ **/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const he={},Dt=[],nt=()=>{},po=()=>!1,As=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Es=e=>e.startsWith("onUpdate:"),Ee=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},yr=Object.prototype.hasOwnProperty,ce=(e,t)=>yr.call(e,t),Q=Array.isArray,Rt=e=>us(e)==="[object Map]",Ht=e=>us(e)==="[object Set]",In=e=>us(e)==="[object Date]",te=e=>typeof e=="function",$e=e=>typeof e=="string",rt=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object",mo=e=>(fe(e)||te(e))&&te(e.then)&&te(e.catch),ho=Object.prototype.toString,us=e=>ho.call(e),br=e=>us(e).slice(8,-1),xo=e=>us(e)==="[object Object]",un=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=an(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Is=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,je=Is(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=Is(e=>e.replace(wr,"-$1").toLowerCase()),Ps=Is(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=Is(e=>e?`on${Ps(e)}`:""),st=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Ms=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Pn;const Os=()=>Pn||(Pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Lt(e){if(Q(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],o=$e(n)?Cr(n):Lt(n);if(o)for(const l in o)t[l]=o[l]}return t}else if($e(e)||fe(e))return e}const kr=/;(?![^(]*\))/g,Sr=/:([^]+)/,$r=/\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace($r,"").split(kr).forEach(s=>{if(s){const n=s.split(Sr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function G(e){let t="";if($e(e))t=e;else if(Q(e))for(let s=0;s<e.length;s++){const n=G(e[s]);n&&(t+=n+" ")}else if(fe(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ar=an(Tr);function vo(e){return!!e||e===""}function Er(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Kt(e[n],t[n]);return s}function Kt(e,t){if(e===t)return!0;let s=In(e),n=In(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=rt(e),n=rt(t),s||n)return e===t;if(s=Q(e),n=Q(t),s||n)return s&&n?Er(e,t):!1;if(s=fe(e),n=fe(t),s||n){if(!s||!n)return!1;const o=Object.keys(e).length,l=Object.keys(t).length;if(o!==l)return!1;for(const a in e){const c=e.hasOwnProperty(a),u=t.hasOwnProperty(a);if(c&&!u||!c&&u||!Kt(e[a],t[a]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Kt(s,t))}const yo=e=>!!(e&&e.__v_isRef===!0),v=e=>$e(e)?e:e==null?"":Q(e)||fe(e)&&(e.toString===ho||!te(e.toString))?yo(e)?v(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>yo(t)?bo(e,t.value):Rt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],l)=>(s[Fs(n,l)+" =>"]=o,s),{})}:Ht(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Fs(s))}:rt(t)?Fs(t):fe(t)&&!Q(t)&&!xo(t)?String(t):t,Fs=(e,t="")=>{var s;return rt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
53
53
  * @vue/reactivity v3.5.31
54
54
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
55
55
  * @license MIT
56
- **/let Ne;class Ir{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ne,!t&&Ne&&(this.index=(Ne.scopes||(Ne.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Ne;try{return Ne=this,t()}finally{Ne=s}}}on(){++this._on===1&&(this.prevScope=Ne,Ne=this)}off(){this._on>0&&--this._on===0&&(Ne=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Pr(){return Ne}let ge;const Hs=new WeakSet;class _o{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,Ne&&Ne.active&&Ne.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hs.has(this)&&(Hs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ko(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mn(this),So(this);const t=ge,s=Be;ge=this,Be=!0;try{return this.fn()}finally{Co(this),ge=t,Be=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mn(t);this.deps=this.depsTail=void 0,Mn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Qt,Xt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Xt,Xt=e;return}e.next=Qt,Qt=e}function fn(){wo++}function pn(){if(--wo>0)return;if(Xt){let t=Xt;for(Xt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Co(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),mn(n),Mr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($o(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $o(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=ge,n=Be;ge=e,Be=!0;try{So(e);const o=e.fn(e._value);(t.version===0||tt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ge=s,Be=n,Co(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let l=s.computed.deps;l;l=l.nextDep)mn(l,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Mr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Be=!0;const To=[];function xt(){To.push(Be),Be=!1}function ht(){const e=To.pop();Be=e===void 0?!0:e}function Mn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ge;ge=void 0;try{t()}finally{ge=s}}}let os=0;class Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class xn{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(!ge||!Be||ge===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ge)s=this.activeLink=new Or(ge,this),ge.deps?(s.prevDep=ge.depsTail,ge.depsTail.nextDep=s,ge.depsTail=s):ge.deps=ge.depsTail=s,Eo(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ge.depsTail,s.nextDep=void 0,ge.depsTail.nextDep=s,ge.depsTail=s,ge.deps===s&&(ge.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){fn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{pn()}}}function Eo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Eo(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,Et=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ie(e,t,s){if(Be&&ge){let n=Zs.get(e);n||Zs.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new xn),o.map=n,o.key=s),o.track()}}function ft(e,t,s,n,o,l){const a=Zs.get(e);if(!a){os++;return}const c=u=>{u&&u.trigger()};if(fn(),t==="clear")a.forEach(c);else{const u=Z(e),x=u&&un(s);if(u&&s==="length"){const d=Number(n);a.forEach((m,y)=>{(y==="length"||y===rs||!ot(y)&&y>=d)&&c(m)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),x&&c(a.get(rs)),t){case"add":u?x&&c(a.get("length")):(c(a.get(Et)),Rt(e)&&c(a.get(Qs)));break;case"delete":u||(c(a.get(Et)),Rt(e)&&c(a.get(Qs)));break;case"set":Rt(e)&&c(a.get(Et));break}}pn()}function Mt(e){const t=ae(e);return t===e?t:(Ie(t,"iterate",rs),He(e)?t:t.map(Ke))}function Ds(e){return Ie(e=ae(e),"iterate",rs),e}function Qe(e,t){return gt(e)?Ut(At(e)?Ke(t):t):Ke(t)}const Dr={__proto__:null,[Symbol.iterator](){return Bs(this,Symbol.iterator,e=>Qe(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>Z(t)?Mt(t):t))},entries(){return Bs(this,"entries",e=>(e[1]=Qe(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,s=>s.map(n=>Qe(this,n)),arguments)},find(e,t){return ct(this,"find",e,t,s=>Qe(this,s),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,s=>Qe(this,s),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return On(this,"reduce",e,t)},reduceRight(e,...t){return On(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Bs(this,"values",e=>Qe(this,e))}};function Bs(e,t,s){const n=Ds(e),o=n[t]();return n!==e&&!He(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=s(l.value)),l}),o}const Rr=Array.prototype;function ct(e,t,s,n,o,l){const a=Ds(e),c=a!==e&&!He(e),u=a[t];if(u!==Rr[t]){const m=u.apply(e,l);return c?Ke(m):m}let x=s;a!==e&&(c?x=function(m,y){return s.call(this,Qe(e,m),y,e)}:s.length>2&&(x=function(m,y){return s.call(this,m,y,e)}));const d=u.call(a,x,n);return c&&o?o(d):d}function On(e,t,s,n){const o=Ds(e),l=o!==e&&!He(e);let a=s,c=!1;o!==e&&(l?(c=n.length===0,a=function(x,d,m){return c&&(c=!1,x=Qe(e,x)),s.call(this,x,Qe(e,d),m,e)}):s.length>3&&(a=function(x,d,m){return s.call(this,x,d,m,e)}));const u=o[t](a,...n);return c?Qe(e,u):u}function Ks(e,t,s){const n=ae(e);Ie(n,"iterate",rs);const o=n[t](...s);return(o===-1||o===!1)&&yn(s[0])?(s[0]=ae(s[0]),n[t](...s)):o}function zt(e,t,s=[]){xt(),fn();const n=ae(e)[t].apply(e,s);return pn(),ht(),n}const jr=an("__proto__,__v_isRef,__isVue"),Ao=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ot));function Nr(e){ot(e)||(e=String(e));const t=ae(this);return Ie(t,"has",e),t.hasOwnProperty(e)}class Io{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(o?l?Jr:Do:l?Oo:Mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=Z(t);if(!o){let u;if(a&&(u=Dr[s]))return u;if(s==="hasOwnProperty")return Nr}const c=Reflect.get(t,s,Me(t)?t:n);if((ot(s)?Ao.has(s):jr(s))||(o||Ie(t,"get",s),l))return c;if(Me(c)){const u=a&&un(s)?c:c.value;return o&&fe(u)?en(u):u}return fe(c)?o?en(c):gn(c):c}}class Po extends Io{constructor(t=!1){super(!1,t)}set(t,s,n,o){let l=t[s];const a=Z(t)&&un(s);if(!this._isShallow){const x=gt(l);if(!He(n)&&!gt(n)&&(l=ae(l),n=ae(n)),!a&&Me(l)&&!Me(n))return x||(l.value=n),!0}const c=a?Number(s)<t.length:ce(t,s),u=Reflect.set(t,s,n,Me(t)?t:o);return t===ae(o)&&(c?tt(n,l)&&ft(t,"set",s,n):ft(t,"add",s,n)),u}deleteProperty(t,s){const n=ce(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&ft(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!ot(s)||!Ao.has(s))&&Ie(t,"has",s),n}ownKeys(t){return Ie(t,"iterate",Z(t)?"length":Et),Reflect.ownKeys(t)}}class Lr extends Io{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Po,Vr=new Lr,Fr=new Po(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Hr(e,t,s){return function(...n){const o=this.__v_raw,l=ae(o),a=Rt(l),c=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,x=o[e](...n),d=s?Xs:t?Ut:Ke;return!t&&Ie(l,"iterate",u?Qs:Et),Ae(Object.create(x),{next(){const{value:m,done:y}=x.next();return y?{value:m,done:y}:{value:c?[d(m[0]),d(m[1])]:d(m),done:y}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Br(e,t){const s={get(o){const l=this.__v_raw,a=ae(l),c=ae(o);e||(tt(o,c)&&Ie(a,"get",o),Ie(a,"get",c));const{has:u}=ps(a),x=t?Xs:e?Ut:Ke;if(u.call(a,o))return x(l.get(o));if(u.call(a,c))return x(l.get(c));l!==a&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Ie(ae(o),"iterate",Et),o.size},has(o){const l=this.__v_raw,a=ae(l),c=ae(o);return e||(tt(o,c)&&Ie(a,"has",o),Ie(a,"has",c)),o===c?l.has(o):l.has(o)||l.has(c)},forEach(o,l){const a=this,c=a.__v_raw,u=ae(c),x=t?Xs:e?Ut:Ke;return!e&&Ie(u,"iterate",Et),c.forEach((d,m)=>o.call(l,x(d),x(m),a))}};return Ae(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(o){const l=ae(this),a=ps(l),c=ae(o),u=!t&&!He(o)&&!gt(o)?c:o;return a.has.call(l,u)||tt(o,u)&&a.has.call(l,o)||tt(c,u)&&a.has.call(l,c)||(l.add(u),ft(l,"add",u,u)),this},set(o,l){!t&&!He(l)&&!gt(l)&&(l=ae(l));const a=ae(this),{has:c,get:u}=ps(a);let x=c.call(a,o);x||(o=ae(o),x=c.call(a,o));const d=u.call(a,o);return a.set(o,l),x?tt(l,d)&&ft(a,"set",o,l):ft(a,"add",o,l),this},delete(o){const l=ae(this),{has:a,get:c}=ps(l);let u=a.call(l,o);u||(o=ae(o),u=a.call(l,o)),c&&c.call(l,o);const x=l.delete(o);return u&&ft(l,"delete",o,void 0),x},clear(){const o=ae(this),l=o.size!==0,a=o.clear();return l&&ft(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Hr(o,e,t)}),s}function hn(e,t){const s=Br(e,t);return(n,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(ce(s,o)&&o in n?s:n,o,l)}const Kr={get:hn(!1,!1)},Wr={get:hn(!1,!0)},zr={get:hn(!0,!1)};const Mo=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(br(e))}function gn(e){return gt(e)?e:vn(e,!1,Ur,Kr,Mo)}function Yr(e){return vn(e,!1,Fr,Wr,Oo)}function en(e){return vn(e,!0,Vr,zr,Do)}function vn(e,t,s,n,o){if(!fe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=o.get(e);if(a)return a;const c=new Proxy(e,l===2?n:s);return o.set(e,c),c}function At(e){return gt(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function gt(e){return!!(e&&e.__v_isReadonly)}function He(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function ae(e){const t=e&&e.__v_raw;return t?ae(t):e}function Zr(e){return!ce(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Ke=e=>fe(e)?gn(e):e,Ut=e=>fe(e)?en(e):e;function Me(e){return e?e.__v_isRef===!0:!1}function E(e){return Qr(e,!1)}function Qr(e,t){return Me(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new xn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ae(t),this._value=s?t:Ke(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||He(t)||gt(t);t=n?t:ae(t),tt(t,s)&&(this._rawValue=t,this._value=n?t:Ke(t),this.dep.trigger())}}function el(e){return Me(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Me(o)&&!Me(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function Ro(e){return At(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new xn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return ko(this,!0),!0}get value(){const t=this.dep.track();return $o(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nl(e,t,s=!1){let n,o;return X(e)?n=e:(n=e.get,o=e.set),new sl(n,o,s)}const xs={},ws=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=ws.get(s);n||ws.set(s,n=[]),n.push(e)}}function rl(e,t,s=xe){const{immediate:n,deep:o,once:l,scheduler:a,augmentJob:c,call:u}=s,x=V=>o?V:He(V)||o===!1||o===0?pt(V,1):pt(V);let d,m,y,T,B=!1,C=!1;if(Me(e)?(m=()=>e.value,B=He(e)):At(e)?(m=()=>x(e),B=!0):Z(e)?(C=!0,B=e.some(V=>At(V)||He(V)),m=()=>e.map(V=>{if(Me(V))return V.value;if(At(V))return x(V);if(X(V))return u?u(V,2):V()})):X(e)?t?m=u?()=>u(e,2):e:m=()=>{if(y){xt();try{y()}finally{ht()}}const V=Tt;Tt=d;try{return u?u(e,3,[T]):e(T)}finally{Tt=V}}:m=st,t&&o){const V=m,se=o===!0?1/0:o;m=()=>pt(V(),se)}const w=Pr(),k=()=>{d.stop(),w&&w.active&&cn(w.effects,d)};if(l&&t){const V=t;t=(...se)=>{V(...se),k()}}let P=C?new Array(e.length).fill(xs):xs;const H=V=>{if(!(!(d.flags&1)||!d.dirty&&!V))if(t){const se=d.run();if(o||B||(C?se.some((ne,W)=>tt(ne,P[W])):tt(se,P))){y&&y();const ne=Tt;Tt=d;try{const W=[se,P===xs?void 0:C&&P[0]===xs?[]:P,T];P=se,u?u(t,3,W):t(...W)}finally{Tt=ne}}}else d.run()};return c&&c(H),d=new _o(m),d.scheduler=a?()=>a(H,!1):H,T=V=>ol(V,!1,d),y=d.onStop=()=>{const V=ws.get(d);if(V){if(u)u(V,4);else for(const se of V)se();ws.delete(d)}},t?n?H(!0):P=d.run():a?a(H.bind(null,!0),!0):d.run(),k.pause=d.pause.bind(d),k.resume=d.resume.bind(d),k.stop=k,k}function pt(e,t=1/0,s){if(t<=0||!fe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Me(e))pt(e.value,t,s);else if(Z(e))for(let n=0;n<e.length;n++)pt(e[n],t,s);else if(Bt(e)||Rt(e))e.forEach(n=>{pt(n,t,s)});else if(ho(e)){for(const n in e)pt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&pt(e[n],t,s)}return e}/**
56
+ **/let Le;class Ir{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Le,!t&&Le&&(this.index=(Le.scopes||(Le.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Le;try{return Le=this,t()}finally{Le=s}}}on(){++this._on===1&&(this.prevScope=Le,Le=this)}off(){this._on>0&&--this._on===0&&(Le=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Pr(){return Le}let ge;const Bs=new WeakSet;class _o{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,Le&&Le.active&&Le.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Bs.has(this)&&(Bs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ko(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mn(this),So(this);const t=ge,s=He;ge=this,He=!0;try{return this.fn()}finally{$o(this),ge=t,He=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mn(t);this.deps=this.depsTail=void 0,Mn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Bs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Qt,Xt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Xt,Xt=e;return}e.next=Qt,Qt=e}function fn(){wo++}function pn(){if(--wo>0)return;if(Xt){let t=Xt;for(Xt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function $o(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),mn(n),Mr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Co(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Co(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=ge,n=He;ge=e,He=!0;try{So(e);const o=e.fn(e._value);(t.version===0||st(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ge=s,He=n,$o(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let l=s.computed.deps;l;l=l.nextDep)mn(l,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Mr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let He=!0;const To=[];function xt(){To.push(He),He=!1}function gt(){const e=To.pop();He=e===void 0?!0:e}function Mn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ge;ge=void 0;try{t()}finally{ge=s}}}let os=0;class Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hn{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(!ge||!He||ge===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ge)s=this.activeLink=new Or(ge,this),ge.deps?(s.prevDep=ge.depsTail,ge.depsTail.nextDep=s,ge.depsTail=s):ge.deps=ge.depsTail=s,Ao(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ge.depsTail,s.nextDep=void 0,ge.depsTail.nextDep=s,ge.depsTail=s,ge.deps===s&&(ge.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){fn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{pn()}}}function Ao(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Ao(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,At=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ie(e,t,s){if(He&&ge){let n=Zs.get(e);n||Zs.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new hn),o.map=n,o.key=s),o.track()}}function pt(e,t,s,n,o,l){const a=Zs.get(e);if(!a){os++;return}const c=u=>{u&&u.trigger()};if(fn(),t==="clear")a.forEach(c);else{const u=Q(e),h=u&&un(s);if(u&&s==="length"){const d=Number(n);a.forEach((m,b)=>{(b==="length"||b===rs||!rt(b)&&b>=d)&&c(m)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),h&&c(a.get(rs)),t){case"add":u?h&&c(a.get("length")):(c(a.get(At)),Rt(e)&&c(a.get(Qs)));break;case"delete":u||(c(a.get(At)),Rt(e)&&c(a.get(Qs)));break;case"set":Rt(e)&&c(a.get(At));break}}pn()}function Mt(e){const t=ae(e);return t===e?t:(Ie(t,"iterate",rs),Be(e)?t:t.map(Ke))}function Ds(e){return Ie(e=ae(e),"iterate",rs),e}function Xe(e,t){return vt(e)?Ut(Et(e)?Ke(t):t):Ke(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>Xe(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>Q(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=Xe(this,e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,s=>s.map(n=>Xe(this,n)),arguments)},find(e,t){return ut(this,"find",e,t,s=>Xe(this,s),arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,s=>Xe(this,s),arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return On(this,"reduce",e,t)},reduceRight(e,...t){return On(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Hs(this,"values",e=>Xe(this,e))}};function Hs(e,t,s){const n=Ds(e),o=n[t]();return n!==e&&!Be(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=s(l.value)),l}),o}const Rr=Array.prototype;function ut(e,t,s,n,o,l){const a=Ds(e),c=a!==e&&!Be(e),u=a[t];if(u!==Rr[t]){const m=u.apply(e,l);return c?Ke(m):m}let h=s;a!==e&&(c?h=function(m,b){return s.call(this,Xe(e,m),b,e)}:s.length>2&&(h=function(m,b){return s.call(this,m,b,e)}));const d=u.call(a,h,n);return c&&o?o(d):d}function On(e,t,s,n){const o=Ds(e),l=o!==e&&!Be(e);let a=s,c=!1;o!==e&&(l?(c=n.length===0,a=function(h,d,m){return c&&(c=!1,h=Xe(e,h)),s.call(this,h,Xe(e,d),m,e)}):s.length>3&&(a=function(h,d,m){return s.call(this,h,d,m,e)}));const u=o[t](a,...n);return c?Xe(e,u):u}function Ks(e,t,s){const n=ae(e);Ie(n,"iterate",rs);const o=n[t](...s);return(o===-1||o===!1)&&yn(s[0])?(s[0]=ae(s[0]),n[t](...s)):o}function zt(e,t,s=[]){xt(),fn();const n=ae(e)[t].apply(e,s);return pn(),gt(),n}const jr=an("__proto__,__v_isRef,__isVue"),Eo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function Nr(e){rt(e)||(e=String(e));const t=ae(this);return Ie(t,"has",e),t.hasOwnProperty(e)}class Io{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(o?l?Jr:Do:l?Oo:Mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=Q(t);if(!o){let u;if(a&&(u=Dr[s]))return u;if(s==="hasOwnProperty")return Nr}const c=Reflect.get(t,s,Me(t)?t:n);if((rt(s)?Eo.has(s):jr(s))||(o||Ie(t,"get",s),l))return c;if(Me(c)){const u=a&&un(s)?c:c.value;return o&&fe(u)?en(u):u}return fe(c)?o?en(c):gn(c):c}}class Po extends Io{constructor(t=!1){super(!1,t)}set(t,s,n,o){let l=t[s];const a=Q(t)&&un(s);if(!this._isShallow){const h=vt(l);if(!Be(n)&&!vt(n)&&(l=ae(l),n=ae(n)),!a&&Me(l)&&!Me(n))return h||(l.value=n),!0}const c=a?Number(s)<t.length:ce(t,s),u=Reflect.set(t,s,n,Me(t)?t:o);return t===ae(o)&&(c?st(n,l)&&pt(t,"set",s,n):pt(t,"add",s,n)),u}deleteProperty(t,s){const n=ce(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&pt(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!rt(s)||!Eo.has(s))&&Ie(t,"has",s),n}ownKeys(t){return Ie(t,"iterate",Q(t)?"length":At),Reflect.ownKeys(t)}}class Lr extends Io{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Po,Vr=new Lr,Fr=new Po(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Br(e,t,s){return function(...n){const o=this.__v_raw,l=ae(o),a=Rt(l),c=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,h=o[e](...n),d=s?Xs:t?Ut:Ke;return!t&&Ie(l,"iterate",u?Qs:At),Ee(Object.create(h),{next(){const{value:m,done:b}=h.next();return b?{value:m,done:b}:{value:c?[d(m[0]),d(m[1])]:d(m),done:b}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(o){const l=this.__v_raw,a=ae(l),c=ae(o);e||(st(o,c)&&Ie(a,"get",o),Ie(a,"get",c));const{has:u}=ps(a),h=t?Xs:e?Ut:Ke;if(u.call(a,o))return h(l.get(o));if(u.call(a,c))return h(l.get(c));l!==a&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Ie(ae(o),"iterate",At),o.size},has(o){const l=this.__v_raw,a=ae(l),c=ae(o);return e||(st(o,c)&&Ie(a,"has",o),Ie(a,"has",c)),o===c?l.has(o):l.has(o)||l.has(c)},forEach(o,l){const a=this,c=a.__v_raw,u=ae(c),h=t?Xs:e?Ut:Ke;return!e&&Ie(u,"iterate",At),c.forEach((d,m)=>o.call(l,h(d),h(m),a))}};return Ee(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(o){const l=ae(this),a=ps(l),c=ae(o),u=!t&&!Be(o)&&!vt(o)?c:o;return a.has.call(l,u)||st(o,u)&&a.has.call(l,o)||st(c,u)&&a.has.call(l,c)||(l.add(u),pt(l,"add",u,u)),this},set(o,l){!t&&!Be(l)&&!vt(l)&&(l=ae(l));const a=ae(this),{has:c,get:u}=ps(a);let h=c.call(a,o);h||(o=ae(o),h=c.call(a,o));const d=u.call(a,o);return a.set(o,l),h?st(l,d)&&pt(a,"set",o,l):pt(a,"add",o,l),this},delete(o){const l=ae(this),{has:a,get:c}=ps(l);let u=a.call(l,o);u||(o=ae(o),u=a.call(l,o)),c&&c.call(l,o);const h=l.delete(o);return u&&pt(l,"delete",o,void 0),h},clear(){const o=ae(this),l=o.size!==0,a=o.clear();return l&&pt(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Br(o,e,t)}),s}function xn(e,t){const s=Hr(e,t);return(n,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(ce(s,o)&&o in n?s:n,o,l)}const Kr={get:xn(!1,!1)},Wr={get:xn(!1,!0)},zr={get:xn(!0,!1)};const Mo=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(br(e))}function gn(e){return vt(e)?e:vn(e,!1,Ur,Kr,Mo)}function Yr(e){return vn(e,!1,Fr,Wr,Oo)}function en(e){return vn(e,!0,Vr,zr,Do)}function vn(e,t,s,n,o){if(!fe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=o.get(e);if(a)return a;const c=new Proxy(e,l===2?n:s);return o.set(e,c),c}function Et(e){return vt(e)?Et(e.__v_raw):!!(e&&e.__v_isReactive)}function vt(e){return!!(e&&e.__v_isReadonly)}function Be(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function ae(e){const t=e&&e.__v_raw;return t?ae(t):e}function Zr(e){return!ce(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Ke=e=>fe(e)?gn(e):e,Ut=e=>fe(e)?en(e):e;function Me(e){return e?e.__v_isRef===!0:!1}function $(e){return Qr(e,!1)}function Qr(e,t){return Me(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new hn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ae(t),this._value=s?t:Ke(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Be(t)||vt(t);t=n?t:ae(t),st(t,s)&&(this._rawValue=t,this._value=n?t:Ke(t),this.dep.trigger())}}function el(e){return Me(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Me(o)&&!Me(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function Ro(e){return Et(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new hn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return ko(this,!0),!0}get value(){const t=this.dep.track();return Co(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nl(e,t,s=!1){let n,o;return te(e)?n=e:(n=e.get,o=e.set),new sl(n,o,s)}const hs={},ws=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=ws.get(s);n||ws.set(s,n=[]),n.push(e)}}function rl(e,t,s=he){const{immediate:n,deep:o,once:l,scheduler:a,augmentJob:c,call:u}=s,h=P=>o?P:Be(P)||o===!1||o===0?mt(P,1):mt(P);let d,m,b,A,H=!1,C=!1;if(Me(e)?(m=()=>e.value,H=Be(e)):Et(e)?(m=()=>h(e),H=!0):Q(e)?(C=!0,H=e.some(P=>Et(P)||Be(P)),m=()=>e.map(P=>{if(Me(P))return P.value;if(Et(P))return h(P);if(te(P))return u?u(P,2):P()})):te(e)?t?m=u?()=>u(e,2):e:m=()=>{if(b){xt();try{b()}finally{gt()}}const P=Tt;Tt=d;try{return u?u(e,3,[A]):e(A)}finally{Tt=P}}:m=nt,t&&o){const P=m,Z=o===!0?1/0:o;m=()=>mt(P(),Z)}const w=Pr(),k=()=>{d.stop(),w&&w.active&&cn(w.effects,d)};if(l&&t){const P=t;t=(...Z)=>{P(...Z),k()}}let S=C?new Array(e.length).fill(hs):hs;const O=P=>{if(!(!(d.flags&1)||!d.dirty&&!P))if(t){const Z=d.run();if(o||H||(C?Z.some((X,K)=>st(X,S[K])):st(Z,S))){b&&b();const X=Tt;Tt=d;try{const K=[Z,S===hs?void 0:C&&S[0]===hs?[]:S,A];S=Z,u?u(t,3,K):t(...K)}finally{Tt=X}}}else d.run()};return c&&c(O),d=new _o(m),d.scheduler=a?()=>a(O,!1):O,A=P=>ol(P,!1,d),b=d.onStop=()=>{const P=ws.get(d);if(P){if(u)u(P,4);else for(const Z of P)Z();ws.delete(d)}},t?n?O(!0):S=d.run():a?a(O.bind(null,!0),!0):d.run(),k.pause=d.pause.bind(d),k.resume=d.resume.bind(d),k.stop=k,k}function mt(e,t=1/0,s){if(t<=0||!fe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Me(e))mt(e.value,t,s);else if(Q(e))for(let n=0;n<e.length;n++)mt(e[n],t,s);else if(Ht(e)||Rt(e))e.forEach(n=>{mt(n,t,s)});else if(xo(e)){for(const n in e)mt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&mt(e[n],t,s)}return e}/**
57
57
  * @vue/runtime-core v3.5.31
58
58
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
59
59
  * @license MIT
60
- **/function ds(e,t,s,n){try{return n?e(...n):e()}catch(o){Rs(o,t,s)}}function rt(e,t,s,n){if(X(e)){const o=ds(e,t,s,n);return o&&mo(o)&&o.catch(l=>{Rs(l,t,s)}),o}if(Z(e)){const o=[];for(let l=0;l<e.length;l++)o.push(rt(e[l],t,s,n));return o}}function Rs(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||xe;if(t){let c=t.parent;const u=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const d=c.ec;if(d){for(let m=0;m<d.length;m++)if(d[m](e,u,x)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,u,x]),ht();return}}ll(e,s,o,n,a)}function ll(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const De=[];let Ye=-1;const jt=[];let _t=null,Ot=0;const jo=Promise.resolve();let ks=null;function No(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function il(e){let t=Ye+1,s=De.length;for(;t<s;){const n=t+s>>>1,o=De[n],l=ls(o);l<e||l===e&&o.flags&2?t=n+1:s=n}return t}function bn(e){if(!(e.flags&1)){const t=ls(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=ls(s)?De.push(e):De.splice(il(t),0,e),e.flags|=1,Lo()}}function Lo(){ks||(ks=jo.then(Vo))}function al(e){Z(e)?jt.push(...e):_t&&e.id===-1?_t.splice(Ot+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Lo()}function Dn(e,t,s=Ye+1){for(;s<De.length;s++){const n=De[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;De.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Uo(e){if(jt.length){const t=[...new Set(jt)].sort((s,n)=>ls(s)-ls(n));if(jt.length=0,_t){_t.push(...t);return}for(_t=t,Ot=0;Ot<_t.length;Ot++){const s=_t[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_t=null,Ot=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Ye=0;Ye<De.length;Ye++){const t=De[Ye];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ds(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ye<De.length;Ye++){const t=De[Ye];t&&(t.flags&=-2)}Ye=-1,De.length=0,Uo(),ks=null,(De.length||jt.length)&&Vo()}}let Ue=null,Fo=null;function Ss(e){const t=Ue;return Ue=e,Fo=e&&e.type.__scopeId||null,t}function cl(e,t=Ue,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&zn(-1);const l=Ss(t);let a;try{a=e(...o)}finally{Ss(l),n._d&&zn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function ee(e,t){if(Ue===null)return e;const s=Us(Ue),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[l,a,c,u=xe]=t[o];l&&(X(l)&&(l={mounted:l,updated:l}),l.deep&&pt(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:u}))}return e}function Ct(e,t,s,n){const o=e.dirs,l=t&&t.dirs;for(let a=0;a<o.length;a++){const c=o[a];l&&(c.oldValue=l[a].value);let u=c.dir[n];u&&(xt(),rt(u,s,8,[e.el,c,e,t]),ht())}}function ul(e,t){if(Pe){let s=Pe.provides;const n=Pe.parent&&Pe.parent.provides;n===s&&(s=Pe.provides=Object.create(n)),s[e]=t}}function vs(e,t,s=!1){const n=ui();if(n||Nt){let o=Nt?Nt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&X(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>vs(dl);function Ws(e,t,s){return Ho(e,t,s)}function Ho(e,t,s=xe){const{immediate:n,deep:o,flush:l,once:a}=s,c=Ae({},s),u=t&&n||!t&&l!=="post";let x;if(as){if(l==="sync"){const T=fl();x=T.__watcherHandles||(T.__watcherHandles=[])}else if(!u){const T=()=>{};return T.stop=st,T.resume=st,T.pause=st,T}}const d=Pe;c.call=(T,B,C)=>rt(T,d,B,C);let m=!1;l==="post"?c.scheduler=T=>{je(T,d&&d.suspense)}:l!=="sync"&&(m=!0,c.scheduler=(T,B)=>{B?T():bn(T)}),c.augmentJob=T=>{t&&(T.flags|=4),m&&(T.flags|=2,d&&(T.id=d.uid,T.i=d))};const y=rl(e,t,c);return as&&(x?x.push(y):u&&y()),y}function pl(e,t,s){const n=this.proxy,o=Ce(e)?e.includes(".")?Bo(n,e):()=>n[e]:e.bind(n,n);let l;X(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Ho(o,l.bind(n),s);return a(),c}function Bo(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const ml=Symbol("_vte"),xl=e=>e.__isTeleport,hl=Symbol("_leaveCb");function _n(e,t){e.shapeFlag&6&&e.component?(e.transition=t,_n(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function vt(e,t){return X(e)?Ae({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Rn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Cs=new WeakMap;function es(e,t,s,n,o=!1){if(Z(e)){e.forEach((C,w)=>es(C,t&&(Z(t)?t[w]:t),s,n,o));return}if(ts(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&es(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Us(n.component):n.el,a=o?null:l,{i:c,r:u}=e,x=t&&t.r,d=c.refs===xe?c.refs={}:c.refs,m=c.setupState,y=ae(m),T=m===xe?po:C=>Rn(d,C)?!1:ce(y,C),B=(C,w)=>!(w&&Rn(d,w));if(x!=null&&x!==u){if(jn(t),Ce(x))d[x]=null,T(x)&&(m[x]=null);else if(Me(x)){const C=t;B(x,C.k)&&(x.value=null),C.k&&(d[C.k]=null)}}if(X(u))ds(u,c,12,[a,d]);else{const C=Ce(u),w=Me(u);if(C||w){const k=()=>{if(e.f){const P=C?T(u)?m[u]:d[u]:B()||!e.k?u.value:d[e.k];if(o)Z(P)&&cn(P,l);else if(Z(P))P.includes(l)||P.push(l);else if(C)d[u]=[l],T(u)&&(m[u]=d[u]);else{const H=[l];B(u,e.k)&&(u.value=H),e.k&&(d[e.k]=H)}}else C?(d[u]=a,T(u)&&(m[u]=a)):w&&(B(u,e.k)&&(u.value=a),e.k&&(d[e.k]=a))};if(a){const P=()=>{k(),Cs.delete(e)};P.id=-1,Cs.set(e,P),je(P,s)}else jn(e),k()}}}function jn(e){const t=Cs.get(e);t&&(t.flags|=8,Cs.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function vl(e,t){zo(e,"da",t)}function zo(e,t,s=Pe){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(js(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Wo(o.parent.vnode)&&yl(n,t,s,o),o=o.parent}}function yl(e,t,s,n){const o=js(t,e,n,!0);wn(()=>{cn(n[t],o)},s)}function js(e,t,s=Pe,n=!1){if(s){const o=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),u=rt(t,s,e,a);return c(),ht(),u});return n?o.unshift(l):o.push(l),l}}const yt=e=>(t,s=Pe)=>{(!as||e==="sp")&&js(e,(...n)=>t(...n),s)},bl=yt("bm"),lt=yt("m"),_l=yt("bu"),wl=yt("u"),kl=yt("bum"),wn=yt("um"),Sl=yt("sp"),Cl=yt("rtg"),$l=yt("rtc");function Tl(e,t=Pe){js("ec",e,t)}const El="components",Jo=Symbol.for("v-ndc");function Al(e){return Ce(e)?Il(El,e,!1)||e:e||Jo}function Il(e,t,s=!0,n=!1){const o=Ue||Pe;if(o){const l=o.type;{const c=xi(l,!1);if(c&&(c===t||c===Re(t)||c===Ps(Re(t))))return l}const a=Nn(o[e]||l[e],t)||Nn(o.appContext[e],t);return!a&&n?l:a}}function Nn(e,t){return e&&(e[t]||e[Re(t)]||e[Ps(Re(t))])}function be(e,t,s,n){let o;const l=s,a=Z(e);if(a||Ce(e)){const c=a&&At(e);let u=!1,x=!1;c&&(u=!He(e),x=gt(e),e=Ds(e)),o=new Array(e.length);for(let d=0,m=e.length;d<m;d++)o[d]=t(u?x?Ut(Ke(e[d])):Ke(e[d]):e[d],d,void 0,l)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,l)}else if(fe(e))if(e[Symbol.iterator])o=Array.from(e,(c,u)=>t(c,u,void 0,l));else{const c=Object.keys(e);o=new Array(c.length);for(let u=0,x=c.length;u<x;u++){const d=c[u];o[u]=t(e[d],d,u,l)}}else o=[];return o}const tn=e=>e?xr(e)?Us(e):tn(e.parent):null,ss=Ae(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=>tn(e.parent),$root:e=>tn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Go(e),$forceUpdate:e=>e.f||(e.f=()=>{bn(e.update)}),$nextTick:e=>e.n||(e.n=No.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==xe&&!e.__isScriptSetup&&ce(e,t),Pl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:l,accessCache:a,type:c,appContext:u}=e;if(t[0]!=="$"){const y=a[t];if(y!==void 0)switch(y){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(o!==xe&&ce(o,t))return a[t]=2,o[t];if(ce(l,t))return a[t]=3,l[t];if(s!==xe&&ce(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const x=ss[t];let d,m;if(x)return t==="$attrs"&&Ie(e.attrs,"get",""),x(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(s!==xe&&ce(s,t))return a[t]=4,s[t];if(m=u.config.globalProperties,ce(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:l}=e;return zs(o,t)?(o[t]=s,!0):n!==xe&&ce(n,t)?(n[t]=s,!0):ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:l,type:a}},c){let u;return!!(s[c]||e!==xe&&c[0]!=="$"&&ce(e,c)||zs(t,c)||ce(l,c)||ce(n,c)||ce(ss,c)||ce(o.config.globalProperties,c)||(u=a.__cssModules)&&u[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ce(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Ln(e){return Z(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ml(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:a,watch:c,provide:u,inject:x,created:d,beforeMount:m,mounted:y,beforeUpdate:T,updated:B,activated:C,deactivated:w,beforeDestroy:k,beforeUnmount:P,destroyed:H,unmounted:V,render:se,renderTracked:ne,renderTriggered:W,errorCaptured:N,serverPrefetch:G,expose:ue,inheritAttrs:U,components:R,directives:K,filters:oe}=t;if(x&&Ol(x,n,null),a)for(const pe in a){const le=a[pe];X(le)&&(n[pe]=le.bind(s))}if(o){const pe=o.call(s,s);fe(pe)&&(e.data=gn(pe))}if(sn=!0,l)for(const pe in l){const le=l[pe],F=X(le)?le.bind(s,s):X(le.get)?le.get.bind(s,s):st,M=!X(le)&&X(le.set)?le.set.bind(s):st,$e=Fe({get:F,set:M});Object.defineProperty(n,pe,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(c)for(const pe in c)qo(c[pe],n,s,pe);if(u){const pe=X(u)?u.call(s):u;Reflect.ownKeys(pe).forEach(le=>{ul(le,pe[le])})}d&&Un(d,e,"c");function Se(pe,le){Z(le)?le.forEach(F=>pe(F.bind(s))):le&&pe(le.bind(s))}if(Se(bl,m),Se(lt,y),Se(_l,T),Se(wl,B),Se(gl,C),Se(vl,w),Se(Tl,N),Se($l,ne),Se(Cl,W),Se(kl,P),Se(wn,V),Se(Sl,G),Z(ue))if(ue.length){const pe=e.exposed||(e.exposed={});ue.forEach(le=>{Object.defineProperty(pe,le,{get:()=>s[le],set:F=>s[le]=F,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===st&&(e.render=se),U!=null&&(e.inheritAttrs=U),R&&(e.components=R),K&&(e.directives=K),G&&Ko(e)}function Ol(e,t,s=st){Z(e)&&(e=nn(e));for(const n in e){const o=e[n];let l;fe(o)?"default"in o?l=vs(o.from||n,o.default,!0):l=vs(o.from||n):l=vs(o),Me(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[n]=l}}function Un(e,t,s){rt(Z(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let o=n.includes(".")?Bo(s,n):()=>s[n];if(Ce(e)){const l=t[e];X(l)&&Ws(o,l)}else if(X(e))Ws(o,e.bind(s));else if(fe(e))if(Z(e))e.forEach(l=>qo(l,t,s,n));else{const l=X(e.handler)?e.handler.bind(s):t[e.handler];X(l)&&Ws(o,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let u;return c?u=c:!o.length&&!s&&!n?u=t:(u={},o.length&&o.forEach(x=>$s(u,x,a,!0)),$s(u,t,a)),fe(t)&&l.set(t,u),u}function $s(e,t,s,n=!1){const{mixins:o,extends:l}=t;l&&$s(e,l,s,!0),o&&o.forEach(a=>$s(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const c=Dl[a]||s&&s[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Fn,emits:Fn,methods:Yt,computed:Yt,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ae(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Oe(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Ae(Object.create(null),e,t):t}function Fn(e,t){return e?Z(e)&&Z(t)?[...new Set([...e,...t])]:Ae(Object.create(null),Ln(e),Ln(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ae(Object.create(null),e);for(const n in t)s[n]=Oe(e[n],t[n]);return s}function Yo(){return{app:null,config:{isNativeTag:po,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 Nl=0;function Ll(e,t){return function(n,o=null){X(n)||(n=Ae({},n)),o!=null&&!fe(o)&&(o=null);const l=Yo(),a=new WeakSet,c=[];let u=!1;const x=l.app={_uid:Nl++,_component:n,_props:o,_container:null,_context:l,_instance:null,version:gi,get config(){return l.config},set config(d){},use(d,...m){return a.has(d)||(d&&X(d.install)?(a.add(d),d.install(x,...m)):X(d)&&(a.add(d),d(x,...m))),x},mixin(d){return l.mixins.includes(d)||l.mixins.push(d),x},component(d,m){return m?(l.components[d]=m,x):l.components[d]},directive(d,m){return m?(l.directives[d]=m,x):l.directives[d]},mount(d,m,y){if(!u){const T=x._ceVNode||nt(n,o);return T.appContext=l,y===!0?y="svg":y===!1&&(y=void 0),e(T,d,y),u=!0,x._container=d,d.__vue_app__=x,Us(T.component)}},onUnmount(d){c.push(d)},unmount(){u&&(rt(c,x._instance,16),e(null,x._container),delete x._container.__vue_app__)},provide(d,m){return l.provides[d]=m,x},runWithContext(d){const m=Nt;Nt=x;try{return d()}finally{Nt=m}}};return x}}let Nt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||xe;let o=s;const l=t.startsWith("update:"),a=l&&Ul(n,t.slice(7));a&&(a.trim&&(o=s.map(d=>Ce(d)?d.trim():d)),a.number&&(o=s.map(Ms)));let c,u=n[c=Vs(t)]||n[c=Vs(Re(t))];!u&&l&&(u=n[c=Vs(St(t))]),u&&rt(u,e,6,o);const x=n[c+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,rt(x,e,6,o)}}const Fl=new WeakMap;function Zo(e,t,s=!1){const n=s?Fl:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const l=e.emits;let a={},c=!1;if(!X(e)){const u=x=>{const d=Zo(x,t,!0);d&&(c=!0,Ae(a,d))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!c?(fe(e)&&n.set(e,null),null):(Z(l)?l.forEach(u=>a[u]=null):Ae(a,l),fe(e)&&n.set(e,a),a)}function Ns(e,t){return!e||!Es(t)?!1:(t=t.slice(2).replace(/Once$/,""),ce(e,t[0].toLowerCase()+t.slice(1))||ce(e,St(t))||ce(e,t))}function Hn(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[l],slots:a,attrs:c,emit:u,render:x,renderCache:d,props:m,data:y,setupState:T,ctx:B,inheritAttrs:C}=e,w=Ss(e);let k,P;try{if(s.shapeFlag&4){const V=o||n,se=V;k=et(x.call(se,V,d,m,T,y,B)),P=c}else{const V=t;k=et(V.length>1?V(m,{attrs:c,slots:a,emit:u}):V(m,null)),P=t.props?c:Hl(c)}}catch(V){ns.length=0,Rs(V,e,1),k=nt(kt)}let H=k;if(P&&C!==!1){const V=Object.keys(P),{shapeFlag:se}=H;V.length&&se&7&&(l&&V.some(As)&&(P=Bl(P,l)),H=Vt(H,P,!1,!0))}return s.dirs&&(H=Vt(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(s.dirs):s.dirs),s.transition&&_n(H,s.transition),k=H,Ss(w),k}const Hl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Es(s))&&((t||(t={}))[s]=e[s]);return t},Bl=(e,t)=>{const s={};for(const n in e)(!As(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:o,component:l}=e,{props:a,children:c,patchFlag:u}=t,x=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?Bn(n,a,x):!!a;if(u&8){const d=t.dynamicProps;for(let m=0;m<d.length;m++){const y=d[m];if(Qo(a,n,y)&&!Ns(x,y))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:n===a?!1:n?a?Bn(n,a,x):!0:!!a;return!1}function Bn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const l=n[o];if(Qo(t,e,l)&&!Ns(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],o=t[s];return s==="style"&&fe(n)&&fe(o)?!Kt(n,o):n!==o}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,n=!1){const o={},l=er();e.propsDefaults=Object.create(null),sr(e,t,o,l);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);s?e.props=n?o:Yr(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:o,attrs:l,vnode:{patchFlag:a}}=e,c=ae(o),[u]=e.propsOptions;let x=!1;if((n||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m<d.length;m++){let y=d[m];if(Ns(e.emitsOptions,y))continue;const T=t[y];if(u)if(ce(l,y))T!==l[y]&&(l[y]=T,x=!0);else{const B=Re(y);o[B]=on(u,c,B,T,e,!1)}else T!==l[y]&&(l[y]=T,x=!0)}}}else{sr(e,t,o,l)&&(x=!0);let d;for(const m in c)(!t||!ce(t,m)&&((d=St(m))===m||!ce(t,d)))&&(u?s&&(s[m]!==void 0||s[d]!==void 0)&&(o[m]=on(u,c,m,void 0,e,!0)):delete o[m]);if(l!==c)for(const m in l)(!t||!ce(t,m))&&(delete l[m],x=!0)}x&&ft(e.attrs,"set","")}function sr(e,t,s,n){const[o,l]=e.propsOptions;let a=!1,c;if(t)for(let u in t){if(Zt(u))continue;const x=t[u];let d;o&&ce(o,d=Re(u))?!l||!l.includes(d)?s[d]=x:(c||(c={}))[d]=x:Ns(e.emitsOptions,u)||(!(u in n)||x!==n[u])&&(n[u]=x,a=!0)}if(l){const u=ae(s),x=c||xe;for(let d=0;d<l.length;d++){const m=l[d];s[m]=on(o,u,m,x[m],e,!ce(x,m))}}return a}function on(e,t,s,n,o,l){const a=e[s];if(a!=null){const c=ce(a,"default");if(c&&n===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&X(u)){const{propsDefaults:x}=o;if(s in x)n=x[s];else{const d=fs(o);n=x[s]=u.call(null,t),d()}}else n=u;o.ce&&o.ce._setProp(s,n)}a[0]&&(l&&!c?n=!1:a[1]&&(n===""||n===St(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,o=n.get(e);if(o)return o;const l=e.props,a={},c=[];let u=!1;if(!X(e)){const d=m=>{u=!0;const[y,T]=nr(m,t,!0);Ae(a,y),T&&c.push(...T)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!l&&!u)return fe(e)&&n.set(e,Dt),Dt;if(Z(l))for(let d=0;d<l.length;d++){const m=Re(l[d]);Kn(m)&&(a[m]=xe)}else if(l)for(const d in l){const m=Re(d);if(Kn(m)){const y=l[d],T=a[m]=Z(y)||X(y)?{type:y}:Ae({},y),B=T.type;let C=!1,w=!0;if(Z(B))for(let k=0;k<B.length;++k){const P=B[k],H=X(P)&&P.name;if(H==="Boolean"){C=!0;break}else H==="String"&&(w=!1)}else C=X(B)&&B.name==="Boolean";T[0]=C,T[1]=w,(C||ce(T,"default"))&&c.push(m)}}const x=[a,c];return fe(e)&&n.set(e,x),x}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>Z(e)?e.map(et):[et(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...o)=>Sn(t(...o)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const o in e){if(kn(o))continue;const l=e[o];if(X(l))t[o]=Gl(o,l,n);else if(l!=null){const a=Sn(l);t[o]=()=>a}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const n in t)(s||!kn(n))&&(e[n]=t[n])},Yl=(e,t,s)=>{const n=e.slots=er();if(e.vnode.shapeFlag&32){const o=t._;o?(lr(n,t,s),s&&go(n,"_",o,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:o}=e;let l=!0,a=xe;if(n.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(o,t,s):(l=!t.$stable,or(t,o)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in o)!kn(c)&&a[c]==null&&delete o[c]},je=si;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:a,createText:c,createComment:u,setText:x,setElementText:d,parentNode:m,nextSibling:y,setScopeId:T=st,insertStaticContent:B}=e,C=(i,p,v,f=null,S=null,$=null,I=void 0,j=null,O=!!p.dynamicChildren)=>{if(i===p)return;i&&!Jt(i,p)&&(f=Pt(i),ke(i,S,$,!0),i=null),p.patchFlag===-2&&(O=!1,p.dynamicChildren=null);const{type:A,ref:Y,shapeFlag:L}=p;switch(A){case Ls:w(i,p,v,f);break;case kt:k(i,p,v,f);break;case ys:i==null&&P(p,v,f,I);break;case te:R(i,p,v,f,S,$,I,j,O);break;default:L&1?se(i,p,v,f,S,$,I,j,O):L&6?K(i,p,v,f,S,$,I,j,O):(L&64||L&128)&&A.process(i,p,v,f,S,$,I,j,O,D)}Y!=null&&S?es(Y,i&&i.ref,$,p||i,!p):Y==null&&i&&i.ref!=null&&es(i.ref,null,$,i,!0)},w=(i,p,v,f)=>{if(i==null)n(p.el=c(p.children),v,f);else{const S=p.el=i.el;p.children!==i.children&&x(S,p.children)}},k=(i,p,v,f)=>{i==null?n(p.el=u(p.children||""),v,f):p.el=i.el},P=(i,p,v,f)=>{[i.el,i.anchor]=B(i.children,p,v,f,i.el,i.anchor)},H=({el:i,anchor:p},v,f)=>{let S;for(;i&&i!==p;)S=y(i),n(i,v,f),i=S;n(p,v,f)},V=({el:i,anchor:p})=>{let v;for(;i&&i!==p;)v=y(i),o(i),i=v;o(p)},se=(i,p,v,f,S,$,I,j,O)=>{if(p.type==="svg"?I="svg":p.type==="math"&&(I="mathml"),i==null)ne(p,v,f,S,$,I,j,O);else{const A=i.el&&i.el._isVueCE?i.el:null;try{A&&A._beginPatch(),G(i,p,S,$,I,j,O)}finally{A&&A._endPatch()}}},ne=(i,p,v,f,S,$,I,j)=>{let O,A;const{props:Y,shapeFlag:L,transition:z,dirs:Q}=i;if(O=i.el=a(i.type,$,Y&&Y.is,Y),L&8?d(O,i.children):L&16&&N(i.children,O,null,f,S,Js(i,$),I,j),Q&&Ct(i,null,f,"created"),W(O,i,i.scopeId,I,f),Y){for(const me in Y)me!=="value"&&!Zt(me)&&l(O,me,null,Y[me],$,f);"value"in Y&&l(O,"value",null,Y.value,$),(A=Y.onVnodeBeforeMount)&&Ge(A,f,i)}Q&&Ct(i,null,f,"beforeMount");const ie=ei(S,z);ie&&z.beforeEnter(O),n(O,p,v),((A=Y&&Y.onVnodeMounted)||ie||Q)&&je(()=>{try{A&&Ge(A,f,i),ie&&z.enter(O),Q&&Ct(i,null,f,"mounted")}finally{}},S)},W=(i,p,v,f,S)=>{if(v&&T(i,v),f)for(let $=0;$<f.length;$++)T(i,f[$]);if(S){let $=S.subTree;if(p===$||ur($.type)&&($.ssContent===p||$.ssFallback===p)){const I=S.vnode;W(i,I,I.scopeId,I.slotScopeIds,S.parent)}}},N=(i,p,v,f,S,$,I,j,O=0)=>{for(let A=O;A<i.length;A++){const Y=i[A]=j?dt(i[A]):et(i[A]);C(null,Y,p,v,f,S,$,I,j)}},G=(i,p,v,f,S,$,I)=>{const j=p.el=i.el;let{patchFlag:O,dynamicChildren:A,dirs:Y}=p;O|=i.patchFlag&16;const L=i.props||xe,z=p.props||xe;let Q;if(v&&$t(v,!1),(Q=z.onVnodeBeforeUpdate)&&Ge(Q,v,p,i),Y&&Ct(p,i,v,"beforeUpdate"),v&&$t(v,!0),(L.innerHTML&&z.innerHTML==null||L.textContent&&z.textContent==null)&&d(j,""),A?ue(i.dynamicChildren,A,j,v,f,Js(p,S),$):I||le(i,p,j,null,v,f,Js(p,S),$,!1),O>0){if(O&16)U(j,L,z,v,S);else if(O&2&&L.class!==z.class&&l(j,"class",null,z.class,S),O&4&&l(j,"style",L.style,z.style,S),O&8){const ie=p.dynamicProps;for(let me=0;me<ie.length;me++){const he=ie[me],Te=L[he],Ee=z[he];(Ee!==Te||he==="value")&&l(j,he,Te,Ee,S,v)}}O&1&&i.children!==p.children&&d(j,p.children)}else!I&&A==null&&U(j,L,z,v,S);((Q=z.onVnodeUpdated)||Y)&&je(()=>{Q&&Ge(Q,v,p,i),Y&&Ct(p,i,v,"updated")},f)},ue=(i,p,v,f,S,$,I)=>{for(let j=0;j<p.length;j++){const O=i[j],A=p[j],Y=O.el&&(O.type===te||!Jt(O,A)||O.shapeFlag&198)?m(O.el):v;C(O,A,Y,null,f,S,$,I,!0)}},U=(i,p,v,f,S)=>{if(p!==v){if(p!==xe)for(const $ in p)!Zt($)&&!($ in v)&&l(i,$,p[$],null,S,f);for(const $ in v){if(Zt($))continue;const I=v[$],j=p[$];I!==j&&$!=="value"&&l(i,$,j,I,S,f)}"value"in v&&l(i,"value",p.value,v.value,S)}},R=(i,p,v,f,S,$,I,j,O)=>{const A=p.el=i?i.el:c(""),Y=p.anchor=i?i.anchor:c("");let{patchFlag:L,dynamicChildren:z,slotScopeIds:Q}=p;Q&&(j=j?j.concat(Q):Q),i==null?(n(A,v,f),n(Y,v,f),N(p.children||[],v,Y,S,$,I,j,O)):L>0&&L&64&&z&&i.dynamicChildren&&i.dynamicChildren.length===z.length?(ue(i.dynamicChildren,z,v,S,$,I,j),(p.key!=null||S&&p===S.subTree)&&ir(i,p,!0)):le(i,p,v,Y,S,$,I,j,O)},K=(i,p,v,f,S,$,I,j,O)=>{p.slotScopeIds=j,i==null?p.shapeFlag&512?S.ctx.activate(p,v,f,I,O):oe(p,v,f,S,$,I,O):ve(i,p,O)},oe=(i,p,v,f,S,$,I)=>{const j=i.component=ci(i,f,S);if(Wo(i)&&(j.ctx.renderer=D),di(j,!1,I),j.asyncDep){if(S&&S.registerDep(j,Se,I),!i.el){const O=j.subTree=nt(kt);k(null,O,p,v),i.placeholder=O.el}}else Se(j,i,p,v,S,$,I)},ve=(i,p,v)=>{const f=p.component=i.component;if(Kl(i,p,v))if(f.asyncDep&&!f.asyncResolved){pe(f,p,v);return}else f.next=p,f.update();else p.el=i.el,f.vnode=p},Se=(i,p,v,f,S,$,I)=>{const j=()=>{if(i.isMounted){let{next:L,bu:z,u:Q,parent:ie,vnode:me}=i;{const Je=ar(i);if(Je){L&&(L.el=me.el,pe(i,L,I)),Je.asyncDep.then(()=>{je(()=>{i.isUnmounted||A()},S)});return}}let he=L,Te;$t(i,!1),L?(L.el=me.el,pe(i,L,I)):L=me,z&&gs(z),(Te=L.props&&L.props.onVnodeBeforeUpdate)&&Ge(Te,ie,L,me),$t(i,!0);const Ee=Hn(i),ze=i.subTree;i.subTree=Ee,C(ze,Ee,m(ze.el),Pt(ze),i,S,$),L.el=Ee.el,he===null&&Wl(i,Ee.el),Q&&je(Q,S),(Te=L.props&&L.props.onVnodeUpdated)&&je(()=>Ge(Te,ie,L,me),S)}else{let L;const{el:z,props:Q}=p,{bm:ie,m:me,parent:he,root:Te,type:Ee}=i,ze=ts(p);$t(i,!1),ie&&gs(ie),!ze&&(L=Q&&Q.onVnodeBeforeMount)&&Ge(L,he,p),$t(i,!0);{Te.ce&&Te.ce._hasShadowRoot()&&Te.ce._injectChildStyle(Ee,i.parent?i.parent.type:void 0);const Je=i.subTree=Hn(i);C(null,Je,v,f,i,S,$),p.el=Je.el}if(me&&je(me,S),!ze&&(L=Q&&Q.onVnodeMounted)){const Je=p;je(()=>Ge(L,he,Je),S)}(p.shapeFlag&256||he&&ts(he.vnode)&&he.vnode.shapeFlag&256)&&i.a&&je(i.a,S),i.isMounted=!0,p=v=f=null}};i.scope.on();const O=i.effect=new _o(j);i.scope.off();const A=i.update=O.run.bind(O),Y=i.job=O.runIfDirty.bind(O);Y.i=i,Y.id=i.uid,O.scheduler=()=>bn(Y),$t(i,!0),A()},pe=(i,p,v)=>{p.component=i;const f=i.vnode.props;i.vnode=p,i.next=null,Jl(i,p.props,f,v),Zl(i,p.children,v),xt(),Dn(i),ht()},le=(i,p,v,f,S,$,I,j,O=!1)=>{const A=i&&i.children,Y=i?i.shapeFlag:0,L=p.children,{patchFlag:z,shapeFlag:Q}=p;if(z>0){if(z&128){M(A,L,v,f,S,$,I,j,O);return}else if(z&256){F(A,L,v,f,S,$,I,j,O);return}}Q&8?(Y&16&&it(A,S,$),L!==A&&d(v,L)):Y&16?Q&16?M(A,L,v,f,S,$,I,j,O):it(A,S,$,!0):(Y&8&&d(v,""),Q&16&&N(L,v,f,S,$,I,j,O))},F=(i,p,v,f,S,$,I,j,O)=>{i=i||Dt,p=p||Dt;const A=i.length,Y=p.length,L=Math.min(A,Y);let z;for(z=0;z<L;z++){const Q=p[z]=O?dt(p[z]):et(p[z]);C(i[z],Q,v,null,S,$,I,j,O)}A>Y?it(i,S,$,!0,!1,L):N(p,v,f,S,$,I,j,O,L)},M=(i,p,v,f,S,$,I,j,O)=>{let A=0;const Y=p.length;let L=i.length-1,z=Y-1;for(;A<=L&&A<=z;){const Q=i[A],ie=p[A]=O?dt(p[A]):et(p[A]);if(Jt(Q,ie))C(Q,ie,v,null,S,$,I,j,O);else break;A++}for(;A<=L&&A<=z;){const Q=i[L],ie=p[z]=O?dt(p[z]):et(p[z]);if(Jt(Q,ie))C(Q,ie,v,null,S,$,I,j,O);else break;L--,z--}if(A>L){if(A<=z){const Q=z+1,ie=Q<Y?p[Q].el:f;for(;A<=z;)C(null,p[A]=O?dt(p[A]):et(p[A]),v,ie,S,$,I,j,O),A++}}else if(A>z)for(;A<=L;)ke(i[A],S,$,!0),A++;else{const Q=A,ie=A,me=new Map;for(A=ie;A<=z;A++){const Le=p[A]=O?dt(p[A]):et(p[A]);Le.key!=null&&me.set(Le.key,A)}let he,Te=0;const Ee=z-ie+1;let ze=!1,Je=0;const Wt=new Array(Ee);for(A=0;A<Ee;A++)Wt[A]=0;for(A=Q;A<=L;A++){const Le=i[A];if(Te>=Ee){ke(Le,S,$,!0);continue}let qe;if(Le.key!=null)qe=me.get(Le.key);else for(he=ie;he<=z;he++)if(Wt[he-ie]===0&&Jt(Le,p[he])){qe=he;break}qe===void 0?ke(Le,S,$,!0):(Wt[qe-ie]=A+1,qe>=Je?Je=qe:ze=!0,C(Le,p[qe],v,null,S,$,I,j,O),Te++)}const Tn=ze?ti(Wt):Dt;for(he=Tn.length-1,A=Ee-1;A>=0;A--){const Le=ie+A,qe=p[Le],En=p[Le+1],An=Le+1<Y?En.el||cr(En):f;Wt[A]===0?C(null,qe,v,An,S,$,I,j,O):ze&&(he<0||A!==Tn[he]?$e(qe,v,An,2):he--)}}},$e=(i,p,v,f,S=null)=>{const{el:$,type:I,transition:j,children:O,shapeFlag:A}=i;if(A&6){$e(i.component.subTree,p,v,f);return}if(A&128){i.suspense.move(p,v,f);return}if(A&64){I.move(i,p,v,D);return}if(I===te){n($,p,v);for(let L=0;L<O.length;L++)$e(O[L],p,v,f);n(i.anchor,p,v);return}if(I===ys){H(i,p,v);return}if(f!==2&&A&1&&j)if(f===0)j.beforeEnter($),n($,p,v),je(()=>j.enter($),S);else{const{leave:L,delayLeave:z,afterLeave:Q}=j,ie=()=>{i.ctx.isUnmounted?o($):n($,p,v)},me=()=>{$._isLeaving&&$[hl](!0),L($,()=>{ie(),Q&&Q()})};z?z($,ie,me):me()}else n($,p,v)},ke=(i,p,v,f=!1,S=!1)=>{const{type:$,props:I,ref:j,children:O,dynamicChildren:A,shapeFlag:Y,patchFlag:L,dirs:z,cacheIndex:Q,memo:ie}=i;if(L===-2&&(S=!1),j!=null&&(xt(),es(j,null,v,i,!0),ht()),Q!=null&&(p.renderCache[Q]=void 0),Y&256){p.ctx.deactivate(i);return}const me=Y&1&&z,he=!ts(i);let Te;if(he&&(Te=I&&I.onVnodeBeforeUnmount)&&Ge(Te,p,i),Y&6)It(i.component,v,f);else{if(Y&128){i.suspense.unmount(v,f);return}me&&Ct(i,null,p,"beforeUnmount"),Y&64?i.type.remove(i,p,v,D,f):A&&!A.hasOnce&&($!==te||L>0&&L&64)?it(A,p,v,!1,!0):($===te&&L&384||!S&&Y&16)&&it(O,p,v),f&&de(i)}const Ee=ie!=null&&Q==null;(he&&(Te=I&&I.onVnodeUnmounted)||me||Ee)&&je(()=>{Te&&Ge(Te,p,i),me&&Ct(i,null,p,"unmounted"),Ee&&(i.el=null)},v)},de=i=>{const{type:p,el:v,anchor:f,transition:S}=i;if(p===te){We(v,f);return}if(p===ys){V(i);return}const $=()=>{o(v),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(i.shapeFlag&1&&S&&!S.persisted){const{leave:I,delayLeave:j}=S,O=()=>I(v,$);j?j(i.el,$,O):O()}else $()},We=(i,p)=>{let v;for(;i!==p;)v=y(i),o(i),i=v;o(p)},It=(i,p,v)=>{const{bum:f,scope:S,job:$,subTree:I,um:j,m:O,a:A}=i;Wn(O),Wn(A),f&&gs(f),S.stop(),$&&($.flags|=8,ke(I,i,p,v)),j&&je(j,p),je(()=>{i.isUnmounted=!0},p)},it=(i,p,v,f=!1,S=!1,$=0)=>{for(let I=$;I<i.length;I++)ke(i[I],p,v,f,S)},Pt=i=>{if(i.shapeFlag&6)return Pt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const p=y(i.anchor||i.el),v=p&&p[ml];return v?y(v):p};let at=!1;const bt=(i,p,v)=>{let f;i==null?p._vnode&&(ke(p._vnode,null,null,!0),f=p._vnode.component):C(p._vnode||null,i,p,null,null,null,v),p._vnode=i,at||(at=!0,Dn(f),Uo(),at=!1)},D={p:C,um:ke,m:$e,r:de,mt:oe,mc:N,pc:le,pbc:ue,n:Pt,o:e};return{render:bt,hydrate:void 0,createApp:Ll(bt)}}function Js({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function $t({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ei(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ir(e,t,s=!1){const n=e.children,o=t.children;if(Z(n)&&Z(o))for(let l=0;l<n.length;l++){const a=n[l];let c=o[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[l]=dt(o[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ir(a,c)),c.type===Ls&&(c.patchFlag===-1&&(c=o[l]=dt(c)),c.el=a.el),c.type===kt&&!c.el&&(c.el=a.el)}}function ti(e){const t=e.slice(),s=[0];let n,o,l,a,c;const u=e.length;for(n=0;n<u;n++){const x=e[n];if(x!==0){if(o=s[s.length-1],e[o]<x){t[n]=o,s.push(n);continue}for(l=0,a=s.length-1;l<a;)c=l+a>>1,e[s[c]]<x?l=c+1:a=c;x<e[s[l]]&&(l>0&&(t[n]=s[l-1]),s[l]=n)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ar(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ar(t)}function Wn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?cr(t.subTree):null}const ur=e=>e.__isSuspense;function si(e,t){t&&t.pendingBranch?Z(e)?t.effects.push(...e):t.effects.push(e):al(e)}const te=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Ve=null;function h(e=!1){ns.push(Ve=e?null:[])}function ni(){ns.pop(),Ve=ns[ns.length-1]||null}let is=1;function zn(e,t=!1){is+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function dr(e){return e.dynamicChildren=is>0?Ve||Dt:null,ni(),is>0&&Ve&&Ve.push(e),e}function g(e,t,s,n,o,l){return dr(r(e,t,s,n,o,l,!0))}function fr(e,t,s,n,o){return dr(nt(e,t,s,n,o,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||Me(e)||X(e)?{i:Ue,r:e,k:t,f:!!s}:e:null);function r(e,t=null,s=null,n=0,o=null,l=e===te?0:1,a=!1,c=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Fo,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ue};return c?(Cn(u,s),l&128&&e.normalize(u)):s&&(u.shapeFlag|=Ce(s)?8:16),is>0&&!a&&Ve&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&Ve.push(u),u}const nt=oi;function oi(e,t=null,s=null,n=0,o=null,l=!1){if((!e||e===Jo)&&(e=kt),pr(e)){const c=Vt(e,t,!0);return s&&Cn(c,s),is>0&&!l&&Ve&&(c.shapeFlag&6?Ve[Ve.indexOf(e)]=c:Ve.push(c)),c.patchFlag=-2,c}if(hi(e)&&(e=e.__vccOpts),t){t=ri(t);let{class:c,style:u}=t;c&&!Ce(c)&&(t.class=J(c)),fe(u)&&(yn(u)&&!Z(u)&&(u=Ae({},u)),t.style=Lt(u))}const a=Ce(e)?1:ur(e)?128:xl(e)?64:fe(e)?4:X(e)?2:0;return r(e,t,s,n,o,a,l,!0)}function ri(e){return e?yn(e)||tr(e)?Ae({},e):e:null}function Vt(e,t,s=!1,n=!1){const{props:o,ref:l,patchFlag:a,children:c,transition:u}=e,x=t?li(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:x,key:x&&mr(x),ref:t&&t.ref?s&&l?Z(l)?l.concat(bs(t)):[l,bs(t)]:bs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==te?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&_n(d,u.clone(d)),d}function we(e=" ",t=0){return nt(Ls,null,e,t)}function Xe(e,t){const s=nt(ys,null,e);return s.staticCount=t,s}function q(e="",t=!1){return t?(h(),fr(kt,null,e)):nt(kt,null,e)}function et(e){return e==null||typeof e=="boolean"?nt(kt):Z(e)?nt(te,null,e.slice()):pr(e)?dt(e):nt(Ls,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Cn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Z(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Cn(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!tr(t)?t._ctx=Ue:o===3&&Ue&&(Ue.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Ue},s=32):(t=String(t),n&64?(s=16,t=[we(t)]):s=8);e.children=t,e.shapeFlag|=s}function li(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=J([t.class,n.class]));else if(o==="style")t.style=Lt([t.style,n.style]);else if(Es(o)){const l=t[o],a=n[o];a&&l!==a&&!(Z(l)&&l.includes(a))?t[o]=l?[].concat(l,a):a:a==null&&l==null&&!As(o)&&(t[o]=a)}else o!==""&&(t[o]=n[o])}return t}function Ge(e,t,s,n=null){rt(e,t,7,[s,n])}const ii=Yo();let ai=0;function ci(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||ii,l={uid:ai++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ir(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,o),emitsOptions:Zo(n,o),emit:null,emitted:null,propsDefaults:xe,inheritAttrs:n.inheritAttrs,ctx:xe,data:xe,props:xe,attrs:xe,slots:xe,refs:xe,setupState:xe,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=Vl.bind(null,l),e.ce&&e.ce(l),l}let Pe=null;const ui=()=>Pe||Ue;let Ts,rn;{const e=Os(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),l=>{o.length>1?o.forEach(a=>a(l)):o[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Pe=s),rn=t("__VUE_SSR_SETTERS__",s=>as=s)}const fs=e=>{const t=Pe;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Pe&&Pe.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let as=!1;function di(e,t=!1,s=!1){t&&rn(t);const{props:n,children:o}=e.vnode,l=xr(e);zl(e,n,l,t),Yl(e,o,s||t);const a=l?fi(e,t):void 0;return t&&rn(!1),a}function fi(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pl);const{setup:n}=s;if(n){xt();const o=e.setupContext=n.length>1?mi(e):null,l=fs(e),a=ds(n,e,0,[e.props,o]),c=mo(a);if(ht(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(u=>{qn(e,u)}).catch(u=>{Rs(u,e,0)});e.asyncDep=a}else qn(e,a)}else hr(e)}function qn(e,t,s){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fe(t)&&(e.setupState=Ro(t)),hr(e)}function hr(e,t,s){const n=e.type;e.render||(e.render=n.render||st);{const o=fs(e);xt();try{Ml(e)}finally{ht(),o()}}}const pi={get(e,t){return Ie(e,"get",""),e[t]}};function mi(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pi),slots:e.slots,emit:e.emit,expose:t}}function Us(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(Zr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ss)return ss[s](e)},has(t,s){return s in t||s in ss}})):e.proxy}function xi(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function hi(e){return X(e)&&"__vccOpts"in e}const Fe=(e,t)=>nl(e,t,as),gi="3.5.31";/**
60
+ **/function ds(e,t,s,n){try{return n?e(...n):e()}catch(o){Rs(o,t,s)}}function lt(e,t,s,n){if(te(e)){const o=ds(e,t,s,n);return o&&mo(o)&&o.catch(l=>{Rs(l,t,s)}),o}if(Q(e)){const o=[];for(let l=0;l<e.length;l++)o.push(lt(e[l],t,s,n));return o}}function Rs(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||he;if(t){let c=t.parent;const u=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const d=c.ec;if(d){for(let m=0;m<d.length;m++)if(d[m](e,u,h)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,u,h]),gt();return}}ll(e,s,o,n,a)}function ll(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const De=[];let Ze=-1;const jt=[];let _t=null,Ot=0;const jo=Promise.resolve();let ks=null;function No(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function il(e){let t=Ze+1,s=De.length;for(;t<s;){const n=t+s>>>1,o=De[n],l=ls(o);l<e||l===e&&o.flags&2?t=n+1:s=n}return t}function bn(e){if(!(e.flags&1)){const t=ls(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=ls(s)?De.push(e):De.splice(il(t),0,e),e.flags|=1,Lo()}}function Lo(){ks||(ks=jo.then(Vo))}function al(e){Q(e)?jt.push(...e):_t&&e.id===-1?_t.splice(Ot+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Lo()}function Dn(e,t,s=Ze+1){for(;s<De.length;s++){const n=De[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;De.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Uo(e){if(jt.length){const t=[...new Set(jt)].sort((s,n)=>ls(s)-ls(n));if(jt.length=0,_t){_t.push(...t);return}for(_t=t,Ot=0;Ot<_t.length;Ot++){const s=_t[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_t=null,Ot=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Ze=0;Ze<De.length;Ze++){const t=De[Ze];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ds(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ze<De.length;Ze++){const t=De[Ze];t&&(t.flags&=-2)}Ze=-1,De.length=0,Uo(),ks=null,(De.length||jt.length)&&Vo()}}let Ve=null,Fo=null;function Ss(e){const t=Ve;return Ve=e,Fo=e&&e.type.__scopeId||null,t}function cl(e,t=Ve,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&zn(-1);const l=Ss(t);let a;try{a=e(...o)}finally{Ss(l),n._d&&zn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function se(e,t){if(Ve===null)return e;const s=Us(Ve),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[l,a,c,u=he]=t[o];l&&(te(l)&&(l={mounted:l,updated:l}),l.deep&&mt(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:u}))}return e}function $t(e,t,s,n){const o=e.dirs,l=t&&t.dirs;for(let a=0;a<o.length;a++){const c=o[a];l&&(c.oldValue=l[a].value);let u=c.dir[n];u&&(xt(),lt(u,s,8,[e.el,c,e,t]),gt())}}function ul(e,t){if(Pe){let s=Pe.provides;const n=Pe.parent&&Pe.parent.provides;n===s&&(s=Pe.provides=Object.create(n)),s[e]=t}}function vs(e,t,s=!1){const n=ui();if(n||Nt){let o=Nt?Nt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&te(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>vs(dl);function Ws(e,t,s){return Bo(e,t,s)}function Bo(e,t,s=he){const{immediate:n,deep:o,flush:l,once:a}=s,c=Ee({},s),u=t&&n||!t&&l!=="post";let h;if(as){if(l==="sync"){const A=fl();h=A.__watcherHandles||(A.__watcherHandles=[])}else if(!u){const A=()=>{};return A.stop=nt,A.resume=nt,A.pause=nt,A}}const d=Pe;c.call=(A,H,C)=>lt(A,d,H,C);let m=!1;l==="post"?c.scheduler=A=>{Ne(A,d&&d.suspense)}:l!=="sync"&&(m=!0,c.scheduler=(A,H)=>{H?A():bn(A)}),c.augmentJob=A=>{t&&(A.flags|=4),m&&(A.flags|=2,d&&(A.id=d.uid,A.i=d))};const b=rl(e,t,c);return as&&(h?h.push(b):u&&b()),b}function pl(e,t,s){const n=this.proxy,o=$e(e)?e.includes(".")?Ho(n,e):()=>n[e]:e.bind(n,n);let l;te(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Bo(o,l.bind(n),s);return a(),c}function Ho(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const ml=Symbol("_vte"),hl=e=>e.__isTeleport,xl=Symbol("_leaveCb");function _n(e,t){e.shapeFlag&6&&e.component?(e.transition=t,_n(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function it(e,t){return te(e)?Ee({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Rn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const $s=new WeakMap;function es(e,t,s,n,o=!1){if(Q(e)){e.forEach((C,w)=>es(C,t&&(Q(t)?t[w]:t),s,n,o));return}if(ts(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&es(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Us(n.component):n.el,a=o?null:l,{i:c,r:u}=e,h=t&&t.r,d=c.refs===he?c.refs={}:c.refs,m=c.setupState,b=ae(m),A=m===he?po:C=>Rn(d,C)?!1:ce(b,C),H=(C,w)=>!(w&&Rn(d,w));if(h!=null&&h!==u){if(jn(t),$e(h))d[h]=null,A(h)&&(m[h]=null);else if(Me(h)){const C=t;H(h,C.k)&&(h.value=null),C.k&&(d[C.k]=null)}}if(te(u))ds(u,c,12,[a,d]);else{const C=$e(u),w=Me(u);if(C||w){const k=()=>{if(e.f){const S=C?A(u)?m[u]:d[u]:H()||!e.k?u.value:d[e.k];if(o)Q(S)&&cn(S,l);else if(Q(S))S.includes(l)||S.push(l);else if(C)d[u]=[l],A(u)&&(m[u]=d[u]);else{const O=[l];H(u,e.k)&&(u.value=O),e.k&&(d[e.k]=O)}}else C?(d[u]=a,A(u)&&(m[u]=a)):w&&(H(u,e.k)&&(u.value=a),e.k&&(d[e.k]=a))};if(a){const S=()=>{k(),$s.delete(e)};S.id=-1,$s.set(e,S),Ne(S,s)}else jn(e),k()}}}function jn(e){const t=$s.get(e);t&&(t.flags|=8,$s.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function vl(e,t){zo(e,"da",t)}function zo(e,t,s=Pe){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(js(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Wo(o.parent.vnode)&&yl(n,t,s,o),o=o.parent}}function yl(e,t,s,n){const o=js(t,e,n,!0);wn(()=>{cn(n[t],o)},s)}function js(e,t,s=Pe,n=!1){if(s){const o=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),u=lt(t,s,e,a);return c(),gt(),u});return n?o.unshift(l):o.push(l),l}}const yt=e=>(t,s=Pe)=>{(!as||e==="sp")&&js(e,(...n)=>t(...n),s)},bl=yt("bm"),We=yt("m"),_l=yt("bu"),wl=yt("u"),kl=yt("bum"),wn=yt("um"),Sl=yt("sp"),$l=yt("rtg"),Cl=yt("rtc");function Tl(e,t=Pe){js("ec",e,t)}const Al="components",Jo=Symbol.for("v-ndc");function El(e){return $e(e)?Il(Al,e,!1)||e:e||Jo}function Il(e,t,s=!0,n=!1){const o=Ve||Pe;if(o){const l=o.type;{const c=hi(l,!1);if(c&&(c===t||c===je(t)||c===Ps(je(t))))return l}const a=Nn(o[e]||l[e],t)||Nn(o.appContext[e],t);return!a&&n?l:a}}function Nn(e,t){return e&&(e[t]||e[je(t)]||e[Ps(je(t))])}function ve(e,t,s,n){let o;const l=s,a=Q(e);if(a||$e(e)){const c=a&&Et(e);let u=!1,h=!1;c&&(u=!Be(e),h=vt(e),e=Ds(e)),o=new Array(e.length);for(let d=0,m=e.length;d<m;d++)o[d]=t(u?h?Ut(Ke(e[d])):Ke(e[d]):e[d],d,void 0,l)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,l)}else if(fe(e))if(e[Symbol.iterator])o=Array.from(e,(c,u)=>t(c,u,void 0,l));else{const c=Object.keys(e);o=new Array(c.length);for(let u=0,h=c.length;u<h;u++){const d=c[u];o[u]=t(e[d],d,u,l)}}else o=[];return o}const tn=e=>e?hr(e)?Us(e):tn(e.parent):null,ss=Ee(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=>tn(e.parent),$root:e=>tn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Go(e),$forceUpdate:e=>e.f||(e.f=()=>{bn(e.update)}),$nextTick:e=>e.n||(e.n=No.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==he&&!e.__isScriptSetup&&ce(e,t),Pl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:l,accessCache:a,type:c,appContext:u}=e;if(t[0]!=="$"){const b=a[t];if(b!==void 0)switch(b){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(o!==he&&ce(o,t))return a[t]=2,o[t];if(ce(l,t))return a[t]=3,l[t];if(s!==he&&ce(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const h=ss[t];let d,m;if(h)return t==="$attrs"&&Ie(e.attrs,"get",""),h(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(s!==he&&ce(s,t))return a[t]=4,s[t];if(m=u.config.globalProperties,ce(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:l}=e;return zs(o,t)?(o[t]=s,!0):n!==he&&ce(n,t)?(n[t]=s,!0):ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:l,type:a}},c){let u;return!!(s[c]||e!==he&&c[0]!=="$"&&ce(e,c)||zs(t,c)||ce(l,c)||ce(n,c)||ce(ss,c)||ce(o.config.globalProperties,c)||(u=a.__cssModules)&&u[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ce(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Ln(e){return Q(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ml(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:a,watch:c,provide:u,inject:h,created:d,beforeMount:m,mounted:b,beforeUpdate:A,updated:H,activated:C,deactivated:w,beforeDestroy:k,beforeUnmount:S,destroyed:O,unmounted:P,render:Z,renderTracked:X,renderTriggered:K,errorCaptured:R,serverPrefetch:z,expose:ue,inheritAttrs:F,components:L,directives:J,filters:oe}=t;if(h&&Ol(h,n,null),a)for(const pe in a){const le=a[pe];te(le)&&(n[pe]=le.bind(s))}if(o){const pe=o.call(s,s);fe(pe)&&(e.data=gn(pe))}if(sn=!0,l)for(const pe in l){const le=l[pe],B=te(le)?le.bind(s,s):te(le.get)?le.get.bind(s,s):nt,D=!te(le)&&te(le.set)?le.set.bind(s):nt,Ce=Re({get:B,set:D});Object.defineProperty(n,pe,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:ke=>Ce.value=ke})}if(c)for(const pe in c)qo(c[pe],n,s,pe);if(u){const pe=te(u)?u.call(s):u;Reflect.ownKeys(pe).forEach(le=>{ul(le,pe[le])})}d&&Un(d,e,"c");function Se(pe,le){Q(le)?le.forEach(B=>pe(B.bind(s))):le&&pe(le.bind(s))}if(Se(bl,m),Se(We,b),Se(_l,A),Se(wl,H),Se(gl,C),Se(vl,w),Se(Tl,R),Se(Cl,X),Se($l,K),Se(kl,S),Se(wn,P),Se(Sl,z),Q(ue))if(ue.length){const pe=e.exposed||(e.exposed={});ue.forEach(le=>{Object.defineProperty(pe,le,{get:()=>s[le],set:B=>s[le]=B,enumerable:!0})})}else e.exposed||(e.exposed={});Z&&e.render===nt&&(e.render=Z),F!=null&&(e.inheritAttrs=F),L&&(e.components=L),J&&(e.directives=J),z&&Ko(e)}function Ol(e,t,s=nt){Q(e)&&(e=nn(e));for(const n in e){const o=e[n];let l;fe(o)?"default"in o?l=vs(o.from||n,o.default,!0):l=vs(o.from||n):l=vs(o),Me(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[n]=l}}function Un(e,t,s){lt(Q(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let o=n.includes(".")?Ho(s,n):()=>s[n];if($e(e)){const l=t[e];te(l)&&Ws(o,l)}else if(te(e))Ws(o,e.bind(s));else if(fe(e))if(Q(e))e.forEach(l=>qo(l,t,s,n));else{const l=te(e.handler)?e.handler.bind(s):t[e.handler];te(l)&&Ws(o,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let u;return c?u=c:!o.length&&!s&&!n?u=t:(u={},o.length&&o.forEach(h=>Cs(u,h,a,!0)),Cs(u,t,a)),fe(t)&&l.set(t,u),u}function Cs(e,t,s,n=!1){const{mixins:o,extends:l}=t;l&&Cs(e,l,s,!0),o&&o.forEach(a=>Cs(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const c=Dl[a]||s&&s[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Fn,emits:Fn,methods:Yt,computed:Yt,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ee(te(e)?e.call(this,this):e,te(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(Q(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Oe(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Ee(Object.create(null),e,t):t}function Fn(e,t){return e?Q(e)&&Q(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Ln(e),Ln(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const n in t)s[n]=Oe(e[n],t[n]);return s}function Yo(){return{app:null,config:{isNativeTag:po,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 Nl=0;function Ll(e,t){return function(n,o=null){te(n)||(n=Ee({},n)),o!=null&&!fe(o)&&(o=null);const l=Yo(),a=new WeakSet,c=[];let u=!1;const h=l.app={_uid:Nl++,_component:n,_props:o,_container:null,_context:l,_instance:null,version:gi,get config(){return l.config},set config(d){},use(d,...m){return a.has(d)||(d&&te(d.install)?(a.add(d),d.install(h,...m)):te(d)&&(a.add(d),d(h,...m))),h},mixin(d){return l.mixins.includes(d)||l.mixins.push(d),h},component(d,m){return m?(l.components[d]=m,h):l.components[d]},directive(d,m){return m?(l.directives[d]=m,h):l.directives[d]},mount(d,m,b){if(!u){const A=h._ceVNode||ot(n,o);return A.appContext=l,b===!0?b="svg":b===!1&&(b=void 0),e(A,d,b),u=!0,h._container=d,d.__vue_app__=h,Us(A.component)}},onUnmount(d){c.push(d)},unmount(){u&&(lt(c,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(d,m){return l.provides[d]=m,h},runWithContext(d){const m=Nt;Nt=h;try{return d()}finally{Nt=m}}};return h}}let Nt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${je(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||he;let o=s;const l=t.startsWith("update:"),a=l&&Ul(n,t.slice(7));a&&(a.trim&&(o=s.map(d=>$e(d)?d.trim():d)),a.number&&(o=s.map(Ms)));let c,u=n[c=Vs(t)]||n[c=Vs(je(t))];!u&&l&&(u=n[c=Vs(St(t))]),u&&lt(u,e,6,o);const h=n[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,lt(h,e,6,o)}}const Fl=new WeakMap;function Zo(e,t,s=!1){const n=s?Fl:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const l=e.emits;let a={},c=!1;if(!te(e)){const u=h=>{const d=Zo(h,t,!0);d&&(c=!0,Ee(a,d))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!c?(fe(e)&&n.set(e,null),null):(Q(l)?l.forEach(u=>a[u]=null):Ee(a,l),fe(e)&&n.set(e,a),a)}function Ns(e,t){return!e||!As(t)?!1:(t=t.slice(2).replace(/Once$/,""),ce(e,t[0].toLowerCase()+t.slice(1))||ce(e,St(t))||ce(e,t))}function Bn(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[l],slots:a,attrs:c,emit:u,render:h,renderCache:d,props:m,data:b,setupState:A,ctx:H,inheritAttrs:C}=e,w=Ss(e);let k,S;try{if(s.shapeFlag&4){const P=o||n,Z=P;k=tt(h.call(Z,P,d,m,A,b,H)),S=c}else{const P=t;k=tt(P.length>1?P(m,{attrs:c,slots:a,emit:u}):P(m,null)),S=t.props?c:Bl(c)}}catch(P){ns.length=0,Rs(P,e,1),k=ot(kt)}let O=k;if(S&&C!==!1){const P=Object.keys(S),{shapeFlag:Z}=O;P.length&&Z&7&&(l&&P.some(Es)&&(S=Hl(S,l)),O=Vt(O,S,!1,!0))}return s.dirs&&(O=Vt(O,null,!1,!0),O.dirs=O.dirs?O.dirs.concat(s.dirs):s.dirs),s.transition&&_n(O,s.transition),k=O,Ss(w),k}const Bl=e=>{let t;for(const s in e)(s==="class"||s==="style"||As(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const n in e)(!Es(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:o,component:l}=e,{props:a,children:c,patchFlag:u}=t,h=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?Hn(n,a,h):!!a;if(u&8){const d=t.dynamicProps;for(let m=0;m<d.length;m++){const b=d[m];if(Qo(a,n,b)&&!Ns(h,b))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:n===a?!1:n?a?Hn(n,a,h):!0:!!a;return!1}function Hn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const l=n[o];if(Qo(t,e,l)&&!Ns(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],o=t[s];return s==="style"&&fe(n)&&fe(o)?!Kt(n,o):n!==o}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,n=!1){const o={},l=er();e.propsDefaults=Object.create(null),sr(e,t,o,l);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);s?e.props=n?o:Yr(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:o,attrs:l,vnode:{patchFlag:a}}=e,c=ae(o),[u]=e.propsOptions;let h=!1;if((n||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m<d.length;m++){let b=d[m];if(Ns(e.emitsOptions,b))continue;const A=t[b];if(u)if(ce(l,b))A!==l[b]&&(l[b]=A,h=!0);else{const H=je(b);o[H]=on(u,c,H,A,e,!1)}else A!==l[b]&&(l[b]=A,h=!0)}}}else{sr(e,t,o,l)&&(h=!0);let d;for(const m in c)(!t||!ce(t,m)&&((d=St(m))===m||!ce(t,d)))&&(u?s&&(s[m]!==void 0||s[d]!==void 0)&&(o[m]=on(u,c,m,void 0,e,!0)):delete o[m]);if(l!==c)for(const m in l)(!t||!ce(t,m))&&(delete l[m],h=!0)}h&&pt(e.attrs,"set","")}function sr(e,t,s,n){const[o,l]=e.propsOptions;let a=!1,c;if(t)for(let u in t){if(Zt(u))continue;const h=t[u];let d;o&&ce(o,d=je(u))?!l||!l.includes(d)?s[d]=h:(c||(c={}))[d]=h:Ns(e.emitsOptions,u)||(!(u in n)||h!==n[u])&&(n[u]=h,a=!0)}if(l){const u=ae(s),h=c||he;for(let d=0;d<l.length;d++){const m=l[d];s[m]=on(o,u,m,h[m],e,!ce(h,m))}}return a}function on(e,t,s,n,o,l){const a=e[s];if(a!=null){const c=ce(a,"default");if(c&&n===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&te(u)){const{propsDefaults:h}=o;if(s in h)n=h[s];else{const d=fs(o);n=h[s]=u.call(null,t),d()}}else n=u;o.ce&&o.ce._setProp(s,n)}a[0]&&(l&&!c?n=!1:a[1]&&(n===""||n===St(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,o=n.get(e);if(o)return o;const l=e.props,a={},c=[];let u=!1;if(!te(e)){const d=m=>{u=!0;const[b,A]=nr(m,t,!0);Ee(a,b),A&&c.push(...A)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!l&&!u)return fe(e)&&n.set(e,Dt),Dt;if(Q(l))for(let d=0;d<l.length;d++){const m=je(l[d]);Kn(m)&&(a[m]=he)}else if(l)for(const d in l){const m=je(d);if(Kn(m)){const b=l[d],A=a[m]=Q(b)||te(b)?{type:b}:Ee({},b),H=A.type;let C=!1,w=!0;if(Q(H))for(let k=0;k<H.length;++k){const S=H[k],O=te(S)&&S.name;if(O==="Boolean"){C=!0;break}else O==="String"&&(w=!1)}else C=te(H)&&H.name==="Boolean";A[0]=C,A[1]=w,(C||ce(A,"default"))&&c.push(m)}}const h=[a,c];return fe(e)&&n.set(e,h),h}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>Q(e)?e.map(tt):[tt(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...o)=>Sn(t(...o)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const o in e){if(kn(o))continue;const l=e[o];if(te(l))t[o]=Gl(o,l,n);else if(l!=null){const a=Sn(l);t[o]=()=>a}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const n in t)(s||!kn(n))&&(e[n]=t[n])},Yl=(e,t,s)=>{const n=e.slots=er();if(e.vnode.shapeFlag&32){const o=t._;o?(lr(n,t,s),s&&go(n,"_",o,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:o}=e;let l=!0,a=he;if(n.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(o,t,s):(l=!t.$stable,or(t,o)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in o)!kn(c)&&a[c]==null&&delete o[c]},Ne=si;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:a,createText:c,createComment:u,setText:h,setElementText:d,parentNode:m,nextSibling:b,setScopeId:A=nt,insertStaticContent:H}=e,C=(i,p,y,f=null,T=null,E=null,M=void 0,U=null,j=!!p.dynamicChildren)=>{if(i===p)return;i&&!Jt(i,p)&&(f=Pt(i),ke(i,T,E,!0),i=null),p.patchFlag===-2&&(j=!1,p.dynamicChildren=null);const{type:I,ref:Y,shapeFlag:V}=p;switch(I){case Ls:w(i,p,y,f);break;case kt:k(i,p,y,f);break;case ys:i==null&&S(p,y,f,M);break;case ne:L(i,p,y,f,T,E,M,U,j);break;default:V&1?Z(i,p,y,f,T,E,M,U,j):V&6?J(i,p,y,f,T,E,M,U,j):(V&64||V&128)&&I.process(i,p,y,f,T,E,M,U,j,N)}Y!=null&&T?es(Y,i&&i.ref,E,p||i,!p):Y==null&&i&&i.ref!=null&&es(i.ref,null,E,i,!0)},w=(i,p,y,f)=>{if(i==null)n(p.el=c(p.children),y,f);else{const T=p.el=i.el;p.children!==i.children&&h(T,p.children)}},k=(i,p,y,f)=>{i==null?n(p.el=u(p.children||""),y,f):p.el=i.el},S=(i,p,y,f)=>{[i.el,i.anchor]=H(i.children,p,y,f,i.el,i.anchor)},O=({el:i,anchor:p},y,f)=>{let T;for(;i&&i!==p;)T=b(i),n(i,y,f),i=T;n(p,y,f)},P=({el:i,anchor:p})=>{let y;for(;i&&i!==p;)y=b(i),o(i),i=y;o(p)},Z=(i,p,y,f,T,E,M,U,j)=>{if(p.type==="svg"?M="svg":p.type==="math"&&(M="mathml"),i==null)X(p,y,f,T,E,M,U,j);else{const I=i.el&&i.el._isVueCE?i.el:null;try{I&&I._beginPatch(),z(i,p,T,E,M,U,j)}finally{I&&I._endPatch()}}},X=(i,p,y,f,T,E,M,U)=>{let j,I;const{props:Y,shapeFlag:V,transition:q,dirs:ee}=i;if(j=i.el=a(i.type,E,Y&&Y.is,Y),V&8?d(j,i.children):V&16&&R(i.children,j,null,f,T,Js(i,E),M,U),ee&&$t(i,null,f,"created"),K(j,i,i.scopeId,M,f),Y){for(const me in Y)me!=="value"&&!Zt(me)&&l(j,me,null,Y[me],E,f);"value"in Y&&l(j,"value",null,Y.value,E),(I=Y.onVnodeBeforeMount)&&Ye(I,f,i)}ee&&$t(i,null,f,"beforeMount");const ie=ei(T,q);ie&&q.beforeEnter(j),n(j,p,y),((I=Y&&Y.onVnodeMounted)||ie||ee)&&Ne(()=>{try{I&&Ye(I,f,i),ie&&q.enter(j),ee&&$t(i,null,f,"mounted")}finally{}},T)},K=(i,p,y,f,T)=>{if(y&&A(i,y),f)for(let E=0;E<f.length;E++)A(i,f[E]);if(T){let E=T.subTree;if(p===E||ur(E.type)&&(E.ssContent===p||E.ssFallback===p)){const M=T.vnode;K(i,M,M.scopeId,M.slotScopeIds,T.parent)}}},R=(i,p,y,f,T,E,M,U,j=0)=>{for(let I=j;I<i.length;I++){const Y=i[I]=U?ft(i[I]):tt(i[I]);C(null,Y,p,y,f,T,E,M,U)}},z=(i,p,y,f,T,E,M)=>{const U=p.el=i.el;let{patchFlag:j,dynamicChildren:I,dirs:Y}=p;j|=i.patchFlag&16;const V=i.props||he,q=p.props||he;let ee;if(y&&Ct(y,!1),(ee=q.onVnodeBeforeUpdate)&&Ye(ee,y,p,i),Y&&$t(p,i,y,"beforeUpdate"),y&&Ct(y,!0),(V.innerHTML&&q.innerHTML==null||V.textContent&&q.textContent==null)&&d(U,""),I?ue(i.dynamicChildren,I,U,y,f,Js(p,T),E):M||le(i,p,U,null,y,f,Js(p,T),E,!1),j>0){if(j&16)F(U,V,q,y,T);else if(j&2&&V.class!==q.class&&l(U,"class",null,q.class,T),j&4&&l(U,"style",V.style,q.style,T),j&8){const ie=p.dynamicProps;for(let me=0;me<ie.length;me++){const xe=ie[me],Te=V[xe],Ae=q[xe];(Ae!==Te||xe==="value")&&l(U,xe,Te,Ae,T,y)}}j&1&&i.children!==p.children&&d(U,p.children)}else!M&&I==null&&F(U,V,q,y,T);((ee=q.onVnodeUpdated)||Y)&&Ne(()=>{ee&&Ye(ee,y,p,i),Y&&$t(p,i,y,"updated")},f)},ue=(i,p,y,f,T,E,M)=>{for(let U=0;U<p.length;U++){const j=i[U],I=p[U],Y=j.el&&(j.type===ne||!Jt(j,I)||j.shapeFlag&198)?m(j.el):y;C(j,I,Y,null,f,T,E,M,!0)}},F=(i,p,y,f,T)=>{if(p!==y){if(p!==he)for(const E in p)!Zt(E)&&!(E in y)&&l(i,E,p[E],null,T,f);for(const E in y){if(Zt(E))continue;const M=y[E],U=p[E];M!==U&&E!=="value"&&l(i,E,U,M,T,f)}"value"in y&&l(i,"value",p.value,y.value,T)}},L=(i,p,y,f,T,E,M,U,j)=>{const I=p.el=i?i.el:c(""),Y=p.anchor=i?i.anchor:c("");let{patchFlag:V,dynamicChildren:q,slotScopeIds:ee}=p;ee&&(U=U?U.concat(ee):ee),i==null?(n(I,y,f),n(Y,y,f),R(p.children||[],y,Y,T,E,M,U,j)):V>0&&V&64&&q&&i.dynamicChildren&&i.dynamicChildren.length===q.length?(ue(i.dynamicChildren,q,y,T,E,M,U),(p.key!=null||T&&p===T.subTree)&&ir(i,p,!0)):le(i,p,y,Y,T,E,M,U,j)},J=(i,p,y,f,T,E,M,U,j)=>{p.slotScopeIds=U,i==null?p.shapeFlag&512?T.ctx.activate(p,y,f,M,j):oe(p,y,f,T,E,M,j):_e(i,p,j)},oe=(i,p,y,f,T,E,M)=>{const U=i.component=ci(i,f,T);if(Wo(i)&&(U.ctx.renderer=N),di(U,!1,M),U.asyncDep){if(T&&T.registerDep(U,Se,M),!i.el){const j=U.subTree=ot(kt);k(null,j,p,y),i.placeholder=j.el}}else Se(U,i,p,y,T,E,M)},_e=(i,p,y)=>{const f=p.component=i.component;if(Kl(i,p,y))if(f.asyncDep&&!f.asyncResolved){pe(f,p,y);return}else f.next=p,f.update();else p.el=i.el,f.vnode=p},Se=(i,p,y,f,T,E,M)=>{const U=()=>{if(i.isMounted){let{next:V,bu:q,u:ee,parent:ie,vnode:me}=i;{const qe=ar(i);if(qe){V&&(V.el=me.el,pe(i,V,M)),qe.asyncDep.then(()=>{Ne(()=>{i.isUnmounted||I()},T)});return}}let xe=V,Te;Ct(i,!1),V?(V.el=me.el,pe(i,V,M)):V=me,q&&gs(q),(Te=V.props&&V.props.onVnodeBeforeUpdate)&&Ye(Te,ie,V,me),Ct(i,!0);const Ae=Bn(i),Je=i.subTree;i.subTree=Ae,C(Je,Ae,m(Je.el),Pt(Je),i,T,E),V.el=Ae.el,xe===null&&Wl(i,Ae.el),ee&&Ne(ee,T),(Te=V.props&&V.props.onVnodeUpdated)&&Ne(()=>Ye(Te,ie,V,me),T)}else{let V;const{el:q,props:ee}=p,{bm:ie,m:me,parent:xe,root:Te,type:Ae}=i,Je=ts(p);Ct(i,!1),ie&&gs(ie),!Je&&(V=ee&&ee.onVnodeBeforeMount)&&Ye(V,xe,p),Ct(i,!0);{Te.ce&&Te.ce._hasShadowRoot()&&Te.ce._injectChildStyle(Ae,i.parent?i.parent.type:void 0);const qe=i.subTree=Bn(i);C(null,qe,y,f,i,T,E),p.el=qe.el}if(me&&Ne(me,T),!Je&&(V=ee&&ee.onVnodeMounted)){const qe=p;Ne(()=>Ye(V,xe,qe),T)}(p.shapeFlag&256||xe&&ts(xe.vnode)&&xe.vnode.shapeFlag&256)&&i.a&&Ne(i.a,T),i.isMounted=!0,p=y=f=null}};i.scope.on();const j=i.effect=new _o(U);i.scope.off();const I=i.update=j.run.bind(j),Y=i.job=j.runIfDirty.bind(j);Y.i=i,Y.id=i.uid,j.scheduler=()=>bn(Y),Ct(i,!0),I()},pe=(i,p,y)=>{p.component=i;const f=i.vnode.props;i.vnode=p,i.next=null,Jl(i,p.props,f,y),Zl(i,p.children,y),xt(),Dn(i),gt()},le=(i,p,y,f,T,E,M,U,j=!1)=>{const I=i&&i.children,Y=i?i.shapeFlag:0,V=p.children,{patchFlag:q,shapeFlag:ee}=p;if(q>0){if(q&128){D(I,V,y,f,T,E,M,U,j);return}else if(q&256){B(I,V,y,f,T,E,M,U,j);return}}ee&8?(Y&16&&at(I,T,E),V!==I&&d(y,V)):Y&16?ee&16?D(I,V,y,f,T,E,M,U,j):at(I,T,E,!0):(Y&8&&d(y,""),ee&16&&R(V,y,f,T,E,M,U,j))},B=(i,p,y,f,T,E,M,U,j)=>{i=i||Dt,p=p||Dt;const I=i.length,Y=p.length,V=Math.min(I,Y);let q;for(q=0;q<V;q++){const ee=p[q]=j?ft(p[q]):tt(p[q]);C(i[q],ee,y,null,T,E,M,U,j)}I>Y?at(i,T,E,!0,!1,V):R(p,y,f,T,E,M,U,j,V)},D=(i,p,y,f,T,E,M,U,j)=>{let I=0;const Y=p.length;let V=i.length-1,q=Y-1;for(;I<=V&&I<=q;){const ee=i[I],ie=p[I]=j?ft(p[I]):tt(p[I]);if(Jt(ee,ie))C(ee,ie,y,null,T,E,M,U,j);else break;I++}for(;I<=V&&I<=q;){const ee=i[V],ie=p[q]=j?ft(p[q]):tt(p[q]);if(Jt(ee,ie))C(ee,ie,y,null,T,E,M,U,j);else break;V--,q--}if(I>V){if(I<=q){const ee=q+1,ie=ee<Y?p[ee].el:f;for(;I<=q;)C(null,p[I]=j?ft(p[I]):tt(p[I]),y,ie,T,E,M,U,j),I++}}else if(I>q)for(;I<=V;)ke(i[I],T,E,!0),I++;else{const ee=I,ie=I,me=new Map;for(I=ie;I<=q;I++){const Ue=p[I]=j?ft(p[I]):tt(p[I]);Ue.key!=null&&me.set(Ue.key,I)}let xe,Te=0;const Ae=q-ie+1;let Je=!1,qe=0;const Wt=new Array(Ae);for(I=0;I<Ae;I++)Wt[I]=0;for(I=ee;I<=V;I++){const Ue=i[I];if(Te>=Ae){ke(Ue,T,E,!0);continue}let Ge;if(Ue.key!=null)Ge=me.get(Ue.key);else for(xe=ie;xe<=q;xe++)if(Wt[xe-ie]===0&&Jt(Ue,p[xe])){Ge=xe;break}Ge===void 0?ke(Ue,T,E,!0):(Wt[Ge-ie]=I+1,Ge>=qe?qe=Ge:Je=!0,C(Ue,p[Ge],y,null,T,E,M,U,j),Te++)}const Tn=Je?ti(Wt):Dt;for(xe=Tn.length-1,I=Ae-1;I>=0;I--){const Ue=ie+I,Ge=p[Ue],An=p[Ue+1],En=Ue+1<Y?An.el||cr(An):f;Wt[I]===0?C(null,Ge,y,En,T,E,M,U,j):Je&&(xe<0||I!==Tn[xe]?Ce(Ge,y,En,2):xe--)}}},Ce=(i,p,y,f,T=null)=>{const{el:E,type:M,transition:U,children:j,shapeFlag:I}=i;if(I&6){Ce(i.component.subTree,p,y,f);return}if(I&128){i.suspense.move(p,y,f);return}if(I&64){M.move(i,p,y,N);return}if(M===ne){n(E,p,y);for(let V=0;V<j.length;V++)Ce(j[V],p,y,f);n(i.anchor,p,y);return}if(M===ys){O(i,p,y);return}if(f!==2&&I&1&&U)if(f===0)U.beforeEnter(E),n(E,p,y),Ne(()=>U.enter(E),T);else{const{leave:V,delayLeave:q,afterLeave:ee}=U,ie=()=>{i.ctx.isUnmounted?o(E):n(E,p,y)},me=()=>{E._isLeaving&&E[xl](!0),V(E,()=>{ie(),ee&&ee()})};q?q(E,ie,me):me()}else n(E,p,y)},ke=(i,p,y,f=!1,T=!1)=>{const{type:E,props:M,ref:U,children:j,dynamicChildren:I,shapeFlag:Y,patchFlag:V,dirs:q,cacheIndex:ee,memo:ie}=i;if(V===-2&&(T=!1),U!=null&&(xt(),es(U,null,y,i,!0),gt()),ee!=null&&(p.renderCache[ee]=void 0),Y&256){p.ctx.deactivate(i);return}const me=Y&1&&q,xe=!ts(i);let Te;if(xe&&(Te=M&&M.onVnodeBeforeUnmount)&&Ye(Te,p,i),Y&6)It(i.component,y,f);else{if(Y&128){i.suspense.unmount(y,f);return}me&&$t(i,null,p,"beforeUnmount"),Y&64?i.type.remove(i,p,y,N,f):I&&!I.hasOnce&&(E!==ne||V>0&&V&64)?at(I,p,y,!1,!0):(E===ne&&V&384||!T&&Y&16)&&at(j,p,y),f&&de(i)}const Ae=ie!=null&&ee==null;(xe&&(Te=M&&M.onVnodeUnmounted)||me||Ae)&&Ne(()=>{Te&&Ye(Te,p,i),me&&$t(i,null,p,"unmounted"),Ae&&(i.el=null)},y)},de=i=>{const{type:p,el:y,anchor:f,transition:T}=i;if(p===ne){ze(y,f);return}if(p===ys){P(i);return}const E=()=>{o(y),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(i.shapeFlag&1&&T&&!T.persisted){const{leave:M,delayLeave:U}=T,j=()=>M(y,E);U?U(i.el,E,j):j()}else E()},ze=(i,p)=>{let y;for(;i!==p;)y=b(i),o(i),i=y;o(p)},It=(i,p,y)=>{const{bum:f,scope:T,job:E,subTree:M,um:U,m:j,a:I}=i;Wn(j),Wn(I),f&&gs(f),T.stop(),E&&(E.flags|=8,ke(M,i,p,y)),U&&Ne(U,p),Ne(()=>{i.isUnmounted=!0},p)},at=(i,p,y,f=!1,T=!1,E=0)=>{for(let M=E;M<i.length;M++)ke(i[M],p,y,f,T)},Pt=i=>{if(i.shapeFlag&6)return Pt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const p=b(i.anchor||i.el),y=p&&p[ml];return y?b(y):p};let ct=!1;const bt=(i,p,y)=>{let f;i==null?p._vnode&&(ke(p._vnode,null,null,!0),f=p._vnode.component):C(p._vnode||null,i,p,null,null,null,y),p._vnode=i,ct||(ct=!0,Dn(f),Uo(),ct=!1)},N={p:C,um:ke,m:Ce,r:de,mt:oe,mc:R,pc:le,pbc:ue,n:Pt,o:e};return{render:bt,hydrate:void 0,createApp:Ll(bt)}}function Js({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Ct({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ei(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ir(e,t,s=!1){const n=e.children,o=t.children;if(Q(n)&&Q(o))for(let l=0;l<n.length;l++){const a=n[l];let c=o[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[l]=ft(o[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ir(a,c)),c.type===Ls&&(c.patchFlag===-1&&(c=o[l]=ft(c)),c.el=a.el),c.type===kt&&!c.el&&(c.el=a.el)}}function ti(e){const t=e.slice(),s=[0];let n,o,l,a,c;const u=e.length;for(n=0;n<u;n++){const h=e[n];if(h!==0){if(o=s[s.length-1],e[o]<h){t[n]=o,s.push(n);continue}for(l=0,a=s.length-1;l<a;)c=l+a>>1,e[s[c]]<h?l=c+1:a=c;h<e[s[l]]&&(l>0&&(t[n]=s[l-1]),s[l]=n)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ar(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ar(t)}function Wn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?cr(t.subTree):null}const ur=e=>e.__isSuspense;function si(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):al(e)}const ne=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Fe=null;function x(e=!1){ns.push(Fe=e?null:[])}function ni(){ns.pop(),Fe=ns[ns.length-1]||null}let is=1;function zn(e,t=!1){is+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function dr(e){return e.dynamicChildren=is>0?Fe||Dt:null,ni(),is>0&&Fe&&Fe.push(e),e}function g(e,t,s,n,o,l){return dr(r(e,t,s,n,o,l,!0))}function fr(e,t,s,n,o){return dr(ot(e,t,s,n,o,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Me(e)||te(e)?{i:Ve,r:e,k:t,f:!!s}:e:null);function r(e,t=null,s=null,n=0,o=null,l=e===ne?0:1,a=!1,c=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Fo,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ve};return c?($n(u,s),l&128&&e.normalize(u)):s&&(u.shapeFlag|=$e(s)?8:16),is>0&&!a&&Fe&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&Fe.push(u),u}const ot=oi;function oi(e,t=null,s=null,n=0,o=null,l=!1){if((!e||e===Jo)&&(e=kt),pr(e)){const c=Vt(e,t,!0);return s&&$n(c,s),is>0&&!l&&Fe&&(c.shapeFlag&6?Fe[Fe.indexOf(e)]=c:Fe.push(c)),c.patchFlag=-2,c}if(xi(e)&&(e=e.__vccOpts),t){t=ri(t);let{class:c,style:u}=t;c&&!$e(c)&&(t.class=G(c)),fe(u)&&(yn(u)&&!Q(u)&&(u=Ee({},u)),t.style=Lt(u))}const a=$e(e)?1:ur(e)?128:hl(e)?64:fe(e)?4:te(e)?2:0;return r(e,t,s,n,o,a,l,!0)}function ri(e){return e?yn(e)||tr(e)?Ee({},e):e:null}function Vt(e,t,s=!1,n=!1){const{props:o,ref:l,patchFlag:a,children:c,transition:u}=e,h=t?li(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&mr(h),ref:t&&t.ref?s&&l?Q(l)?l.concat(bs(t)):[l,bs(t)]:bs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ne?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&_n(d,u.clone(d)),d}function we(e=" ",t=0){return ot(Ls,null,e,t)}function et(e,t){const s=ot(ys,null,e);return s.staticCount=t,s}function W(e="",t=!1){return t?(x(),fr(kt,null,e)):ot(kt,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot(kt):Q(e)?ot(ne,null,e.slice()):pr(e)?ft(e):ot(Ls,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function $n(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Q(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),$n(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!tr(t)?t._ctx=Ve:o===3&&Ve&&(Ve.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else te(t)?(t={default:t,_ctx:Ve},s=32):(t=String(t),n&64?(s=16,t=[we(t)]):s=8);e.children=t,e.shapeFlag|=s}function li(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=G([t.class,n.class]));else if(o==="style")t.style=Lt([t.style,n.style]);else if(As(o)){const l=t[o],a=n[o];a&&l!==a&&!(Q(l)&&l.includes(a))?t[o]=l?[].concat(l,a):a:a==null&&l==null&&!Es(o)&&(t[o]=a)}else o!==""&&(t[o]=n[o])}return t}function Ye(e,t,s,n=null){lt(e,t,7,[s,n])}const ii=Yo();let ai=0;function ci(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||ii,l={uid:ai++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ir(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,o),emitsOptions:Zo(n,o),emit:null,emitted:null,propsDefaults:he,inheritAttrs:n.inheritAttrs,ctx:he,data:he,props:he,attrs:he,slots:he,refs:he,setupState:he,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=Vl.bind(null,l),e.ce&&e.ce(l),l}let Pe=null;const ui=()=>Pe||Ve;let Ts,rn;{const e=Os(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),l=>{o.length>1?o.forEach(a=>a(l)):o[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Pe=s),rn=t("__VUE_SSR_SETTERS__",s=>as=s)}const fs=e=>{const t=Pe;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Pe&&Pe.scope.off(),Ts(null)};function hr(e){return e.vnode.shapeFlag&4}let as=!1;function di(e,t=!1,s=!1){t&&rn(t);const{props:n,children:o}=e.vnode,l=hr(e);zl(e,n,l,t),Yl(e,o,s||t);const a=l?fi(e,t):void 0;return t&&rn(!1),a}function fi(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pl);const{setup:n}=s;if(n){xt();const o=e.setupContext=n.length>1?mi(e):null,l=fs(e),a=ds(n,e,0,[e.props,o]),c=mo(a);if(gt(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(u=>{qn(e,u)}).catch(u=>{Rs(u,e,0)});e.asyncDep=a}else qn(e,a)}else xr(e)}function qn(e,t,s){te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fe(t)&&(e.setupState=Ro(t)),xr(e)}function xr(e,t,s){const n=e.type;e.render||(e.render=n.render||nt);{const o=fs(e);xt();try{Ml(e)}finally{gt(),o()}}}const pi={get(e,t){return Ie(e,"get",""),e[t]}};function mi(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pi),slots:e.slots,emit:e.emit,expose:t}}function Us(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(Zr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ss)return ss[s](e)},has(t,s){return s in t||s in ss}})):e.proxy}function hi(e,t=!0){return te(e)?e.displayName||e.name:e.name||t&&e.__name}function xi(e){return te(e)&&"__vccOpts"in e}const Re=(e,t)=>nl(e,t,as),gi="3.5.31";/**
61
61
  * @vue/runtime-dom v3.5.31
62
62
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
63
63
  * @license MIT
64
- **/let ln;const Gn=typeof window<"u"&&window.trustedTypes;if(Gn)try{ln=Gn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=ln?e=>ln.createHTML(e):e=>e,vi="http://www.w3.org/2000/svg",yi="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,Yn=ut&&ut.createElement("template"),bi={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?ut.createElementNS(vi,e):t==="mathml"?ut.createElementNS(yi,e):s?ut.createElement(e,{is:s}):ut.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>ut.createTextNode(e),createComment:e=>ut.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ut.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,l){const a=s?s.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===l||!(o=o.nextSibling)););else{Yn.innerHTML=gr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(n==="svg"||n==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_i=Symbol("_vtc");function wi(e,t,s){const n=e[_i];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ki=Symbol("_vsh"),Si=Symbol(""),Ci=/(?:^|;)\s*display\s*:/;function $i(e,t,s){const n=e.style,o=Ce(s);let l=!1;if(s&&!o){if(t)if(Ce(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(n,c,"")}else for(const a in t)s[a]==null&&_s(n,a,"");for(const a in s)a==="display"&&(l=!0),_s(n,a,s[a])}else if(o){if(t!==s){const a=n[Si];a&&(s+=";"+a),n.cssText=s,l=Ci.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?n.display:"",e[ki]&&(n.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(Z(s))s.forEach(n=>_s(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ti(e,t);Qn.test(s)?e.setProperty(St(n),s.replace(Qn,""),"important"):e[n]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ti(e,t){const s=qs[t];if(s)return s;let n=Re(t);if(n!=="filter"&&n in e)return qs[t]=n;n=Ps(n);for(let o=0;o<Xn.length;o++){const l=Xn[o]+n;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,n,o,l=Er(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!vo(s)?e.removeAttribute(t):e.setAttribute(t,l?"":ot(s)?String(s):s)}function so(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(c!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=vo(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(o||t)}function wt(e,t,s,n){e.addEventListener(t,s,n)}function Ei(e,t,s,n){e.removeEventListener(t,s,n)}const no=Symbol("_vei");function Ai(e,t,s,n,o=null){const l=e[no]||(e[no]={}),a=l[t];if(n&&a)a.value=n;else{const[c,u]=Ii(t);if(n){const x=l[t]=Oi(n,o);wt(e,c,x,u)}else a&&(Ei(e,c,a,u),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Ii(e){let t;if(oo.test(e)){t={};let n;for(;n=e.match(oo);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Pi=Promise.resolve(),Mi=()=>Gs||(Pi.then(()=>Gs=0),Gs=Date.now());function Oi(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;rt(Di(n,s.value),t,5,[n])};return s.value=e,s.attached=Mi(),s}function Di(e,t){if(Z(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ri=(e,t,s,n,o,l)=>{const a=o==="svg";t==="class"?wi(e,n,a):t==="style"?$i(e,s,n):Es(t)?As(t)||Ai(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ji(e,t,n,a))?(so(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,n,a,l,t!=="value")):e._isVueCE&&(Ni(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ce(n)))?so(e,Re(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),to(e,t,n,a))};function ji(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&X(s));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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ro(t)&&Ce(s)?!1:t in e}function Ni(e,t){const s=e._def.props;if(!s)return!1;const n=Re(t);return Array.isArray(s)?s.some(o=>Re(o)===n):Object.keys(s).some(o=>Re(o)===n)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Z(t)?s=>gs(t,s):t};function Li(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Ms(e)),e}const re={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[mt]=Ft(o);const l=n||o.props&&o.props.type==="number";wt(e,t?"change":"input",a=>{a.target.composing||e[mt](io(e.value,s,l))}),(s||l)&&wt(e,"change",()=>{e.value=io(e.value,s,l)}),t||(wt(e,"compositionstart",Li),wt(e,"compositionend",lo),wt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:l}},a){if(e[mt]=Ft(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,u=t??"";if(c===u)return;const x=e.getRootNode();(x instanceof Document||x instanceof ShadowRoot)&&x.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===u)||(e.value=u)}},ao={deep:!0,created(e,t,s){e[mt]=Ft(s),wt(e,"change",()=>{const n=e._modelValue,o=cs(e),l=e.checked,a=e[mt];if(Z(n)){const c=dn(n,o),u=c!==-1;if(l&&!u)a(n.concat(o));else if(!l&&u){const x=[...n];x.splice(c,1),a(x)}}else if(Bt(n)){const c=new Set(n);l?c.add(o):c.delete(o),a(c)}else a(vr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Ft(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(Z(t))o=dn(t,n.props.value)>-1;else if(Bt(t))o=t.has(n.props.value);else{if(t===s)return;o=Kt(t,vr(e,!0))}e.checked!==o&&(e.checked=o)}const Ht={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Bt(t);wt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Ms(cs(a)):cs(a));e[mt](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,No(()=>{e._assigning=!1})}),e[mt]=Ft(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Ft(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=Z(t);if(!(s&&!n&&!Bt(t))){for(let o=0,l=e.options.length;o<l;o++){const a=e.options[o],c=cs(a);if(s)if(n){const u=typeof c;u==="string"||u==="number"?a.selected=t.some(x=>String(x)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Kt(cs(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function vr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ui={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ze=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const l=St(o.key);if(t.some(a=>a===l||Ui[a]===l))return e(o)}))},Vi=Ae({patchProp:Ri},bi);let fo;function Fi(){return fo||(fo=Ql(Vi))}const Hi=((...e)=>{const t=Fi().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Ki(n);if(!o)return;const l=t._component;!X(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=s(o,!1,Bi(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function Bi(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ki(e){return Ce(e)?document.querySelector(e):e}let $n="";function qt(e){$n=e}function _e(){return $n}async function ye(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${$n}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wi={class:"animate-fade-in"},zi={key:0,class:"text-center py-12 text-textSecondary"},Ji={key:1,class:"text-center text-textSecondary py-12"},qi={key:2,class:"space-y-3"},Gi={class:"flex items-center justify-between"},Yi={class:"flex items-center gap-3"},Zi={class:"font-medium"},Qi={class:"text-accentLight"},Xi={class:"text-textSecondary text-xs"},ea={key:2,class:"text-muted italic"},ta={class:"text-xs text-textSecondary font-mono"},sa={class:"text-right"},na={class:"flex items-center gap-2 justify-end"},oa={class:"text-xs text-textSecondary"},ra=vt({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=E([]),n=E(!0);async function o(){n.value=!0;try{const x=await ye("/api/status");s.value=(x.sessions||[]).slice().sort((d,m)=>d.status==="active"&&m.status!=="active"?-1:d.status!=="active"&&m.status==="active"?1:m.lastActivity-d.lastActivity)}finally{n.value=!1}}const l=Fe(()=>{var d;return(((d=t.status)==null?void 0:d.sessions)??s.value).slice().sort((m,y)=>m.status==="active"&&y.status!=="active"?-1:m.status!=="active"&&y.status==="active"?1:y.lastActivity-m.lastActivity)});function a(x){const d=Math.floor((Date.now()-x.lastActivity)/6e4);return x.status==="disconnected"?{label:`Disconnected${d>0?` — ${d}m ago`:""}`,color:"text-muted"}:d<5?{label:"Active",color:"text-success"}:d<30?{label:`Idle ${d}m`,color:"text-warn"}:{label:`Dormant ${d}m`,color:"text-danger"}}function c(x){if(!x.lastWaitCallAt)return"";const d=Math.floor((Date.now()-x.lastWaitCallAt)/6e4);return d<5?`Polling — ${d===0?"just now":d+"m ago"}`:`Last poll — ${d}m ago`}function u(x){return x.lastWaitCallAt?Math.floor((Date.now()-x.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return lt(o),(x,d)=>(h(),g("div",Wi,[n.value&&l.value.length===0?(h(),g("div",zi,"Loading sessions...")):l.value.length===0?(h(),g("div",Ji,"No sessions")):(h(),g("div",qi,[(h(!0),g(te,null,be(l.value,m=>(h(),g("div",{key:m.mcpSessionId,class:J(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[r("div",Gi,[r("div",Yi,[r("span",{class:J(["w-2.5 h-2.5 rounded-full",m.status==="disconnected"?"bg-muted":Math.floor((Date.now()-m.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-m.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),r("div",null,[r("div",Zi,[m.topicName?(h(),g(te,{key:0},[r("span",Qi,_(m.topicName),1),r("span",Xi," (thread "+_(m.threadId)+")",1)],64)):m.threadId!=null?(h(),g(te,{key:1},[we("Thread "+_(m.threadId),1)],64)):(h(),g("span",ea,"Awaiting start_session…"))]),r("div",ta,_(m.mcpSessionId.slice(0,12))+"...",1)])]),r("div",sa,[r("div",na,[r("span",{class:J(["text-sm font-medium",a(m).color])},_(a(m).label),3),c(m)?(h(),g("span",{key:0,class:J(["text-xs ml-2",u(m)])},_(c(m)),3)):q("",!0)]),r("div",oa,_(m.transportType),1)])])],2))),128))]))]))}}),la={class:"animate-fade-in"},ia={class:"flex flex-wrap items-center gap-3 mb-4"},aa={key:0,class:"text-center py-12 text-textSecondary"},ca={key:1,class:"text-center py-12 text-textSecondary"},ua={key:2,class:"space-y-2"},da={class:"flex items-start justify-between gap-3"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-1"},ma={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xa={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},ha={class:"text-xs text-textSecondary"},ga={class:"text-sm text-textPrimary leading-relaxed"},va={class:"flex flex-wrap gap-1.5 mt-2"},ya={class:"text-right shrink-0"},ba={class:"text-sm font-mono text-textSecondary"},_a={class:"text-xs text-muted"},wa={class:"text-xs text-muted"},ka=vt({__name:"MemoryNotesTab",setup(e){const t=E([]),s=E(!1),n=E(""),o=E("created_at"),l=E("");let a=null;async function c(){s.value=!0;try{const d=l.value.trim();let m;if(d)m=await ye(`/api/search?q=${encodeURIComponent(d)}&limit=50`);else{const y=new URLSearchParams({limit:"50",sort:o.value});n.value&&y.set("type",n.value),m=await ye(`/api/notes?${y}`)}t.value=m}finally{s.value=!1}}function u(){a&&clearTimeout(a),a=setTimeout(c,300)}function x(d){if(!d)return"never";const m=Date.now()-new Date(d).getTime(),y=Math.floor(m/6e4);if(y<1)return"just now";if(y<60)return`${y}m ago`;const T=Math.floor(y/60);return T<24?`${T}h ago`:`${Math.floor(T/24)}d ago`}return lt(c),(d,m)=>(h(),g("div",la,[r("div",ia,[ee(r("input",{"onUpdate:modelValue":m[0]||(m[0]=y=>l.value=y),onInput:u,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[re,l.value]]),ee(r("select",{"onUpdate:modelValue":m[1]||(m[1]=y=>n.value=y),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[Xe('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[Ht,n.value]]),ee(r("select",{"onUpdate:modelValue":m[2]||(m[2]=y=>o.value=y),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[r("option",{value:"created_at"},"Newest",-1),r("option",{value:"confidence"},"Confidence",-1),r("option",{value:"access_count"},"Most accessed",-1)])],544),[[Ht,o.value]])]),s.value?(h(),g("div",aa,"Loading notes...")):t.value.length===0?(h(),g("div",ca,"No notes found")):(h(),g("div",ua,[(h(!0),g(te,null,be(t.value,y=>(h(),g("div",{key:y.noteId,class:J(["glass rounded-xl p-4 animate-fade-in",`priority-${y.priority||0}`])},[r("div",da,[r("div",fa,[r("div",pa,[r("span",{class:J(["type-badge",`type-${y.type}`])},_(y.type),3),y.priority>=2?(h(),g("span",ma,"HIGH IMPORTANCE")):y.priority===1?(h(),g("span",xa,"NOTABLE")):q("",!0),r("span",ha,_(y.noteId),1)]),r("p",ga,_(y.content),1),r("div",va,[(h(!0),g(te,null,be(y.keywords||[],T=>(h(),g("span",{key:T,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(T),1))),128))])]),r("div",ya,[r("div",ba,_(((Number(y.confidence)||0)*100).toFixed(0))+"%",1),r("div",_a,_(x(y.createdAt)),1),r("div",wa,_(y.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Sa={class:"animate-fade-in space-y-6"},Ca={class:"glass rounded-xl p-4"},$a={class:"flex flex-wrap items-center gap-4 mb-4"},Ta={key:0,class:"text-sm text-success"},Ea={class:"flex flex-wrap items-center gap-3 mb-4"},Aa={key:0,class:"text-sm text-success"},Ia={class:"glass rounded-xl p-6"},Pa={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ma={class:"flex items-center gap-2"},Oa={key:0,class:"text-sm text-success"},Da={key:0,class:"mb-3"},Ra={class:"mt-4"},ja=["innerHTML"],Na={class:"glass rounded-xl p-6"},La={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ua={class:"flex items-center gap-2"},Va={key:0,class:"text-sm text-success"},Fa={class:"flex gap-2 mb-4"},Ha=["onClick"],Ba={key:0,class:"mb-3"},Ka=["value","placeholder"],Wa={class:"glass rounded-xl p-6"},za={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ja={class:"flex items-center gap-2"},qa={key:0,class:"text-sm text-success"},Ga={class:"mb-4 flex flex-wrap items-center gap-3"},Ya={class:"flex items-center gap-2"},Za={class:"font-mono text-sm text-textPrimary"},Qa={key:0,class:"mb-3"},Xa={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=vt({__name:"TemplatesTab",setup(e){function t(F){return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=E("copilot"),n=E(""),o=E(50),l=E(""),a=E(""),c=E(!0),u=E(""),x=E(!1),d=E({}),m=E("copilot"),y=E(""),T=E(""),B=E(!0),C=E(""),w=E(!1),k=E([]),P=E("");async function H(){await Promise.all([V(),se(),ne(),W()])}async function V(){try{const F=await ye("/api/settings/agent-type");s.value=F.agentType||"copilot"}catch{}}async function se(){try{const F=await ye("/api/settings/bootstrap-message-count");o.value=F.count??50}catch{}}async function ne(){try{const F=await ye("/api/templates");if(F.templates&&F.templates.length>0){const M=F.templates[0];a.value=M.content||"",c.value=M.isDefault??!0}F.agentReminders&&(d.value=F.agentReminders)}catch{}}async function W(){try{const[F,M,$e]=await Promise.all([ye("/api/templates/drive"),ye("/api/templates/drive-presets"),ye("/api/settings/dmn-activation-hours")]);k.value=M.presets||[],P.value=String($e.value??"not set"),F.custom?(T.value=F.custom,B.value=!1):(T.value=F.default||"",B.value=!0)}catch{}}async function N(){try{await ye("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await ye("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await ne()}catch(F){n.value="Error: "+F.message}}async function G(){try{await ye("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:o.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(F){l.value="Error: "+F.message}}async function ue(){try{const F=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!F.ok)throw new Error(F.statusText);c.value=!1,u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3)}catch(F){u.value="Error: "+F.message}}async function U(){if(confirm("Reset to default template? Your customizations will be lost."))try{const F=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!F.ok)throw new Error(F.statusText);await ne(),u.value="Reset to default ✓",setTimeout(()=>{u.value=""},3e3)}catch(F){u.value="Error: "+F.message}}async function R(){var $e;const F=m.value,M=(($e=d.value[F])==null?void 0:$e.content)??"";try{const ke=await fetch(`/api/templates/reminders-${F}`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:M})});if(!ke.ok)throw new Error(ke.statusText);d.value[F]={content:M,isDefault:!1},y.value=`Saved ${F} ✓`,setTimeout(()=>{y.value=""},3e3)}catch(ke){y.value="Error: "+ke.message}}async function K(){const F=m.value;if(confirm(`Reset ${F} agent reminder? The custom template will be removed.`))try{const M=await fetch(`/api/templates/reminders-${F}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!M.ok)throw new Error(M.statusText);await ne(),y.value=`Reset ${F} ✓`,setTimeout(()=>{y.value=""},3e3)}catch(M){y.value="Error: "+M.message}}async function oe(){const F=T.value;if(!F.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const M=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:F})});if(!M.ok)throw new Error(M.statusText);B.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(M){C.value="Error: "+M.message}}async function ve(){if(confirm("Reset drive template? The custom template will be removed."))try{const F=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!F.ok)throw new Error(F.statusText);await W(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(F){C.value="Error: "+F.message}}function Se(F){T.value=F.content,B.value=!1}const pe=Fe(()=>t(a.value)),le=Fe(()=>T.value?t(T.value):'<span style="color:#6b7280">(no template loaded)</span>');return lt(H),(F,M)=>{var $e,ke;return h(),g("div",Sa,[r("div",Ca,[r("div",$a,[M[8]||(M[8]=r("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),ee(r("select",{"onUpdate:modelValue":M[0]||(M[0]=de=>s.value=de),onChange:N,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...M[7]||(M[7]=[Xe('<option value="copilot">Copilot</option><option value="copilot_claude">Copilot (Claude)</option><option value="copilot_codex">Copilot (Codex)</option><option value="claude">Claude</option><option value="cursor">Cursor</option><option value="codex">Codex</option><option value="openai_codex">OpenAI Codex</option>',7)])],544),[[Ht,s.value]]),n.value?(h(),g("span",Ta,_(n.value),1)):q("",!0),M[9]||(M[9]=r("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),r("div",Ea,[M[10]||(M[10]=r("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),ee(r("input",{"onUpdate:modelValue":M[1]||(M[1]=de=>o.value=de),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[re,o.value,void 0,{number:!0}]]),r("button",{onClick:G,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(h(),g("span",Aa,_(l.value),1)):q("",!0),M[11]||(M[11]=r("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),r("div",Ia,[r("div",Pa,[M[12]||(M[12]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Reminders Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),r("div",Ma,[u.value?(h(),g("span",Oa,_(u.value),1)):q("",!0),r("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:ue,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(h(),g("div",Da,[...M[13]||(M[13]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):q("",!0),ee(r("textarea",{"onUpdate:modelValue":M[2]||(M[2]=de=>a.value=de),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[re,a.value]]),r("div",Ra,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:M[3]||(M[3]=de=>x.value=!x.value)},[(h(),g("svg",{class:J(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...M[14]||(M[14]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),M[15]||(M[15]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),x.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:pe.value},null,8,ja)):q("",!0)]),M[16]||(M[16]=Xe('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),r("div",Na,[r("div",La,[M[17]||(M[17]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),r("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),r("div",Ua,[y.value?(h(),g("span",Va,_(y.value),1)):q("",!0),r("button",{onClick:K,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),r("button",{onClick:R,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Fa,[(h(),g(te,null,be(["copilot","claude","cursor","codex"],de=>r("button",{key:de,onClick:We=>m.value=de,class:J(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===de?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},_(de.charAt(0).toUpperCase()+de.slice(1)),11,Ha)),64))]),(($e=d.value[m.value])==null?void 0:$e.isDefault)!==!1?(h(),g("div",Ba,[...M[18]||(M[18]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):q("",!0),r("textarea",{value:((ke=d.value[m.value])==null?void 0:ke.content)??"",onInput:M[4]||(M[4]=de=>{const We=de.target;d.value[m.value]={content:We.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${m.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ka)]),r("div",Wa,[r("div",za,[M[19]||(M[19]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),r("div",Ja,[C.value?(h(),g("span",qa,_(C.value),1)):q("",!0),r("button",{onClick:ve,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:oe,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Ga,[M[21]||(M[21]=r("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),r("div",Ya,[r("span",Za,_(P.value),1),M[20]||(M[20]=r("span",{class:"text-sm text-textSecondary"},"hours",-1))]),M[22]||(M[22]=r("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),B.value?(h(),g("div",Qa,[...M[23]||(M[23]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):q("",!0),r("div",Xa,[M[24]||(M[24]=r("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(h(!0),g(te,null,be(k.value,de=>(h(),g("button",{key:de.key,onClick:We=>Se(de),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},_(de.label),9,ec))),128))]),ee(r("textarea",{"onUpdate:modelValue":M[5]||(M[5]=de=>T.value=de),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[re,T.value]]),r("div",tc,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:M[6]||(M[6]=de=>w.value=!w.value)},[(h(),g("svg",{class:J(["w-4 h-4 text-textSecondary transition-transform",w.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...M[25]||(M[25]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),M[26]||(M[26]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),w.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:le.value},null,8,sc)):q("",!0)]),M[27]||(M[27]=Xe('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),oc={class:"animate-fade-in"},rc={class:"glass rounded-xl p-6 mb-6"},lc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ic={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ac={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},cc={class:"flex items-center gap-4 mb-3"},uc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},dc={class:"flex items-center gap-2"},fc={key:0,class:"text-sm text-warn"},pc={key:1,class:"text-center py-8 text-textSecondary text-sm"},mc={key:2,class:"text-center text-textSecondary py-12"},xc={key:3,class:"space-y-2"},hc=["onClick"],gc={class:"flex items-start justify-between gap-3"},vc={class:"flex-1 min-w-0"},yc={class:"flex items-center gap-2 mb-1"},bc={class:"font-medium text-sm"},_c={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},wc={class:"flex flex-wrap gap-1.5 mt-1"},kc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},Cc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},$c={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},Ec={class:"flex items-center gap-2"},Ac={key:0,class:"text-sm text-success"},Ic={key:1,class:"text-sm text-warn"},Pc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Mc=["value"],Oc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=vt({__name:"SkillsTab",setup(e){const t=E([]),s=E(!0),n=E(null),o=E(""),l=E(""),a=E(!1),c=E(""),u=E(""),x=E(!1),d=E(""),m=E(""),y=E(!1),T=E("");async function B(){s.value=!0;try{const W=await ye("/api/skills");t.value=W.skills||[]}finally{s.value=!1}}function C(W){return W?W.includes(".remote-copilot-mcp")&&W.includes("skills")?"user":W.endsWith(".default.md")?"default":W.endsWith(".skill.md")?"project":"unknown":"unknown"}function w(W){const N={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return N[W]||N.unknown}function k(W){n.value=W,o.value=W.content,l.value=(W.triggers||[]).join(", "),a.value=!!W.replacesOrchestrator,x.value=!1}function P(){n.value=null,u.value=""}function H(W,N,G,ue){let U=`---
65
- name: ${W}
64
+ **/let ln;const Gn=typeof window<"u"&&window.trustedTypes;if(Gn)try{ln=Gn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=ln?e=>ln.createHTML(e):e=>e,vi="http://www.w3.org/2000/svg",yi="http://www.w3.org/1998/Math/MathML",dt=typeof document<"u"?document:null,Yn=dt&&dt.createElement("template"),bi={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?dt.createElementNS(vi,e):t==="mathml"?dt.createElementNS(yi,e):s?dt.createElement(e,{is:s}):dt.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>dt.createTextNode(e),createComment:e=>dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,l){const a=s?s.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===l||!(o=o.nextSibling)););else{Yn.innerHTML=gr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(n==="svg"||n==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_i=Symbol("_vtc");function wi(e,t,s){const n=e[_i];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ki=Symbol("_vsh"),Si=Symbol(""),$i=/(?:^|;)\s*display\s*:/;function Ci(e,t,s){const n=e.style,o=$e(s);let l=!1;if(s&&!o){if(t)if($e(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(n,c,"")}else for(const a in t)s[a]==null&&_s(n,a,"");for(const a in s)a==="display"&&(l=!0),_s(n,a,s[a])}else if(o){if(t!==s){const a=n[Si];a&&(s+=";"+a),n.cssText=s,l=$i.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?n.display:"",e[ki]&&(n.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(Q(s))s.forEach(n=>_s(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ti(e,t);Qn.test(s)?e.setProperty(St(n),s.replace(Qn,""),"important"):e[n]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ti(e,t){const s=qs[t];if(s)return s;let n=je(t);if(n!=="filter"&&n in e)return qs[t]=n;n=Ps(n);for(let o=0;o<Xn.length;o++){const l=Xn[o]+n;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,n,o,l=Ar(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!vo(s)?e.removeAttribute(t):e.setAttribute(t,l?"":rt(s)?String(s):s)}function so(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(c!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=vo(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(o||t)}function wt(e,t,s,n){e.addEventListener(t,s,n)}function Ai(e,t,s,n){e.removeEventListener(t,s,n)}const no=Symbol("_vei");function Ei(e,t,s,n,o=null){const l=e[no]||(e[no]={}),a=l[t];if(n&&a)a.value=n;else{const[c,u]=Ii(t);if(n){const h=l[t]=Oi(n,o);wt(e,c,h,u)}else a&&(Ai(e,c,a,u),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Ii(e){let t;if(oo.test(e)){t={};let n;for(;n=e.match(oo);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Pi=Promise.resolve(),Mi=()=>Gs||(Pi.then(()=>Gs=0),Gs=Date.now());function Oi(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;lt(Di(n,s.value),t,5,[n])};return s.value=e,s.attached=Mi(),s}function Di(e,t){if(Q(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ri=(e,t,s,n,o,l)=>{const a=o==="svg";t==="class"?wi(e,n,a):t==="style"?Ci(e,s,n):As(t)?Es(t)||Ei(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ji(e,t,n,a))?(so(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,n,a,l,t!=="value")):e._isVueCE&&(Ni(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(n)))?so(e,je(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),to(e,t,n,a))};function ji(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&te(s));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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ro(t)&&$e(s)?!1:t in e}function Ni(e,t){const s=e._def.props;if(!s)return!1;const n=je(t);return Array.isArray(s)?s.some(o=>je(o)===n):Object.keys(s).some(o=>je(o)===n)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?s=>gs(t,s):t};function Li(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ht=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Ms(e)),e}const re={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[ht]=Ft(o);const l=n||o.props&&o.props.type==="number";wt(e,t?"change":"input",a=>{a.target.composing||e[ht](io(e.value,s,l))}),(s||l)&&wt(e,"change",()=>{e.value=io(e.value,s,l)}),t||(wt(e,"compositionstart",Li),wt(e,"compositionend",lo),wt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:l}},a){if(e[ht]=Ft(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,u=t??"";if(c===u)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===u)||(e.value=u)}},ao={deep:!0,created(e,t,s){e[ht]=Ft(s),wt(e,"change",()=>{const n=e._modelValue,o=cs(e),l=e.checked,a=e[ht];if(Q(n)){const c=dn(n,o),u=c!==-1;if(l&&!u)a(n.concat(o));else if(!l&&u){const h=[...n];h.splice(c,1),a(h)}}else if(Ht(n)){const c=new Set(n);l?c.add(o):c.delete(o),a(c)}else a(vr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[ht]=Ft(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(Q(t))o=dn(t,n.props.value)>-1;else if(Ht(t))o=t.has(n.props.value);else{if(t===s)return;o=Kt(t,vr(e,!0))}e.checked!==o&&(e.checked=o)}const Bt={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Ht(t);wt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Ms(cs(a)):cs(a));e[ht](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,No(()=>{e._assigning=!1})}),e[ht]=Ft(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[ht]=Ft(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=Q(t);if(!(s&&!n&&!Ht(t))){for(let o=0,l=e.options.length;o<l;o++){const a=e.options[o],c=cs(a);if(s)if(n){const u=typeof c;u==="string"||u==="number"?a.selected=t.some(h=>String(h)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Kt(cs(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function vr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ui={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Qe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const l=St(o.key);if(t.some(a=>a===l||Ui[a]===l))return e(o)}))},Vi=Ee({patchProp:Ri},bi);let fo;function Fi(){return fo||(fo=Ql(Vi))}const Bi=((...e)=>{const t=Fi().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Ki(n);if(!o)return;const l=t._component;!te(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=s(o,!1,Hi(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function Hi(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ki(e){return $e(e)?document.querySelector(e):e}let Cn="";function qt(e){Cn=e}function ye(){return Cn}async function be(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${Cn}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wi={class:"animate-fade-in"},zi={key:0,class:"text-center py-12 text-textSecondary"},Ji={key:1,class:"text-center text-textSecondary py-12"},qi={key:2,class:"space-y-3"},Gi={class:"flex items-center justify-between"},Yi={class:"flex items-center gap-3"},Zi={class:"font-medium"},Qi={class:"text-accentLight"},Xi={class:"text-textSecondary text-xs"},ea={key:2,class:"text-muted italic"},ta={class:"text-xs text-textSecondary font-mono"},sa={class:"text-right"},na={class:"flex items-center gap-2 justify-end"},oa={class:"text-xs text-textSecondary"},ra=it({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=$([]),n=$(!0);async function o(){n.value=!0;try{const h=await be("/api/status");s.value=(h.sessions||[]).slice().sort((d,m)=>d.status==="active"&&m.status!=="active"?-1:d.status!=="active"&&m.status==="active"?1:m.lastActivity-d.lastActivity)}finally{n.value=!1}}const l=Re(()=>{var d;return(((d=t.status)==null?void 0:d.sessions)??s.value).slice().sort((m,b)=>m.status==="active"&&b.status!=="active"?-1:m.status!=="active"&&b.status==="active"?1:b.lastActivity-m.lastActivity)});function a(h){const d=Math.floor((Date.now()-h.lastActivity)/6e4);return h.status==="disconnected"?{label:`Disconnected${d>0?` — ${d}m ago`:""}`,color:"text-muted"}:d<5?{label:"Active",color:"text-success"}:d<30?{label:`Idle ${d}m`,color:"text-warn"}:{label:`Dormant ${d}m`,color:"text-danger"}}function c(h){if(!h.lastWaitCallAt)return"";const d=Math.floor((Date.now()-h.lastWaitCallAt)/6e4);return d<5?`Polling — ${d===0?"just now":d+"m ago"}`:`Last poll — ${d}m ago`}function u(h){return h.lastWaitCallAt?Math.floor((Date.now()-h.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return We(o),(h,d)=>(x(),g("div",Wi,[n.value&&l.value.length===0?(x(),g("div",zi,"Loading sessions...")):l.value.length===0?(x(),g("div",Ji,"No sessions")):(x(),g("div",qi,[(x(!0),g(ne,null,ve(l.value,m=>(x(),g("div",{key:m.mcpSessionId,class:G(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[r("div",Gi,[r("div",Yi,[r("span",{class:G(["w-2.5 h-2.5 rounded-full",m.status==="disconnected"?"bg-muted":Math.floor((Date.now()-m.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-m.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),r("div",null,[r("div",Zi,[m.topicName?(x(),g(ne,{key:0},[r("span",Qi,v(m.topicName),1),r("span",Xi," (thread "+v(m.threadId)+")",1)],64)):m.threadId!=null?(x(),g(ne,{key:1},[we("Thread "+v(m.threadId),1)],64)):(x(),g("span",ea,"Awaiting start_session…"))]),r("div",ta,v(m.mcpSessionId.slice(0,12))+"...",1)])]),r("div",sa,[r("div",na,[r("span",{class:G(["text-sm font-medium",a(m).color])},v(a(m).label),3),c(m)?(x(),g("span",{key:0,class:G(["text-xs ml-2",u(m)])},v(c(m)),3)):W("",!0)]),r("div",oa,v(m.transportType),1)])])],2))),128))]))]))}}),la={class:"animate-fade-in"},ia={class:"flex flex-wrap items-center gap-3 mb-4"},aa={key:0,class:"text-center py-12 text-textSecondary"},ca={key:1,class:"text-center py-12 text-textSecondary"},ua={key:2,class:"space-y-2"},da={class:"flex items-start justify-between gap-3"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-1"},ma={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},ha={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},xa={class:"text-xs text-textSecondary"},ga={class:"text-sm text-textPrimary leading-relaxed"},va={class:"flex flex-wrap gap-1.5 mt-2"},ya={class:"text-right shrink-0"},ba={class:"text-sm font-mono text-textSecondary"},_a={class:"text-xs text-muted"},wa={class:"text-xs text-muted"},ka=it({__name:"MemoryNotesTab",setup(e){const t=$([]),s=$(!1),n=$(""),o=$("created_at"),l=$("");let a=null;async function c(){s.value=!0;try{const d=l.value.trim();let m;if(d)m=await be(`/api/search?q=${encodeURIComponent(d)}&limit=50`);else{const b=new URLSearchParams({limit:"50",sort:o.value});n.value&&b.set("type",n.value),m=await be(`/api/notes?${b}`)}t.value=m}finally{s.value=!1}}function u(){a&&clearTimeout(a),a=setTimeout(c,300)}function h(d){if(!d)return"never";const m=Date.now()-new Date(d).getTime(),b=Math.floor(m/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;const A=Math.floor(b/60);return A<24?`${A}h ago`:`${Math.floor(A/24)}d ago`}return We(c),(d,m)=>(x(),g("div",la,[r("div",ia,[se(r("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>l.value=b),onInput:u,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[re,l.value]]),se(r("select",{"onUpdate:modelValue":m[1]||(m[1]=b=>n.value=b),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[et('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[Bt,n.value]]),se(r("select",{"onUpdate:modelValue":m[2]||(m[2]=b=>o.value=b),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[r("option",{value:"created_at"},"Newest",-1),r("option",{value:"confidence"},"Confidence",-1),r("option",{value:"access_count"},"Most accessed",-1)])],544),[[Bt,o.value]])]),s.value?(x(),g("div",aa,"Loading notes...")):t.value.length===0?(x(),g("div",ca,"No notes found")):(x(),g("div",ua,[(x(!0),g(ne,null,ve(t.value,b=>(x(),g("div",{key:b.noteId,class:G(["glass rounded-xl p-4 animate-fade-in",`priority-${b.priority||0}`])},[r("div",da,[r("div",fa,[r("div",pa,[r("span",{class:G(["type-badge",`type-${b.type}`])},v(b.type),3),b.priority>=2?(x(),g("span",ma,"HIGH IMPORTANCE")):b.priority===1?(x(),g("span",ha,"NOTABLE")):W("",!0),r("span",xa,v(b.noteId),1)]),r("p",ga,v(b.content),1),r("div",va,[(x(!0),g(ne,null,ve(b.keywords||[],A=>(x(),g("span",{key:A,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},v(A),1))),128))])]),r("div",ya,[r("div",ba,v(((Number(b.confidence)||0)*100).toFixed(0))+"%",1),r("div",_a,v(h(b.createdAt)),1),r("div",wa,v(b.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Sa={class:"animate-fade-in space-y-6"},$a={class:"glass rounded-xl p-4"},Ca={class:"flex flex-wrap items-center gap-4 mb-4"},Ta={key:0,class:"text-sm text-success"},Aa={class:"flex flex-wrap items-center gap-3 mb-4"},Ea={key:0,class:"text-sm text-success"},Ia={class:"glass rounded-xl p-6"},Pa={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ma={class:"flex items-center gap-2"},Oa={key:0,class:"text-sm text-success"},Da={key:0,class:"mb-3"},Ra={class:"mt-4"},ja=["innerHTML"],Na={class:"glass rounded-xl p-6"},La={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ua={class:"flex items-center gap-2"},Va={key:0,class:"text-sm text-success"},Fa={class:"flex gap-2 mb-4"},Ba=["onClick"],Ha={key:0,class:"mb-3"},Ka=["value","placeholder"],Wa={class:"glass rounded-xl p-6"},za={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ja={class:"flex items-center gap-2"},qa={key:0,class:"text-sm text-success"},Ga={class:"mb-4 flex flex-wrap items-center gap-3"},Ya={class:"flex items-center gap-2"},Za={class:"font-mono text-sm text-textPrimary"},Qa={key:0,class:"mb-3"},Xa={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=it({__name:"TemplatesTab",setup(e){function t(B){return B.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=$("copilot"),n=$(""),o=$(50),l=$(""),a=$(""),c=$(!0),u=$(""),h=$(!1),d=$({}),m=$("copilot"),b=$(""),A=$(""),H=$(!0),C=$(""),w=$(!1),k=$([]),S=$("");async function O(){await Promise.all([P(),Z(),X(),K()])}async function P(){try{const B=await be("/api/settings/agent-type");s.value=B.agentType||"copilot"}catch{}}async function Z(){try{const B=await be("/api/settings/bootstrap-message-count");o.value=B.count??50}catch{}}async function X(){try{const B=await be("/api/templates");if(B.templates&&B.templates.length>0){const D=B.templates[0];a.value=D.content||"",c.value=D.isDefault??!0}B.agentReminders&&(d.value=B.agentReminders)}catch{}}async function K(){try{const[B,D,Ce]=await Promise.all([be("/api/templates/drive"),be("/api/templates/drive-presets"),be("/api/settings/dmn-activation-hours")]);k.value=D.presets||[],S.value=String(Ce.value??"not set"),B.custom?(A.value=B.custom,H.value=!1):(A.value=B.default||"",H.value=!0)}catch{}}async function R(){try{await be("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await be("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await X()}catch(B){n.value="Error: "+B.message}}async function z(){try{await be("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:o.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(B){l.value="Error: "+B.message}}async function ue(){try{const B=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!B.ok)throw new Error(B.statusText);c.value=!1,u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3)}catch(B){u.value="Error: "+B.message}}async function F(){if(confirm("Reset to default template? Your customizations will be lost."))try{const B=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!B.ok)throw new Error(B.statusText);await X(),u.value="Reset to default ✓",setTimeout(()=>{u.value=""},3e3)}catch(B){u.value="Error: "+B.message}}async function L(){var Ce;const B=m.value,D=((Ce=d.value[B])==null?void 0:Ce.content)??"";try{const ke=await fetch(`/api/templates/reminders-${B}`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:D})});if(!ke.ok)throw new Error(ke.statusText);d.value[B]={content:D,isDefault:!1},b.value=`Saved ${B} ✓`,setTimeout(()=>{b.value=""},3e3)}catch(ke){b.value="Error: "+ke.message}}async function J(){const B=m.value;if(confirm(`Reset ${B} agent reminder? The custom template will be removed.`))try{const D=await fetch(`/api/templates/reminders-${B}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!D.ok)throw new Error(D.statusText);await X(),b.value=`Reset ${B} ✓`,setTimeout(()=>{b.value=""},3e3)}catch(D){b.value="Error: "+D.message}}async function oe(){const B=A.value;if(!B.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const D=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!D.ok)throw new Error(D.statusText);H.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(D){C.value="Error: "+D.message}}async function _e(){if(confirm("Reset drive template? The custom template will be removed."))try{const B=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!B.ok)throw new Error(B.statusText);await K(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(B){C.value="Error: "+B.message}}function Se(B){A.value=B.content,H.value=!1}const pe=Re(()=>t(a.value)),le=Re(()=>A.value?t(A.value):'<span style="color:#6b7280">(no template loaded)</span>');return We(O),(B,D)=>{var Ce,ke;return x(),g("div",Sa,[r("div",$a,[r("div",Ca,[D[8]||(D[8]=r("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),se(r("select",{"onUpdate:modelValue":D[0]||(D[0]=de=>s.value=de),onChange:R,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...D[7]||(D[7]=[et('<option value="copilot">Copilot</option><option value="copilot_claude">Copilot (Claude)</option><option value="copilot_codex">Copilot (Codex)</option><option value="claude">Claude</option><option value="cursor">Cursor</option><option value="codex">Codex</option><option value="openai_codex">OpenAI Codex</option>',7)])],544),[[Bt,s.value]]),n.value?(x(),g("span",Ta,v(n.value),1)):W("",!0),D[9]||(D[9]=r("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),r("div",Aa,[D[10]||(D[10]=r("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),se(r("input",{"onUpdate:modelValue":D[1]||(D[1]=de=>o.value=de),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[re,o.value,void 0,{number:!0}]]),r("button",{onClick:z,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(x(),g("span",Ea,v(l.value),1)):W("",!0),D[11]||(D[11]=r("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),r("div",Ia,[r("div",Pa,[D[12]||(D[12]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Reminders Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),r("div",Ma,[u.value?(x(),g("span",Oa,v(u.value),1)):W("",!0),r("button",{onClick:F,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:ue,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(x(),g("div",Da,[...D[13]||(D[13]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):W("",!0),se(r("textarea",{"onUpdate:modelValue":D[2]||(D[2]=de=>a.value=de),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[re,a.value]]),r("div",Ra,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[3]||(D[3]=de=>h.value=!h.value)},[(x(),g("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",h.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[14]||(D[14]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[15]||(D[15]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),h.value?(x(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:pe.value},null,8,ja)):W("",!0)]),D[16]||(D[16]=et('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),r("div",Na,[r("div",La,[D[17]||(D[17]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),r("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),r("div",Ua,[b.value?(x(),g("span",Va,v(b.value),1)):W("",!0),r("button",{onClick:J,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),r("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Fa,[(x(),g(ne,null,ve(["copilot","claude","cursor","codex"],de=>r("button",{key:de,onClick:ze=>m.value=de,class:G(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===de?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},v(de.charAt(0).toUpperCase()+de.slice(1)),11,Ba)),64))]),((Ce=d.value[m.value])==null?void 0:Ce.isDefault)!==!1?(x(),g("div",Ha,[...D[18]||(D[18]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):W("",!0),r("textarea",{value:((ke=d.value[m.value])==null?void 0:ke.content)??"",onInput:D[4]||(D[4]=de=>{const ze=de.target;d.value[m.value]={content:ze.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${m.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ka)]),r("div",Wa,[r("div",za,[D[19]||(D[19]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),r("div",Ja,[C.value?(x(),g("span",qa,v(C.value),1)):W("",!0),r("button",{onClick:_e,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:oe,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Ga,[D[21]||(D[21]=r("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),r("div",Ya,[r("span",Za,v(S.value),1),D[20]||(D[20]=r("span",{class:"text-sm text-textSecondary"},"hours",-1))]),D[22]||(D[22]=r("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),H.value?(x(),g("div",Qa,[...D[23]||(D[23]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):W("",!0),r("div",Xa,[D[24]||(D[24]=r("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(x(!0),g(ne,null,ve(k.value,de=>(x(),g("button",{key:de.key,onClick:ze=>Se(de),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},v(de.label),9,ec))),128))]),se(r("textarea",{"onUpdate:modelValue":D[5]||(D[5]=de=>A.value=de),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[re,A.value]]),r("div",tc,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[6]||(D[6]=de=>w.value=!w.value)},[(x(),g("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",w.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[25]||(D[25]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[26]||(D[26]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),w.value?(x(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:le.value},null,8,sc)):W("",!0)]),D[27]||(D[27]=et('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),oc={class:"animate-fade-in"},rc={class:"glass rounded-xl p-6 mb-6"},lc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ic={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ac={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},cc={class:"flex items-center gap-4 mb-3"},uc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},dc={class:"flex items-center gap-2"},fc={key:0,class:"text-sm text-warn"},pc={key:1,class:"text-center py-8 text-textSecondary text-sm"},mc={key:2,class:"text-center text-textSecondary py-12"},hc={key:3,class:"space-y-2"},xc=["onClick"],gc={class:"flex items-start justify-between gap-3"},vc={class:"flex-1 min-w-0"},yc={class:"flex items-center gap-2 mb-1"},bc={class:"font-medium text-sm"},_c={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},wc={class:"flex flex-wrap gap-1.5 mt-1"},kc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},$c={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Cc={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},Ac={class:"flex items-center gap-2"},Ec={key:0,class:"text-sm text-success"},Ic={key:1,class:"text-sm text-warn"},Pc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Mc=["value"],Oc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=it({__name:"SkillsTab",setup(e){const t=$([]),s=$(!0),n=$(null),o=$(""),l=$(""),a=$(!1),c=$(""),u=$(""),h=$(!1),d=$(""),m=$(""),b=$(!1),A=$("");async function H(){s.value=!0;try{const K=await be("/api/skills");t.value=K.skills||[]}finally{s.value=!1}}function C(K){return K?K.includes(".remote-copilot-mcp")&&K.includes("skills")?"user":K.endsWith(".default.md")?"default":K.endsWith(".skill.md")?"project":"unknown":"unknown"}function w(K){const R={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return R[K]||R.unknown}function k(K){n.value=K,o.value=K.content,l.value=(K.triggers||[]).join(", "),a.value=!!K.replacesOrchestrator,h.value=!1}function S(){n.value=null,u.value=""}function O(K,R,z,ue){let F=`---
65
+ name: ${K}
66
66
  triggers:
67
- `;return N.forEach(R=>{U+=` - ${R.trim()}
68
- `}),G&&(U+=`replaces_orchestrator: true
69
- `),U+=`---
67
+ `;return R.forEach(L=>{F+=` - ${L.trim()}
68
+ `}),z&&(F+=`replaces_orchestrator: true
69
+ `),F+=`---
70
70
 
71
- `,U+ue}async function V(){if(!n.value)return;const W=n.value.name;try{const N=l.value.split(",").map(R=>R.trim()).filter(Boolean),G=o.value;let ue;G.trimStart().startsWith("---")?ue=G:ue=H(W,N,a.value,G);const U=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"PUT",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!U.ok)throw new Error(U.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await B()}catch(N){c.value="Error: "+N.message}}async function se(){if(!n.value)return;const W=n.value.name;try{const N=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!N.ok)throw new Error(N.statusText);P(),await B()}catch(N){u.value="Error: "+N.message}}async function ne(){const W=d.value.trim(),N=m.value;if(!W){T.value="Name is required";return}const G=N.split(",").map(U=>U.trim()).filter(Boolean);if(!G.length){T.value="At least one trigger is required";return}const ue=H(W,G,y.value,`\x3C!-- Write your skill instructions here -->
72
- `);try{const U=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"PUT",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!U.ok)throw new Error(U.statusText);T.value="Created ✓",x.value=!1,await B();const R=t.value.find(K=>K.name===W);R&&k(R)}catch(U){T.value="Error: "+U.message}}return lt(B),(W,N)=>(h(),g("div",oc,[r("div",rc,[r("div",lc,[N[8]||(N[8]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Skill Library"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),r("button",{onClick:N[0]||(N[0]=G=>{x.value=!x.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),x.value?(h(),g("div",ic,[N[12]||(N[12]=r("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),r("div",ac,[r("div",null,[N[9]||(N[9]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),ee(r("input",{"onUpdate:modelValue":N[1]||(N[1]=G=>d.value=G),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value]])]),r("div",null,[N[10]||(N[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),ee(r("input",{"onUpdate:modelValue":N[2]||(N[2]=G=>m.value=G),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,m.value]])])]),r("div",cc,[r("label",uc,[ee(r("input",{"onUpdate:modelValue":N[3]||(N[3]=G=>y.value=G),type:"checkbox",class:"rounded"},null,512),[[ao,y.value]]),N[11]||(N[11]=r("span",null,"Replaces orchestrator",-1))])]),r("div",dc,[r("button",{onClick:ne,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),r("button",{onClick:N[4]||(N[4]=G=>x.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),T.value?(h(),g("span",fc,_(T.value),1)):q("",!0)])])):q("",!0),s.value?(h(),g("div",pc,"Loading...")):t.value.length===0?(h(),g("div",mc,"No skills loaded")):(h(),g("div",xc,[(h(!0),g(te,null,be(t.value,G=>{var ue;return h(),g("div",{key:G.name,onClick:U=>k(G),class:J(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=n.value)==null?void 0:ue.name)===G.name?"border-accent":"border-transparent"])},[r("div",gc,[r("div",vc,[r("div",yc,[r("span",bc,_(G.name),1),r("span",{class:"type-badge",style:Lt(w(C(G.source)))},_(C(G.source)),5),G.replacesOrchestrator?(h(),g("span",_c,"REPLACES ORCH")):q("",!0)]),r("div",wc,[(h(!0),g(te,null,be(G.triggers||[],U=>(h(),g("span",{key:U,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(U),1))),128))])]),r("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:G.source||""},_((G.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,hc)}),128))]))]),n.value?(h(),g("div",Sc,[r("div",Cc,[r("div",null,[r("h3",$c,"Edit: "+_(n.value.name),1),r("p",Tc,_(n.value.source||"(unknown source)"),1)]),r("div",Ec,[c.value?(h(),g("span",Ac,_(c.value),1)):q("",!0),u.value?(h(),g("span",Ic,_(u.value),1)):q("",!0),C(n.value.source)==="user"?(h(),g("button",{key:2,onClick:se,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):q("",!0),r("button",{onClick:P,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),r("button",{onClick:V,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Pc,[r("div",null,[N[13]||(N[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),r("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Mc)]),r("div",null,[N[14]||(N[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),ee(r("input",{"onUpdate:modelValue":N[5]||(N[5]=G=>l.value=G),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,l.value]])]),r("div",Oc,[r("label",Dc,[ee(r("input",{"onUpdate:modelValue":N[6]||(N[6]=G=>a.value=G),type:"checkbox",class:"rounded"},null,512),[[ao,a.value]]),N[15]||(N[15]=r("span",null,"Replaces orchestrator",-1))])])]),ee(r("textarea",{"onUpdate:modelValue":N[7]||(N[7]=G=>o.value=G),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[re,o.value]])])):q("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Nc={class:"glass rounded-xl p-6"},Lc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Uc={class:"flex items-center gap-3"},Vc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Fc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Hc=["value"],Bc={class:"flex justify-end"},Kc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},zc={key:1,class:"text-center py-8 text-danger text-sm"},Jc={key:2,class:"text-center py-12 text-textSecondary"},qc={key:3},Gc={class:"space-y-3"},Yc={class:"p-4"},Zc={class:"flex flex-wrap items-center gap-3"},Qc=["onBlur"],Xc=["onDblclick"],eu={class:"text-xs text-muted font-mono"},tu=["value","onChange"],su=["value"],nu={class:"text-xs text-muted"},ou=["onKeyup","onBlur"],ru=["title","onDblclick"],lu={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],au={class:"flex items-center gap-1.5"},cu=["onClick"],uu={class:"flex items-center gap-1.5"},du=["onClick"],fu={class:"flex items-center gap-1.5"},pu=["onClick"],mu=["onClick"],xu=["onClick"],hu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},vu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},yu=["value"],bu={class:"flex items-center gap-2"},_u=["onClick","disabled"],wu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},ku={key:0,class:"text-xs text-muted py-1"},Su={class:"text-sm font-medium"},Cu={class:"text-xs text-muted font-mono"},$u=["value","onChange"],Tu=["value"],Eu={class:"text-xs text-muted"},Au=["onBlur","onKeyup"],Iu=["title","onDblclick"],Pu={class:"ml-auto flex items-center gap-3"},Mu=["onClick","disabled"],Ou=["onClick","disabled"],Du=["onClick","disabled"],Ru={key:2,class:"flex items-center gap-1.5"},ju=["onClick"],Nu={key:3,class:"flex items-center gap-1.5"},Lu=["onClick"],Uu={key:4,class:"flex items-center gap-1.5"},Vu=["onClick"],Fu=["onClick"],Hu={key:4},Bu={class:"space-y-2"},Ku={class:"font-medium"},Wu={class:"text-xs text-muted font-mono"},zu={class:"text-xs text-textSecondary"},Ju={class:"text-xs text-muted"},qu={class:"ml-auto flex items-center gap-2"},Gu=["onClick","disabled"],Yu=["onClick","disabled"],Zu=["onClick"],Qu={key:5},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd=["value","onChange"],nd=["value"],od={class:"text-xs text-muted"},rd=["onBlur","onKeyup"],ld=["title","onDblclick"],id={class:"ml-auto flex items-center gap-3"},ad=["onClick","disabled"],cd=["onClick","disabled"],ud={class:"flex items-center gap-1.5"},dd=["onClick"],fd={class:"flex items-center gap-1.5"},pd=["onClick"],md={class:"flex items-center gap-1.5"},xd=["onClick"],hd=["onClick"],gd={key:6},vd={class:"space-y-2"},yd={class:"font-medium"},bd={class:"text-xs text-muted font-mono"},_d=["value","onChange"],wd=["value"],kd={class:"text-xs text-muted"},Sd=vt({__name:"ThreadsTab",setup(e){const t=E([]),s=E(!0),n=E(""),o=E({}),l=E(new Set),a=E(!1),c=E({name:"",threadId:0,client:"claude",workingDirectory:""}),u=E(""),x=E(!1),d=E(null),m=E(""),y=E(null),T=E(""),B=E(null),C=E({name:"",threadId:0,client:"claude",workingDirectory:""}),w=E(""),k=E(!1),P=E(null),H=E(null),V=E(null),se=["claude","copilot","codex","openai_codex","copilot_claude","copilot_codex","cursor"],ne={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},W=Fe(()=>t.value.filter(D=>D.type==="root")),N=Fe(()=>t.value.filter(D=>D.type==="daily")),G=Fe(()=>t.value.filter(D=>D.type==="branch")),ue=Fe(()=>t.value.filter(D=>D.type==="worker"));async function U(){s.value=!0,n.value="";try{const D=await ye("/api/threads");t.value=D.threads??[]}catch(D){n.value=D.message||"Failed to load threads"}finally{s.value=!1}}async function R(D){try{const b=await ye(`/api/threads/${D}/children`);o.value[D]=b.threads??[]}catch{o.value[D]=[]}}function K(D){l.value.has(D)?l.value.delete(D):(l.value.add(D),R(D))}async function oe(){if(!(!c.value.name.trim()||!c.value.threadId)){x.value=!0,u.value="";try{const D=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:c.value.threadId,name:c.value.name.trim(),type:"root",client:c.value.client,keepAlive:!0,...c.value.workingDirectory.trim()?{workingDirectory:c.value.workingDirectory.trim()}:{}})});if(!D.ok){const b=await D.json().catch(()=>({error:D.statusText}));throw new Error(b.error??D.statusText)}u.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{u.value=""},3e3),await U()}catch(D){u.value="Error: "+D.message}finally{x.value=!1}}}async function ve(D){if(!(!C.value.name.trim()||!C.value.threadId)){k.value=!0,w.value="";try{const b=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:D,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}w.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},B.value=null,setTimeout(()=>{w.value=""},3e3),await U(),R(D)}catch(b){w.value="Error: "+b.message}finally{k.value=!1}}}function Se(D){d.value=D.threadId,m.value=D.name}async function pe(D){const b=m.value.trim();if(d.value=null,!!b)try{const i=await fetch(`/api/threads/${D}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({name:b})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to rename thread: "+i.message}}function le(D){y.value=D.threadId,T.value=D.workingDirectory??""}async function F(D){const b=T.value.trim();y.value=null;try{const i=await fetch(`/api/threads/${D}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:b||null})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to update working directory: "+i.message}}async function M(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!D.keepAlive})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle keep-alive: "+b.message}}async function $e(D,b){try{const i=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({client:b})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to change agent type: "+i.message}}async function ke(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!D.dailyRotation})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle daily rotation: "+b.message}}async function de(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!D.autonomousMode})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle autonomous mode: "+b.message}}async function We(D){if(confirm(`Archive thread "${D.name}" (${D.threadId})?`))try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to archive: "+b.message}}async function It(D){if(confirm(`Start thread "${D.name}" (${D.threadId})?`)){P.value=D.threadId;try{const b=await fetch(`/api/threads/${D.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}await U()}catch(b){n.value="Failed to start thread: "+b.message}finally{P.value=null}}}function it(D){u.value="Sync to Root — not yet implemented",setTimeout(()=>{u.value=""},3e3)}async function Pt(D){if(confirm(`Convert "${D.name}" to a root thread? This will detach it from its parent.`)){V.value=D.threadId;try{const b=await fetch(`/api/threads/${D.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}n.value="",u.value=`Converted "${D.name}" to root ✓`,setTimeout(()=>{u.value=""},3e3),await U()}catch(b){n.value="Failed to convert: "+b.message}finally{V.value=null}}}function at(D){if(!D)return"—";const b=new Date(D),p=Date.now()-b.getTime();return p<6e4?"just now":p<36e5?`${Math.floor(p/6e4)}m ago`:p<864e5?`${Math.floor(p/36e5)}h ago`:b.toLocaleDateString()}function bt(D){return D==="active"?"text-success":D==="archived"?"text-muted":"text-warn"}return lt(U),(D,b)=>(h(),g("div",jc,[r("div",Nc,[r("div",Lc,[b[18]||(b[18]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Thread Registry"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),r("div",Uc,[u.value?(h(),g("span",{key:0,class:J([u.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(u.value),3)):q("",!0),r("button",{onClick:b[0]||(b[0]=i=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},_(a.value?"Cancel":"+ New Root Thread"),1),r("button",{onClick:U,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(h(),g("div",Vc,[r("div",Fc,[r("div",null,[b[19]||(b[19]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),ee(r("input",{"onUpdate:modelValue":b[1]||(b[1]=i=>c.value.name=i),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.name]])]),r("div",null,[b[20]||(b[20]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),ee(r("input",{"onUpdate:modelValue":b[2]||(b[2]=i=>c.value.threadId=i),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.threadId,void 0,{number:!0}]])]),r("div",null,[b[21]||(b[21]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),ee(r("select",{"onUpdate:modelValue":b[3]||(b[3]=i=>c.value.client=i),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(te,null,be(se,i=>r("option",{key:i,value:i},_(i),9,Hc)),64))],512),[[Ht,c.value.client]])])]),r("div",null,[b[22]||(b[22]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),ee(r("input",{"onUpdate:modelValue":b[4]||(b[4]=i=>c.value.workingDirectory=i),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,c.value.workingDirectory]])]),r("div",Bc,[r("button",{onClick:oe,disabled:x.value||!c.value.name.trim()||!c.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(x.value?"Creating…":"Create Root Thread"),9,Kc)])])):q("",!0)]),s.value&&t.value.length===0?(h(),g("div",Wc,"Loading threads…")):n.value?(h(),g("div",zc,_(n.value),1)):t.value.length===0?(h(),g("div",Jc,"No threads registered")):q("",!0),W.value.length>0?(h(),g("div",qc,[b[29]||(b[29]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),r("div",Gc,[(h(!0),g(te,null,be(W.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl overflow-hidden"},[r("div",Yc,[r("div",Zc,[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),d.value===i.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[5]||(b[5]=f=>m.value=f),onBlur:f=>pe(i.threadId),onKeyup:[b[6]||(b[6]=Ze(f=>f.target.blur(),["enter"])),b[7]||(b[7]=Ze(f=>d.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Qc)),[[re,m.value]]):(h(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:f=>Se(i),title:"Double-click to rename"},_(i.name),41,Xc)),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",eu,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,su)),64))],40,tu),r("span",nu,_(at(i.lastActiveAt)),1),y.value===i.threadId?ee((h(),g("input",{key:2,"onUpdate:modelValue":b[8]||(b[8]=f=>T.value=f),onKeyup:[Ze(f=>F(i.threadId),["enter"]),b[9]||(b[9]=Ze(f=>y.value=null,["escape"]))],onBlur:f=>F(i.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,ou)),[[re,T.value]]):(h(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+_(i.workingDirectory??"—"),41,ru)),r("div",lu,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,iu),r("div",au,[r("button",{onClick:f=>M(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,cu),b[23]||(b[23]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",uu,[r("button",{onClick:f=>ke(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,du),b[24]||(b[24]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",fu,[r("button",{onClick:f=>de(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,pu),b[25]||(b[25]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>K(i.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},_(l.value.has(i.threadId)?"▾ Children":"▸ Children"),9,mu),r("button",{onClick:f=>{B.value=B.value===i.threadId?null:i.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},w.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,xu),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,hu)])]),B.value===i.threadId?(h(),g("div",gu,[r("div",vu,[ee(r("input",{"onUpdate:modelValue":b[10]||(b[10]=f=>C.value.name=f),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.name]]),ee(r("input",{"onUpdate:modelValue":b[11]||(b[11]=f=>C.value.threadId=f),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.threadId,void 0,{number:!0}]]),ee(r("select",{"onUpdate:modelValue":b[12]||(b[12]=f=>C.value.client=f),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,yu)),64))],512),[[Ht,C.value.client]])]),ee(r("input",{"onUpdate:modelValue":b[13]||(b[13]=f=>C.value.workingDirectory=f),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,C.value.workingDirectory]]),r("div",bu,[r("button",{onClick:f=>ve(i.threadId),disabled:k.value||!C.value.name.trim()||!C.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},_(k.value?"Creating…":"Create Branch"),9,_u),w.value?(h(),g("span",{key:0,class:J([w.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},_(w.value),3)):q("",!0)])])):q("",!0)]),l.value.has(i.threadId)&&o.value[i.threadId]?(h(),g("div",wu,[o.value[i.threadId].length===0?(h(),g("div",ku,"No children")):q("",!0),(h(!0),g(te,null,be(o.value[i.threadId],f=>{var S,$;return h(),g("div",{key:f.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[r("span",{class:J(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(S=ne[f.type])==null?void 0:S.classes])},_(($=ne[f.type])==null?void 0:$.emoji)+" "+_(f.type.toUpperCase()),3),r("span",Su,_(f.name),1),r("span",{class:J(["text-xs",bt(f.status)])},_(f.status),3),r("span",Cu,"ID: "+_(f.threadId),1),r("select",{value:f.client,onChange:I=>$e(f,I.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,I=>r("option",{key:I,value:I},_(I),9,Tu)),64))],40,$u),r("span",Eu,_(at(f.lastActiveAt)),1),f.type==="branch"&&y.value===f.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[14]||(b[14]=I=>T.value=I),onBlur:I=>F(f.threadId),onKeyup:[Ze(I=>F(f.threadId),["enter"]),b[15]||(b[15]=Ze(I=>y.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,Au)),[[re,T.value]]):f.type==="branch"?(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(f.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:I=>le(f)},"📁 "+_(f.workingDirectory??"—"),41,Iu)):q("",!0),r("div",Pu,[r("button",{onClick:I=>It(f),disabled:P.value===f.threadId||f.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===f.threadId?"Starting…":"▶ Start"),9,Mu),f.rootThreadId?(h(),g("button",{key:0,onClick:I=>it(),disabled:H.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===f.threadId?"Syncing…":"⟳ Sync to Root"),9,Ou)):q("",!0),f.type==="branch"||f.type==="daily"?(h(),g("button",{key:1,onClick:I=>Pt(f),disabled:V.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Convert to independent root thread"},_(V.value===f.threadId?"Converting…":"↑ To Root"),9,Du)):q("",!0),f.type==="branch"?(h(),g("div",Ru,[r("button",{onClick:I=>M(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,ju),b[26]||(b[26]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):q("",!0),f.type==="branch"?(h(),g("div",Nu,[r("button",{onClick:I=>ke(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Lu),b[27]||(b[27]=r("span",{class:"text-xs text-muted"},"Daily",-1))])):q("",!0),f.type==="branch"?(h(),g("div",Uu,[r("button",{onClick:I=>de(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),b[28]||(b[28]=r("span",{class:"text-xs text-muted"},"Auto",-1))])):q("",!0),f.type!=="root"?(h(),g("button",{key:5,onClick:I=>We(f),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Fu)):q("",!0)])])}),128))])):q("",!0)])}),128))])])):q("",!0),N.value.length>0?(h(),g("div",Hu,[b[30]||(b[30]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),r("div",Bu,[(h(!0),g(te,null,be(N.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",Ku,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",Wu,"ID: "+_(i.threadId),1),r("span",zu,_(i.client),1),r("span",Ju,_(at(i.lastActiveAt)),1),r("div",qu,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,Gu),i.rootThreadId?(h(),g("button",{key:0,onClick:f=>it(),disabled:H.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,Yu)):q("",!0),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Zu)])])}),128))])])):q("",!0),G.value.length>0?(h(),g("div",Qu,[b[34]||(b[34]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),r("div",Xu,[(h(!0),g(te,null,be(G.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",ed,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",td,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,nd)),64))],40,sd),r("span",od,_(at(i.lastActiveAt)),1),y.value===i.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[16]||(b[16]=f=>T.value=f),onBlur:f=>F(i.threadId),onKeyup:[Ze(f=>F(i.threadId),["enter"]),b[17]||(b[17]=Ze(f=>y.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,rd)),[[re,T.value]]):(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+_(i.workingDirectory??"—"),41,ld)),r("div",id,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,ad),i.rootThreadId?(h(),g("button",{key:0,onClick:f=>it(),disabled:H.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,cd)):q("",!0),r("div",ud,[r("button",{onClick:f=>M(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,dd),b[31]||(b[31]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",fd,[r("button",{onClick:f=>ke(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,pd),b[32]||(b[32]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",md,[r("button",{onClick:f=>de(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,xd),b[33]||(b[33]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,hd)])])}),128))])])):q("",!0),ue.value.length>0?(h(),g("div",gd,[b[36]||(b[36]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),r("div",vd,[(h(!0),g(te,null,be(ue.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",yd,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",bd,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,wd)),64))],40,_d),r("span",kd,_(at(i.lastActiveAt)),1),b[35]||(b[35]=r("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):q("",!0)]))}}),Cd={class:"animate-fade-in"},$d={class:"glass rounded-xl p-6 mb-6"},Td={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ed={class:"flex items-center gap-3"},Ad={key:0,class:"text-center py-8 text-textSecondary text-sm"},Id={key:1,class:"text-center py-8 text-danger text-sm"},Pd={key:2,class:"text-center text-textSecondary py-12"},Md={key:3,class:"space-y-2"},Od={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Dd={class:"flex items-center justify-between gap-3"},Rd={class:"flex items-center gap-2 min-w-0"},jd={class:"flex items-center justify-between gap-3"},Nd={class:"flex-1 min-w-0"},Ld={class:"flex items-center gap-2 mb-1"},Ud={class:"font-medium text-sm font-mono"},Vd={class:"text-xs text-muted font-mono truncate"},Fd={class:"flex items-center gap-2 shrink-0"},Hd=["onClick"],Bd=["onClick","disabled"],Kd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Wd={class:"text-lg font-semibold mb-4"},zd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Jd=["readonly"],qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Gd={class:"mb-4"},Yd={class:"flex items-center justify-between mb-2"},Zd=["onUpdate:modelValue"],Qd=["onUpdate:modelValue"],Xd=["onClick"],ef={key:0,class:"text-xs text-muted italic"},tf={class:"mb-4"},sf={class:"mb-4"},nf={class:"flex items-center justify-between mb-2"},of=["onUpdate:modelValue"],rf=["onUpdate:modelValue"],lf=["onClick"],af={key:0,class:"text-xs text-muted italic"},cf={class:"flex items-center gap-3 flex-wrap"},uf=["disabled"],df={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ff=vt({__name:"McpServersTab",setup(e){const t=E({}),s=E(!0),n=E(""),o=E(""),l=E(!0),a=E(!1),c=E(null),u=E(!1),x=E(null),d=E(""),m=E("stdio"),y=E(""),T=E(""),B=E(""),C=E([]),w=E([]),k=E(""),P=Fe(()=>Object.entries(t.value).filter(([U])=>U!==Gt));async function H(){s.value=!0,n.value="";try{const U=await ye("/api/mcp-servers");t.value=U.servers||{}}catch(U){n.value="Failed to load MCP servers: "+U.message}finally{s.value=!1}}function V(U){return U==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function se(){x.value=null,d.value="",m.value="stdio",y.value="",T.value="",B.value="",C.value=[],w.value=[],k.value="",u.value=!0}function ne(U,R){x.value=U,d.value=U,m.value=R.type,y.value=R.command||"",T.value=(R.args||[]).join(" "),B.value=R.url||"",C.value=Object.entries(R.env||{}).map(([K,oe])=>({k:K,v:oe})),w.value=Object.entries(R.headers||{}).map(([K,oe])=>({k:K,v:oe})),k.value="",u.value=!0}function W(){u.value=!1,x.value=null}function N(){if(k.value="",!d.value.trim())return k.value="Name is required",!1;if(m.value==="stdio"&&!y.value.trim())return k.value="Command is required for stdio type",!1;if(m.value==="http"){const U=B.value.trim();if(!U)return k.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(U))return k.value="URL must start with http:// or https://",!1}return!0}async function G(){if(!N()||a.value)return;a.value=!0;const U=d.value.trim(),R={type:m.value};if(m.value==="stdio"){R.command=y.value.trim();const K=T.value.trim();K&&(R.args=K.split(/\s+/));const oe=Object.fromEntries(C.value.filter(ve=>ve.k.trim()).map(ve=>[ve.k.trim(),ve.v]));Object.keys(oe).length&&(R.env=oe)}else{R.url=B.value.trim();const K=Object.fromEntries(w.value.filter(oe=>oe.k.trim()).map(oe=>[oe.k.trim(),oe.v]));Object.keys(K).length&&(R.headers=K)}try{const K=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({name:U,config:R})});if(!K.ok)throw new Error(K.statusText);o.value="Saved ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),W(),await H()}catch(K){k.value="Error: "+K.message}finally{a.value=!1}}async function ue(U){if(confirm(`Delete MCP server "${U}"?`)&&!c.value){c.value=U;try{const R=await fetch(`/api/mcp-servers/${encodeURIComponent(U)}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!R.ok)throw new Error(R.statusText);o.value="Deleted ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),await H()}catch(R){o.value="Error: "+R.message,l.value=!1}finally{c.value=null}}}return lt(H),(U,R)=>(h(),g("div",Cd,[r("div",$d,[r("div",Td,[R[7]||(R[7]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"MCP Servers"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),r("div",Ed,[o.value?(h(),g("span",{key:0,class:J(["text-sm",l.value?"text-success":"text-danger"])},_(o.value),3)):q("",!0),r("button",{onClick:se,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(h(),g("div",Ad,"Loading...")):n.value?(h(),g("div",Id,_(n.value),1)):Object.keys(t.value).length===0?(h(),g("div",Pd,"No MCP servers configured")):(h(),g("div",Md,[t.value[Gt]?(h(),g("div",Od,[r("div",Dd,[r("div",Rd,[r("span",{class:"font-medium text-sm font-mono"},_(Gt)),r("span",{class:"type-badge",style:Lt(V(t.value[Gt].type))},_(t.value[Gt].type),5),R[8]||(R[8]=r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),R[9]||(R[9]=r("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):q("",!0),(h(!0),g(te,null,be(P.value,([K,oe])=>{var ve;return h(),g("div",{key:K,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",jd,[r("div",Nd,[r("div",Ld,[r("span",Ud,_(K),1),r("span",{class:"type-badge",style:Lt(V(oe.type))},_(oe.type),5)]),r("div",Vd,[oe.type==="stdio"?(h(),g(te,{key:0},[we(_(oe.command)+_((ve=oe.args)!=null&&ve.length?" "+oe.args.join(" "):""),1)],64)):(h(),g(te,{key:1},[we(_(oe.url),1)],64))])]),r("div",Fd,[r("button",{onClick:Se=>ne(K,oe),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},"Edit",8,Hd),r("button",{onClick:Se=>ue(K),disabled:c.value===K,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50"},_(c.value===K?"…":"Delete"),9,Bd)])])])}),128))]))]),u.value?(h(),g("div",Kd,[r("h3",Wd,_(x.value?`Edit: ${x.value}`:"Add MCP Server"),1),r("div",zd,[r("div",null,[R[10]||(R[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Name "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[0]||(R[0]=K=>d.value=K),type:"text",readonly:!!x.value,placeholder:"my-server",class:J(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",x.value?"opacity-60 cursor-not-allowed":""])},null,10,Jd),[[re,d.value]])]),r("div",null,[R[12]||(R[12]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Type "),r("span",{class:"text-danger"},"*")],-1)),ee(r("select",{"onUpdate:modelValue":R[1]||(R[1]=K=>m.value=K),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...R[11]||(R[11]=[r("option",{value:"stdio"},"stdio",-1),r("option",{value:"http"},"http",-1)])],512),[[Ht,m.value]])])]),m.value==="stdio"?(h(),g(te,{key:0},[r("div",qd,[r("div",null,[R[13]||(R[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Command "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[2]||(R[2]=K=>y.value=K),type:"text",placeholder:"node",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,y.value]])]),r("div",null,[R[14]||(R[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),ee(r("input",{"onUpdate:modelValue":R[3]||(R[3]=K=>T.value=K),type:"text",placeholder:"./server.js --port 3000",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,T.value]])])]),r("div",Gd,[r("div",Yd,[R[15]||(R[15]=r("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),r("button",{onClick:R[4]||(R[4]=K=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(te,null,be(C.value,(K,oe)=>(h(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[ee(r("input",{"onUpdate:modelValue":ve=>K.k=ve,type:"text",placeholder:"KEY",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Zd),[[re,K.k]]),R[16]||(R[16]=r("span",{class:"text-muted text-xs"},"=",-1)),ee(r("input",{"onUpdate:modelValue":ve=>K.v=ve,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Qd),[[re,K.v]]),r("button",{onClick:ve=>C.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Xd)]))),128)),C.value.length===0?(h(),g("div",ef,"No env vars")):q("",!0)])],64)):(h(),g(te,{key:1},[r("div",tf,[R[17]||(R[17]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("URL "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[5]||(R[5]=K=>B.value=K),type:"text",placeholder:"http://localhost:3000/mcp",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,B.value]])]),r("div",sf,[r("div",nf,[R[18]||(R[18]=r("label",{class:"text-xs text-textSecondary"},"Headers",-1)),r("button",{onClick:R[6]||(R[6]=K=>w.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(te,null,be(w.value,(K,oe)=>(h(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[ee(r("input",{"onUpdate:modelValue":ve=>K.k=ve,type:"text",placeholder:"Header-Name",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,of),[[re,K.k]]),R[19]||(R[19]=r("span",{class:"text-muted text-xs"},":",-1)),ee(r("input",{"onUpdate:modelValue":ve=>K.v=ve,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,rf),[[re,K.v]]),r("button",{onClick:ve=>w.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,lf)]))),128)),w.value.length===0?(h(),g("div",af,"No headers")):q("",!0)])],64)),r("div",cf,[r("button",{onClick:G,disabled:a.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(a.value?"Saving…":x.value?"Save Changes":"Add Server"),9,uf),r("button",{onClick:W,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," Cancel "),k.value?(h(),g("span",df,_(k.value),1)):q("",!0)])])):q("",!0)]))}}),pf={class:"animate-fade-in"},mf={class:"glass rounded-xl p-6 mb-6"},xf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},hf={class:"flex items-center gap-3"},gf=["disabled"],vf={key:0,class:"text-center py-8 text-textSecondary text-sm"},yf={key:1,class:"space-y-6"},bf={class:"glass rounded-xl p-4 border border-gray-700/50"},_f={class:"flex items-center gap-4"},wf={class:"flex justify-between text-xs text-muted mt-2"},kf={class:"font-mono"},Sf={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},Cf={class:"glass rounded-xl p-4 border border-gray-700/50"},$f={class:"flex items-center gap-4"},Tf={class:"flex justify-between text-xs text-muted mt-2"},Ef={class:"font-mono"},Af={class:"glass rounded-xl p-4 border border-gray-700/50"},If={class:"glass rounded-xl p-4 border border-gray-700/50"},Pf={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Mf={class:"grid grid-cols-2 gap-4"},Of={class:"text-sm font-medium text-textSecondary"},Df={class:"text-sm font-medium font-mono text-textSecondary"},Rf={class:"text-sm font-medium font-mono text-textSecondary"},jf={class:"mt-3"},Nf=vt({__name:"SettingsTab",setup(e){const t=E(!0),s=E(!1),n=E(""),o=E(50),l=E(50),a=E(1440),c=E(1440),u=E("claude-opus-4-6"),x=E("claude-opus-4-6"),d=E("claude-sonnet-4-5"),m=E("claude-sonnet-4-5"),y=Fe(()=>o.value!==l.value||a.value!==c.value||u.value!==x.value||d.value!==m.value);async function T(){t.value=!0;try{const[C,w,k,P]=await Promise.all([ye("/api/settings/bootstrap-message-count"),ye("/api/settings/wait-timeout"),ye("/api/settings/default-thread-model"),ye("/api/settings/default-worker-model")]);o.value=C.count,l.value=C.count,a.value=w.minutes,c.value=w.minutes,u.value=k.defaultThreadModel,x.value=k.defaultThreadModel,d.value=P.defaultWorkerModel,m.value=P.defaultWorkerModel}finally{t.value=!1}}async function B(){if(s.value=!0,n.value="",!u.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!d.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}try{const C={Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},[w,k,P,H]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:C,body:JSON.stringify({count:o.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:C,body:JSON.stringify({minutes:a.value})}),fetch("/api/settings/default-thread-model",{method:"POST",headers:C,body:JSON.stringify({model:u.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:C,body:JSON.stringify({model:d.value})})]);for(const N of[w,k,P,H])if(!N.ok){const G=await N.json().catch(()=>({error:N.statusText}));throw new Error(G.error??N.statusText)}const V=await w.json(),se=await k.json(),ne=await P.json(),W=await H.json();l.value=V.count,o.value=V.count,c.value=se.minutes,a.value=se.minutes,x.value=ne.defaultThreadModel,u.value=ne.defaultThreadModel,m.value=W.defaultWorkerModel,d.value=W.defaultWorkerModel,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(C){n.value="Error: "+C.message}finally{s.value=!1}}return lt(T),(C,w)=>(h(),g("div",pf,[r("div",mf,[r("div",xf,[w[6]||(w[6]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Settings"),r("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),r("div",hf,[n.value?(h(),g("span",{key:0,class:J([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(n.value),3)):q("",!0),r("button",{onClick:B,disabled:s.value||t.value||!y.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(s.value?"Saving…":"Save"),9,gf)])]),t.value?(h(),g("div",vf,"Loading…")):(h(),g("div",yf,[r("div",bf,[w[10]||(w[10]=r("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),w[11]||(w[11]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Number of recent messages injected into the agent's bootstrap context. Set to "),r("span",{class:"font-mono text-accentLight"},"0"),we(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),r("div",_f,[ee(r("input",{"onUpdate:modelValue":w[0]||(w[0]=k=>o.value=k),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[re,o.value,void 0,{number:!0}]]),ee(r("input",{"onUpdate:modelValue":w[1]||(w[1]=k=>o.value=k),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,o.value,void 0,{number:!0}]])]),r("div",wf,[w[7]||(w[7]=r("span",null,"Off",-1)),r("span",kf,_(o.value)+" messages",1),w[8]||(w[8]=r("span",null,"Max",-1))]),o.value===0?(h(),g("div",Sf,[...w[9]||(w[9]=[we(" Message buffer injection is ",-1),r("strong",null,"disabled",-1),we(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):q("",!0)]),r("div",Cf,[w[14]||(w[14]=r("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),w[15]||(w[15]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Maximum time (in minutes) a single "),r("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),we(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),r("div",$f,[ee(r("input",{"onUpdate:modelValue":w[2]||(w[2]=k=>a.value=k),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[re,a.value,void 0,{number:!0}]]),ee(r("input",{"onUpdate:modelValue":w[3]||(w[3]=k=>a.value=k),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,a.value,void 0,{number:!0}]])]),r("div",Tf,[w[12]||(w[12]=r("span",null,"1 min",-1)),r("span",Ef,_(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),w[13]||(w[13]=r("span",null,"24h",-1))])]),r("div",Af,[w[16]||(w[16]=r("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),w[17]||(w[17]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),we(" env var if set. ")],-1)),ee(r("input",{"onUpdate:modelValue":w[4]||(w[4]=k=>u.value=k),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,u.value,void 0,{trim:!0}]])]),r("div",If,[w[18]||(w[18]=r("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),w[19]||(w[19]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a worker Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),we(" env var if set. ")],-1)),ee(r("input",{"onUpdate:modelValue":w[5]||(w[5]=k=>d.value=k),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value,void 0,{trim:!0}]])]),r("div",Pf,[w[24]||(w[24]=r("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),r("div",Mf,[r("div",null,[w[20]||(w[20]=r("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),r("span",{class:J(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},_(l.value>0?`${l.value} messages`:"Disabled"),3)]),r("div",null,[w[21]||(w[21]=r("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),r("span",Of,_(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)]),r("div",null,[w[22]||(w[22]=r("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),r("span",Df,_(x.value),1)]),r("div",null,[w[23]||(w[23]=r("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),r("span",Rf,_(m.value),1)])]),r("div",jf,[r("span",{class:J(["text-sm font-medium",y.value?"text-warn":"text-textSecondary"])},_(y.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Lf={class:"animate-fade-in"},Uf={class:"glass rounded-xl p-6 mb-6"},Vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ff={class:"flex flex-wrap gap-3 items-center"},Hf=["disabled"],Bf={key:0,class:"flex items-center gap-2"},Kf={key:1},Wf={class:"glass rounded-xl p-6"},zf={key:0,class:"text-center py-8 text-textSecondary text-sm"},Jf={key:1,class:"text-center py-12 text-textSecondary text-sm"},qf={key:2,class:"space-y-2"},Gf={class:"flex items-center justify-between gap-3"},Yf={class:"flex-1 min-w-0"},Zf={class:"flex flex-wrap items-center gap-2 mb-1"},Qf={class:"font-medium text-sm font-mono"},Xf={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},ep={class:"text-xs text-muted"},tp={class:"text-xs text-muted"},sp=["onClick","disabled"],np={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},op={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},rp={class:"text-sm text-textSecondary mb-4"},lp={class:"font-mono text-textPrimary"},ip=vt({__name:"SnapshotsTab",setup(e){const t=E([]),s=E(!0),n=E(!1),o=E(null),l=E(""),a=E(""),c=E(!0),u=E(null);function x(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}function d(k){try{return new Date(k).toLocaleString()}catch{return k}}function m(k,P){a.value=k,c.value=P,setTimeout(()=>{a.value=""},4e3)}async function y(){s.value=!0;try{const k=await ye("/api/snapshots");t.value=k.snapshots}catch(k){m("Failed to load snapshots: "+k.message,!1)}finally{s.value=!1}}async function T(){if(!n.value){n.value=!0;try{await ye("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await y()}catch(k){m("Error: "+k.message,!1)}finally{n.value=!1}}}function B(k){u.value=k}function C(){u.value=null}async function w(){const k=u.value;if(!(!k||o.value)){u.value=null,o.value=k;try{await ye(`/api/snapshots/${encodeURIComponent(k)}`,{method:"DELETE"}),m("Deleted ✓",!0),await y()}catch(P){m("Error: "+P.message,!1)}finally{o.value=null}}}return lt(y),(k,P)=>(h(),g("div",Lf,[r("div",Uf,[r("div",Vf,[P[1]||(P[1]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Snapshots"),r("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(h(),g("span",{key:0,class:J(["text-sm",c.value?"text-success":"text-danger"])},_(a.value),3)):q("",!0)]),r("div",Ff,[ee(r("input",{"onUpdate:modelValue":P[0]||(P[0]=H=>l.value=H),type:"text",placeholder:"Description (optional)",class:"flex-1 min-w-48 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition",onKeydown:Ze(T,["enter"])},null,544),[[re,l.value]]),r("button",{onClick:T,disabled:n.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition whitespace-nowrap"},[n.value?(h(),g("span",Bf,[...P[2]||(P[2]=[r("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),we(" Creating… ",-1)])])):(h(),g("span",Kf,"+ Create Snapshot"))],8,Hf)])]),r("div",Wf,[s.value?(h(),g("div",zf,"Loading…")):t.value.length===0?(h(),g("div",Jf,"No snapshots yet")):(h(),g("div",qf,[(h(!0),g(te,null,be(t.value,H=>(h(),g("div",{key:H.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",Gf,[r("div",Yf,[r("div",Zf,[r("span",Qf,_(H.name),1),r("span",Xf,"v"+_(H.mcpVersion),1),r("span",ep,_(x(H.sizeBytes)),1)]),r("div",tp,[we(_(d(H.createdAt)),1),H.description?(h(),g(te,{key:0},[we(" · "+_(H.description),1)],64)):q("",!0)])]),r("button",{onClick:V=>B(H.name),disabled:o.value===H.name,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50 shrink-0"},_(o.value===H.name?"…":"Delete"),9,sp)])]))),128))]))]),u.value?(h(),g("div",np,[r("div",op,[P[5]||(P[5]=r("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),r("p",rp,[P[3]||(P[3]=we(" Delete ",-1)),r("span",lp,_(u.value),1),P[4]||(P[4]=we("? This cannot be undone. ",-1))]),r("div",{class:"flex gap-3"},[r("button",{onClick:w,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),r("button",{onClick:C,class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel")])])])):q("",!0)]))}}),ap={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},cp={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},up=["disabled"],dp={key:0,class:"mt-3 text-sm text-danger"},fp={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},pp={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},mp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},xp={class:"flex items-center gap-4"},hp={class:"text-sm text-textSecondary font-mono"},gp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},vp={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},yp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},bp={class:"text-2xl font-bold font-mono"},_p={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},wp={class:"text-2xl font-bold font-mono"},kp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Sp={class:"text-2xl font-bold font-mono"},Cp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},$p={class:"flex items-center gap-2 mb-2"},Tp={class:"text-2xl font-bold font-mono"},Ep={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Ap={class:"text-2xl font-bold font-mono"},Ip={class:"max-w-7xl mx-auto px-4 sm:px-6"},Pp={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Mp=["onClick"],Op={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},hs="sensorium_token",Dp=vt({__name:"App",setup(e){const t=E(!1),s=E(""),n=E(""),o=E(!1),l=E(null),a=E("sessions");let c=null;const u=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"settings",label:"Settings"}],x={sessions:ra,notes:ka,templates:nc,skills:Rc,threads:Sd,mcp:ff,snapshots:ip,settings:Nf},d=Fe(()=>x[a.value]),m=Fe(()=>{if(!l.value)return"—";const w=Math.floor(l.value.uptime),k=Math.floor(w/86400),P=Math.floor(w%86400/3600),H=Math.floor(w%3600/60);return k>0?`${k}d ${P}h`:P>0?`${P}h ${H}m`:`${H}m`});async function y(){const w=s.value.trim()||"no-auth";o.value=!0,n.value="";try{qt(w),await B(),localStorage.setItem(hs,w),t.value=!0,C()}catch(k){const P=k;P.status===401?n.value="Invalid token":n.value=P.message??"Connection failed",qt("")}finally{o.value=!1}}function T(){localStorage.removeItem(hs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function B(){l.value=await ye("/api/status")}function C(){c&&clearInterval(c),c=setInterval(B,3e4)}return lt(async()=>{const w=localStorage.getItem(hs);if(w){s.value=w;try{qt(w),await B(),t.value=!0,C()}catch{localStorage.removeItem(hs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(w,k)=>{var P,H,V,se,ne,W,N,G,ue;return t.value?(h(),g("div",fp,[r("header",pp,[r("div",mp,[k[3]||(k[3]=Xe('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),r("div",xp,[k[2]||(k[2]=r("div",{class:"flex items-center gap-2 text-sm"},[r("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),r("span",{class:"text-textSecondary"},"Connected")],-1)),r("div",hp,_(m.value),1),r("button",{onClick:T,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),r("div",gp,[r("div",vp,[r("div",yp,[k[4]||(k[4]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),r("div",bp,_(((P=l.value)==null?void 0:P.activeSessions)??0),1)]),r("div",_p,[k[5]||(k[5]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),r("div",wp,_(((V=(H=l.value)==null?void 0:H.memory)==null?void 0:V.totalSemanticNotes)??0),1)]),r("div",kp,[k[6]||(k[6]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),r("div",Sp,_(((ne=(se=l.value)==null?void 0:se.memory)==null?void 0:ne.totalEpisodes)??0),1)]),r("div",Cp,[r("div",$p,[r("span",{class:J((((N=(W=l.value)==null?void 0:W.memory)==null?void 0:N.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...k[7]||(k[7]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),k[8]||(k[8]=r("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),r("div",Tp,_(((ue=(G=l.value)==null?void 0:G.memory)==null?void 0:ue.unconsolidatedEpisodes)??0),1)]),r("div",Ep,[k[9]||(k[9]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),r("div",Ap,_(m.value),1)])])]),r("div",Ip,[r("nav",Pp,[(h(),g(te,null,be(u,U=>r("button",{key:U.id,onClick:R=>a.value=U.id,class:J(["pb-3 text-sm font-medium transition",a.value===U.id?"tab-active":"tab-inactive"])},_(U.label),11,Mp)),64))])]),r("div",Op,[(h(),fr(Al(d.value),{status:l.value},null,8,["status"]))])])):(h(),g("div",ap,[r("div",cp,[k[1]||(k[1]=Xe('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),ee(r("input",{"onUpdate:modelValue":k[0]||(k[0]=U=>s.value=U),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Ze(y,["enter"])},null,544),[[re,s.value]]),r("button",{onClick:y,disabled:o.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},_(o.value?"Connecting...":"Connect"),9,up),n.value?(h(),g("p",dp,_(n.value),1)):q("",!0)])]))}}});Hi(Dp).mount("#app");</script>
71
+ `,F+ue}async function P(){if(!n.value)return;const K=n.value.name;try{const R=l.value.split(",").map(L=>L.trim()).filter(Boolean),z=o.value;let ue;z.trimStart().startsWith("---")?ue=z:ue=O(K,R,a.value,z);const F=await fetch(`/api/skills/${encodeURIComponent(K)}`,{method:"PUT",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!F.ok)throw new Error(F.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await H()}catch(R){c.value="Error: "+R.message}}async function Z(){if(!n.value)return;const K=n.value.name;try{const R=await fetch(`/api/skills/${encodeURIComponent(K)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!R.ok)throw new Error(R.statusText);S(),await H()}catch(R){u.value="Error: "+R.message}}async function X(){const K=d.value.trim(),R=m.value;if(!K){A.value="Name is required";return}const z=R.split(",").map(F=>F.trim()).filter(Boolean);if(!z.length){A.value="At least one trigger is required";return}const ue=O(K,z,b.value,`\x3C!-- Write your skill instructions here -->
72
+ `);try{const F=await fetch(`/api/skills/${encodeURIComponent(K)}`,{method:"PUT",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!F.ok)throw new Error(F.statusText);A.value="Created ✓",h.value=!1,await H();const L=t.value.find(J=>J.name===K);L&&k(L)}catch(F){A.value="Error: "+F.message}}return We(H),(K,R)=>(x(),g("div",oc,[r("div",rc,[r("div",lc,[R[8]||(R[8]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Skill Library"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),r("button",{onClick:R[0]||(R[0]=z=>{h.value=!h.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),h.value?(x(),g("div",ic,[R[12]||(R[12]=r("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),r("div",ac,[r("div",null,[R[9]||(R[9]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),se(r("input",{"onUpdate:modelValue":R[1]||(R[1]=z=>d.value=z),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value]])]),r("div",null,[R[10]||(R[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),se(r("input",{"onUpdate:modelValue":R[2]||(R[2]=z=>m.value=z),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,m.value]])])]),r("div",cc,[r("label",uc,[se(r("input",{"onUpdate:modelValue":R[3]||(R[3]=z=>b.value=z),type:"checkbox",class:"rounded"},null,512),[[ao,b.value]]),R[11]||(R[11]=r("span",null,"Replaces orchestrator",-1))])]),r("div",dc,[r("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),r("button",{onClick:R[4]||(R[4]=z=>h.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),A.value?(x(),g("span",fc,v(A.value),1)):W("",!0)])])):W("",!0),s.value?(x(),g("div",pc,"Loading...")):t.value.length===0?(x(),g("div",mc,"No skills loaded")):(x(),g("div",hc,[(x(!0),g(ne,null,ve(t.value,z=>{var ue;return x(),g("div",{key:z.name,onClick:F=>k(z),class:G(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=n.value)==null?void 0:ue.name)===z.name?"border-accent":"border-transparent"])},[r("div",gc,[r("div",vc,[r("div",yc,[r("span",bc,v(z.name),1),r("span",{class:"type-badge",style:Lt(w(C(z.source)))},v(C(z.source)),5),z.replacesOrchestrator?(x(),g("span",_c,"REPLACES ORCH")):W("",!0)]),r("div",wc,[(x(!0),g(ne,null,ve(z.triggers||[],F=>(x(),g("span",{key:F,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},v(F),1))),128))])]),r("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:z.source||""},v((z.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,xc)}),128))]))]),n.value?(x(),g("div",Sc,[r("div",$c,[r("div",null,[r("h3",Cc,"Edit: "+v(n.value.name),1),r("p",Tc,v(n.value.source||"(unknown source)"),1)]),r("div",Ac,[c.value?(x(),g("span",Ec,v(c.value),1)):W("",!0),u.value?(x(),g("span",Ic,v(u.value),1)):W("",!0),C(n.value.source)==="user"?(x(),g("button",{key:2,onClick:Z,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):W("",!0),r("button",{onClick:S,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),r("button",{onClick:P,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Pc,[r("div",null,[R[13]||(R[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),r("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Mc)]),r("div",null,[R[14]||(R[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),se(r("input",{"onUpdate:modelValue":R[5]||(R[5]=z=>l.value=z),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,l.value]])]),r("div",Oc,[r("label",Dc,[se(r("input",{"onUpdate:modelValue":R[6]||(R[6]=z=>a.value=z),type:"checkbox",class:"rounded"},null,512),[[ao,a.value]]),R[15]||(R[15]=r("span",null,"Replaces orchestrator",-1))])])]),se(r("textarea",{"onUpdate:modelValue":R[7]||(R[7]=z=>o.value=z),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[re,o.value]])])):W("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Nc={class:"glass rounded-xl p-6"},Lc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Uc={class:"flex items-center gap-3"},Vc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Fc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Bc=["value"],Hc={class:"flex justify-end"},Kc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},zc={key:1,class:"text-center py-8 text-danger text-sm"},Jc={key:2,class:"text-center py-12 text-textSecondary"},qc={key:3},Gc={class:"space-y-3"},Yc={class:"p-4"},Zc={class:"flex flex-wrap items-center gap-3"},Qc=["onBlur"],Xc=["onDblclick"],eu={class:"text-xs text-muted font-mono"},tu=["value","onChange"],su=["value"],nu={class:"text-xs text-muted"},ou=["onKeyup","onBlur"],ru=["title","onDblclick"],lu={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],au={class:"flex items-center gap-1.5"},cu=["onClick"],uu={class:"flex items-center gap-1.5"},du=["onClick"],fu={class:"flex items-center gap-1.5"},pu=["onClick"],mu=["onClick"],hu=["onClick"],xu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},vu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},yu=["value"],bu={class:"flex items-center gap-2"},_u=["onClick","disabled"],wu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},ku={key:0,class:"text-xs text-muted py-1"},Su={class:"text-sm font-medium"},$u={class:"text-xs text-muted font-mono"},Cu=["value","onChange"],Tu=["value"],Au={class:"text-xs text-muted"},Eu=["onBlur","onKeyup"],Iu=["title","onDblclick"],Pu={class:"ml-auto flex items-center gap-3"},Mu=["onClick","disabled"],Ou=["onClick","disabled"],Du=["onClick","disabled"],Ru={key:2,class:"flex items-center gap-1.5"},ju=["onClick"],Nu={key:3,class:"flex items-center gap-1.5"},Lu=["onClick"],Uu={key:4,class:"flex items-center gap-1.5"},Vu=["onClick"],Fu=["onClick"],Bu={key:4},Hu={class:"space-y-2"},Ku={class:"font-medium"},Wu={class:"text-xs text-muted font-mono"},zu={class:"text-xs text-textSecondary"},Ju={class:"text-xs text-muted"},qu={class:"ml-auto flex items-center gap-2"},Gu=["onClick","disabled"],Yu=["onClick","disabled"],Zu=["onClick"],Qu={key:5},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd=["value","onChange"],nd=["value"],od={class:"text-xs text-muted"},rd=["onBlur","onKeyup"],ld=["title","onDblclick"],id={class:"ml-auto flex items-center gap-3"},ad=["onClick","disabled"],cd=["onClick","disabled"],ud={class:"flex items-center gap-1.5"},dd=["onClick"],fd={class:"flex items-center gap-1.5"},pd=["onClick"],md={class:"flex items-center gap-1.5"},hd=["onClick"],xd=["onClick"],gd={key:6},vd={class:"space-y-2"},yd={class:"font-medium"},bd={class:"text-xs text-muted font-mono"},_d=["value","onChange"],wd=["value"],kd={class:"text-xs text-muted"},Sd=it({__name:"ThreadsTab",setup(e){const t=$([]),s=$(!0),n=$(""),o=$({}),l=$(new Set),a=$(!1),c=$({name:"",threadId:0,client:"claude",workingDirectory:""}),u=$(""),h=$(!1),d=$(null),m=$(""),b=$(null),A=$(""),H=$(null),C=$({name:"",threadId:0,client:"claude",workingDirectory:""}),w=$(""),k=$(!1),S=$(null),O=$(null),P=$(null),Z=["claude","copilot","codex","openai_codex","copilot_claude","copilot_codex","cursor"],X={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},K=Re(()=>t.value.filter(N=>N.type==="root")),R=Re(()=>t.value.filter(N=>N.type==="daily")),z=Re(()=>t.value.filter(N=>N.type==="branch")),ue=Re(()=>t.value.filter(N=>N.type==="worker"));async function F(){s.value=!0,n.value="";try{const N=await be("/api/threads");t.value=N.threads??[]}catch(N){n.value=N.message||"Failed to load threads"}finally{s.value=!1}}async function L(N){try{const _=await be(`/api/threads/${N}/children`);o.value[N]=_.threads??[]}catch{o.value[N]=[]}}function J(N){l.value.has(N)?l.value.delete(N):(l.value.add(N),L(N))}async function oe(){if(!(!c.value.name.trim()||!c.value.threadId)){h.value=!0,u.value="";try{const N=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:c.value.threadId,name:c.value.name.trim(),type:"root",client:c.value.client,keepAlive:!0,...c.value.workingDirectory.trim()?{workingDirectory:c.value.workingDirectory.trim()}:{}})});if(!N.ok){const _=await N.json().catch(()=>({error:N.statusText}));throw new Error(_.error??N.statusText)}u.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{u.value=""},3e3),await F()}catch(N){u.value="Error: "+N.message}finally{h.value=!1}}}async function _e(N){if(!(!C.value.name.trim()||!C.value.threadId)){k.value=!0,w.value="";try{const _=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:N,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}w.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},H.value=null,setTimeout(()=>{w.value=""},3e3),await F(),L(N)}catch(_){w.value="Error: "+_.message}finally{k.value=!1}}}function Se(N){d.value=N.threadId,m.value=N.name}async function pe(N){const _=m.value.trim();if(d.value=null,!!_)try{const i=await fetch(`/api/threads/${N}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({name:_})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to rename thread: "+i.message}}function le(N){b.value=N.threadId,A.value=N.workingDirectory??""}async function B(N){const _=A.value.trim();b.value=null;try{const i=await fetch(`/api/threads/${N}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:_||null})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to update working directory: "+i.message}}async function D(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!N.keepAlive})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle keep-alive: "+_.message}}async function Ce(N,_){try{const i=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({client:_})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to change agent type: "+i.message}}async function ke(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!N.dailyRotation})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle daily rotation: "+_.message}}async function de(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!N.autonomousMode})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle autonomous mode: "+_.message}}async function ze(N){if(confirm(`Archive thread "${N.name}" (${N.threadId})?`))try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to archive: "+_.message}}async function It(N){if(confirm(`Start thread "${N.name}" (${N.threadId})?`)){S.value=N.threadId;try{const _=await fetch(`/api/threads/${N.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}await F()}catch(_){n.value="Failed to start thread: "+_.message}finally{S.value=null}}}function at(N){u.value="Sync to Root — not yet implemented",setTimeout(()=>{u.value=""},3e3)}async function Pt(N){if(confirm(`Convert "${N.name}" to a root thread? This will detach it from its parent.`)){P.value=N.threadId;try{const _=await fetch(`/api/threads/${N.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}n.value="",u.value=`Converted "${N.name}" to root ✓`,setTimeout(()=>{u.value=""},3e3),await F()}catch(_){n.value="Failed to convert: "+_.message}finally{P.value=null}}}function ct(N){if(!N)return"—";const _=new Date(N),p=Date.now()-_.getTime();return p<6e4?"just now":p<36e5?`${Math.floor(p/6e4)}m ago`:p<864e5?`${Math.floor(p/36e5)}h ago`:_.toLocaleDateString()}function bt(N){return N==="active"?"text-success":N==="archived"?"text-muted":"text-warn"}return We(F),(N,_)=>(x(),g("div",jc,[r("div",Nc,[r("div",Lc,[_[18]||(_[18]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Thread Registry"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),r("div",Uc,[u.value?(x(),g("span",{key:0,class:G([u.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},v(u.value),3)):W("",!0),r("button",{onClick:_[0]||(_[0]=i=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},v(a.value?"Cancel":"+ New Root Thread"),1),r("button",{onClick:F,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(x(),g("div",Vc,[r("div",Fc,[r("div",null,[_[19]||(_[19]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),se(r("input",{"onUpdate:modelValue":_[1]||(_[1]=i=>c.value.name=i),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.name]])]),r("div",null,[_[20]||(_[20]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),se(r("input",{"onUpdate:modelValue":_[2]||(_[2]=i=>c.value.threadId=i),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.threadId,void 0,{number:!0}]])]),r("div",null,[_[21]||(_[21]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),se(r("select",{"onUpdate:modelValue":_[3]||(_[3]=i=>c.value.client=i),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(x(),g(ne,null,ve(Z,i=>r("option",{key:i,value:i},v(i),9,Bc)),64))],512),[[Bt,c.value.client]])])]),r("div",null,[_[22]||(_[22]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),se(r("input",{"onUpdate:modelValue":_[4]||(_[4]=i=>c.value.workingDirectory=i),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,c.value.workingDirectory]])]),r("div",Hc,[r("button",{onClick:oe,disabled:h.value||!c.value.name.trim()||!c.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(h.value?"Creating…":"Create Root Thread"),9,Kc)])])):W("",!0)]),s.value&&t.value.length===0?(x(),g("div",Wc,"Loading threads…")):n.value?(x(),g("div",zc,v(n.value),1)):t.value.length===0?(x(),g("div",Jc,"No threads registered")):W("",!0),K.value.length>0?(x(),g("div",qc,[_[29]||(_[29]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),r("div",Gc,[(x(!0),g(ne,null,ve(K.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl overflow-hidden"},[r("div",Yc,[r("div",Zc,[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),d.value===i.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[5]||(_[5]=f=>m.value=f),onBlur:f=>pe(i.threadId),onKeyup:[_[6]||(_[6]=Qe(f=>f.target.blur(),["enter"])),_[7]||(_[7]=Qe(f=>d.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Qc)),[[re,m.value]]):(x(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:f=>Se(i),title:"Double-click to rename"},v(i.name),41,Xc)),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",eu,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,su)),64))],40,tu),r("span",nu,v(ct(i.lastActiveAt)),1),b.value===i.threadId?se((x(),g("input",{key:2,"onUpdate:modelValue":_[8]||(_[8]=f=>A.value=f),onKeyup:[Qe(f=>B(i.threadId),["enter"]),_[9]||(_[9]=Qe(f=>b.value=null,["escape"]))],onBlur:f=>B(i.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,ou)),[[re,A.value]]):(x(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+v(i.workingDirectory??"—"),41,ru)),r("div",lu,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,iu),r("div",au,[r("button",{onClick:f=>D(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,cu),_[23]||(_[23]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",uu,[r("button",{onClick:f=>ke(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,du),_[24]||(_[24]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",fu,[r("button",{onClick:f=>de(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,pu),_[25]||(_[25]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>J(i.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},v(l.value.has(i.threadId)?"▾ Children":"▸ Children"),9,mu),r("button",{onClick:f=>{H.value=H.value===i.threadId?null:i.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},w.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,hu),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,xu)])]),H.value===i.threadId?(x(),g("div",gu,[r("div",vu,[se(r("input",{"onUpdate:modelValue":_[10]||(_[10]=f=>C.value.name=f),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.name]]),se(r("input",{"onUpdate:modelValue":_[11]||(_[11]=f=>C.value.threadId=f),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.threadId,void 0,{number:!0}]]),se(r("select",{"onUpdate:modelValue":_[12]||(_[12]=f=>C.value.client=f),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,yu)),64))],512),[[Bt,C.value.client]])]),se(r("input",{"onUpdate:modelValue":_[13]||(_[13]=f=>C.value.workingDirectory=f),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,C.value.workingDirectory]]),r("div",bu,[r("button",{onClick:f=>_e(i.threadId),disabled:k.value||!C.value.name.trim()||!C.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},v(k.value?"Creating…":"Create Branch"),9,_u),w.value?(x(),g("span",{key:0,class:G([w.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},v(w.value),3)):W("",!0)])])):W("",!0)]),l.value.has(i.threadId)&&o.value[i.threadId]?(x(),g("div",wu,[o.value[i.threadId].length===0?(x(),g("div",ku,"No children")):W("",!0),(x(!0),g(ne,null,ve(o.value[i.threadId],f=>{var T,E;return x(),g("div",{key:f.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[r("span",{class:G(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(T=X[f.type])==null?void 0:T.classes])},v((E=X[f.type])==null?void 0:E.emoji)+" "+v(f.type.toUpperCase()),3),r("span",Su,v(f.name),1),r("span",{class:G(["text-xs",bt(f.status)])},v(f.status),3),r("span",$u,"ID: "+v(f.threadId),1),r("select",{value:f.client,onChange:M=>Ce(f,M.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,M=>r("option",{key:M,value:M},v(M),9,Tu)),64))],40,Cu),r("span",Au,v(ct(f.lastActiveAt)),1),f.type==="branch"&&b.value===f.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[14]||(_[14]=M=>A.value=M),onBlur:M=>B(f.threadId),onKeyup:[Qe(M=>B(f.threadId),["enter"]),_[15]||(_[15]=Qe(M=>b.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,Eu)),[[re,A.value]]):f.type==="branch"?(x(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(f.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:M=>le(f)},"📁 "+v(f.workingDirectory??"—"),41,Iu)):W("",!0),r("div",Pu,[r("button",{onClick:M=>It(f),disabled:S.value===f.threadId||f.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===f.threadId?"Starting…":"▶ Start"),9,Mu),f.rootThreadId?(x(),g("button",{key:0,onClick:M=>at(),disabled:O.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===f.threadId?"Syncing…":"⟳ Sync to Root"),9,Ou)):W("",!0),f.type==="branch"||f.type==="daily"?(x(),g("button",{key:1,onClick:M=>Pt(f),disabled:P.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Convert to independent root thread"},v(P.value===f.threadId?"Converting…":"↑ To Root"),9,Du)):W("",!0),f.type==="branch"?(x(),g("div",Ru,[r("button",{onClick:M=>D(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,ju),_[26]||(_[26]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):W("",!0),f.type==="branch"?(x(),g("div",Nu,[r("button",{onClick:M=>ke(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Lu),_[27]||(_[27]=r("span",{class:"text-xs text-muted"},"Daily",-1))])):W("",!0),f.type==="branch"?(x(),g("div",Uu,[r("button",{onClick:M=>de(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),_[28]||(_[28]=r("span",{class:"text-xs text-muted"},"Auto",-1))])):W("",!0),f.type!=="root"?(x(),g("button",{key:5,onClick:M=>ze(f),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Fu)):W("",!0)])])}),128))])):W("",!0)])}),128))])])):W("",!0),R.value.length>0?(x(),g("div",Bu,[_[30]||(_[30]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),r("div",Hu,[(x(!0),g(ne,null,ve(R.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",Ku,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",Wu,"ID: "+v(i.threadId),1),r("span",zu,v(i.client),1),r("span",Ju,v(ct(i.lastActiveAt)),1),r("div",qu,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,Gu),i.rootThreadId?(x(),g("button",{key:0,onClick:f=>at(),disabled:O.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,Yu)):W("",!0),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Zu)])])}),128))])])):W("",!0),z.value.length>0?(x(),g("div",Qu,[_[34]||(_[34]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),r("div",Xu,[(x(!0),g(ne,null,ve(z.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",ed,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",td,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,nd)),64))],40,sd),r("span",od,v(ct(i.lastActiveAt)),1),b.value===i.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[16]||(_[16]=f=>A.value=f),onBlur:f=>B(i.threadId),onKeyup:[Qe(f=>B(i.threadId),["enter"]),_[17]||(_[17]=Qe(f=>b.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,rd)),[[re,A.value]]):(x(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+v(i.workingDirectory??"—"),41,ld)),r("div",id,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,ad),i.rootThreadId?(x(),g("button",{key:0,onClick:f=>at(),disabled:O.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,cd)):W("",!0),r("div",ud,[r("button",{onClick:f=>D(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,dd),_[31]||(_[31]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",fd,[r("button",{onClick:f=>ke(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,pd),_[32]||(_[32]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",md,[r("button",{onClick:f=>de(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,hd),_[33]||(_[33]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,xd)])])}),128))])])):W("",!0),ue.value.length>0?(x(),g("div",gd,[_[36]||(_[36]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),r("div",vd,[(x(!0),g(ne,null,ve(ue.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",yd,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",bd,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,wd)),64))],40,_d),r("span",kd,v(ct(i.lastActiveAt)),1),_[35]||(_[35]=r("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):W("",!0)]))}}),$d={class:"animate-fade-in"},Cd={class:"glass rounded-xl p-6 mb-6"},Td={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ad={class:"flex items-center gap-3"},Ed={key:0,class:"text-center py-8 text-textSecondary text-sm"},Id={key:1,class:"text-center py-8 text-danger text-sm"},Pd={key:2,class:"text-center text-textSecondary py-12"},Md={key:3,class:"space-y-2"},Od={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Dd={class:"flex items-center justify-between gap-3"},Rd={class:"flex items-center gap-2 min-w-0"},jd={class:"flex items-center justify-between gap-3"},Nd={class:"flex-1 min-w-0"},Ld={class:"flex items-center gap-2 mb-1"},Ud={class:"font-medium text-sm font-mono"},Vd={class:"text-xs text-muted font-mono truncate"},Fd={class:"flex items-center gap-2 shrink-0"},Bd=["onClick"],Hd=["onClick","disabled"],Kd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Wd={class:"text-lg font-semibold mb-4"},zd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Jd=["readonly"],qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Gd={class:"mb-4"},Yd={class:"flex items-center justify-between mb-2"},Zd=["onUpdate:modelValue"],Qd=["onUpdate:modelValue"],Xd=["onClick"],ef={key:0,class:"text-xs text-muted italic"},tf={class:"mb-4"},sf={class:"mb-4"},nf={class:"flex items-center justify-between mb-2"},of=["onUpdate:modelValue"],rf=["onUpdate:modelValue"],lf=["onClick"],af={key:0,class:"text-xs text-muted italic"},cf={class:"flex items-center gap-3 flex-wrap"},uf=["disabled"],df={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ff=it({__name:"McpServersTab",setup(e){const t=$({}),s=$(!0),n=$(""),o=$(""),l=$(!0),a=$(!1),c=$(null),u=$(!1),h=$(null),d=$(""),m=$("stdio"),b=$(""),A=$(""),H=$(""),C=$([]),w=$([]),k=$(""),S=Re(()=>Object.entries(t.value).filter(([F])=>F!==Gt));async function O(){s.value=!0,n.value="";try{const F=await be("/api/mcp-servers");t.value=F.servers||{}}catch(F){n.value="Failed to load MCP servers: "+F.message}finally{s.value=!1}}function P(F){return F==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function Z(){h.value=null,d.value="",m.value="stdio",b.value="",A.value="",H.value="",C.value=[],w.value=[],k.value="",u.value=!0}function X(F,L){h.value=F,d.value=F,m.value=L.type,b.value=L.command||"",A.value=(L.args||[]).join(" "),H.value=L.url||"",C.value=Object.entries(L.env||{}).map(([J,oe])=>({k:J,v:oe})),w.value=Object.entries(L.headers||{}).map(([J,oe])=>({k:J,v:oe})),k.value="",u.value=!0}function K(){u.value=!1,h.value=null}function R(){if(k.value="",!d.value.trim())return k.value="Name is required",!1;if(m.value==="stdio"&&!b.value.trim())return k.value="Command is required for stdio type",!1;if(m.value==="http"){const F=H.value.trim();if(!F)return k.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(F))return k.value="URL must start with http:// or https://",!1}return!0}async function z(){if(!R()||a.value)return;a.value=!0;const F=d.value.trim(),L={type:m.value};if(m.value==="stdio"){L.command=b.value.trim();const J=A.value.trim();J&&(L.args=J.split(/\s+/));const oe=Object.fromEntries(C.value.filter(_e=>_e.k.trim()).map(_e=>[_e.k.trim(),_e.v]));Object.keys(oe).length&&(L.env=oe)}else{L.url=H.value.trim();const J=Object.fromEntries(w.value.filter(oe=>oe.k.trim()).map(oe=>[oe.k.trim(),oe.v]));Object.keys(J).length&&(L.headers=J)}try{const J=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({name:F,config:L})});if(!J.ok)throw new Error(J.statusText);o.value="Saved ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),K(),await O()}catch(J){k.value="Error: "+J.message}finally{a.value=!1}}async function ue(F){if(confirm(`Delete MCP server "${F}"?`)&&!c.value){c.value=F;try{const L=await fetch(`/api/mcp-servers/${encodeURIComponent(F)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!L.ok)throw new Error(L.statusText);o.value="Deleted ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),await O()}catch(L){o.value="Error: "+L.message,l.value=!1}finally{c.value=null}}}return We(O),(F,L)=>(x(),g("div",$d,[r("div",Cd,[r("div",Td,[L[7]||(L[7]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"MCP Servers"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),r("div",Ad,[o.value?(x(),g("span",{key:0,class:G(["text-sm",l.value?"text-success":"text-danger"])},v(o.value),3)):W("",!0),r("button",{onClick:Z,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(x(),g("div",Ed,"Loading...")):n.value?(x(),g("div",Id,v(n.value),1)):Object.keys(t.value).length===0?(x(),g("div",Pd,"No MCP servers configured")):(x(),g("div",Md,[t.value[Gt]?(x(),g("div",Od,[r("div",Dd,[r("div",Rd,[r("span",{class:"font-medium text-sm font-mono"},v(Gt)),r("span",{class:"type-badge",style:Lt(P(t.value[Gt].type))},v(t.value[Gt].type),5),L[8]||(L[8]=r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),L[9]||(L[9]=r("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):W("",!0),(x(!0),g(ne,null,ve(S.value,([J,oe])=>{var _e;return x(),g("div",{key:J,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",jd,[r("div",Nd,[r("div",Ld,[r("span",Ud,v(J),1),r("span",{class:"type-badge",style:Lt(P(oe.type))},v(oe.type),5)]),r("div",Vd,[oe.type==="stdio"?(x(),g(ne,{key:0},[we(v(oe.command)+v((_e=oe.args)!=null&&_e.length?" "+oe.args.join(" "):""),1)],64)):(x(),g(ne,{key:1},[we(v(oe.url),1)],64))])]),r("div",Fd,[r("button",{onClick:Se=>X(J,oe),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},"Edit",8,Bd),r("button",{onClick:Se=>ue(J),disabled:c.value===J,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50"},v(c.value===J?"…":"Delete"),9,Hd)])])])}),128))]))]),u.value?(x(),g("div",Kd,[r("h3",Wd,v(h.value?`Edit: ${h.value}`:"Add MCP Server"),1),r("div",zd,[r("div",null,[L[10]||(L[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Name "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[0]||(L[0]=J=>d.value=J),type:"text",readonly:!!h.value,placeholder:"my-server",class:G(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",h.value?"opacity-60 cursor-not-allowed":""])},null,10,Jd),[[re,d.value]])]),r("div",null,[L[12]||(L[12]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Type "),r("span",{class:"text-danger"},"*")],-1)),se(r("select",{"onUpdate:modelValue":L[1]||(L[1]=J=>m.value=J),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...L[11]||(L[11]=[r("option",{value:"stdio"},"stdio",-1),r("option",{value:"http"},"http",-1)])],512),[[Bt,m.value]])])]),m.value==="stdio"?(x(),g(ne,{key:0},[r("div",qd,[r("div",null,[L[13]||(L[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Command "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[2]||(L[2]=J=>b.value=J),type:"text",placeholder:"node",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,b.value]])]),r("div",null,[L[14]||(L[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),se(r("input",{"onUpdate:modelValue":L[3]||(L[3]=J=>A.value=J),type:"text",placeholder:"./server.js --port 3000",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,A.value]])])]),r("div",Gd,[r("div",Yd,[L[15]||(L[15]=r("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),r("button",{onClick:L[4]||(L[4]=J=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),g(ne,null,ve(C.value,(J,oe)=>(x(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[se(r("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"KEY",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Zd),[[re,J.k]]),L[16]||(L[16]=r("span",{class:"text-muted text-xs"},"=",-1)),se(r("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Qd),[[re,J.v]]),r("button",{onClick:_e=>C.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Xd)]))),128)),C.value.length===0?(x(),g("div",ef,"No env vars")):W("",!0)])],64)):(x(),g(ne,{key:1},[r("div",tf,[L[17]||(L[17]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("URL "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[5]||(L[5]=J=>H.value=J),type:"text",placeholder:"http://localhost:3000/mcp",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,H.value]])]),r("div",sf,[r("div",nf,[L[18]||(L[18]=r("label",{class:"text-xs text-textSecondary"},"Headers",-1)),r("button",{onClick:L[6]||(L[6]=J=>w.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),g(ne,null,ve(w.value,(J,oe)=>(x(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[se(r("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"Header-Name",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,of),[[re,J.k]]),L[19]||(L[19]=r("span",{class:"text-muted text-xs"},":",-1)),se(r("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,rf),[[re,J.v]]),r("button",{onClick:_e=>w.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,lf)]))),128)),w.value.length===0?(x(),g("div",af,"No headers")):W("",!0)])],64)),r("div",cf,[r("button",{onClick:z,disabled:a.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(a.value?"Saving…":h.value?"Save Changes":"Add Server"),9,uf),r("button",{onClick:K,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," Cancel "),k.value?(x(),g("span",df,v(k.value),1)):W("",!0)])])):W("",!0)]))}}),pf={class:"animate-fade-in"},mf={class:"glass rounded-xl p-6 mb-6"},hf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},xf={class:"flex items-center gap-3"},gf=["disabled"],vf={key:0,class:"text-center py-8 text-textSecondary text-sm"},yf={key:1,class:"space-y-6"},bf={class:"glass rounded-xl p-4 border border-gray-700/50"},_f={class:"flex items-center gap-4"},wf={class:"flex justify-between text-xs text-muted mt-2"},kf={class:"font-mono"},Sf={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},$f={class:"glass rounded-xl p-4 border border-gray-700/50"},Cf={class:"flex items-center gap-4"},Tf={class:"flex justify-between text-xs text-muted mt-2"},Af={class:"font-mono"},Ef={class:"glass rounded-xl p-4 border border-gray-700/50"},If={class:"glass rounded-xl p-4 border border-gray-700/50"},Pf={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Mf={class:"grid grid-cols-2 gap-4"},Of={class:"text-sm font-medium text-textSecondary"},Df={class:"text-sm font-medium font-mono text-textSecondary"},Rf={class:"text-sm font-medium font-mono text-textSecondary"},jf={class:"mt-3"},Nf=it({__name:"SettingsTab",setup(e){const t=$(!0),s=$(!1),n=$(""),o=$(50),l=$(50),a=$(1440),c=$(1440),u=$("claude-opus-4-6"),h=$("claude-opus-4-6"),d=$("claude-sonnet-4-5"),m=$("claude-sonnet-4-5"),b=Re(()=>o.value!==l.value||a.value!==c.value||u.value!==h.value||d.value!==m.value);async function A(){t.value=!0;try{const[C,w,k,S]=await Promise.all([be("/api/settings/bootstrap-message-count"),be("/api/settings/wait-timeout"),be("/api/settings/default-thread-model"),be("/api/settings/default-worker-model")]);o.value=C.count,l.value=C.count,a.value=w.minutes,c.value=w.minutes,u.value=k.defaultThreadModel,h.value=k.defaultThreadModel,d.value=S.defaultWorkerModel,m.value=S.defaultWorkerModel}finally{t.value=!1}}async function H(){if(s.value=!0,n.value="",!u.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!d.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}try{const C={Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},[w,k,S,O]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:C,body:JSON.stringify({count:o.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:C,body:JSON.stringify({minutes:a.value})}),fetch("/api/settings/default-thread-model",{method:"POST",headers:C,body:JSON.stringify({model:u.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:C,body:JSON.stringify({model:d.value})})]);for(const R of[w,k,S,O])if(!R.ok){const z=await R.json().catch(()=>({error:R.statusText}));throw new Error(z.error??R.statusText)}const P=await w.json(),Z=await k.json(),X=await S.json(),K=await O.json();l.value=P.count,o.value=P.count,c.value=Z.minutes,a.value=Z.minutes,h.value=X.defaultThreadModel,u.value=X.defaultThreadModel,m.value=K.defaultWorkerModel,d.value=K.defaultWorkerModel,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(C){n.value="Error: "+C.message}finally{s.value=!1}}return We(A),(C,w)=>(x(),g("div",pf,[r("div",mf,[r("div",hf,[w[6]||(w[6]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Settings"),r("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),r("div",xf,[n.value?(x(),g("span",{key:0,class:G([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},v(n.value),3)):W("",!0),r("button",{onClick:H,disabled:s.value||t.value||!b.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(s.value?"Saving…":"Save"),9,gf)])]),t.value?(x(),g("div",vf,"Loading…")):(x(),g("div",yf,[r("div",bf,[w[10]||(w[10]=r("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),w[11]||(w[11]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Number of recent messages injected into the agent's bootstrap context. Set to "),r("span",{class:"font-mono text-accentLight"},"0"),we(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),r("div",_f,[se(r("input",{"onUpdate:modelValue":w[0]||(w[0]=k=>o.value=k),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[re,o.value,void 0,{number:!0}]]),se(r("input",{"onUpdate:modelValue":w[1]||(w[1]=k=>o.value=k),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,o.value,void 0,{number:!0}]])]),r("div",wf,[w[7]||(w[7]=r("span",null,"Off",-1)),r("span",kf,v(o.value)+" messages",1),w[8]||(w[8]=r("span",null,"Max",-1))]),o.value===0?(x(),g("div",Sf,[...w[9]||(w[9]=[we(" Message buffer injection is ",-1),r("strong",null,"disabled",-1),we(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):W("",!0)]),r("div",$f,[w[14]||(w[14]=r("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),w[15]||(w[15]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Maximum time (in minutes) a single "),r("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),we(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),r("div",Cf,[se(r("input",{"onUpdate:modelValue":w[2]||(w[2]=k=>a.value=k),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[re,a.value,void 0,{number:!0}]]),se(r("input",{"onUpdate:modelValue":w[3]||(w[3]=k=>a.value=k),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,a.value,void 0,{number:!0}]])]),r("div",Tf,[w[12]||(w[12]=r("span",null,"1 min",-1)),r("span",Af,v(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),w[13]||(w[13]=r("span",null,"24h",-1))])]),r("div",Ef,[w[16]||(w[16]=r("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),w[17]||(w[17]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),we(" env var if set. ")],-1)),se(r("input",{"onUpdate:modelValue":w[4]||(w[4]=k=>u.value=k),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,u.value,void 0,{trim:!0}]])]),r("div",If,[w[18]||(w[18]=r("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),w[19]||(w[19]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a worker Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),we(" env var if set. ")],-1)),se(r("input",{"onUpdate:modelValue":w[5]||(w[5]=k=>d.value=k),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value,void 0,{trim:!0}]])]),r("div",Pf,[w[24]||(w[24]=r("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),r("div",Mf,[r("div",null,[w[20]||(w[20]=r("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),r("span",{class:G(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},v(l.value>0?`${l.value} messages`:"Disabled"),3)]),r("div",null,[w[21]||(w[21]=r("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),r("span",Of,v(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)]),r("div",null,[w[22]||(w[22]=r("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),r("span",Df,v(h.value),1)]),r("div",null,[w[23]||(w[23]=r("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),r("span",Rf,v(m.value),1)])]),r("div",jf,[r("span",{class:G(["text-sm font-medium",b.value?"text-warn":"text-textSecondary"])},v(b.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Lf={class:"animate-fade-in"},Uf={class:"glass rounded-xl p-6 mb-6"},Vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ff={class:"flex flex-wrap gap-3 items-center"},Bf=["disabled"],Hf={key:0,class:"flex items-center gap-2"},Kf={key:1},Wf={class:"glass rounded-xl p-6"},zf={key:0,class:"text-center py-8 text-textSecondary text-sm"},Jf={key:1,class:"text-center py-12 text-textSecondary text-sm"},qf={key:2,class:"space-y-2"},Gf={class:"flex items-center justify-between gap-3"},Yf={class:"flex-1 min-w-0"},Zf={class:"flex flex-wrap items-center gap-2 mb-1"},Qf={class:"font-medium text-sm font-mono"},Xf={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},ep={class:"text-xs text-muted"},tp={class:"text-xs text-muted"},sp=["onClick","disabled"],np={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},op={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},rp={class:"text-sm text-textSecondary mb-4"},lp={class:"font-mono text-textPrimary"},ip=it({__name:"SnapshotsTab",setup(e){const t=$([]),s=$(!0),n=$(!1),o=$(null),l=$(""),a=$(""),c=$(!0),u=$(null);function h(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}function d(k){try{return new Date(k).toLocaleString()}catch{return k}}function m(k,S){a.value=k,c.value=S,setTimeout(()=>{a.value=""},4e3)}async function b(){s.value=!0;try{const k=await be("/api/snapshots");t.value=k.snapshots}catch(k){m("Failed to load snapshots: "+k.message,!1)}finally{s.value=!1}}async function A(){if(!n.value){n.value=!0;try{await be("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await b()}catch(k){m("Error: "+k.message,!1)}finally{n.value=!1}}}function H(k){u.value=k}function C(){u.value=null}async function w(){const k=u.value;if(!(!k||o.value)){u.value=null,o.value=k;try{await be(`/api/snapshots/${encodeURIComponent(k)}`,{method:"DELETE"}),m("Deleted ✓",!0),await b()}catch(S){m("Error: "+S.message,!1)}finally{o.value=null}}}return We(b),(k,S)=>(x(),g("div",Lf,[r("div",Uf,[r("div",Vf,[S[1]||(S[1]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Snapshots"),r("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(x(),g("span",{key:0,class:G(["text-sm",c.value?"text-success":"text-danger"])},v(a.value),3)):W("",!0)]),r("div",Ff,[se(r("input",{"onUpdate:modelValue":S[0]||(S[0]=O=>l.value=O),type:"text",placeholder:"Description (optional)",class:"flex-1 min-w-48 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition",onKeydown:Qe(A,["enter"])},null,544),[[re,l.value]]),r("button",{onClick:A,disabled:n.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition whitespace-nowrap"},[n.value?(x(),g("span",Hf,[...S[2]||(S[2]=[r("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),we(" Creating… ",-1)])])):(x(),g("span",Kf,"+ Create Snapshot"))],8,Bf)])]),r("div",Wf,[s.value?(x(),g("div",zf,"Loading…")):t.value.length===0?(x(),g("div",Jf,"No snapshots yet")):(x(),g("div",qf,[(x(!0),g(ne,null,ve(t.value,O=>(x(),g("div",{key:O.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",Gf,[r("div",Yf,[r("div",Zf,[r("span",Qf,v(O.name),1),r("span",Xf,"v"+v(O.mcpVersion),1),r("span",ep,v(h(O.sizeBytes)),1)]),r("div",tp,[we(v(d(O.createdAt)),1),O.description?(x(),g(ne,{key:0},[we(" · "+v(O.description),1)],64)):W("",!0)])]),r("button",{onClick:P=>H(O.name),disabled:o.value===O.name,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50 shrink-0"},v(o.value===O.name?"…":"Delete"),9,sp)])]))),128))]))]),u.value?(x(),g("div",np,[r("div",op,[S[5]||(S[5]=r("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),r("p",rp,[S[3]||(S[3]=we(" Delete ",-1)),r("span",lp,v(u.value),1),S[4]||(S[4]=we("? This cannot be undone. ",-1))]),r("div",{class:"flex gap-3"},[r("button",{onClick:w,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),r("button",{onClick:C,class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel")])])])):W("",!0)]))}}),ap={class:"animate-fade-in space-y-6"},cp={class:"glass rounded-xl p-6"},up={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},dp={class:"text-sm text-textSecondary mt-1"},fp={class:"flex items-center gap-3"},pp={key:0,class:"text-xs text-accentLight animate-pulse"},mp={key:0,class:"flex flex-wrap gap-2 mt-3"},hp=["onClick"],xp={class:"ml-1 opacity-60"},gp={key:0,class:"text-center py-12 text-textSecondary"},vp={key:1,class:"text-center py-8 text-danger text-sm"},yp={key:2,class:"text-center py-12 text-textSecondary"},bp={key:3,class:"space-y-3"},_p={class:"flex flex-wrap items-start gap-3"},wp={class:"flex-1 min-w-0 space-y-2"},kp={class:"flex flex-wrap items-center gap-2"},Sp={class:"font-semibold truncate"},$p={class:"text-xs text-muted font-mono"},Cp={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},Tp={title:"Created"},Ap={title:"Archived"},Ep={key:0,class:"text-muted"},Ip={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},Pp={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},Mp={class:"flex items-center gap-2 shrink-0"},Op=["onClick","disabled"],Dp=3,Rp=it({__name:"ArchivedThreadsTab",setup(e){const t=$([]),s=$(!0),n=$(""),o=$({}),l=$({}),a=$({done:0,total:0}),c=$(null),u=$("all");let h=0;const d={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"}},m=Re(()=>u.value==="all"?t.value:t.value.filter(S=>S.type===u.value)),b=Re(()=>{const S={all:t.value.length};for(const O of t.value)S[O.type]=(S[O.type]??0)+1;return S}),A=Re(()=>Object.values(l.value).some(Boolean));async function H(){s.value=!0,n.value="";try{const S=await be("/api/threads/archived");t.value=S.threads??[],o.value={},l.value={},t.value.length>0&&C()}catch(S){n.value=S.message||"Failed to load archived threads"}finally{s.value=!1}}async function C(){const S=++h,O=[...t.value];a.value={done:0,total:O.length};async function P(){for(;O.length>0&&S===h;){const X=O.shift();l.value={...l.value,[X.threadId]:!0};try{const K=await fetch(`/api/threads/${X.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(S!==h)return;if(K.ok){const R=await K.json();R.summary&&(o.value={...o.value,[X.threadId]:R.summary})}}catch{}finally{if(S===h){const{[X.threadId]:K,...R}=l.value;l.value=R,a.value={...a.value,done:a.value.done+1}}}}}const Z=Array.from({length:Math.min(Dp,O.length)},()=>P());await Promise.all(Z)}function w(S){if(!S)return"—";const O=new Date(S),Z=Date.now()-O.getTime(),X=Math.floor(Z/6e4),K=Math.floor(Z/36e5),R=Math.floor(Z/864e5),z=Math.floor(R/30);return X<1?"just now":X<60?`${X}m ago`:K<24?`${K}h ago`:R<30?`${R}d ago`:z<12?`${z}mo ago`:`${Math.floor(z/12)}y ago`}async function k(S){if(confirm(`Unarchive thread "${S.name}" (${S.threadId})?`)){c.value=S.threadId;try{const O=await fetch(`/api/threads/${S.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!O.ok){const P=await O.json().catch(()=>({error:O.statusText}));throw new Error(P.error??O.statusText)}await H()}catch(O){n.value="Failed to unarchive: "+O.message}finally{c.value=null}}}return We(H),(S,O)=>(x(),g("div",ap,[r("div",cp,[r("div",up,[r("div",null,[O[0]||(O[0]=r("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),r("p",dp,v(t.value.length)+" archived thread"+v(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),r("div",fp,[A.value?(x(),g("span",pp," Building summaries… "+v(a.value.done)+"/"+v(a.value.total),1)):W("",!0),r("button",{onClick:H,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(x(),g("div",mp,[(x(),g(ne,null,ve(["all","root","branch","daily"],P=>r("button",{key:P,onClick:Z=>u.value=P,class:G(["px-3 py-1 rounded-full text-xs font-medium border transition",u.value===P?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[we(v(P==="all"?"All":P.charAt(0).toUpperCase()+P.slice(1))+" ",1),r("span",xp,"("+v(b.value[P]??0)+")",1)],10,hp)),64))])):W("",!0)]),s.value&&t.value.length===0?(x(),g("div",gp,"Loading archived threads…")):n.value?(x(),g("div",vp,v(n.value),1)):t.value.length===0?(x(),g("div",yp,"No archived threads")):W("",!0),m.value.length>0?(x(),g("div",bp,[(x(!0),g(ne,null,ve(m.value,P=>{var Z,X;return x(),g("div",{key:P.id,class:"glass rounded-xl p-4"},[r("div",_p,[r("div",wp,[r("div",kp,[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(Z=d[P.type])==null?void 0:Z.classes])},v((X=d[P.type])==null?void 0:X.emoji)+" "+v(P.type.toUpperCase()),3),r("span",Sp,v(P.name),1),r("span",$p,"ID: "+v(P.threadId),1)]),r("div",Cp,[r("span",Tp,"Created "+v(w(P.createdAt)),1),r("span",Ap,"Archived "+v(w(P.archivedAt??P.lastActiveAt)),1),P.client?(x(),g("span",Ep,v(P.client),1)):W("",!0)]),o.value[P.threadId]?(x(),g("div",Ip,v(o.value[P.threadId]),1)):l.value[P.threadId]?(x(),g("div",Pp," Generating summary… ")):W("",!0)]),r("div",Mp,[r("button",{onClick:K=>k(P),disabled:c.value===P.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition"},v(c.value===P.threadId?"Restoring…":"↩ Unarchive"),9,Op)])])])}),128))])):W("",!0)]))}}),jp={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Np={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},Lp=["disabled"],Up={key:0,class:"mt-3 text-sm text-danger"},Vp={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Fp={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Bp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Hp={class:"flex items-center gap-4"},Kp={class:"text-sm text-textSecondary font-mono"},Wp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},zp={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},Jp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},qp={class:"text-2xl font-bold font-mono"},Gp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Yp={class:"text-2xl font-bold font-mono"},Zp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Qp={class:"text-2xl font-bold font-mono"},Xp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},em={class:"flex items-center gap-2 mb-2"},tm={class:"text-2xl font-bold font-mono"},sm={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},nm={class:"text-2xl font-bold font-mono"},om={class:"max-w-7xl mx-auto px-4 sm:px-6"},rm={class:"flex gap-6 border-b border-gray-800/50 mb-6"},lm=["onClick"],im={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},xs="sensorium_token",am=it({__name:"App",setup(e){const t=$(!1),s=$(""),n=$(""),o=$(!1),l=$(null),a=$("sessions");let c=null;const u=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"settings",label:"Settings"}],h={sessions:ra,notes:ka,templates:nc,skills:Rc,threads:Sd,archived:Rp,mcp:ff,snapshots:ip,settings:Nf},d=Re(()=>h[a.value]),m=Re(()=>{if(!l.value)return"—";const w=Math.floor(l.value.uptime),k=Math.floor(w/86400),S=Math.floor(w%86400/3600),O=Math.floor(w%3600/60);return k>0?`${k}d ${S}h`:S>0?`${S}h ${O}m`:`${O}m`});async function b(){const w=s.value.trim()||"no-auth";o.value=!0,n.value="";try{qt(w),await H(),localStorage.setItem(xs,w),t.value=!0,C()}catch(k){const S=k;S.status===401?n.value="Invalid token":n.value=S.message??"Connection failed",qt("")}finally{o.value=!1}}function A(){localStorage.removeItem(xs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function H(){l.value=await be("/api/status")}function C(){c&&clearInterval(c),c=setInterval(H,3e4)}return We(async()=>{const w=localStorage.getItem(xs);if(w){s.value=w;try{qt(w),await H(),t.value=!0,C()}catch{localStorage.removeItem(xs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(w,k)=>{var S,O,P,Z,X,K,R,z,ue;return t.value?(x(),g("div",Vp,[r("header",Fp,[r("div",Bp,[k[3]||(k[3]=et('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),r("div",Hp,[k[2]||(k[2]=r("div",{class:"flex items-center gap-2 text-sm"},[r("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),r("span",{class:"text-textSecondary"},"Connected")],-1)),r("div",Kp,v(m.value),1),r("button",{onClick:A,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),r("div",Wp,[r("div",zp,[r("div",Jp,[k[4]||(k[4]=et('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),r("div",qp,v(((S=l.value)==null?void 0:S.activeSessions)??0),1)]),r("div",Gp,[k[5]||(k[5]=et('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),r("div",Yp,v(((P=(O=l.value)==null?void 0:O.memory)==null?void 0:P.totalSemanticNotes)??0),1)]),r("div",Zp,[k[6]||(k[6]=et('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),r("div",Qp,v(((X=(Z=l.value)==null?void 0:Z.memory)==null?void 0:X.totalEpisodes)??0),1)]),r("div",Xp,[r("div",em,[r("span",{class:G((((R=(K=l.value)==null?void 0:K.memory)==null?void 0:R.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...k[7]||(k[7]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),k[8]||(k[8]=r("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),r("div",tm,v(((ue=(z=l.value)==null?void 0:z.memory)==null?void 0:ue.unconsolidatedEpisodes)??0),1)]),r("div",sm,[k[9]||(k[9]=et('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),r("div",nm,v(m.value),1)])])]),r("div",om,[r("nav",rm,[(x(),g(ne,null,ve(u,F=>r("button",{key:F.id,onClick:L=>a.value=F.id,class:G(["pb-3 text-sm font-medium transition",a.value===F.id?"tab-active":"tab-inactive"])},v(F.label),11,lm)),64))])]),r("div",im,[(x(),fr(El(d.value),{status:l.value},null,8,["status"]))])])):(x(),g("div",jp,[r("div",Np,[k[1]||(k[1]=et('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),se(r("input",{"onUpdate:modelValue":k[0]||(k[0]=F=>s.value=F),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Qe(b,["enter"])},null,544),[[re,s.value]]),r("button",{onClick:b,disabled:o.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},v(o.value?"Connecting...":"Connect"),9,Lp),n.value?(x(),g("p",Up,v(n.value),1)):W("",!0)])]))}}});Bi(am).mount("#app");</script>
73
73
  <style rel="stylesheet" crossorigin>body{background:#0f1419}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:#1a1f2e}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#4b5563}.glass{background:#1a1f2ecc;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid rgba(99,102,241,.1)}.stat-glow{box-shadow:0 0 20px #6366f114}.priority-2{border-left:3px solid #ef4444}.priority-1{border-left:3px solid #f59e0b}.priority-0{border-left:3px solid transparent}.type-badge{font-size:.65rem;padding:2px 6px;border-radius:9999px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.type-fact{background:#3b82f626;color:#60a5fa}.type-preference{background:#a855f726;color:#c084fc}.type-pattern{background:#22c55e26;color:#4ade80}.type-entity{background:#fbbf2426;color:#fbbf24}.type-relationship{background:#f472b626;color:#f472b6}.tab-active{border-bottom:2px solid #6366f1;color:#e5e7eb}.tab-inactive{border-bottom:2px solid transparent;color:#6b7280}.tab-inactive:hover{color:#9ca3af}</style>
74
74
  </head>
75
75
  <body class="font-sans text-textPrimary min-h-screen">