sensorium-mcp 3.0.91 → 3.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +15 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +42 -0
- package/dist/config.js.map +1 -1
- package/dist/dashboard/presets.d.ts.map +1 -1
- package/dist/dashboard/presets.js +3 -0
- package/dist/dashboard/presets.js.map +1 -1
- package/dist/dashboard/routes/skills.d.ts +3 -0
- package/dist/dashboard/routes/skills.d.ts.map +1 -1
- package/dist/dashboard/routes/skills.js +63 -0
- package/dist/dashboard/routes/skills.js.map +1 -1
- package/dist/dashboard/routes/threads.d.ts.map +1 -1
- package/dist/dashboard/routes/threads.js +1 -0
- package/dist/dashboard/routes/threads.js.map +1 -1
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +4 -1
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/dashboard/spa.html +11 -11
- package/dist/data/memory/bootstrap.d.ts +0 -1
- package/dist/data/memory/bootstrap.d.ts.map +1 -1
- package/dist/data/memory/bootstrap.js +0 -15
- package/dist/data/memory/bootstrap.js.map +1 -1
- package/dist/data/memory/thread-registry.d.ts +7 -4
- package/dist/data/memory/thread-registry.d.ts.map +1 -1
- package/dist/data/memory/thread-registry.js +12 -6
- package/dist/data/memory/thread-registry.js.map +1 -1
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +41 -10
- package/dist/http-server.js.map +1 -1
- package/dist/integrations/openai/speech.d.ts +8 -2
- package/dist/integrations/openai/speech.d.ts.map +1 -1
- package/dist/integrations/openai/speech.js +15 -6
- package/dist/integrations/openai/speech.js.map +1 -1
- package/dist/intent.d.ts.map +1 -1
- package/dist/intent.js +38 -2
- package/dist/intent.js.map +1 -1
- package/dist/server/factory.d.ts.map +1 -1
- package/dist/server/factory.js +34 -3
- package/dist/server/factory.js.map +1 -1
- package/dist/services/agent-spawn.service.d.ts.map +1 -1
- package/dist/services/agent-spawn.service.js +4 -2
- package/dist/services/agent-spawn.service.js.map +1 -1
- package/dist/services/claude-spawn.service.d.ts +1 -1
- package/dist/services/claude-spawn.service.d.ts.map +1 -1
- package/dist/services/claude-spawn.service.js +6 -4
- package/dist/services/claude-spawn.service.js.map +1 -1
- package/dist/services/keeper.service.d.ts.map +1 -1
- package/dist/services/keeper.service.js +7 -6
- package/dist/services/keeper.service.js.map +1 -1
- package/dist/services/memory-briefing.service.d.ts.map +1 -1
- package/dist/services/memory-briefing.service.js +3 -8
- package/dist/services/memory-briefing.service.js.map +1 -1
- package/dist/services/process.service.d.ts +6 -0
- package/dist/services/process.service.d.ts.map +1 -1
- package/dist/services/process.service.js +81 -1
- package/dist/services/process.service.js.map +1 -1
- package/dist/services/spawn-common.d.ts.map +1 -1
- package/dist/services/spawn-common.js +79 -4
- package/dist/services/spawn-common.js.map +1 -1
- package/dist/services/topic.service.d.ts +1 -0
- package/dist/services/topic.service.d.ts.map +1 -1
- package/dist/services/topic.service.js +7 -3
- package/dist/services/topic.service.js.map +1 -1
- package/dist/services/worker-cleanup.service.d.ts +1 -0
- package/dist/services/worker-cleanup.service.d.ts.map +1 -1
- package/dist/services/worker-cleanup.service.js +159 -19
- package/dist/services/worker-cleanup.service.js.map +1 -1
- package/dist/sessions.d.ts +21 -0
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +56 -0
- package/dist/sessions.js.map +1 -1
- package/dist/tools/defs/session-defs.d.ts.map +1 -1
- package/dist/tools/defs/session-defs.js +2 -1
- package/dist/tools/defs/session-defs.js.map +1 -1
- package/dist/tools/delegate-tool.d.ts.map +1 -1
- package/dist/tools/delegate-tool.js +34 -0
- package/dist/tools/delegate-tool.js.map +1 -1
- package/dist/tools/start-session-tool.js +5 -5
- package/dist/tools/start-session-tool.js.map +1 -1
- package/dist/tools/wait/message-delivery.d.ts.map +1 -1
- package/dist/tools/wait/message-delivery.js +10 -3
- package/dist/tools/wait/message-delivery.js.map +1 -1
- package/dist/tools/wait/poll-loop.d.ts.map +1 -1
- package/dist/tools/wait/poll-loop.js +5 -1
- package/dist/tools/wait/poll-loop.js.map +1 -1
- package/package.json +1 -1
- package/templates/fire-and-forget.default.md +2 -2
- package/templates/{delegate-and-wait.default.md → handoff.default.md} +7 -5
- package/templates/offload.default.md +33 -0
- package/templates/swarm.default.md +41 -0
- package/templates/plan-mode.default.md +0 -29
package/dist/dashboard/spa.html
CHANGED
|
@@ -45,31 +45,31 @@
|
|
|
45
45
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
46
46
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
47
47
|
|
|
48
|
-
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))
|
|
48
|
+
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function s(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(r){if(r.ep)return;r.ep=!0;const l=s(r);fetch(r.href,l)}})();/**
|
|
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
|
|
52
|
+
**/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const be={},Rt=[],nt=()=>{},po=()=>!1,Ps=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,fe=(e,t)=>yr.call(e,t),ne=Array.isArray,jt=e=>us(e)==="[object Map]",Ft=e=>us(e)==="[object Set]",An=e=>us(e)==="[object Date]",ae=e=>typeof e=="function",Se=e=>typeof e=="string",rt=e=>typeof e=="symbol",he=e=>e!==null&&typeof e=="object",mo=e=>(he(e)||ae(e))&&ae(e.then)&&ae(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),br=e=>us(e).slice(8,-1),vo=e=>us(e)==="[object Object]",un=e=>Se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=an(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),As=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=As(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,$t=As(e=>e.replace(wr,"-$1").toLowerCase()),Is=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=As(e=>e?`on${Is(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,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:s})},Os=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let In;const Ms=()=>In||(In=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(e){if(ne(e)){const t={};for(let s=0;s<e.length;s++){const o=e[s],r=Se(o)?Cr(o):It(o);if(r)for(const l in r)t[l]=r[l]}return t}else if(Se(e)||he(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 o=s.split(Sr);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Y(e){let t="";if(Se(e))t=e;else if(ne(e))for(let s=0;s<e.length;s++){const o=Y(e[s]);o&&(t+=o+" ")}else if(he(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Pr=an(Tr);function ho(e){return!!e||e===""}function Er(e,t){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Ht(e[o],t[o]);return s}function Ht(e,t){if(e===t)return!0;let s=An(e),o=An(t);if(s||o)return s&&o?e.getTime()===t.getTime():!1;if(s=rt(e),o=rt(t),s||o)return e===t;if(s=ne(e),o=ne(t),s||o)return s&&o?Er(e,t):!1;if(s=he(e),o=he(t),s||o){if(!s||!o)return!1;const r=Object.keys(e).length,l=Object.keys(t).length;if(r!==l)return!1;for(const a in e){const c=e.hasOwnProperty(a),d=t.hasOwnProperty(a);if(c&&!d||!c&&d||!Ht(e[a],t[a]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Ht(s,t))}const yo=e=>!!(e&&e.__v_isRef===!0),y=e=>Se(e)?e:e==null?"":ne(e)||he(e)&&(e.toString===xo||!ae(e.toString))?yo(e)?y(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>yo(t)?bo(e,t.value):jt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[o,r],l)=>(s[Bs(o,l)+" =>"]=r,s),{})}:Ft(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Bs(s))}:rt(t)?Bs(t):he(t)&&!ne(t)&&!vo(t)?String(t):t,Bs=(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 je;class Ar{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=je,!t&&je&&(this.index=(je.scopes||(je.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=je;try{return je=this,t()}finally{je=s}}}on(){++this._on===1&&(this.prevScope=je,je=this)}off(){this._on>0&&--this._on===0&&(je=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 r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ir(){return je}let be;const Fs=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,je&&je.active&&je.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fs.has(this)&&(Fs.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,On(this),So(this);const t=be,s=Ke;be=this,Ke=!0;try{return this.fn()}finally{$o(this),be=t,Ke=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,On(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Zt,Qt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Qt,Qt=e;return}e.next=Zt,Zt=e}function fn(){wo++}function pn(){if(--wo>0)return;if(Qt){let t=Qt;for(Qt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Zt;){let t=Zt;for(Zt=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 r=n.prevDep;n.version===-1?(n===s&&(s=r),mn(n),Or(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}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===ns)||(e.globalVersion=ns,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=be,n=Ke;be=e,Ke=!0;try{So(e);const r=e.fn(e._value);(t.version===0||et(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{be=s,Ke=n,$o(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:n,nextSub:r}=e;if(n&&(n.nextSub=r,e.prevSub=void 0),r&&(r.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 Or(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Ke=!0;const To=[];function mt(){To.push(Ke),Ke=!1}function vt(){const e=To.pop();Ke=e===void 0?!0:e}function On(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=be;be=void 0;try{t()}finally{be=s}}}let ns=0;class Mr{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 vn{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(!be||!Ke||be===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==be)s=this.activeLink=new Mr(be,this),be.deps?(s.prevDep=be.depsTail,be.depsTail.nextDep=s,be.depsTail=s):be.deps=be.depsTail=s,Po(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=be.depsTail,s.nextDep=void 0,be.depsTail.nextDep=s,be.depsTail=s,be.deps===s&&(be.deps=n)}return s}trigger(t){this.version++,ns++,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 Po(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)Po(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,Pt=Symbol(""),Qs=Symbol(""),os=Symbol("");function Ee(e,t,s){if(Ke&&be){let n=Zs.get(e);n||Zs.set(e,n=new Map);let r=n.get(s);r||(n.set(s,r=new vn),r.map=n,r.key=s),r.track()}}function dt(e,t,s,n,r,l){const a=Zs.get(e);if(!a){ns++;return}const i=c=>{c&&c.trigger()};if(fn(),t==="clear")a.forEach(i);else{const c=te(e),x=c&&un(s);if(c&&s==="length"){const u=Number(n);a.forEach((m,g)=>{(g==="length"||g===os||!nt(g)&&g>=u)&&i(m)})}else switch((s!==void 0||a.has(void 0))&&i(a.get(s)),x&&i(a.get(os)),t){case"add":c?x&&i(a.get("length")):(i(a.get(Pt)),Dt(e)&&i(a.get(Qs)));break;case"delete":c||(i(a.get(Pt)),Dt(e)&&i(a.get(Qs)));break;case"set":Dt(e)&&i(a.get(Pt));break}}pn()}function It(e){const t=ce(e);return t===e?t:(Ee(t,"iterate",os),Fe(e)?t:t.map(We))}function Ms(e){return Ee(e=ce(e),"iterate",os),e}function Qe(e,t){return xt(e)?Nt(Et(e)?We(t):t):We(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>Qe(this,e))},concat(...e){return It(this).concat(...e.map(t=>te(t)?It(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=Qe(this,e[1]),e))},every(e,t){return at(this,"every",e,t,void 0,arguments)},filter(e,t){return at(this,"filter",e,t,s=>s.map(n=>Qe(this,n)),arguments)},find(e,t){return at(this,"find",e,t,s=>Qe(this,s),arguments)},findIndex(e,t){return at(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return at(this,"findLast",e,t,s=>Qe(this,s),arguments)},findLastIndex(e,t){return at(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return at(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return It(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return at(this,"map",e,t,void 0,arguments)},pop(){return Wt(this,"pop")},push(...e){return Wt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return Wt(this,"shift")},some(e,t){return at(this,"some",e,t,void 0,arguments)},splice(...e){return Wt(this,"splice",e)},toReversed(){return It(this).toReversed()},toSorted(e){return It(this).toSorted(e)},toSpliced(...e){return It(this).toSpliced(...e)},unshift(...e){return Wt(this,"unshift",e)},values(){return Hs(this,"values",e=>Qe(this,e))}};function Hs(e,t,s){const n=Ms(e),r=n[t]();return n!==e&&!Fe(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=s(l.value)),l}),r}const Rr=Array.prototype;function at(e,t,s,n,r,l){const a=Ms(e),i=a!==e&&!Fe(e),c=a[t];if(c!==Rr[t]){const m=c.apply(e,l);return i?We(m):m}let x=s;a!==e&&(i?x=function(m,g){return s.call(this,Qe(e,m),g,e)}:s.length>2&&(x=function(m,g){return s.call(this,m,g,e)}));const u=c.call(a,x,n);return i&&r?r(u):u}function Mn(e,t,s,n){const r=Ms(e),l=r!==e&&!Fe(e);let a=s,i=!1;r!==e&&(l?(i=n.length===0,a=function(x,u,m){return i&&(i=!1,x=Qe(e,x)),s.call(this,x,Qe(e,u),m,e)}):s.length>3&&(a=function(x,u,m){return s.call(this,x,u,m,e)}));const c=r[t](a,...n);return i?Qe(e,c):c}function Ks(e,t,s){const n=ce(e);Ee(n,"iterate",os);const r=n[t](...s);return(r===-1||r===!1)&&yn(s[0])?(s[0]=ce(s[0]),n[t](...s)):r}function Wt(e,t,s=[]){mt(),fn();const n=ce(e)[t].apply(e,s);return pn(),vt(),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(nt));function Lr(e){nt(e)||(e=String(e));const t=ce(this);return Ee(t,"has",e),t.hasOwnProperty(e)}class Ao{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(r?l?Jr:Do:l?Mo:Oo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=te(t);if(!r){let c;if(a&&(c=Dr[s]))return c;if(s==="hasOwnProperty")return Lr}const i=Reflect.get(t,s,Ie(t)?t:n);if((nt(s)?Eo.has(s):jr(s))||(r||Ee(t,"get",s),l))return i;if(Ie(i)){const c=a&&un(s)?i:i.value;return r&&me(c)?en(c):c}return me(i)?r?en(i):hn(i):i}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,n,r){let l=t[s];const a=te(t)&&un(s);if(!this._isShallow){const x=xt(l);if(!Fe(n)&&!xt(n)&&(l=ce(l),n=ce(n)),!a&&Ie(l)&&!Ie(n))return x||(l.value=n),!0}const i=a?Number(s)<t.length:ue(t,s),c=Reflect.set(t,s,n,Ie(t)?t:r);return t===ce(r)&&(i?et(n,l)&&dt(t,"set",s,n):dt(t,"add",s,n)),c}deleteProperty(t,s){const n=ue(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&n&&dt(t,"delete",s,void 0),r}has(t,s){const n=Reflect.has(t,s);return(!nt(s)||!Eo.has(s))&&Ee(t,"has",s),n}ownKeys(t){return Ee(t,"iterate",te(t)?"length":Pt),Reflect.ownKeys(t)}}class Nr extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Io,Vr=new Nr,Br=new Io(!0);const Xs=e=>e,fs=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...n){const r=this.__v_raw,l=ce(r),a=Dt(l),i=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,x=r[e](...n),u=s?Xs:t?Nt:We;return!t&&Ee(l,"iterate",c?Qs:Pt),Pe(Object.create(x),{next(){const{value:m,done:g}=x.next();return g?{value:m,done:g}:{value:i?[u(m[0]),u(m[1])]:u(m),done:g}}})}}function ps(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(r){const l=this.__v_raw,a=ce(l),i=ce(r);e||(et(r,i)&&Ee(a,"get",r),Ee(a,"get",i));const{has:c}=fs(a),x=t?Xs:e?Nt:We;if(c.call(a,r))return x(l.get(r));if(c.call(a,i))return x(l.get(i));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Ee(ce(r),"iterate",Pt),r.size},has(r){const l=this.__v_raw,a=ce(l),i=ce(r);return e||(et(r,i)&&Ee(a,"has",r),Ee(a,"has",i)),r===i?l.has(r):l.has(r)||l.has(i)},forEach(r,l){const a=this,i=a.__v_raw,c=ce(i),x=t?Xs:e?Nt:We;return!e&&Ee(c,"iterate",Pt),i.forEach((u,m)=>r.call(l,x(u),x(m),a))}};return Pe(s,e?{add:ps("add"),set:ps("set"),delete:ps("delete"),clear:ps("clear")}:{add(r){const l=ce(this),a=fs(l),i=ce(r),c=!t&&!Fe(r)&&!xt(r)?i:r;return a.has.call(l,c)||et(r,c)&&a.has.call(l,r)||et(i,c)&&a.has.call(l,i)||(l.add(c),dt(l,"add",c,c)),this},set(r,l){!t&&!Fe(l)&&!xt(l)&&(l=ce(l));const a=ce(this),{has:i,get:c}=fs(a);let x=i.call(a,r);x||(r=ce(r),x=i.call(a,r));const u=c.call(a,r);return a.set(r,l),x?et(l,u)&&dt(a,"set",r,l):dt(a,"add",r,l),this},delete(r){const l=ce(this),{has:a,get:i}=fs(l);let c=a.call(l,r);c||(r=ce(r),c=a.call(l,r)),i&&i.call(l,r);const x=l.delete(r);return c&&dt(l,"delete",r,void 0),x},clear(){const r=ce(this),l=r.size!==0,a=r.clear();return l&&dt(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function xn(e,t){const s=Hr(e,t);return(n,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?n:Reflect.get(ue(s,r)&&r in n?s:n,r,l)}const Kr={get:xn(!1,!1)},Wr={get:xn(!1,!0)},zr={get:xn(!0,!1)};const Oo=new WeakMap,Mo=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 hn(e){return xt(e)?e:gn(e,!1,Ur,Kr,Oo)}function Yr(e){return gn(e,!1,Br,Wr,Mo)}function en(e){return gn(e,!0,Vr,zr,Do)}function gn(e,t,s,n,r){if(!me(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=r.get(e);if(a)return a;const i=new Proxy(e,l===2?n:s);return r.set(e,i),i}function Et(e){return xt(e)?Et(e.__v_raw):!!(e&&e.__v_isReactive)}function xt(e){return!!(e&&e.__v_isReadonly)}function Fe(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Zr(e){return!ue(e,"__v_skip")&&Object.isExtensible(e)&&ho(e,"__v_skip",!0),e}const We=e=>me(e)?hn(e):e,Nt=e=>me(e)?en(e):e;function Ie(e){return e?e.__v_isRef===!0:!1}function S(e){return Qr(e,!1)}function Qr(e,t){return Ie(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new vn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ce(t),this._value=s?t:We(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Fe(t)||xt(t);t=n?t:ce(t),et(t,s)&&(this._rawValue=t,this._value=n?t:We(t),this.dep.trigger())}}function el(e){return Ie(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 r=e[t];return Ie(r)&&!Ie(s)?(r.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 vn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ns-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&be!==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,r;return oe(e)?n=e:(n=e.get,r=e.set),new sl(n,r,s)}const ms={},_s=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=_s.get(s);n||_s.set(s,n=[]),n.push(e)}}function rl(e,t,s=ge){const{immediate:n,deep:r,once:l,scheduler:a,augmentJob:i,call:c}=s,x=O=>r?O:Fe(O)||r===!1||r===0?ft(O,1):ft(O);let u,m,g,P,V=!1,A=!1;if(Ie(e)?(m=()=>e.value,V=Fe(e)):Et(e)?(m=()=>x(e),V=!0):te(e)?(A=!0,V=e.some(O=>Et(O)||Fe(O)),m=()=>e.map(O=>{if(Ie(O))return O.value;if(Et(O))return x(O);if(oe(O))return c?c(O,2):O()})):oe(e)?t?m=c?()=>c(e,2):e:m=()=>{if(g){mt();try{g()}finally{vt()}}const O=Tt;Tt=u;try{return c?c(e,3,[P]):e(P)}finally{Tt=O}}:m=tt,t&&r){const O=m,F=r===!0?1/0:r;m=()=>ft(O(),F)}const H=Ir(),$=()=>{u.stop(),H&&H.active&&cn(H.effects,u)};if(l&&t){const O=t;t=(...F)=>{O(...F),$()}}let I=A?new Array(e.length).fill(ms):ms;const U=O=>{if(!(!(u.flags&1)||!u.dirty&&!O))if(t){const F=u.run();if(r||V||(A?F.some((k,E)=>et(k,I[E])):et(F,I))){g&&g();const k=Tt;Tt=u;try{const E=[F,I===ms?void 0:A&&I[0]===ms?[]:I,P];I=F,c?c(t,3,E):t(...E)}finally{Tt=k}}}else u.run()};return i&&i(U),u=new _o(m),u.scheduler=a?()=>a(U,!1):U,P=O=>ol(O,!1,u),g=u.onStop=()=>{const O=_s.get(u);if(O){if(c)c(O,4);else for(const F of O)F();_s.delete(u)}},t?n?U(!0):I=u.run():a?a(U.bind(null,!0),!0):u.run(),$.pause=u.pause.bind(u),$.resume=u.resume.bind(u),$.stop=$,$}function ft(e,t=1/0,s){if(t<=0||!me(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Ie(e))ft(e.value,t,s);else if(te(e))for(let n=0;n<e.length;n++)ft(e[n],t,s);else if(Bt(e)||Dt(e))e.forEach(n=>{ft(n,t,s)});else if(xo(e)){for(const n in e)ft(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&ft(e[n],t,s)}return e}/**
|
|
56
|
+
**/let Le;class Ar{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,o;for(s=0,o=this.effects.length;s<o;s++)this.effects[s].stop();for(this.effects.length=0,s=0,o=this.cleanups.length;s<o;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,o=this.scopes.length;s<o;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ir(){return Le}let we;const Fs=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,Fs.has(this)&&(Fs.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,On(this),So(this);const t=we,s=We;we=this,We=!0;try{return this.fn()}finally{$o(this),we=t,We=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,On(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.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(o){e||(e=o)}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,o=s;for(;o;){const r=o.prevDep;o.version===-1?(o===s&&(s=r),mn(o),Or(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}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=we,o=We;we=e,We=!0;try{So(e);const r=e.fn(e._value);(t.version===0||st(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{we=s,We=o,$o(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),s.subs===e&&(s.subs=o,!o&&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 Or(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let We=!0;const To=[];function xt(){To.push(We),We=!1}function vt(){const e=To.pop();We=e===void 0?!0:e}function On(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=we;we=void 0;try{t()}finally{we=s}}}let os=0;class Mr{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(!we||!We||we===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==we)s=this.activeLink=new Mr(we,this),we.deps?(s.prevDep=we.depsTail,we.depsTail.nextDep=s,we.depsTail=s):we.deps=we.depsTail=s,Po(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const o=s.nextDep;o.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=o),s.prevDep=we.depsTail,s.nextDep=void 0,we.depsTail.nextDep=s,we.depsTail=s,we.deps===s&&(we.deps=o)}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 Po(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Po(o)}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 Ae(e,t,s){if(We&&we){let o=Zs.get(e);o||Zs.set(e,o=new Map);let r=o.get(s);r||(o.set(s,r=new xn),r.map=o,r.key=s),r.track()}}function ft(e,t,s,o,r,l){const a=Zs.get(e);if(!a){os++;return}const c=d=>{d&&d.trigger()};if(fn(),t==="clear")a.forEach(c);else{const d=ne(e),x=d&&un(s);if(d&&s==="length"){const f=Number(o);a.forEach((p,h)=>{(h==="length"||h===rs||!rt(h)&&h>=f)&&c(p)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),x&&c(a.get(rs)),t){case"add":d?x&&c(a.get("length")):(c(a.get(Et)),jt(e)&&c(a.get(Qs)));break;case"delete":d||(c(a.get(Et)),jt(e)&&c(a.get(Qs)));break;case"set":jt(e)&&c(a.get(Et));break}}pn()}function Mt(e){const t=de(e);return t===e?t:(Ae(t,"iterate",rs),He(e)?t:t.map(ze))}function Ds(e){return Ae(e=de(e),"iterate",rs),e}function et(e,t){return gt(e)?Ut(At(e)?ze(t):t):ze(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>ne(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=et(this,e[1]),e))},every(e,t){return it(this,"every",e,t,void 0,arguments)},filter(e,t){return it(this,"filter",e,t,s=>s.map(o=>et(this,o)),arguments)},find(e,t){return it(this,"find",e,t,s=>et(this,s),arguments)},findIndex(e,t){return it(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return it(this,"findLast",e,t,s=>et(this,s),arguments)},findLastIndex(e,t){return it(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return it(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 it(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return it(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=>et(this,e))}};function Hs(e,t,s){const o=Ds(e),r=o[t]();return o!==e&&!He(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=s(l.value)),l}),r}const Rr=Array.prototype;function it(e,t,s,o,r,l){const a=Ds(e),c=a!==e&&!He(e),d=a[t];if(d!==Rr[t]){const p=d.apply(e,l);return c?ze(p):p}let x=s;a!==e&&(c?x=function(p,h){return s.call(this,et(e,p),h,e)}:s.length>2&&(x=function(p,h){return s.call(this,p,h,e)}));const f=d.call(a,x,o);return c&&r?r(f):f}function Mn(e,t,s,o){const r=Ds(e),l=r!==e&&!He(e);let a=s,c=!1;r!==e&&(l?(c=o.length===0,a=function(x,f,p){return c&&(c=!1,x=et(e,x)),s.call(this,x,et(e,f),p,e)}):s.length>3&&(a=function(x,f,p){return s.call(this,x,f,p,e)}));const d=r[t](a,...o);return c?et(e,d):d}function Ks(e,t,s){const o=de(e);Ae(o,"iterate",rs);const r=o[t](...s);return(r===-1||r===!1)&&yn(s[0])?(s[0]=de(s[0]),o[t](...s)):r}function zt(e,t,s=[]){xt(),fn();const o=de(e)[t].apply(e,s);return pn(),vt(),o}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 Lr(e){rt(e)||(e=String(e));const t=de(this);return Ae(t,"has",e),t.hasOwnProperty(e)}class Ao{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,o){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return l;if(s==="__v_raw")return o===(r?l?Jr:Do:l?Mo:Oo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const a=ne(t);if(!r){let d;if(a&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Lr}const c=Reflect.get(t,s,Oe(t)?t:o);if((rt(s)?Eo.has(s):jr(s))||(r||Ae(t,"get",s),l))return c;if(Oe(c)){const d=a&&un(s)?c:c.value;return r&&he(d)?en(d):d}return he(c)?r?en(c):gn(c):c}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,o,r){let l=t[s];const a=ne(t)&&un(s);if(!this._isShallow){const x=gt(l);if(!He(o)&&!gt(o)&&(l=de(l),o=de(o)),!a&&Oe(l)&&!Oe(o))return x||(l.value=o),!0}const c=a?Number(s)<t.length:fe(t,s),d=Reflect.set(t,s,o,Oe(t)?t:r);return t===de(r)&&(c?st(o,l)&&ft(t,"set",s,o):ft(t,"add",s,o)),d}deleteProperty(t,s){const o=fe(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&o&&ft(t,"delete",s,void 0),r}has(t,s){const o=Reflect.has(t,s);return(!rt(s)||!Eo.has(s))&&Ae(t,"has",s),o}ownKeys(t){return Ae(t,"iterate",ne(t)?"length":Et),Reflect.ownKeys(t)}}class Nr extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Io,Vr=new Nr,Br=new Io(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...o){const r=this.__v_raw,l=de(r),a=jt(l),c=e==="entries"||e===Symbol.iterator&&a,d=e==="keys"&&a,x=r[e](...o),f=s?Xs:t?Ut:ze;return!t&&Ae(l,"iterate",d?Qs:Et),Ee(Object.create(x),{next(){const{value:p,done:h}=x.next();return h?{value:p,done:h}:{value:c?[f(p[0]),f(p[1])]:f(p),done:h}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(r){const l=this.__v_raw,a=de(l),c=de(r);e||(st(r,c)&&Ae(a,"get",r),Ae(a,"get",c));const{has:d}=ps(a),x=t?Xs:e?Ut:ze;if(d.call(a,r))return x(l.get(r));if(d.call(a,c))return x(l.get(c));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(de(r),"iterate",Et),r.size},has(r){const l=this.__v_raw,a=de(l),c=de(r);return e||(st(r,c)&&Ae(a,"has",r),Ae(a,"has",c)),r===c?l.has(r):l.has(r)||l.has(c)},forEach(r,l){const a=this,c=a.__v_raw,d=de(c),x=t?Xs:e?Ut:ze;return!e&&Ae(d,"iterate",Et),c.forEach((f,p)=>r.call(l,x(f),x(p),a))}};return Ee(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(r){const l=de(this),a=ps(l),c=de(r),d=!t&&!He(r)&&!gt(r)?c:r;return a.has.call(l,d)||st(r,d)&&a.has.call(l,r)||st(c,d)&&a.has.call(l,c)||(l.add(d),ft(l,"add",d,d)),this},set(r,l){!t&&!He(l)&&!gt(l)&&(l=de(l));const a=de(this),{has:c,get:d}=ps(a);let x=c.call(a,r);x||(r=de(r),x=c.call(a,r));const f=d.call(a,r);return a.set(r,l),x?st(l,f)&&ft(a,"set",r,l):ft(a,"add",r,l),this},delete(r){const l=de(this),{has:a,get:c}=ps(l);let d=a.call(l,r);d||(r=de(r),d=a.call(l,r)),c&&c.call(l,r);const x=l.delete(r);return d&&ft(l,"delete",r,void 0),x},clear(){const r=de(this),l=r.size!==0,a=r.clear();return l&&ft(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function vn(e,t){const s=Hr(e,t);return(o,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(fe(s,r)&&r in o?s:o,r,l)}const Kr={get:vn(!1,!1)},Wr={get:vn(!1,!0)},zr={get:vn(!0,!1)};const Oo=new WeakMap,Mo=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:hn(e,!1,Ur,Kr,Oo)}function Yr(e){return hn(e,!1,Br,Wr,Mo)}function en(e){return hn(e,!0,Vr,zr,Do)}function hn(e,t,s,o,r){if(!he(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=r.get(e);if(a)return a;const c=new Proxy(e,l===2?o:s);return r.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 de(e){const t=e&&e.__v_raw;return t?de(t):e}function Zr(e){return!fe(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const ze=e=>he(e)?gn(e):e,Ut=e=>he(e)?en(e):e;function Oe(e){return e?e.__v_isRef===!0:!1}function _(e){return Qr(e,!1)}function Qr(e,t){return Oe(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:de(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,o=this.__v_isShallow||He(t)||gt(t);t=o?t:de(t),st(t,s)&&(this._rawValue=t,this._value=o?t:ze(t),this.dep.trigger())}}function el(e){return Oe(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,o)=>{const r=e[t];return Oe(r)&&!Oe(s)?(r.value=s,!0):Reflect.set(e,t,s,o)}};function Ro(e){return At(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,o){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=o}notify(){if(this.flags|=16,!(this.flags&8)&&we!==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 o,r;return ae(e)?o=e:(o=e.get,r=e.set),new sl(o,r,s)}const xs={},ws=new WeakMap;let Pt;function ol(e,t=!1,s=Pt){if(s){let o=ws.get(s);o||ws.set(s,o=[]),o.push(e)}}function rl(e,t,s=be){const{immediate:o,deep:r,once:l,scheduler:a,augmentJob:c,call:d}=s,x=I=>r?I:He(I)||r===!1||r===0?pt(I,1):pt(I);let f,p,h,S,F=!1,C=!1;if(Oe(e)?(p=()=>e.value,F=He(e)):At(e)?(p=()=>x(e),F=!0):ne(e)?(C=!0,F=e.some(I=>At(I)||He(I)),p=()=>e.map(I=>{if(Oe(I))return I.value;if(At(I))return x(I);if(ae(I))return d?d(I,2):I()})):ae(e)?t?p=d?()=>d(e,2):e:p=()=>{if(h){xt();try{h()}finally{vt()}}const I=Pt;Pt=f;try{return d?d(e,3,[S]):e(S)}finally{Pt=I}}:p=nt,t&&r){const I=p,V=r===!0?1/0:r;p=()=>pt(I(),V)}const N=Ir(),$=()=>{f.stop(),N&&N.active&&cn(N.effects,f)};if(l&&t){const I=t;t=(...V)=>{I(...V),$()}}let T=C?new Array(e.length).fill(xs):xs;const L=I=>{if(!(!(f.flags&1)||!f.dirty&&!I))if(t){const V=f.run();if(r||F||(C?V.some((b,O)=>st(b,T[O])):st(V,T))){h&&h();const b=Pt;Pt=f;try{const O=[V,T===xs?void 0:C&&T[0]===xs?[]:T,S];T=V,d?d(t,3,O):t(...O)}finally{Pt=b}}}else f.run()};return c&&c(L),f=new _o(p),f.scheduler=a?()=>a(L,!1):L,S=I=>ol(I,!1,f),h=f.onStop=()=>{const I=ws.get(f);if(I){if(d)d(I,4);else for(const V of I)V();ws.delete(f)}},t?o?L(!0):T=f.run():a?a(L.bind(null,!0),!0):f.run(),$.pause=f.pause.bind(f),$.resume=f.resume.bind(f),$.stop=$,$}function pt(e,t=1/0,s){if(t<=0||!he(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Oe(e))pt(e.value,t,s);else if(ne(e))for(let o=0;o<e.length;o++)pt(e[o],t,s);else if(Ft(e)||jt(e))e.forEach(o=>{pt(o,t,s)});else if(vo(e)){for(const o in e)pt(e[o],t,s);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&pt(e[o],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 us(e,t,s,n){try{return n?e(...n):e()}catch(r){Ds(r,t,s)}}function ot(e,t,s,n){if(oe(e)){const r=us(e,t,s,n);return r&&mo(r)&&r.catch(l=>{Ds(l,t,s)}),r}if(te(e)){const r=[];for(let l=0;l<e.length;l++)r.push(ot(e[l],t,s,n));return r}}function Ds(e,t,s,n=!0){const r=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||ge;if(t){let i=t.parent;const c=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;i;){const u=i.ec;if(u){for(let m=0;m<u.length;m++)if(u[m](e,c,x)===!1)return}i=i.parent}if(l){mt(),us(l,null,10,[e,c,x]),vt();return}}ll(e,s,r,n,a)}function ll(e,t,s,n=!0,r=!1){if(r)throw e;console.error(e)}const Me=[];let Ze=-1;const Rt=[];let gt=null,Ot=0;const jo=Promise.resolve();let ws=null;function Lo(e){const t=ws||jo;return e?t.then(this?e.bind(this):e):t}function al(e){let t=Ze+1,s=Me.length;for(;t<s;){const n=t+s>>>1,r=Me[n],l=rs(r);l<e||l===e&&r.flags&2?t=n+1:s=n}return t}function bn(e){if(!(e.flags&1)){const t=rs(e),s=Me[Me.length-1];!s||!(e.flags&2)&&t>=rs(s)?Me.push(e):Me.splice(al(t),0,e),e.flags|=1,No()}}function No(){ws||(ws=jo.then(Vo))}function il(e){te(e)?Rt.push(...e):gt&&e.id===-1?gt.splice(Ot+1,0,e):e.flags&1||(Rt.push(e),e.flags|=1),No()}function Dn(e,t,s=Ze+1){for(;s<Me.length;s++){const n=Me[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;Me.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Uo(e){if(Rt.length){const t=[...new Set(Rt)].sort((s,n)=>rs(s)-rs(n));if(Rt.length=0,gt){gt.push(...t);return}for(gt=t,Ot=0;Ot<gt.length;Ot++){const s=gt[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}gt=null,Ot=0}}const rs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Ze=0;Ze<Me.length;Ze++){const t=Me[Ze];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),us(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ze<Me.length;Ze++){const t=Me[Ze];t&&(t.flags&=-2)}Ze=-1,Me.length=0,Uo(),ws=null,(Me.length||Rt.length)&&Vo()}}let Ue=null,Bo=null;function ks(e){const t=Ue;return Ue=e,Bo=e&&e.type.__scopeId||null,t}function cl(e,t=Ue,s){if(!t||e._n)return e;const n=(...r)=>{n._d&&zn(-1);const l=ks(t);let a;try{a=e(...r)}finally{ks(l),n._d&&zn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function Z(e,t){if(Ue===null)return e;const s=Ns(Ue),n=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,a,i,c=ge]=t[r];l&&(oe(l)&&(l={mounted:l,updated:l}),l.deep&&ft(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:i,modifiers:c}))}return e}function $t(e,t,s,n){const r=e.dirs,l=t&&t.dirs;for(let a=0;a<r.length;a++){const i=r[a];l&&(i.oldValue=l[a].value);let c=i.dir[n];c&&(mt(),ot(c,s,8,[e.el,i,e,t]),vt())}}function ul(e,t){if(Ae){let s=Ae.provides;const n=Ae.parent&&Ae.parent.provides;n===s&&(s=Ae.provides=Object.create(n)),s[e]=t}}function hs(e,t,s=!1){const n=ua();if(n||jt){let r=jt?jt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return s&&oe(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>hs(dl);function Ws(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=ge){const{immediate:n,deep:r,flush:l,once:a}=s,i=Pe({},s),c=t&&n||!t&&l!=="post";let x;if(as){if(l==="sync"){const P=fl();x=P.__watcherHandles||(P.__watcherHandles=[])}else if(!c){const P=()=>{};return P.stop=tt,P.resume=tt,P.pause=tt,P}}const u=Ae;i.call=(P,V,A)=>ot(P,u,V,A);let m=!1;l==="post"?i.scheduler=P=>{Re(P,u&&u.suspense)}:l!=="sync"&&(m=!0,i.scheduler=(P,V)=>{V?P():bn(P)}),i.augmentJob=P=>{t&&(P.flags|=4),m&&(P.flags|=2,u&&(P.id=u.uid,P.i=u))};const g=rl(e,t,i);return as&&(x?x.push(g):c&&g()),g}function pl(e,t,s){const n=this.proxy,r=ke(e)?e.includes(".")?Ho(n,e):()=>n[e]:e.bind(n,n);let l;oe(t)?l=t:(l=t.handler,s=t);const a=ds(this),i=Fo(r,l.bind(n),s);return a(),i}function Ho(e,t){const s=t.split(".");return()=>{let n=e;for(let r=0;r<s.length&&n;r++)n=n[s[r]];return n}}const ml=Symbol("_vte"),vl=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 Be(e,t){return oe(e)?Pe({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 Ss=new WeakMap;function Xt(e,t,s,n,r=!1){if(te(e)){e.forEach((A,H)=>Xt(A,t&&(te(t)?t[H]:t),s,n,r));return}if(es(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Xt(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Ns(n.component):n.el,a=r?null:l,{i,r:c}=e,x=t&&t.r,u=i.refs===ge?i.refs={}:i.refs,m=i.setupState,g=ce(m),P=m===ge?po:A=>Rn(u,A)?!1:ue(g,A),V=(A,H)=>!(H&&Rn(u,H));if(x!=null&&x!==c){if(jn(t),ke(x))u[x]=null,P(x)&&(m[x]=null);else if(Ie(x)){const A=t;V(x,A.k)&&(x.value=null),A.k&&(u[A.k]=null)}}if(oe(c))us(c,i,12,[a,u]);else{const A=ke(c),H=Ie(c);if(A||H){const $=()=>{if(e.f){const I=A?P(c)?m[c]:u[c]:V()||!e.k?c.value:u[e.k];if(r)te(I)&&cn(I,l);else if(te(I))I.includes(l)||I.push(l);else if(A)u[c]=[l],P(c)&&(m[c]=u[c]);else{const U=[l];V(c,e.k)&&(c.value=U),e.k&&(u[e.k]=U)}}else A?(u[c]=a,P(c)&&(m[c]=a)):H&&(V(c,e.k)&&(c.value=a),e.k&&(u[e.k]=a))};if(a){const I=()=>{$(),Ss.delete(e)};I.id=-1,Ss.set(e,I),Re(I,s)}else jn(e),$()}}}function jn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const es=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function hl(e,t){zo(e,"a",t)}function gl(e,t){zo(e,"da",t)}function zo(e,t,s=Ae){const n=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Rs(t,n,s),s){let r=s.parent;for(;r&&r.parent;)Wo(r.parent.vnode)&&yl(n,t,s,r),r=r.parent}}function yl(e,t,s,n){const r=Rs(t,e,n,!0);wn(()=>{cn(n[t],r)},s)}function Rs(e,t,s=Ae,n=!1){if(s){const r=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{mt();const i=ds(s),c=ot(t,s,e,a);return i(),vt(),c});return n?r.unshift(l):r.push(l),l}}const ht=e=>(t,s=Ae)=>{(!as||e==="sp")&&Rs(e,(...n)=>t(...n),s)},bl=ht("bm"),Le=ht("m"),_l=ht("bu"),wl=ht("u"),kl=ht("bum"),wn=ht("um"),Sl=ht("sp"),$l=ht("rtg"),Cl=ht("rtc");function Tl(e,t=Ae){Rs("ec",e,t)}const Pl="components",Jo=Symbol.for("v-ndc");function El(e){return ke(e)?Al(Pl,e,!1)||e:e||Jo}function Al(e,t,s=!0,n=!1){const r=Ue||Ae;if(r){const l=r.type;{const i=va(l,!1);if(i&&(i===t||i===De(t)||i===As(De(t))))return l}const a=Ln(r[e]||l[e],t)||Ln(r.appContext[e],t);return!a&&n?l:a}}function Ln(e,t){return e&&(e[t]||e[De(t)]||e[As(De(t))])}function de(e,t,s,n){let r;const l=s,a=te(e);if(a||ke(e)){const i=a&&Et(e);let c=!1,x=!1;i&&(c=!Fe(e),x=xt(e),e=Ms(e)),r=new Array(e.length);for(let u=0,m=e.length;u<m;u++)r[u]=t(c?x?Nt(We(e[u])):We(e[u]):e[u],u,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let i=0;i<e;i++)r[i]=t(i+1,i,void 0,l)}else if(me(e))if(e[Symbol.iterator])r=Array.from(e,(i,c)=>t(i,c,void 0,l));else{const i=Object.keys(e);r=new Array(i.length);for(let c=0,x=i.length;c<x;c++){const u=i[c];r[c]=t(e[u],u,c,l)}}else r=[];return r}const tn=e=>e?vr(e)?Ns(e):tn(e.parent):null,ts=Pe(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=Lo.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==ge&&!e.__isScriptSetup&&ue(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:r,props:l,accessCache:a,type:i,appContext:c}=e;if(t[0]!=="$"){const g=a[t];if(g!==void 0)switch(g){case 1:return n[t];case 2:return r[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(r!==ge&&ue(r,t))return a[t]=2,r[t];if(ue(l,t))return a[t]=3,l[t];if(s!==ge&&ue(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const x=ts[t];let u,m;if(x)return t==="$attrs"&&Ee(e.attrs,"get",""),x(e);if((u=i.__cssModules)&&(u=u[t]))return u;if(s!==ge&&ue(s,t))return a[t]=4,s[t];if(m=c.config.globalProperties,ue(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:r,ctx:l}=e;return zs(r,t)?(r[t]=s,!0):n!==ge&&ue(n,t)?(n[t]=s,!0):ue(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:r,props:l,type:a}},i){let c;return!!(s[i]||e!==ge&&i[0]!=="$"&&ue(e,i)||zs(t,i)||ue(l,i)||ue(n,i)||ue(ts,i)||ue(r.config.globalProperties,i)||(c=a.__cssModules)&&c[i])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ue(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Nn(e){return te(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ol(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:i,provide:c,inject:x,created:u,beforeMount:m,mounted:g,beforeUpdate:P,updated:V,activated:A,deactivated:H,beforeDestroy:$,beforeUnmount:I,destroyed:U,unmounted:O,render:F,renderTracked:k,renderTriggered:E,errorCaptured:L,serverPrefetch:J,expose:re,inheritAttrs:N,components:C,directives:R,filters:G}=t;if(x&&Ml(x,n,null),a)for(const xe in a){const ie=a[xe];oe(ie)&&(n[xe]=ie.bind(s))}if(r){const xe=r.call(s,s);me(xe)&&(e.data=hn(xe))}if(sn=!0,l)for(const xe in l){const ie=l[xe],Y=oe(ie)?ie.bind(s,s):oe(ie.get)?ie.get.bind(s,s):tt,B=!oe(ie)&&oe(ie.set)?ie.set.bind(s):tt,$e=Te({get:Y,set:B});Object.defineProperty(n,xe,{enumerable:!0,configurable:!0,get:()=>$e.value,set:_e=>$e.value=_e})}if(i)for(const xe in i)qo(i[xe],n,s,xe);if(c){const xe=oe(c)?c.call(s):c;Reflect.ownKeys(xe).forEach(ie=>{ul(ie,xe[ie])})}u&&Un(u,e,"c");function we(xe,ie){te(ie)?ie.forEach(Y=>xe(Y.bind(s))):ie&&xe(ie.bind(s))}if(we(bl,m),we(Le,g),we(_l,P),we(wl,V),we(hl,A),we(gl,H),we(Tl,L),we(Cl,k),we($l,E),we(kl,I),we(wn,O),we(Sl,J),te(re))if(re.length){const xe=e.exposed||(e.exposed={});re.forEach(ie=>{Object.defineProperty(xe,ie,{get:()=>s[ie],set:Y=>s[ie]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});F&&e.render===tt&&(e.render=F),N!=null&&(e.inheritAttrs=N),C&&(e.components=C),R&&(e.directives=R),J&&Ko(e)}function Ml(e,t,s=tt){te(e)&&(e=nn(e));for(const n in e){const r=e[n];let l;me(r)?"default"in r?l=hs(r.from||n,r.default,!0):l=hs(r.from||n):l=hs(r),Ie(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){ot(te(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let r=n.includes(".")?Ho(s,n):()=>s[n];if(ke(e)){const l=t[e];oe(l)&&Ws(r,l)}else if(oe(e))Ws(r,e.bind(s));else if(me(e))if(te(e))e.forEach(l=>qo(l,t,s,n));else{const l=oe(e.handler)?e.handler.bind(s):t[e.handler];oe(l)&&Ws(r,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,i=l.get(t);let c;return i?c=i:!r.length&&!s&&!n?c=t:(c={},r.length&&r.forEach(x=>$s(c,x,a,!0)),$s(c,t,a)),me(t)&&l.set(t,c),c}function $s(e,t,s,n=!1){const{mixins:r,extends:l}=t;l&&$s(e,l,s,!0),r&&r.forEach(a=>$s(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const i=Dl[a]||s&&s[a];e[a]=i?i(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Bn,emits:Bn,methods:Gt,computed:Gt,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:Gt,directives:Gt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Pe(oe(e)?e.call(this,this):e,oe(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Gt(nn(e),nn(t))}function nn(e){if(te(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 Gt(e,t){return e?Pe(Object.create(null),e,t):t}function Bn(e,t){return e?te(e)&&te(t)?[...new Set([...e,...t])]:Pe(Object.create(null),Nn(e),Nn(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Pe(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 Ll=0;function Nl(e,t){return function(n,r=null){oe(n)||(n=Pe({},n)),r!=null&&!me(r)&&(r=null);const l=Yo(),a=new WeakSet,i=[];let c=!1;const x=l.app={_uid:Ll++,_component:n,_props:r,_container:null,_context:l,_instance:null,version:ha,get config(){return l.config},set config(u){},use(u,...m){return a.has(u)||(u&&oe(u.install)?(a.add(u),u.install(x,...m)):oe(u)&&(a.add(u),u(x,...m))),x},mixin(u){return l.mixins.includes(u)||l.mixins.push(u),x},component(u,m){return m?(l.components[u]=m,x):l.components[u]},directive(u,m){return m?(l.directives[u]=m,x):l.directives[u]},mount(u,m,g){if(!c){const P=x._ceVNode||st(n,r);return P.appContext=l,g===!0?g="svg":g===!1&&(g=void 0),e(P,u,g),c=!0,x._container=u,u.__vue_app__=x,Ns(P.component)}},onUnmount(u){i.push(u)},unmount(){c&&(ot(i,x._instance,16),e(null,x._container),delete x._container.__vue_app__)},provide(u,m){return l.provides[u]=m,x},runWithContext(u){const m=jt;jt=x;try{return u()}finally{jt=m}}};return x}}let jt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${De(t)}Modifiers`]||e[`${wt(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||ge;let r=s;const l=t.startsWith("update:"),a=l&&Ul(n,t.slice(7));a&&(a.trim&&(r=s.map(u=>ke(u)?u.trim():u)),a.number&&(r=s.map(Is)));let i,c=n[i=Vs(t)]||n[i=Vs(De(t))];!c&&l&&(c=n[i=Vs(wt(t))]),c&&ot(c,e,6,r);const x=n[i+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,ot(x,e,6,r)}}const Bl=new WeakMap;function Zo(e,t,s=!1){const n=s?Bl:t.emitsCache,r=n.get(e);if(r!==void 0)return r;const l=e.emits;let a={},i=!1;if(!oe(e)){const c=x=>{const u=Zo(x,t,!0);u&&(i=!0,Pe(a,u))};!s&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!l&&!i?(me(e)&&n.set(e,null),null):(te(l)?l.forEach(c=>a[c]=null):Pe(a,l),me(e)&&n.set(e,a),a)}function js(e,t){return!e||!Ts(t)?!1:(t=t.slice(2).replace(/Once$/,""),ue(e,t[0].toLowerCase()+t.slice(1))||ue(e,wt(t))||ue(e,t))}function Fn(e){const{type:t,vnode:s,proxy:n,withProxy:r,propsOptions:[l],slots:a,attrs:i,emit:c,render:x,renderCache:u,props:m,data:g,setupState:P,ctx:V,inheritAttrs:A}=e,H=ks(e);let $,I;try{if(s.shapeFlag&4){const O=r||n,F=O;$=Xe(x.call(F,O,u,m,P,g,V)),I=i}else{const O=t;$=Xe(O.length>1?O(m,{attrs:i,slots:a,emit:c}):O(m,null)),I=t.props?i:Fl(i)}}catch(O){ss.length=0,Ds(O,e,1),$=st(bt)}let U=$;if(I&&A!==!1){const O=Object.keys(I),{shapeFlag:F}=U;O.length&&F&7&&(l&&O.some(Ps)&&(I=Hl(I,l)),U=Ut(U,I,!1,!0))}return s.dirs&&(U=Ut(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(s.dirs):s.dirs),s.transition&&_n(U,s.transition),$=U,ks(H),$}const Fl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ts(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const n in e)(!Ps(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:r,component:l}=e,{props:a,children:i,patchFlag:c}=t,x=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&c>=0){if(c&1024)return!0;if(c&16)return n?Hn(n,a,x):!!a;if(c&8){const u=t.dynamicProps;for(let m=0;m<u.length;m++){const g=u[m];if(Qo(a,n,g)&&!js(x,g))return!0}}}else return(r||i)&&(!i||!i.$stable)?!0:n===a?!1:n?a?Hn(n,a,x):!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 r=0;r<n.length;r++){const l=n[r];if(Qo(t,e,l)&&!js(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],r=t[s];return s==="style"&&me(n)&&me(r)?!Ft(n,r):n!==r}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=n,e=r),r===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 r={},l=er();e.propsDefaults=Object.create(null),sr(e,t,r,l);for(const a in e.propsOptions[0])a in r||(r[a]=void 0);s?e.props=n?r:Yr(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:r,attrs:l,vnode:{patchFlag:a}}=e,i=ce(r),[c]=e.propsOptions;let x=!1;if((n||a>0)&&!(a&16)){if(a&8){const u=e.vnode.dynamicProps;for(let m=0;m<u.length;m++){let g=u[m];if(js(e.emitsOptions,g))continue;const P=t[g];if(c)if(ue(l,g))P!==l[g]&&(l[g]=P,x=!0);else{const V=De(g);r[V]=on(c,i,V,P,e,!1)}else P!==l[g]&&(l[g]=P,x=!0)}}}else{sr(e,t,r,l)&&(x=!0);let u;for(const m in i)(!t||!ue(t,m)&&((u=wt(m))===m||!ue(t,u)))&&(c?s&&(s[m]!==void 0||s[u]!==void 0)&&(r[m]=on(c,i,m,void 0,e,!0)):delete r[m]);if(l!==i)for(const m in l)(!t||!ue(t,m))&&(delete l[m],x=!0)}x&&dt(e.attrs,"set","")}function sr(e,t,s,n){const[r,l]=e.propsOptions;let a=!1,i;if(t)for(let c in t){if(Yt(c))continue;const x=t[c];let u;r&&ue(r,u=De(c))?!l||!l.includes(u)?s[u]=x:(i||(i={}))[u]=x:js(e.emitsOptions,c)||(!(c in n)||x!==n[c])&&(n[c]=x,a=!0)}if(l){const c=ce(s),x=i||ge;for(let u=0;u<l.length;u++){const m=l[u];s[m]=on(r,c,m,x[m],e,!ue(x,m))}}return a}function on(e,t,s,n,r,l){const a=e[s];if(a!=null){const i=ue(a,"default");if(i&&n===void 0){const c=a.default;if(a.type!==Function&&!a.skipFactory&&oe(c)){const{propsDefaults:x}=r;if(s in x)n=x[s];else{const u=ds(r);n=x[s]=c.call(null,t),u()}}else n=c;r.ce&&r.ce._setProp(s,n)}a[0]&&(l&&!i?n=!1:a[1]&&(n===""||n===wt(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,r=n.get(e);if(r)return r;const l=e.props,a={},i=[];let c=!1;if(!oe(e)){const u=m=>{c=!0;const[g,P]=nr(m,t,!0);Pe(a,g),P&&i.push(...P)};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!l&&!c)return me(e)&&n.set(e,Mt),Mt;if(te(l))for(let u=0;u<l.length;u++){const m=De(l[u]);Kn(m)&&(a[m]=ge)}else if(l)for(const u in l){const m=De(u);if(Kn(m)){const g=l[u],P=a[m]=te(g)||oe(g)?{type:g}:Pe({},g),V=P.type;let A=!1,H=!0;if(te(V))for(let $=0;$<V.length;++$){const I=V[$],U=oe(I)&&I.name;if(U==="Boolean"){A=!0;break}else U==="String"&&(H=!1)}else A=oe(V)&&V.name==="Boolean";P[0]=A,P[1]=H,(A||ue(P,"default"))&&i.push(m)}}const x=[a,i];return me(e)&&n.set(e,x),x}function Kn(e){return e[0]!=="$"&&!Yt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>te(e)?e.map(Xe):[Xe(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...r)=>Sn(t(...r)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const r in e){if(kn(r))continue;const l=e[r];if(oe(l))t[r]=Gl(r,l,n);else if(l!=null){const a=Sn(l);t[r]=()=>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 r=t._;r?(lr(n,t,s),s&&ho(n,"_",r,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:r}=e;let l=!0,a=ge;if(n.shapeFlag&32){const i=t._;i?s&&i===1?l=!1:lr(r,t,s):(l=!t.$stable,or(t,r)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const i in r)!kn(i)&&a[i]==null&&delete r[i]},Re=sa;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:r,patchProp:l,createElement:a,createText:i,createComment:c,setText:x,setElementText:u,parentNode:m,nextSibling:g,setScopeId:P=tt,insertStaticContent:V}=e,A=(p,b,T,M=null,_=null,f=null,d=void 0,D=null,j=!!b.dynamicChildren)=>{if(p===b)return;p&&!zt(p,b)&&(M=lt(p),_e(p,_,f,!0),p=null),b.patchFlag===-2&&(j=!1,b.dynamicChildren=null);const{type:v,ref:Q,shapeFlag:K}=b;switch(v){case Ls:H(p,b,T,M);break;case bt:$(p,b,T,M);break;case gs:p==null&&I(b,T,M,d);break;case ne:C(p,b,T,M,_,f,d,D,j);break;default:K&1?F(p,b,T,M,_,f,d,D,j):K&6?R(p,b,T,M,_,f,d,D,j):(K&64||K&128)&&v.process(p,b,T,M,_,f,d,D,j,ze)}Q!=null&&_?Xt(Q,p&&p.ref,f,b||p,!b):Q==null&&p&&p.ref!=null&&Xt(p.ref,null,f,p,!0)},H=(p,b,T,M)=>{if(p==null)n(b.el=i(b.children),T,M);else{const _=b.el=p.el;b.children!==p.children&&x(_,b.children)}},$=(p,b,T,M)=>{p==null?n(b.el=c(b.children||""),T,M):b.el=p.el},I=(p,b,T,M)=>{[p.el,p.anchor]=V(p.children,b,T,M,p.el,p.anchor)},U=({el:p,anchor:b},T,M)=>{let _;for(;p&&p!==b;)_=g(p),n(p,T,M),p=_;n(b,T,M)},O=({el:p,anchor:b})=>{let T;for(;p&&p!==b;)T=g(p),r(p),p=T;r(b)},F=(p,b,T,M,_,f,d,D,j)=>{if(b.type==="svg"?d="svg":b.type==="math"&&(d="mathml"),p==null)k(b,T,M,_,f,d,D,j);else{const v=p.el&&p.el._isVueCE?p.el:null;try{v&&v._beginPatch(),J(p,b,_,f,d,D,j)}finally{v&&v._endPatch()}}},k=(p,b,T,M,_,f,d,D)=>{let j,v;const{props:Q,shapeFlag:K,transition:W,dirs:se}=p;if(j=p.el=a(p.type,f,Q&&Q.is,Q),K&8?u(j,p.children):K&16&&L(p.children,j,null,M,_,Js(p,f),d,D),se&&$t(p,null,M,"created"),E(j,p,p.scopeId,d,M),Q){for(const he in Q)he!=="value"&&!Yt(he)&&l(j,he,null,Q[he],f,M);"value"in Q&&l(j,"value",null,Q.value,f),(v=Q.onVnodeBeforeMount)&&Ye(v,M,p)}se&&$t(p,null,M,"beforeMount");const ae=ea(_,W);ae&&W.beforeEnter(j),n(j,b,T),((v=Q&&Q.onVnodeMounted)||ae||se)&&Re(()=>{try{v&&Ye(v,M,p),ae&&W.enter(j),se&&$t(p,null,M,"mounted")}finally{}},_)},E=(p,b,T,M,_)=>{if(T&&P(p,T),M)for(let f=0;f<M.length;f++)P(p,M[f]);if(_){let f=_.subTree;if(b===f||ur(f.type)&&(f.ssContent===b||f.ssFallback===b)){const d=_.vnode;E(p,d,d.scopeId,d.slotScopeIds,_.parent)}}},L=(p,b,T,M,_,f,d,D,j=0)=>{for(let v=j;v<p.length;v++){const Q=p[v]=D?ut(p[v]):Xe(p[v]);A(null,Q,b,T,M,_,f,d,D)}},J=(p,b,T,M,_,f,d)=>{const D=b.el=p.el;let{patchFlag:j,dynamicChildren:v,dirs:Q}=b;j|=p.patchFlag&16;const K=p.props||ge,W=b.props||ge;let se;if(T&&Ct(T,!1),(se=W.onVnodeBeforeUpdate)&&Ye(se,T,b,p),Q&&$t(b,p,T,"beforeUpdate"),T&&Ct(T,!0),(K.innerHTML&&W.innerHTML==null||K.textContent&&W.textContent==null)&&u(D,""),v?re(p.dynamicChildren,v,D,T,M,Js(b,_),f):d||ie(p,b,D,null,T,M,Js(b,_),f,!1),j>0){if(j&16)N(D,K,W,T,_);else if(j&2&&K.class!==W.class&&l(D,"class",null,W.class,_),j&4&&l(D,"style",K.style,W.style,_),j&8){const ae=b.dynamicProps;for(let he=0;he<ae.length;he++){const ye=ae[he],Se=K[ye],Ce=W[ye];(Ce!==Se||ye==="value")&&l(D,ye,Se,Ce,_,T)}}j&1&&p.children!==b.children&&u(D,b.children)}else!d&&v==null&&N(D,K,W,T,_);((se=W.onVnodeUpdated)||Q)&&Re(()=>{se&&Ye(se,T,b,p),Q&&$t(b,p,T,"updated")},M)},re=(p,b,T,M,_,f,d)=>{for(let D=0;D<b.length;D++){const j=p[D],v=b[D],Q=j.el&&(j.type===ne||!zt(j,v)||j.shapeFlag&198)?m(j.el):T;A(j,v,Q,null,M,_,f,d,!0)}},N=(p,b,T,M,_)=>{if(b!==T){if(b!==ge)for(const f in b)!Yt(f)&&!(f in T)&&l(p,f,b[f],null,_,M);for(const f in T){if(Yt(f))continue;const d=T[f],D=b[f];d!==D&&f!=="value"&&l(p,f,D,d,_,M)}"value"in T&&l(p,"value",b.value,T.value,_)}},C=(p,b,T,M,_,f,d,D,j)=>{const v=b.el=p?p.el:i(""),Q=b.anchor=p?p.anchor:i("");let{patchFlag:K,dynamicChildren:W,slotScopeIds:se}=b;se&&(D=D?D.concat(se):se),p==null?(n(v,T,M),n(Q,T,M),L(b.children||[],T,Q,_,f,d,D,j)):K>0&&K&64&&W&&p.dynamicChildren&&p.dynamicChildren.length===W.length?(re(p.dynamicChildren,W,T,_,f,d,D),(b.key!=null||_&&b===_.subTree)&&ar(p,b,!0)):ie(p,b,T,Q,_,f,d,D,j)},R=(p,b,T,M,_,f,d,D,j)=>{b.slotScopeIds=D,p==null?b.shapeFlag&512?_.ctx.activate(b,T,M,d,j):G(b,T,M,_,f,d,j):ve(p,b,j)},G=(p,b,T,M,_,f,d)=>{const D=p.component=ca(p,M,_);if(Wo(p)&&(D.ctx.renderer=ze),da(D,!1,d),D.asyncDep){if(_&&_.registerDep(D,we,d),!p.el){const j=D.subTree=st(bt);$(null,j,b,T),p.placeholder=j.el}}else we(D,p,b,T,_,f,d)},ve=(p,b,T)=>{const M=b.component=p.component;if(Kl(p,b,T))if(M.asyncDep&&!M.asyncResolved){xe(M,b,T);return}else M.next=b,M.update();else b.el=p.el,M.vnode=b},we=(p,b,T,M,_,f,d)=>{const D=()=>{if(p.isMounted){let{next:K,bu:W,u:se,parent:ae,vnode:he}=p;{const qe=ir(p);if(qe){K&&(K.el=he.el,xe(p,K,d)),qe.asyncDep.then(()=>{Re(()=>{p.isUnmounted||v()},_)});return}}let ye=K,Se;Ct(p,!1),K?(K.el=he.el,xe(p,K,d)):K=he,W&&xs(W),(Se=K.props&&K.props.onVnodeBeforeUpdate)&&Ye(Se,ae,K,he),Ct(p,!0);const Ce=Fn(p),Je=p.subTree;p.subTree=Ce,A(Je,Ce,m(Je.el),lt(Je),p,_,f),K.el=Ce.el,ye===null&&Wl(p,Ce.el),se&&Re(se,_),(Se=K.props&&K.props.onVnodeUpdated)&&Re(()=>Ye(Se,ae,K,he),_)}else{let K;const{el:W,props:se}=b,{bm:ae,m:he,parent:ye,root:Se,type:Ce}=p,Je=es(b);Ct(p,!1),ae&&xs(ae),!Je&&(K=se&&se.onVnodeBeforeMount)&&Ye(K,ye,b),Ct(p,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle(Ce,p.parent?p.parent.type:void 0);const qe=p.subTree=Fn(p);A(null,qe,T,M,p,_,f),b.el=qe.el}if(he&&Re(he,_),!Je&&(K=se&&se.onVnodeMounted)){const qe=b;Re(()=>Ye(K,ye,qe),_)}(b.shapeFlag&256||ye&&es(ye.vnode)&&ye.vnode.shapeFlag&256)&&p.a&&Re(p.a,_),p.isMounted=!0,b=T=M=null}};p.scope.on();const j=p.effect=new _o(D);p.scope.off();const v=p.update=j.run.bind(j),Q=p.job=j.runIfDirty.bind(j);Q.i=p,Q.id=p.uid,j.scheduler=()=>bn(Q),Ct(p,!0),v()},xe=(p,b,T)=>{b.component=p;const M=p.vnode.props;p.vnode=b,p.next=null,Jl(p,b.props,M,T),Zl(p,b.children,T),mt(),Dn(p),vt()},ie=(p,b,T,M,_,f,d,D,j=!1)=>{const v=p&&p.children,Q=p?p.shapeFlag:0,K=b.children,{patchFlag:W,shapeFlag:se}=b;if(W>0){if(W&128){B(v,K,T,M,_,f,d,D,j);return}else if(W&256){Y(v,K,T,M,_,f,d,D,j);return}}se&8?(Q&16&&rt(v,_,f),K!==v&&u(T,K)):Q&16?se&16?B(v,K,T,M,_,f,d,D,j):rt(v,_,f,!0):(Q&8&&u(T,""),se&16&&L(K,T,M,_,f,d,D,j))},Y=(p,b,T,M,_,f,d,D,j)=>{p=p||Mt,b=b||Mt;const v=p.length,Q=b.length,K=Math.min(v,Q);let W;for(W=0;W<K;W++){const se=b[W]=j?ut(b[W]):Xe(b[W]);A(p[W],se,T,null,_,f,d,D,j)}v>Q?rt(p,_,f,!0,!1,K):L(b,T,M,_,f,d,D,j,K)},B=(p,b,T,M,_,f,d,D,j)=>{let v=0;const Q=b.length;let K=p.length-1,W=Q-1;for(;v<=K&&v<=W;){const se=p[v],ae=b[v]=j?ut(b[v]):Xe(b[v]);if(zt(se,ae))A(se,ae,T,null,_,f,d,D,j);else break;v++}for(;v<=K&&v<=W;){const se=p[K],ae=b[W]=j?ut(b[W]):Xe(b[W]);if(zt(se,ae))A(se,ae,T,null,_,f,d,D,j);else break;K--,W--}if(v>K){if(v<=W){const se=W+1,ae=se<Q?b[se].el:M;for(;v<=W;)A(null,b[v]=j?ut(b[v]):Xe(b[v]),T,ae,_,f,d,D,j),v++}}else if(v>W)for(;v<=K;)_e(p[v],_,f,!0),v++;else{const se=v,ae=v,he=new Map;for(v=ae;v<=W;v++){const Ne=b[v]=j?ut(b[v]):Xe(b[v]);Ne.key!=null&&he.set(Ne.key,v)}let ye,Se=0;const Ce=W-ae+1;let Je=!1,qe=0;const Kt=new Array(Ce);for(v=0;v<Ce;v++)Kt[v]=0;for(v=se;v<=K;v++){const Ne=p[v];if(Se>=Ce){_e(Ne,_,f,!0);continue}let Ge;if(Ne.key!=null)Ge=he.get(Ne.key);else for(ye=ae;ye<=W;ye++)if(Kt[ye-ae]===0&&zt(Ne,b[ye])){Ge=ye;break}Ge===void 0?_e(Ne,_,f,!0):(Kt[Ge-ae]=v+1,Ge>=qe?qe=Ge:Je=!0,A(Ne,b[Ge],T,null,_,f,d,D,j),Se++)}const Tn=Je?ta(Kt):Mt;for(ye=Tn.length-1,v=Ce-1;v>=0;v--){const Ne=ae+v,Ge=b[Ne],Pn=b[Ne+1],En=Ne+1<Q?Pn.el||cr(Pn):M;Kt[v]===0?A(null,Ge,T,En,_,f,d,D,j):Je&&(ye<0||v!==Tn[ye]?$e(Ge,T,En,2):ye--)}}},$e=(p,b,T,M,_=null)=>{const{el:f,type:d,transition:D,children:j,shapeFlag:v}=p;if(v&6){$e(p.component.subTree,b,T,M);return}if(v&128){p.suspense.move(b,T,M);return}if(v&64){d.move(p,b,T,ze);return}if(d===ne){n(f,b,T);for(let K=0;K<j.length;K++)$e(j[K],b,T,M);n(p.anchor,b,T);return}if(d===gs){U(p,b,T);return}if(M!==2&&v&1&&D)if(M===0)D.beforeEnter(f),n(f,b,T),Re(()=>D.enter(f),_);else{const{leave:K,delayLeave:W,afterLeave:se}=D,ae=()=>{p.ctx.isUnmounted?r(f):n(f,b,T)},he=()=>{f._isLeaving&&f[xl](!0),K(f,()=>{ae(),se&&se()})};W?W(f,ae,he):he()}else n(f,b,T)},_e=(p,b,T,M=!1,_=!1)=>{const{type:f,props:d,ref:D,children:j,dynamicChildren:v,shapeFlag:Q,patchFlag:K,dirs:W,cacheIndex:se,memo:ae}=p;if(K===-2&&(_=!1),D!=null&&(mt(),Xt(D,null,T,p,!0),vt()),se!=null&&(b.renderCache[se]=void 0),Q&256){b.ctx.deactivate(p);return}const he=Q&1&&W,ye=!es(p);let Se;if(ye&&(Se=d&&d.onVnodeBeforeUnmount)&&Ye(Se,b,p),Q&6)Us(p.component,T,M);else{if(Q&128){p.suspense.unmount(T,M);return}he&&$t(p,null,b,"beforeUnmount"),Q&64?p.type.remove(p,b,T,ze,M):v&&!v.hasOnce&&(f!==ne||K>0&&K&64)?rt(v,b,T,!1,!0):(f===ne&&K&384||!_&&Q&16)&&rt(j,b,T),M&&fe(p)}const Ce=ae!=null&&se==null;(ye&&(Se=d&&d.onVnodeUnmounted)||he||Ce)&&Re(()=>{Se&&Ye(Se,b,p),he&&$t(p,null,b,"unmounted"),Ce&&(p.el=null)},T)},fe=p=>{const{type:b,el:T,anchor:M,transition:_}=p;if(b===ne){kt(T,M);return}if(b===gs){O(p);return}const f=()=>{r(T),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(p.shapeFlag&1&&_&&!_.persisted){const{leave:d,delayLeave:D}=_,j=()=>d(T,f);D?D(p.el,f,j):j()}else f()},kt=(p,b)=>{let T;for(;p!==b;)T=g(p),r(p),p=T;r(b)},Us=(p,b,T)=>{const{bum:M,scope:_,job:f,subTree:d,um:D,m:j,a:v}=p;Wn(j),Wn(v),M&&xs(M),_.stop(),f&&(f.flags|=8,_e(d,p,b,T)),D&&Re(D,b),Re(()=>{p.isUnmounted=!0},b)},rt=(p,b,T,M=!1,_=!1,f=0)=>{for(let d=f;d<p.length;d++)_e(p[d],b,T,M,_)},lt=p=>{if(p.shapeFlag&6)return lt(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const b=g(p.anchor||p.el),T=b&&b[ml];return T?g(T):b};let St=!1;const At=(p,b,T)=>{let M;p==null?b._vnode&&(_e(b._vnode,null,null,!0),M=b._vnode.component):A(b._vnode||null,p,b,null,null,null,T),b._vnode=p,St||(St=!0,Dn(M),Uo(),St=!1)},ze={p:A,um:_e,m:$e,r:fe,mt:G,mc:L,pc:ie,pbc:re,n:lt,o:e};return{render:At,hydrate:void 0,createApp:Nl(At)}}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 ea(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ar(e,t,s=!1){const n=e.children,r=t.children;if(te(n)&&te(r))for(let l=0;l<n.length;l++){const a=n[l];let i=r[l];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=r[l]=ut(r[l]),i.el=a.el),!s&&i.patchFlag!==-2&&ar(a,i)),i.type===Ls&&(i.patchFlag===-1&&(i=r[l]=ut(i)),i.el=a.el),i.type===bt&&!i.el&&(i.el=a.el)}}function ta(e){const t=e.slice(),s=[0];let n,r,l,a,i;const c=e.length;for(n=0;n<c;n++){const x=e[n];if(x!==0){if(r=s[s.length-1],e[r]<x){t[n]=r,s.push(n);continue}for(l=0,a=s.length-1;l<a;)i=l+a>>1,e[s[i]]<x?l=i+1:a=i;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 ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(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 sa(e,t){t&&t.pendingBranch?te(e)?t.effects.push(...e):t.effects.push(e):il(e)}const ne=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),bt=Symbol.for("v-cmt"),gs=Symbol.for("v-stc"),ss=[];let Ve=null;function h(e=!1){ss.push(Ve=e?null:[])}function na(){ss.pop(),Ve=ss[ss.length-1]||null}let ls=1;function zn(e,t=!1){ls+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function dr(e){return e.dynamicChildren=ls>0?Ve||Mt:null,na(),ls>0&&Ve&&Ve.push(e),e}function y(e,t,s,n,r,l){return dr(o(e,t,s,n,r,l,!0))}function fr(e,t,s,n,r){return dr(st(e,t,s,n,r,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function zt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,ys=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?ke(e)||Ie(e)||oe(e)?{i:Ue,r:e,k:t,f:!!s}:e:null);function o(e,t=null,s=null,n=0,r=null,l=e===ne?0:1,a=!1,i=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&ys(t),scopeId:Bo,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:r,dynamicChildren:null,appContext:null,ctx:Ue};return i?($n(c,s),l&128&&e.normalize(c)):s&&(c.shapeFlag|=ke(s)?8:16),ls>0&&!a&&Ve&&(c.patchFlag>0||l&6)&&c.patchFlag!==32&&Ve.push(c),c}const st=oa;function oa(e,t=null,s=null,n=0,r=null,l=!1){if((!e||e===Jo)&&(e=bt),pr(e)){const i=Ut(e,t,!0);return s&&$n(i,s),ls>0&&!l&&Ve&&(i.shapeFlag&6?Ve[Ve.indexOf(e)]=i:Ve.push(i)),i.patchFlag=-2,i}if(xa(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:i,style:c}=t;i&&!ke(i)&&(t.class=q(i)),me(c)&&(yn(c)&&!te(c)&&(c=Pe({},c)),t.style=Lt(c))}const a=ke(e)?1:ur(e)?128:vl(e)?64:me(e)?4:oe(e)?2:0;return o(e,t,s,n,r,a,l,!0)}function ra(e){return e?yn(e)||tr(e)?Pe({},e):e:null}function Ut(e,t,s=!1,n=!1){const{props:r,ref:l,patchFlag:a,children:i,transition:c}=e,x=t?la(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:x,key:x&&mr(x),ref:t&&t.ref?s&&l?te(l)?l.concat(ys(t)):[l,ys(t)]:ys(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,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:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ut(e.ssContent),ssFallback:e.ssFallback&&Ut(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&_n(u,c.clone(u)),u}function X(e=" ",t=0){return st(Ls,null,e,t)}function ct(e,t){const s=st(gs,null,e);return s.staticCount=t,s}function z(e="",t=!1){return t?(h(),fr(bt,null,e)):st(bt,null,e)}function Xe(e){return e==null||typeof e=="boolean"?st(bt):te(e)?st(ne,null,e.slice()):pr(e)?ut(e):st(Ls,null,String(e))}function ut(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ut(e)}function $n(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(te(t))s=16;else if(typeof t=="object")if(n&65){const r=t.default;r&&(r._c&&(r._d=!1),$n(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Ue:r===3&&Ue&&(Ue.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else oe(t)?(t={default:t,_ctx:Ue},s=32):(t=String(t),n&64?(s=16,t=[X(t)]):s=8);e.children=t,e.shapeFlag|=s}function la(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const r in n)if(r==="class")t.class!==n.class&&(t.class=q([t.class,n.class]));else if(r==="style")t.style=Lt([t.style,n.style]);else if(Ts(r)){const l=t[r],a=n[r];a&&l!==a&&!(te(l)&&l.includes(a))?t[r]=l?[].concat(l,a):a:a==null&&l==null&&!Ps(r)&&(t[r]=a)}else r!==""&&(t[r]=n[r])}return t}function Ye(e,t,s,n=null){ot(e,t,7,[s,n])}const aa=Yo();let ia=0;function ca(e,t,s){const n=e.type,r=(t?t.appContext:e.appContext)||aa,l={uid:ia++,vnode:e,type:n,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,r),emitsOptions:Zo(n,r),emit:null,emitted:null,propsDefaults:ge,inheritAttrs:n.inheritAttrs,ctx:ge,data:ge,props:ge,attrs:ge,slots:ge,refs:ge,setupState:ge,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 Ae=null;const ua=()=>Ae||Ue;let Cs,rn;{const e=Os(),t=(s,n)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(n),l=>{r.length>1?r.forEach(a=>a(l)):r[0](l)}};Cs=t("__VUE_INSTANCE_SETTERS__",s=>Ae=s),rn=t("__VUE_SSR_SETTERS__",s=>as=s)}const ds=e=>{const t=Ae;return Cs(e),e.scope.on(),()=>{e.scope.off(),Cs(t)}},Jn=()=>{Ae&&Ae.scope.off(),Cs(null)};function vr(e){return e.vnode.shapeFlag&4}let as=!1;function da(e,t=!1,s=!1){t&&rn(t);const{props:n,children:r}=e.vnode,l=vr(e);zl(e,n,l,t),Yl(e,r,s||t);const a=l?fa(e,t):void 0;return t&&rn(!1),a}function fa(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Il);const{setup:n}=s;if(n){mt();const r=e.setupContext=n.length>1?ma(e):null,l=ds(e),a=us(n,e,0,[e.props,r]),i=mo(a);if(vt(),l(),(i||e.sp)&&!es(e)&&Ko(e),i){if(a.then(Jn,Jn),t)return a.then(c=>{qn(e,c)}).catch(c=>{Ds(c,e,0)});e.asyncDep=a}else qn(e,a)}else xr(e)}function qn(e,t,s){oe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:me(t)&&(e.setupState=Ro(t)),xr(e)}function xr(e,t,s){const n=e.type;e.render||(e.render=n.render||tt);{const r=ds(e);mt();try{Ol(e)}finally{vt(),r()}}}const pa={get(e,t){return Ee(e,"get",""),e[t]}};function ma(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pa),slots:e.slots,emit:e.emit,expose:t}}function Ns(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 ts)return ts[s](e)},has(t,s){return s in t||s in ts}})):e.proxy}function va(e,t=!0){return oe(e)?e.displayName||e.name:e.name||t&&e.__name}function xa(e){return oe(e)&&"__vccOpts"in e}const Te=(e,t)=>nl(e,t,as),ha="3.5.31";/**
|
|
60
|
+
**/function ds(e,t,s,o){try{return o?e(...o):e()}catch(r){Rs(r,t,s)}}function lt(e,t,s,o){if(ae(e)){const r=ds(e,t,s,o);return r&&mo(r)&&r.catch(l=>{Rs(l,t,s)}),r}if(ne(e)){const r=[];for(let l=0;l<e.length;l++)r.push(lt(e[l],t,s,o));return r}}function Rs(e,t,s,o=!0){const r=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||be;if(t){let c=t.parent;const d=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const f=c.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,x)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,d,x]),vt();return}}ll(e,s,r,o,a)}function ll(e,t,s,o=!0,r=!1){if(r)throw e;console.error(e)}const De=[];let Qe=-1;const Lt=[];let wt=null,Dt=0;const jo=Promise.resolve();let ks=null;function Lo(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function al(e){let t=Qe+1,s=De.length;for(;t<s;){const o=t+s>>>1,r=De[o],l=ls(r);l<e||l===e&&r.flags&2?t=o+1:s=o}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(al(t),0,e),e.flags|=1,No()}}function No(){ks||(ks=jo.then(Vo))}function il(e){ne(e)?Lt.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1),No()}function Dn(e,t,s=Qe+1){for(;s<De.length;s++){const o=De[s];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;De.splice(s,1),s--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Uo(e){if(Lt.length){const t=[...new Set(Lt)].sort((s,o)=>ls(s)-ls(o));if(Lt.length=0,wt){wt.push(...t);return}for(wt=t,Dt=0;Dt<wt.length;Dt++){const s=wt[Dt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}wt=null,Dt=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Qe=0;Qe<De.length;Qe++){const t=De[Qe];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(;Qe<De.length;Qe++){const t=De[Qe];t&&(t.flags&=-2)}Qe=-1,De.length=0,Uo(),ks=null,(De.length||Lt.length)&&Vo()}}let Ve=null,Bo=null;function Ss(e){const t=Ve;return Ve=e,Bo=e&&e.type.__scopeId||null,t}function cl(e,t=Ve,s){if(!t||e._n)return e;const o=(...r)=>{o._d&&zn(-1);const l=Ss(t);let a;try{a=e(...r)}finally{Ss(l),o._d&&zn(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function Z(e,t){if(Ve===null)return e;const s=Us(Ve),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,a,c,d=be]=t[r];l&&(ae(l)&&(l={mounted:l,updated:l}),l.deep&&pt(a),o.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:d}))}return e}function Ct(e,t,s,o){const r=e.dirs,l=t&&t.dirs;for(let a=0;a<r.length;a++){const c=r[a];l&&(c.oldValue=l[a].value);let d=c.dir[o];d&&(xt(),lt(d,s,8,[e.el,c,e,t]),vt())}}function ul(e,t){if(Ie){let s=Ie.provides;const o=Ie.parent&&Ie.parent.provides;o===s&&(s=Ie.provides=Object.create(o)),s[e]=t}}function hs(e,t,s=!1){const o=ua();if(o||Nt){let r=Nt?Nt._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return s&&ae(t)?t.call(o&&o.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>hs(dl);function Ws(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=be){const{immediate:o,deep:r,flush:l,once:a}=s,c=Ee({},s),d=t&&o||!t&&l!=="post";let x;if(is){if(l==="sync"){const S=fl();x=S.__watcherHandles||(S.__watcherHandles=[])}else if(!d){const S=()=>{};return S.stop=nt,S.resume=nt,S.pause=nt,S}}const f=Ie;c.call=(S,F,C)=>lt(S,f,F,C);let p=!1;l==="post"?c.scheduler=S=>{je(S,f&&f.suspense)}:l!=="sync"&&(p=!0,c.scheduler=(S,F)=>{F?S():bn(S)}),c.augmentJob=S=>{t&&(S.flags|=4),p&&(S.flags|=2,f&&(S.id=f.uid,S.i=f))};const h=rl(e,t,c);return is&&(x?x.push(h):d&&h()),h}function pl(e,t,s){const o=this.proxy,r=Se(e)?e.includes(".")?Ho(o,e):()=>o[e]:e.bind(o,o);let l;ae(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Fo(r,l.bind(o),s);return a(),c}function Ho(e,t){const s=t.split(".");return()=>{let o=e;for(let r=0;r<s.length&&o;r++)o=o[s[r]];return o}}const ml=Symbol("_vte"),xl=e=>e.__isTeleport,vl=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 Fe(e,t){return ae(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,o,r=!1){if(ne(e)){e.forEach((C,N)=>es(C,t&&(ne(t)?t[N]:t),s,o,r));return}if(ts(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&es(e,t,s,o.component.subTree);return}const l=o.shapeFlag&4?Us(o.component):o.el,a=r?null:l,{i:c,r:d}=e,x=t&&t.r,f=c.refs===be?c.refs={}:c.refs,p=c.setupState,h=de(p),S=p===be?po:C=>Rn(f,C)?!1:fe(h,C),F=(C,N)=>!(N&&Rn(f,N));if(x!=null&&x!==d){if(jn(t),Se(x))f[x]=null,S(x)&&(p[x]=null);else if(Oe(x)){const C=t;F(x,C.k)&&(x.value=null),C.k&&(f[C.k]=null)}}if(ae(d))ds(d,c,12,[a,f]);else{const C=Se(d),N=Oe(d);if(C||N){const $=()=>{if(e.f){const T=C?S(d)?p[d]:f[d]:F()||!e.k?d.value:f[e.k];if(r)ne(T)&&cn(T,l);else if(ne(T))T.includes(l)||T.push(l);else if(C)f[d]=[l],S(d)&&(p[d]=f[d]);else{const L=[l];F(d,e.k)&&(d.value=L),e.k&&(f[e.k]=L)}}else C?(f[d]=a,S(d)&&(p[d]=a)):N&&(F(d,e.k)&&(d.value=a),e.k&&(f[e.k]=a))};if(a){const T=()=>{$(),$s.delete(e)};T.id=-1,$s.set(e,T),je(T,s)}else jn(e),$()}}}function jn(e){const t=$s.get(e);t&&(t.flags|=8,$s.delete(e))}Ms().requestIdleCallback;Ms().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function hl(e,t){zo(e,"da",t)}function zo(e,t,s=Ie){const o=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(js(t,o,s),s){let r=s.parent;for(;r&&r.parent;)Wo(r.parent.vnode)&&yl(o,t,s,r),r=r.parent}}function yl(e,t,s,o){const r=js(t,e,o,!0);wn(()=>{cn(o[t],r)},s)}function js(e,t,s=Ie,o=!1){if(s){const r=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),d=lt(t,s,e,a);return c(),vt(),d});return o?r.unshift(l):r.push(l),l}}const yt=e=>(t,s=Ie)=>{(!is||e==="sp")&&js(e,(...o)=>t(...o),s)},bl=yt("bm"),Ne=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=Ie){js("ec",e,t)}const Pl="components",Jo=Symbol.for("v-ndc");function El(e){return Se(e)?Al(Pl,e,!1)||e:e||Jo}function Al(e,t,s=!0,o=!1){const r=Ve||Ie;if(r){const l=r.type;{const c=xa(l,!1);if(c&&(c===t||c===Re(t)||c===Is(Re(t))))return l}const a=Ln(r[e]||l[e],t)||Ln(r.appContext[e],t);return!a&&o?l:a}}function Ln(e,t){return e&&(e[t]||e[Re(t)]||e[Is(Re(t))])}function pe(e,t,s,o){let r;const l=s,a=ne(e);if(a||Se(e)){const c=a&&At(e);let d=!1,x=!1;c&&(d=!He(e),x=gt(e),e=Ds(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(d?x?Ut(ze(e[f])):ze(e[f]):e[f],f,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let c=0;c<e;c++)r[c]=t(c+1,c,void 0,l)}else if(he(e))if(e[Symbol.iterator])r=Array.from(e,(c,d)=>t(c,d,void 0,l));else{const c=Object.keys(e);r=new Array(c.length);for(let d=0,x=c.length;d<x;d++){const f=c[d];r[d]=t(e[f],f,d,l)}}else r=[];return r}const tn=e=>e?xr(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=Lo.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==be&&!e.__isScriptSetup&&fe(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:o,data:r,props:l,accessCache:a,type:c,appContext:d}=e;if(t[0]!=="$"){const h=a[t];if(h!==void 0)switch(h){case 1:return o[t];case 2:return r[t];case 4:return s[t];case 3:return l[t]}else{if(zs(o,t))return a[t]=1,o[t];if(r!==be&&fe(r,t))return a[t]=2,r[t];if(fe(l,t))return a[t]=3,l[t];if(s!==be&&fe(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const x=ss[t];let f,p;if(x)return t==="$attrs"&&Ae(e.attrs,"get",""),x(e);if((f=c.__cssModules)&&(f=f[t]))return f;if(s!==be&&fe(s,t))return a[t]=4,s[t];if(p=d.config.globalProperties,fe(p,t))return p[t]},set({_:e},t,s){const{data:o,setupState:r,ctx:l}=e;return zs(r,t)?(r[t]=s,!0):o!==be&&fe(o,t)?(o[t]=s,!0):fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:o,appContext:r,props:l,type:a}},c){let d;return!!(s[c]||e!==be&&c[0]!=="$"&&fe(e,c)||zs(t,c)||fe(l,c)||fe(o,c)||fe(ss,c)||fe(r.config.globalProperties,c)||(d=a.__cssModules)&&d[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:fe(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Nn(e){return ne(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ol(e){const t=Go(e),s=e.proxy,o=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:c,provide:d,inject:x,created:f,beforeMount:p,mounted:h,beforeUpdate:S,updated:F,activated:C,deactivated:N,beforeDestroy:$,beforeUnmount:T,destroyed:L,unmounted:I,render:V,renderTracked:b,renderTriggered:O,errorCaptured:le,serverPrefetch:ve,expose:me,inheritAttrs:z,components:k,directives:M,filters:U}=t;if(x&&Ml(x,o,null),a)for(const ie in a){const ee=a[ie];ae(ee)&&(o[ie]=ee.bind(s))}if(r){const ie=r.call(s,s);he(ie)&&(e.data=gn(ie))}if(sn=!0,l)for(const ie in l){const ee=l[ie],q=ae(ee)?ee.bind(s,s):ae(ee.get)?ee.get.bind(s,s):nt,j=!ae(ee)&&ae(ee.set)?ee.set.bind(s):nt,Ce=Pe({get:q,set:j});Object.defineProperty(o,ie,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:ke=>Ce.value=ke})}if(c)for(const ie in c)qo(c[ie],o,s,ie);if(d){const ie=ae(d)?d.call(s):d;Reflect.ownKeys(ie).forEach(ee=>{ul(ee,ie[ee])})}f&&Un(f,e,"c");function G(ie,ee){ne(ee)?ee.forEach(q=>ie(q.bind(s))):ee&&ie(ee.bind(s))}if(G(bl,p),G(Ne,h),G(_l,S),G(wl,F),G(gl,C),G(hl,N),G(Tl,le),G(Cl,b),G($l,O),G(kl,T),G(wn,I),G(Sl,ve),ne(me))if(me.length){const ie=e.exposed||(e.exposed={});me.forEach(ee=>{Object.defineProperty(ie,ee,{get:()=>s[ee],set:q=>s[ee]=q,enumerable:!0})})}else e.exposed||(e.exposed={});V&&e.render===nt&&(e.render=V),z!=null&&(e.inheritAttrs=z),k&&(e.components=k),M&&(e.directives=M),ve&&Ko(e)}function Ml(e,t,s=nt){ne(e)&&(e=nn(e));for(const o in e){const r=e[o];let l;he(r)?"default"in r?l=hs(r.from||o,r.default,!0):l=hs(r.from||o):l=hs(r),Oe(l)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[o]=l}}function Un(e,t,s){lt(ne(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,o){let r=o.includes(".")?Ho(s,o):()=>s[o];if(Se(e)){const l=t[e];ae(l)&&Ws(r,l)}else if(ae(e))Ws(r,e.bind(s));else if(he(e))if(ne(e))e.forEach(l=>qo(l,t,s,o));else{const l=ae(e.handler)?e.handler.bind(s):t[e.handler];ae(l)&&Ws(r,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:o}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let d;return c?d=c:!r.length&&!s&&!o?d=t:(d={},r.length&&r.forEach(x=>Cs(d,x,a,!0)),Cs(d,t,a)),he(t)&&l.set(t,d),d}function Cs(e,t,s,o=!1){const{mixins:r,extends:l}=t;l&&Cs(e,l,s,!0),r&&r.forEach(a=>Cs(e,a,s,!0));for(const a in t)if(!(o&&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:Bn,emits:Bn,methods:Yt,computed:Yt,beforeCreate:Me,created:Me,beforeMount:Me,mounted:Me,beforeUpdate:Me,updated:Me,beforeDestroy:Me,beforeUnmount:Me,destroyed:Me,unmounted:Me,activated:Me,deactivated:Me,errorCaptured:Me,serverPrefetch:Me,components:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ee(ae(e)?e.call(this,this):e,ae(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(ne(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Me(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Ee(Object.create(null),e,t):t}function Bn(e,t){return e?ne(e)&&ne(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Nn(e),Nn(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const o in t)s[o]=Me(e[o],t[o]);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 Ll=0;function Nl(e,t){return function(o,r=null){ae(o)||(o=Ee({},o)),r!=null&&!he(r)&&(r=null);const l=Yo(),a=new WeakSet,c=[];let d=!1;const x=l.app={_uid:Ll++,_component:o,_props:r,_container:null,_context:l,_instance:null,version:ga,get config(){return l.config},set config(f){},use(f,...p){return a.has(f)||(f&&ae(f.install)?(a.add(f),f.install(x,...p)):ae(f)&&(a.add(f),f(x,...p))),x},mixin(f){return l.mixins.includes(f)||l.mixins.push(f),x},component(f,p){return p?(l.components[f]=p,x):l.components[f]},directive(f,p){return p?(l.directives[f]=p,x):l.directives[f]},mount(f,p,h){if(!d){const S=x._ceVNode||ot(o,r);return S.appContext=l,h===!0?h="svg":h===!1&&(h=void 0),e(S,f,h),d=!0,x._container=f,f.__vue_app__=x,Us(S.component)}},onUnmount(f){c.push(f)},unmount(){d&&(lt(c,x._instance,16),e(null,x._container),delete x._container.__vue_app__)},provide(f,p){return l.provides[f]=p,x},runWithContext(f){const p=Nt;Nt=x;try{return f()}finally{Nt=p}}};return x}}let Nt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${$t(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const o=e.vnode.props||be;let r=s;const l=t.startsWith("update:"),a=l&&Ul(o,t.slice(7));a&&(a.trim&&(r=s.map(f=>Se(f)?f.trim():f)),a.number&&(r=s.map(Os)));let c,d=o[c=Vs(t)]||o[c=Vs(Re(t))];!d&&l&&(d=o[c=Vs($t(t))]),d&<(d,e,6,r);const x=o[c+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,lt(x,e,6,r)}}const Bl=new WeakMap;function Zo(e,t,s=!1){const o=s?Bl:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const l=e.emits;let a={},c=!1;if(!ae(e)){const d=x=>{const f=Zo(x,t,!0);f&&(c=!0,Ee(a,f))};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!l&&!c?(he(e)&&o.set(e,null),null):(ne(l)?l.forEach(d=>a[d]=null):Ee(a,l),he(e)&&o.set(e,a),a)}function Ls(e,t){return!e||!Ps(t)?!1:(t=t.slice(2).replace(/Once$/,""),fe(e,t[0].toLowerCase()+t.slice(1))||fe(e,$t(t))||fe(e,t))}function Fn(e){const{type:t,vnode:s,proxy:o,withProxy:r,propsOptions:[l],slots:a,attrs:c,emit:d,render:x,renderCache:f,props:p,data:h,setupState:S,ctx:F,inheritAttrs:C}=e,N=Ss(e);let $,T;try{if(s.shapeFlag&4){const I=r||o,V=I;$=tt(x.call(V,I,f,p,S,h,F)),T=c}else{const I=t;$=tt(I.length>1?I(p,{attrs:c,slots:a,emit:d}):I(p,null)),T=t.props?c:Fl(c)}}catch(I){ns.length=0,Rs(I,e,1),$=ot(St)}let L=$;if(T&&C!==!1){const I=Object.keys(T),{shapeFlag:V}=L;I.length&&V&7&&(l&&I.some(Es)&&(T=Hl(T,l)),L=Vt(L,T,!1,!0))}return s.dirs&&(L=Vt(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(s.dirs):s.dirs),s.transition&&_n(L,s.transition),$=L,Ss(N),$}const Fl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ps(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const o in e)(!Es(o)||!(o.slice(9)in t))&&(s[o]=e[o]);return s};function Kl(e,t,s){const{props:o,children:r,component:l}=e,{props:a,children:c,patchFlag:d}=t,x=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return o?Hn(o,a,x):!!a;if(d&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const h=f[p];if(Qo(a,o,h)&&!Ls(x,h))return!0}}}else return(r||c)&&(!c||!c.$stable)?!0:o===a?!1:o?a?Hn(o,a,x):!0:!!a;return!1}function Hn(e,t,s){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r<o.length;r++){const l=o[r];if(Qo(t,e,l)&&!Ls(s,l))return!0}return!1}function Qo(e,t,s){const o=e[s],r=t[s];return s==="style"&&he(o)&&he(r)?!Ht(o,r):o!==r}function Wl({vnode:e,parent:t,suspense:s},o){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=o,e=r),r===e)(e=t.vnode).el=o,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=o)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,o=!1){const r={},l=er();e.propsDefaults=Object.create(null),sr(e,t,r,l);for(const a in e.propsOptions[0])a in r||(r[a]=void 0);s?e.props=o?r:Yr(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function Jl(e,t,s,o){const{props:r,attrs:l,vnode:{patchFlag:a}}=e,c=de(r),[d]=e.propsOptions;let x=!1;if((o||a>0)&&!(a&16)){if(a&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let h=f[p];if(Ls(e.emitsOptions,h))continue;const S=t[h];if(d)if(fe(l,h))S!==l[h]&&(l[h]=S,x=!0);else{const F=Re(h);r[F]=on(d,c,F,S,e,!1)}else S!==l[h]&&(l[h]=S,x=!0)}}}else{sr(e,t,r,l)&&(x=!0);let f;for(const p in c)(!t||!fe(t,p)&&((f=$t(p))===p||!fe(t,f)))&&(d?s&&(s[p]!==void 0||s[f]!==void 0)&&(r[p]=on(d,c,p,void 0,e,!0)):delete r[p]);if(l!==c)for(const p in l)(!t||!fe(t,p))&&(delete l[p],x=!0)}x&&ft(e.attrs,"set","")}function sr(e,t,s,o){const[r,l]=e.propsOptions;let a=!1,c;if(t)for(let d in t){if(Zt(d))continue;const x=t[d];let f;r&&fe(r,f=Re(d))?!l||!l.includes(f)?s[f]=x:(c||(c={}))[f]=x:Ls(e.emitsOptions,d)||(!(d in o)||x!==o[d])&&(o[d]=x,a=!0)}if(l){const d=de(s),x=c||be;for(let f=0;f<l.length;f++){const p=l[f];s[p]=on(r,d,p,x[p],e,!fe(x,p))}}return a}function on(e,t,s,o,r,l){const a=e[s];if(a!=null){const c=fe(a,"default");if(c&&o===void 0){const d=a.default;if(a.type!==Function&&!a.skipFactory&&ae(d)){const{propsDefaults:x}=r;if(s in x)o=x[s];else{const f=fs(r);o=x[s]=d.call(null,t),f()}}else o=d;r.ce&&r.ce._setProp(s,o)}a[0]&&(l&&!c?o=!1:a[1]&&(o===""||o===$t(s))&&(o=!0))}return o}const ql=new WeakMap;function nr(e,t,s=!1){const o=s?ql:t.propsCache,r=o.get(e);if(r)return r;const l=e.props,a={},c=[];let d=!1;if(!ae(e)){const f=p=>{d=!0;const[h,S]=nr(p,t,!0);Ee(a,h),S&&c.push(...S)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!l&&!d)return he(e)&&o.set(e,Rt),Rt;if(ne(l))for(let f=0;f<l.length;f++){const p=Re(l[f]);Kn(p)&&(a[p]=be)}else if(l)for(const f in l){const p=Re(f);if(Kn(p)){const h=l[f],S=a[p]=ne(h)||ae(h)?{type:h}:Ee({},h),F=S.type;let C=!1,N=!0;if(ne(F))for(let $=0;$<F.length;++$){const T=F[$],L=ae(T)&&T.name;if(L==="Boolean"){C=!0;break}else L==="String"&&(N=!1)}else C=ae(F)&&F.name==="Boolean";S[0]=C,S[1]=N,(C||fe(S,"default"))&&c.push(p)}}const x=[a,c];return he(e)&&o.set(e,x),x}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>ne(e)?e.map(tt):[tt(e)],Gl=(e,t,s)=>{if(t._n)return t;const o=cl((...r)=>Sn(t(...r)),s);return o._c=!1,o},or=(e,t,s)=>{const o=e._ctx;for(const r in e){if(kn(r))continue;const l=e[r];if(ae(l))t[r]=Gl(r,l,o);else if(l!=null){const a=Sn(l);t[r]=()=>a}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const o in t)(s||!kn(o))&&(e[o]=t[o])},Yl=(e,t,s)=>{const o=e.slots=er();if(e.vnode.shapeFlag&32){const r=t._;r?(lr(o,t,s),s&&go(o,"_",r,!0)):or(t,o)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:o,slots:r}=e;let l=!0,a=be;if(o.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(r,t,s):(l=!t.$stable,or(t,r)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in r)!kn(c)&&a[c]==null&&delete r[c]},je=sa;function Ql(e){return Xl(e)}function Xl(e,t){const s=Ms();s.__VUE__=!0;const{insert:o,remove:r,patchProp:l,createElement:a,createText:c,createComment:d,setText:x,setElementText:f,parentNode:p,nextSibling:h,setScopeId:S=nt,insertStaticContent:F}=e,C=(i,u,w,P=null,m=null,A=null,K=void 0,R=null,B=!!u.dynamicChildren)=>{if(i===u)return;i&&!Jt(i,u)&&(P=bt(i),ke(i,m,A,!0),i=null),u.patchFlag===-2&&(B=!1,u.dynamicChildren=null);const{type:D,ref:X,shapeFlag:J}=u;switch(D){case Ns:N(i,u,w,P);break;case St:$(i,u,w,P);break;case ys:i==null&&T(u,w,P,K);break;case re:k(i,u,w,P,m,A,K,R,B);break;default:J&1?V(i,u,w,P,m,A,K,R,B):J&6?M(i,u,w,P,m,A,K,R,B):(J&64||J&128)&&D.process(i,u,w,P,m,A,K,R,B,Ke)}X!=null&&m?es(X,i&&i.ref,A,u||i,!u):X==null&&i&&i.ref!=null&&es(i.ref,null,A,i,!0)},N=(i,u,w,P)=>{if(i==null)o(u.el=c(u.children),w,P);else{const m=u.el=i.el;u.children!==i.children&&x(m,u.children)}},$=(i,u,w,P)=>{i==null?o(u.el=d(u.children||""),w,P):u.el=i.el},T=(i,u,w,P)=>{[i.el,i.anchor]=F(i.children,u,w,P,i.el,i.anchor)},L=({el:i,anchor:u},w,P)=>{let m;for(;i&&i!==u;)m=h(i),o(i,w,P),i=m;o(u,w,P)},I=({el:i,anchor:u})=>{let w;for(;i&&i!==u;)w=h(i),r(i),i=w;r(u)},V=(i,u,w,P,m,A,K,R,B)=>{if(u.type==="svg"?K="svg":u.type==="math"&&(K="mathml"),i==null)b(u,w,P,m,A,K,R,B);else{const D=i.el&&i.el._isVueCE?i.el:null;try{D&&D._beginPatch(),ve(i,u,m,A,K,R,B)}finally{D&&D._endPatch()}}},b=(i,u,w,P,m,A,K,R)=>{let B,D;const{props:X,shapeFlag:J,transition:Q,dirs:oe}=i;if(B=i.el=a(i.type,A,X&&X.is,X),J&8?f(B,i.children):J&16&&le(i.children,B,null,P,m,Js(i,A),K,R),oe&&Ct(i,null,P,"created"),O(B,i,i.scopeId,K,P),X){for(const ye in X)ye!=="value"&&!Zt(ye)&&l(B,ye,null,X[ye],A,P);"value"in X&&l(B,"value",null,X.value,A),(D=X.onVnodeBeforeMount)&&Ze(D,P,i)}oe&&Ct(i,null,P,"beforeMount");const ue=ea(m,Q);ue&&Q.beforeEnter(B),o(B,u,w),((D=X&&X.onVnodeMounted)||ue||oe)&&je(()=>{try{D&&Ze(D,P,i),ue&&Q.enter(B),oe&&Ct(i,null,P,"mounted")}finally{}},m)},O=(i,u,w,P,m)=>{if(w&&S(i,w),P)for(let A=0;A<P.length;A++)S(i,P[A]);if(m){let A=m.subTree;if(u===A||ur(A.type)&&(A.ssContent===u||A.ssFallback===u)){const K=m.vnode;O(i,K,K.scopeId,K.slotScopeIds,m.parent)}}},le=(i,u,w,P,m,A,K,R,B=0)=>{for(let D=B;D<i.length;D++){const X=i[D]=R?dt(i[D]):tt(i[D]);C(null,X,u,w,P,m,A,K,R)}},ve=(i,u,w,P,m,A,K)=>{const R=u.el=i.el;let{patchFlag:B,dynamicChildren:D,dirs:X}=u;B|=i.patchFlag&16;const J=i.props||be,Q=u.props||be;let oe;if(w&&Tt(w,!1),(oe=Q.onVnodeBeforeUpdate)&&Ze(oe,w,u,i),X&&Ct(u,i,w,"beforeUpdate"),w&&Tt(w,!0),(J.innerHTML&&Q.innerHTML==null||J.textContent&&Q.textContent==null)&&f(R,""),D?me(i.dynamicChildren,D,R,w,P,Js(u,m),A):K||ee(i,u,R,null,w,P,Js(u,m),A,!1),B>0){if(B&16)z(R,J,Q,w,m);else if(B&2&&J.class!==Q.class&&l(R,"class",null,Q.class,m),B&4&&l(R,"style",J.style,Q.style,m),B&8){const ue=u.dynamicProps;for(let ye=0;ye<ue.length;ye++){const _e=ue[ye],$e=J[_e],Te=Q[_e];(Te!==$e||_e==="value")&&l(R,_e,$e,Te,m,w)}}B&1&&i.children!==u.children&&f(R,u.children)}else!K&&D==null&&z(R,J,Q,w,m);((oe=Q.onVnodeUpdated)||X)&&je(()=>{oe&&Ze(oe,w,u,i),X&&Ct(u,i,w,"updated")},P)},me=(i,u,w,P,m,A,K)=>{for(let R=0;R<u.length;R++){const B=i[R],D=u[R],X=B.el&&(B.type===re||!Jt(B,D)||B.shapeFlag&198)?p(B.el):w;C(B,D,X,null,P,m,A,K,!0)}},z=(i,u,w,P,m)=>{if(u!==w){if(u!==be)for(const A in u)!Zt(A)&&!(A in w)&&l(i,A,u[A],null,m,P);for(const A in w){if(Zt(A))continue;const K=w[A],R=u[A];K!==R&&A!=="value"&&l(i,A,R,K,m,P)}"value"in w&&l(i,"value",u.value,w.value,m)}},k=(i,u,w,P,m,A,K,R,B)=>{const D=u.el=i?i.el:c(""),X=u.anchor=i?i.anchor:c("");let{patchFlag:J,dynamicChildren:Q,slotScopeIds:oe}=u;oe&&(R=R?R.concat(oe):oe),i==null?(o(D,w,P),o(X,w,P),le(u.children||[],w,X,m,A,K,R,B)):J>0&&J&64&&Q&&i.dynamicChildren&&i.dynamicChildren.length===Q.length?(me(i.dynamicChildren,Q,w,m,A,K,R),(u.key!=null||m&&u===m.subTree)&&ar(i,u,!0)):ee(i,u,w,X,m,A,K,R,B)},M=(i,u,w,P,m,A,K,R,B)=>{u.slotScopeIds=R,i==null?u.shapeFlag&512?m.ctx.activate(u,w,P,K,B):U(u,w,P,m,A,K,B):E(i,u,B)},U=(i,u,w,P,m,A,K)=>{const R=i.component=ca(i,P,m);if(Wo(i)&&(R.ctx.renderer=Ke),da(R,!1,K),R.asyncDep){if(m&&m.registerDep(R,G,K),!i.el){const B=R.subTree=ot(St);$(null,B,u,w),i.placeholder=B.el}}else G(R,i,u,w,m,A,K)},E=(i,u,w)=>{const P=u.component=i.component;if(Kl(i,u,w))if(P.asyncDep&&!P.asyncResolved){ie(P,u,w);return}else P.next=u,P.update();else u.el=i.el,P.vnode=u},G=(i,u,w,P,m,A,K)=>{const R=()=>{if(i.isMounted){let{next:J,bu:Q,u:oe,parent:ue,vnode:ye}=i;{const Ge=ir(i);if(Ge){J&&(J.el=ye.el,ie(i,J,K)),Ge.asyncDep.then(()=>{je(()=>{i.isUnmounted||D()},m)});return}}let _e=J,$e;Tt(i,!1),J?(J.el=ye.el,ie(i,J,K)):J=ye,Q&&gs(Q),($e=J.props&&J.props.onVnodeBeforeUpdate)&&Ze($e,ue,J,ye),Tt(i,!0);const Te=Fn(i),qe=i.subTree;i.subTree=Te,C(qe,Te,p(qe.el),bt(qe),i,m,A),J.el=Te.el,_e===null&&Wl(i,Te.el),oe&&je(oe,m),($e=J.props&&J.props.onVnodeUpdated)&&je(()=>Ze($e,ue,J,ye),m)}else{let J;const{el:Q,props:oe}=u,{bm:ue,m:ye,parent:_e,root:$e,type:Te}=i,qe=ts(u);Tt(i,!1),ue&&gs(ue),!qe&&(J=oe&&oe.onVnodeBeforeMount)&&Ze(J,_e,u),Tt(i,!0);{$e.ce&&$e.ce._hasShadowRoot()&&$e.ce._injectChildStyle(Te,i.parent?i.parent.type:void 0);const Ge=i.subTree=Fn(i);C(null,Ge,w,P,i,m,A),u.el=Ge.el}if(ye&&je(ye,m),!qe&&(J=oe&&oe.onVnodeMounted)){const Ge=u;je(()=>Ze(J,_e,Ge),m)}(u.shapeFlag&256||_e&&ts(_e.vnode)&&_e.vnode.shapeFlag&256)&&i.a&&je(i.a,m),i.isMounted=!0,u=w=P=null}};i.scope.on();const B=i.effect=new _o(R);i.scope.off();const D=i.update=B.run.bind(B),X=i.job=B.runIfDirty.bind(B);X.i=i,X.id=i.uid,B.scheduler=()=>bn(X),Tt(i,!0),D()},ie=(i,u,w)=>{u.component=i;const P=i.vnode.props;i.vnode=u,i.next=null,Jl(i,u.props,P,w),Zl(i,u.children,w),xt(),Dn(i),vt()},ee=(i,u,w,P,m,A,K,R,B=!1)=>{const D=i&&i.children,X=i?i.shapeFlag:0,J=u.children,{patchFlag:Q,shapeFlag:oe}=u;if(Q>0){if(Q&128){j(D,J,w,P,m,A,K,R,B);return}else if(Q&256){q(D,J,w,P,m,A,K,R,B);return}}oe&8?(X&16&&Je(D,m,A),J!==D&&f(w,J)):X&16?oe&16?j(D,J,w,P,m,A,K,R,B):Je(D,m,A,!0):(X&8&&f(w,""),oe&16&&le(J,w,P,m,A,K,R,B))},q=(i,u,w,P,m,A,K,R,B)=>{i=i||Rt,u=u||Rt;const D=i.length,X=u.length,J=Math.min(D,X);let Q;for(Q=0;Q<J;Q++){const oe=u[Q]=B?dt(u[Q]):tt(u[Q]);C(i[Q],oe,w,null,m,A,K,R,B)}D>X?Je(i,m,A,!0,!1,J):le(u,w,P,m,A,K,R,B,J)},j=(i,u,w,P,m,A,K,R,B)=>{let D=0;const X=u.length;let J=i.length-1,Q=X-1;for(;D<=J&&D<=Q;){const oe=i[D],ue=u[D]=B?dt(u[D]):tt(u[D]);if(Jt(oe,ue))C(oe,ue,w,null,m,A,K,R,B);else break;D++}for(;D<=J&&D<=Q;){const oe=i[J],ue=u[Q]=B?dt(u[Q]):tt(u[Q]);if(Jt(oe,ue))C(oe,ue,w,null,m,A,K,R,B);else break;J--,Q--}if(D>J){if(D<=Q){const oe=Q+1,ue=oe<X?u[oe].el:P;for(;D<=Q;)C(null,u[D]=B?dt(u[D]):tt(u[D]),w,ue,m,A,K,R,B),D++}}else if(D>Q)for(;D<=J;)ke(i[D],m,A,!0),D++;else{const oe=D,ue=D,ye=new Map;for(D=ue;D<=Q;D++){const Ue=u[D]=B?dt(u[D]):tt(u[D]);Ue.key!=null&&ye.set(Ue.key,D)}let _e,$e=0;const Te=Q-ue+1;let qe=!1,Ge=0;const Wt=new Array(Te);for(D=0;D<Te;D++)Wt[D]=0;for(D=oe;D<=J;D++){const Ue=i[D];if($e>=Te){ke(Ue,m,A,!0);continue}let Ye;if(Ue.key!=null)Ye=ye.get(Ue.key);else for(_e=ue;_e<=Q;_e++)if(Wt[_e-ue]===0&&Jt(Ue,u[_e])){Ye=_e;break}Ye===void 0?ke(Ue,m,A,!0):(Wt[Ye-ue]=D+1,Ye>=Ge?Ge=Ye:qe=!0,C(Ue,u[Ye],w,null,m,A,K,R,B),$e++)}const Tn=qe?ta(Wt):Rt;for(_e=Tn.length-1,D=Te-1;D>=0;D--){const Ue=ue+D,Ye=u[Ue],Pn=u[Ue+1],En=Ue+1<X?Pn.el||cr(Pn):P;Wt[D]===0?C(null,Ye,w,En,m,A,K,R,B):qe&&(_e<0||D!==Tn[_e]?Ce(Ye,w,En,2):_e--)}}},Ce=(i,u,w,P,m=null)=>{const{el:A,type:K,transition:R,children:B,shapeFlag:D}=i;if(D&6){Ce(i.component.subTree,u,w,P);return}if(D&128){i.suspense.move(u,w,P);return}if(D&64){K.move(i,u,w,Ke);return}if(K===re){o(A,u,w);for(let J=0;J<B.length;J++)Ce(B[J],u,w,P);o(i.anchor,u,w);return}if(K===ys){L(i,u,w);return}if(P!==2&&D&1&&R)if(P===0)R.beforeEnter(A),o(A,u,w),je(()=>R.enter(A),m);else{const{leave:J,delayLeave:Q,afterLeave:oe}=R,ue=()=>{i.ctx.isUnmounted?r(A):o(A,u,w)},ye=()=>{A._isLeaving&&A[vl](!0),J(A,()=>{ue(),oe&&oe()})};Q?Q(A,ue,ye):ye()}else o(A,u,w)},ke=(i,u,w,P=!1,m=!1)=>{const{type:A,props:K,ref:R,children:B,dynamicChildren:D,shapeFlag:X,patchFlag:J,dirs:Q,cacheIndex:oe,memo:ue}=i;if(J===-2&&(m=!1),R!=null&&(xt(),es(R,null,w,i,!0),vt()),oe!=null&&(u.renderCache[oe]=void 0),X&256){u.ctx.deactivate(i);return}const ye=X&1&&Q,_e=!ts(i);let $e;if(_e&&($e=K&&K.onVnodeBeforeUnmount)&&Ze($e,u,i),X&6)Ot(i.component,w,P);else{if(X&128){i.suspense.unmount(w,P);return}ye&&Ct(i,null,u,"beforeUnmount"),X&64?i.type.remove(i,u,w,Ke,P):D&&!D.hasOnce&&(A!==re||J>0&&J&64)?Je(D,u,w,!1,!0):(A===re&&J&384||!m&&X&16)&&Je(B,u,w),P&&ge(i)}const Te=ue!=null&&oe==null;(_e&&($e=K&&K.onVnodeUnmounted)||ye||Te)&&je(()=>{$e&&Ze($e,u,i),ye&&Ct(i,null,u,"unmounted"),Te&&(i.el=null)},w)},ge=i=>{const{type:u,el:w,anchor:P,transition:m}=i;if(u===re){at(w,P);return}if(u===ys){I(i);return}const A=()=>{r(w),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(i.shapeFlag&1&&m&&!m.persisted){const{leave:K,delayLeave:R}=m,B=()=>K(w,A);R?R(i.el,A,B):B()}else A()},at=(i,u)=>{let w;for(;i!==u;)w=h(i),r(i),i=w;r(u)},Ot=(i,u,w)=>{const{bum:P,scope:m,job:A,subTree:K,um:R,m:B,a:D}=i;Wn(B),Wn(D),P&&gs(P),m.stop(),A&&(A.flags|=8,ke(K,i,u,w)),R&&je(R,u),je(()=>{i.isUnmounted=!0},u)},Je=(i,u,w,P=!1,m=!1,A=0)=>{for(let K=A;K<i.length;K++)ke(i[K],u,w,P,m)},bt=i=>{if(i.shapeFlag&6)return bt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const u=h(i.anchor||i.el),w=u&&u[ml];return w?h(w):u};let Kt=!1;const _t=(i,u,w)=>{let P;i==null?u._vnode&&(ke(u._vnode,null,null,!0),P=u._vnode.component):C(u._vnode||null,i,u,null,null,null,w),u._vnode=i,Kt||(Kt=!0,Dn(P),Uo(),Kt=!1)},Ke={p:C,um:ke,m:Ce,r:ge,mt:U,mc:le,pc:ee,pbc:me,n:bt,o:e};return{render:_t,hydrate:void 0,createApp:Nl(_t)}}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 Tt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ea(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ar(e,t,s=!1){const o=e.children,r=t.children;if(ne(o)&&ne(r))for(let l=0;l<o.length;l++){const a=o[l];let c=r[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=r[l]=dt(r[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ar(a,c)),c.type===Ns&&(c.patchFlag===-1&&(c=r[l]=dt(c)),c.el=a.el),c.type===St&&!c.el&&(c.el=a.el)}}function ta(e){const t=e.slice(),s=[0];let o,r,l,a,c;const d=e.length;for(o=0;o<d;o++){const x=e[o];if(x!==0){if(r=s[s.length-1],e[r]<x){t[o]=r,s.push(o);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[o]=s[l-1]),s[l]=o)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(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 sa(e,t){t&&t.pendingBranch?ne(e)?t.effects.push(...e):t.effects.push(e):il(e)}const re=Symbol.for("v-fgt"),Ns=Symbol.for("v-txt"),St=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Be=null;function v(e=!1){ns.push(Be=e?null:[])}function na(){ns.pop(),Be=ns[ns.length-1]||null}let as=1;function zn(e,t=!1){as+=e,e<0&&Be&&t&&(Be.hasOnce=!0)}function dr(e){return e.dynamicChildren=as>0?Be||Rt:null,na(),as>0&&Be&&Be.push(e),e}function g(e,t,s,o,r,l){return dr(n(e,t,s,o,r,l,!0))}function fr(e,t,s,o,r){return dr(ot(e,t,s,o,r,!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?Se(e)||Oe(e)||ae(e)?{i:Ve,r:e,k:t,f:!!s}:e:null);function n(e,t=null,s=null,o=0,r=null,l=e===re?0:1,a=!1,c=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Bo,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:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ve};return c?($n(d,s),l&128&&e.normalize(d)):s&&(d.shapeFlag|=Se(s)?8:16),as>0&&!a&&Be&&(d.patchFlag>0||l&6)&&d.patchFlag!==32&&Be.push(d),d}const ot=oa;function oa(e,t=null,s=null,o=0,r=null,l=!1){if((!e||e===Jo)&&(e=St),pr(e)){const c=Vt(e,t,!0);return s&&$n(c,s),as>0&&!l&&Be&&(c.shapeFlag&6?Be[Be.indexOf(e)]=c:Be.push(c)),c.patchFlag=-2,c}if(va(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:c,style:d}=t;c&&!Se(c)&&(t.class=Y(c)),he(d)&&(yn(d)&&!ne(d)&&(d=Ee({},d)),t.style=It(d))}const a=Se(e)?1:ur(e)?128:xl(e)?64:he(e)?4:ae(e)?2:0;return n(e,t,s,o,r,a,l,!0)}function ra(e){return e?yn(e)||tr(e)?Ee({},e):e:null}function Vt(e,t,s=!1,o=!1){const{props:r,ref:l,patchFlag:a,children:c,transition:d}=e,x=t?la(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:x,key:x&&mr(x),ref:t&&t.ref?s&&l?ne(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!==re?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,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 d&&o&&_n(f,d.clone(f)),f}function te(e=" ",t=0){return ot(Ns,null,e,t)}function ut(e,t){const s=ot(ys,null,e);return s.staticCount=t,s}function W(e="",t=!1){return t?(v(),fr(St,null,e)):ot(St,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot(St):ne(e)?ot(re,null,e.slice()):pr(e)?dt(e):ot(Ns,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function $n(e,t){let s=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ne(t))s=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),$n(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Ve:r===3&&Ve&&(Ve.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ae(t)?(t={default:t,_ctx:Ve},s=32):(t=String(t),o&64?(s=16,t=[te(t)]):s=8);e.children=t,e.shapeFlag|=s}function la(...e){const t={};for(let s=0;s<e.length;s++){const o=e[s];for(const r in o)if(r==="class")t.class!==o.class&&(t.class=Y([t.class,o.class]));else if(r==="style")t.style=It([t.style,o.style]);else if(Ps(r)){const l=t[r],a=o[r];a&&l!==a&&!(ne(l)&&l.includes(a))?t[r]=l?[].concat(l,a):a:a==null&&l==null&&!Es(r)&&(t[r]=a)}else r!==""&&(t[r]=o[r])}return t}function Ze(e,t,s,o=null){lt(e,t,7,[s,o])}const aa=Yo();let ia=0;function ca(e,t,s){const o=e.type,r=(t?t.appContext:e.appContext)||aa,l={uid:ia++,vnode:e,type:o,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(o,r),emitsOptions:Zo(o,r),emit:null,emitted:null,propsDefaults:be,inheritAttrs:o.inheritAttrs,ctx:be,data:be,props:be,attrs:be,slots:be,refs:be,setupState:be,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 Ie=null;const ua=()=>Ie||Ve;let Ts,rn;{const e=Ms(),t=(s,o)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(o),l=>{r.length>1?r.forEach(a=>a(l)):r[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Ie=s),rn=t("__VUE_SSR_SETTERS__",s=>is=s)}const fs=e=>{const t=Ie;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Ie&&Ie.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let is=!1;function da(e,t=!1,s=!1){t&&rn(t);const{props:o,children:r}=e.vnode,l=xr(e);zl(e,o,l,t),Yl(e,r,s||t);const a=l?fa(e,t):void 0;return t&&rn(!1),a}function fa(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Il);const{setup:o}=s;if(o){xt();const r=e.setupContext=o.length>1?ma(e):null,l=fs(e),a=ds(o,e,0,[e.props,r]),c=mo(a);if(vt(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(d=>{qn(e,d)}).catch(d=>{Rs(d,e,0)});e.asyncDep=a}else qn(e,a)}else vr(e)}function qn(e,t,s){ae(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=Ro(t)),vr(e)}function vr(e,t,s){const o=e.type;e.render||(e.render=o.render||nt);{const r=fs(e);xt();try{Ol(e)}finally{vt(),r()}}}const pa={get(e,t){return Ae(e,"get",""),e[t]}};function ma(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pa),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 xa(e,t=!0){return ae(e)?e.displayName||e.name:e.name||t&&e.__name}function va(e){return ae(e)&&"__vccOpts"in e}const Pe=(e,t)=>nl(e,t,is),ga="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 hr=ln?e=>ln.createHTML(e):e=>e,ga="http://www.w3.org/2000/svg",ya="http://www.w3.org/1998/Math/MathML",it=typeof document<"u"?document:null,Yn=it&&it.createElement("template"),ba={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 r=t==="svg"?it.createElementNS(ga,e):t==="mathml"?it.createElementNS(ya,e):s?it.createElement(e,{is:s}):it.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>it.createTextNode(e),createComment:e=>it.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>it.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,l){const a=s?s.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===l||!(r=r.nextSibling)););else{Yn.innerHTML=hr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const i=Yn.content;if(n==="svg"||n==="mathml"){const c=i.firstChild;for(;c.firstChild;)i.appendChild(c.firstChild);i.removeChild(c)}t.insertBefore(i,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function wa(e,t,s){const n=e[_a];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ka=Symbol("_vsh"),Sa=Symbol(""),$a=/(?:^|;)\s*display\s*:/;function Ca(e,t,s){const n=e.style,r=ke(s);let l=!1;if(s&&!r){if(t)if(ke(t))for(const a of t.split(";")){const i=a.slice(0,a.indexOf(":")).trim();s[i]==null&&bs(n,i,"")}else for(const a in t)s[a]==null&&bs(n,a,"");for(const a in s)a==="display"&&(l=!0),bs(n,a,s[a])}else if(r){if(t!==s){const a=n[Sa];a&&(s+=";"+a),n.cssText=s,l=$a.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?n.display:"",e[ka]&&(n.display="none"))}const Qn=/\s*!important$/;function bs(e,t,s){if(te(s))s.forEach(n=>bs(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ta(e,t);Qn.test(s)?e.setProperty(wt(n),s.replace(Qn,""),"important"):e[n]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ta(e,t){const s=qs[t];if(s)return s;let n=De(t);if(n!=="filter"&&n in e)return qs[t]=n;n=As(n);for(let r=0;r<Xn.length;r++){const l=Xn[r]+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,r,l=Pr(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!go(s)?e.removeAttribute(t):e.setAttribute(t,l?"":nt(s)?String(s):s)}function so(e,t,s,n,r){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?hr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const i=l==="OPTION"?e.getAttribute("value")||"":e.value,c=s==null?e.type==="checkbox"?"on":"":String(s);(i!==c||!("_value"in e))&&(e.value=c),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const i=typeof e[t];i==="boolean"?s=go(s):s==null&&i==="string"?(s="",a=!0):i==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(r||t)}function yt(e,t,s,n){e.addEventListener(t,s,n)}function Pa(e,t,s,n){e.removeEventListener(t,s,n)}const no=Symbol("_vei");function Ea(e,t,s,n,r=null){const l=e[no]||(e[no]={}),a=l[t];if(n&&a)a.value=n;else{const[i,c]=Aa(t);if(n){const x=l[t]=Ma(n,r);yt(e,i,x,c)}else a&&(Pa(e,i,a,c),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Aa(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):wt(e.slice(2)),t]}let Gs=0;const Ia=Promise.resolve(),Oa=()=>Gs||(Ia.then(()=>Gs=0),Gs=Date.now());function Ma(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;ot(Da(n,s.value),t,5,[n])};return s.value=e,s.attached=Oa(),s}function Da(e,t){if(te(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ra=(e,t,s,n,r,l)=>{const a=r==="svg";t==="class"?wa(e,n,a):t==="style"?Ca(e,s,n):Ts(t)?Ps(t)||Ea(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ja(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&&(La(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ke(n)))?so(e,De(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),to(e,t,n,a))};function ja(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&oe(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ro(t)&&ke(s)?!1:t in e}function La(e,t){const s=e._def.props;if(!s)return!1;const n=De(t);return Array.isArray(s)?s.some(r=>De(r)===n):Object.keys(s).some(r=>De(r)===n)}const Vt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return te(t)?s=>xs(t,s):t};function Na(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const pt=Symbol("_assign");function ao(e,t,s){return t&&(e=e.trim()),s&&(e=Is(e)),e}const ee={created(e,{modifiers:{lazy:t,trim:s,number:n}},r){e[pt]=Vt(r);const l=n||r.props&&r.props.type==="number";yt(e,t?"change":"input",a=>{a.target.composing||e[pt](ao(e.value,s,l))}),(s||l)&&yt(e,"change",()=>{e.value=ao(e.value,s,l)}),t||(yt(e,"compositionstart",Na),yt(e,"compositionend",lo),yt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:r,number:l}},a){if(e[pt]=Vt(a),e.composing)return;const i=(l||e.type==="number")&&!/^0\d/.test(e.value)?Is(e.value):e.value,c=t??"";if(i===c)return;const x=e.getRootNode();(x instanceof Document||x instanceof ShadowRoot)&&x.activeElement===e&&e.type!=="range"&&(n&&t===s||r&&e.value.trim()===c)||(e.value=c)}},io={deep:!0,created(e,t,s){e[pt]=Vt(s),yt(e,"change",()=>{const n=e._modelValue,r=is(e),l=e.checked,a=e[pt];if(te(n)){const i=dn(n,r),c=i!==-1;if(l&&!c)a(n.concat(r));else if(!l&&c){const x=[...n];x.splice(i,1),a(x)}}else if(Bt(n)){const i=new Set(n);l?i.add(r):i.delete(r),a(i)}else a(gr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[pt]=Vt(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let r;if(te(t))r=dn(t,n.props.value)>-1;else if(Bt(t))r=t.has(n.props.value);else{if(t===s)return;r=Ft(t,gr(e,!0))}e.checked!==r&&(e.checked=r)}const _t={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const r=Bt(t);yt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Is(is(a)):is(a));e[pt](e.multiple?r?new Set(l):l:l[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[pt]=Vt(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[pt]=Vt(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=te(t);if(!(s&&!n&&!Bt(t))){for(let r=0,l=e.options.length;r<l;r++){const a=e.options[r],i=is(a);if(s)if(n){const c=typeof i;c==="string"||c==="number"?a.selected=t.some(x=>String(x)===String(i)):a.selected=dn(t,i)>-1}else a.selected=t.has(i);else if(Ft(is(a),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function is(e){return"_value"in e?e._value:e.value}function gr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ua={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},He=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(r=>{if(!("key"in r))return;const l=wt(r.key);if(t.some(a=>a===l||Ua[a]===l))return e(r)}))},Va=Pe({patchProp:Ra},ba);let fo;function Ba(){return fo||(fo=Ql(Va))}const Fa=((...e)=>{const t=Ba().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=Ka(n);if(!r)return;const l=t._component;!oe(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=s(r,!1,Ha(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function Ha(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ka(e){return ke(e)?document.querySelector(e):e}let Cn="";function Jt(e){Cn=e}function le(){return Cn}async function pe(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 Wa={class:"animate-fade-in"},za={key:0,class:"text-center py-12 text-textSecondary"},Ja={key:1,class:"text-center text-textSecondary py-12"},qa={key:2,class:"space-y-3"},Ga={class:"flex items-center justify-between"},Ya={class:"flex items-center gap-3"},Za={class:"font-medium"},Qa={class:"text-accentLight"},Xa={class:"text-textSecondary text-xs"},ei={key:2,class:"text-muted italic"},ti={class:"text-xs text-textSecondary font-mono"},si={class:"text-right"},ni={class:"flex items-center gap-2 justify-end"},oi={class:"text-xs text-textSecondary"},ri=Be({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=S([]),n=S(!0);async function r(){n.value=!0;try{const x=await pe("/api/status");s.value=(x.sessions||[]).slice().sort((u,m)=>u.status==="active"&&m.status!=="active"?-1:u.status!=="active"&&m.status==="active"?1:m.lastActivity-u.lastActivity)}finally{n.value=!1}}const l=Te(()=>{var u;return(((u=t.status)==null?void 0:u.sessions)??s.value).slice().sort((m,g)=>m.status==="active"&&g.status!=="active"?-1:m.status!=="active"&&g.status==="active"?1:g.lastActivity-m.lastActivity)});function a(x){const u=Math.floor((Date.now()-x.lastActivity)/6e4);return x.status==="disconnected"?{label:`Disconnected${u>0?` — ${u}m ago`:""}`,color:"text-muted"}:u<5?{label:"Active",color:"text-success"}:u<30?{label:`Idle ${u}m`,color:"text-warn"}:{label:`Dormant ${u}m`,color:"text-danger"}}function i(x){if(!x.lastWaitCallAt)return"";const u=Math.floor((Date.now()-x.lastWaitCallAt)/6e4);return u<5?`Polling — ${u===0?"just now":u+"m ago"}`:`Last poll — ${u}m ago`}function c(x){return x.lastWaitCallAt?Math.floor((Date.now()-x.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return Le(r),(x,u)=>(h(),y("div",Wa,[n.value&&l.value.length===0?(h(),y("div",za,"Loading sessions...")):l.value.length===0?(h(),y("div",Ja,"No sessions")):(h(),y("div",qa,[(h(!0),y(ne,null,de(l.value,m=>(h(),y("div",{key:m.mcpSessionId,class:q(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[o("div",Ga,[o("div",Ya,[o("span",{class:q(["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),o("div",null,[o("div",Za,[m.topicName?(h(),y(ne,{key:0},[o("span",Qa,w(m.topicName),1),o("span",Xa," (thread "+w(m.threadId)+")",1)],64)):m.threadId!=null?(h(),y(ne,{key:1},[X("Thread "+w(m.threadId),1)],64)):(h(),y("span",ei,"Awaiting start_session…"))]),o("div",ti,w(m.mcpSessionId.slice(0,12))+"...",1)])]),o("div",si,[o("div",ni,[o("span",{class:q(["text-sm font-medium",a(m).color])},w(a(m).label),3),i(m)?(h(),y("span",{key:0,class:q(["text-xs ml-2",c(m)])},w(i(m)),3)):z("",!0)]),o("div",oi,w(m.transportType),1)])])],2))),128))]))]))}}),li={class:"animate-fade-in"},ai={class:"flex flex-wrap items-center gap-3 mb-4"},ii={key:0,class:"text-center py-12 text-textSecondary"},ci={key:1,class:"text-center py-12 text-textSecondary"},ui={key:2,class:"space-y-2"},di={class:"flex items-start justify-between gap-3"},fi={class:"flex-1 min-w-0"},pi={class:"flex items-center gap-2 mb-1"},mi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},vi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},xi={class:"text-xs text-textSecondary"},hi={class:"text-sm text-textPrimary leading-relaxed"},gi={class:"flex flex-wrap gap-1.5 mt-2"},yi={class:"text-right shrink-0"},bi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=Be({__name:"MemoryNotesTab",setup(e){const t=S([]),s=S(!1),n=S(""),r=S("created_at"),l=S("");let a=null;async function i(){s.value=!0;try{const u=l.value.trim();let m;if(u)m=await pe(`/api/search?q=${encodeURIComponent(u)}&limit=50`);else{const g=new URLSearchParams({limit:"50",sort:r.value});n.value&&g.set("type",n.value),m=await pe(`/api/notes?${g}`)}t.value=m}finally{s.value=!1}}function c(){a&&clearTimeout(a),a=setTimeout(i,300)}function x(u){if(!u)return"never";const m=Date.now()-new Date(u).getTime(),g=Math.floor(m/6e4);if(g<1)return"just now";if(g<60)return`${g}m ago`;const P=Math.floor(g/60);return P<24?`${P}h ago`:`${Math.floor(P/24)}d ago`}return Le(i),(u,m)=>(h(),y("div",li,[o("div",ai,[Z(o("input",{"onUpdate:modelValue":m[0]||(m[0]=g=>l.value=g),onInput:c,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),[[ee,l.value]]),Z(o("select",{"onUpdate:modelValue":m[1]||(m[1]=g=>n.value=g),onChange:i,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[ct('<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),[[_t,n.value]]),Z(o("select",{"onUpdate:modelValue":m[2]||(m[2]=g=>r.value=g),onChange:i,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[o("option",{value:"created_at"},"Newest",-1),o("option",{value:"confidence"},"Confidence",-1),o("option",{value:"access_count"},"Most accessed",-1)])],544),[[_t,r.value]])]),s.value?(h(),y("div",ii,"Loading notes...")):t.value.length===0?(h(),y("div",ci,"No notes found")):(h(),y("div",ui,[(h(!0),y(ne,null,de(t.value,g=>(h(),y("div",{key:g.noteId,class:q(["glass rounded-xl p-4 animate-fade-in",`priority-${g.priority||0}`])},[o("div",di,[o("div",fi,[o("div",pi,[o("span",{class:q(["type-badge",`type-${g.type}`])},w(g.type),3),g.priority>=2?(h(),y("span",mi,"HIGH IMPORTANCE")):g.priority===1?(h(),y("span",vi,"NOTABLE")):z("",!0),o("span",xi,w(g.noteId),1)]),o("p",hi,w(g.content),1),o("div",gi,[(h(!0),y(ne,null,de(g.keywords||[],P=>(h(),y("span",{key:P,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},w(P),1))),128))])]),o("div",yi,[o("div",bi,w(((Number(g.confidence)||0)*100).toFixed(0))+"%",1),o("div",_i,w(x(g.createdAt)),1),o("div",wi,w(g.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Si={class:"animate-fade-in space-y-6"},$i={class:"glass rounded-xl p-4"},Ci={class:"flex flex-wrap items-center gap-4 mb-4"},Ti={key:0,class:"text-sm text-success"},Pi={class:"flex flex-wrap items-center gap-3 mb-4"},Ei={key:0,class:"text-sm text-success"},Ai={class:"glass rounded-xl p-6"},Ii={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Oi={class:"flex items-center gap-2"},Mi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Ri={class:"mt-4"},ji=["innerHTML"],Li={class:"glass rounded-xl p-6"},Ni={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ui={class:"flex items-center gap-2"},Vi={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Ki=["value","placeholder"],Wi={class:"glass rounded-xl p-6"},zi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ji={class:"flex items-center gap-2"},qi={key:0,class:"text-sm text-success"},Gi={class:"mb-4 flex flex-wrap items-center gap-3"},Yi={class:"flex items-center gap-2"},Zi={class:"font-mono text-sm text-textPrimary"},Qi={key:0,class:"mb-3"},Xi={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=Be({__name:"TemplatesTab",setup(e){function t(Y){return Y.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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=S("copilot"),n=S(""),r=S(50),l=S(""),a=S(""),i=S(!0),c=S(""),x=S(!1),u=S({}),m=S("copilot"),g=S(""),P=S(""),V=S(!0),A=S(""),H=S(!1),$=S([]),I=S("");async function U(){await Promise.all([O(),F(),k(),E()])}async function O(){try{const Y=await pe("/api/settings/agent-type");s.value=Y.agentType||"copilot"}catch{}}async function F(){try{const Y=await pe("/api/settings/bootstrap-message-count");r.value=Y.count??50}catch{}}async function k(){try{const Y=await pe("/api/templates");if(Y.templates&&Y.templates.length>0){const B=Y.templates[0];a.value=B.content||"",i.value=B.isDefault??!0}Y.agentReminders&&(u.value=Y.agentReminders)}catch{}}async function E(){try{const[Y,B,$e]=await Promise.all([pe("/api/templates/drive"),pe("/api/templates/drive-presets"),pe("/api/settings/dmn-activation-hours")]);$.value=B.presets||[],I.value=String($e.value??"not set"),Y.custom?(P.value=Y.custom,V.value=!1):(P.value=Y.default||"",V.value=!0)}catch{}}async function L(){try{await pe("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await pe("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await k()}catch(Y){n.value="Error: "+Y.message}}async function J(){try{await pe("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(Y){l.value="Error: "+Y.message}}async function re(){try{const Y=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!Y.ok)throw new Error(Y.statusText);i.value=!1,c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3)}catch(Y){c.value="Error: "+Y.message}}async function N(){if(confirm("Reset to default template? Your customizations will be lost."))try{const Y=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!Y.ok)throw new Error(Y.statusText);await k(),c.value="Reset to default ✓",setTimeout(()=>{c.value=""},3e3)}catch(Y){c.value="Error: "+Y.message}}async function C(){var $e;const Y=m.value,B=(($e=u.value[Y])==null?void 0:$e.content)??"";try{const _e=await fetch(`/api/templates/reminders-${Y}`,{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!_e.ok)throw new Error(_e.statusText);u.value[Y]={content:B,isDefault:!1},g.value=`Saved ${Y} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(_e){g.value="Error: "+_e.message}}async function R(){const Y=m.value;if(confirm(`Reset ${Y} agent reminder? The custom template will be removed.`))try{const B=await fetch(`/api/templates/reminders-${Y}`,{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!B.ok)throw new Error(B.statusText);await k(),g.value=`Reset ${Y} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(B){g.value="Error: "+B.message}}async function G(){const Y=P.value;if(!Y.trim()){A.value="Template is empty — load a preset first",setTimeout(()=>{A.value=""},3e3);return}try{const B=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({content:Y})});if(!B.ok)throw new Error(B.statusText);V.value=!1,A.value="Saved ✓",setTimeout(()=>{A.value=""},3e3)}catch(B){A.value="Error: "+B.message}}async function ve(){if(confirm("Reset drive template? The custom template will be removed."))try{const Y=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!Y.ok)throw new Error(Y.statusText);await E(),A.value="Reset to default ✓",setTimeout(()=>{A.value=""},3e3)}catch(Y){A.value="Error: "+Y.message}}function we(Y){P.value=Y.content,V.value=!1}const xe=Te(()=>t(a.value)),ie=Te(()=>P.value?t(P.value):'<span style="color:#6b7280">(no template loaded)</span>');return Le(U),(Y,B)=>{var $e,_e;return h(),y("div",Si,[o("div",$i,[o("div",Ci,[B[8]||(B[8]=o("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),Z(o("select",{"onUpdate:modelValue":B[0]||(B[0]=fe=>s.value=fe),onChange:L,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...B[7]||(B[7]=[o("option",{value:"claude"},"Claude",-1),o("option",{value:"copilot"},"Copilot",-1),o("option",{value:"codex"},"Codex",-1)])],544),[[_t,s.value]]),n.value?(h(),y("span",Ti,w(n.value),1)):z("",!0),B[9]||(B[9]=o("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),o("div",Pi,[B[10]||(B[10]=o("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),Z(o("input",{"onUpdate:modelValue":B[1]||(B[1]=fe=>r.value=fe),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),[[ee,r.value,void 0,{number:!0}]]),o("button",{onClick:J,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(),y("span",Ei,w(l.value),1)):z("",!0),B[11]||(B[11]=o("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),o("div",Ai,[o("div",Ii,[B[12]||(B[12]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Reminders Template"),o("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),o("div",Oi,[c.value?(h(),y("span",Mi,w(c.value),1)):z("",!0),o("button",{onClick:N,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"),o("button",{onClick:re,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i.value?(h(),y("div",Di,[...B[13]||(B[13]=[o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):z("",!0),Z(o("textarea",{"onUpdate:modelValue":B[2]||(B[2]=fe=>a.value=fe),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),[[ee,a.value]]),o("div",Ri,[o("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:B[3]||(B[3]=fe=>x.value=!x.value)},[(h(),y("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...B[14]||(B[14]=[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),B[15]||(B[15]=o("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),x.value?(h(),y("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:xe.value},null,8,ji)):z("",!0)]),B[16]||(B[16]=ct('<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">— "autonomous" or "standard"</span></div></div></details>',1))]),o("div",Li,[o("div",Ni,[B[17]||(B[17]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),o("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),o("div",Ui,[g.value?(h(),y("span",Vi,w(g.value),1)):z("",!0),o("button",{onClick:R,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"),o("button",{onClick:C,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Bi,[(h(),y(ne,null,de(["claude","copilot","codex"],fe=>o("button",{key:fe,onClick:kt=>m.value=fe,class:q(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===fe?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},w(fe.charAt(0).toUpperCase()+fe.slice(1)),11,Fi)),64))]),(($e=u.value[m.value])==null?void 0:$e.isDefault)!==!1?(h(),y("div",Hi,[...B[18]||(B[18]=[o("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)])])):z("",!0),o("textarea",{value:((_e=u.value[m.value])==null?void 0:_e.content)??"",onInput:B[4]||(B[4]=fe=>{const kt=fe.target;u.value[m.value]={content:kt.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,Ki)]),o("div",Wi,[o("div",zi,[B[19]||(B[19]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),o("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),o("div",Ji,[A.value?(h(),y("span",qi,w(A.value),1)):z("",!0),o("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"),o("button",{onClick:G,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Gi,[B[21]||(B[21]=o("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),o("div",Yi,[o("span",Zi,w(I.value),1),B[20]||(B[20]=o("span",{class:"text-sm text-textSecondary"},"hours",-1))]),B[22]||(B[22]=o("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),V.value?(h(),y("div",Qi,[...B[23]||(B[23]=[o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):z("",!0),o("div",Xi,[B[24]||(B[24]=o("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(h(!0),y(ne,null,de($.value,fe=>(h(),y("button",{key:fe.key,onClick:kt=>we(fe),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"},w(fe.label),9,ec))),128))]),Z(o("textarea",{"onUpdate:modelValue":B[5]||(B[5]=fe=>P.value=fe),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),[[ee,P.value]]),o("div",tc,[o("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:B[6]||(B[6]=fe=>H.value=!H.value)},[(h(),y("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",H.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...B[25]||(B[25]=[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),B[26]||(B[26]=o("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),H.value?(h(),y("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ie.value},null,8,sc)):z("",!0)]),B[27]||(B[27]=ct('<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"},ac={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ic={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"},vc={key:3,class:"space-y-2"},xc=["onClick"],hc={class:"flex items-start justify-between gap-3"},gc={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"},Pc={class:"flex items-center gap-2"},Ec={key:0,class:"text-sm text-success"},Ac={key:1,class:"text-sm text-warn"},Ic={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Oc=["value"],Mc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=Be({__name:"SkillsTab",setup(e){const t=S([]),s=S(!0),n=S(null),r=S(""),l=S(""),a=S(!1),i=S(""),c=S(""),x=S(!1),u=S(""),m=S(""),g=S(!1),P=S("");async function V(){s.value=!0;try{const E=await pe("/api/skills");t.value=E.skills||[]}finally{s.value=!1}}function A(E){return E?E.includes(".remote-copilot-mcp")&&E.includes("skills")?"user":E.endsWith(".default.md")?"default":E.endsWith(".skill.md")?"project":"unknown":"unknown"}function H(E){const L={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 L[E]||L.unknown}function $(E){n.value=E,r.value=E.content,l.value=(E.triggers||[]).join(", "),a.value=!!E.replacesOrchestrator,x.value=!1}function I(){n.value=null,c.value=""}function U(E,L,J,re){let N=`---
|
|
65
|
-
name: ${
|
|
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,ha="http://www.w3.org/2000/svg",ya="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,Yn=ct&&ct.createElement("template"),ba={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,o)=>{const r=t==="svg"?ct.createElementNS(ha,e):t==="mathml"?ct.createElementNS(ya,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,o,r,l){const a=s?s.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===l||!(r=r.nextSibling)););else{Yn.innerHTML=gr(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(o==="svg"||o==="mathml"){const d=c.firstChild;for(;d.firstChild;)c.appendChild(d.firstChild);c.removeChild(d)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function wa(e,t,s){const o=e[_a];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ka=Symbol("_vsh"),Sa=Symbol(""),$a=/(?:^|;)\s*display\s*:/;function Ca(e,t,s){const o=e.style,r=Se(s);let l=!1;if(s&&!r){if(t)if(Se(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(o,c,"")}else for(const a in t)s[a]==null&&_s(o,a,"");for(const a in s)a==="display"&&(l=!0),_s(o,a,s[a])}else if(r){if(t!==s){const a=o[Sa];a&&(s+=";"+a),o.cssText=s,l=$a.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?o.display:"",e[ka]&&(o.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(ne(s))s.forEach(o=>_s(e,t,o));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const o=Ta(e,t);Qn.test(s)?e.setProperty($t(o),s.replace(Qn,""),"important"):e[o]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ta(e,t){const s=qs[t];if(s)return s;let o=Re(t);if(o!=="filter"&&o in e)return qs[t]=o;o=Is(o);for(let r=0;r<Xn.length;r++){const l=Xn[r]+o;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,o,r,l=Pr(t)){o&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!ho(s)?e.removeAttribute(t):e.setAttribute(t,l?"":rt(s)?String(s):s)}function so(e,t,s,o,r){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,d=s==null?e.type==="checkbox"?"on":"":String(s);(c!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=ho(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(r||t)}function kt(e,t,s,o){e.addEventListener(t,s,o)}function Pa(e,t,s,o){e.removeEventListener(t,s,o)}const no=Symbol("_vei");function Ea(e,t,s,o,r=null){const l=e[no]||(e[no]={}),a=l[t];if(o&&a)a.value=o;else{const[c,d]=Aa(t);if(o){const x=l[t]=Ma(o,r);kt(e,c,x,d)}else a&&(Pa(e,c,a,d),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Aa(e){let t;if(oo.test(e)){t={};let o;for(;o=e.match(oo);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$t(e.slice(2)),t]}let Gs=0;const Ia=Promise.resolve(),Oa=()=>Gs||(Ia.then(()=>Gs=0),Gs=Date.now());function Ma(e,t){const s=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=s.attached)return;lt(Da(o,s.value),t,5,[o])};return s.value=e,s.attached=Oa(),s}function Da(e,t){if(ne(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(o=>r=>!r._stopped&&o&&o(r))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ra=(e,t,s,o,r,l)=>{const a=r==="svg";t==="class"?wa(e,o,a):t==="style"?Ca(e,s,o):Ps(t)?Es(t)||Ea(e,t,s,o,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ja(e,t,o,a))?(so(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,o,a,l,t!=="value")):e._isVueCE&&(La(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Se(o)))?so(e,Re(t),o,l,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),to(e,t,o,a))};function ja(e,t,s,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&ae(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ro(t)&&Se(s)?!1:t in e}function La(e,t){const s=e._def.props;if(!s)return!1;const o=Re(t);return Array.isArray(s)?s.some(r=>Re(r)===o):Object.keys(s).some(r=>Re(r)===o)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ne(t)?s=>gs(t,s):t};function Na(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 ao(e,t,s){return t&&(e=e.trim()),s&&(e=Os(e)),e}const se={created(e,{modifiers:{lazy:t,trim:s,number:o}},r){e[mt]=Bt(r);const l=o||r.props&&r.props.type==="number";kt(e,t?"change":"input",a=>{a.target.composing||e[mt](ao(e.value,s,l))}),(s||l)&&kt(e,"change",()=>{e.value=ao(e.value,s,l)}),t||(kt(e,"compositionstart",Na),kt(e,"compositionend",lo),kt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:o,trim:r,number:l}},a){if(e[mt]=Bt(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Os(e.value):e.value,d=t??"";if(c===d)return;const x=e.getRootNode();(x instanceof Document||x instanceof ShadowRoot)&&x.activeElement===e&&e.type!=="range"&&(o&&t===s||r&&e.value.trim()===d)||(e.value=d)}},io={deep:!0,created(e,t,s){e[mt]=Bt(s),kt(e,"change",()=>{const o=e._modelValue,r=cs(e),l=e.checked,a=e[mt];if(ne(o)){const c=dn(o,r),d=c!==-1;if(l&&!d)a(o.concat(r));else if(!l&&d){const x=[...o];x.splice(c,1),a(x)}}else if(Ft(o)){const c=new Set(o);l?c.add(r):c.delete(r),a(c)}else a(hr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Bt(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},o){e._modelValue=t;let r;if(ne(t))r=dn(t,o.props.value)>-1;else if(Ft(t))r=t.has(o.props.value);else{if(t===s)return;r=Ht(t,hr(e,!0))}e.checked!==r&&(e.checked=r)}const ht={deep:!0,created(e,{value:t,modifiers:{number:s}},o){const r=Ft(t);kt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Os(cs(a)):cs(a));e[mt](e.multiple?r?new Set(l):l:l[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[mt]=Bt(o)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Bt(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,o=ne(t);if(!(s&&!o&&!Ft(t))){for(let r=0,l=e.options.length;r<l;r++){const a=e.options[r],c=cs(a);if(s)if(o){const d=typeof c;d==="string"||d==="number"?a.selected=t.some(x=>String(x)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Ht(cs(a),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function hr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ua={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),o=t.join(".");return s[o]||(s[o]=(r=>{if(!("key"in r))return;const l=$t(r.key);if(t.some(a=>a===l||Ua[a]===l))return e(r)}))},Va=Ee({patchProp:Ra},ba);let fo;function Ba(){return fo||(fo=Ql(Va))}const Fa=((...e)=>{const t=Ba().createApp(...e),{mount:s}=t;return t.mount=o=>{const r=Ka(o);if(!r)return;const l=t._component;!ae(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=s(r,!1,Ha(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function Ha(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ka(e){return Se(e)?document.querySelector(e):e}let Cn="";function qt(e){Cn=e}function ce(){return Cn}async function xe(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 o=new Error(s.statusText);throw o.status=s.status,o}return s.json()}const Wa={class:"animate-fade-in"},za={key:0,class:"text-center py-12 text-textSecondary"},Ja={key:1,class:"text-center text-textSecondary py-12"},qa={key:2,class:"space-y-3"},Ga={class:"flex items-center justify-between"},Ya={class:"flex items-center gap-3"},Za={class:"font-medium"},Qa={class:"text-accentLight"},Xa={class:"text-textSecondary text-xs"},ei={key:2,class:"text-muted italic"},ti={class:"text-xs text-textSecondary font-mono"},si={class:"text-right"},ni={class:"flex items-center gap-2 justify-end"},oi={class:"text-xs text-textSecondary"},ri=Fe({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=_([]),o=_(!0);async function r(){o.value=!0;try{const x=await xe("/api/status");s.value=(x.sessions||[]).slice().sort((f,p)=>f.status==="active"&&p.status!=="active"?-1:f.status!=="active"&&p.status==="active"?1:p.lastActivity-f.lastActivity)}finally{o.value=!1}}const l=Pe(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??s.value).slice().sort((p,h)=>p.status==="active"&&h.status!=="active"?-1:p.status!=="active"&&h.status==="active"?1:h.lastActivity-p.lastActivity)});function a(x){const f=Math.floor((Date.now()-x.lastActivity)/6e4);return x.status==="disconnected"?{label:`Disconnected${f>0?` — ${f}m ago`:""}`,color:"text-muted"}:f<5?{label:"Active",color:"text-success"}:f<30?{label:`Idle ${f}m`,color:"text-warn"}:{label:`Dormant ${f}m`,color:"text-danger"}}function c(x){if(!x.lastWaitCallAt)return"";const f=Math.floor((Date.now()-x.lastWaitCallAt)/6e4);return f<5?`Polling — ${f===0?"just now":f+"m ago"}`:`Last poll — ${f}m ago`}function d(x){return x.lastWaitCallAt?Math.floor((Date.now()-x.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return Ne(r),(x,f)=>(v(),g("div",Wa,[o.value&&l.value.length===0?(v(),g("div",za,"Loading sessions...")):l.value.length===0?(v(),g("div",Ja,"No sessions")):(v(),g("div",qa,[(v(!0),g(re,null,pe(l.value,p=>(v(),g("div",{key:p.mcpSessionId,class:Y(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[n("div",Ga,[n("div",Ya,[n("span",{class:Y(["w-2.5 h-2.5 rounded-full",p.status==="disconnected"?"bg-muted":Math.floor((Date.now()-p.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-p.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),n("div",null,[n("div",Za,[p.topicName?(v(),g(re,{key:0},[n("span",Qa,y(p.topicName),1),n("span",Xa," (thread "+y(p.threadId)+")",1)],64)):p.threadId!=null?(v(),g(re,{key:1},[te("Thread "+y(p.threadId),1)],64)):(v(),g("span",ei,"Awaiting start_session…"))]),n("div",ti,y(p.mcpSessionId.slice(0,12))+"...",1)])]),n("div",si,[n("div",ni,[n("span",{class:Y(["text-sm font-medium",a(p).color])},y(a(p).label),3),c(p)?(v(),g("span",{key:0,class:Y(["text-xs ml-2",d(p)])},y(c(p)),3)):W("",!0)]),n("div",oi,y(p.transportType),1)])])],2))),128))]))]))}}),li={class:"animate-fade-in"},ai={class:"flex flex-wrap items-center gap-3 mb-4"},ii={key:0,class:"text-center py-12 text-textSecondary"},ci={key:1,class:"text-center py-12 text-textSecondary"},ui={key:2,class:"space-y-2"},di={class:"flex items-start justify-between gap-3"},fi={class:"flex-1 min-w-0"},pi={class:"flex items-center gap-2 mb-1"},mi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},vi={class:"text-xs text-textSecondary"},gi={class:"text-sm text-textPrimary leading-relaxed"},hi={class:"flex flex-wrap gap-1.5 mt-2"},yi={class:"text-right shrink-0"},bi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=Fe({__name:"MemoryNotesTab",setup(e){const t=_([]),s=_(!1),o=_(""),r=_("created_at"),l=_("");let a=null;async function c(){s.value=!0;try{const f=l.value.trim();let p;if(f)p=await xe(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const h=new URLSearchParams({limit:"50",sort:r.value});o.value&&h.set("type",o.value),p=await xe(`/api/notes?${h}`)}t.value=p}finally{s.value=!1}}function d(){a&&clearTimeout(a),a=setTimeout(c,300)}function x(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),h=Math.floor(p/6e4);if(h<1)return"just now";if(h<60)return`${h}m ago`;const S=Math.floor(h/60);return S<24?`${S}h ago`:`${Math.floor(S/24)}d ago`}return Ne(c),(f,p)=>(v(),g("div",li,[n("div",ai,[Z(n("input",{"onUpdate:modelValue":p[0]||(p[0]=h=>l.value=h),onInput:d,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),[[se,l.value]]),Z(n("select",{"onUpdate:modelValue":p[1]||(p[1]=h=>o.value=h),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[ut('<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,o.value]]),Z(n("select",{"onUpdate:modelValue":p[2]||(p[2]=h=>r.value=h),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[4]||(p[4]=[n("option",{value:"created_at"},"Newest",-1),n("option",{value:"confidence"},"Confidence",-1),n("option",{value:"access_count"},"Most accessed",-1)])],544),[[ht,r.value]])]),s.value?(v(),g("div",ii,"Loading notes...")):t.value.length===0?(v(),g("div",ci,"No notes found")):(v(),g("div",ui,[(v(!0),g(re,null,pe(t.value,h=>(v(),g("div",{key:h.noteId,class:Y(["glass rounded-xl p-4 animate-fade-in",`priority-${h.priority||0}`])},[n("div",di,[n("div",fi,[n("div",pi,[n("span",{class:Y(["type-badge",`type-${h.type}`])},y(h.type),3),h.priority>=2?(v(),g("span",mi,"HIGH IMPORTANCE")):h.priority===1?(v(),g("span",xi,"NOTABLE")):W("",!0),n("span",vi,y(h.noteId),1)]),n("p",gi,y(h.content),1),n("div",hi,[(v(!0),g(re,null,pe(h.keywords||[],S=>(v(),g("span",{key:S,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(S),1))),128))])]),n("div",yi,[n("div",bi,y(((Number(h.confidence)||0)*100).toFixed(0))+"%",1),n("div",_i,y(x(h.createdAt)),1),n("div",wi,y(h.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Si={class:"animate-fade-in space-y-6"},$i={class:"glass rounded-xl p-4"},Ci={class:"flex flex-wrap items-center gap-4 mb-4"},Ti={key:0,class:"text-sm text-success"},Pi={class:"flex flex-wrap items-center gap-3 mb-4"},Ei={key:0,class:"text-sm text-success"},Ai={class:"glass rounded-xl p-6"},Ii={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Oi={class:"flex items-center gap-2"},Mi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Ri={class:"mt-4"},ji=["innerHTML"],Li={class:"glass rounded-xl p-6"},Ni={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ui={class:"flex items-center gap-2"},Vi={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Ki=["value","placeholder"],Wi={class:"glass rounded-xl p-6"},zi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ji={class:"flex items-center gap-2"},qi={key:0,class:"text-sm text-success"},Gi={class:"mb-4 flex flex-wrap items-center gap-3"},Yi={class:"flex items-center gap-2"},Zi={class:"font-mono text-sm text-textPrimary"},Qi={key:0,class:"mb-3"},Xi={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=Fe({__name:"TemplatesTab",setup(e){function t(q){return q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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"),o=_(""),r=_(50),l=_(""),a=_(""),c=_(!0),d=_(""),x=_(!1),f=_({}),p=_("copilot"),h=_(""),S=_(""),F=_(!0),C=_(""),N=_(!1),$=_([]),T=_("");async function L(){await Promise.all([I(),V(),b(),O()])}async function I(){try{const q=await xe("/api/settings/agent-type");s.value=q.agentType||"copilot"}catch{}}async function V(){try{const q=await xe("/api/settings/bootstrap-message-count");r.value=q.count??50}catch{}}async function b(){try{const q=await xe("/api/templates");if(q.templates&&q.templates.length>0){const j=q.templates[0];a.value=j.content||"",c.value=j.isDefault??!0}q.agentReminders&&(f.value=q.agentReminders)}catch{}}async function O(){try{const[q,j,Ce]=await Promise.all([xe("/api/templates/drive"),xe("/api/templates/drive-presets"),xe("/api/settings/dmn-activation-hours")]);$.value=j.presets||[],T.value=String(Ce.value??"not set"),q.custom?(S.value=q.custom,F.value=!1):(S.value=q.default||"",F.value=!0)}catch{}}async function le(){try{await xe("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await xe("/api/templates/reminders",{method:"DELETE"}),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3),await b()}catch(q){o.value="Error: "+q.message}}async function ve(){try{await xe("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(q){l.value="Error: "+q.message}}async function me(){try{const q=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!q.ok)throw new Error(q.statusText);c.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(q){d.value="Error: "+q.message}}async function z(){if(confirm("Reset to default template? Your customizations will be lost."))try{const q=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!q.ok)throw new Error(q.statusText);await b(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(q){d.value="Error: "+q.message}}async function k(){var Ce;const q=p.value,j=((Ce=f.value[q])==null?void 0:Ce.content)??"";try{const ke=await fetch(`/api/templates/reminders-${q}`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({content:j})});if(!ke.ok)throw new Error(ke.statusText);f.value[q]={content:j,isDefault:!1},h.value=`Saved ${q} ✓`,setTimeout(()=>{h.value=""},3e3)}catch(ke){h.value="Error: "+ke.message}}async function M(){const q=p.value;if(confirm(`Reset ${q} agent reminder? The custom template will be removed.`))try{const j=await fetch(`/api/templates/reminders-${q}`,{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!j.ok)throw new Error(j.statusText);await b(),h.value=`Reset ${q} ✓`,setTimeout(()=>{h.value=""},3e3)}catch(j){h.value="Error: "+j.message}}async function U(){const q=S.value;if(!q.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const j=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({content:q})});if(!j.ok)throw new Error(j.statusText);F.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(j){C.value="Error: "+j.message}}async function E(){if(confirm("Reset drive template? The custom template will be removed."))try{const q=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!q.ok)throw new Error(q.statusText);await O(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(q){C.value="Error: "+q.message}}function G(q){S.value=q.content,F.value=!1}const ie=Pe(()=>t(a.value)),ee=Pe(()=>S.value?t(S.value):'<span style="color:#6b7280">(no template loaded)</span>');return Ne(L),(q,j)=>{var Ce,ke;return v(),g("div",Si,[n("div",$i,[n("div",Ci,[j[8]||(j[8]=n("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),Z(n("select",{"onUpdate:modelValue":j[0]||(j[0]=ge=>s.value=ge),onChange:le,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...j[7]||(j[7]=[n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1),n("option",{value:"codex"},"Codex",-1)])],544),[[ht,s.value]]),o.value?(v(),g("span",Ti,y(o.value),1)):W("",!0),j[9]||(j[9]=n("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),n("div",Pi,[j[10]||(j[10]=n("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),Z(n("input",{"onUpdate:modelValue":j[1]||(j[1]=ge=>r.value=ge),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),[[se,r.value,void 0,{number:!0}]]),n("button",{onClick:ve,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(v(),g("span",Ei,y(l.value),1)):W("",!0),j[11]||(j[11]=n("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),n("div",Ai,[n("div",Ii,[j[12]||(j[12]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Reminders Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),n("div",Oi,[d.value?(v(),g("span",Mi,y(d.value),1)):W("",!0),n("button",{onClick:z,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"),n("button",{onClick:me,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(v(),g("div",Di,[...j[13]||(j[13]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):W("",!0),Z(n("textarea",{"onUpdate:modelValue":j[2]||(j[2]=ge=>a.value=ge),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),[[se,a.value]]),n("div",Ri,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:j[3]||(j[3]=ge=>x.value=!x.value)},[(v(),g("svg",{class:Y(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...j[14]||(j[14]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),j[15]||(j[15]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),x.value?(v(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ie.value},null,8,ji)):W("",!0)]),j[16]||(j[16]=ut('<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">— "autonomous" or "standard"</span></div></div></details>',1))]),n("div",Li,[n("div",Ni,[j[17]||(j[17]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),n("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),n("div",Ui,[h.value?(v(),g("span",Vi,y(h.value),1)):W("",!0),n("button",{onClick:M,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"),n("button",{onClick:k,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Bi,[(v(),g(re,null,pe(["claude","copilot","codex"],ge=>n("button",{key:ge,onClick:at=>p.value=ge,class:Y(["px-4 py-2 rounded-xl text-sm font-medium transition",p.value===ge?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},y(ge.charAt(0).toUpperCase()+ge.slice(1)),11,Fi)),64))]),((Ce=f.value[p.value])==null?void 0:Ce.isDefault)!==!1?(v(),g("div",Hi,[...j[18]||(j[18]=[n("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),n("textarea",{value:((ke=f.value[p.value])==null?void 0:ke.content)??"",onInput:j[4]||(j[4]=ge=>{const at=ge.target;f.value[p.value]={content:at.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 ${p.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ki)]),n("div",Wi,[n("div",zi,[j[19]||(j[19]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),n("div",Ji,[C.value?(v(),g("span",qi,y(C.value),1)):W("",!0),n("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"),n("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Gi,[j[21]||(j[21]=n("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),n("div",Yi,[n("span",Zi,y(T.value),1),j[20]||(j[20]=n("span",{class:"text-sm text-textSecondary"},"hours",-1))]),j[22]||(j[22]=n("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),F.value?(v(),g("div",Qi,[...j[23]||(j[23]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):W("",!0),n("div",Xi,[j[24]||(j[24]=n("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(v(!0),g(re,null,pe($.value,ge=>(v(),g("button",{key:ge.key,onClick:at=>G(ge),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"},y(ge.label),9,ec))),128))]),Z(n("textarea",{"onUpdate:modelValue":j[5]||(j[5]=ge=>S.value=ge),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),[[se,S.value]]),n("div",tc,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:j[6]||(j[6]=ge=>N.value=!N.value)},[(v(),g("svg",{class:Y(["w-4 h-4 text-textSecondary transition-transform",N.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...j[25]||(j[25]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),j[26]||(j[26]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),N.value?(v(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ee.value},null,8,sc)):W("",!0)]),j[27]||(j[27]=ut('<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"},ac={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ic={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={class:"glass rounded-xl p-4 mb-4 border border-gray-700/50"},mc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3"},xc={class:"sm:col-span-2"},vc={class:"flex items-center gap-2 mb-3"},gc={key:0,class:"space-y-2"},hc={class:"flex items-center gap-2 min-w-0"},yc=["title"],bc=["onClick"],_c={key:1,class:"text-center py-8 text-textSecondary text-sm"},wc={key:2,class:"text-center text-textSecondary py-12"},kc={key:3,class:"space-y-2"},Sc=["onClick"],$c={class:"flex items-start justify-between gap-3"},Cc={class:"flex-1 min-w-0"},Tc={class:"flex items-center gap-2 mb-1"},Pc={class:"font-medium text-sm"},Ec={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},Ac={class:"flex flex-wrap gap-1.5 mt-1"},Ic=["title"],Oc={key:0,class:"glass rounded-xl p-6"},Mc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Dc={class:"text-lg font-semibold"},Rc={class:"text-sm text-textSecondary mt-1"},jc={class:"flex items-center gap-2"},Lc={key:0,class:"text-sm text-success"},Nc={key:1,class:"text-sm text-warn"},Uc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Vc=["value"],Bc={class:"flex items-end"},Fc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Hc=Fe({__name:"SkillsTab",setup(e){const t=_([]),s=_(!0),o=_(null),r=_(""),l=_(""),a=_(!1),c=_(""),d=_(""),x=_(!1),f=_(""),p=_(""),h=_(!1),S=_(""),F=_([]),C=_(""),N=_("sensorium"),$=_("");async function T(){s.value=!0;try{const U=await xe("/api/skills");t.value=U.skills||[]}finally{s.value=!1}}async function L(){const U=await xe("/api/skills/imported");F.value=U.imported||[]}async function I(){const U=C.value.trim();if(!U){$.value="Path is required";return}try{const E=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({path:U,type:N.value})});if(!E.ok){const G=await E.json().catch(()=>({error:E.statusText}));throw new Error(G.error??E.statusText)}C.value="",$.value="Imported ✓",setTimeout(()=>{$.value=""},3e3),await L()}catch(E){$.value="Error: "+E.message}}async function V(U){try{const E=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({path:U})});if(!E.ok)throw new Error(E.statusText);await L()}catch(E){$.value="Error: "+E.message}}function b(U){return U?U.includes(".remote-copilot-mcp")&&U.includes("skills")?"user":U.endsWith(".default.md")?"default":U.endsWith(".skill.md")?"project":"unknown":"unknown"}function O(U){const E={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 E[U]||E.unknown}function le(U){o.value=U,r.value=U.content,l.value=(U.triggers||[]).join(", "),a.value=!!U.replacesOrchestrator,x.value=!1}function ve(){o.value=null,d.value=""}function me(U,E,G,ie){let ee=`---
|
|
65
|
+
name: ${U}
|
|
66
66
|
triggers:
|
|
67
|
-
`;return
|
|
68
|
-
`}),
|
|
69
|
-
`),
|
|
67
|
+
`;return E.forEach(q=>{ee+=` - ${q.trim()}
|
|
68
|
+
`}),G&&(ee+=`replaces_orchestrator: true
|
|
69
|
+
`),ee+=`---
|
|
70
70
|
|
|
71
|
-
`,
|
|
72
|
-
`);try{const N=await fetch(`/api/skills/${encodeURIComponent(E)}`,{method:"PUT",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({content:re})});if(!N.ok)throw new Error(N.statusText);P.value="Created ✓",x.value=!1,await V();const C=t.value.find(R=>R.name===E);C&&$(C)}catch(N){P.value="Error: "+N.message}}return Le(V),(E,L)=>(h(),y("div",oc,[o("div",rc,[o("div",lc,[L[8]||(L[8]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Skill Library"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),o("button",{onClick:L[0]||(L[0]=J=>{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(),y("div",ac,[L[12]||(L[12]=o("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),o("div",ic,[o("div",null,[L[9]||(L[9]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),Z(o("input",{"onUpdate:modelValue":L[1]||(L[1]=J=>u.value=J),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),[[ee,u.value]])]),o("div",null,[L[10]||(L[10]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(o("input",{"onUpdate:modelValue":L[2]||(L[2]=J=>m.value=J),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),[[ee,m.value]])])]),o("div",cc,[o("label",uc,[Z(o("input",{"onUpdate:modelValue":L[3]||(L[3]=J=>g.value=J),type:"checkbox",class:"rounded"},null,512),[[io,g.value]]),L[11]||(L[11]=o("span",null,"Replaces orchestrator",-1))])]),o("div",dc,[o("button",{onClick:k,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),o("button",{onClick:L[4]||(L[4]=J=>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"),P.value?(h(),y("span",fc,w(P.value),1)):z("",!0)])])):z("",!0),s.value?(h(),y("div",pc,"Loading...")):t.value.length===0?(h(),y("div",mc,"No skills loaded")):(h(),y("div",vc,[(h(!0),y(ne,null,de(t.value,J=>{var re;return h(),y("div",{key:J.name,onClick:N=>$(J),class:q(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((re=n.value)==null?void 0:re.name)===J.name?"border-accent":"border-transparent"])},[o("div",hc,[o("div",gc,[o("div",yc,[o("span",bc,w(J.name),1),o("span",{class:"type-badge",style:Lt(H(A(J.source)))},w(A(J.source)),5),J.replacesOrchestrator?(h(),y("span",_c,"REPLACES ORCH")):z("",!0)]),o("div",wc,[(h(!0),y(ne,null,de(J.triggers||[],N=>(h(),y("span",{key:N,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},w(N),1))),128))])]),o("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:J.source||""},w((J.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,xc)}),128))]))]),n.value?(h(),y("div",Sc,[o("div",$c,[o("div",null,[o("h3",Cc,"Edit: "+w(n.value.name),1),o("p",Tc,w(n.value.source||"(unknown source)"),1)]),o("div",Pc,[i.value?(h(),y("span",Ec,w(i.value),1)):z("",!0),c.value?(h(),y("span",Ac,w(c.value),1)):z("",!0),A(n.value.source)==="user"?(h(),y("button",{key:2,onClick:F,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")):z("",!0),o("button",{onClick:I,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"),o("button",{onClick:O,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Ic,[o("div",null,[L[13]||(L[13]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),o("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,Oc)]),o("div",null,[L[14]||(L[14]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(o("input",{"onUpdate:modelValue":L[5]||(L[5]=J=>l.value=J),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),[[ee,l.value]])]),o("div",Mc,[o("label",Dc,[Z(o("input",{"onUpdate:modelValue":L[6]||(L[6]=J=>a.value=J),type:"checkbox",class:"rounded"},null,512),[[io,a.value]]),L[15]||(L[15]=o("span",null,"Replaces orchestrator",-1))])])]),Z(o("textarea",{"onUpdate:modelValue":L[7]||(L[7]=J=>r.value=J),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),[[ee,r.value]])])):z("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Lc={class:"glass rounded-xl p-6"},Nc={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"},Bc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Fc=["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=["value"],ou={class:"text-xs text-muted"},ru=["onKeyup","onBlur"],lu=["title","onDblclick"],au=["onBlur"],iu=["title","onDblclick"],cu={class:"ml-auto flex items-center gap-3"},uu=["onClick","disabled"],du={class:"flex items-center gap-1.5"},fu=["onClick"],pu={class:"flex items-center gap-1.5"},mu=["onClick"],vu={class:"flex items-center gap-1.5"},xu=["onClick"],hu=["onClick"],gu=["onClick"],yu=["onClick"],bu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},_u={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},wu=["value"],ku={class:"flex items-center gap-2"},Su=["onClick","disabled"],$u={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Cu={key:0,class:"text-xs text-muted py-1"},Tu={class:"text-sm font-medium"},Pu={class:"text-xs text-muted font-mono"},Eu=["value","onChange"],Au=["value"],Iu=["value"],Ou={class:"text-xs text-muted"},Mu=["onBlur","onKeyup"],Du=["title","onDblclick"],Ru={class:"ml-auto flex items-center gap-3"},ju=["onClick","disabled"],Lu=["onClick","disabled"],Nu=["onClick","disabled"],Uu={key:2,class:"flex items-center gap-1.5"},Vu=["onClick"],Bu={key:3,class:"flex items-center gap-1.5"},Fu=["onClick"],Hu={key:4,class:"flex items-center gap-1.5"},Ku=["onClick"],Wu=["onClick"],zu={key:4},Ju={class:"space-y-2"},qu={class:"font-medium"},Gu={class:"text-xs text-muted font-mono"},Yu={class:"text-xs text-textSecondary"},Zu={class:"text-xs text-muted"},Qu={class:"ml-auto flex items-center gap-2"},Xu=["onClick","disabled"],ed=["onClick","disabled"],td=["onClick"],sd={key:5},nd={class:"space-y-2"},od={class:"font-medium"},rd={class:"text-xs text-muted font-mono"},ld=["value","onChange"],ad=["value"],id=["value"],cd={class:"text-xs text-muted"},ud=["onBlur","onKeyup"],dd=["title","onDblclick"],fd={class:"ml-auto flex items-center gap-3"},pd=["onClick","disabled"],md=["onClick","disabled"],vd={class:"flex items-center gap-1.5"},xd=["onClick"],hd={class:"flex items-center gap-1.5"},gd=["onClick"],yd={class:"flex items-center gap-1.5"},bd=["onClick"],_d=["onClick"],wd={key:6},kd={class:"space-y-2"},Sd={class:"font-medium"},$d={class:"text-xs text-muted font-mono"},Cd=["value","onChange"],Td=["value"],Pd=["value"],Ed={class:"text-xs text-muted"},Ad=Be({__name:"ThreadsTab",setup(e){const t=S([]),s=S(!0),n=S(""),r=S({}),l=S(new Set),a=S(!1),i=S({name:"",threadId:0,client:"claude",workingDirectory:""}),c=S(""),x=S(!1),u=S(null),m=S(""),g=S(null),P=S(""),V=S(null),A=S(""),H=S(null),$=S({name:"",threadId:0,client:"claude",workingDirectory:""}),I=S(""),U=S(!1),O=S(null),F=S(null),k=S(null),E=["claude","copilot","codex"];function L(_){return E.includes(_)}const J={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"}},re=Te(()=>t.value.filter(_=>_.type==="root")),N=Te(()=>t.value.filter(_=>_.type==="daily")),C=Te(()=>t.value.filter(_=>_.type==="branch")),R=Te(()=>t.value.filter(_=>_.type==="worker"));async function G(){s.value=!0,n.value="";try{const _=await pe("/api/threads");t.value=_.threads??[]}catch(_){n.value=_.message||"Failed to load threads"}finally{s.value=!1}}async function ve(_){try{const f=await pe(`/api/threads/${_}/children`);r.value[_]=f.threads??[]}catch{r.value[_]=[]}}function we(_){l.value.has(_)?l.value.delete(_):(l.value.add(_),ve(_))}async function xe(){if(!(!i.value.name.trim()||!i.value.threadId)){x.value=!0,c.value="";try{const _=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:i.value.threadId,name:i.value.name.trim(),type:"root",client:i.value.client,keepAlive:!0,...i.value.workingDirectory.trim()?{workingDirectory:i.value.workingDirectory.trim()}:{}})});if(!_.ok){const f=await _.json().catch(()=>({error:_.statusText}));throw new Error(f.error??_.statusText)}c.value="Created ✓",i.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{c.value=""},3e3),await G()}catch(_){c.value="Error: "+_.message}finally{x.value=!1}}}async function ie(_){if(!(!$.value.name.trim()||!$.value.threadId)){U.value=!0,I.value="";try{const f=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:$.value.threadId,name:$.value.name.trim(),type:"branch",rootThreadId:_,client:$.value.client,...$.value.workingDirectory.trim()?{workingDirectory:$.value.workingDirectory.trim()}:{}})});if(!f.ok){const d=await f.json().catch(()=>({error:f.statusText}));throw new Error(d.error??f.statusText)}I.value="Branch created ✓",$.value={name:"",threadId:0,client:"claude",workingDirectory:""},H.value=null,setTimeout(()=>{I.value=""},3e3),await G(),ve(_)}catch(f){I.value="Error: "+f.message}finally{U.value=!1}}}function Y(_){u.value=_.threadId,m.value=_.name}async function B(_){const f=m.value.trim();if(u.value=null,!!f)try{const d=await fetch(`/api/threads/${_}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({name:f})});if(!d.ok)throw new Error(d.statusText);await G()}catch(d){n.value="Failed to rename thread: "+d.message}}function $e(_){g.value=_.threadId,P.value=_.workingDirectory??""}async function _e(_){const f=P.value.trim();g.value=null;try{const d=await fetch(`/api/threads/${_}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:f||null})});if(!d.ok)throw new Error(d.statusText);await G()}catch(d){n.value="Failed to update working directory: "+d.message}}function fe(_){return _.mcpServers?Object.keys(_.mcpServers).length:0}function kt(_){V.value=_.threadId,A.value=_.mcpServers?JSON.stringify(_.mcpServers,null,2):""}async function Us(_){const f=A.value.trim();V.value=null;let d=null;if(f)try{d=JSON.parse(f)}catch{n.value="Invalid MCP servers JSON";return}try{const D=await fetch(`/api/threads/${_}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({mcpServers:d})});if(!D.ok){const j=await D.json().catch(()=>null);throw new Error((j==null?void 0:j.error)||D.statusText)}await G()}catch(D){n.value="Failed to update MCP servers: "+D.message}}async function rt(_){try{const f=await fetch(`/api/threads/${_.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!_.keepAlive})});if(!f.ok)throw new Error(f.statusText);await G()}catch(f){n.value="Failed to toggle keep-alive: "+f.message}}async function lt(_,f){try{const d=await fetch(`/api/threads/${_.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({client:f})});if(!d.ok)throw new Error(d.statusText);await G()}catch(d){n.value="Failed to change agent type: "+d.message}}async function St(_){try{const f=await fetch(`/api/threads/${_.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!_.dailyRotation})});if(!f.ok)throw new Error(f.statusText);await G()}catch(f){n.value="Failed to toggle daily rotation: "+f.message}}async function At(_){try{const f=await fetch(`/api/threads/${_.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!_.autonomousMode})});if(!f.ok)throw new Error(f.statusText);await G()}catch(f){n.value="Failed to toggle autonomous mode: "+f.message}}async function ze(_){if(confirm(`Archive thread "${_.name}" (${_.threadId})?`))try{const f=await fetch(`/api/threads/${_.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!f.ok)throw new Error(f.statusText);await G()}catch(f){n.value="Failed to archive: "+f.message}}async function Ht(_){if(confirm(`Start thread "${_.name}" (${_.threadId})?`)){O.value=_.threadId;try{const f=await fetch(`/api/threads/${_.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${le()}`}});if(!f.ok){const d=await f.json().catch(()=>({error:f.statusText}));throw new Error(d.error??f.statusText)}await G()}catch(f){n.value="Failed to start thread: "+f.message}finally{O.value=null}}}function p(_){c.value="Sync to Root — not yet implemented",setTimeout(()=>{c.value=""},3e3)}async function b(_){if(confirm(`Convert "${_.name}" to a root thread? This will detach it from its parent.`)){k.value=_.threadId;try{const f=await fetch(`/api/threads/${_.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${le()}`}});if(!f.ok){const d=await f.json().catch(()=>({error:f.statusText}));throw new Error(d.error??f.statusText)}n.value="",c.value=`Converted "${_.name}" to root ✓`,setTimeout(()=>{c.value=""},3e3),await G()}catch(f){n.value="Failed to convert: "+f.message}finally{k.value=null}}}function T(_){if(!_)return"—";const f=new Date(_),D=Date.now()-f.getTime();return D<6e4?"just now":D<36e5?`${Math.floor(D/6e4)}m ago`:D<864e5?`${Math.floor(D/36e5)}h ago`:f.toLocaleDateString()}function M(_){return _==="active"?"text-success":_==="archived"?"text-muted":"text-warn"}return Le(G),(_,f)=>(h(),y("div",jc,[o("div",Lc,[o("div",Nc,[f[20]||(f[20]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Thread Registry"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),o("div",Uc,[c.value?(h(),y("span",{key:0,class:q([c.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},w(c.value),3)):z("",!0),o("button",{onClick:f[0]||(f[0]=d=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},w(a.value?"Cancel":"+ New Root Thread"),1),o("button",{onClick:G,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(h(),y("div",Vc,[o("div",Bc,[o("div",null,[f[21]||(f[21]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),Z(o("input",{"onUpdate:modelValue":f[1]||(f[1]=d=>i.value.name=d),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),[[ee,i.value.name]])]),o("div",null,[f[22]||(f[22]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),Z(o("input",{"onUpdate:modelValue":f[2]||(f[2]=d=>i.value.threadId=d),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),[[ee,i.value.threadId,void 0,{number:!0}]])]),o("div",null,[f[23]||(f[23]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),Z(o("select",{"onUpdate:modelValue":f[3]||(f[3]=d=>i.value.client=d),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(),y(ne,null,de(E,d=>o("option",{key:d,value:d},w(d),9,Fc)),64))],512),[[_t,i.value.client]])])]),o("div",null,[f[24]||(f[24]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),Z(o("input",{"onUpdate:modelValue":f[4]||(f[4]=d=>i.value.workingDirectory=d),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),[[ee,i.value.workingDirectory]])]),o("div",Hc,[o("button",{onClick:xe,disabled:x.value||!i.value.name.trim()||!i.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},w(x.value?"Creating…":"Create Root Thread"),9,Kc)])])):z("",!0)]),s.value&&t.value.length===0?(h(),y("div",Wc,"Loading threads…")):n.value?(h(),y("div",zc,w(n.value),1)):t.value.length===0?(h(),y("div",Jc,"No threads registered")):z("",!0),re.value.length>0?(h(),y("div",qc,[f[31]||(f[31]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),o("div",Gc,[(h(!0),y(ne,null,de(re.value,d=>{var D,j;return h(),y("div",{key:d.id,class:"glass rounded-xl overflow-hidden"},[o("div",Yc,[o("div",Zc,[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(D=J[d.type])==null?void 0:D.classes])},w((j=J[d.type])==null?void 0:j.emoji)+" "+w(d.type.toUpperCase()),3),u.value===d.threadId?Z((h(),y("input",{key:0,"onUpdate:modelValue":f[5]||(f[5]=v=>m.value=v),onBlur:v=>B(d.threadId),onKeyup:[f[6]||(f[6]=He(v=>v.target.blur(),["enter"])),f[7]||(f[7]=He(v=>u.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)),[[ee,m.value]]):(h(),y("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:v=>Y(d),title:"Double-click to rename"},w(d.name),41,Xc)),o("span",{class:q(["text-xs font-medium",M(d.status)])},w(d.status),3),o("span",eu,"ID: "+w(d.threadId),1),o("select",{value:d.client,onChange:v=>lt(d,v.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"},[L(d.client)?z("",!0):(h(),y("option",{key:0,value:d.client,disabled:""},w(d.client)+" (legacy)",9,su)),(h(),y(ne,null,de(E,v=>o("option",{key:v,value:v},w(v),9,nu)),64))],40,tu),o("span",ou,w(T(d.lastActiveAt)),1),g.value===d.threadId?Z((h(),y("input",{key:2,"onUpdate:modelValue":f[8]||(f[8]=v=>P.value=v),onKeyup:[He(v=>_e(d.threadId),["enter"]),f[9]||(f[9]=He(v=>g.value=null,["escape"]))],onBlur:v=>_e(d.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,ru)),[[ee,P.value]]):(h(),y("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(d.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:v=>$e(d)},"📁 "+w(d.workingDirectory??"—"),41,lu)),V.value===d.threadId?Z((h(),y("textarea",{key:4,"onUpdate:modelValue":f[10]||(f[10]=v=>A.value=v),onKeyup:f[11]||(f[11]=He(v=>V.value=null,["escape"])),onBlur:v=>Us(d.threadId),rows:"4",placeholder:'{"youtube-rag":{"type":"http","url":"https://…","headers":{"Authorization":"Bearer …"}}}',class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-72"},null,40,au)),[[ee,A.value]]):(h(),y("span",{key:5,class:"text-xs text-muted font-mono truncate max-w-[160px] cursor-pointer hover:text-accent transition",title:(fe(d)?fe(d)+" custom MCP server(s) attached":"Click to attach an http MCP server")+" (dblclick to edit)",onDblclick:v=>kt(d)},"🔌 "+w(fe(d)||"—"),41,iu)),o("div",cu,[o("button",{onClick:v=>Ht(d),disabled:O.value===d.threadId||d.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"},w(O.value===d.threadId?"Starting…":"▶ Start"),9,uu),o("div",du,[o("button",{onClick:v=>rt(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,fu),f[25]||(f[25]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),o("div",pu,[o("button",{onClick:v=>St(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,mu),f[26]||(f[26]=o("span",{class:"text-xs text-muted"},"Daily",-1))]),o("div",vu,[o("button",{onClick:v=>At(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,xu),f[27]||(f[27]=o("span",{class:"text-xs text-muted"},"Auto",-1))]),o("button",{onClick:v=>we(d.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},w(l.value.has(d.threadId)?"▾ Children":"▸ Children"),9,hu),o("button",{onClick:v=>{H.value=H.value===d.threadId?null:d.threadId,$.value={name:"",threadId:0,client:"claude",workingDirectory:""},I.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,gu),o("button",{onClick:v=>ze(d),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,yu)])]),H.value===d.threadId?(h(),y("div",bu,[o("div",_u,[Z(o("input",{"onUpdate:modelValue":f[12]||(f[12]=v=>$.value.name=v),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),[[ee,$.value.name]]),Z(o("input",{"onUpdate:modelValue":f[13]||(f[13]=v=>$.value.threadId=v),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),[[ee,$.value.threadId,void 0,{number:!0}]]),Z(o("select",{"onUpdate:modelValue":f[14]||(f[14]=v=>$.value.client=v),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(),y(ne,null,de(E,v=>o("option",{key:v,value:v},w(v),9,wu)),64))],512),[[_t,$.value.client]])]),Z(o("input",{"onUpdate:modelValue":f[15]||(f[15]=v=>$.value.workingDirectory=v),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),[[ee,$.value.workingDirectory]]),o("div",ku,[o("button",{onClick:v=>ie(d.threadId),disabled:U.value||!$.value.name.trim()||!$.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"},w(U.value?"Creating…":"Create Branch"),9,Su),I.value?(h(),y("span",{key:0,class:q([I.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},w(I.value),3)):z("",!0)])])):z("",!0)]),l.value.has(d.threadId)&&r.value[d.threadId]?(h(),y("div",$u,[r.value[d.threadId].length===0?(h(),y("div",Cu,"No children")):z("",!0),(h(!0),y(ne,null,de(r.value[d.threadId],v=>{var Q,K;return h(),y("div",{key:v.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[o("span",{class:q(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(Q=J[v.type])==null?void 0:Q.classes])},w((K=J[v.type])==null?void 0:K.emoji)+" "+w(v.type.toUpperCase()),3),o("span",Tu,w(v.name),1),o("span",{class:q(["text-xs",M(v.status)])},w(v.status),3),o("span",Pu,"ID: "+w(v.threadId),1),o("select",{value:v.client,onChange:W=>lt(v,W.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"},[L(v.client)?z("",!0):(h(),y("option",{key:0,value:v.client,disabled:""},w(v.client)+" (legacy)",9,Au)),(h(),y(ne,null,de(E,W=>o("option",{key:W,value:W},w(W),9,Iu)),64))],40,Eu),o("span",Ou,w(T(v.lastActiveAt)),1),v.type==="branch"&&g.value===v.threadId?Z((h(),y("input",{key:0,"onUpdate:modelValue":f[16]||(f[16]=W=>P.value=W),onBlur:W=>_e(v.threadId),onKeyup:[He(W=>_e(v.threadId),["enter"]),f[17]||(f[17]=He(W=>g.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,Mu)),[[ee,P.value]]):v.type==="branch"?(h(),y("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(v.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:W=>$e(v)},"📁 "+w(v.workingDirectory??"—"),41,Du)):z("",!0),o("div",Ru,[o("button",{onClick:W=>Ht(v),disabled:O.value===v.threadId||v.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"},w(O.value===v.threadId?"Starting…":"▶ Start"),9,ju),v.rootThreadId?(h(),y("button",{key:0,onClick:W=>p(),disabled:F.value===v.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"},w(F.value===v.threadId?"Syncing…":"⟳ Sync to Root"),9,Lu)):z("",!0),v.type==="branch"||v.type==="daily"?(h(),y("button",{key:1,onClick:W=>b(v),disabled:k.value===v.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"},w(k.value===v.threadId?"Converting…":"↑ To Root"),9,Nu)):z("",!0),v.type==="branch"?(h(),y("div",Uu,[o("button",{onClick:W=>rt(v),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",v.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",v.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),f[28]||(f[28]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):z("",!0),v.type==="branch"?(h(),y("div",Bu,[o("button",{onClick:W=>St(v),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",v.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",v.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Fu),f[29]||(f[29]=o("span",{class:"text-xs text-muted"},"Daily",-1))])):z("",!0),v.type==="branch"?(h(),y("div",Hu,[o("button",{onClick:W=>At(v),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",v.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",v.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Ku),f[30]||(f[30]=o("span",{class:"text-xs text-muted"},"Auto",-1))])):z("",!0),v.type!=="root"?(h(),y("button",{key:5,onClick:W=>ze(v),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,Wu)):z("",!0)])])}),128))])):z("",!0)])}),128))])])):z("",!0),N.value.length>0?(h(),y("div",zu,[f[32]||(f[32]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),o("div",Ju,[(h(!0),y(ne,null,de(N.value,d=>{var D,j;return h(),y("div",{key:d.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(D=J[d.type])==null?void 0:D.classes])},w((j=J[d.type])==null?void 0:j.emoji)+" "+w(d.type.toUpperCase()),3),o("span",qu,w(d.name),1),o("span",{class:q(["text-xs font-medium",M(d.status)])},w(d.status),3),o("span",Gu,"ID: "+w(d.threadId),1),o("span",Yu,w(d.client),1),o("span",Zu,w(T(d.lastActiveAt)),1),o("div",Qu,[o("button",{onClick:v=>Ht(d),disabled:O.value===d.threadId||d.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"},w(O.value===d.threadId?"Starting…":"▶ Start"),9,Xu),d.rootThreadId?(h(),y("button",{key:0,onClick:v=>p(),disabled:F.value===d.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"},w(F.value===d.threadId?"Syncing…":"⟳ Sync to Root"),9,ed)):z("",!0),o("button",{onClick:v=>ze(d),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,td)])])}),128))])])):z("",!0),C.value.length>0?(h(),y("div",sd,[f[36]||(f[36]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),o("div",nd,[(h(!0),y(ne,null,de(C.value,d=>{var D,j;return h(),y("div",{key:d.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(D=J[d.type])==null?void 0:D.classes])},w((j=J[d.type])==null?void 0:j.emoji)+" "+w(d.type.toUpperCase()),3),o("span",od,w(d.name),1),o("span",{class:q(["text-xs font-medium",M(d.status)])},w(d.status),3),o("span",rd,"ID: "+w(d.threadId),1),o("select",{value:d.client,onChange:v=>lt(d,v.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"},[L(d.client)?z("",!0):(h(),y("option",{key:0,value:d.client,disabled:""},w(d.client)+" (legacy)",9,ad)),(h(),y(ne,null,de(E,v=>o("option",{key:v,value:v},w(v),9,id)),64))],40,ld),o("span",cd,w(T(d.lastActiveAt)),1),g.value===d.threadId?Z((h(),y("input",{key:0,"onUpdate:modelValue":f[18]||(f[18]=v=>P.value=v),onBlur:v=>_e(d.threadId),onKeyup:[He(v=>_e(d.threadId),["enter"]),f[19]||(f[19]=He(v=>g.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,ud)),[[ee,P.value]]):(h(),y("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(d.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:v=>$e(d)},"📁 "+w(d.workingDirectory??"—"),41,dd)),o("div",fd,[o("button",{onClick:v=>Ht(d),disabled:O.value===d.threadId||d.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"},w(O.value===d.threadId?"Starting…":"▶ Start"),9,pd),d.rootThreadId?(h(),y("button",{key:0,onClick:v=>p(),disabled:F.value===d.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"},w(F.value===d.threadId?"Syncing…":"⟳ Sync to Root"),9,md)):z("",!0),o("div",vd,[o("button",{onClick:v=>rt(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,xd),f[33]||(f[33]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),o("div",hd,[o("button",{onClick:v=>St(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,gd),f[34]||(f[34]=o("span",{class:"text-xs text-muted"},"Daily",-1))]),o("div",yd,[o("button",{onClick:v=>At(d),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",d.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",d.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,bd),f[35]||(f[35]=o("span",{class:"text-xs text-muted"},"Auto",-1))]),o("button",{onClick:v=>ze(d),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,_d)])])}),128))])])):z("",!0),R.value.length>0?(h(),y("div",wd,[f[38]||(f[38]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),o("div",kd,[(h(!0),y(ne,null,de(R.value,d=>{var D,j;return h(),y("div",{key:d.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(D=J[d.type])==null?void 0:D.classes])},w((j=J[d.type])==null?void 0:j.emoji)+" "+w(d.type.toUpperCase()),3),o("span",Sd,w(d.name),1),o("span",{class:q(["text-xs font-medium",M(d.status)])},w(d.status),3),o("span",$d,"ID: "+w(d.threadId),1),o("select",{value:d.client,onChange:v=>lt(d,v.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"},[L(d.client)?z("",!0):(h(),y("option",{key:0,value:d.client,disabled:""},w(d.client)+" (legacy)",9,Td)),(h(),y(ne,null,de(E,v=>o("option",{key:v,value:v},w(v),9,Pd)),64))],40,Cd),o("span",Ed,w(T(d.lastActiveAt)),1),f[37]||(f[37]=o("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):z("",!0)]))}}),Id={class:"animate-fade-in"},Od={class:"glass rounded-xl p-6 mb-6"},Md={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Dd={class:"flex items-center gap-3"},Rd={key:0,class:"text-center py-8 text-textSecondary text-sm"},jd={key:1,class:"text-center py-8 text-danger text-sm"},Ld={key:2,class:"text-center text-textSecondary py-12"},Nd={key:3,class:"space-y-2"},Ud={class:"flex items-center justify-between gap-3"},Vd={class:"flex-1 min-w-0"},Bd={class:"flex items-center gap-2 mb-1"},Fd={class:"font-medium text-sm"},Hd={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Kd={key:0,class:"type-badge",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"}},Wd={class:"text-xs text-muted font-mono truncate"},zd={class:"flex items-center gap-2 shrink-0"},Jd=["onClick","disabled"],qd=["onClick"],Gd=["onClick","disabled"],Yd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Zd={class:"text-lg font-semibold mb-4"},Qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Xd=["value"],ef={class:"mb-4"},tf={class:"mb-4"},sf={class:"mb-4"},nf={class:"flex items-center gap-3 flex-wrap"},of=["disabled"],rf={key:0,class:"text-sm text-danger"},lf=Be({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex"],s=S([]),n=S(!0),r=S(""),l=S(""),a=S(!0),i=S(!1),c=S(null),x=S(null),u=S(!1),m=S(null),g=S(""),P=S("claude"),V=S(""),A=S(""),H=S(""),$=S("");async function I(){n.value=!0,r.value="";try{const N=await pe("/api/agent-templates");s.value=N.templates||[]}catch(N){r.value="Failed to load templates: "+N.message}finally{n.value=!1}}function U(){m.value=null,g.value="",P.value="claude",V.value="",A.value="",H.value="",$.value="",u.value=!0}function O(N){m.value=N.id,g.value=N.name,P.value=N.client,V.value=N.workingDirectory,A.value=N.systemPrompt||"",H.value=N.mcpServers&&Object.keys(N.mcpServers).length?JSON.stringify(N.mcpServers,null,2):"",$.value="",u.value=!0}function F(){u.value=!1,m.value=null}function k(){$.value="";const N=g.value.trim(),C=V.value.trim();if(!N)return $.value="Name is required",null;if(!C)return $.value="Working directory is required",null;let R={};const G=H.value.trim();if(G){try{R=JSON.parse(G)}catch{return $.value="MCP servers must be valid JSON",null}if(typeof R!="object"||R===null||Array.isArray(R))return $.value="MCP servers must be a JSON object",null}return{name:N,client:P.value,workingDirectory:C,systemPrompt:A.value.trim()||null,mcpServers:R}}async function E(){if(i.value)return;const N=k();if(N){i.value=!0;try{const C=m.value?`/api/agent-templates/${m.value}`:"/api/agent-templates",R=m.value?"PATCH":"POST",G=await fetch(C,{method:R,headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify(N)});if(!G.ok){const ve=await G.json().catch(()=>({}));throw new Error(ve.error||G.statusText)}re("Saved ✓",!0),F(),await I()}catch(C){$.value="Error: "+C.message}finally{i.value=!1}}}async function L(N){if(!c.value){c.value=N.id;try{const C=await fetch(`/api/agent-templates/${N.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${le()}`}});if(!C.ok){const G=await C.json().catch(()=>({}));throw new Error(G.error||C.statusText)}const R=await C.json();re(`Started thread ${R.threadId} ✓`,!0)}catch(C){re("Error: "+C.message,!1)}finally{c.value=null}}}async function J(N){if(confirm(`Delete template "${N.name}"?`)&&!x.value){x.value=N.id;try{const C=await fetch(`/api/agent-templates/${N.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!C.ok)throw new Error(C.statusText);re("Deleted ✓",!0),await I()}catch(C){re("Error: "+C.message,!1)}finally{x.value=null}}}function re(N,C){l.value=N,a.value=C,setTimeout(()=>{l.value=""},3e3)}return Le(I),(N,C)=>(h(),y("div",Id,[o("div",Od,[o("div",Md,[C[5]||(C[5]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Agent Templates"),o("p",{class:"text-sm text-textSecondary mt-1"},"Reusable spawn presets. Starting one stamps out a fresh root thread.")],-1)),o("div",Dd,[l.value?(h(),y("span",{key:0,class:q(["text-sm",a.value?"text-success":"text-danger"])},w(l.value),3)):z("",!0),o("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Template ")])]),n.value?(h(),y("div",Rd,"Loading...")):r.value?(h(),y("div",jd,w(r.value),1)):s.value.length===0?(h(),y("div",Ld,"No agent templates yet")):(h(),y("div",Nd,[(h(!0),y(ne,null,de(s.value,R=>(h(),y("div",{key:R.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[o("div",Ud,[o("div",Vd,[o("div",Bd,[o("span",Fd,w(R.name),1),o("span",Hd,w(R.client),1),R.mcpServers&&Object.keys(R.mcpServers).length?(h(),y("span",Kd,w(Object.keys(R.mcpServers).length)+" mcp",1)):z("",!0)]),o("div",Wd,w(R.workingDirectory),1)]),o("div",zd,[o("button",{onClick:G=>L(R),disabled:c.value===R.id,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight text-xs text-white font-medium transition disabled:opacity-50"},w(c.value===R.id?"Starting…":"Start"),9,Jd),o("button",{onClick:G=>O(R),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,qd),o("button",{onClick:G=>J(R),disabled:x.value===R.id,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"},w(x.value===R.id?"…":"Delete"),9,Gd)])])]))),128))]))]),u.value?(h(),y("div",Yd,[o("h3",Zd,w(m.value?`Edit: ${g.value}`:"New Agent Template"),1),o("div",Qd,[o("div",null,[C[6]||(C[6]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Name "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":C[0]||(C[0]=R=>g.value=R),type:"text",placeholder:"YouTube Researcher",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),[[ee,g.value]])]),o("div",null,[C[7]||(C[7]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Client "),o("span",{class:"text-danger"},"*")],-1)),Z(o("select",{"onUpdate:modelValue":C[1]||(C[1]=R=>P.value=R),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"},[(h(),y(ne,null,de(t,R=>o("option",{key:R,value:R},w(R),9,Xd)),64))],512),[[_t,P.value]])])]),o("div",ef,[C[8]||(C[8]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Working Directory "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":C[2]||(C[2]=R=>V.value=R),type:"text",placeholder:"C:\\src\\my-project",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),[[ee,V.value]])]),o("div",tf,[C[9]||(C[9]=o("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),Z(o("textarea",{"onUpdate:modelValue":C[3]||(C[3]=R=>A.value=R),rows:"4",placeholder:"Optional identity prompt for the spawned thread",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 resize-y"},null,512),[[ee,A.value]])]),o("div",sf,[C[10]||(C[10]=o("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),Z(o("textarea",{"onUpdate:modelValue":C[4]||(C[4]=R=>H.value=R),rows:"6",placeholder:'{ "my-server": { "type": "http", "url": "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 resize-y"},null,512),[[ee,H.value]]),C[11]||(C[11]=o("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),o("div",nf,[o("button",{onClick:E,disabled:i.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},w(i.value?"Saving…":m.value?"Save Changes":"Create Template"),9,of),o("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"}," Cancel "),$.value?(h(),y("span",rf,w($.value),1)):z("",!0)])])):z("",!0)]))}}),af={class:"animate-fade-in"},cf={class:"glass rounded-xl p-6 mb-6"},uf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},df={class:"flex items-center gap-3"},ff={key:0,class:"text-center py-8 text-textSecondary text-sm"},pf={key:1,class:"text-center py-8 text-danger text-sm"},mf={key:2,class:"text-center text-textSecondary py-12"},vf={key:3,class:"space-y-2"},xf={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},hf={class:"flex items-center justify-between gap-3"},gf={class:"flex items-center gap-2 min-w-0"},yf={class:"flex items-center justify-between gap-3"},bf={class:"flex-1 min-w-0"},_f={class:"flex items-center gap-2 mb-1"},wf={class:"font-medium text-sm font-mono"},kf={class:"text-xs text-muted font-mono truncate"},Sf={class:"flex items-center gap-2 shrink-0"},$f=["onClick"],Cf=["onClick","disabled"],Tf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Pf={class:"text-lg font-semibold mb-4"},Ef={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Af=["readonly"],If={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Of={class:"mb-4"},Mf={class:"flex items-center justify-between mb-2"},Df=["onUpdate:modelValue"],Rf=["onUpdate:modelValue"],jf=["onClick"],Lf={key:0,class:"text-xs text-muted italic"},Nf={class:"mb-4"},Uf={class:"mb-4"},Vf={class:"flex items-center justify-between mb-2"},Bf=["onUpdate:modelValue"],Ff=["onUpdate:modelValue"],Hf=["onClick"],Kf={key:0,class:"text-xs text-muted italic"},Wf={class:"flex items-center gap-3 flex-wrap"},zf=["disabled"],Jf={key:0,class:"text-sm text-danger"},qt="sensorium-mcp",qf=Be({__name:"McpServersTab",setup(e){const t=S({}),s=S(!0),n=S(""),r=S(""),l=S(!0),a=S(!1),i=S(null),c=S(!1),x=S(null),u=S(""),m=S("stdio"),g=S(""),P=S(""),V=S(""),A=S([]),H=S([]),$=S(""),I=Te(()=>Object.entries(t.value).filter(([N])=>N!==qt));async function U(){s.value=!0,n.value="";try{const N=await pe("/api/mcp-servers");t.value=N.servers||{}}catch(N){n.value="Failed to load MCP servers: "+N.message}finally{s.value=!1}}function O(N){return N==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function F(){x.value=null,u.value="",m.value="stdio",g.value="",P.value="",V.value="",A.value=[],H.value=[],$.value="",c.value=!0}function k(N,C){x.value=N,u.value=N,m.value=C.type,g.value=C.command||"",P.value=(C.args||[]).join(" "),V.value=C.url||"",A.value=Object.entries(C.env||{}).map(([R,G])=>({k:R,v:G})),H.value=Object.entries(C.headers||{}).map(([R,G])=>({k:R,v:G})),$.value="",c.value=!0}function E(){c.value=!1,x.value=null}function L(){if($.value="",!u.value.trim())return $.value="Name is required",!1;if(m.value==="stdio"&&!g.value.trim())return $.value="Command is required for stdio type",!1;if(m.value==="http"){const N=V.value.trim();if(!N)return $.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(N))return $.value="URL must start with http:// or https://",!1}return!0}async function J(){if(!L()||a.value)return;a.value=!0;const N=u.value.trim(),C={type:m.value};if(m.value==="stdio"){C.command=g.value.trim();const R=P.value.trim();R&&(C.args=R.split(/\s+/));const G=Object.fromEntries(A.value.filter(ve=>ve.k.trim()).map(ve=>[ve.k.trim(),ve.v]));Object.keys(G).length&&(C.env=G)}else{C.url=V.value.trim();const R=Object.fromEntries(H.value.filter(G=>G.k.trim()).map(G=>[G.k.trim(),G.v]));Object.keys(R).length&&(C.headers=R)}try{const R=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify({name:N,config:C})});if(!R.ok)throw new Error(R.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),E(),await U()}catch(R){$.value="Error: "+R.message}finally{a.value=!1}}async function re(N){if(confirm(`Delete MCP server "${N}"?`)&&!i.value){i.value=N;try{const C=await fetch(`/api/mcp-servers/${encodeURIComponent(N)}`,{method:"DELETE",headers:{Authorization:`Bearer ${le()}`}});if(!C.ok)throw new Error(C.statusText);r.value="Deleted ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await U()}catch(C){r.value="Error: "+C.message,l.value=!1}finally{i.value=null}}}return Le(U),(N,C)=>(h(),y("div",af,[o("div",cf,[o("div",uf,[C[7]||(C[7]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"MCP Servers"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),o("div",df,[r.value?(h(),y("span",{key:0,class:q(["text-sm",l.value?"text-success":"text-danger"])},w(r.value),3)):z("",!0),o("button",{onClick:F,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(h(),y("div",ff,"Loading...")):n.value?(h(),y("div",pf,w(n.value),1)):Object.keys(t.value).length===0?(h(),y("div",mf,"No MCP servers configured")):(h(),y("div",vf,[t.value[qt]?(h(),y("div",xf,[o("div",hf,[o("div",gf,[o("span",{class:"font-medium text-sm font-mono"},w(qt)),o("span",{class:"type-badge",style:Lt(O(t.value[qt].type))},w(t.value[qt].type),5),C[8]||(C[8]=o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),C[9]||(C[9]=o("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):z("",!0),(h(!0),y(ne,null,de(I.value,([R,G])=>{var ve;return h(),y("div",{key:R,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[o("div",yf,[o("div",bf,[o("div",_f,[o("span",wf,w(R),1),o("span",{class:"type-badge",style:Lt(O(G.type))},w(G.type),5)]),o("div",kf,[G.type==="stdio"?(h(),y(ne,{key:0},[X(w(G.command)+w((ve=G.args)!=null&&ve.length?" "+G.args.join(" "):""),1)],64)):(h(),y(ne,{key:1},[X(w(G.url),1)],64))])]),o("div",Sf,[o("button",{onClick:we=>k(R,G),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,$f),o("button",{onClick:we=>re(R),disabled:i.value===R,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"},w(i.value===R?"…":"Delete"),9,Cf)])])])}),128))]))]),c.value?(h(),y("div",Tf,[o("h3",Pf,w(x.value?`Edit: ${x.value}`:"Add MCP Server"),1),o("div",Ef,[o("div",null,[C[10]||(C[10]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Name "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":C[0]||(C[0]=R=>u.value=R),type:"text",readonly:!!x.value,placeholder:"my-server",class:q(["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,Af),[[ee,u.value]])]),o("div",null,[C[12]||(C[12]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Type "),o("span",{class:"text-danger"},"*")],-1)),Z(o("select",{"onUpdate:modelValue":C[1]||(C[1]=R=>m.value=R),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"},[...C[11]||(C[11]=[o("option",{value:"stdio"},"stdio",-1),o("option",{value:"http"},"http",-1)])],512),[[_t,m.value]])])]),m.value==="stdio"?(h(),y(ne,{key:0},[o("div",If,[o("div",null,[C[13]||(C[13]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Command "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":C[2]||(C[2]=R=>g.value=R),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),[[ee,g.value]])]),o("div",null,[C[14]||(C[14]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),Z(o("input",{"onUpdate:modelValue":C[3]||(C[3]=R=>P.value=R),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),[[ee,P.value]])])]),o("div",Of,[o("div",Mf,[C[15]||(C[15]=o("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),o("button",{onClick:C[4]||(C[4]=R=>A.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),y(ne,null,de(A.value,(R,G)=>(h(),y("div",{key:G,class:"flex items-center gap-2 mb-2"},[Z(o("input",{"onUpdate:modelValue":ve=>R.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,Df),[[ee,R.k]]),C[16]||(C[16]=o("span",{class:"text-muted text-xs"},"=",-1)),Z(o("input",{"onUpdate:modelValue":ve=>R.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),[[ee,R.v]]),o("button",{onClick:ve=>A.value.splice(G,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,jf)]))),128)),A.value.length===0?(h(),y("div",Lf,"No env vars")):z("",!0)])],64)):(h(),y(ne,{key:1},[o("div",Nf,[C[17]||(C[17]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("URL "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":C[5]||(C[5]=R=>V.value=R),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),[[ee,V.value]])]),o("div",Uf,[o("div",Vf,[C[18]||(C[18]=o("label",{class:"text-xs text-textSecondary"},"Headers",-1)),o("button",{onClick:C[6]||(C[6]=R=>H.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),y(ne,null,de(H.value,(R,G)=>(h(),y("div",{key:G,class:"flex items-center gap-2 mb-2"},[Z(o("input",{"onUpdate:modelValue":ve=>R.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,Bf),[[ee,R.k]]),C[19]||(C[19]=o("span",{class:"text-muted text-xs"},":",-1)),Z(o("input",{"onUpdate:modelValue":ve=>R.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,Ff),[[ee,R.v]]),o("button",{onClick:ve=>H.value.splice(G,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Hf)]))),128)),H.value.length===0?(h(),y("div",Kf,"No headers")):z("",!0)])],64)),o("div",Wf,[o("button",{onClick:J,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"},w(a.value?"Saving…":x.value?"Save Changes":"Add Server"),9,zf),o("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"}," Cancel "),$.value?(h(),y("span",Jf,w($.value),1)):z("",!0)])])):z("",!0)]))}}),Gf={class:"animate-fade-in"},Yf={class:"glass rounded-xl p-6 mb-6"},Zf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Qf={class:"flex items-center gap-3"},Xf=["disabled"],ep={key:0,class:"text-center py-8 text-textSecondary text-sm"},tp={key:1,class:"space-y-6"},sp={class:"glass rounded-xl p-4 border border-gray-700/50"},np={class:"glass rounded-xl p-4 border border-gray-700/50"},op={class:"glass rounded-xl p-4 border border-gray-700/50"},rp={class:"glass rounded-xl p-4 border border-gray-700/50"},lp={class:"glass rounded-xl p-4 border border-gray-700/50"},ap={class:"glass rounded-xl p-4 border border-gray-700/50"},ip={class:"text-xs text-textSecondary mb-3"},cp={class:"flex items-center gap-2"},up=["placeholder"],dp=["disabled"],fp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},pp={class:"grid grid-cols-2 gap-4"},mp={class:"text-sm font-medium font-mono text-textSecondary"},vp={class:"text-sm font-medium font-mono text-textSecondary"},xp={class:"mt-3"},hp=Be({__name:"ClaudeTab",setup(e){const t=S(!0),s=S(!1),n=S(""),r=S("claude-opus-4-6"),l=S("claude-opus-4-6"),a=S("claude-sonnet-4-5"),i=S("claude-sonnet-4-5"),c=S(!1),x=S(""),u=S(""),m=S(""),g=S(""),P=S(20),V=S(20),A=S(""),H=S(!1),$=Te(()=>r.value!==l.value||a.value!==i.value||x.value!==u.value||m.value!==g.value||P.value!==V.value||A.value.length>0);async function I(){t.value=!0;try{const[F,k,E]=await Promise.all([pe("/api/settings/default-thread-model"),pe("/api/settings/default-worker-model"),pe("/api/settings/claude")]);r.value=F.defaultThreadModel,l.value=F.defaultThreadModel,a.value=k.defaultWorkerModel,i.value=k.defaultWorkerModel,x.value=E.cliPath,u.value=E.cliPath,m.value=E.gitBashPath,g.value=E.gitBashPath,P.value=E.maxConcurrentThreads,V.value=E.maxConcurrentThreads,H.value=E.oauthTokenSet,A.value=""}finally{t.value=!1}}async function U(){if(s.value=!0,n.value="",!r.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!a.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite(P.value)||P.value<1){n.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const F={Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},k={cliPath:x.value,gitBashPath:m.value,maxConcurrentThreads:P.value};A.value.length>0&&(k.oauthToken=A.value);const[E,L,J]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:F,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:F,body:JSON.stringify({model:a.value})}),fetch("/api/settings/claude",{method:"POST",headers:F,body:JSON.stringify(k)})]);for(const R of[E,L,J])if(!R.ok){const G=await R.json().catch(()=>({error:R.statusText}));throw new Error(G.error??R.statusText)}const re=await E.json(),N=await L.json(),C=await J.json();l.value=re.defaultThreadModel,r.value=re.defaultThreadModel,i.value=N.defaultWorkerModel,a.value=N.defaultWorkerModel,x.value=C.cliPath,u.value=C.cliPath,m.value=C.gitBashPath,g.value=C.gitBashPath,P.value=C.maxConcurrentThreads,V.value=C.maxConcurrentThreads,H.value=C.oauthTokenSet,A.value="",n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(F){n.value="Error: "+F.message}finally{s.value=!1}}async function O(){c.value=!0,n.value="";try{const F={Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},k=await fetch("/api/settings/claude",{method:"POST",headers:F,body:JSON.stringify({clearOauthToken:!0})});if(!k.ok){const L=await k.json().catch(()=>({error:k.statusText}));throw new Error(L.error??k.statusText)}const E=await k.json();H.value=E.oauthTokenSet,A.value="",n.value="Token cleared ✓",setTimeout(()=>{n.value=""},3e3)}catch(F){n.value="Error: "+F.message}finally{c.value=!1}}return Le(I),(F,k)=>(h(),y("div",Gf,[o("div",Yf,[o("div",Zf,[k[6]||(k[6]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Claude"),o("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),o("div",Qf,[n.value?(h(),y("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},w(n.value),3)):z("",!0),o("button",{onClick:U,disabled:s.value||t.value||!$.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},w(s.value?"Saving…":"Save"),9,Xf)])]),t.value?(h(),y("div",ep,"Loading…")):(h(),y("div",tp,[o("div",sp,[k[7]||(k[7]=o("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),k[8]||(k[8]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":k[0]||(k[0]=E=>r.value=E),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),[[ee,r.value,void 0,{trim:!0}]])]),o("div",np,[k[9]||(k[9]=o("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),k[10]||(k[10]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a worker Claude thread. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":k[1]||(k[1]=E=>a.value=E),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),[[ee,a.value,void 0,{trim:!0}]])]),o("div",op,[k[11]||(k[11]=o("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),k[12]||(k[12]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":k[2]||(k[2]=E=>x.value=E),type:"text",placeholder:"(auto-detect)",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),[[ee,x.value,void 0,{trim:!0}]])]),o("div",rp,[k[13]||(k[13]=o("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),k[14]||(k[14]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Path to "),o("span",{class:"font-mono text-accentLight"},"bash.exe"),X(" passed to Claude via "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),X(". Leave empty to auto-detect. ")],-1)),Z(o("input",{"onUpdate:modelValue":k[3]||(k[3]=E=>m.value=E),type:"text",placeholder:"(auto-detect)",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),[[ee,m.value,void 0,{trim:!0}]])]),o("div",lp,[k[15]||(k[15]=o("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),k[16]||(k[16]=o("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),Z(o("input",{"onUpdate:modelValue":k[4]||(k[4]=E=>P.value=E),type:"number",min:"1",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),[[ee,P.value,void 0,{number:!0}]])]),o("div",ap,[k[20]||(k[20]=o("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),o("p",ip,[k[17]||(k[17]=X(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),k[18]||(k[18]=o("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),k[19]||(k[19]=X(" env var if set. ",-1)),o("span",{class:q(H.value?"text-success":"text-muted")},w(H.value?"A token is currently stored.":"No token stored."),3)]),o("div",cp,[Z(o("input",{"onUpdate:modelValue":k[5]||(k[5]=E=>A.value=E),type:"password",placeholder:H.value?"•••••••• (leave empty to keep)":"Paste token to store",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,up),[[ee,A.value]]),H.value?(h(),y("button",{key:0,onClick:O,disabled:c.value,class:"px-3 py-2 rounded-lg border border-gray-700 hover:border-danger hover:text-danger disabled:opacity-50 text-sm transition whitespace-nowrap"},w(c.value?"Clearing…":"Clear"),9,dp)):z("",!0)])]),o("div",fp,[k[23]||(k[23]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",pp,[o("div",null,[k[21]||(k[21]=o("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),o("span",mp,w(l.value),1)]),o("div",null,[k[22]||(k[22]=o("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),o("span",vp,w(i.value),1)])]),o("div",xp,[o("span",{class:q(["text-sm font-medium",$.value?"text-warn":"text-textSecondary"])},w($.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),gp={class:"animate-fade-in"},yp={class:"glass rounded-xl p-6 mb-6"},bp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},_p={class:"flex items-center gap-3"},wp=["disabled"],kp={key:0,class:"text-center py-8 text-textSecondary text-sm"},Sp={key:1,class:"space-y-6"},$p={class:"glass rounded-xl p-4 border border-gray-700/50"},Cp={id:"copilot-models"},Tp=["value"],Pp={key:0,class:"text-xs text-success mt-2"},Ep={class:"glass rounded-xl p-4 border border-gray-700/50"},Ap={class:"flex items-center justify-between"},Ip={class:"glass rounded-xl p-4 border border-gray-700/50"},Op=["disabled"],Mp={class:"glass rounded-xl p-4 border border-gray-700/50"},Dp=["disabled"],Rp={class:"glass rounded-xl p-4 border border-gray-700/50"},jp={class:"text-xs text-textSecondary mb-3"},Lp={key:0,class:"text-success"},Np={key:1,class:"text-warn"},Up=["disabled","placeholder"],Vp={class:"glass rounded-xl p-4 border border-gray-700/50"},Bp={key:0,class:"mt-4 space-y-4"},Fp={class:"text-xs text-textSecondary mb-2"},Hp=["disabled"],Kp={class:"text-xs text-textSecondary mb-2"},Wp=["disabled"],zp={class:"glass rounded-xl p-4 border border-gray-700/50"},Jp={class:"flex items-center justify-between gap-3"},qp=["disabled"],Gp={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},Yp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Zp={class:"grid grid-cols-2 gap-4"},Qp={class:"text-sm font-medium font-mono text-textSecondary"},Xp=Be({__name:"CopilotTab",setup(e){const t=S(!0),s=S(!1),n=S(""),r=S(""),l=S(!1),a=S("openai"),i=S(""),c=S(""),x=S(""),u=S(""),m=S(!1),g=S(!1),P=S(!1),V=S(""),A=S([]);async function H(){t.value=!0;try{const F=await pe("/api/settings/copilot");$(F),l.value&&m.value&&O(!0)}finally{t.value=!1}}function $(F){r.value=F.model,l.value=F.byok.enabled,a.value=F.byok.providerType,i.value=F.byok.baseUrl,c.value=F.byok.modelId,x.value=F.byok.wireModel,m.value=F.byok.apiKeySet,u.value=""}const I=Te(()=>!(!r.value.trim()||l.value&&(!i.value.trim()||!m.value&&!u.value.trim())));async function U(){if(s.value=!0,n.value="",!r.value.trim()){n.value="Error: Model cannot be empty",s.value=!1;return}try{const F={enabled:l.value,providerType:a.value,baseUrl:i.value.trim(),modelId:c.value.trim(),wireModel:x.value.trim()};u.value.trim()&&(F.apiKey=u.value.trim());const k={Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},E=await fetch("/api/settings/copilot",{method:"POST",headers:k,body:JSON.stringify({model:r.value.trim(),byok:F})});if(!E.ok){const J=await E.json().catch(()=>({error:E.statusText}));throw new Error(J.error??E.statusText)}const L=await E.json();$(L),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(F){n.value="Error: "+F.message}finally{s.value=!1}}async function O(F=!1){P.value=!0,V.value="",A.value=[];try{const k={baseUrl:i.value.trim(),providerType:a.value};u.value.trim()&&(k.apiKey=u.value.trim());const E=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},body:JSON.stringify(k)}),L=await E.json();if(!E.ok||!L.ok)throw new Error(L.error??E.statusText);A.value=L.models??[],V.value=`OK — ${L.count??A.value.length} models`}catch(k){F||(V.value="Error: "+k.message)}finally{P.value=!1}}return Le(H),(F,k)=>(h(),y("div",gp,[o("div",yp,[o("div",bp,[k[9]||(k[9]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Copilot"),o("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),o("div",_p,[n.value?(h(),y("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},w(n.value),3)):z("",!0),o("button",{onClick:U,disabled:s.value||t.value||!I.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},w(s.value?"Saving…":"Save"),9,wp)])]),t.value?(h(),y("div",kp,"Loading…")):(h(),y("div",Sp,[o("div",$p,[k[10]||(k[10]=o("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),k[11]||(k[11]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model passed to the Copilot CLI via "),o("span",{class:"font-mono text-accentLight"},"--model"),X(" / "),o("span",{class:"font-mono text-accentLight"},"COPILOT_MODEL"),X(". ")],-1)),Z(o("input",{"onUpdate:modelValue":k[0]||(k[0]=E=>r.value=E),type:"text",list:"copilot-models",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),[[ee,r.value,void 0,{trim:!0}]]),o("datalist",Cp,[(h(!0),y(ne,null,de(A.value,E=>(h(),y("option",{key:E,value:E},null,8,Tp))),128))]),A.value.length?(h(),y("p",Pp,w(A.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):z("",!0)]),o("div",Ep,[o("div",Ap,[k[12]||(k[12]=o("div",null,[o("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),o("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),o("button",{onClick:k[1]||(k[1]=E=>l.value=!l.value),class:q(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",l.value?"bg-accent":"bg-gray-700"])},[o("span",{class:q(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",l.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),o("div",{class:q(["space-y-4 transition",l.value?"":"opacity-40 pointer-events-none select-none"])},[o("div",Ip,[k[14]||(k[14]=o("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),k[15]||(k[15]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Wire protocol of the endpoint ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),X("). ")],-1)),Z(o("select",{"onUpdate:modelValue":k[2]||(k[2]=E=>a.value=E),disabled:!l.value,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"},[...k[13]||(k[13]=[o("option",{value:"openai"},"openai",-1),o("option",{value:"azure"},"azure",-1),o("option",{value:"anthropic"},"anthropic",-1)])],8,Op),[[_t,a.value]])]),o("div",Mp,[k[16]||(k[16]=o("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),k[17]||(k[17]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" e.g. "),o("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),X(" ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),X("). ")],-1)),Z(o("input",{"onUpdate:modelValue":k[3]||(k[3]=E=>i.value=E),type:"text",disabled:!l.value,placeholder:"https://openrouter.ai/api/v1",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,8,Dp),[[ee,i.value,void 0,{trim:!0}]])]),o("div",Rp,[k[21]||(k[21]=o("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),o("p",jp,[k[18]||(k[18]=X(" Stored server-side and never echoed back (",-1)),k[19]||(k[19]=o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),k[20]||(k[20]=X("). ",-1)),m.value?(h(),y("span",Lp,"A key is currently set — leave blank to keep it.")):(h(),y("span",Np,"No key set."))]),Z(o("input",{"onUpdate:modelValue":k[4]||(k[4]=E=>u.value=E),type:"password",disabled:!l.value,placeholder:m.value?"•••••••• (unchanged)":"sk-…",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,8,Up),[[ee,u.value]])]),o("div",Vp,[o("button",{type:"button",onClick:k[5]||(k[5]=E=>g.value=!g.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[o("span",null,w(g.value?"▾":"▸"),1),k[22]||(k[22]=X(" Advanced (model mapping) ",-1))]),g.value?(h(),y("div",Bp,[o("div",null,[k[25]||(k[25]=o("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),o("p",Fp,[k[23]||(k[23]=X(" Well-known base model for tool config (",-1)),k[24]||(k[24]=o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),X("). Defaults to Copilot Model. "+w(A.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Z(o("input",{"onUpdate:modelValue":k[6]||(k[6]=E=>c.value=E),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,Hp),[[ee,c.value,void 0,{trim:!0}]])]),o("div",null,[k[28]||(k[28]=o("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),o("p",Kp,[k[26]||(k[26]=X(" Exact model name sent to the provider (",-1)),k[27]||(k[27]=o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),X("). Defaults to Copilot Model. "+w(A.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Z(o("input",{"onUpdate:modelValue":k[7]||(k[7]=E=>x.value=E),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,Wp),[[ee,x.value,void 0,{trim:!0}]])])])):z("",!0)]),o("div",zp,[o("div",Jp,[k[29]||(k[29]=o("div",null,[o("div",{class:"text-sm font-medium"},"Test Connection"),o("p",{class:"text-xs text-textSecondary mt-1"}," Lists models from the endpoint above using the values entered here — no need to save first. Uses the right auth for the selected Provider Type (openai/azure/anthropic). ")],-1)),o("button",{onClick:k[8]||(k[8]=E=>O()),disabled:P.value||!l.value,class:"px-4 py-2 rounded-xl bg-surface border border-gray-700 hover:border-accent disabled:opacity-50 text-sm font-medium transition whitespace-nowrap"},w(P.value?"Testing…":"Test"),9,qp)]),V.value?(h(),y("div",{key:0,class:q([V.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},w(V.value),3)):z("",!0),A.value.length?(h(),y("div",Gp,[(h(!0),y(ne,null,de(A.value,E=>(h(),y("div",{key:E,class:"text-xs font-mono text-textSecondary py-0.5"},w(E),1))),128))])):z("",!0)])],2),o("div",Yp,[k[32]||(k[32]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",Zp,[o("div",null,[k[30]||(k[30]=o("div",{class:"text-xs text-muted mb-1"},"Model",-1)),o("span",Qp,w(r.value||"—"),1)]),o("div",null,[k[31]||(k[31]=o("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),o("span",{class:q(["text-sm font-medium",l.value?"text-success":"text-textSecondary"])},w(l.value?"Enabled":"Disabled"),3)])])])]))])]))}}),em={class:"animate-fade-in"},tm={class:"glass rounded-xl p-6 mb-6"},sm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},nm={class:"flex items-center gap-3"},om=["disabled"],rm={key:0,class:"text-center py-8 text-textSecondary text-sm"},lm={key:1,class:"space-y-6"},am={class:"glass rounded-xl p-4 border border-gray-700/50"},im={class:"flex items-center gap-4"},cm={class:"flex justify-between text-xs text-muted mt-2"},um={class:"font-mono"},dm={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},fm={class:"glass rounded-xl p-4 border border-gray-700/50"},pm={class:"flex items-center gap-4"},mm={class:"flex justify-between text-xs text-muted mt-2"},vm={class:"font-mono"},xm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},hm={class:"grid grid-cols-2 gap-4"},gm={class:"text-sm font-medium text-textSecondary"},ym={class:"mt-3"},bm=Be({__name:"SettingsTab",setup(e){const t=S(!0),s=S(!1),n=S(""),r=S(50),l=S(50),a=S(1440),i=S(1440),c=Te(()=>r.value!==l.value||a.value!==i.value);async function x(){t.value=!0;try{const[m,g]=await Promise.all([pe("/api/settings/bootstrap-message-count"),pe("/api/settings/wait-timeout")]);r.value=m.count,l.value=m.count,a.value=g.minutes,i.value=g.minutes}finally{t.value=!1}}async function u(){s.value=!0,n.value="";try{const m={Authorization:`Bearer ${le()}`,"Content-Type":"application/json"},[g,P]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:m,body:JSON.stringify({count:r.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:m,body:JSON.stringify({minutes:a.value})})]);for(const H of[g,P])if(!H.ok){const $=await H.json().catch(()=>({error:H.statusText}));throw new Error($.error??H.statusText)}const V=await g.json(),A=await P.json();l.value=V.count,r.value=V.count,i.value=A.minutes,a.value=A.minutes,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(m){n.value="Error: "+m.message}finally{s.value=!1}}return Le(x),(m,g)=>(h(),y("div",em,[o("div",tm,[o("div",sm,[g[4]||(g[4]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Settings"),o("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),o("div",nm,[n.value?(h(),y("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},w(n.value),3)):z("",!0),o("button",{onClick:u,disabled:s.value||t.value||!c.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},w(s.value?"Saving…":"Save"),9,om)])]),t.value?(h(),y("div",rm,"Loading…")):(h(),y("div",lm,[o("div",am,[g[8]||(g[8]=o("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),g[9]||(g[9]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Number of recent messages injected into the agent's bootstrap context. Set to "),o("span",{class:"font-mono text-accentLight"},"0"),X(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),o("div",im,[Z(o("input",{"onUpdate:modelValue":g[0]||(g[0]=P=>r.value=P),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[ee,r.value,void 0,{number:!0}]]),Z(o("input",{"onUpdate:modelValue":g[1]||(g[1]=P=>r.value=P),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),[[ee,r.value,void 0,{number:!0}]])]),o("div",cm,[g[5]||(g[5]=o("span",null,"Off",-1)),o("span",um,w(r.value)+" messages",1),g[6]||(g[6]=o("span",null,"Max",-1))]),r.value===0?(h(),y("div",dm,[...g[7]||(g[7]=[X(" Message buffer injection is ",-1),o("strong",null,"disabled",-1),X(". 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)])])):z("",!0)]),o("div",fm,[g[12]||(g[12]=o("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),g[13]||(g[13]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Maximum time (in minutes) a single "),o("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),X(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),o("div",pm,[Z(o("input",{"onUpdate:modelValue":g[2]||(g[2]=P=>a.value=P),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[ee,a.value,void 0,{number:!0}]]),Z(o("input",{"onUpdate:modelValue":g[3]||(g[3]=P=>a.value=P),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),[[ee,a.value,void 0,{number:!0}]])]),o("div",mm,[g[10]||(g[10]=o("span",null,"1 min",-1)),o("span",vm,w(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),g[11]||(g[11]=o("span",null,"24h",-1))])]),o("div",xm,[g[16]||(g[16]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",hm,[o("div",null,[g[14]||(g[14]=o("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),o("span",{class:q(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},w(l.value>0?`${l.value} messages`:"Disabled"),3)]),o("div",null,[g[15]||(g[15]=o("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),o("span",gm,w(i.value>=60?Math.floor(i.value/60)+"h "+i.value%60+"m":i.value+" min"),1)])]),o("div",ym,[o("span",{class:q(["text-sm font-medium",c.value?"text-warn":"text-textSecondary"])},w(c.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),_m={class:"animate-fade-in"},wm={class:"glass rounded-xl p-6 mb-6"},km={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Sm={class:"flex flex-wrap gap-3 items-center"},$m=["disabled"],Cm={key:0,class:"flex items-center gap-2"},Tm={key:1},Pm={class:"glass rounded-xl p-6"},Em={key:0,class:"text-center py-8 text-textSecondary text-sm"},Am={key:1,class:"text-center py-12 text-textSecondary text-sm"},Im={key:2,class:"space-y-2"},Om={class:"flex items-center justify-between gap-3"},Mm={class:"flex-1 min-w-0"},Dm={class:"flex flex-wrap items-center gap-2 mb-1"},Rm={class:"font-medium text-sm font-mono"},jm={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Lm={class:"text-xs text-muted"},Nm={class:"text-xs text-muted"},Um=["onClick","disabled"],Vm={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Bm={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Fm={class:"text-sm text-textSecondary mb-4"},Hm={class:"font-mono text-textPrimary"},Km=Be({__name:"SnapshotsTab",setup(e){const t=S([]),s=S(!0),n=S(!1),r=S(null),l=S(""),a=S(""),i=S(!0),c=S(null);function x($){return $<1024?`${$} B`:$<1024*1024?`${($/1024).toFixed(1)} KB`:`${($/(1024*1024)).toFixed(1)} MB`}function u($){try{return new Date($).toLocaleString()}catch{return $}}function m($,I){a.value=$,i.value=I,setTimeout(()=>{a.value=""},4e3)}async function g(){s.value=!0;try{const $=await pe("/api/snapshots");t.value=$.snapshots}catch($){m("Failed to load snapshots: "+$.message,!1)}finally{s.value=!1}}async function P(){if(!n.value){n.value=!0;try{await pe("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await g()}catch($){m("Error: "+$.message,!1)}finally{n.value=!1}}}function V($){c.value=$}function A(){c.value=null}async function H(){const $=c.value;if(!(!$||r.value)){c.value=null,r.value=$;try{await pe(`/api/snapshots/${encodeURIComponent($)}`,{method:"DELETE"}),m("Deleted ✓",!0),await g()}catch(I){m("Error: "+I.message,!1)}finally{r.value=null}}}return Le(g),($,I)=>(h(),y("div",_m,[o("div",wm,[o("div",km,[I[1]||(I[1]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Snapshots"),o("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(h(),y("span",{key:0,class:q(["text-sm",i.value?"text-success":"text-danger"])},w(a.value),3)):z("",!0)]),o("div",Sm,[Z(o("input",{"onUpdate:modelValue":I[0]||(I[0]=U=>l.value=U),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:He(P,["enter"])},null,544),[[ee,l.value]]),o("button",{onClick:P,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(),y("span",Cm,[...I[2]||(I[2]=[o("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),X(" Creating… ",-1)])])):(h(),y("span",Tm,"+ Create Snapshot"))],8,$m)])]),o("div",Pm,[s.value?(h(),y("div",Em,"Loading…")):t.value.length===0?(h(),y("div",Am,"No snapshots yet")):(h(),y("div",Im,[(h(!0),y(ne,null,de(t.value,U=>(h(),y("div",{key:U.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[o("div",Om,[o("div",Mm,[o("div",Dm,[o("span",Rm,w(U.name),1),o("span",jm,"v"+w(U.mcpVersion),1),o("span",Lm,w(x(U.sizeBytes)),1)]),o("div",Nm,[X(w(u(U.createdAt)),1),U.description?(h(),y(ne,{key:0},[X(" · "+w(U.description),1)],64)):z("",!0)])]),o("button",{onClick:O=>V(U.name),disabled:r.value===U.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"},w(r.value===U.name?"…":"Delete"),9,Um)])]))),128))]))]),c.value?(h(),y("div",Vm,[o("div",Bm,[I[5]||(I[5]=o("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),o("p",Fm,[I[3]||(I[3]=X(" Delete ",-1)),o("span",Hm,w(c.value),1),I[4]||(I[4]=X("? This cannot be undone. ",-1))]),o("div",{class:"flex gap-3"},[o("button",{onClick:H,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),o("button",{onClick:A,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")])])])):z("",!0)]))}}),Wm={class:"animate-fade-in space-y-6"},zm={class:"glass rounded-xl p-6"},Jm={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},qm={class:"text-sm text-textSecondary mt-1"},Gm={class:"flex items-center gap-3"},Ym={key:0,class:"text-xs text-accentLight animate-pulse"},Zm={key:0,class:"flex flex-wrap gap-2 mt-3"},Qm=["onClick"],Xm={class:"ml-1 opacity-60"},ev={key:0,class:"text-center py-12 text-textSecondary"},tv={key:1,class:"text-center py-8 text-danger text-sm"},sv={key:2,class:"text-center py-12 text-textSecondary"},nv={key:3,class:"space-y-3"},ov={class:"flex flex-wrap items-start gap-3"},rv={class:"flex-1 min-w-0 space-y-2"},lv={class:"flex flex-wrap items-center gap-2"},av={class:"font-semibold truncate"},iv={class:"text-xs text-muted font-mono"},cv={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},uv={title:"Created"},dv={title:"Archived"},fv={key:0,class:"text-muted"},pv={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},mv={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},vv={class:"flex items-center gap-2 shrink-0"},xv=["onClick","disabled"],hv=3,gv=Be({__name:"ArchivedThreadsTab",setup(e){const t=S([]),s=S(!0),n=S(""),r=S({}),l=S({}),a=S({done:0,total:0}),i=S(null),c=S("all");let x=0;const u={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=Te(()=>c.value==="all"?t.value:t.value.filter(I=>I.type===c.value)),g=Te(()=>{const I={all:t.value.length};for(const U of t.value)I[U.type]=(I[U.type]??0)+1;return I}),P=Te(()=>Object.values(l.value).some(Boolean));async function V(){s.value=!0,n.value="";try{const I=await pe("/api/threads/archived");t.value=I.threads??[],r.value={},l.value={},t.value.length>0&&A()}catch(I){n.value=I.message||"Failed to load archived threads"}finally{s.value=!1}}async function A(){const I=++x,U=[...t.value];a.value={done:0,total:U.length};async function O(){for(;U.length>0&&I===x;){const k=U.shift();l.value={...l.value,[k.threadId]:!0};try{const E=await fetch(`/api/threads/${k.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${le()}`}});if(I!==x)return;if(E.ok){const L=await E.json();L.summary&&(r.value={...r.value,[k.threadId]:L.summary})}}catch{}finally{if(I===x){const{[k.threadId]:E,...L}=l.value;l.value=L,a.value={...a.value,done:a.value.done+1}}}}}const F=Array.from({length:Math.min(hv,U.length)},()=>O());await Promise.all(F)}function H(I){if(!I)return"—";const U=new Date(I),F=Date.now()-U.getTime(),k=Math.floor(F/6e4),E=Math.floor(F/36e5),L=Math.floor(F/864e5),J=Math.floor(L/30);return k<1?"just now":k<60?`${k}m ago`:E<24?`${E}h ago`:L<30?`${L}d ago`:J<12?`${J}mo ago`:`${Math.floor(J/12)}y ago`}async function $(I){if(confirm(`Unarchive thread "${I.name}" (${I.threadId})?`)){i.value=I.threadId;try{const U=await fetch(`/api/threads/${I.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${le()}`}});if(!U.ok){const O=await U.json().catch(()=>({error:U.statusText}));throw new Error(O.error??U.statusText)}await V()}catch(U){n.value="Failed to unarchive: "+U.message}finally{i.value=null}}}return Le(V),(I,U)=>(h(),y("div",Wm,[o("div",zm,[o("div",Jm,[o("div",null,[U[0]||(U[0]=o("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),o("p",qm,w(t.value.length)+" archived thread"+w(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),o("div",Gm,[P.value?(h(),y("span",Ym," Building summaries… "+w(a.value.done)+"/"+w(a.value.total),1)):z("",!0),o("button",{onClick:V,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(h(),y("div",Zm,[(h(),y(ne,null,de(["all","root","branch","daily"],O=>o("button",{key:O,onClick:F=>c.value=O,class:q(["px-3 py-1 rounded-full text-xs font-medium border transition",c.value===O?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[X(w(O==="all"?"All":O.charAt(0).toUpperCase()+O.slice(1))+" ",1),o("span",Xm,"("+w(g.value[O]??0)+")",1)],10,Qm)),64))])):z("",!0)]),s.value&&t.value.length===0?(h(),y("div",ev,"Loading archived threads…")):n.value?(h(),y("div",tv,w(n.value),1)):t.value.length===0?(h(),y("div",sv,"No archived threads")):z("",!0),m.value.length>0?(h(),y("div",nv,[(h(!0),y(ne,null,de(m.value,O=>{var F,k;return h(),y("div",{key:O.id,class:"glass rounded-xl p-4"},[o("div",ov,[o("div",rv,[o("div",lv,[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(F=u[O.type])==null?void 0:F.classes])},w((k=u[O.type])==null?void 0:k.emoji)+" "+w(O.type.toUpperCase()),3),o("span",av,w(O.name),1),o("span",iv,"ID: "+w(O.threadId),1)]),o("div",cv,[o("span",uv,"Created "+w(H(O.createdAt)),1),o("span",dv,"Archived "+w(H(O.archivedAt??O.lastActiveAt)),1),O.client?(h(),y("span",fv,w(O.client),1)):z("",!0)]),r.value[O.threadId]?(h(),y("div",pv,w(r.value[O.threadId]),1)):l.value[O.threadId]?(h(),y("div",mv," Generating summary… ")):z("",!0)]),o("div",vv,[o("button",{onClick:E=>$(O),disabled:i.value===O.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"},w(i.value===O.threadId?"Restoring…":"↩ Unarchive"),9,xv)])])])}),128))])):z("",!0)]))}}),yv={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},bv={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},_v=["disabled"],wv={key:0,class:"mt-3 text-sm text-danger"},kv={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Sv={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},$v={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Cv={class:"flex items-center gap-4"},Tv={class:"text-sm text-textSecondary font-mono"},Pv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},Ev={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},Av={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Iv={class:"text-2xl font-bold font-mono"},Ov={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Mv={class:"text-2xl font-bold font-mono"},Dv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Rv={class:"text-2xl font-bold font-mono"},jv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Lv={class:"flex items-center gap-2 mb-2"},Nv={class:"text-2xl font-bold font-mono"},Uv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Vv={class:"text-2xl font-bold font-mono"},Bv={class:"max-w-7xl mx-auto px-4 sm:px-6"},Fv={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Hv=["onClick"],Kv={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",Wv=Be({__name:"App",setup(e){const t=S(!1),s=S(""),n=S(""),r=S(!1),l=S(null),a=S("sessions");let i=null;const c=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"agents",label:"Agents"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],x={sessions:ri,notes:ki,templates:nc,skills:Rc,agents:lf,threads:Ad,archived:gv,mcp:qf,snapshots:Km,claude:hp,copilot:Xp,settings:bm},u=Te(()=>x[a.value]),m=Te(()=>{if(!l.value)return"—";const H=Math.floor(l.value.uptime),$=Math.floor(H/86400),I=Math.floor(H%86400/3600),U=Math.floor(H%3600/60);return $>0?`${$}d ${I}h`:I>0?`${I}h ${U}m`:`${U}m`});async function g(){const H=s.value.trim()||"no-auth";r.value=!0,n.value="";try{Jt(H),await V(),localStorage.setItem(vs,H),t.value=!0,A()}catch($){const I=$;I.status===401?n.value="Invalid token":n.value=I.message??"Connection failed",Jt("")}finally{r.value=!1}}function P(){localStorage.removeItem(vs),t.value=!1,s.value="",l.value=null,i&&clearInterval(i),Jt("")}async function V(){l.value=await pe("/api/status")}function A(){i&&clearInterval(i),i=setInterval(V,3e4)}return Le(async()=>{const H=localStorage.getItem(vs);if(H){s.value=H;try{Jt(H),await V(),t.value=!0,A()}catch{localStorage.removeItem(vs),Jt("")}}}),wn(()=>{i&&clearInterval(i)}),(H,$)=>{var I,U,O,F,k,E,L,J,re;return t.value?(h(),y("div",kv,[o("header",Sv,[o("div",$v,[$[3]||($[3]=ct('<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)),o("div",Cv,[$[2]||($[2]=o("div",{class:"flex items-center gap-2 text-sm"},[o("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),o("span",{class:"text-textSecondary"},"Connected")],-1)),o("div",Tv,w(m.value),1),o("button",{onClick:P,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),o("div",Pv,[o("div",Ev,[o("div",Av,[$[4]||($[4]=ct('<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)),o("div",Iv,w(((I=l.value)==null?void 0:I.activeSessions)??0),1)]),o("div",Ov,[$[5]||($[5]=ct('<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)),o("div",Mv,w(((O=(U=l.value)==null?void 0:U.memory)==null?void 0:O.totalSemanticNotes)??0),1)]),o("div",Dv,[$[6]||($[6]=ct('<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)),o("div",Rv,w(((k=(F=l.value)==null?void 0:F.memory)==null?void 0:k.totalEpisodes)??0),1)]),o("div",jv,[o("div",Lv,[o("span",{class:q((((L=(E=l.value)==null?void 0:E.memory)==null?void 0:L.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...$[7]||($[7]=[o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("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),$[8]||($[8]=o("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),o("div",Nv,w(((re=(J=l.value)==null?void 0:J.memory)==null?void 0:re.unconsolidatedEpisodes)??0),1)]),o("div",Uv,[$[9]||($[9]=ct('<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)),o("div",Vv,w(m.value),1)])])]),o("div",Bv,[o("nav",Fv,[(h(),y(ne,null,de(c,N=>o("button",{key:N.id,onClick:C=>a.value=N.id,class:q(["pb-3 text-sm font-medium transition",a.value===N.id?"tab-active":"tab-inactive"])},w(N.label),11,Hv)),64))])]),o("div",Kv,[(h(),fr(El(u.value),{status:l.value},null,8,["status"]))])])):(h(),y("div",yv,[o("div",bv,[$[1]||($[1]=ct('<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)),Z(o("input",{"onUpdate:modelValue":$[0]||($[0]=N=>s.value=N),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:He(g,["enter"])},null,544),[[ee,s.value]]),o("button",{onClick:g,disabled:r.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"},w(r.value?"Connecting...":"Connect"),9,_v),n.value?(h(),y("p",wv,w(n.value),1)):z("",!0)])]))}}});Fa(Wv).mount("#app");</script>
|
|
71
|
+
`,ee+ie}async function z(){if(!o.value)return;const U=o.value.name;try{const E=l.value.split(",").map(q=>q.trim()).filter(Boolean),G=r.value;let ie;G.trimStart().startsWith("---")?ie=G:ie=me(U,E,a.value,G);const ee=await fetch(`/api/skills/${encodeURIComponent(U)}`,{method:"PUT",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!ee.ok)throw new Error(ee.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await T()}catch(E){c.value="Error: "+E.message}}async function k(){if(!o.value)return;const U=o.value.name;try{const E=await fetch(`/api/skills/${encodeURIComponent(U)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!E.ok)throw new Error(E.statusText);ve(),await T()}catch(E){d.value="Error: "+E.message}}async function M(){const U=f.value.trim(),E=p.value;if(!U){S.value="Name is required";return}const G=E.split(",").map(ee=>ee.trim()).filter(Boolean);if(!G.length){S.value="At least one trigger is required";return}const ie=me(U,G,h.value,`\x3C!-- Write your skill instructions here -->
|
|
72
|
+
`);try{const ee=await fetch(`/api/skills/${encodeURIComponent(U)}`,{method:"PUT",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!ee.ok)throw new Error(ee.statusText);S.value="Created ✓",x.value=!1,await T();const q=t.value.find(j=>j.name===U);q&&le(q)}catch(ee){S.value="Error: "+ee.message}}return Ne(()=>{T(),L()}),(U,E)=>(v(),g("div",oc,[n("div",rc,[n("div",lc,[E[10]||(E[10]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Skill Library"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),n("button",{onClick:E[0]||(E[0]=G=>{x.value=!x.value,o.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?(v(),g("div",ac,[E[14]||(E[14]=n("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),n("div",ic,[n("div",null,[E[11]||(E[11]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),Z(n("input",{"onUpdate:modelValue":E[1]||(E[1]=G=>f.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),[[se,f.value]])]),n("div",null,[E[12]||(E[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(n("input",{"onUpdate:modelValue":E[2]||(E[2]=G=>p.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),[[se,p.value]])])]),n("div",cc,[n("label",uc,[Z(n("input",{"onUpdate:modelValue":E[3]||(E[3]=G=>h.value=G),type:"checkbox",class:"rounded"},null,512),[[io,h.value]]),E[13]||(E[13]=n("span",null,"Replaces orchestrator",-1))])]),n("div",dc,[n("button",{onClick:M,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),n("button",{onClick:E[4]||(E[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"),S.value?(v(),g("span",fc,y(S.value),1)):W("",!0)])])):W("",!0),n("div",pc,[E[18]||(E[18]=n("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),E[19]||(E[19]=n("p",{class:"text-xs text-textSecondary mb-3"},"Register an external skill file by absolute path — read in place, not copied (a git pull on its source updates it).",-1)),n("div",mc,[n("div",xc,[E[15]||(E[15]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),Z(n("input",{"onUpdate:modelValue":E[5]||(E[5]=G=>C.value=G),type:"text",placeholder:"C:/path/to/skill.md",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),[[se,C.value]])]),n("div",null,[E[17]||(E[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),Z(n("select",{"onUpdate:modelValue":E[6]||(E[6]=G=>N.value=G),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"},[...E[16]||(E[16]=[n("option",{value:"sensorium"},"Sensorium",-1),n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1)])],512),[[ht,N.value]])])]),n("div",vc,[n("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),$.value?(v(),g("span",{key:0,class:Y([$.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y($.value),3)):W("",!0)]),F.value.length?(v(),g("div",gc,[(v(!0),g(re,null,pe(F.value,G=>(v(),g("div",{key:G.path,class:"flex items-center justify-between gap-3 rounded-lg bg-surface/50 border border-gray-700/50 px-3 py-2"},[n("div",hc,[n("span",{class:"type-badge",style:It(O("user"))},y(G.type),5),n("span",{class:"text-xs font-mono text-textSecondary truncate",title:G.path},y(G.path),9,yc)]),n("button",{onClick:ie=>V(G.path),class:"px-3 py-1 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 shrink-0"},"Remove",8,bc)]))),128))])):W("",!0)]),s.value?(v(),g("div",_c,"Loading...")):t.value.length===0?(v(),g("div",wc,"No skills loaded")):(v(),g("div",kc,[(v(!0),g(re,null,pe(t.value,G=>{var ie;return v(),g("div",{key:G.name,onClick:ee=>le(G),class:Y(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ie=o.value)==null?void 0:ie.name)===G.name?"border-accent":"border-transparent"])},[n("div",$c,[n("div",Cc,[n("div",Tc,[n("span",Pc,y(G.name),1),n("span",{class:"type-badge",style:It(O(b(G.source)))},y(b(G.source)),5),G.replacesOrchestrator?(v(),g("span",Ec,"REPLACES ORCH")):W("",!0)]),n("div",Ac,[(v(!0),g(re,null,pe(G.triggers||[],ee=>(v(),g("span",{key:ee,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(ee),1))),128))])]),n("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:G.source||""},y((G.source||"").split(/[\\/]/).pop()||""),9,Ic)])],10,Sc)}),128))]))]),o.value?(v(),g("div",Oc,[n("div",Mc,[n("div",null,[n("h3",Dc,"Edit: "+y(o.value.name),1),n("p",Rc,y(o.value.source||"(unknown source)"),1)]),n("div",jc,[c.value?(v(),g("span",Lc,y(c.value),1)):W("",!0),d.value?(v(),g("span",Nc,y(d.value),1)):W("",!0),b(o.value.source)==="user"?(v(),g("button",{key:2,onClick:k,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),n("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"},"Close"),n("button",{onClick:z,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Uc,[n("div",null,[E[20]||(E[20]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),n("input",{value:o.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,Vc)]),n("div",null,[E[21]||(E[21]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(n("input",{"onUpdate:modelValue":E[7]||(E[7]=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),[[se,l.value]])]),n("div",Bc,[n("label",Fc,[Z(n("input",{"onUpdate:modelValue":E[8]||(E[8]=G=>a.value=G),type:"checkbox",class:"rounded"},null,512),[[io,a.value]]),E[22]||(E[22]=n("span",null,"Replaces orchestrator",-1))])])]),Z(n("textarea",{"onUpdate:modelValue":E[9]||(E[9]=G=>r.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),[[se,r.value]])])):W("",!0)]))}}),Kc={class:"animate-fade-in space-y-6"},Wc={class:"glass rounded-xl p-6"},zc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Jc={class:"flex items-center gap-3"},qc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Gc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Yc=["value"],Zc={class:"flex justify-end"},Qc=["disabled"],Xc={key:0,class:"text-center py-12 text-textSecondary"},eu={key:1,class:"text-center py-8 text-danger text-sm"},tu={key:2,class:"text-center py-12 text-textSecondary"},su={key:3},nu={class:"space-y-3"},ou={class:"p-4"},ru={class:"flex flex-wrap items-center gap-3"},lu=["onBlur"],au=["onDblclick"],iu={class:"text-xs text-muted font-mono"},cu=["value","onChange"],uu=["value"],du=["value"],fu={class:"text-xs text-muted"},pu=["onKeyup","onBlur"],mu=["title","onDblclick"],xu={class:"ml-auto flex items-center gap-3"},vu=["onClick","disabled"],gu={class:"flex items-center gap-1.5"},hu=["onClick"],yu={class:"flex items-center gap-1.5"},bu=["onClick"],_u={class:"flex items-center gap-1.5"},wu=["onClick"],ku=["onClick"],Su=["onClick"],$u=["onClick"],Cu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},Tu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},Pu=["value"],Eu={class:"flex items-center gap-2"},Au=["onClick","disabled"],Iu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Ou={key:0,class:"text-xs text-muted py-1"},Mu={class:"text-sm font-medium"},Du={class:"text-xs text-muted font-mono"},Ru=["value","onChange"],ju=["value"],Lu=["value"],Nu={class:"text-xs text-muted"},Uu=["onBlur","onKeyup"],Vu=["title","onDblclick"],Bu={class:"ml-auto flex items-center gap-3"},Fu=["onClick","disabled"],Hu=["onClick","disabled"],Ku=["onClick","disabled"],Wu={key:2,class:"flex items-center gap-1.5"},zu=["onClick"],Ju={key:3,class:"flex items-center gap-1.5"},qu=["onClick"],Gu={key:4,class:"flex items-center gap-1.5"},Yu=["onClick"],Zu=["onClick"],Qu={key:4},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd={class:"text-xs text-textSecondary"},nd={class:"text-xs text-muted"},od={class:"ml-auto flex items-center gap-2"},rd=["onClick","disabled"],ld=["onClick","disabled"],ad=["onClick"],id={key:5},cd={class:"space-y-2"},ud={class:"font-medium"},dd={class:"text-xs text-muted font-mono"},fd=["value","onChange"],pd=["value"],md=["value"],xd={class:"text-xs text-muted"},vd=["onBlur","onKeyup"],gd=["title","onDblclick"],hd={class:"ml-auto flex items-center gap-3"},yd=["onClick","disabled"],bd=["onClick","disabled"],_d={class:"flex items-center gap-1.5"},wd=["onClick"],kd={class:"flex items-center gap-1.5"},Sd=["onClick"],$d={class:"flex items-center gap-1.5"},Cd=["onClick"],Td=["onClick"],Pd={key:6},Ed={class:"space-y-2"},Ad={class:"font-medium"},Id={class:"text-xs text-muted font-mono"},Od=["value","onChange"],Md=["value"],Dd=["value"],Rd={class:"text-xs text-muted"},jd=Fe({__name:"ThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),l=_(new Set),a=_(!1),c=_({name:"",threadId:0,client:"claude",workingDirectory:""}),d=_(""),x=_(!1),f=_(null),p=_(""),h=_(null),S=_(""),F=_(null),C=_({name:"",threadId:0,client:"claude",workingDirectory:""}),N=_(""),$=_(!1),T=_(null),L=_(null),I=_(null),V=["claude","copilot","codex","fable"];function b(H){return V.includes(H)}const O={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"}},le=Pe(()=>t.value.filter(H=>H.type==="root")),ve=Pe(()=>t.value.filter(H=>H.type==="daily")),me=Pe(()=>t.value.filter(H=>H.type==="branch")),z=Pe(()=>t.value.filter(H=>H.type==="worker"));async function k(){s.value=!0,o.value="";try{const H=await xe("/api/threads");t.value=H.threads??[]}catch(H){o.value=H.message||"Failed to load threads"}finally{s.value=!1}}async function M(H){try{const i=await xe(`/api/threads/${H}/children`);r.value[H]=i.threads??[]}catch{r.value[H]=[]}}function U(H){l.value.has(H)?l.value.delete(H):(l.value.add(H),M(H))}async function E(){if(!(!c.value.name.trim()||!c.value.threadId)){x.value=!0,d.value="";try{const H=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"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(!H.ok){const i=await H.json().catch(()=>({error:H.statusText}));throw new Error(i.error??H.statusText)}d.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{d.value=""},3e3),await k()}catch(H){d.value="Error: "+H.message}finally{x.value=!1}}}async function G(H){if(!(!C.value.name.trim()||!C.value.threadId)){$.value=!0,N.value="";try{const i=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:H,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}N.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},F.value=null,setTimeout(()=>{N.value=""},3e3),await k(),M(H)}catch(i){N.value="Error: "+i.message}finally{$.value=!1}}}function ie(H){f.value=H.threadId,p.value=H.name}async function ee(H){const i=p.value.trim();if(f.value=null,!!i)try{const u=await fetch(`/api/threads/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({name:i})});if(!u.ok)throw new Error(u.statusText);await k()}catch(u){o.value="Failed to rename thread: "+u.message}}function q(H){h.value=H.threadId,S.value=H.workingDirectory??""}async function j(H){const i=S.value.trim();h.value=null;try{const u=await fetch(`/api/threads/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:i||null})});if(!u.ok)throw new Error(u.statusText);await k()}catch(u){o.value="Failed to update working directory: "+u.message}}async function Ce(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!H.keepAlive})});if(!i.ok)throw new Error(i.statusText);await k()}catch(i){o.value="Failed to toggle keep-alive: "+i.message}}async function ke(H,i){try{const u=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({client:i})});if(!u.ok)throw new Error(u.statusText);await k()}catch(u){o.value="Failed to change agent type: "+u.message}}async function ge(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!H.dailyRotation})});if(!i.ok)throw new Error(i.statusText);await k()}catch(i){o.value="Failed to toggle daily rotation: "+i.message}}async function at(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!H.autonomousMode})});if(!i.ok)throw new Error(i.statusText);await k()}catch(i){o.value="Failed to toggle autonomous mode: "+i.message}}async function Ot(H){if(confirm(`Archive thread "${H.name}" (${H.threadId})?`))try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!i.ok)throw new Error(i.statusText);await k()}catch(i){o.value="Failed to archive: "+i.message}}async function Je(H){if(confirm(`Start thread "${H.name}" (${H.threadId})?`)){T.value=H.threadId;try{const i=await fetch(`/api/threads/${H.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}await k()}catch(i){o.value="Failed to start thread: "+i.message}finally{T.value=null}}}function bt(H){d.value="Sync to Root — not yet implemented",setTimeout(()=>{d.value=""},3e3)}async function Kt(H){if(confirm(`Convert "${H.name}" to a root thread? This will detach it from its parent.`)){I.value=H.threadId;try{const i=await fetch(`/api/threads/${H.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}o.value="",d.value=`Converted "${H.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await k()}catch(i){o.value="Failed to convert: "+i.message}finally{I.value=null}}}function _t(H){if(!H)return"—";const i=new Date(H),w=Date.now()-i.getTime();return w<6e4?"just now":w<36e5?`${Math.floor(w/6e4)}m ago`:w<864e5?`${Math.floor(w/36e5)}h ago`:i.toLocaleDateString()}function Ke(H){return H==="active"?"text-success":H==="archived"?"text-muted":"text-warn"}return Ne(k),(H,i)=>(v(),g("div",Kc,[n("div",Wc,[n("div",zc,[i[18]||(i[18]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Thread Registry"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),n("div",Jc,[d.value?(v(),g("span",{key:0,class:Y([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(d.value),3)):W("",!0),n("button",{onClick:i[0]||(i[0]=u=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},y(a.value?"Cancel":"+ New Root Thread"),1),n("button",{onClick:k,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(v(),g("div",qc,[n("div",Gc,[n("div",null,[i[19]||(i[19]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),Z(n("input",{"onUpdate:modelValue":i[1]||(i[1]=u=>c.value.name=u),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),[[se,c.value.name]])]),n("div",null,[i[20]||(i[20]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),Z(n("input",{"onUpdate:modelValue":i[2]||(i[2]=u=>c.value.threadId=u),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),[[se,c.value.threadId,void 0,{number:!0}]])]),n("div",null,[i[21]||(i[21]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),Z(n("select",{"onUpdate:modelValue":i[3]||(i[3]=u=>c.value.client=u),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"},[(v(),g(re,null,pe(V,u=>n("option",{key:u,value:u},y(u),9,Yc)),64))],512),[[ht,c.value.client]])])]),n("div",null,[i[22]||(i[22]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),Z(n("input",{"onUpdate:modelValue":i[4]||(i[4]=u=>c.value.workingDirectory=u),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),[[se,c.value.workingDirectory]])]),n("div",Zc,[n("button",{onClick:E,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"},y(x.value?"Creating…":"Create Root Thread"),9,Qc)])])):W("",!0)]),s.value&&t.value.length===0?(v(),g("div",Xc,"Loading threads…")):o.value?(v(),g("div",eu,y(o.value),1)):t.value.length===0?(v(),g("div",tu,"No threads registered")):W("",!0),le.value.length>0?(v(),g("div",su,[i[29]||(i[29]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),n("div",nu,[(v(!0),g(re,null,pe(le.value,u=>{var w,P;return v(),g("div",{key:u.id,class:"glass rounded-xl overflow-hidden"},[n("div",ou,[n("div",ru,[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(w=O[u.type])==null?void 0:w.classes])},y((P=O[u.type])==null?void 0:P.emoji)+" "+y(u.type.toUpperCase()),3),f.value===u.threadId?Z((v(),g("input",{key:0,"onUpdate:modelValue":i[5]||(i[5]=m=>p.value=m),onBlur:m=>ee(u.threadId),onKeyup:[i[6]||(i[6]=Xe(m=>m.target.blur(),["enter"])),i[7]||(i[7]=Xe(m=>f.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,lu)),[[se,p.value]]):(v(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:m=>ie(u),title:"Double-click to rename"},y(u.name),41,au)),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",iu,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,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"},[b(u.client)?W("",!0):(v(),g("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,uu)),(v(),g(re,null,pe(V,m=>n("option",{key:m,value:m},y(m),9,du)),64))],40,cu),n("span",fu,y(_t(u.lastActiveAt)),1),h.value===u.threadId?Z((v(),g("input",{key:2,"onUpdate:modelValue":i[8]||(i[8]=m=>S.value=m),onKeyup:[Xe(m=>j(u.threadId),["enter"]),i[9]||(i[9]=Xe(m=>h.value=null,["escape"]))],onBlur:m=>j(u.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,pu)),[[se,S.value]]):(v(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>q(u)},"📁 "+y(u.workingDirectory??"—"),41,mu)),n("div",xu,[n("button",{onClick:m=>Je(u),disabled:T.value===u.threadId||u.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"},y(T.value===u.threadId?"Starting…":"▶ Start"),9,vu),n("div",gu,[n("button",{onClick:m=>Ce(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,hu),i[23]||(i[23]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",yu,[n("button",{onClick:m=>ge(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,bu),i[24]||(i[24]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",_u,[n("button",{onClick:m=>at(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,wu),i[25]||(i[25]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>U(u.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},y(l.value.has(u.threadId)?"▾ Children":"▸ Children"),9,ku),n("button",{onClick:m=>{F.value=F.value===u.threadId?null:u.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},N.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,Su),n("button",{onClick:m=>Ot(u),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,$u)])]),F.value===u.threadId?(v(),g("div",Cu,[n("div",Tu,[Z(n("input",{"onUpdate:modelValue":i[10]||(i[10]=m=>C.value.name=m),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),[[se,C.value.name]]),Z(n("input",{"onUpdate:modelValue":i[11]||(i[11]=m=>C.value.threadId=m),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),[[se,C.value.threadId,void 0,{number:!0}]]),Z(n("select",{"onUpdate:modelValue":i[12]||(i[12]=m=>C.value.client=m),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"},[(v(),g(re,null,pe(V,m=>n("option",{key:m,value:m},y(m),9,Pu)),64))],512),[[ht,C.value.client]])]),Z(n("input",{"onUpdate:modelValue":i[13]||(i[13]=m=>C.value.workingDirectory=m),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),[[se,C.value.workingDirectory]]),n("div",Eu,[n("button",{onClick:m=>G(u.threadId),disabled:$.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"},y($.value?"Creating…":"Create Branch"),9,Au),N.value?(v(),g("span",{key:0,class:Y([N.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},y(N.value),3)):W("",!0)])])):W("",!0)]),l.value.has(u.threadId)&&r.value[u.threadId]?(v(),g("div",Iu,[r.value[u.threadId].length===0?(v(),g("div",Ou,"No children")):W("",!0),(v(!0),g(re,null,pe(r.value[u.threadId],m=>{var A,K;return v(),g("div",{key:m.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[n("span",{class:Y(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(A=O[m.type])==null?void 0:A.classes])},y((K=O[m.type])==null?void 0:K.emoji)+" "+y(m.type.toUpperCase()),3),n("span",Mu,y(m.name),1),n("span",{class:Y(["text-xs",Ke(m.status)])},y(m.status),3),n("span",Du,"ID: "+y(m.threadId),1),n("select",{value:m.client,onChange:R=>ke(m,R.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"},[b(m.client)?W("",!0):(v(),g("option",{key:0,value:m.client,disabled:""},y(m.client)+" (legacy)",9,ju)),(v(),g(re,null,pe(V,R=>n("option",{key:R,value:R},y(R),9,Lu)),64))],40,Ru),n("span",Nu,y(_t(m.lastActiveAt)),1),m.type==="branch"&&h.value===m.threadId?Z((v(),g("input",{key:0,"onUpdate:modelValue":i[14]||(i[14]=R=>S.value=R),onBlur:R=>j(m.threadId),onKeyup:[Xe(R=>j(m.threadId),["enter"]),i[15]||(i[15]=Xe(R=>h.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,Uu)),[[se,S.value]]):m.type==="branch"?(v(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(m.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:R=>q(m)},"📁 "+y(m.workingDirectory??"—"),41,Vu)):W("",!0),n("div",Bu,[n("button",{onClick:R=>Je(m),disabled:T.value===m.threadId||m.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"},y(T.value===m.threadId?"Starting…":"▶ Start"),9,Fu),m.rootThreadId?(v(),g("button",{key:0,onClick:R=>bt(),disabled:L.value===m.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"},y(L.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,Hu)):W("",!0),m.type==="branch"||m.type==="daily"?(v(),g("button",{key:1,onClick:R=>Kt(m),disabled:I.value===m.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"},y(I.value===m.threadId?"Converting…":"↑ To Root"),9,Ku)):W("",!0),m.type==="branch"?(v(),g("div",Wu,[n("button",{onClick:R=>Ce(m),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,zu),i[26]||(i[26]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):W("",!0),m.type==="branch"?(v(),g("div",Ju,[n("button",{onClick:R=>ge(m),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,qu),i[27]||(i[27]=n("span",{class:"text-xs text-muted"},"Daily",-1))])):W("",!0),m.type==="branch"?(v(),g("div",Gu,[n("button",{onClick:R=>at(m),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Yu),i[28]||(i[28]=n("span",{class:"text-xs text-muted"},"Auto",-1))])):W("",!0),m.type!=="root"?(v(),g("button",{key:5,onClick:R=>Ot(m),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,Zu)):W("",!0)])])}),128))])):W("",!0)])}),128))])])):W("",!0),ve.value.length>0?(v(),g("div",Qu,[i[30]||(i[30]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),n("div",Xu,[(v(!0),g(re,null,pe(ve.value,u=>{var w,P;return v(),g("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(w=O[u.type])==null?void 0:w.classes])},y((P=O[u.type])==null?void 0:P.emoji)+" "+y(u.type.toUpperCase()),3),n("span",ed,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",td,"ID: "+y(u.threadId),1),n("span",sd,y(u.client),1),n("span",nd,y(_t(u.lastActiveAt)),1),n("div",od,[n("button",{onClick:m=>Je(u),disabled:T.value===u.threadId||u.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"},y(T.value===u.threadId?"Starting…":"▶ Start"),9,rd),u.rootThreadId?(v(),g("button",{key:0,onClick:m=>bt(),disabled:L.value===u.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"},y(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,ld)):W("",!0),n("button",{onClick:m=>Ot(u),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,ad)])])}),128))])])):W("",!0),me.value.length>0?(v(),g("div",id,[i[34]||(i[34]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),n("div",cd,[(v(!0),g(re,null,pe(me.value,u=>{var w,P;return v(),g("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(w=O[u.type])==null?void 0:w.classes])},y((P=O[u.type])==null?void 0:P.emoji)+" "+y(u.type.toUpperCase()),3),n("span",ud,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",dd,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,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"},[b(u.client)?W("",!0):(v(),g("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,pd)),(v(),g(re,null,pe(V,m=>n("option",{key:m,value:m},y(m),9,md)),64))],40,fd),n("span",xd,y(_t(u.lastActiveAt)),1),h.value===u.threadId?Z((v(),g("input",{key:0,"onUpdate:modelValue":i[16]||(i[16]=m=>S.value=m),onBlur:m=>j(u.threadId),onKeyup:[Xe(m=>j(u.threadId),["enter"]),i[17]||(i[17]=Xe(m=>h.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,vd)),[[se,S.value]]):(v(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>q(u)},"📁 "+y(u.workingDirectory??"—"),41,gd)),n("div",hd,[n("button",{onClick:m=>Je(u),disabled:T.value===u.threadId||u.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"},y(T.value===u.threadId?"Starting…":"▶ Start"),9,yd),u.rootThreadId?(v(),g("button",{key:0,onClick:m=>bt(),disabled:L.value===u.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"},y(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,bd)):W("",!0),n("div",_d,[n("button",{onClick:m=>Ce(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,wd),i[31]||(i[31]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",kd,[n("button",{onClick:m=>ge(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Sd),i[32]||(i[32]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",$d,[n("button",{onClick:m=>at(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Cd),i[33]||(i[33]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>Ot(u),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,Td)])])}),128))])])):W("",!0),z.value.length>0?(v(),g("div",Pd,[i[36]||(i[36]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),n("div",Ed,[(v(!0),g(re,null,pe(z.value,u=>{var w,P;return v(),g("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(w=O[u.type])==null?void 0:w.classes])},y((P=O[u.type])==null?void 0:P.emoji)+" "+y(u.type.toUpperCase()),3),n("span",Ad,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",Id,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,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"},[b(u.client)?W("",!0):(v(),g("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,Md)),(v(),g(re,null,pe(V,m=>n("option",{key:m,value:m},y(m),9,Dd)),64))],40,Od),n("span",Rd,y(_t(u.lastActiveAt)),1),i[35]||(i[35]=n("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):W("",!0)]))}}),Ld={class:"animate-fade-in"},Nd={class:"glass rounded-xl p-6 mb-6"},Ud={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Vd={class:"flex items-center gap-3"},Bd={key:0,class:"text-center py-8 text-textSecondary text-sm"},Fd={key:1,class:"text-center py-8 text-danger text-sm"},Hd={key:2,class:"text-center text-textSecondary py-12"},Kd={key:3,class:"space-y-2"},Wd={class:"flex items-center justify-between gap-3"},zd={class:"flex-1 min-w-0"},Jd={class:"flex items-center gap-2 mb-1"},qd={class:"font-medium text-sm"},Gd={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Yd={key:0,class:"type-badge",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"}},Zd={class:"text-xs text-muted font-mono truncate"},Qd={class:"flex items-center gap-2 shrink-0"},Xd=["onClick","disabled"],ef=["onClick"],tf=["onClick","disabled"],sf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},nf={class:"text-lg font-semibold mb-4"},of={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},rf=["value"],lf={class:"mb-4"},af={class:"mb-4"},cf={class:"mb-4"},uf={class:"flex items-center gap-3 flex-wrap"},df=["disabled"],ff={key:0,class:"text-sm text-danger"},pf=Fe({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],s=_([]),o=_(!0),r=_(""),l=_(""),a=_(!0),c=_(!1),d=_(null),x=_(null),f=_(!1),p=_(null),h=_(""),S=_("claude"),F=_(""),C=_(""),N=_(""),$=_("");async function T(){o.value=!0,r.value="";try{const z=await xe("/api/agent-templates");s.value=z.templates||[]}catch(z){r.value="Failed to load templates: "+z.message}finally{o.value=!1}}function L(){p.value=null,h.value="",S.value="claude",F.value="",C.value="",N.value="",$.value="",f.value=!0}function I(z){p.value=z.id,h.value=z.name,S.value=z.client,F.value=z.workingDirectory,C.value=z.systemPrompt||"",N.value=z.mcpServers&&Object.keys(z.mcpServers).length?JSON.stringify(z.mcpServers,null,2):"",$.value="",f.value=!0}function V(){f.value=!1,p.value=null}function b(){$.value="";const z=h.value.trim(),k=F.value.trim();if(!z)return $.value="Name is required",null;if(!k)return $.value="Working directory is required",null;let M={};const U=N.value.trim();if(U){try{M=JSON.parse(U)}catch{return $.value="MCP servers must be valid JSON",null}if(typeof M!="object"||M===null||Array.isArray(M))return $.value="MCP servers must be a JSON object",null}return{name:z,client:S.value,workingDirectory:k,systemPrompt:C.value.trim()||null,mcpServers:M}}async function O(){if(c.value)return;const z=b();if(z){c.value=!0;try{const k=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",M=p.value?"PATCH":"POST",U=await fetch(k,{method:M,headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify(z)});if(!U.ok){const E=await U.json().catch(()=>({}));throw new Error(E.error||U.statusText)}me("Saved ✓",!0),V(),await T()}catch(k){$.value="Error: "+k.message}finally{c.value=!1}}}async function le(z){if(!d.value){d.value=z.id;try{const k=await fetch(`/api/agent-templates/${z.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`}});if(!k.ok){const U=await k.json().catch(()=>({}));throw new Error(U.error||k.statusText)}const M=await k.json();me(`Started thread ${M.threadId} ✓`,!0)}catch(k){me("Error: "+k.message,!1)}finally{d.value=null}}}async function ve(z){if(confirm(`Delete template "${z.name}"?`)&&!x.value){x.value=z.id;try{const k=await fetch(`/api/agent-templates/${z.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!k.ok)throw new Error(k.statusText);me("Deleted ✓",!0),await T()}catch(k){me("Error: "+k.message,!1)}finally{x.value=null}}}function me(z,k){l.value=z,a.value=k,setTimeout(()=>{l.value=""},3e3)}return Ne(T),(z,k)=>(v(),g("div",Ld,[n("div",Nd,[n("div",Ud,[k[5]||(k[5]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent Templates"),n("p",{class:"text-sm text-textSecondary mt-1"},"Reusable spawn presets. Starting one stamps out a fresh root thread.")],-1)),n("div",Vd,[l.value?(v(),g("span",{key:0,class:Y(["text-sm",a.value?"text-success":"text-danger"])},y(l.value),3)):W("",!0),n("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Template ")])]),o.value?(v(),g("div",Bd,"Loading...")):r.value?(v(),g("div",Fd,y(r.value),1)):s.value.length===0?(v(),g("div",Hd,"No agent templates yet")):(v(),g("div",Kd,[(v(!0),g(re,null,pe(s.value,M=>(v(),g("div",{key:M.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Wd,[n("div",zd,[n("div",Jd,[n("span",qd,y(M.name),1),n("span",Gd,y(M.client),1),M.mcpServers&&Object.keys(M.mcpServers).length?(v(),g("span",Yd,y(Object.keys(M.mcpServers).length)+" mcp",1)):W("",!0)]),n("div",Zd,y(M.workingDirectory),1)]),n("div",Qd,[n("button",{onClick:U=>le(M),disabled:d.value===M.id,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight text-xs text-white font-medium transition disabled:opacity-50"},y(d.value===M.id?"Starting…":"Start"),9,Xd),n("button",{onClick:U=>I(M),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,ef),n("button",{onClick:U=>ve(M),disabled:x.value===M.id,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"},y(x.value===M.id?"…":"Delete"),9,tf)])])]))),128))]))]),f.value?(v(),g("div",sf,[n("h3",nf,y(p.value?`Edit: ${h.value}`:"New Agent Template"),1),n("div",of,[n("div",null,[k[6]||(k[6]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Name "),n("span",{class:"text-danger"},"*")],-1)),Z(n("input",{"onUpdate:modelValue":k[0]||(k[0]=M=>h.value=M),type:"text",placeholder:"YouTube Researcher",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),[[se,h.value]])]),n("div",null,[k[7]||(k[7]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Client "),n("span",{class:"text-danger"},"*")],-1)),Z(n("select",{"onUpdate:modelValue":k[1]||(k[1]=M=>S.value=M),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"},[(v(),g(re,null,pe(t,M=>n("option",{key:M,value:M},y(M),9,rf)),64))],512),[[ht,S.value]])])]),n("div",lf,[k[8]||(k[8]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Working Directory "),n("span",{class:"text-danger"},"*")],-1)),Z(n("input",{"onUpdate:modelValue":k[2]||(k[2]=M=>F.value=M),type:"text",placeholder:"C:\\src\\my-project",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),[[se,F.value]])]),n("div",af,[k[9]||(k[9]=n("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),Z(n("textarea",{"onUpdate:modelValue":k[3]||(k[3]=M=>C.value=M),rows:"4",placeholder:"Optional identity prompt for the spawned thread",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 resize-y"},null,512),[[se,C.value]])]),n("div",cf,[k[10]||(k[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),Z(n("textarea",{"onUpdate:modelValue":k[4]||(k[4]=M=>N.value=M),rows:"6",placeholder:'{ "my-server": { "type": "http", "url": "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 resize-y"},null,512),[[se,N.value]]),k[11]||(k[11]=n("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),n("div",uf,[n("button",{onClick:O,disabled:c.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(c.value?"Saving…":p.value?"Save Changes":"Create Template"),9,df),n("button",{onClick:V,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 "),$.value?(v(),g("span",ff,y($.value),1)):W("",!0)])])):W("",!0)]))}}),mf={class:"animate-fade-in"},xf={class:"glass rounded-xl p-6 mb-6"},vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},gf={class:"flex items-center gap-3"},hf={key:0,class:"text-center py-8 text-textSecondary text-sm"},yf={key:1,class:"text-center py-8 text-danger text-sm"},bf={key:2,class:"text-center text-textSecondary py-12"},_f={key:3,class:"space-y-2"},wf={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},kf={class:"flex items-center justify-between gap-3"},Sf={class:"flex items-center gap-2 min-w-0"},$f={class:"flex items-center justify-between gap-3"},Cf={class:"flex-1 min-w-0"},Tf={class:"flex items-center gap-2 mb-1"},Pf={class:"font-medium text-sm font-mono"},Ef={class:"text-xs text-muted font-mono truncate"},Af={class:"flex items-center gap-2 shrink-0"},If=["onClick"],Of=["onClick","disabled"],Mf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Df={class:"text-lg font-semibold mb-4"},Rf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},jf=["readonly"],Lf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Nf={class:"mb-4"},Uf={class:"flex items-center justify-between mb-2"},Vf=["onUpdate:modelValue"],Bf=["onUpdate:modelValue"],Ff=["onClick"],Hf={key:0,class:"text-xs text-muted italic"},Kf={class:"mb-4"},Wf={class:"mb-4"},zf={class:"flex items-center justify-between mb-2"},Jf=["onUpdate:modelValue"],qf=["onUpdate:modelValue"],Gf=["onClick"],Yf={key:0,class:"text-xs text-muted italic"},Zf={class:"flex items-center gap-3 flex-wrap"},Qf=["disabled"],Xf={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ep=Fe({__name:"McpServersTab",setup(e){const t=_({}),s=_(!0),o=_(""),r=_(""),l=_(!0),a=_(!1),c=_(null),d=_(!1),x=_(null),f=_(""),p=_("stdio"),h=_(""),S=_(""),F=_(""),C=_([]),N=_([]),$=_(""),T=Pe(()=>Object.entries(t.value).filter(([z])=>z!==Gt));async function L(){s.value=!0,o.value="";try{const z=await xe("/api/mcp-servers");t.value=z.servers||{}}catch(z){o.value="Failed to load MCP servers: "+z.message}finally{s.value=!1}}function I(z){return z==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function V(){x.value=null,f.value="",p.value="stdio",h.value="",S.value="",F.value="",C.value=[],N.value=[],$.value="",d.value=!0}function b(z,k){x.value=z,f.value=z,p.value=k.type,h.value=k.command||"",S.value=(k.args||[]).join(" "),F.value=k.url||"",C.value=Object.entries(k.env||{}).map(([M,U])=>({k:M,v:U})),N.value=Object.entries(k.headers||{}).map(([M,U])=>({k:M,v:U})),$.value="",d.value=!0}function O(){d.value=!1,x.value=null}function le(){if($.value="",!f.value.trim())return $.value="Name is required",!1;if(p.value==="stdio"&&!h.value.trim())return $.value="Command is required for stdio type",!1;if(p.value==="http"){const z=F.value.trim();if(!z)return $.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(z))return $.value="URL must start with http:// or https://",!1}return!0}async function ve(){if(!le()||a.value)return;a.value=!0;const z=f.value.trim(),k={type:p.value};if(p.value==="stdio"){k.command=h.value.trim();const M=S.value.trim();M&&(k.args=M.split(/\s+/));const U=Object.fromEntries(C.value.filter(E=>E.k.trim()).map(E=>[E.k.trim(),E.v]));Object.keys(U).length&&(k.env=U)}else{k.url=F.value.trim();const M=Object.fromEntries(N.value.filter(U=>U.k.trim()).map(U=>[U.k.trim(),U.v]));Object.keys(M).length&&(k.headers=M)}try{const M=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify({name:z,config:k})});if(!M.ok)throw new Error(M.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),O(),await L()}catch(M){$.value="Error: "+M.message}finally{a.value=!1}}async function me(z){if(confirm(`Delete MCP server "${z}"?`)&&!c.value){c.value=z;try{const k=await fetch(`/api/mcp-servers/${encodeURIComponent(z)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ce()}`}});if(!k.ok)throw new Error(k.statusText);r.value="Deleted ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await L()}catch(k){r.value="Error: "+k.message,l.value=!1}finally{c.value=null}}}return Ne(L),(z,k)=>(v(),g("div",mf,[n("div",xf,[n("div",vf,[k[7]||(k[7]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"MCP Servers"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),n("div",gf,[r.value?(v(),g("span",{key:0,class:Y(["text-sm",l.value?"text-success":"text-danger"])},y(r.value),3)):W("",!0),n("button",{onClick:V,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(v(),g("div",hf,"Loading...")):o.value?(v(),g("div",yf,y(o.value),1)):Object.keys(t.value).length===0?(v(),g("div",bf,"No MCP servers configured")):(v(),g("div",_f,[t.value[Gt]?(v(),g("div",wf,[n("div",kf,[n("div",Sf,[n("span",{class:"font-medium text-sm font-mono"},y(Gt)),n("span",{class:"type-badge",style:It(I(t.value[Gt].type))},y(t.value[Gt].type),5),k[8]||(k[8]=n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),k[9]||(k[9]=n("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):W("",!0),(v(!0),g(re,null,pe(T.value,([M,U])=>{var E;return v(),g("div",{key:M,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",$f,[n("div",Cf,[n("div",Tf,[n("span",Pf,y(M),1),n("span",{class:"type-badge",style:It(I(U.type))},y(U.type),5)]),n("div",Ef,[U.type==="stdio"?(v(),g(re,{key:0},[te(y(U.command)+y((E=U.args)!=null&&E.length?" "+U.args.join(" "):""),1)],64)):(v(),g(re,{key:1},[te(y(U.url),1)],64))])]),n("div",Af,[n("button",{onClick:G=>b(M,U),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,If),n("button",{onClick:G=>me(M),disabled:c.value===M,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"},y(c.value===M?"…":"Delete"),9,Of)])])])}),128))]))]),d.value?(v(),g("div",Mf,[n("h3",Df,y(x.value?`Edit: ${x.value}`:"Add MCP Server"),1),n("div",Rf,[n("div",null,[k[10]||(k[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Name "),n("span",{class:"text-danger"},"*")],-1)),Z(n("input",{"onUpdate:modelValue":k[0]||(k[0]=M=>f.value=M),type:"text",readonly:!!x.value,placeholder:"my-server",class:Y(["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,jf),[[se,f.value]])]),n("div",null,[k[12]||(k[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Type "),n("span",{class:"text-danger"},"*")],-1)),Z(n("select",{"onUpdate:modelValue":k[1]||(k[1]=M=>p.value=M),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"},[...k[11]||(k[11]=[n("option",{value:"stdio"},"stdio",-1),n("option",{value:"http"},"http",-1)])],512),[[ht,p.value]])])]),p.value==="stdio"?(v(),g(re,{key:0},[n("div",Lf,[n("div",null,[k[13]||(k[13]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("Command "),n("span",{class:"text-danger"},"*")],-1)),Z(n("input",{"onUpdate:modelValue":k[2]||(k[2]=M=>h.value=M),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),[[se,h.value]])]),n("div",null,[k[14]||(k[14]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),Z(n("input",{"onUpdate:modelValue":k[3]||(k[3]=M=>S.value=M),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),[[se,S.value]])])]),n("div",Nf,[n("div",Uf,[k[15]||(k[15]=n("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),n("button",{onClick:k[4]||(k[4]=M=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(re,null,pe(C.value,(M,U)=>(v(),g("div",{key:U,class:"flex items-center gap-2 mb-2"},[Z(n("input",{"onUpdate:modelValue":E=>M.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,Vf),[[se,M.k]]),k[16]||(k[16]=n("span",{class:"text-muted text-xs"},"=",-1)),Z(n("input",{"onUpdate:modelValue":E=>M.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,Bf),[[se,M.v]]),n("button",{onClick:E=>C.value.splice(U,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Ff)]))),128)),C.value.length===0?(v(),g("div",Hf,"No env vars")):W("",!0)])],64)):(v(),g(re,{key:1},[n("div",Kf,[k[17]||(k[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},[te("URL "),n("span",{class:"text-danger"},"*")],-1)),Z(n("input",{"onUpdate:modelValue":k[5]||(k[5]=M=>F.value=M),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),[[se,F.value]])]),n("div",Wf,[n("div",zf,[k[18]||(k[18]=n("label",{class:"text-xs text-textSecondary"},"Headers",-1)),n("button",{onClick:k[6]||(k[6]=M=>N.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(re,null,pe(N.value,(M,U)=>(v(),g("div",{key:U,class:"flex items-center gap-2 mb-2"},[Z(n("input",{"onUpdate:modelValue":E=>M.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,Jf),[[se,M.k]]),k[19]||(k[19]=n("span",{class:"text-muted text-xs"},":",-1)),Z(n("input",{"onUpdate:modelValue":E=>M.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,qf),[[se,M.v]]),n("button",{onClick:E=>N.value.splice(U,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Gf)]))),128)),N.value.length===0?(v(),g("div",Yf,"No headers")):W("",!0)])],64)),n("div",Zf,[n("button",{onClick:ve,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"},y(a.value?"Saving…":x.value?"Save Changes":"Add Server"),9,Qf),n("button",{onClick:O,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 "),$.value?(v(),g("span",Xf,y($.value),1)):W("",!0)])])):W("",!0)]))}}),tp={class:"animate-fade-in"},sp={class:"glass rounded-xl p-6 mb-6"},np={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},op={class:"flex items-center gap-3"},rp=["disabled"],lp={key:0,class:"text-center py-8 text-textSecondary text-sm"},ap={key:1,class:"space-y-6"},ip={class:"glass rounded-xl p-4 border border-gray-700/50"},cp={class:"glass rounded-xl p-4 border border-gray-700/50"},up={class:"glass rounded-xl p-4 border border-gray-700/50"},dp={class:"glass rounded-xl p-4 border border-gray-700/50"},fp={class:"glass rounded-xl p-4 border border-gray-700/50"},pp={class:"glass rounded-xl p-4 border border-gray-700/50"},mp={class:"text-xs text-textSecondary mb-3"},xp={class:"flex items-center gap-2"},vp=["placeholder"],gp=["disabled"],hp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},yp={class:"grid grid-cols-2 gap-4"},bp={class:"text-sm font-medium font-mono text-textSecondary"},_p={class:"text-sm font-medium font-mono text-textSecondary"},wp={class:"mt-3"},kp=Fe({__name:"ClaudeTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_("claude-opus-4-6"),l=_("claude-opus-4-6"),a=_("claude-sonnet-4-5"),c=_("claude-sonnet-4-5"),d=_(!1),x=_(""),f=_(""),p=_(""),h=_(""),S=_(20),F=_(20),C=_(""),N=_(!1),$=Pe(()=>r.value!==l.value||a.value!==c.value||x.value!==f.value||p.value!==h.value||S.value!==F.value||C.value.length>0);async function T(){t.value=!0;try{const[V,b,O]=await Promise.all([xe("/api/settings/default-thread-model"),xe("/api/settings/default-worker-model"),xe("/api/settings/claude")]);r.value=V.defaultThreadModel,l.value=V.defaultThreadModel,a.value=b.defaultWorkerModel,c.value=b.defaultWorkerModel,x.value=O.cliPath,f.value=O.cliPath,p.value=O.gitBashPath,h.value=O.gitBashPath,S.value=O.maxConcurrentThreads,F.value=O.maxConcurrentThreads,N.value=O.oauthTokenSet,C.value=""}finally{t.value=!1}}async function L(){if(s.value=!0,o.value="",!r.value){o.value="Error: Thread model cannot be empty",s.value=!1;return}if(!a.value){o.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite(S.value)||S.value<1){o.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const V={Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},b={cliPath:x.value,gitBashPath:p.value,maxConcurrentThreads:S.value};C.value.length>0&&(b.oauthToken=C.value);const[O,le,ve]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:V,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:V,body:JSON.stringify({model:a.value})}),fetch("/api/settings/claude",{method:"POST",headers:V,body:JSON.stringify(b)})]);for(const M of[O,le,ve])if(!M.ok){const U=await M.json().catch(()=>({error:M.statusText}));throw new Error(U.error??M.statusText)}const me=await O.json(),z=await le.json(),k=await ve.json();l.value=me.defaultThreadModel,r.value=me.defaultThreadModel,c.value=z.defaultWorkerModel,a.value=z.defaultWorkerModel,x.value=k.cliPath,f.value=k.cliPath,p.value=k.gitBashPath,h.value=k.gitBashPath,S.value=k.maxConcurrentThreads,F.value=k.maxConcurrentThreads,N.value=k.oauthTokenSet,C.value="",o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(V){o.value="Error: "+V.message}finally{s.value=!1}}async function I(){d.value=!0,o.value="";try{const V={Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},b=await fetch("/api/settings/claude",{method:"POST",headers:V,body:JSON.stringify({clearOauthToken:!0})});if(!b.ok){const le=await b.json().catch(()=>({error:b.statusText}));throw new Error(le.error??b.statusText)}const O=await b.json();N.value=O.oauthTokenSet,C.value="",o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(V){o.value="Error: "+V.message}finally{d.value=!1}}return Ne(T),(V,b)=>(v(),g("div",tp,[n("div",sp,[n("div",np,[b[6]||(b[6]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Claude"),n("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),n("div",op,[o.value?(v(),g("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):W("",!0),n("button",{onClick:L,disabled:s.value||t.value||!$.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,rp)])]),t.value?(v(),g("div",lp,"Loading…")):(v(),g("div",ap,[n("div",ip,[b[7]||(b[7]=n("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),b[8]||(b[8]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),te(" env var if set. ")],-1)),Z(n("input",{"onUpdate:modelValue":b[0]||(b[0]=O=>r.value=O),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),[[se,r.value,void 0,{trim:!0}]])]),n("div",cp,[b[9]||(b[9]=n("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),b[10]||(b[10]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Model used when spawning a worker Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),te(" env var if set. ")],-1)),Z(n("input",{"onUpdate:modelValue":b[1]||(b[1]=O=>a.value=O),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),[[se,a.value,void 0,{trim:!0}]])]),n("div",up,[b[11]||(b[11]=n("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),b[12]||(b[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),te(" env var if set. ")],-1)),Z(n("input",{"onUpdate:modelValue":b[2]||(b[2]=O=>x.value=O),type:"text",placeholder:"(auto-detect)",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),[[se,x.value,void 0,{trim:!0}]])]),n("div",dp,[b[13]||(b[13]=n("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),b[14]||(b[14]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Path to "),n("span",{class:"font-mono text-accentLight"},"bash.exe"),te(" passed to Claude via "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),te(". Leave empty to auto-detect. ")],-1)),Z(n("input",{"onUpdate:modelValue":b[3]||(b[3]=O=>p.value=O),type:"text",placeholder:"(auto-detect)",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),[[se,p.value,void 0,{trim:!0}]])]),n("div",fp,[b[15]||(b[15]=n("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),b[16]||(b[16]=n("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),Z(n("input",{"onUpdate:modelValue":b[4]||(b[4]=O=>S.value=O),type:"number",min:"1",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),[[se,S.value,void 0,{number:!0}]])]),n("div",pp,[b[20]||(b[20]=n("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),n("p",mp,[b[17]||(b[17]=te(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),b[18]||(b[18]=n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),b[19]||(b[19]=te(" env var if set. ",-1)),n("span",{class:Y(N.value?"text-success":"text-muted")},y(N.value?"A token is currently stored.":"No token stored."),3)]),n("div",xp,[Z(n("input",{"onUpdate:modelValue":b[5]||(b[5]=O=>C.value=O),type:"password",placeholder:N.value?"•••••••• (leave empty to keep)":"Paste token to store",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,vp),[[se,C.value]]),N.value?(v(),g("button",{key:0,onClick:I,disabled:d.value,class:"px-3 py-2 rounded-lg border border-gray-700 hover:border-danger hover:text-danger disabled:opacity-50 text-sm transition whitespace-nowrap"},y(d.value?"Clearing…":"Clear"),9,gp)):W("",!0)])]),n("div",hp,[b[23]||(b[23]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",yp,[n("div",null,[b[21]||(b[21]=n("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),n("span",bp,y(l.value),1)]),n("div",null,[b[22]||(b[22]=n("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),n("span",_p,y(c.value),1)])]),n("div",wp,[n("span",{class:Y(["text-sm font-medium",$.value?"text-warn":"text-textSecondary"])},y($.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Sp={class:"animate-fade-in"},$p={class:"glass rounded-xl p-6 mb-6"},Cp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Tp={class:"flex items-center gap-3"},Pp=["disabled"],Ep={key:0,class:"text-center py-8 text-textSecondary text-sm"},Ap={key:1,class:"space-y-6"},Ip={class:"glass rounded-xl p-4 border border-gray-700/50"},Op={id:"copilot-models"},Mp=["value"],Dp={key:0,class:"text-xs text-success mt-2"},Rp={class:"glass rounded-xl p-4 border border-gray-700/50"},jp={class:"flex items-center justify-between"},Lp={class:"glass rounded-xl p-4 border border-gray-700/50"},Np=["disabled"],Up={class:"glass rounded-xl p-4 border border-gray-700/50"},Vp=["disabled"],Bp={class:"glass rounded-xl p-4 border border-gray-700/50"},Fp={class:"text-xs text-textSecondary mb-3"},Hp={key:0,class:"text-success"},Kp={key:1,class:"text-warn"},Wp=["disabled","placeholder"],zp={class:"glass rounded-xl p-4 border border-gray-700/50"},Jp={key:0,class:"mt-4 space-y-4"},qp={class:"text-xs text-textSecondary mb-2"},Gp=["disabled"],Yp={class:"text-xs text-textSecondary mb-2"},Zp=["disabled"],Qp={class:"glass rounded-xl p-4 border border-gray-700/50"},Xp={class:"flex items-center justify-between gap-3"},em=["disabled"],tm={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},sm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},nm={class:"grid grid-cols-2 gap-4"},om={class:"text-sm font-medium font-mono text-textSecondary"},rm=Fe({__name:"CopilotTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(""),l=_(!1),a=_("openai"),c=_(""),d=_(""),x=_(""),f=_(""),p=_(!1),h=_(!1),S=_(!1),F=_(""),C=_([]);async function N(){t.value=!0;try{const V=await xe("/api/settings/copilot");$(V),l.value&&p.value&&I(!0)}finally{t.value=!1}}function $(V){r.value=V.model,l.value=V.byok.enabled,a.value=V.byok.providerType,c.value=V.byok.baseUrl,d.value=V.byok.modelId,x.value=V.byok.wireModel,p.value=V.byok.apiKeySet,f.value=""}const T=Pe(()=>!(!r.value.trim()||l.value&&(!c.value.trim()||!p.value&&!f.value.trim())));async function L(){if(s.value=!0,o.value="",!r.value.trim()){o.value="Error: Model cannot be empty",s.value=!1;return}try{const V={enabled:l.value,providerType:a.value,baseUrl:c.value.trim(),modelId:d.value.trim(),wireModel:x.value.trim()};f.value.trim()&&(V.apiKey=f.value.trim());const b={Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},O=await fetch("/api/settings/copilot",{method:"POST",headers:b,body:JSON.stringify({model:r.value.trim(),byok:V})});if(!O.ok){const ve=await O.json().catch(()=>({error:O.statusText}));throw new Error(ve.error??O.statusText)}const le=await O.json();$(le),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(V){o.value="Error: "+V.message}finally{s.value=!1}}async function I(V=!1){S.value=!0,F.value="",C.value=[];try{const b={baseUrl:c.value.trim(),providerType:a.value};f.value.trim()&&(b.apiKey=f.value.trim());const O=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},body:JSON.stringify(b)}),le=await O.json();if(!O.ok||!le.ok)throw new Error(le.error??O.statusText);C.value=le.models??[],F.value=`OK — ${le.count??C.value.length} models`}catch(b){V||(F.value="Error: "+b.message)}finally{S.value=!1}}return Ne(N),(V,b)=>(v(),g("div",Sp,[n("div",$p,[n("div",Cp,[b[9]||(b[9]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Copilot"),n("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),n("div",Tp,[o.value?(v(),g("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):W("",!0),n("button",{onClick:L,disabled:s.value||t.value||!T.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,Pp)])]),t.value?(v(),g("div",Ep,"Loading…")):(v(),g("div",Ap,[n("div",Ip,[b[10]||(b[10]=n("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),b[11]||(b[11]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Model passed to the Copilot CLI via "),n("span",{class:"font-mono text-accentLight"},"--model"),te(" / "),n("span",{class:"font-mono text-accentLight"},"COPILOT_MODEL"),te(". ")],-1)),Z(n("input",{"onUpdate:modelValue":b[0]||(b[0]=O=>r.value=O),type:"text",list:"copilot-models",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),[[se,r.value,void 0,{trim:!0}]]),n("datalist",Op,[(v(!0),g(re,null,pe(C.value,O=>(v(),g("option",{key:O,value:O},null,8,Mp))),128))]),C.value.length?(v(),g("p",Dp,y(C.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):W("",!0)]),n("div",Rp,[n("div",jp,[b[12]||(b[12]=n("div",null,[n("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),n("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),n("button",{onClick:b[1]||(b[1]=O=>l.value=!l.value),class:Y(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",l.value?"bg-accent":"bg-gray-700"])},[n("span",{class:Y(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",l.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),n("div",{class:Y(["space-y-4 transition",l.value?"":"opacity-40 pointer-events-none select-none"])},[n("div",Lp,[b[14]||(b[14]=n("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),b[15]||(b[15]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Wire protocol of the endpoint ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),te("). ")],-1)),Z(n("select",{"onUpdate:modelValue":b[2]||(b[2]=O=>a.value=O),disabled:!l.value,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"},[...b[13]||(b[13]=[n("option",{value:"openai"},"openai",-1),n("option",{value:"azure"},"azure",-1),n("option",{value:"anthropic"},"anthropic",-1)])],8,Np),[[ht,a.value]])]),n("div",Up,[b[16]||(b[16]=n("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),b[17]||(b[17]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" e.g. "),n("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),te(" ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),te("). ")],-1)),Z(n("input",{"onUpdate:modelValue":b[3]||(b[3]=O=>c.value=O),type:"text",disabled:!l.value,placeholder:"https://openrouter.ai/api/v1",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,8,Vp),[[se,c.value,void 0,{trim:!0}]])]),n("div",Bp,[b[21]||(b[21]=n("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),n("p",Fp,[b[18]||(b[18]=te(" Stored server-side and never echoed back (",-1)),b[19]||(b[19]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),b[20]||(b[20]=te("). ",-1)),p.value?(v(),g("span",Hp,"A key is currently set — leave blank to keep it.")):(v(),g("span",Kp,"No key set."))]),Z(n("input",{"onUpdate:modelValue":b[4]||(b[4]=O=>f.value=O),type:"password",disabled:!l.value,placeholder:p.value?"•••••••• (unchanged)":"sk-…",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,8,Wp),[[se,f.value]])]),n("div",zp,[n("button",{type:"button",onClick:b[5]||(b[5]=O=>h.value=!h.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[n("span",null,y(h.value?"▾":"▸"),1),b[22]||(b[22]=te(" Advanced (model mapping) ",-1))]),h.value?(v(),g("div",Jp,[n("div",null,[b[25]||(b[25]=n("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),n("p",qp,[b[23]||(b[23]=te(" Well-known base model for tool config (",-1)),b[24]||(b[24]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),te("). Defaults to Copilot Model. "+y(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Z(n("input",{"onUpdate:modelValue":b[6]||(b[6]=O=>d.value=O),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,Gp),[[se,d.value,void 0,{trim:!0}]])]),n("div",null,[b[28]||(b[28]=n("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),n("p",Yp,[b[26]||(b[26]=te(" Exact model name sent to the provider (",-1)),b[27]||(b[27]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),te("). Defaults to Copilot Model. "+y(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Z(n("input",{"onUpdate:modelValue":b[7]||(b[7]=O=>x.value=O),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,Zp),[[se,x.value,void 0,{trim:!0}]])])])):W("",!0)]),n("div",Qp,[n("div",Xp,[b[29]||(b[29]=n("div",null,[n("div",{class:"text-sm font-medium"},"Test Connection"),n("p",{class:"text-xs text-textSecondary mt-1"}," Lists models from the endpoint above using the values entered here — no need to save first. Uses the right auth for the selected Provider Type (openai/azure/anthropic). ")],-1)),n("button",{onClick:b[8]||(b[8]=O=>I()),disabled:S.value||!l.value,class:"px-4 py-2 rounded-xl bg-surface border border-gray-700 hover:border-accent disabled:opacity-50 text-sm font-medium transition whitespace-nowrap"},y(S.value?"Testing…":"Test"),9,em)]),F.value?(v(),g("div",{key:0,class:Y([F.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},y(F.value),3)):W("",!0),C.value.length?(v(),g("div",tm,[(v(!0),g(re,null,pe(C.value,O=>(v(),g("div",{key:O,class:"text-xs font-mono text-textSecondary py-0.5"},y(O),1))),128))])):W("",!0)])],2),n("div",sm,[b[32]||(b[32]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",nm,[n("div",null,[b[30]||(b[30]=n("div",{class:"text-xs text-muted mb-1"},"Model",-1)),n("span",om,y(r.value||"—"),1)]),n("div",null,[b[31]||(b[31]=n("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),n("span",{class:Y(["text-sm font-medium",l.value?"text-success":"text-textSecondary"])},y(l.value?"Enabled":"Disabled"),3)])])])]))])]))}}),lm={class:"animate-fade-in"},am={class:"glass rounded-xl p-6 mb-6"},im={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},cm={class:"flex items-center gap-3"},um=["disabled"],dm={key:0,class:"text-center py-8 text-textSecondary text-sm"},fm={key:1,class:"space-y-6"},pm={class:"glass rounded-xl p-4 border border-gray-700/50"},mm={class:"flex items-center gap-4"},xm={class:"flex justify-between text-xs text-muted mt-2"},vm={class:"font-mono"},gm={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},hm={class:"glass rounded-xl p-4 border border-gray-700/50"},ym={class:"flex items-center gap-4"},bm={class:"flex justify-between text-xs text-muted mt-2"},_m={class:"font-mono"},wm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},km={class:"grid grid-cols-2 gap-4"},Sm={class:"text-sm font-medium text-textSecondary"},$m={class:"mt-3"},Cm=Fe({__name:"SettingsTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(50),l=_(50),a=_(1440),c=_(1440),d=Pe(()=>r.value!==l.value||a.value!==c.value);async function x(){t.value=!0;try{const[p,h]=await Promise.all([xe("/api/settings/bootstrap-message-count"),xe("/api/settings/wait-timeout")]);r.value=p.count,l.value=p.count,a.value=h.minutes,c.value=h.minutes}finally{t.value=!1}}async function f(){s.value=!0,o.value="";try{const p={Authorization:`Bearer ${ce()}`,"Content-Type":"application/json"},[h,S]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:p,body:JSON.stringify({count:r.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:p,body:JSON.stringify({minutes:a.value})})]);for(const N of[h,S])if(!N.ok){const $=await N.json().catch(()=>({error:N.statusText}));throw new Error($.error??N.statusText)}const F=await h.json(),C=await S.json();l.value=F.count,r.value=F.count,c.value=C.minutes,a.value=C.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(p){o.value="Error: "+p.message}finally{s.value=!1}}return Ne(x),(p,h)=>(v(),g("div",lm,[n("div",am,[n("div",im,[h[4]||(h[4]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Settings"),n("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),n("div",cm,[o.value?(v(),g("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):W("",!0),n("button",{onClick:f,disabled:s.value||t.value||!d.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,um)])]),t.value?(v(),g("div",dm,"Loading…")):(v(),g("div",fm,[n("div",pm,[h[8]||(h[8]=n("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),h[9]||(h[9]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Number of recent messages injected into the agent's bootstrap context. Set to "),n("span",{class:"font-mono text-accentLight"},"0"),te(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),n("div",mm,[Z(n("input",{"onUpdate:modelValue":h[0]||(h[0]=S=>r.value=S),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[se,r.value,void 0,{number:!0}]]),Z(n("input",{"onUpdate:modelValue":h[1]||(h[1]=S=>r.value=S),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),[[se,r.value,void 0,{number:!0}]])]),n("div",xm,[h[5]||(h[5]=n("span",null,"Off",-1)),n("span",vm,y(r.value)+" messages",1),h[6]||(h[6]=n("span",null,"Max",-1))]),r.value===0?(v(),g("div",gm,[...h[7]||(h[7]=[te(" Message buffer injection is ",-1),n("strong",null,"disabled",-1),te(". 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)]),n("div",hm,[h[12]||(h[12]=n("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),h[13]||(h[13]=n("p",{class:"text-xs text-textSecondary mb-3"},[te(" Maximum time (in minutes) a single "),n("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),te(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),n("div",ym,[Z(n("input",{"onUpdate:modelValue":h[2]||(h[2]=S=>a.value=S),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[se,a.value,void 0,{number:!0}]]),Z(n("input",{"onUpdate:modelValue":h[3]||(h[3]=S=>a.value=S),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),[[se,a.value,void 0,{number:!0}]])]),n("div",bm,[h[10]||(h[10]=n("span",null,"1 min",-1)),n("span",_m,y(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),h[11]||(h[11]=n("span",null,"24h",-1))])]),n("div",wm,[h[16]||(h[16]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",km,[n("div",null,[h[14]||(h[14]=n("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),n("span",{class:Y(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},y(l.value>0?`${l.value} messages`:"Disabled"),3)]),n("div",null,[h[15]||(h[15]=n("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),n("span",Sm,y(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)])]),n("div",$m,[n("span",{class:Y(["text-sm font-medium",d.value?"text-warn":"text-textSecondary"])},y(d.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Tm={class:"animate-fade-in"},Pm={class:"glass rounded-xl p-6 mb-6"},Em={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Am={class:"flex flex-wrap gap-3 items-center"},Im=["disabled"],Om={key:0,class:"flex items-center gap-2"},Mm={key:1},Dm={class:"glass rounded-xl p-6"},Rm={key:0,class:"text-center py-8 text-textSecondary text-sm"},jm={key:1,class:"text-center py-12 text-textSecondary text-sm"},Lm={key:2,class:"space-y-2"},Nm={class:"flex items-center justify-between gap-3"},Um={class:"flex-1 min-w-0"},Vm={class:"flex flex-wrap items-center gap-2 mb-1"},Bm={class:"font-medium text-sm font-mono"},Fm={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Hm={class:"text-xs text-muted"},Km={class:"text-xs text-muted"},Wm=["onClick","disabled"],zm={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Jm={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},qm={class:"text-sm text-textSecondary mb-4"},Gm={class:"font-mono text-textPrimary"},Ym=Fe({__name:"SnapshotsTab",setup(e){const t=_([]),s=_(!0),o=_(!1),r=_(null),l=_(""),a=_(""),c=_(!0),d=_(null);function x($){return $<1024?`${$} B`:$<1024*1024?`${($/1024).toFixed(1)} KB`:`${($/(1024*1024)).toFixed(1)} MB`}function f($){try{return new Date($).toLocaleString()}catch{return $}}function p($,T){a.value=$,c.value=T,setTimeout(()=>{a.value=""},4e3)}async function h(){s.value=!0;try{const $=await xe("/api/snapshots");t.value=$.snapshots}catch($){p("Failed to load snapshots: "+$.message,!1)}finally{s.value=!1}}async function S(){if(!o.value){o.value=!0;try{await xe("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",p("Snapshot created ✓",!0),await h()}catch($){p("Error: "+$.message,!1)}finally{o.value=!1}}}function F($){d.value=$}function C(){d.value=null}async function N(){const $=d.value;if(!(!$||r.value)){d.value=null,r.value=$;try{await xe(`/api/snapshots/${encodeURIComponent($)}`,{method:"DELETE"}),p("Deleted ✓",!0),await h()}catch(T){p("Error: "+T.message,!1)}finally{r.value=null}}}return Ne(h),($,T)=>(v(),g("div",Tm,[n("div",Pm,[n("div",Em,[T[1]||(T[1]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Snapshots"),n("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(v(),g("span",{key:0,class:Y(["text-sm",c.value?"text-success":"text-danger"])},y(a.value),3)):W("",!0)]),n("div",Am,[Z(n("input",{"onUpdate:modelValue":T[0]||(T[0]=L=>l.value=L),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:Xe(S,["enter"])},null,544),[[se,l.value]]),n("button",{onClick:S,disabled:o.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"},[o.value?(v(),g("span",Om,[...T[2]||(T[2]=[n("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),te(" Creating… ",-1)])])):(v(),g("span",Mm,"+ Create Snapshot"))],8,Im)])]),n("div",Dm,[s.value?(v(),g("div",Rm,"Loading…")):t.value.length===0?(v(),g("div",jm,"No snapshots yet")):(v(),g("div",Lm,[(v(!0),g(re,null,pe(t.value,L=>(v(),g("div",{key:L.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Nm,[n("div",Um,[n("div",Vm,[n("span",Bm,y(L.name),1),n("span",Fm,"v"+y(L.mcpVersion),1),n("span",Hm,y(x(L.sizeBytes)),1)]),n("div",Km,[te(y(f(L.createdAt)),1),L.description?(v(),g(re,{key:0},[te(" · "+y(L.description),1)],64)):W("",!0)])]),n("button",{onClick:I=>F(L.name),disabled:r.value===L.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"},y(r.value===L.name?"…":"Delete"),9,Wm)])]))),128))]))]),d.value?(v(),g("div",zm,[n("div",Jm,[T[5]||(T[5]=n("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),n("p",qm,[T[3]||(T[3]=te(" Delete ",-1)),n("span",Gm,y(d.value),1),T[4]||(T[4]=te("? This cannot be undone. ",-1))]),n("div",{class:"flex gap-3"},[n("button",{onClick:N,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),n("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)]))}}),Zm={class:"animate-fade-in space-y-6"},Qm={class:"glass rounded-xl p-6"},Xm={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},ex={class:"text-sm text-textSecondary mt-1"},tx={class:"flex items-center gap-3"},sx={key:0,class:"text-xs text-accentLight animate-pulse"},nx={key:0,class:"flex flex-wrap gap-2 mt-3"},ox=["onClick"],rx={class:"ml-1 opacity-60"},lx={key:0,class:"text-center py-12 text-textSecondary"},ax={key:1,class:"text-center py-8 text-danger text-sm"},ix={key:2,class:"text-center py-12 text-textSecondary"},cx={key:3,class:"space-y-3"},ux={class:"flex flex-wrap items-start gap-3"},dx={class:"flex-1 min-w-0 space-y-2"},fx={class:"flex flex-wrap items-center gap-2"},px={class:"font-semibold truncate"},mx={class:"text-xs text-muted font-mono"},xx={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},vx={title:"Created"},gx={title:"Archived"},hx={key:0,class:"text-muted"},yx={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},bx={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},_x={class:"flex items-center gap-2 shrink-0"},wx=["onClick","disabled"],kx=3,Sx=Fe({__name:"ArchivedThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),l=_({}),a=_({done:0,total:0}),c=_(null),d=_("all");let x=0;const f={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"}},p=Pe(()=>d.value==="all"?t.value:t.value.filter(T=>T.type===d.value)),h=Pe(()=>{const T={all:t.value.length};for(const L of t.value)T[L.type]=(T[L.type]??0)+1;return T}),S=Pe(()=>Object.values(l.value).some(Boolean));async function F(){s.value=!0,o.value="";try{const T=await xe("/api/threads/archived");t.value=T.threads??[],r.value={},l.value={},t.value.length>0&&C()}catch(T){o.value=T.message||"Failed to load archived threads"}finally{s.value=!1}}async function C(){const T=++x,L=[...t.value];a.value={done:0,total:L.length};async function I(){for(;L.length>0&&T===x;){const b=L.shift();l.value={...l.value,[b.threadId]:!0};try{const O=await fetch(`/api/threads/${b.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`}});if(T!==x)return;if(O.ok){const le=await O.json();le.summary&&(r.value={...r.value,[b.threadId]:le.summary})}}catch{}finally{if(T===x){const{[b.threadId]:O,...le}=l.value;l.value=le,a.value={...a.value,done:a.value.done+1}}}}}const V=Array.from({length:Math.min(kx,L.length)},()=>I());await Promise.all(V)}function N(T){if(!T)return"—";const L=new Date(T),V=Date.now()-L.getTime(),b=Math.floor(V/6e4),O=Math.floor(V/36e5),le=Math.floor(V/864e5),ve=Math.floor(le/30);return b<1?"just now":b<60?`${b}m ago`:O<24?`${O}h ago`:le<30?`${le}d ago`:ve<12?`${ve}mo ago`:`${Math.floor(ve/12)}y ago`}async function $(T){if(confirm(`Unarchive thread "${T.name}" (${T.threadId})?`)){c.value=T.threadId;try{const L=await fetch(`/api/threads/${T.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${ce()}`}});if(!L.ok){const I=await L.json().catch(()=>({error:L.statusText}));throw new Error(I.error??L.statusText)}await F()}catch(L){o.value="Failed to unarchive: "+L.message}finally{c.value=null}}}return Ne(F),(T,L)=>(v(),g("div",Zm,[n("div",Qm,[n("div",Xm,[n("div",null,[L[0]||(L[0]=n("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),n("p",ex,y(t.value.length)+" archived thread"+y(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),n("div",tx,[S.value?(v(),g("span",sx," Building summaries… "+y(a.value.done)+"/"+y(a.value.total),1)):W("",!0),n("button",{onClick:F,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(v(),g("div",nx,[(v(),g(re,null,pe(["all","root","branch","daily"],I=>n("button",{key:I,onClick:V=>d.value=I,class:Y(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===I?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[te(y(I==="all"?"All":I.charAt(0).toUpperCase()+I.slice(1))+" ",1),n("span",rx,"("+y(h.value[I]??0)+")",1)],10,ox)),64))])):W("",!0)]),s.value&&t.value.length===0?(v(),g("div",lx,"Loading archived threads…")):o.value?(v(),g("div",ax,y(o.value),1)):t.value.length===0?(v(),g("div",ix,"No archived threads")):W("",!0),p.value.length>0?(v(),g("div",cx,[(v(!0),g(re,null,pe(p.value,I=>{var V,b;return v(),g("div",{key:I.id,class:"glass rounded-xl p-4"},[n("div",ux,[n("div",dx,[n("div",fx,[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(V=f[I.type])==null?void 0:V.classes])},y((b=f[I.type])==null?void 0:b.emoji)+" "+y(I.type.toUpperCase()),3),n("span",px,y(I.name),1),n("span",mx,"ID: "+y(I.threadId),1)]),n("div",xx,[n("span",vx,"Created "+y(N(I.createdAt)),1),n("span",gx,"Archived "+y(N(I.archivedAt??I.lastActiveAt)),1),I.client?(v(),g("span",hx,y(I.client),1)):W("",!0)]),r.value[I.threadId]?(v(),g("div",yx,y(r.value[I.threadId]),1)):l.value[I.threadId]?(v(),g("div",bx," Generating summary… ")):W("",!0)]),n("div",_x,[n("button",{onClick:O=>$(I),disabled:c.value===I.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"},y(c.value===I.threadId?"Restoring…":"↩ Unarchive"),9,wx)])])])}),128))])):W("",!0)]))}}),$x={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Cx={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},Tx=["disabled"],Px={key:0,class:"mt-3 text-sm text-danger"},Ex={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Ax={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Ix={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Ox={class:"flex items-center gap-4"},Mx={class:"text-sm text-textSecondary font-mono"},Dx={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},Rx={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},jx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Lx={class:"text-2xl font-bold font-mono"},Nx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Ux={class:"text-2xl font-bold font-mono"},Vx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Bx={class:"text-2xl font-bold font-mono"},Fx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Hx={class:"flex items-center gap-2 mb-2"},Kx={class:"text-2xl font-bold font-mono"},Wx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},zx={class:"text-2xl font-bold font-mono"},Jx={class:"max-w-7xl mx-auto px-4 sm:px-6"},qx={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Gx=["onClick"],Yx={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",Zx=Fe({__name:"App",setup(e){const t=_(!1),s=_(""),o=_(""),r=_(!1),l=_(null),a=_("sessions");let c=null;const d=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"agents",label:"Agents"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],x={sessions:ri,notes:ki,templates:nc,skills:Hc,agents:pf,threads:jd,archived:Sx,mcp:ep,snapshots:Ym,claude:kp,copilot:rm,settings:Cm},f=Pe(()=>x[a.value]),p=Pe(()=>{if(!l.value)return"—";const N=Math.floor(l.value.uptime),$=Math.floor(N/86400),T=Math.floor(N%86400/3600),L=Math.floor(N%3600/60);return $>0?`${$}d ${T}h`:T>0?`${T}h ${L}m`:`${L}m`});async function h(){const N=s.value.trim()||"no-auth";r.value=!0,o.value="";try{qt(N),await F(),localStorage.setItem(vs,N),t.value=!0,C()}catch($){const T=$;T.status===401?o.value="Invalid token":o.value=T.message??"Connection failed",qt("")}finally{r.value=!1}}function S(){localStorage.removeItem(vs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function F(){l.value=await xe("/api/status")}function C(){c&&clearInterval(c),c=setInterval(F,3e4)}return Ne(async()=>{const N=localStorage.getItem(vs);if(N){s.value=N;try{qt(N),await F(),t.value=!0,C()}catch{localStorage.removeItem(vs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(N,$)=>{var T,L,I,V,b,O,le,ve,me;return t.value?(v(),g("div",Ex,[n("header",Ax,[n("div",Ix,[$[3]||($[3]=ut('<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)),n("div",Ox,[$[2]||($[2]=n("div",{class:"flex items-center gap-2 text-sm"},[n("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),n("span",{class:"text-textSecondary"},"Connected")],-1)),n("div",Mx,y(p.value),1),n("button",{onClick:S,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),n("div",Dx,[n("div",Rx,[n("div",jx,[$[4]||($[4]=ut('<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)),n("div",Lx,y(((T=l.value)==null?void 0:T.activeSessions)??0),1)]),n("div",Nx,[$[5]||($[5]=ut('<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)),n("div",Ux,y(((I=(L=l.value)==null?void 0:L.memory)==null?void 0:I.totalSemanticNotes)??0),1)]),n("div",Vx,[$[6]||($[6]=ut('<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)),n("div",Bx,y(((b=(V=l.value)==null?void 0:V.memory)==null?void 0:b.totalEpisodes)??0),1)]),n("div",Fx,[n("div",Hx,[n("span",{class:Y((((le=(O=l.value)==null?void 0:O.memory)==null?void 0:le.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...$[7]||($[7]=[n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("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),$[8]||($[8]=n("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),n("div",Kx,y(((me=(ve=l.value)==null?void 0:ve.memory)==null?void 0:me.unconsolidatedEpisodes)??0),1)]),n("div",Wx,[$[9]||($[9]=ut('<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)),n("div",zx,y(p.value),1)])])]),n("div",Jx,[n("nav",qx,[(v(),g(re,null,pe(d,z=>n("button",{key:z.id,onClick:k=>a.value=z.id,class:Y(["pb-3 text-sm font-medium transition",a.value===z.id?"tab-active":"tab-inactive"])},y(z.label),11,Gx)),64))])]),n("div",Yx,[(v(),fr(El(f.value),{status:l.value},null,8,["status"]))])])):(v(),g("div",$x,[n("div",Cx,[$[1]||($[1]=ut('<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)),Z(n("input",{"onUpdate:modelValue":$[0]||($[0]=z=>s.value=z),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:Xe(h,["enter"])},null,544),[[se,s.value]]),n("button",{onClick:h,disabled:r.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"},y(r.value?"Connecting...":"Connect"),9,Tx),o.value?(v(),g("p",Px,y(o.value),1)):W("",!0)])]))}}});Fa(Zx).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">
|