sensorium-mcp 3.1.2-board.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/dashboard/routes/types.d.ts +0 -6
  2. package/dist/dashboard/routes/types.d.ts.map +1 -1
  3. package/dist/dashboard/routes/types.js.map +1 -1
  4. package/dist/dashboard/routes.d.ts.map +1 -1
  5. package/dist/dashboard/routes.js +0 -32
  6. package/dist/dashboard/routes.js.map +1 -1
  7. package/dist/dashboard/spa.html +12 -12
  8. package/dist/data/memory/migration-runner.d.ts.map +1 -1
  9. package/dist/data/memory/migration-runner.js +0 -4
  10. package/dist/data/memory/migration-runner.js.map +1 -1
  11. package/dist/data/memory/schema.d.ts.map +1 -1
  12. package/dist/data/memory/schema.js +0 -4
  13. package/dist/data/memory/schema.js.map +1 -1
  14. package/dist/index.js +2 -39
  15. package/dist/index.js.map +1 -1
  16. package/dist/server/http-server.d.ts +1 -3
  17. package/dist/server/http-server.d.ts.map +1 -1
  18. package/dist/server/http-server.js +1 -3
  19. package/dist/server/http-server.js.map +1 -1
  20. package/dist/services/spawn-common.d.ts.map +1 -1
  21. package/dist/services/spawn-common.js +1 -3
  22. package/dist/services/spawn-common.js.map +1 -1
  23. package/dist/services/worker-cleanup.service.d.ts +1 -6
  24. package/dist/services/worker-cleanup.service.d.ts.map +1 -1
  25. package/dist/services/worker-cleanup.service.js +10 -123
  26. package/dist/services/worker-cleanup.service.js.map +1 -1
  27. package/dist/tools/delegate-tool.d.ts.map +1 -1
  28. package/dist/tools/delegate-tool.js +0 -32
  29. package/dist/tools/delegate-tool.js.map +1 -1
  30. package/dist/tools/wait/message-delivery.d.ts.map +1 -1
  31. package/dist/tools/wait/message-delivery.js +0 -13
  32. package/dist/tools/wait/message-delivery.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/dashboard/routes/board.d.ts +0 -67
  35. package/dist/dashboard/routes/board.d.ts.map +0 -1
  36. package/dist/dashboard/routes/board.js +0 -612
  37. package/dist/dashboard/routes/board.js.map +0 -1
  38. package/dist/data/board/board-schema.d.ts +0 -22
  39. package/dist/data/board/board-schema.d.ts.map +0 -1
  40. package/dist/data/board/board-schema.js +0 -103
  41. package/dist/data/board/board-schema.js.map +0 -1
  42. package/dist/data/board/board-types.d.ts +0 -117
  43. package/dist/data/board/board-types.d.ts.map +0 -1
  44. package/dist/data/board/board-types.js +0 -9
  45. package/dist/data/board/board-types.js.map +0 -1
  46. package/dist/data/board/card.repository.d.ts +0 -64
  47. package/dist/data/board/card.repository.d.ts.map +0 -1
  48. package/dist/data/board/card.repository.js +0 -272
  49. package/dist/data/board/card.repository.js.map +0 -1
  50. package/dist/data/board/comment.repository.d.ts +0 -12
  51. package/dist/data/board/comment.repository.d.ts.map +0 -1
  52. package/dist/data/board/comment.repository.js +0 -31
  53. package/dist/data/board/comment.repository.js.map +0 -1
  54. package/dist/data/board/lane.repository.d.ts +0 -18
  55. package/dist/data/board/lane.repository.d.ts.map +0 -1
  56. package/dist/data/board/lane.repository.js +0 -44
  57. package/dist/data/board/lane.repository.js.map +0 -1
  58. package/dist/data/board/profile-defaults.d.ts +0 -19
  59. package/dist/data/board/profile-defaults.d.ts.map +0 -1
  60. package/dist/data/board/profile-defaults.js +0 -118
  61. package/dist/data/board/profile-defaults.js.map +0 -1
  62. package/dist/services/board/board-signals.d.ts +0 -25
  63. package/dist/services/board/board-signals.d.ts.map +0 -1
  64. package/dist/services/board/board-signals.js +0 -83
  65. package/dist/services/board/board-signals.js.map +0 -1
  66. package/dist/services/board/card-briefing.d.ts +0 -17
  67. package/dist/services/board/card-briefing.d.ts.map +0 -1
  68. package/dist/services/board/card-briefing.js +0 -86
  69. package/dist/services/board/card-briefing.js.map +0 -1
  70. package/dist/services/board/orchestrator.service.d.ts +0 -55
  71. package/dist/services/board/orchestrator.service.d.ts.map +0 -1
  72. package/dist/services/board/orchestrator.service.js +0 -198
  73. package/dist/services/board/orchestrator.service.js.map +0 -1
  74. package/dist/services/board/release-worker.d.ts +0 -32
  75. package/dist/services/board/release-worker.d.ts.map +0 -1
  76. package/dist/services/board/release-worker.js +0 -49
  77. package/dist/services/board/release-worker.js.map +0 -1
  78. package/dist/services/board/report-capture.d.ts +0 -48
  79. package/dist/services/board/report-capture.d.ts.map +0 -1
  80. package/dist/services/board/report-capture.js +0 -172
  81. package/dist/services/board/report-capture.js.map +0 -1
  82. package/dist/services/board/worker-spawn.d.ts +0 -30
  83. package/dist/services/board/worker-spawn.d.ts.map +0 -1
  84. package/dist/services/board/worker-spawn.js +0 -90
  85. package/dist/services/board/worker-spawn.js.map +0 -1
  86. package/dist/services/passive-notice.service.d.ts +0 -39
  87. package/dist/services/passive-notice.service.d.ts.map +0 -1
  88. package/dist/services/passive-notice.service.js +0 -274
  89. package/dist/services/passive-notice.service.js.map +0 -1
@@ -45,32 +45,32 @@
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"]'))o(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();/**
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 cn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $e={},jt=[],it=()=>{},xo=()=>!1,Is=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),As=e=>e.startsWith("onUpdate:"),Me=Object.assign,fn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},yr=Object.prototype.hasOwnProperty,_e=(e,t)=>yr.call(e,t),de=Array.isArray,Ut=e=>fs(e)==="[object Map]",Kt=e=>fs(e)==="[object Set]",On=e=>fs(e)==="[object Date]",xe=e=>typeof e=="function",Pe=e=>typeof e=="string",dt=e=>typeof e=="symbol",we=e=>e!==null&&typeof e=="object",vo=e=>(we(e)||xe(e))&&xe(e.then)&&xe(e.catch),go=Object.prototype.toString,fs=e=>go.call(e),_r=e=>fs(e).slice(8,-1),bo=e=>fs(e)==="[object Object]",pn=e=>Pe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xt=cn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ms=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},wr=/-\w/g,Ve=Ms(e=>e.replace(wr,t=>t.slice(1).toUpperCase())),kr=/\B([A-Z])/g,Pt=Ms(e=>e.replace(kr,"-$1").toLowerCase()),Os=Ms(e=>e.charAt(0).toUpperCase()+e.slice(1)),Fs=Ms(e=>e?`on${Os(e)}`:""),lt=(e,t)=>!Object.is(e,t),hs=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ho=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Ds=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Dn;const Rs=()=>Dn||(Dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bt(e){if(de(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],r=Pe(o)?Tr(o):bt(o);if(r)for(const a in r)t[a]=r[a]}return t}else if(Pe(e)||we(e))return e}const $r=/;(?![^(]*\))/g,Sr=/:([^]+)/,Cr=/\/\*[^]*?\*\//g;function Tr(e){const t={};return e.replace(Cr,"").split($r).forEach(n=>{if(n){const o=n.split(Sr);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function G(e){let t="";if(Pe(e))t=e;else if(de(e))for(let n=0;n<e.length;n++){const o=G(e[n]);o&&(t+=o+" ")}else if(we(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Pr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Er=cn(Pr);function yo(e){return!!e||e===""}function Ir(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Wt(e[o],t[o]);return n}function Wt(e,t){if(e===t)return!0;let n=On(e),o=On(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=dt(e),o=dt(t),n||o)return e===t;if(n=de(e),o=de(t),n||o)return n&&o?Ir(e,t):!1;if(n=we(e),o=we(t),n||o){if(!n||!o)return!1;const r=Object.keys(e).length,a=Object.keys(t).length;if(r!==a)return!1;for(const l in e){const i=e.hasOwnProperty(l),c=t.hasOwnProperty(l);if(i&&!c||!i&&c||!Wt(e[l],t[l]))return!1}}return String(e)===String(t)}function mn(e,t){return e.findIndex(n=>Wt(n,t))}const _o=e=>!!(e&&e.__v_isRef===!0),b=e=>Pe(e)?e:e==null?"":de(e)||we(e)&&(e.toString===go||!xe(e.toString))?_o(e)?b(e.value):JSON.stringify(e,wo,2):String(e),wo=(e,t)=>_o(t)?wo(e,t.value):Ut(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r],a)=>(n[Ks(o,a)+" =>"]=r,n),{})}:Kt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ks(n))}:dt(t)?Ks(t):we(t)&&!de(t)&&!bo(t)?String(t):t,Ks=(e,t="")=>{var n;return dt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
52
+ **/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ye={},Rt=[],ot=()=>{},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,un=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},br=Object.prototype.hasOwnProperty,xe=(e,t)=>br.call(e,t),re=Array.isArray,jt=e=>cs(e)==="[object Map]",Ft=e=>cs(e)==="[object Set]",An=e=>cs(e)==="[object Date]",ae=e=>typeof e=="function",Se=e=>typeof e=="string",lt=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,cs=e=>xo.call(e),yr=e=>cs(e).slice(8,-1),vo=e=>cs(e)==="[object Object]",cn=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,St=As(e=>e.replace(wr,"-$1").toLowerCase()),Is=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=As(e=>e?`on${Is(e)}`:""),nt=(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(re(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,$r=/:([^]+)/,Sr=/\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace(Sr,"").split(kr).forEach(s=>{if(s){const o=s.split($r);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function q(e){let t="";if(Se(e))t=e;else if(re(e))for(let s=0;s<e.length;s++){const o=q(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=lt(e),o=lt(t),s||o)return e===t;if(s=re(e),o=re(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 u=e.hasOwnProperty(a),d=t.hasOwnProperty(a);if(u&&!d||!u&&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 bo=e=>!!(e&&e.__v_isRef===!0),y=e=>Se(e)?e:e==null?"":re(e)||he(e)&&(e.toString===xo||!ae(e.toString))?bo(e)?y(e.value):JSON.stringify(e,yo,2):String(e),yo=(e,t)=>bo(t)?yo(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))}:lt(t)?Bs(t):he(t)&&!re(t)&&!vo(t)?String(t):t,Bs=(e,t="")=>{var s;return lt(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 He;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=He,!t&&He&&(this.index=(He.scopes||(He.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=He;try{return He=this,t()}finally{He=n}}}on(){++this._on===1&&(this.prevScope=He,He=this)}off(){this._on>0&&--this._on===0&&(He=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].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 Mr(){return He}let Ce;const Ws=new WeakSet;class ko{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,He&&He.active&&He.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ws.has(this)&&(Ws.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||So(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Rn(this),Co(this);const t=Ce,n=Ge;Ce=this,Ge=!0;try{return this.fn()}finally{To(this),Ce=t,Ge=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gn(t);this.deps=this.depsTail=void 0,Rn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ws.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Xs(this)&&this.run()}get dirty(){return Xs(this)}}let $o=0,es,ts;function So(e,t=!1){if(e.flags|=8,t){e.next=ts,ts=e;return}e.next=es,es=e}function xn(){$o++}function vn(){if(--$o>0)return;if(ts){let t=ts;for(ts=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;es;){let t=es;for(es=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Co(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function To(e){let t,n=e.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),gn(o),Or(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}e.deps=t,e.depsTail=n}function Xs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Po(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Po(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===as)||(e.globalVersion=as,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Xs(e))))return;e.flags|=2;const t=e.dep,n=Ce,o=Ge;Ce=e,Ge=!0;try{Co(e);const r=e.fn(e._value);(t.version===0||lt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Ce=n,Ge=o,To(e),e.flags&=-3}}function gn(e,t=!1){const{dep:n,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)gn(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Or(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ge=!0;const Eo=[];function ht(){Eo.push(Ge),Ge=!1}function yt(){const e=Eo.pop();Ge=e===void 0?!0:e}function Rn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ce;Ce=void 0;try{t()}finally{Ce=n}}}let as=0;class Dr{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class bn{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(!Ce||!Ge||Ce===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ce)n=this.activeLink=new Dr(Ce,this),Ce.deps?(n.prevDep=Ce.depsTail,Ce.depsTail.nextDep=n,Ce.depsTail=n):Ce.deps=Ce.depsTail=n,Io(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Ce.depsTail,n.nextDep=void 0,Ce.depsTail.nextDep=n,Ce.depsTail=n,Ce.deps===n&&(Ce.deps=o)}return n}trigger(t){this.version++,as++,this.notify(t)}notify(t){xn();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{vn()}}}function Io(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)Io(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const en=new WeakMap,Mt=Symbol(""),tn=Symbol(""),ls=Symbol("");function Re(e,t,n){if(Ge&&Ce){let o=en.get(e);o||en.set(e,o=new Map);let r=o.get(n);r||(o.set(n,r=new bn),r.map=o,r.key=n),r.track()}}function xt(e,t,n,o,r,a){const l=en.get(e);if(!l){as++;return}const i=c=>{c&&c.trigger()};if(xn(),t==="clear")l.forEach(i);else{const c=de(e),v=c&&pn(n);if(c&&n==="length"){const f=Number(o);l.forEach((p,k)=>{(k==="length"||k===ls||!dt(k)&&k>=f)&&i(p)})}else switch((n!==void 0||l.has(void 0))&&i(l.get(n)),v&&i(l.get(ls)),t){case"add":c?v&&i(l.get("length")):(i(l.get(Mt)),Ut(e)&&i(l.get(tn)));break;case"delete":c||(i(l.get(Mt)),Ut(e)&&i(l.get(tn)));break;case"set":Ut(e)&&i(l.get(Mt));break}}vn()}function Rt(e){const t=ye(e);return t===e?t:(Re(t,"iterate",ls),ze(e)?t:t.map(Ze))}function Ls(e){return Re(e=ye(e),"iterate",ls),e}function rt(e,t){return _t(e)?Bt(Ot(e)?Ze(t):t):Ze(t)}const Rr={__proto__:null,[Symbol.iterator](){return zs(this,Symbol.iterator,e=>rt(this,e))},concat(...e){return Rt(this).concat(...e.map(t=>de(t)?Rt(t):t))},entries(){return zs(this,"entries",e=>(e[1]=rt(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,n=>n.map(o=>rt(this,o)),arguments)},find(e,t){return ct(this,"find",e,t,n=>rt(this,n),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,n=>rt(this,n),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return Js(this,"includes",e)},indexOf(...e){return Js(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return Js(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return qt(this,"pop")},push(...e){return qt(this,"push",e)},reduce(e,...t){return Ln(this,"reduce",e,t)},reduceRight(e,...t){return Ln(this,"reduceRight",e,t)},shift(){return qt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return qt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return qt(this,"unshift",e)},values(){return zs(this,"values",e=>rt(this,e))}};function zs(e,t,n){const o=Ls(e),r=o[t]();return o!==e&&!ze(e)&&(r._next=r.next,r.next=()=>{const a=r._next();return a.done||(a.value=n(a.value)),a}),r}const Lr=Array.prototype;function ct(e,t,n,o,r,a){const l=Ls(e),i=l!==e&&!ze(e),c=l[t];if(c!==Lr[t]){const p=c.apply(e,a);return i?Ze(p):p}let v=n;l!==e&&(i?v=function(p,k){return n.call(this,rt(e,p),k,e)}:n.length>2&&(v=function(p,k){return n.call(this,p,k,e)}));const f=c.call(l,v,o);return i&&r?r(f):f}function Ln(e,t,n,o){const r=Ls(e),a=r!==e&&!ze(e);let l=n,i=!1;r!==e&&(a?(i=o.length===0,l=function(v,f,p){return i&&(i=!1,v=rt(e,v)),n.call(this,v,rt(e,f),p,e)}):n.length>3&&(l=function(v,f,p){return n.call(this,v,f,p,e)}));const c=r[t](l,...o);return i?rt(e,c):c}function Js(e,t,n){const o=ye(e);Re(o,"iterate",ls);const r=o[t](...n);return(r===-1||r===!1)&&wn(n[0])?(n[0]=ye(n[0]),o[t](...n)):r}function qt(e,t,n=[]){ht(),xn();const o=ye(e)[t].apply(e,n);return vn(),yt(),o}const jr=cn("__proto__,__v_isRef,__isVue"),Ao=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(dt));function Ur(e){dt(e)||(e=String(e));const t=ye(this);return Re(t,"has",e),t.hasOwnProperty(e)}class Mo{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return a;if(n==="__v_raw")return o===(r?a?qr:Lo:a?Ro:Do).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const l=de(t);if(!r){let c;if(l&&(c=Rr[n]))return c;if(n==="hasOwnProperty")return Ur}const i=Reflect.get(t,n,je(t)?t:o);if((dt(n)?Ao.has(n):jr(n))||(r||Re(t,"get",n),a))return i;if(je(i)){const c=l&&pn(n)?i:i.value;return r&&we(c)?nn(c):c}return we(i)?r?nn(i):yn(i):i}}class Oo extends Mo{constructor(t=!1){super(!1,t)}set(t,n,o,r){let a=t[n];const l=de(t)&&pn(n);if(!this._isShallow){const v=_t(a);if(!ze(o)&&!_t(o)&&(a=ye(a),o=ye(o)),!l&&je(a)&&!je(o))return v||(a.value=o),!0}const i=l?Number(n)<t.length:_e(t,n),c=Reflect.set(t,n,o,je(t)?t:r);return t===ye(r)&&(i?lt(o,a)&&xt(t,"set",n,o):xt(t,"add",n,o)),c}deleteProperty(t,n){const o=_e(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&o&&xt(t,"delete",n,void 0),r}has(t,n){const o=Reflect.has(t,n);return(!dt(n)||!Ao.has(n))&&Re(t,"has",n),o}ownKeys(t){return Re(t,"iterate",de(t)?"length":Mt),Reflect.ownKeys(t)}}class Nr extends Mo{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Vr=new Oo,Br=new Nr,Hr=new Oo(!0);const sn=e=>e,xs=e=>Reflect.getPrototypeOf(e);function Fr(e,t,n){return function(...o){const r=this.__v_raw,a=ye(r),l=Ut(a),i=e==="entries"||e===Symbol.iterator&&l,c=e==="keys"&&l,v=r[e](...o),f=n?sn:t?Bt:Ze;return!t&&Re(a,"iterate",c?tn:Mt),Me(Object.create(v),{next(){const{value:p,done:k}=v.next();return k?{value:p,done:k}:{value:i?[f(p[0]),f(p[1])]:f(p),done:k}}})}}function vs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Kr(e,t){const n={get(r){const a=this.__v_raw,l=ye(a),i=ye(r);e||(lt(r,i)&&Re(l,"get",r),Re(l,"get",i));const{has:c}=xs(l),v=t?sn:e?Bt:Ze;if(c.call(l,r))return v(a.get(r));if(c.call(l,i))return v(a.get(i));a!==l&&a.get(r)},get size(){const r=this.__v_raw;return!e&&Re(ye(r),"iterate",Mt),r.size},has(r){const a=this.__v_raw,l=ye(a),i=ye(r);return e||(lt(r,i)&&Re(l,"has",r),Re(l,"has",i)),r===i?a.has(r):a.has(r)||a.has(i)},forEach(r,a){const l=this,i=l.__v_raw,c=ye(i),v=t?sn:e?Bt:Ze;return!e&&Re(c,"iterate",Mt),i.forEach((f,p)=>r.call(a,v(f),v(p),l))}};return Me(n,e?{add:vs("add"),set:vs("set"),delete:vs("delete"),clear:vs("clear")}:{add(r){const a=ye(this),l=xs(a),i=ye(r),c=!t&&!ze(r)&&!_t(r)?i:r;return l.has.call(a,c)||lt(r,c)&&l.has.call(a,r)||lt(i,c)&&l.has.call(a,i)||(a.add(c),xt(a,"add",c,c)),this},set(r,a){!t&&!ze(a)&&!_t(a)&&(a=ye(a));const l=ye(this),{has:i,get:c}=xs(l);let v=i.call(l,r);v||(r=ye(r),v=i.call(l,r));const f=c.call(l,r);return l.set(r,a),v?lt(a,f)&&xt(l,"set",r,a):xt(l,"add",r,a),this},delete(r){const a=ye(this),{has:l,get:i}=xs(a);let c=l.call(a,r);c||(r=ye(r),c=l.call(a,r)),i&&i.call(a,r);const v=a.delete(r);return c&&xt(a,"delete",r,void 0),v},clear(){const r=ye(this),a=r.size!==0,l=r.clear();return a&&xt(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Fr(r,e,t)}),n}function hn(e,t){const n=Kr(e,t);return(o,r,a)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(_e(n,r)&&r in o?n:o,r,a)}const Wr={get:hn(!1,!1)},zr={get:hn(!1,!0)},Jr={get:hn(!0,!1)};const Do=new WeakMap,Ro=new WeakMap,Lo=new WeakMap,qr=new WeakMap;function Gr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yr(e){return e.__v_skip||!Object.isExtensible(e)?0:Gr(_r(e))}function yn(e){return _t(e)?e:_n(e,!1,Vr,Wr,Do)}function Zr(e){return _n(e,!1,Hr,zr,Ro)}function nn(e){return _n(e,!0,Br,Jr,Lo)}function _n(e,t,n,o,r){if(!we(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=Yr(e);if(a===0)return e;const l=r.get(e);if(l)return l;const i=new Proxy(e,a===2?o:n);return r.set(e,i),i}function Ot(e){return _t(e)?Ot(e.__v_raw):!!(e&&e.__v_isReactive)}function _t(e){return!!(e&&e.__v_isReadonly)}function ze(e){return!!(e&&e.__v_isShallow)}function wn(e){return e?!!e.__v_raw:!1}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}function Qr(e){return!_e(e,"__v_skip")&&Object.isExtensible(e)&&ho(e,"__v_skip",!0),e}const Ze=e=>we(e)?yn(e):e,Bt=e=>we(e)?nn(e):e;function je(e){return e?e.__v_isRef===!0:!1}function w(e){return Xr(e,!1)}function Xr(e,t){return je(e)?e:new ea(e,t)}class ea{constructor(t,n){this.dep=new bn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ye(t),this._value=n?t:Ze(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||ze(t)||_t(t);t=o?t:ye(t),lt(t,n)&&(this._rawValue=t,this._value=o?t:Ze(t),this.dep.trigger())}}function ta(e){return je(e)?e.value:e}const sa={get:(e,t,n)=>t==="__v_raw"?e:ta(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return je(r)&&!je(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function jo(e){return Ot(e)?e:new Proxy(e,sa)}class na{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=as-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Ce!==this)return So(this,!0),!0}get value(){const t=this.dep.track();return Po(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function oa(e,t,n=!1){let o,r;return xe(e)?o=e:(o=e.get,r=e.set),new na(o,r,n)}const gs={},$s=new WeakMap;let At;function ra(e,t=!1,n=At){if(n){let o=$s.get(n);o||$s.set(n,o=[]),o.push(e)}}function aa(e,t,n=$e){const{immediate:o,deep:r,once:a,scheduler:l,augmentJob:i,call:c}=n,v=D=>r?D:ze(D)||r===!1||r===0?vt(D,1):vt(D);let f,p,k,S,E=!1,y=!1;if(je(e)?(p=()=>e.value,E=ze(e)):Ot(e)?(p=()=>v(e),E=!0):de(e)?(y=!0,E=e.some(D=>Ot(D)||ze(D)),p=()=>e.map(D=>{if(je(D))return D.value;if(Ot(D))return v(D);if(xe(D))return c?c(D,2):D()})):xe(e)?t?p=c?()=>c(e,2):e:p=()=>{if(k){ht();try{k()}finally{yt()}}const D=At;At=f;try{return c?c(e,3,[S]):e(S)}finally{At=D}}:p=it,t&&r){const D=p,X=r===!0?1/0:r;p=()=>vt(D(),X)}const H=Mr(),C=()=>{f.stop(),H&&H.active&&fn(H.effects,f)};if(a&&t){const D=t;t=(...X)=>{D(...X),C()}}let M=y?new Array(e.length).fill(gs):gs;const L=D=>{if(!(!(f.flags&1)||!f.dirty&&!D))if(t){const X=f.run();if(r||E||(y?X.some((te,re)=>lt(te,M[re])):lt(X,M))){k&&k();const te=At;At=f;try{const re=[X,M===gs?void 0:y&&M[0]===gs?[]:M,S];M=X,c?c(t,3,re):t(...re)}finally{At=te}}}else f.run()};return i&&i(L),f=new ko(p),f.scheduler=l?()=>l(L,!1):L,S=D=>ra(D,!1,f),k=f.onStop=()=>{const D=$s.get(f);if(D){if(c)c(D,4);else for(const X of D)X();$s.delete(f)}},t?o?L(!0):M=f.run():l?l(L.bind(null,!0),!0):f.run(),C.pause=f.pause.bind(f),C.resume=f.resume.bind(f),C.stop=C,C}function vt(e,t=1/0,n){if(t<=0||!we(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,je(e))vt(e.value,t,n);else if(de(e))for(let o=0;o<e.length;o++)vt(e[o],t,n);else if(Kt(e)||Ut(e))e.forEach(o=>{vt(o,t,n)});else if(bo(e)){for(const o in e)vt(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&vt(e[o],t,n)}return e}/**
56
+ **/let Ue;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=Ue,!t&&Ue&&(this.index=(Ue.scopes||(Ue.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=Ue;try{return Ue=this,t()}finally{Ue=s}}}on(){++this._on===1&&(this.prevScope=Ue,Ue=this)}off(){this._on>0&&--this._on===0&&(Ue=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 Ue}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,Ue&&Ue.active&&Ue.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),$o(this);const t=we,s=We;we=this,We=!0;try{return this.fn()}finally{So(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(){Gs(this)&&this.run()}get dirty(){return Gs(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 $o(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function So(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 Gs(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||!Gs(e))))return;e.flags|=2;const t=e.dep,s=we,o=We;we=e,We=!0;try{$o(e);const r=e.fn(e._value);(t.version===0||nt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{we=s,We=o,So(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 vt(){To.push(We),We=!1}function gt(){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 pt(e,t,s,o,r,l){const a=Zs.get(e);if(!a){os++;return}const u=d=>{d&&d.trigger()};if(fn(),t==="clear")a.forEach(u);else{const d=re(e),x=d&&cn(s);if(d&&s==="length"){const f=Number(o);a.forEach((p,w)=>{(w==="length"||w===rs||!lt(w)&&w>=f)&&u(p)})}else switch((s!==void 0||a.has(void 0))&&u(a.get(s)),x&&u(a.get(rs)),t){case"add":d?x&&u(a.get("length")):(u(a.get(Et)),jt(e)&&u(a.get(Qs)));break;case"delete":d||(u(a.get(Et)),jt(e)&&u(a.get(Qs)));break;case"set":jt(e)&&u(a.get(Et));break}}pn()}function Mt(e){const t=me(e);return t===e?t:(Ae(t,"iterate",rs),He(e)?t:t.map(Je))}function Ds(e){return Ae(e=me(e),"iterate",rs),e}function tt(e,t){return ht(e)?Nt(At(e)?Je(t):t):Je(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>tt(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>re(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=tt(this,e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,s=>s.map(o=>tt(this,o)),arguments)},find(e,t){return ut(this,"find",e,t,s=>tt(this,s),arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,s=>tt(this,s),arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Hs(this,"values",e=>tt(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 ut(e,t,s,o,r,l){const a=Ds(e),u=a!==e&&!He(e),d=a[t];if(d!==Rr[t]){const p=d.apply(e,l);return u?Je(p):p}let x=s;a!==e&&(u?x=function(p,w){return s.call(this,tt(e,p),w,e)}:s.length>2&&(x=function(p,w){return s.call(this,p,w,e)}));const f=d.call(a,x,o);return u&&r?r(f):f}function Mn(e,t,s,o){const r=Ds(e),l=r!==e&&!He(e);let a=s,u=!1;r!==e&&(l?(u=o.length===0,a=function(x,f,p){return u&&(u=!1,x=tt(e,x)),s.call(this,x,tt(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 u?tt(e,d):d}function Ks(e,t,s){const o=me(e);Ae(o,"iterate",rs);const r=o[t](...s);return(r===-1||r===!1)&&bn(s[0])?(s[0]=me(s[0]),o[t](...s)):r}function zt(e,t,s=[]){vt(),fn();const o=me(e)[t].apply(e,s);return pn(),gt(),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(lt));function Lr(e){lt(e)||(e=String(e));const t=me(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=re(t);if(!r){let d;if(a&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Lr}const u=Reflect.get(t,s,Oe(t)?t:o);if((lt(s)?Eo.has(s):jr(s))||(r||Ae(t,"get",s),l))return u;if(Oe(u)){const d=a&&cn(s)?u:u.value;return r&&he(d)?en(d):d}return he(u)?r?en(u):gn(u):u}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,o,r){let l=t[s];const a=re(t)&&cn(s);if(!this._isShallow){const x=ht(l);if(!He(o)&&!ht(o)&&(l=me(l),o=me(o)),!a&&Oe(l)&&!Oe(o))return x||(l.value=o),!0}const u=a?Number(s)<t.length:xe(t,s),d=Reflect.set(t,s,o,Oe(t)?t:r);return t===me(r)&&(u?nt(o,l)&&pt(t,"set",s,o):pt(t,"add",s,o)),d}deleteProperty(t,s){const o=xe(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&o&&pt(t,"delete",s,void 0),r}has(t,s){const o=Reflect.has(t,s);return(!lt(s)||!Eo.has(s))&&Ae(t,"has",s),o}ownKeys(t){return Ae(t,"iterate",re(t)?"length":Et),Reflect.ownKeys(t)}}class Ur extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Nr=new Io,Vr=new Ur,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=me(r),a=jt(l),u=e==="entries"||e===Symbol.iterator&&a,d=e==="keys"&&a,x=r[e](...o),f=s?Xs:t?Nt:Je;return!t&&Ae(l,"iterate",d?Qs:Et),Ee(Object.create(x),{next(){const{value:p,done:w}=x.next();return w?{value:p,done:w}:{value:u?[f(p[0]),f(p[1])]:f(p),done:w}}})}}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=me(l),u=me(r);e||(nt(r,u)&&Ae(a,"get",r),Ae(a,"get",u));const{has:d}=ps(a),x=t?Xs:e?Nt:Je;if(d.call(a,r))return x(l.get(r));if(d.call(a,u))return x(l.get(u));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(me(r),"iterate",Et),r.size},has(r){const l=this.__v_raw,a=me(l),u=me(r);return e||(nt(r,u)&&Ae(a,"has",r),Ae(a,"has",u)),r===u?l.has(r):l.has(r)||l.has(u)},forEach(r,l){const a=this,u=a.__v_raw,d=me(u),x=t?Xs:e?Nt:Je;return!e&&Ae(d,"iterate",Et),u.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=me(this),a=ps(l),u=me(r),d=!t&&!He(r)&&!ht(r)?u:r;return a.has.call(l,d)||nt(r,d)&&a.has.call(l,r)||nt(u,d)&&a.has.call(l,u)||(l.add(d),pt(l,"add",d,d)),this},set(r,l){!t&&!He(l)&&!ht(l)&&(l=me(l));const a=me(this),{has:u,get:d}=ps(a);let x=u.call(a,r);x||(r=me(r),x=u.call(a,r));const f=d.call(a,r);return a.set(r,l),x?nt(l,f)&&pt(a,"set",r,l):pt(a,"add",r,l),this},delete(r){const l=me(this),{has:a,get:u}=ps(l);let d=a.call(l,r);d||(r=me(r),d=a.call(l,r)),u&&u.call(l,r);const x=l.delete(r);return d&&pt(l,"delete",r,void 0),x},clear(){const r=me(this),l=r.size!==0,a=r.clear();return l&&pt(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(xe(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 Yr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(yr(e))}function gn(e){return ht(e)?e:hn(e,!1,Nr,Kr,Oo)}function Gr(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=Yr(e);if(l===0)return e;const a=r.get(e);if(a)return a;const u=new Proxy(e,l===2?o:s);return r.set(e,u),u}function At(e){return ht(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function ht(e){return!!(e&&e.__v_isReadonly)}function He(e){return!!(e&&e.__v_isShallow)}function bn(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Zr(e){return!xe(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Je=e=>he(e)?gn(e):e,Nt=e=>he(e)?en(e):e;function Oe(e){return e?e.__v_isRef===!0:!1}function k(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:me(t),this._value=s?t:Je(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)||ht(t);t=o?t:me(t),nt(t,s)&&(this._rawValue=t,this._value=o?t:Je(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=ye){const{immediate:o,deep:r,once:l,scheduler:a,augmentJob:u,call:d}=s,x=O=>r?O:He(O)||r===!1||r===0?mt(O,1):mt(O);let f,p,w,T,P=!1,C=!1;if(Oe(e)?(p=()=>e.value,P=He(e)):At(e)?(p=()=>x(e),P=!0):re(e)?(C=!0,P=e.some(O=>At(O)||He(O)),p=()=>e.map(O=>{if(Oe(O))return O.value;if(At(O))return x(O);if(ae(O))return d?d(O,2):O()})):ae(e)?t?p=d?()=>d(e,2):e:p=()=>{if(w){vt();try{w()}finally{gt()}}const O=Pt;Pt=f;try{return d?d(e,3,[T]):e(T)}finally{Pt=O}}:p=ot,t&&r){const O=p,G=r===!0?1/0:r;p=()=>mt(O(),G)}const N=Ir(),S=()=>{f.stop(),N&&N.active&&un(N.effects,f)};if(l&&t){const O=t;t=(...G)=>{O(...G),S()}}let A=C?new Array(e.length).fill(xs):xs;const j=O=>{if(!(!(f.flags&1)||!f.dirty&&!O))if(t){const G=f.run();if(r||P||(C?G.some((oe,ne)=>nt(oe,A[ne])):nt(G,A))){w&&w();const oe=Pt;Pt=f;try{const ne=[G,A===xs?void 0:C&&A[0]===xs?[]:A,T];A=G,d?d(t,3,ne):t(...ne)}finally{Pt=oe}}}else f.run()};return u&&u(j),f=new _o(p),f.scheduler=a?()=>a(j,!1):j,T=O=>ol(O,!1,f),w=f.onStop=()=>{const O=ws.get(f);if(O){if(d)d(O,4);else for(const G of O)G();ws.delete(f)}},t?o?j(!0):A=f.run():a?a(j.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function mt(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))mt(e.value,t,s);else if(re(e))for(let o=0;o<e.length;o++)mt(e[o],t,s);else if(Ft(e)||jt(e))e.forEach(o=>{mt(o,t,s)});else if(vo(e)){for(const o in e)mt(e[o],t,s);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&mt(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 ps(e,t,n,o){try{return o?e(...o):e()}catch(r){js(r,t,n)}}function ut(e,t,n,o){if(xe(e)){const r=ps(e,t,n,o);return r&&vo(r)&&r.catch(a=>{js(a,t,n)}),r}if(de(e)){const r=[];for(let a=0;a<e.length;a++)r.push(ut(e[a],t,n,o));return r}}function js(e,t,n,o=!0){const r=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||$e;if(t){let i=t.parent;const c=t.proxy,v=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const f=i.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,c,v)===!1)return}i=i.parent}if(a){ht(),ps(a,null,10,[e,c,v]),yt();return}}la(e,n,r,o,l)}function la(e,t,n,o=!0,r=!1){if(r)throw e;console.error(e)}const Ne=[];let nt=-1;const Nt=[];let St=null,Lt=0;const Uo=Promise.resolve();let Ss=null;function No(e){const t=Ss||Uo;return e?t.then(this?e.bind(this):e):t}function ia(e){let t=nt+1,n=Ne.length;for(;t<n;){const o=t+n>>>1,r=Ne[o],a=is(r);a<e||a===e&&r.flags&2?t=o+1:n=o}return t}function kn(e){if(!(e.flags&1)){const t=is(e),n=Ne[Ne.length-1];!n||!(e.flags&2)&&t>=is(n)?Ne.push(e):Ne.splice(ia(t),0,e),e.flags|=1,Vo()}}function Vo(){Ss||(Ss=Uo.then(Ho))}function da(e){de(e)?Nt.push(...e):St&&e.id===-1?St.splice(Lt+1,0,e):e.flags&1||(Nt.push(e),e.flags|=1),Vo()}function jn(e,t,n=nt+1){for(;n<Ne.length;n++){const o=Ne[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Ne.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Bo(e){if(Nt.length){const t=[...new Set(Nt)].sort((n,o)=>is(n)-is(o));if(Nt.length=0,St){St.push(...t);return}for(St=t,Lt=0;Lt<St.length;Lt++){const n=St[Lt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}St=null,Lt=0}}const is=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ho(e){try{for(nt=0;nt<Ne.length;nt++){const t=Ne[nt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ps(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;nt<Ne.length;nt++){const t=Ne[nt];t&&(t.flags&=-2)}nt=-1,Ne.length=0,Bo(),Ss=null,(Ne.length||Nt.length)&&Ho()}}let Ke=null,Fo=null;function Cs(e){const t=Ke;return Ke=e,Fo=e&&e.type.__scopeId||null,t}function ua(e,t=Ke,n){if(!t||e._n)return e;const o=(...r)=>{o._d&&Gn(-1);const a=Cs(t);let l;try{l=e(...r)}finally{Cs(a),o._d&&Gn(1)}return l};return o._n=!0,o._c=!0,o._d=!0,o}function F(e,t){if(Ke===null)return e;const n=Hs(Ke),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[a,l,i,c=$e]=t[r];a&&(xe(a)&&(a={mounted:a,updated:a}),a.deep&&vt(l),o.push({dir:a,instance:n,value:l,oldValue:void 0,arg:i,modifiers:c}))}return e}function Et(e,t,n,o){const r=e.dirs,a=t&&t.dirs;for(let l=0;l<r.length;l++){const i=r[l];a&&(i.oldValue=a[l].value);let c=i.dir[o];c&&(ht(),ut(c,n,8,[e.el,i,e,t]),yt())}}function ca(e,t){if(Le){let n=Le.provides;const o=Le.parent&&Le.parent.provides;o===n&&(n=Le.provides=Object.create(o)),n[e]=t}}function ys(e,t,n=!1){const o=cl();if(o||Vt){let r=Vt?Vt._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 n&&xe(t)?t.call(o&&o.proxy):t}}const fa=Symbol.for("v-scx"),pa=()=>ys(fa);function qs(e,t,n){return Ko(e,t,n)}function Ko(e,t,n=$e){const{immediate:o,deep:r,flush:a,once:l}=n,i=Me({},n),c=t&&o||!t&&a!=="post";let v;if(us){if(a==="sync"){const S=pa();v=S.__watcherHandles||(S.__watcherHandles=[])}else if(!c){const S=()=>{};return S.stop=it,S.resume=it,S.pause=it,S}}const f=Le;i.call=(S,E,y)=>ut(S,f,E,y);let p=!1;a==="post"?i.scheduler=S=>{Be(S,f&&f.suspense)}:a!=="sync"&&(p=!0,i.scheduler=(S,E)=>{E?S():kn(S)}),i.augmentJob=S=>{t&&(S.flags|=4),p&&(S.flags|=2,f&&(S.id=f.uid,S.i=f))};const k=aa(e,t,i);return us&&(v?v.push(k):c&&k()),k}function ma(e,t,n){const o=this.proxy,r=Pe(e)?e.includes(".")?Wo(o,e):()=>o[e]:e.bind(o,o);let a;xe(t)?a=t:(a=t.handler,n=t);const l=ms(this),i=Ko(r,a.bind(o),n);return l(),i}function Wo(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;r<n.length&&o;r++)o=o[n[r]];return o}}const xa=Symbol("_vte"),va=e=>e.__isTeleport,ga=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 Oe(e,t){return xe(e)?Me({name:e.name},t,{setup:e}):e}function zo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Un(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ts=new WeakMap;function ss(e,t,n,o,r=!1){if(de(e)){e.forEach((y,H)=>ss(y,t&&(de(t)?t[H]:t),n,o,r));return}if(ns(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&ss(e,t,n,o.component.subTree);return}const a=o.shapeFlag&4?Hs(o.component):o.el,l=r?null:a,{i,r:c}=e,v=t&&t.r,f=i.refs===$e?i.refs={}:i.refs,p=i.setupState,k=ye(p),S=p===$e?xo:y=>Un(f,y)?!1:_e(k,y),E=(y,H)=>!(H&&Un(f,H));if(v!=null&&v!==c){if(Nn(t),Pe(v))f[v]=null,S(v)&&(p[v]=null);else if(je(v)){const y=t;E(v,y.k)&&(v.value=null),y.k&&(f[y.k]=null)}}if(xe(c))ps(c,i,12,[l,f]);else{const y=Pe(c),H=je(c);if(y||H){const C=()=>{if(e.f){const M=y?S(c)?p[c]:f[c]:E()||!e.k?c.value:f[e.k];if(r)de(M)&&fn(M,a);else if(de(M))M.includes(a)||M.push(a);else if(y)f[c]=[a],S(c)&&(p[c]=f[c]);else{const L=[a];E(c,e.k)&&(c.value=L),e.k&&(f[e.k]=L)}}else y?(f[c]=l,S(c)&&(p[c]=l)):H&&(E(c,e.k)&&(c.value=l),e.k&&(f[e.k]=l))};if(l){const M=()=>{C(),Ts.delete(e)};M.id=-1,Ts.set(e,M),Be(M,n)}else Nn(e),C()}}}function Nn(e){const t=Ts.get(e);t&&(t.flags|=8,Ts.delete(e))}Rs().requestIdleCallback;Rs().cancelIdleCallback;const ns=e=>!!e.type.__asyncLoader,Jo=e=>e.type.__isKeepAlive;function ba(e,t){qo(e,"a",t)}function ha(e,t){qo(e,"da",t)}function qo(e,t,n=Le){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Us(t,o,n),n){let r=n.parent;for(;r&&r.parent;)Jo(r.parent.vnode)&&ya(o,t,n,r),r=r.parent}}function ya(e,t,n,o){const r=Us(t,e,o,!0);Ns(()=>{fn(o[t],r)},n)}function Us(e,t,n=Le,o=!1){if(n){const r=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...l)=>{ht();const i=ms(n),c=ut(t,n,e,l);return i(),yt(),c});return o?r.unshift(a):r.push(a),a}}const wt=e=>(t,n=Le)=>{(!us||e==="sp")&&Us(e,(...o)=>t(...o),n)},_a=wt("bm"),De=wt("m"),wa=wt("bu"),ka=wt("u"),$a=wt("bum"),Ns=wt("um"),Sa=wt("sp"),Ca=wt("rtg"),Ta=wt("rtc");function Pa(e,t=Le){Us("ec",e,t)}const Ea="components",Go=Symbol.for("v-ndc");function Ia(e){return Pe(e)?Aa(Ea,e,!1)||e:e||Go}function Aa(e,t,n=!0,o=!1){const r=Ke||Le;if(r){const a=r.type;{const i=vl(a,!1);if(i&&(i===t||i===Ve(t)||i===Os(Ve(t))))return a}const l=Vn(r[e]||a[e],t)||Vn(r.appContext[e],t);return!l&&o?a:l}}function Vn(e,t){return e&&(e[t]||e[Ve(t)]||e[Os(Ve(t))])}function me(e,t,n,o){let r;const a=n,l=de(e);if(l||Pe(e)){const i=l&&Ot(e);let c=!1,v=!1;i&&(c=!ze(e),v=_t(e),e=Ls(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(c?v?Bt(Ze(e[f])):Ze(e[f]):e[f],f,void 0,a)}else if(typeof e=="number"){r=new Array(e);for(let i=0;i<e;i++)r[i]=t(i+1,i,void 0,a)}else if(we(e))if(e[Symbol.iterator])r=Array.from(e,(i,c)=>t(i,c,void 0,a));else{const i=Object.keys(e);r=new Array(i.length);for(let c=0,v=i.length;c<v;c++){const f=i[c];r[c]=t(e[f],f,c,a)}}else r=[];return r}const on=e=>e?vr(e)?Hs(e):on(e.parent):null,os=Me(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=>on(e.parent),$root:e=>on(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Zo(e),$forceUpdate:e=>e.f||(e.f=()=>{kn(e.update)}),$nextTick:e=>e.n||(e.n=No.bind(e.proxy)),$watch:e=>ma.bind(e)}),Gs=(e,t)=>e!==$e&&!e.__isScriptSetup&&_e(e,t),Ma={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:a,accessCache:l,type:i,appContext:c}=e;if(t[0]!=="$"){const k=l[t];if(k!==void 0)switch(k){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return a[t]}else{if(Gs(o,t))return l[t]=1,o[t];if(r!==$e&&_e(r,t))return l[t]=2,r[t];if(_e(a,t))return l[t]=3,a[t];if(n!==$e&&_e(n,t))return l[t]=4,n[t];rn&&(l[t]=0)}}const v=os[t];let f,p;if(v)return t==="$attrs"&&Re(e.attrs,"get",""),v(e);if((f=i.__cssModules)&&(f=f[t]))return f;if(n!==$e&&_e(n,t))return l[t]=4,n[t];if(p=c.config.globalProperties,_e(p,t))return p[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:a}=e;return Gs(r,t)?(r[t]=n,!0):o!==$e&&_e(o,t)?(o[t]=n,!0):_e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,props:a,type:l}},i){let c;return!!(n[i]||e!==$e&&i[0]!=="$"&&_e(e,i)||Gs(t,i)||_e(a,i)||_e(o,i)||_e(os,i)||_e(r.config.globalProperties,i)||(c=l.__cssModules)&&c[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:_e(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Bn(e){return de(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let rn=!0;function Oa(e){const t=Zo(e),n=e.proxy,o=e.ctx;rn=!1,t.beforeCreate&&Hn(t.beforeCreate,e,"bc");const{data:r,computed:a,methods:l,watch:i,provide:c,inject:v,created:f,beforeMount:p,mounted:k,beforeUpdate:S,updated:E,activated:y,deactivated:H,beforeDestroy:C,beforeUnmount:M,destroyed:L,unmounted:D,render:X,renderTracked:te,renderTriggered:re,errorCaptured:pe,serverPrefetch:be,expose:ne,inheritAttrs:$,components:h,directives:_,filters:I}=t;if(v&&Da(v,o,null),l)for(const ue in l){const oe=l[ue];xe(oe)&&(o[ue]=oe.bind(n))}if(r){const ue=r.call(n,n);we(ue)&&(e.data=yn(ue))}if(rn=!0,a)for(const ue in a){const oe=a[ue],O=xe(oe)?oe.bind(n,n):xe(oe.get)?oe.get.bind(n,n):it,P=!xe(oe)&&xe(oe.set)?oe.set.bind(n):it,z=Te({get:O,set:P});Object.defineProperty(o,ue,{enumerable:!0,configurable:!0,get:()=>z.value,set:ve=>z.value=ve})}if(i)for(const ue in i)Yo(i[ue],o,n,ue);if(c){const ue=xe(c)?c.call(n):c;Reflect.ownKeys(ue).forEach(oe=>{ca(oe,ue[oe])})}f&&Hn(f,e,"c");function W(ue,oe){de(oe)?oe.forEach(O=>ue(O.bind(n))):oe&&ue(oe.bind(n))}if(W(_a,p),W(De,k),W(wa,S),W(ka,E),W(ba,y),W(ha,H),W(Pa,pe),W(Ta,te),W(Ca,re),W($a,M),W(Ns,D),W(Sa,be),de(ne))if(ne.length){const ue=e.exposed||(e.exposed={});ne.forEach(oe=>{Object.defineProperty(ue,oe,{get:()=>n[oe],set:O=>n[oe]=O,enumerable:!0})})}else e.exposed||(e.exposed={});X&&e.render===it&&(e.render=X),$!=null&&(e.inheritAttrs=$),h&&(e.components=h),_&&(e.directives=_),be&&zo(e)}function Da(e,t,n=it){de(e)&&(e=an(e));for(const o in e){const r=e[o];let a;we(r)?"default"in r?a=ys(r.from||o,r.default,!0):a=ys(r.from||o):a=ys(r),je(a)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):t[o]=a}}function Hn(e,t,n){ut(de(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Yo(e,t,n,o){let r=o.includes(".")?Wo(n,o):()=>n[o];if(Pe(e)){const a=t[e];xe(a)&&qs(r,a)}else if(xe(e))qs(r,e.bind(n));else if(we(e))if(de(e))e.forEach(a=>Yo(a,t,n,o));else{const a=xe(e.handler)?e.handler.bind(n):t[e.handler];xe(a)&&qs(r,a,e)}}function Zo(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:a,config:{optionMergeStrategies:l}}=e.appContext,i=a.get(t);let c;return i?c=i:!r.length&&!n&&!o?c=t:(c={},r.length&&r.forEach(v=>Ps(c,v,l,!0)),Ps(c,t,l)),we(t)&&a.set(t,c),c}function Ps(e,t,n,o=!1){const{mixins:r,extends:a}=t;a&&Ps(e,a,n,!0),r&&r.forEach(l=>Ps(e,l,n,!0));for(const l in t)if(!(o&&l==="expose")){const i=Ra[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const Ra={data:Fn,props:Kn,emits:Kn,methods:Qt,computed:Qt,beforeCreate:Ue,created:Ue,beforeMount:Ue,mounted:Ue,beforeUpdate:Ue,updated:Ue,beforeDestroy:Ue,beforeUnmount:Ue,destroyed:Ue,unmounted:Ue,activated:Ue,deactivated:Ue,errorCaptured:Ue,serverPrefetch:Ue,components:Qt,directives:Qt,watch:ja,provide:Fn,inject:La};function Fn(e,t){return t?e?function(){return Me(xe(e)?e.call(this,this):e,xe(t)?t.call(this,this):t)}:t:e}function La(e,t){return Qt(an(e),an(t))}function an(e){if(de(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ue(e,t){return e?[...new Set([].concat(e,t))]:t}function Qt(e,t){return e?Me(Object.create(null),e,t):t}function Kn(e,t){return e?de(e)&&de(t)?[...new Set([...e,...t])]:Me(Object.create(null),Bn(e),Bn(t??{})):t}function ja(e,t){if(!e)return t;if(!t)return e;const n=Me(Object.create(null),e);for(const o in t)n[o]=Ue(e[o],t[o]);return n}function Qo(){return{app:null,config:{isNativeTag:xo,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 Ua=0;function Na(e,t){return function(o,r=null){xe(o)||(o=Me({},o)),r!=null&&!we(r)&&(r=null);const a=Qo(),l=new WeakSet,i=[];let c=!1;const v=a.app={_uid:Ua++,_component:o,_props:r,_container:null,_context:a,_instance:null,version:bl,get config(){return a.config},set config(f){},use(f,...p){return l.has(f)||(f&&xe(f.install)?(l.add(f),f.install(v,...p)):xe(f)&&(l.add(f),f(v,...p))),v},mixin(f){return a.mixins.includes(f)||a.mixins.push(f),v},component(f,p){return p?(a.components[f]=p,v):a.components[f]},directive(f,p){return p?(a.directives[f]=p,v):a.directives[f]},mount(f,p,k){if(!c){const S=v._ceVNode||Ye(o,r);return S.appContext=a,k===!0?k="svg":k===!1&&(k=void 0),e(S,f,k),c=!0,v._container=f,f.__vue_app__=v,Hs(S.component)}},onUnmount(f){i.push(f)},unmount(){c&&(ut(i,v._instance,16),e(null,v._container),delete v._container.__vue_app__)},provide(f,p){return a.provides[f]=p,v},runWithContext(f){const p=Vt;Vt=v;try{return f()}finally{Vt=p}}};return v}}let Vt=null;const Va=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ve(t)}Modifiers`]||e[`${Pt(t)}Modifiers`];function Ba(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||$e;let r=n;const a=t.startsWith("update:"),l=a&&Va(o,t.slice(7));l&&(l.trim&&(r=n.map(f=>Pe(f)?f.trim():f)),l.number&&(r=n.map(Ds)));let i,c=o[i=Fs(t)]||o[i=Fs(Ve(t))];!c&&a&&(c=o[i=Fs(Pt(t))]),c&&ut(c,e,6,r);const v=o[i+"Once"];if(v){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,ut(v,e,6,r)}}const Ha=new WeakMap;function Xo(e,t,n=!1){const o=n?Ha:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const a=e.emits;let l={},i=!1;if(!xe(e)){const c=v=>{const f=Xo(v,t,!0);f&&(i=!0,Me(l,f))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!a&&!i?(we(e)&&o.set(e,null),null):(de(a)?a.forEach(c=>l[c]=null):Me(l,a),we(e)&&o.set(e,l),l)}function Vs(e,t){return!e||!Is(t)?!1:(t=t.slice(2).replace(/Once$/,""),_e(e,t[0].toLowerCase()+t.slice(1))||_e(e,Pt(t))||_e(e,t))}function Wn(e){const{type:t,vnode:n,proxy:o,withProxy:r,propsOptions:[a],slots:l,attrs:i,emit:c,render:v,renderCache:f,props:p,data:k,setupState:S,ctx:E,inheritAttrs:y}=e,H=Cs(e);let C,M;try{if(n.shapeFlag&4){const D=r||o,X=D;C=at(v.call(X,D,f,p,S,k,E)),M=i}else{const D=t;C=at(D.length>1?D(p,{attrs:i,slots:l,emit:c}):D(p,null)),M=t.props?i:Fa(i)}}catch(D){rs.length=0,js(D,e,1),C=Ye(Tt)}let L=C;if(M&&y!==!1){const D=Object.keys(M),{shapeFlag:X}=L;D.length&&X&7&&(a&&D.some(As)&&(M=Ka(M,a)),L=Ht(L,M,!1,!0))}return n.dirs&&(L=Ht(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition&&$n(L,n.transition),C=L,Cs(H),C}const Fa=e=>{let t;for(const n in e)(n==="class"||n==="style"||Is(n))&&((t||(t={}))[n]=e[n]);return t},Ka=(e,t)=>{const n={};for(const o in e)(!As(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function Wa(e,t,n){const{props:o,children:r,component:a}=e,{props:l,children:i,patchFlag:c}=t,v=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return o?zn(o,l,v):!!l;if(c&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const k=f[p];if(er(l,o,k)&&!Vs(v,k))return!0}}}else return(r||i)&&(!i||!i.$stable)?!0:o===l?!1:o?l?zn(o,l,v):!0:!!l;return!1}function zn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r<o.length;r++){const a=o[r];if(er(t,e,a)&&!Vs(n,a))return!0}return!1}function er(e,t,n){const o=e[n],r=t[n];return n==="style"&&we(o)&&we(r)?!Wt(o,r):o!==r}function za({vnode:e,parent:t,suspense:n},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}n&&n.activeBranch===e&&(n.vnode.el=o)}const tr={},sr=()=>Object.create(tr),nr=e=>Object.getPrototypeOf(e)===tr;function Ja(e,t,n,o=!1){const r={},a=sr();e.propsDefaults=Object.create(null),or(e,t,r,a);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);n?e.props=o?r:Zr(r):e.type.props?e.props=r:e.props=a,e.attrs=a}function qa(e,t,n,o){const{props:r,attrs:a,vnode:{patchFlag:l}}=e,i=ye(r),[c]=e.propsOptions;let v=!1;if((o||l>0)&&!(l&16)){if(l&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let k=f[p];if(Vs(e.emitsOptions,k))continue;const S=t[k];if(c)if(_e(a,k))S!==a[k]&&(a[k]=S,v=!0);else{const E=Ve(k);r[E]=ln(c,i,E,S,e,!1)}else S!==a[k]&&(a[k]=S,v=!0)}}}else{or(e,t,r,a)&&(v=!0);let f;for(const p in i)(!t||!_e(t,p)&&((f=Pt(p))===p||!_e(t,f)))&&(c?n&&(n[p]!==void 0||n[f]!==void 0)&&(r[p]=ln(c,i,p,void 0,e,!0)):delete r[p]);if(a!==i)for(const p in a)(!t||!_e(t,p))&&(delete a[p],v=!0)}v&&xt(e.attrs,"set","")}function or(e,t,n,o){const[r,a]=e.propsOptions;let l=!1,i;if(t)for(let c in t){if(Xt(c))continue;const v=t[c];let f;r&&_e(r,f=Ve(c))?!a||!a.includes(f)?n[f]=v:(i||(i={}))[f]=v:Vs(e.emitsOptions,c)||(!(c in o)||v!==o[c])&&(o[c]=v,l=!0)}if(a){const c=ye(n),v=i||$e;for(let f=0;f<a.length;f++){const p=a[f];n[p]=ln(r,c,p,v[p],e,!_e(v,p))}}return l}function ln(e,t,n,o,r,a){const l=e[n];if(l!=null){const i=_e(l,"default");if(i&&o===void 0){const c=l.default;if(l.type!==Function&&!l.skipFactory&&xe(c)){const{propsDefaults:v}=r;if(n in v)o=v[n];else{const f=ms(r);o=v[n]=c.call(null,t),f()}}else o=c;r.ce&&r.ce._setProp(n,o)}l[0]&&(a&&!i?o=!1:l[1]&&(o===""||o===Pt(n))&&(o=!0))}return o}const Ga=new WeakMap;function rr(e,t,n=!1){const o=n?Ga:t.propsCache,r=o.get(e);if(r)return r;const a=e.props,l={},i=[];let c=!1;if(!xe(e)){const f=p=>{c=!0;const[k,S]=rr(p,t,!0);Me(l,k),S&&i.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!a&&!c)return we(e)&&o.set(e,jt),jt;if(de(a))for(let f=0;f<a.length;f++){const p=Ve(a[f]);Jn(p)&&(l[p]=$e)}else if(a)for(const f in a){const p=Ve(f);if(Jn(p)){const k=a[f],S=l[p]=de(k)||xe(k)?{type:k}:Me({},k),E=S.type;let y=!1,H=!0;if(de(E))for(let C=0;C<E.length;++C){const M=E[C],L=xe(M)&&M.name;if(L==="Boolean"){y=!0;break}else L==="String"&&(H=!1)}else y=xe(E)&&E.name==="Boolean";S[0]=y,S[1]=H,(y||_e(S,"default"))&&i.push(p)}}const v=[l,i];return we(e)&&o.set(e,v),v}function Jn(e){return e[0]!=="$"&&!Xt(e)}const Sn=e=>e==="_"||e==="_ctx"||e==="$stable",Cn=e=>de(e)?e.map(at):[at(e)],Ya=(e,t,n)=>{if(t._n)return t;const o=ua((...r)=>Cn(t(...r)),n);return o._c=!1,o},ar=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Sn(r))continue;const a=e[r];if(xe(a))t[r]=Ya(r,a,o);else if(a!=null){const l=Cn(a);t[r]=()=>l}}},lr=(e,t)=>{const n=Cn(t);e.slots.default=()=>n},ir=(e,t,n)=>{for(const o in t)(n||!Sn(o))&&(e[o]=t[o])},Za=(e,t,n)=>{const o=e.slots=sr();if(e.vnode.shapeFlag&32){const r=t._;r?(ir(o,t,n),n&&ho(o,"_",r,!0)):ar(t,o)}else t&&lr(e,t)},Qa=(e,t,n)=>{const{vnode:o,slots:r}=e;let a=!0,l=$e;if(o.shapeFlag&32){const i=t._;i?n&&i===1?a=!1:ir(r,t,n):(a=!t.$stable,ar(t,r)),l=t}else t&&(lr(e,t),l={default:1});if(a)for(const i in r)!Sn(i)&&l[i]==null&&delete r[i]},Be=nl;function Xa(e){return el(e)}function el(e,t){const n=Rs();n.__VUE__=!0;const{insert:o,remove:r,patchProp:a,createElement:l,createText:i,createComment:c,setText:v,setElementText:f,parentNode:p,nextSibling:k,setScopeId:S=it,insertStaticContent:E}=e,y=(d,u,T,j=null,g=null,N=null,q=void 0,B=null,K=!!u.dynamicChildren)=>{if(d===u)return;d&&!Gt(d,u)&&(j=kt(d),ve(d,g,N,!0),d=null),u.patchFlag===-2&&(K=!1,u.dynamicChildren=null);const{type:V,ref:ie,shapeFlag:Q}=u;switch(V){case Bs:H(d,u,T,j);break;case Tt:C(d,u,T,j);break;case _s:d==null&&M(u,T,j,q);break;case se:h(d,u,T,j,g,N,q,B,K);break;default:Q&1?X(d,u,T,j,g,N,q,B,K):Q&6?_(d,u,T,j,g,N,q,B,K):(Q&64||Q&128)&&V.process(d,u,T,j,g,N,q,B,K,Je)}ie!=null&&g?ss(ie,d&&d.ref,N,u||d,!u):ie==null&&d&&d.ref!=null&&ss(d.ref,null,N,d,!0)},H=(d,u,T,j)=>{if(d==null)o(u.el=i(u.children),T,j);else{const g=u.el=d.el;u.children!==d.children&&v(g,u.children)}},C=(d,u,T,j)=>{d==null?o(u.el=c(u.children||""),T,j):u.el=d.el},M=(d,u,T,j)=>{[d.el,d.anchor]=E(d.children,u,T,j,d.el,d.anchor)},L=({el:d,anchor:u},T,j)=>{let g;for(;d&&d!==u;)g=k(d),o(d,T,j),d=g;o(u,T,j)},D=({el:d,anchor:u})=>{let T;for(;d&&d!==u;)T=k(d),r(d),d=T;r(u)},X=(d,u,T,j,g,N,q,B,K)=>{if(u.type==="svg"?q="svg":u.type==="math"&&(q="mathml"),d==null)te(u,T,j,g,N,q,B,K);else{const V=d.el&&d.el._isVueCE?d.el:null;try{V&&V._beginPatch(),be(d,u,g,N,q,B,K)}finally{V&&V._endPatch()}}},te=(d,u,T,j,g,N,q,B)=>{let K,V;const{props:ie,shapeFlag:Q,transition:ae,dirs:fe}=d;if(K=d.el=l(d.type,N,ie&&ie.is,ie),Q&8?f(K,d.children):Q&16&&pe(d.children,K,null,j,g,Ys(d,N),q,B),fe&&Et(d,null,j,"created"),re(K,d,d.scopeId,q,j),ie){for(const ke in ie)ke!=="value"&&!Xt(ke)&&a(K,ke,null,ie[ke],N,j);"value"in ie&&a(K,"value",null,ie.value,N),(V=ie.onVnodeBeforeMount)&&st(V,j,d)}fe&&Et(d,null,j,"beforeMount");const he=tl(g,ae);he&&ae.beforeEnter(K),o(K,u,T),((V=ie&&ie.onVnodeMounted)||he||fe)&&Be(()=>{try{V&&st(V,j,d),he&&ae.enter(K),fe&&Et(d,null,j,"mounted")}finally{}},g)},re=(d,u,T,j,g)=>{if(T&&S(d,T),j)for(let N=0;N<j.length;N++)S(d,j[N]);if(g){let N=g.subTree;if(u===N||fr(N.type)&&(N.ssContent===u||N.ssFallback===u)){const q=g.vnode;re(d,q,q.scopeId,q.slotScopeIds,g.parent)}}},pe=(d,u,T,j,g,N,q,B,K=0)=>{for(let V=K;V<d.length;V++){const ie=d[V]=B?mt(d[V]):at(d[V]);y(null,ie,u,T,j,g,N,q,B)}},be=(d,u,T,j,g,N,q)=>{const B=u.el=d.el;let{patchFlag:K,dynamicChildren:V,dirs:ie}=u;K|=d.patchFlag&16;const Q=d.props||$e,ae=u.props||$e;let fe;if(T&&It(T,!1),(fe=ae.onVnodeBeforeUpdate)&&st(fe,T,u,d),ie&&Et(u,d,T,"beforeUpdate"),T&&It(T,!0),(Q.innerHTML&&ae.innerHTML==null||Q.textContent&&ae.textContent==null)&&f(B,""),V?ne(d.dynamicChildren,V,B,T,j,Ys(u,g),N):q||oe(d,u,B,null,T,j,Ys(u,g),N,!1),K>0){if(K&16)$(B,Q,ae,T,g);else if(K&2&&Q.class!==ae.class&&a(B,"class",null,ae.class,g),K&4&&a(B,"style",Q.style,ae.style,g),K&8){const he=u.dynamicProps;for(let ke=0;ke<he.length;ke++){const Se=he[ke],Ee=Q[Se],Ae=ae[Se];(Ae!==Ee||Se==="value")&&a(B,Se,Ee,Ae,g,T)}}K&1&&d.children!==u.children&&f(B,u.children)}else!q&&V==null&&$(B,Q,ae,T,g);((fe=ae.onVnodeUpdated)||ie)&&Be(()=>{fe&&st(fe,T,u,d),ie&&Et(u,d,T,"updated")},j)},ne=(d,u,T,j,g,N,q)=>{for(let B=0;B<u.length;B++){const K=d[B],V=u[B],ie=K.el&&(K.type===se||!Gt(K,V)||K.shapeFlag&198)?p(K.el):T;y(K,V,ie,null,j,g,N,q,!0)}},$=(d,u,T,j,g)=>{if(u!==T){if(u!==$e)for(const N in u)!Xt(N)&&!(N in T)&&a(d,N,u[N],null,g,j);for(const N in T){if(Xt(N))continue;const q=T[N],B=u[N];q!==B&&N!=="value"&&a(d,N,B,q,g,j)}"value"in T&&a(d,"value",u.value,T.value,g)}},h=(d,u,T,j,g,N,q,B,K)=>{const V=u.el=d?d.el:i(""),ie=u.anchor=d?d.anchor:i("");let{patchFlag:Q,dynamicChildren:ae,slotScopeIds:fe}=u;fe&&(B=B?B.concat(fe):fe),d==null?(o(V,T,j),o(ie,T,j),pe(u.children||[],T,ie,g,N,q,B,K)):Q>0&&Q&64&&ae&&d.dynamicChildren&&d.dynamicChildren.length===ae.length?(ne(d.dynamicChildren,ae,T,g,N,q,B),(u.key!=null||g&&u===g.subTree)&&dr(d,u,!0)):oe(d,u,T,ie,g,N,q,B,K)},_=(d,u,T,j,g,N,q,B,K)=>{u.slotScopeIds=B,d==null?u.shapeFlag&512?g.ctx.activate(u,T,j,q,K):I(u,T,j,g,N,q,K):R(d,u,K)},I=(d,u,T,j,g,N,q)=>{const B=d.component=ul(d,j,g);if(Jo(d)&&(B.ctx.renderer=Je),fl(B,!1,q),B.asyncDep){if(g&&g.registerDep(B,W,q),!d.el){const K=B.subTree=Ye(Tt);C(null,K,u,T),d.placeholder=K.el}}else W(B,d,u,T,g,N,q)},R=(d,u,T)=>{const j=u.component=d.component;if(Wa(d,u,T))if(j.asyncDep&&!j.asyncResolved){ue(j,u,T);return}else j.next=u,j.update();else u.el=d.el,j.vnode=u},W=(d,u,T,j,g,N,q)=>{const B=()=>{if(d.isMounted){let{next:Q,bu:ae,u:fe,parent:he,vnode:ke}=d;{const et=ur(d);if(et){Q&&(Q.el=ke.el,ue(d,Q,q)),et.asyncDep.then(()=>{Be(()=>{d.isUnmounted||V()},g)});return}}let Se=Q,Ee;It(d,!1),Q?(Q.el=ke.el,ue(d,Q,q)):Q=ke,ae&&hs(ae),(Ee=Q.props&&Q.props.onVnodeBeforeUpdate)&&st(Ee,he,Q,ke),It(d,!0);const Ae=Wn(d),Xe=d.subTree;d.subTree=Ae,y(Xe,Ae,p(Xe.el),kt(Xe),d,g,N),Q.el=Ae.el,Se===null&&za(d,Ae.el),fe&&Be(fe,g),(Ee=Q.props&&Q.props.onVnodeUpdated)&&Be(()=>st(Ee,he,Q,ke),g)}else{let Q;const{el:ae,props:fe}=u,{bm:he,m:ke,parent:Se,root:Ee,type:Ae}=d,Xe=ns(u);It(d,!1),he&&hs(he),!Xe&&(Q=fe&&fe.onVnodeBeforeMount)&&st(Q,Se,u),It(d,!0);{Ee.ce&&Ee.ce._hasShadowRoot()&&Ee.ce._injectChildStyle(Ae,d.parent?d.parent.type:void 0);const et=d.subTree=Wn(d);y(null,et,T,j,d,g,N),u.el=et.el}if(ke&&Be(ke,g),!Xe&&(Q=fe&&fe.onVnodeMounted)){const et=u;Be(()=>st(Q,Se,et),g)}(u.shapeFlag&256||Se&&ns(Se.vnode)&&Se.vnode.shapeFlag&256)&&d.a&&Be(d.a,g),d.isMounted=!0,u=T=j=null}};d.scope.on();const K=d.effect=new ko(B);d.scope.off();const V=d.update=K.run.bind(K),ie=d.job=K.runIfDirty.bind(K);ie.i=d,ie.id=d.uid,K.scheduler=()=>kn(ie),It(d,!0),V()},ue=(d,u,T)=>{u.component=d;const j=d.vnode.props;d.vnode=u,d.next=null,qa(d,u.props,j,T),Qa(d,u.children,T),ht(),jn(d),yt()},oe=(d,u,T,j,g,N,q,B,K=!1)=>{const V=d&&d.children,ie=d?d.shapeFlag:0,Q=u.children,{patchFlag:ae,shapeFlag:fe}=u;if(ae>0){if(ae&128){P(V,Q,T,j,g,N,q,B,K);return}else if(ae&256){O(V,Q,T,j,g,N,q,B,K);return}}fe&8?(ie&16&&Qe(V,g,N),Q!==V&&f(T,Q)):ie&16?fe&16?P(V,Q,T,j,g,N,q,B,K):Qe(V,g,N,!0):(ie&8&&f(T,""),fe&16&&pe(Q,T,j,g,N,q,B,K))},O=(d,u,T,j,g,N,q,B,K)=>{d=d||jt,u=u||jt;const V=d.length,ie=u.length,Q=Math.min(V,ie);let ae;for(ae=0;ae<Q;ae++){const fe=u[ae]=K?mt(u[ae]):at(u[ae]);y(d[ae],fe,T,null,g,N,q,B,K)}V>ie?Qe(d,g,N,!0,!1,Q):pe(u,T,j,g,N,q,B,K,Q)},P=(d,u,T,j,g,N,q,B,K)=>{let V=0;const ie=u.length;let Q=d.length-1,ae=ie-1;for(;V<=Q&&V<=ae;){const fe=d[V],he=u[V]=K?mt(u[V]):at(u[V]);if(Gt(fe,he))y(fe,he,T,null,g,N,q,B,K);else break;V++}for(;V<=Q&&V<=ae;){const fe=d[Q],he=u[ae]=K?mt(u[ae]):at(u[ae]);if(Gt(fe,he))y(fe,he,T,null,g,N,q,B,K);else break;Q--,ae--}if(V>Q){if(V<=ae){const fe=ae+1,he=fe<ie?u[fe].el:j;for(;V<=ae;)y(null,u[V]=K?mt(u[V]):at(u[V]),T,he,g,N,q,B,K),V++}}else if(V>ae)for(;V<=Q;)ve(d[V],g,N,!0),V++;else{const fe=V,he=V,ke=new Map;for(V=he;V<=ae;V++){const Fe=u[V]=K?mt(u[V]):at(u[V]);Fe.key!=null&&ke.set(Fe.key,V)}let Se,Ee=0;const Ae=ae-he+1;let Xe=!1,et=0;const Jt=new Array(Ae);for(V=0;V<Ae;V++)Jt[V]=0;for(V=fe;V<=Q;V++){const Fe=d[V];if(Ee>=Ae){ve(Fe,g,N,!0);continue}let tt;if(Fe.key!=null)tt=ke.get(Fe.key);else for(Se=he;Se<=ae;Se++)if(Jt[Se-he]===0&&Gt(Fe,u[Se])){tt=Se;break}tt===void 0?ve(Fe,g,N,!0):(Jt[tt-he]=V+1,tt>=et?et=tt:Xe=!0,y(Fe,u[tt],T,null,g,N,q,B,K),Ee++)}const In=Xe?sl(Jt):jt;for(Se=In.length-1,V=Ae-1;V>=0;V--){const Fe=he+V,tt=u[Fe],An=u[Fe+1],Mn=Fe+1<ie?An.el||cr(An):j;Jt[V]===0?y(null,tt,T,Mn,g,N,q,B,K):Xe&&(Se<0||V!==In[Se]?z(tt,T,Mn,2):Se--)}}},z=(d,u,T,j,g=null)=>{const{el:N,type:q,transition:B,children:K,shapeFlag:V}=d;if(V&6){z(d.component.subTree,u,T,j);return}if(V&128){d.suspense.move(u,T,j);return}if(V&64){q.move(d,u,T,Je);return}if(q===se){o(N,u,T);for(let Q=0;Q<K.length;Q++)z(K[Q],u,T,j);o(d.anchor,u,T);return}if(q===_s){L(d,u,T);return}if(j!==2&&V&1&&B)if(j===0)B.beforeEnter(N),o(N,u,T),Be(()=>B.enter(N),g);else{const{leave:Q,delayLeave:ae,afterLeave:fe}=B,he=()=>{d.ctx.isUnmounted?r(N):o(N,u,T)},ke=()=>{N._isLeaving&&N[ga](!0),Q(N,()=>{he(),fe&&fe()})};ae?ae(N,he,ke):ke()}else o(N,u,T)},ve=(d,u,T,j=!1,g=!1)=>{const{type:N,props:q,ref:B,children:K,dynamicChildren:V,shapeFlag:ie,patchFlag:Q,dirs:ae,cacheIndex:fe,memo:he}=d;if(Q===-2&&(g=!1),B!=null&&(ht(),ss(B,null,T,d,!0),yt()),fe!=null&&(u.renderCache[fe]=void 0),ie&256){u.ctx.deactivate(d);return}const ke=ie&1&&ae,Se=!ns(d);let Ee;if(Se&&(Ee=q&&q.onVnodeBeforeUnmount)&&st(Ee,u,d),ie&6)Z(d.component,T,j);else{if(ie&128){d.suspense.unmount(T,j);return}ke&&Et(d,null,u,"beforeUnmount"),ie&64?d.type.remove(d,u,T,Je,j):V&&!V.hasOnce&&(N!==se||Q>0&&Q&64)?Qe(V,u,T,!1,!0):(N===se&&Q&384||!g&&ie&16)&&Qe(K,u,T),j&&le(d)}const Ae=he!=null&&fe==null;(Se&&(Ee=q&&q.onVnodeUnmounted)||ke||Ae)&&Be(()=>{Ee&&st(Ee,u,d),ke&&Et(d,null,u,"unmounted"),Ae&&(d.el=null)},T)},le=d=>{const{type:u,el:T,anchor:j,transition:g}=d;if(u===se){A(T,j);return}if(u===_s){D(d);return}const N=()=>{r(T),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(d.shapeFlag&1&&g&&!g.persisted){const{leave:q,delayLeave:B}=g,K=()=>q(T,N);B?B(d.el,N,K):K()}else N()},A=(d,u)=>{let T;for(;d!==u;)T=k(d),r(d),d=T;r(u)},Z=(d,u,T)=>{const{bum:j,scope:g,job:N,subTree:q,um:B,m:K,a:V}=d;qn(K),qn(V),j&&hs(j),g.stop(),N&&(N.flags|=8,ve(q,d,u,T)),B&&Be(B,u),Be(()=>{d.isUnmounted=!0},u)},Qe=(d,u,T,j=!1,g=!1,N=0)=>{for(let q=N;q<d.length;q++)ve(d[q],u,T,j,g)},kt=d=>{if(d.shapeFlag&6)return kt(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const u=k(d.anchor||d.el),T=u&&u[xa];return T?k(T):u};let zt=!1;const $t=(d,u,T)=>{let j;d==null?u._vnode&&(ve(u._vnode,null,null,!0),j=u._vnode.component):y(u._vnode||null,d,u,null,null,null,T),u._vnode=d,zt||(zt=!0,jn(j),Bo(),zt=!1)},Je={p:y,um:ve,m:z,r:le,mt:I,mc:pe,pc:oe,pbc:ne,n:kt,o:e};return{render:$t,hydrate:void 0,createApp:Na($t)}}function Ys({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function It({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function tl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function dr(e,t,n=!1){const o=e.children,r=t.children;if(de(o)&&de(r))for(let a=0;a<o.length;a++){const l=o[a];let i=r[a];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=r[a]=mt(r[a]),i.el=l.el),!n&&i.patchFlag!==-2&&dr(l,i)),i.type===Bs&&(i.patchFlag===-1&&(i=r[a]=mt(i)),i.el=l.el),i.type===Tt&&!i.el&&(i.el=l.el)}}function sl(e){const t=e.slice(),n=[0];let o,r,a,l,i;const c=e.length;for(o=0;o<c;o++){const v=e[o];if(v!==0){if(r=n[n.length-1],e[r]<v){t[o]=r,n.push(o);continue}for(a=0,l=n.length-1;a<l;)i=a+l>>1,e[n[i]]<v?a=i+1:l=i;v<e[n[a]]&&(a>0&&(t[o]=n[a-1]),n[a]=o)}}for(a=n.length,l=n[a-1];a-- >0;)n[a]=l,l=t[l];return n}function ur(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ur(t)}function qn(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 fr=e=>e.__isSuspense;function nl(e,t){t&&t.pendingBranch?de(e)?t.effects.push(...e):t.effects.push(e):da(e)}const se=Symbol.for("v-fgt"),Bs=Symbol.for("v-txt"),Tt=Symbol.for("v-cmt"),_s=Symbol.for("v-stc"),rs=[];let We=null;function m(e=!1){rs.push(We=e?null:[])}function ol(){rs.pop(),We=rs[rs.length-1]||null}let ds=1;function Gn(e,t=!1){ds+=e,e<0&&We&&t&&(We.hasOnce=!0)}function pr(e){return e.dynamicChildren=ds>0?We||jt:null,ol(),ds>0&&We&&We.push(e),e}function x(e,t,n,o,r,a){return pr(s(e,t,n,o,r,a,!0))}function Tn(e,t,n,o,r){return pr(Ye(e,t,n,o,r,!0))}function mr(e){return e?e.__v_isVNode===!0:!1}function Gt(e,t){return e.type===t.type&&e.key===t.key}const xr=({key:e})=>e??null,ws=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Pe(e)||je(e)||xe(e)?{i:Ke,r:e,k:t,f:!!n}:e:null);function s(e,t=null,n=null,o=0,r=null,a=e===se?0:1,l=!1,i=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xr(t),ref:t&&ws(t),scopeId:Fo,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ke};return i?(Pn(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=Pe(n)?8:16),ds>0&&!l&&We&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&We.push(c),c}const Ye=rl;function rl(e,t=null,n=null,o=0,r=null,a=!1){if((!e||e===Go)&&(e=Tt),mr(e)){const i=Ht(e,t,!0);return n&&Pn(i,n),ds>0&&!a&&We&&(i.shapeFlag&6?We[We.indexOf(e)]=i:We.push(i)),i.patchFlag=-2,i}if(gl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:i,style:c}=t;i&&!Pe(i)&&(t.class=G(i)),we(c)&&(wn(c)&&!de(c)&&(c=Me({},c)),t.style=bt(c))}const l=Pe(e)?1:fr(e)?128:va(e)?64:we(e)?4:xe(e)?2:0;return s(e,t,n,o,r,l,a,!0)}function al(e){return e?wn(e)||nr(e)?Me({},e):e:null}function Ht(e,t,n=!1,o=!1){const{props:r,ref:a,patchFlag:l,children:i,transition:c}=e,v=t?ll(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:v,key:v&&xr(v),ref:t&&t.ref?n&&a?de(a)?a.concat(ws(t)):[a,ws(t)]:ws(t):a,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!==se?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ht(e.ssContent),ssFallback:e.ssFallback&&Ht(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&o&&$n(f,c.clone(f)),f}function Y(e=" ",t=0){return Ye(Bs,null,e,t)}function pt(e,t){const n=Ye(_s,null,e);return n.staticCount=t,n}function U(e="",t=!1){return t?(m(),Tn(Tt,null,e)):Ye(Tt,null,e)}function at(e){return e==null||typeof e=="boolean"?Ye(Tt):de(e)?Ye(se,null,e.slice()):mr(e)?mt(e):Ye(Bs,null,String(e))}function mt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ht(e)}function Pn(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(de(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Pn(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!nr(t)?t._ctx=Ke:r===3&&Ke&&(Ke.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else xe(t)?(t={default:t,_ctx:Ke},n=32):(t=String(t),o&64?(n=16,t=[Y(t)]):n=8);e.children=t,e.shapeFlag|=n}function ll(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const r in o)if(r==="class")t.class!==o.class&&(t.class=G([t.class,o.class]));else if(r==="style")t.style=bt([t.style,o.style]);else if(Is(r)){const a=t[r],l=o[r];l&&a!==l&&!(de(a)&&a.includes(l))?t[r]=a?[].concat(a,l):l:l==null&&a==null&&!As(r)&&(t[r]=l)}else r!==""&&(t[r]=o[r])}return t}function st(e,t,n,o=null){ut(e,t,7,[n,o])}const il=Qo();let dl=0;function ul(e,t,n){const o=e.type,r=(t?t.appContext:e.appContext)||il,a={uid:dl++,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:rr(o,r),emitsOptions:Xo(o,r),emit:null,emitted:null,propsDefaults:$e,inheritAttrs:o.inheritAttrs,ctx:$e,data:$e,props:$e,attrs:$e,slots:$e,refs:$e,setupState:$e,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Ba.bind(null,a),e.ce&&e.ce(a),a}let Le=null;const cl=()=>Le||Ke;let Es,dn;{const e=Rs(),t=(n,o)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(o),a=>{r.length>1?r.forEach(l=>l(a)):r[0](a)}};Es=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),dn=t("__VUE_SSR_SETTERS__",n=>us=n)}const ms=e=>{const t=Le;return Es(e),e.scope.on(),()=>{e.scope.off(),Es(t)}},Yn=()=>{Le&&Le.scope.off(),Es(null)};function vr(e){return e.vnode.shapeFlag&4}let us=!1;function fl(e,t=!1,n=!1){t&&dn(t);const{props:o,children:r}=e.vnode,a=vr(e);Ja(e,o,a,t),Za(e,r,n||t);const l=a?pl(e,t):void 0;return t&&dn(!1),l}function pl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ma);const{setup:o}=n;if(o){ht();const r=e.setupContext=o.length>1?xl(e):null,a=ms(e),l=ps(o,e,0,[e.props,r]),i=vo(l);if(yt(),a(),(i||e.sp)&&!ns(e)&&zo(e),i){if(l.then(Yn,Yn),t)return l.then(c=>{Zn(e,c)}).catch(c=>{js(c,e,0)});e.asyncDep=l}else Zn(e,l)}else gr(e)}function Zn(e,t,n){xe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:we(t)&&(e.setupState=jo(t)),gr(e)}function gr(e,t,n){const o=e.type;e.render||(e.render=o.render||it);{const r=ms(e);ht();try{Oa(e)}finally{yt(),r()}}}const ml={get(e,t){return Re(e,"get",""),e[t]}};function xl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ml),slots:e.slots,emit:e.emit,expose:t}}function Hs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(jo(Qr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in os)return os[n](e)},has(t,n){return n in t||n in os}})):e.proxy}function vl(e,t=!0){return xe(e)?e.displayName||e.name:e.name||t&&e.__name}function gl(e){return xe(e)&&"__vccOpts"in e}const Te=(e,t)=>oa(e,t,us),bl="3.5.31";/**
60
+ **/function ds(e,t,s,o){try{return o?e(...o):e()}catch(r){Rs(r,t,s)}}function at(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(re(e)){const r=[];for(let l=0;l<e.length;l++)r.push(at(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||ye;if(t){let u=t.parent;const d=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;u;){const f=u.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,x)===!1)return}u=u.parent}if(l){vt(),ds(l,null,10,[e,d,x]),gt();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 Xe=-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=Xe+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 yn(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,Uo()}}function Uo(){ks||(ks=jo.then(Vo))}function il(e){re(e)?Lt.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1),Uo()}function Dn(e,t,s=Xe+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 No(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(Xe=0;Xe<De.length;Xe++){const t=De[Xe];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(;Xe<De.length;Xe++){const t=De[Xe];t&&(t.flags&=-2)}Xe=-1,De.length=0,No(),ks=null,(De.length||Lt.length)&&Vo()}}let Be=null,Bo=null;function $s(e){const t=Be;return Be=e,Bo=e&&e.type.__scopeId||null,t}function ul(e,t=Be,s){if(!t||e._n)return e;const o=(...r)=>{o._d&&zn(-1);const l=$s(t);let a;try{a=e(...r)}finally{$s(l),o._d&&zn(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function J(e,t){if(Be===null)return e;const s=Ns(Be),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,a,u,d=ye]=t[r];l&&(ae(l)&&(l={mounted:l,updated:l}),l.deep&&mt(a),o.push({dir:l,instance:s,value:a,oldValue:void 0,arg:u,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 u=r[a];l&&(u.oldValue=l[a].value);let d=u.dir[o];d&&(vt(),at(d,s,8,[e.el,u,e,t]),gt())}}function cl(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=ca();if(o||Ut){let r=Ut?Ut._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=ye){const{immediate:o,deep:r,flush:l,once:a}=s,u=Ee({},s),d=t&&o||!t&&l!=="post";let x;if(is){if(l==="sync"){const T=fl();x=T.__watcherHandles||(T.__watcherHandles=[])}else if(!d){const T=()=>{};return T.stop=ot,T.resume=ot,T.pause=ot,T}}const f=Ie;u.call=(T,P,C)=>at(T,f,P,C);let p=!1;l==="post"?u.scheduler=T=>{Le(T,f&&f.suspense)}:l!=="sync"&&(p=!0,u.scheduler=(T,P)=>{P?T():yn(T)}),u.augmentJob=T=>{t&&(T.flags|=4),p&&(T.flags|=2,f&&(T.id=f.uid,T.i=f))};const w=rl(e,t,u);return is&&(x?x.push(w):d&&w()),w}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),u=Fo(r,l.bind(o),s);return a(),u}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 Ne(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 Ss=new WeakMap;function es(e,t,s,o,r=!1){if(re(e)){e.forEach((C,N)=>es(C,t&&(re(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?Ns(o.component):o.el,a=r?null:l,{i:u,r:d}=e,x=t&&t.r,f=u.refs===ye?u.refs={}:u.refs,p=u.setupState,w=me(p),T=p===ye?po:C=>Rn(f,C)?!1:xe(w,C),P=(C,N)=>!(N&&Rn(f,N));if(x!=null&&x!==d){if(jn(t),Se(x))f[x]=null,T(x)&&(p[x]=null);else if(Oe(x)){const C=t;P(x,C.k)&&(x.value=null),C.k&&(f[C.k]=null)}}if(ae(d))ds(d,u,12,[a,f]);else{const C=Se(d),N=Oe(d);if(C||N){const S=()=>{if(e.f){const A=C?T(d)?p[d]:f[d]:P()||!e.k?d.value:f[e.k];if(r)re(A)&&un(A,l);else if(re(A))A.includes(l)||A.push(l);else if(C)f[d]=[l],T(d)&&(p[d]=f[d]);else{const j=[l];P(d,e.k)&&(d.value=j),e.k&&(f[e.k]=j)}}else C?(f[d]=a,T(d)&&(p[d]=a)):N&&(P(d,e.k)&&(d.value=a),e.k&&(f[e.k]=a))};if(a){const A=()=>{S(),Ss.delete(e)};A.id=-1,Ss.set(e,A),Le(A,s)}else jn(e),S()}}}function jn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.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)&&bl(o,t,s,r),r=r.parent}}function bl(e,t,s,o){const r=js(t,e,o,!0);wn(()=>{un(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)=>{vt();const u=fs(s),d=at(t,s,e,a);return u(),gt(),d});return o?r.unshift(l):r.push(l),l}}const bt=e=>(t,s=Ie)=>{(!is||e==="sp")&&js(e,(...o)=>t(...o),s)},yl=bt("bm"),je=bt("m"),_l=bt("bu"),wl=bt("u"),kl=bt("bum"),wn=bt("um"),$l=bt("sp"),Sl=bt("rtg"),Cl=bt("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=Be||Ie;if(r){const l=r.type;{const u=xa(l,!1);if(u&&(u===t||u===Re(t)||u===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 ce(e,t,s,o){let r;const l=s,a=re(e);if(a||Se(e)){const u=a&&At(e);let d=!1,x=!1;u&&(d=!He(e),x=ht(e),e=Ds(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(d?x?Nt(Je(e[f])):Je(e[f]):e[f],f,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let u=0;u<e;u++)r[u]=t(u+1,u,void 0,l)}else if(he(e))if(e[Symbol.iterator])r=Array.from(e,(u,d)=>t(u,d,void 0,l));else{const u=Object.keys(e);r=new Array(u.length);for(let d=0,x=u.length;d<x;d++){const f=u[d];r[d]=t(e[f],f,d,l)}}else r=[];return r}const tn=e=>e?xr(e)?Ns(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=>Yo(e),$forceUpdate:e=>e.f||(e.f=()=>{yn(e.update)}),$nextTick:e=>e.n||(e.n=Lo.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==ye&&!e.__isScriptSetup&&xe(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:o,data:r,props:l,accessCache:a,type:u,appContext:d}=e;if(t[0]!=="$"){const w=a[t];if(w!==void 0)switch(w){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!==ye&&xe(r,t))return a[t]=2,r[t];if(xe(l,t))return a[t]=3,l[t];if(s!==ye&&xe(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=u.__cssModules)&&(f=f[t]))return f;if(s!==ye&&xe(s,t))return a[t]=4,s[t];if(p=d.config.globalProperties,xe(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!==ye&&xe(o,t)?(o[t]=s,!0):xe(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}},u){let d;return!!(s[u]||e!==ye&&u[0]!=="$"&&xe(e,u)||zs(t,u)||xe(l,u)||xe(o,u)||xe(ss,u)||xe(r.config.globalProperties,u)||(d=a.__cssModules)&&d[u])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:xe(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Un(e){return re(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ol(e){const t=Yo(e),s=e.proxy,o=e.ctx;sn=!1,t.beforeCreate&&Nn(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:u,provide:d,inject:x,created:f,beforeMount:p,mounted:w,beforeUpdate:T,updated:P,activated:C,deactivated:N,beforeDestroy:S,beforeUnmount:A,destroyed:j,unmounted:O,render:G,renderTracked:oe,renderTriggered:ne,errorCaptured:ue,serverPrefetch:ve,expose:X,inheritAttrs:_,components:h,directives:b,filters:E}=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],B=ae(ee)?ee.bind(s,s):ae(ee.get)?ee.get.bind(s,s):ot,U=!ae(ee)&&ae(ee.set)?ee.set.bind(s):ot,$e=Pe({get:B,set:U});Object.defineProperty(o,ie,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(u)for(const ie in u)qo(u[ie],o,s,ie);if(d){const ie=ae(d)?d.call(s):d;Reflect.ownKeys(ie).forEach(ee=>{cl(ee,ie[ee])})}f&&Nn(f,e,"c");function W(ie,ee){re(ee)?ee.forEach(B=>ie(B.bind(s))):ee&&ie(ee.bind(s))}if(W(yl,p),W(je,w),W(_l,T),W(wl,P),W(gl,C),W(hl,N),W(Tl,ue),W(Cl,oe),W(Sl,ne),W(kl,A),W(wn,O),W($l,ve),re(X))if(X.length){const ie=e.exposed||(e.exposed={});X.forEach(ee=>{Object.defineProperty(ie,ee,{get:()=>s[ee],set:B=>s[ee]=B,enumerable:!0})})}else e.exposed||(e.exposed={});G&&e.render===ot&&(e.render=G),_!=null&&(e.inheritAttrs=_),h&&(e.components=h),b&&(e.directives=b),ve&&Ko(e)}function Ml(e,t,s=ot){re(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 Nn(e,t,s){at(re(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(re(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 Yo(e){const t=e.type,{mixins:s,extends:o}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,u=l.get(t);let d;return u?d=u:!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 u=Dl[a]||s&&s[a];e[a]=u?u(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Bn,emits:Bn,methods:Gt,computed:Gt,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:Gt,directives:Gt,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 Gt(nn(e),nn(t))}function nn(e){if(re(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 Gt(e,t){return e?Ee(Object.create(null),e,t):t}function Bn(e,t){return e?re(e)&&re(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Un(e),Un(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 Go(){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 Ul(e,t){return function(o,r=null){ae(o)||(o=Ee({},o)),r!=null&&!he(r)&&(r=null);const l=Go(),a=new WeakSet,u=[];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,w){if(!d){const T=x._ceVNode||rt(o,r);return T.appContext=l,w===!0?w="svg":w===!1&&(w=void 0),e(T,f,w),d=!0,x._container=f,f.__vue_app__=x,Ns(T.component)}},onUnmount(f){u.push(f)},unmount(){d&&(at(u,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=Ut;Ut=x;try{return f()}finally{Ut=p}}};return x}}let Ut=null;const Nl=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const o=e.vnode.props||ye;let r=s;const l=t.startsWith("update:"),a=l&&Nl(o,t.slice(7));a&&(a.trim&&(r=s.map(f=>Se(f)?f.trim():f)),a.number&&(r=s.map(Os)));let u,d=o[u=Vs(t)]||o[u=Vs(Re(t))];!d&&l&&(d=o[u=Vs(St(t))]),d&&at(d,e,6,r);const x=o[u+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,at(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={},u=!1;if(!ae(e)){const d=x=>{const f=Zo(x,t,!0);f&&(u=!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&&!u?(he(e)&&o.set(e,null),null):(re(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$/,""),xe(e,t[0].toLowerCase()+t.slice(1))||xe(e,St(t))||xe(e,t))}function Fn(e){const{type:t,vnode:s,proxy:o,withProxy:r,propsOptions:[l],slots:a,attrs:u,emit:d,render:x,renderCache:f,props:p,data:w,setupState:T,ctx:P,inheritAttrs:C}=e,N=$s(e);let S,A;try{if(s.shapeFlag&4){const O=r||o,G=O;S=st(x.call(G,O,f,p,T,w,P)),A=u}else{const O=t;S=st(O.length>1?O(p,{attrs:u,slots:a,emit:d}):O(p,null)),A=t.props?u:Fl(u)}}catch(O){ns.length=0,Rs(O,e,1),S=rt($t)}let j=S;if(A&&C!==!1){const O=Object.keys(A),{shapeFlag:G}=j;O.length&&G&7&&(l&&O.some(Es)&&(A=Hl(A,l)),j=Vt(j,A,!1,!0))}return s.dirs&&(j=Vt(j,null,!1,!0),j.dirs=j.dirs?j.dirs.concat(s.dirs):s.dirs),s.transition&&_n(j,s.transition),S=j,$s(N),S}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:u,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 w=f[p];if(Qo(a,o,w)&&!Ls(x,w))return!0}}}else return(r||u)&&(!u||!u.$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:Gr(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,u=me(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 w=f[p];if(Ls(e.emitsOptions,w))continue;const T=t[w];if(d)if(xe(l,w))T!==l[w]&&(l[w]=T,x=!0);else{const P=Re(w);r[P]=on(d,u,P,T,e,!1)}else T!==l[w]&&(l[w]=T,x=!0)}}}else{sr(e,t,r,l)&&(x=!0);let f;for(const p in u)(!t||!xe(t,p)&&((f=St(p))===p||!xe(t,f)))&&(d?s&&(s[p]!==void 0||s[f]!==void 0)&&(r[p]=on(d,u,p,void 0,e,!0)):delete r[p]);if(l!==u)for(const p in l)(!t||!xe(t,p))&&(delete l[p],x=!0)}x&&pt(e.attrs,"set","")}function sr(e,t,s,o){const[r,l]=e.propsOptions;let a=!1,u;if(t)for(let d in t){if(Zt(d))continue;const x=t[d];let f;r&&xe(r,f=Re(d))?!l||!l.includes(f)?s[f]=x:(u||(u={}))[f]=x:Ls(e.emitsOptions,d)||(!(d in o)||x!==o[d])&&(o[d]=x,a=!0)}if(l){const d=me(s),x=u||ye;for(let f=0;f<l.length;f++){const p=l[f];s[p]=on(r,d,p,x[p],e,!xe(x,p))}}return a}function on(e,t,s,o,r,l){const a=e[s];if(a!=null){const u=xe(a,"default");if(u&&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&&!u?o=!1:a[1]&&(o===""||o===St(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={},u=[];let d=!1;if(!ae(e)){const f=p=>{d=!0;const[w,T]=nr(p,t,!0);Ee(a,w),T&&u.push(...T)};!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(re(l))for(let f=0;f<l.length;f++){const p=Re(l[f]);Kn(p)&&(a[p]=ye)}else if(l)for(const f in l){const p=Re(f);if(Kn(p)){const w=l[f],T=a[p]=re(w)||ae(w)?{type:w}:Ee({},w),P=T.type;let C=!1,N=!0;if(re(P))for(let S=0;S<P.length;++S){const A=P[S],j=ae(A)&&A.name;if(j==="Boolean"){C=!0;break}else j==="String"&&(N=!1)}else C=ae(P)&&P.name==="Boolean";T[0]=C,T[1]=N,(C||xe(T,"default"))&&u.push(p)}}const x=[a,u];return he(e)&&o.set(e,x),x}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",$n=e=>re(e)?e.map(st):[st(e)],Yl=(e,t,s)=>{if(t._n)return t;const o=ul((...r)=>$n(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]=Yl(r,l,o);else if(l!=null){const a=$n(l);t[r]=()=>a}}},rr=(e,t)=>{const s=$n(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const o in t)(s||!kn(o))&&(e[o]=t[o])},Gl=(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=ye;if(o.shapeFlag&32){const u=t._;u?s&&u===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 u in r)!kn(u)&&a[u]==null&&delete r[u]},Le=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:u,createComment:d,setText:x,setElementText:f,parentNode:p,nextSibling:w,setScopeId:T=ot,insertStaticContent:P}=e,C=(i,c,$,M=null,m=null,D=null,K=void 0,L=null,V=!!c.dynamicChildren)=>{if(i===c)return;i&&!Jt(i,c)&&(M=yt(i),ke(i,m,D,!0),i=null),c.patchFlag===-2&&(V=!1,c.dynamicChildren=null);const{type:R,ref:se,shapeFlag:z}=c;switch(R){case Us:N(i,c,$,M);break;case $t:S(i,c,$,M);break;case bs:i==null&&A(c,$,M,K);break;case te:h(i,c,$,M,m,D,K,L,V);break;default:z&1?G(i,c,$,M,m,D,K,L,V):z&6?b(i,c,$,M,m,D,K,L,V):(z&64||z&128)&&R.process(i,c,$,M,m,D,K,L,V,Ke)}se!=null&&m?es(se,i&&i.ref,D,c||i,!c):se==null&&i&&i.ref!=null&&es(i.ref,null,D,i,!0)},N=(i,c,$,M)=>{if(i==null)o(c.el=u(c.children),$,M);else{const m=c.el=i.el;c.children!==i.children&&x(m,c.children)}},S=(i,c,$,M)=>{i==null?o(c.el=d(c.children||""),$,M):c.el=i.el},A=(i,c,$,M)=>{[i.el,i.anchor]=P(i.children,c,$,M,i.el,i.anchor)},j=({el:i,anchor:c},$,M)=>{let m;for(;i&&i!==c;)m=w(i),o(i,$,M),i=m;o(c,$,M)},O=({el:i,anchor:c})=>{let $;for(;i&&i!==c;)$=w(i),r(i),i=$;r(c)},G=(i,c,$,M,m,D,K,L,V)=>{if(c.type==="svg"?K="svg":c.type==="math"&&(K="mathml"),i==null)oe(c,$,M,m,D,K,L,V);else{const R=i.el&&i.el._isVueCE?i.el:null;try{R&&R._beginPatch(),ve(i,c,m,D,K,L,V)}finally{R&&R._endPatch()}}},oe=(i,c,$,M,m,D,K,L)=>{let V,R;const{props:se,shapeFlag:z,transition:Q,dirs:le}=i;if(V=i.el=a(i.type,D,se&&se.is,se),z&8?f(V,i.children):z&16&&ue(i.children,V,null,M,m,Js(i,D),K,L),le&&Ct(i,null,M,"created"),ne(V,i,i.scopeId,K,M),se){for(const be in se)be!=="value"&&!Zt(be)&&l(V,be,null,se[be],D,M);"value"in se&&l(V,"value",null,se.value,D),(R=se.onVnodeBeforeMount)&&Qe(R,M,i)}le&&Ct(i,null,M,"beforeMount");const fe=ea(m,Q);fe&&Q.beforeEnter(V),o(V,c,$),((R=se&&se.onVnodeMounted)||fe||le)&&Le(()=>{try{R&&Qe(R,M,i),fe&&Q.enter(V),le&&Ct(i,null,M,"mounted")}finally{}},m)},ne=(i,c,$,M,m)=>{if($&&T(i,$),M)for(let D=0;D<M.length;D++)T(i,M[D]);if(m){let D=m.subTree;if(c===D||cr(D.type)&&(D.ssContent===c||D.ssFallback===c)){const K=m.vnode;ne(i,K,K.scopeId,K.slotScopeIds,m.parent)}}},ue=(i,c,$,M,m,D,K,L,V=0)=>{for(let R=V;R<i.length;R++){const se=i[R]=L?ft(i[R]):st(i[R]);C(null,se,c,$,M,m,D,K,L)}},ve=(i,c,$,M,m,D,K)=>{const L=c.el=i.el;let{patchFlag:V,dynamicChildren:R,dirs:se}=c;V|=i.patchFlag&16;const z=i.props||ye,Q=c.props||ye;let le;if($&&Tt($,!1),(le=Q.onVnodeBeforeUpdate)&&Qe(le,$,c,i),se&&Ct(c,i,$,"beforeUpdate"),$&&Tt($,!0),(z.innerHTML&&Q.innerHTML==null||z.textContent&&Q.textContent==null)&&f(L,""),R?X(i.dynamicChildren,R,L,$,M,Js(c,m),D):K||ee(i,c,L,null,$,M,Js(c,m),D,!1),V>0){if(V&16)_(L,z,Q,$,m);else if(V&2&&z.class!==Q.class&&l(L,"class",null,Q.class,m),V&4&&l(L,"style",z.style,Q.style,m),V&8){const fe=c.dynamicProps;for(let be=0;be<fe.length;be++){const _e=fe[be],Ce=z[_e],Te=Q[_e];(Te!==Ce||_e==="value")&&l(L,_e,Ce,Te,m,$)}}V&1&&i.children!==c.children&&f(L,c.children)}else!K&&R==null&&_(L,z,Q,$,m);((le=Q.onVnodeUpdated)||se)&&Le(()=>{le&&Qe(le,$,c,i),se&&Ct(c,i,$,"updated")},M)},X=(i,c,$,M,m,D,K)=>{for(let L=0;L<c.length;L++){const V=i[L],R=c[L],se=V.el&&(V.type===te||!Jt(V,R)||V.shapeFlag&198)?p(V.el):$;C(V,R,se,null,M,m,D,K,!0)}},_=(i,c,$,M,m)=>{if(c!==$){if(c!==ye)for(const D in c)!Zt(D)&&!(D in $)&&l(i,D,c[D],null,m,M);for(const D in $){if(Zt(D))continue;const K=$[D],L=c[D];K!==L&&D!=="value"&&l(i,D,L,K,m,M)}"value"in $&&l(i,"value",c.value,$.value,m)}},h=(i,c,$,M,m,D,K,L,V)=>{const R=c.el=i?i.el:u(""),se=c.anchor=i?i.anchor:u("");let{patchFlag:z,dynamicChildren:Q,slotScopeIds:le}=c;le&&(L=L?L.concat(le):le),i==null?(o(R,$,M),o(se,$,M),ue(c.children||[],$,se,m,D,K,L,V)):z>0&&z&64&&Q&&i.dynamicChildren&&i.dynamicChildren.length===Q.length?(X(i.dynamicChildren,Q,$,m,D,K,L),(c.key!=null||m&&c===m.subTree)&&ar(i,c,!0)):ee(i,c,$,se,m,D,K,L,V)},b=(i,c,$,M,m,D,K,L,V)=>{c.slotScopeIds=L,i==null?c.shapeFlag&512?m.ctx.activate(c,$,M,K,V):E(c,$,M,m,D,K,V):I(i,c,V)},E=(i,c,$,M,m,D,K)=>{const L=i.component=ua(i,M,m);if(Wo(i)&&(L.ctx.renderer=Ke),da(L,!1,K),L.asyncDep){if(m&&m.registerDep(L,W,K),!i.el){const V=L.subTree=rt($t);S(null,V,c,$),i.placeholder=V.el}}else W(L,i,c,$,m,D,K)},I=(i,c,$)=>{const M=c.component=i.component;if(Kl(i,c,$))if(M.asyncDep&&!M.asyncResolved){ie(M,c,$);return}else M.next=c,M.update();else c.el=i.el,M.vnode=c},W=(i,c,$,M,m,D,K)=>{const L=()=>{if(i.isMounted){let{next:z,bu:Q,u:le,parent:fe,vnode:be}=i;{const Ge=ir(i);if(Ge){z&&(z.el=be.el,ie(i,z,K)),Ge.asyncDep.then(()=>{Le(()=>{i.isUnmounted||R()},m)});return}}let _e=z,Ce;Tt(i,!1),z?(z.el=be.el,ie(i,z,K)):z=be,Q&&gs(Q),(Ce=z.props&&z.props.onVnodeBeforeUpdate)&&Qe(Ce,fe,z,be),Tt(i,!0);const Te=Fn(i),Ye=i.subTree;i.subTree=Te,C(Ye,Te,p(Ye.el),yt(Ye),i,m,D),z.el=Te.el,_e===null&&Wl(i,Te.el),le&&Le(le,m),(Ce=z.props&&z.props.onVnodeUpdated)&&Le(()=>Qe(Ce,fe,z,be),m)}else{let z;const{el:Q,props:le}=c,{bm:fe,m:be,parent:_e,root:Ce,type:Te}=i,Ye=ts(c);Tt(i,!1),fe&&gs(fe),!Ye&&(z=le&&le.onVnodeBeforeMount)&&Qe(z,_e,c),Tt(i,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Te,i.parent?i.parent.type:void 0);const Ge=i.subTree=Fn(i);C(null,Ge,$,M,i,m,D),c.el=Ge.el}if(be&&Le(be,m),!Ye&&(z=le&&le.onVnodeMounted)){const Ge=c;Le(()=>Qe(z,_e,Ge),m)}(c.shapeFlag&256||_e&&ts(_e.vnode)&&_e.vnode.shapeFlag&256)&&i.a&&Le(i.a,m),i.isMounted=!0,c=$=M=null}};i.scope.on();const V=i.effect=new _o(L);i.scope.off();const R=i.update=V.run.bind(V),se=i.job=V.runIfDirty.bind(V);se.i=i,se.id=i.uid,V.scheduler=()=>yn(se),Tt(i,!0),R()},ie=(i,c,$)=>{c.component=i;const M=i.vnode.props;i.vnode=c,i.next=null,Jl(i,c.props,M,$),Zl(i,c.children,$),vt(),Dn(i),gt()},ee=(i,c,$,M,m,D,K,L,V=!1)=>{const R=i&&i.children,se=i?i.shapeFlag:0,z=c.children,{patchFlag:Q,shapeFlag:le}=c;if(Q>0){if(Q&128){U(R,z,$,M,m,D,K,L,V);return}else if(Q&256){B(R,z,$,M,m,D,K,L,V);return}}le&8?(se&16&&qe(R,m,D),z!==R&&f($,z)):se&16?le&16?U(R,z,$,M,m,D,K,L,V):qe(R,m,D,!0):(se&8&&f($,""),le&16&&ue(z,$,M,m,D,K,L,V))},B=(i,c,$,M,m,D,K,L,V)=>{i=i||Rt,c=c||Rt;const R=i.length,se=c.length,z=Math.min(R,se);let Q;for(Q=0;Q<z;Q++){const le=c[Q]=V?ft(c[Q]):st(c[Q]);C(i[Q],le,$,null,m,D,K,L,V)}R>se?qe(i,m,D,!0,!1,z):ue(c,$,M,m,D,K,L,V,z)},U=(i,c,$,M,m,D,K,L,V)=>{let R=0;const se=c.length;let z=i.length-1,Q=se-1;for(;R<=z&&R<=Q;){const le=i[R],fe=c[R]=V?ft(c[R]):st(c[R]);if(Jt(le,fe))C(le,fe,$,null,m,D,K,L,V);else break;R++}for(;R<=z&&R<=Q;){const le=i[z],fe=c[Q]=V?ft(c[Q]):st(c[Q]);if(Jt(le,fe))C(le,fe,$,null,m,D,K,L,V);else break;z--,Q--}if(R>z){if(R<=Q){const le=Q+1,fe=le<se?c[le].el:M;for(;R<=Q;)C(null,c[R]=V?ft(c[R]):st(c[R]),$,fe,m,D,K,L,V),R++}}else if(R>Q)for(;R<=z;)ke(i[R],m,D,!0),R++;else{const le=R,fe=R,be=new Map;for(R=fe;R<=Q;R++){const Ve=c[R]=V?ft(c[R]):st(c[R]);Ve.key!=null&&be.set(Ve.key,R)}let _e,Ce=0;const Te=Q-fe+1;let Ye=!1,Ge=0;const Wt=new Array(Te);for(R=0;R<Te;R++)Wt[R]=0;for(R=le;R<=z;R++){const Ve=i[R];if(Ce>=Te){ke(Ve,m,D,!0);continue}let Ze;if(Ve.key!=null)Ze=be.get(Ve.key);else for(_e=fe;_e<=Q;_e++)if(Wt[_e-fe]===0&&Jt(Ve,c[_e])){Ze=_e;break}Ze===void 0?ke(Ve,m,D,!0):(Wt[Ze-fe]=R+1,Ze>=Ge?Ge=Ze:Ye=!0,C(Ve,c[Ze],$,null,m,D,K,L,V),Ce++)}const Tn=Ye?ta(Wt):Rt;for(_e=Tn.length-1,R=Te-1;R>=0;R--){const Ve=fe+R,Ze=c[Ve],Pn=c[Ve+1],En=Ve+1<se?Pn.el||ur(Pn):M;Wt[R]===0?C(null,Ze,$,En,m,D,K,L,V):Ye&&(_e<0||R!==Tn[_e]?$e(Ze,$,En,2):_e--)}}},$e=(i,c,$,M,m=null)=>{const{el:D,type:K,transition:L,children:V,shapeFlag:R}=i;if(R&6){$e(i.component.subTree,c,$,M);return}if(R&128){i.suspense.move(c,$,M);return}if(R&64){K.move(i,c,$,Ke);return}if(K===te){o(D,c,$);for(let z=0;z<V.length;z++)$e(V[z],c,$,M);o(i.anchor,c,$);return}if(K===bs){j(i,c,$);return}if(M!==2&&R&1&&L)if(M===0)L.beforeEnter(D),o(D,c,$),Le(()=>L.enter(D),m);else{const{leave:z,delayLeave:Q,afterLeave:le}=L,fe=()=>{i.ctx.isUnmounted?r(D):o(D,c,$)},be=()=>{D._isLeaving&&D[vl](!0),z(D,()=>{fe(),le&&le()})};Q?Q(D,fe,be):be()}else o(D,c,$)},ke=(i,c,$,M=!1,m=!1)=>{const{type:D,props:K,ref:L,children:V,dynamicChildren:R,shapeFlag:se,patchFlag:z,dirs:Q,cacheIndex:le,memo:fe}=i;if(z===-2&&(m=!1),L!=null&&(vt(),es(L,null,$,i,!0),gt()),le!=null&&(c.renderCache[le]=void 0),se&256){c.ctx.deactivate(i);return}const be=se&1&&Q,_e=!ts(i);let Ce;if(_e&&(Ce=K&&K.onVnodeBeforeUnmount)&&Qe(Ce,c,i),se&6)Ot(i.component,$,M);else{if(se&128){i.suspense.unmount($,M);return}be&&Ct(i,null,c,"beforeUnmount"),se&64?i.type.remove(i,c,$,Ke,M):R&&!R.hasOnce&&(D!==te||z>0&&z&64)?qe(R,c,$,!1,!0):(D===te&&z&384||!m&&se&16)&&qe(V,c,$),M&&ge(i)}const Te=fe!=null&&le==null;(_e&&(Ce=K&&K.onVnodeUnmounted)||be||Te)&&Le(()=>{Ce&&Qe(Ce,c,i),be&&Ct(i,null,c,"unmounted"),Te&&(i.el=null)},$)},ge=i=>{const{type:c,el:$,anchor:M,transition:m}=i;if(c===te){it($,M);return}if(c===bs){O(i);return}const D=()=>{r($),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(i.shapeFlag&1&&m&&!m.persisted){const{leave:K,delayLeave:L}=m,V=()=>K($,D);L?L(i.el,D,V):V()}else D()},it=(i,c)=>{let $;for(;i!==c;)$=w(i),r(i),i=$;r(c)},Ot=(i,c,$)=>{const{bum:M,scope:m,job:D,subTree:K,um:L,m:V,a:R}=i;Wn(V),Wn(R),M&&gs(M),m.stop(),D&&(D.flags|=8,ke(K,i,c,$)),L&&Le(L,c),Le(()=>{i.isUnmounted=!0},c)},qe=(i,c,$,M=!1,m=!1,D=0)=>{for(let K=D;K<i.length;K++)ke(i[K],c,$,M,m)},yt=i=>{if(i.shapeFlag&6)return yt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const c=w(i.anchor||i.el),$=c&&c[ml];return $?w($):c};let Kt=!1;const _t=(i,c,$)=>{let M;i==null?c._vnode&&(ke(c._vnode,null,null,!0),M=c._vnode.component):C(c._vnode||null,i,c,null,null,null,$),c._vnode=i,Kt||(Kt=!0,Dn(M),No(),Kt=!1)},Ke={p:C,um:ke,m:$e,r:ge,mt:E,mc:ue,pc:ee,pbc:X,n:yt,o:e};return{render:_t,hydrate:void 0,createApp:Ul(_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(re(o)&&re(r))for(let l=0;l<o.length;l++){const a=o[l];let u=r[l];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=r[l]=ft(r[l]),u.el=a.el),!s&&u.patchFlag!==-2&&ar(a,u)),u.type===Us&&(u.patchFlag===-1&&(u=r[l]=ft(u)),u.el=a.el),u.type===$t&&!u.el&&(u.el=a.el)}}function ta(e){const t=e.slice(),s=[0];let o,r,l,a,u;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;)u=l+a>>1,e[s[u]]<x?l=u+1:a=u;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 ur(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ur(t.subTree):null}const cr=e=>e.__isSuspense;function sa(e,t){t&&t.pendingBranch?re(e)?t.effects.push(...e):t.effects.push(e):il(e)}const te=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),bs=Symbol.for("v-stc"),ns=[];let Fe=null;function v(e=!1){ns.push(Fe=e?null:[])}function na(){ns.pop(),Fe=ns[ns.length-1]||null}let as=1;function zn(e,t=!1){as+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function dr(e){return e.dynamicChildren=as>0?Fe||Rt:null,na(),as>0&&Fe&&Fe.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(rt(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,ys=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Se(e)||Oe(e)||ae(e)?{i:Be,r:e,k:t,f:!!s}:e:null);function n(e,t=null,s=null,o=0,r=null,l=e===te?0:1,a=!1,u=!1){const d={__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:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Be};return u?(Sn(d,s),l&128&&e.normalize(d)):s&&(d.shapeFlag|=Se(s)?8:16),as>0&&!a&&Fe&&(d.patchFlag>0||l&6)&&d.patchFlag!==32&&Fe.push(d),d}const rt=oa;function oa(e,t=null,s=null,o=0,r=null,l=!1){if((!e||e===Jo)&&(e=$t),pr(e)){const u=Vt(e,t,!0);return s&&Sn(u,s),as>0&&!l&&Fe&&(u.shapeFlag&6?Fe[Fe.indexOf(e)]=u:Fe.push(u)),u.patchFlag=-2,u}if(va(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:u,style:d}=t;u&&!Se(u)&&(t.class=q(u)),he(d)&&(bn(d)&&!re(d)&&(d=Ee({},d)),t.style=It(d))}const a=Se(e)?1:cr(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?bn(e)||tr(e)?Ee({},e):e:null}function Vt(e,t,s=!1,o=!1){const{props:r,ref:l,patchFlag:a,children:u,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?re(l)?l.concat(ys(t)):[l,ys(t)]:ys(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==te?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition: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 Y(e=" ",t=0){return rt(Us,null,e,t)}function dt(e,t){const s=rt(bs,null,e);return s.staticCount=t,s}function F(e="",t=!1){return t?(v(),fr($t,null,e)):rt($t,null,e)}function st(e){return e==null||typeof e=="boolean"?rt($t):re(e)?rt(te,null,e.slice()):pr(e)?ft(e):rt(Us,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Sn(e,t){let s=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(re(t))s=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Sn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Be:r===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ae(t)?(t={default:t,_ctx:Be},s=32):(t=String(t),o&64?(s=16,t=[Y(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=q([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&&!(re(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 Qe(e,t,s,o=null){at(e,t,7,[s,o])}const aa=Go();let ia=0;function ua(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:ye,inheritAttrs:o.inheritAttrs,ctx:ye,data:ye,props:ye,attrs:ye,slots:ye,refs:ye,setupState:ye,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 ca=()=>Ie||Be;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),Gl(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){vt();const r=e.setupContext=o.length>1?ma(e):null,l=fs(e),a=ds(o,e,0,[e.props,r]),u=mo(a);if(gt(),l(),(u||e.sp)&&!ts(e)&&Ko(e),u){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||ot);{const r=fs(e);vt();try{Ol(e)}finally{gt(),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 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 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 un;const Qn=typeof window<"u"&&window.trustedTypes;if(Qn)try{un=Qn.createPolicy("vue",{createHTML:e=>e})}catch{}const br=un?e=>un.createHTML(e):e=>e,hl="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",ft=typeof document<"u"?document:null,Xn=ft&&ft.createElement("template"),_l={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t==="svg"?ft.createElementNS(hl,e):t==="mathml"?ft.createElementNS(yl,e):n?ft.createElement(e,{is:n}):ft.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>ft.createTextNode(e),createComment:e=>ft.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ft.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,a){const l=n?n.previousSibling:t.lastChild;if(r&&(r===a||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===a||!(r=r.nextSibling)););else{Xn.innerHTML=br(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const i=Xn.content;if(o==="svg"||o==="mathml"){const c=i.firstChild;for(;c.firstChild;)i.appendChild(c.firstChild);i.removeChild(c)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},wl=Symbol("_vtc");function kl(e,t,n){const o=e[wl];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const eo=Symbol("_vod"),$l=Symbol("_vsh"),Sl=Symbol(""),Cl=/(?:^|;)\s*display\s*:/;function Tl(e,t,n){const o=e.style,r=Pe(n);let a=!1;if(n&&!r){if(t)if(Pe(t))for(const l of t.split(";")){const i=l.slice(0,l.indexOf(":")).trim();n[i]==null&&ks(o,i,"")}else for(const l in t)n[l]==null&&ks(o,l,"");for(const l in n)l==="display"&&(a=!0),ks(o,l,n[l])}else if(r){if(t!==n){const l=o[Sl];l&&(n+=";"+l),o.cssText=n,a=Cl.test(n)}}else t&&e.removeAttribute("style");eo in e&&(e[eo]=a?o.display:"",e[$l]&&(o.display="none"))}const to=/\s*!important$/;function ks(e,t,n){if(de(n))n.forEach(o=>ks(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=Pl(e,t);to.test(n)?e.setProperty(Pt(o),n.replace(to,""),"important"):e[o]=n}}const so=["Webkit","Moz","ms"],Zs={};function Pl(e,t){const n=Zs[t];if(n)return n;let o=Ve(t);if(o!=="filter"&&o in e)return Zs[t]=o;o=Os(o);for(let r=0;r<so.length;r++){const a=so[r]+o;if(a in e)return Zs[t]=a}return t}const no="http://www.w3.org/1999/xlink";function oo(e,t,n,o,r,a=Er(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(no,t.slice(6,t.length)):e.setAttributeNS(no,t,n):n==null||a&&!yo(n)?e.removeAttribute(t):e.setAttribute(t,a?"":dt(n)?String(n):n)}function ro(e,t,n,o,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?br(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const i=a==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(i!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=yo(n):n==null&&i==="string"?(n="",l=!0):i==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(r||t)}function Ct(e,t,n,o){e.addEventListener(t,n,o)}function El(e,t,n,o){e.removeEventListener(t,n,o)}const ao=Symbol("_vei");function Il(e,t,n,o,r=null){const a=e[ao]||(e[ao]={}),l=a[t];if(o&&l)l.value=o;else{const[i,c]=Al(t);if(o){const v=a[t]=Dl(o,r);Ct(e,i,v,c)}else l&&(El(e,i,l,c),a[t]=void 0)}}const lo=/(?:Once|Passive|Capture)$/;function Al(e){let t;if(lo.test(e)){t={};let o;for(;o=e.match(lo);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Pt(e.slice(2)),t]}let Qs=0;const Ml=Promise.resolve(),Ol=()=>Qs||(Ml.then(()=>Qs=0),Qs=Date.now());function Dl(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;ut(Rl(o,n.value),t,5,[o])};return n.value=e,n.attached=Ol(),n}function Rl(e,t){if(de(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>r=>!r._stopped&&o&&o(r))}else return t}const io=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ll=(e,t,n,o,r,a)=>{const l=r==="svg";t==="class"?kl(e,o,l):t==="style"?Tl(e,n,o):Is(t)?As(t)||Il(e,t,n,o,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jl(e,t,o,l))?(ro(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&oo(e,t,o,l,a,t!=="value")):e._isVueCE&&(Ul(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Pe(o)))?ro(e,Ve(t),o,a,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),oo(e,t,o,l))};function jl(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&io(t)&&xe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return io(t)&&Pe(n)?!1:t in e}function Ul(e,t){const n=e._def.props;if(!n)return!1;const o=Ve(t);return Array.isArray(n)?n.some(r=>Ve(r)===o):Object.keys(n).some(r=>Ve(r)===o)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return de(t)?n=>hs(t,n):t};function Nl(e){e.target.composing=!0}function uo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const gt=Symbol("_assign");function co(e,t,n){return t&&(e=e.trim()),n&&(e=Ds(e)),e}const ee={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e[gt]=Ft(r);const a=o||r.props&&r.props.type==="number";Ct(e,t?"change":"input",l=>{l.target.composing||e[gt](co(e.value,n,a))}),(n||a)&&Ct(e,"change",()=>{e.value=co(e.value,n,a)}),t||(Ct(e,"compositionstart",Nl),Ct(e,"compositionend",uo),Ct(e,"change",uo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:r,number:a}},l){if(e[gt]=Ft(l),e.composing)return;const i=(a||e.type==="number")&&!/^0\d/.test(e.value)?Ds(e.value):e.value,c=t??"";if(i===c)return;const v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(o&&t===n||r&&e.value.trim()===c)||(e.value=c)}},ot={deep:!0,created(e,t,n){e[gt]=Ft(n),Ct(e,"change",()=>{const o=e._modelValue,r=cs(e),a=e.checked,l=e[gt];if(de(o)){const i=mn(o,r),c=i!==-1;if(a&&!c)l(o.concat(r));else if(!a&&c){const v=[...o];v.splice(i,1),l(v)}}else if(Kt(o)){const i=new Set(o);a?i.add(r):i.delete(r),l(i)}else l(hr(e,a))})},mounted:fo,beforeUpdate(e,t,n){e[gt]=Ft(n),fo(e,t,n)}};function fo(e,{value:t,oldValue:n},o){e._modelValue=t;let r;if(de(t))r=mn(t,o.props.value)>-1;else if(Kt(t))r=t.has(o.props.value);else{if(t===n)return;r=Wt(t,hr(e,!0))}e.checked!==r&&(e.checked=r)}const Ie={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const r=Kt(t);Ct(e,"change",()=>{const a=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>n?Ds(cs(l)):cs(l));e[gt](e.multiple?r?new Set(a):a:a[0]),e._assigning=!0,No(()=>{e._assigning=!1})}),e[gt]=Ft(o)},mounted(e,{value:t}){po(e,t)},beforeUpdate(e,t,n){e[gt]=Ft(n)},updated(e,{value:t}){e._assigning||po(e,t)}};function po(e,t){const n=e.multiple,o=de(t);if(!(n&&!o&&!Kt(t))){for(let r=0,a=e.options.length;r<a;r++){const l=e.options[r],i=cs(l);if(n)if(o){const c=typeof i;c==="string"||c==="number"?l.selected=t.some(v=>String(v)===String(i)):l.selected=mn(t,i)>-1}else l.selected=t.has(i);else if(Wt(cs(l),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function hr(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Vl=["ctrl","shift","alt","meta"],Bl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Vl.some(n=>e[`${n}Key`]&&!t.includes(n))},Dt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((r,...a)=>{for(let l=0;l<t.length;l++){const i=Bl[t[l]];if(i&&i(r,t))return}return e(r,...a)}))},Hl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},qe=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const a=Pt(r.key);if(t.some(l=>l===a||Hl[l]===a))return e(r)}))},Fl=Me({patchProp:Ll},_l);let mo;function Kl(){return mo||(mo=Xa(Fl))}const Wl=((...e)=>{const t=Kl().createApp(...e),{mount:n}=t;return t.mount=o=>{const r=Jl(o);if(!r)return;const a=t._component;!xe(a)&&!a.render&&!a.template&&(a.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const l=n(r,!1,zl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t});function zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Jl(e){return Pe(e)?document.querySelector(e):e}let En="";function Yt(e){En=e}function ge(){return En}async function ce(e,t){const n=await fetch(e,{...t,headers:{Authorization:`Bearer ${En}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!n.ok){let o=n.statusText;try{const a=await n.json();a&&typeof a.error=="string"&&a.error&&(o=a.error)}catch{}const r=new Error(o);throw r.status=n.status,r}return n.json()}const ql={class:"animate-fade-in"},Gl={key:0,class:"text-center py-12 text-textSecondary"},Yl={key:1,class:"text-center text-textSecondary py-12"},Zl={key:2,class:"space-y-3"},Ql={class:"flex items-center justify-between"},Xl={class:"flex items-center gap-3"},ei={class:"font-medium"},ti={class:"text-accentLight"},si={class:"text-textSecondary text-xs"},ni={key:2,class:"text-muted italic"},oi={class:"text-xs text-textSecondary font-mono"},ri={class:"text-right"},ai={class:"flex items-center gap-2 justify-end"},li={class:"text-xs text-textSecondary"},ii=Oe({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,n=w([]),o=w(!0);async function r(){o.value=!0;try{const v=await ce("/api/status");n.value=(v.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 a=Te(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??n.value).slice().sort((p,k)=>p.status==="active"&&k.status!=="active"?-1:p.status!=="active"&&k.status==="active"?1:k.lastActivity-p.lastActivity)});function l(v){const f=Math.floor((Date.now()-v.lastActivity)/6e4);return v.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 i(v){if(!v.lastWaitCallAt)return"";const f=Math.floor((Date.now()-v.lastWaitCallAt)/6e4);return f<5?`Polling — ${f===0?"just now":f+"m ago"}`:`Last poll — ${f}m ago`}function c(v){return v.lastWaitCallAt?Math.floor((Date.now()-v.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return De(r),(v,f)=>(m(),x("div",ql,[o.value&&a.value.length===0?(m(),x("div",Gl,"Loading sessions...")):a.value.length===0?(m(),x("div",Yl,"No sessions")):(m(),x("div",Zl,[(m(!0),x(se,null,me(a.value,p=>(m(),x("div",{key:p.mcpSessionId,class:G(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[s("div",Ql,[s("div",Xl,[s("span",{class:G(["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),s("div",null,[s("div",ei,[p.topicName?(m(),x(se,{key:0},[s("span",ti,b(p.topicName),1),s("span",si," (thread "+b(p.threadId)+")",1)],64)):p.threadId!=null?(m(),x(se,{key:1},[Y("Thread "+b(p.threadId),1)],64)):(m(),x("span",ni,"Awaiting start_session…"))]),s("div",oi,b(p.mcpSessionId.slice(0,12))+"...",1)])]),s("div",ri,[s("div",ai,[s("span",{class:G(["text-sm font-medium",l(p).color])},b(l(p).label),3),i(p)?(m(),x("span",{key:0,class:G(["text-xs ml-2",c(p)])},b(i(p)),3)):U("",!0)]),s("div",li,b(p.transportType),1)])])],2))),128))]))]))}}),di={class:"animate-fade-in"},ui={class:"flex flex-wrap items-center gap-3 mb-4"},ci={key:0,class:"text-center py-12 text-textSecondary"},fi={key:1,class:"text-center py-12 text-textSecondary"},pi={key:2,class:"space-y-2"},mi={class:"flex items-start justify-between gap-3"},xi={class:"flex-1 min-w-0"},vi={class:"flex items-center gap-2 mb-1"},gi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},bi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},hi={class:"text-xs text-textSecondary"},yi={class:"text-sm text-textPrimary leading-relaxed"},_i={class:"flex flex-wrap gap-1.5 mt-2"},wi={class:"text-right shrink-0"},ki={class:"text-sm font-mono text-textSecondary"},$i={class:"text-xs text-muted"},Si={class:"text-xs text-muted"},Ci=Oe({__name:"MemoryNotesTab",setup(e){const t=w([]),n=w(!1),o=w(""),r=w("created_at"),a=w("");let l=null;async function i(){n.value=!0;try{const f=a.value.trim();let p;if(f)p=await ce(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const k=new URLSearchParams({limit:"50",sort:r.value});o.value&&k.set("type",o.value),p=await ce(`/api/notes?${k}`)}t.value=p}finally{n.value=!1}}function c(){l&&clearTimeout(l),l=setTimeout(i,300)}function v(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),k=Math.floor(p/6e4);if(k<1)return"just now";if(k<60)return`${k}m ago`;const S=Math.floor(k/60);return S<24?`${S}h ago`:`${Math.floor(S/24)}d ago`}return De(i),(f,p)=>(m(),x("div",di,[s("div",ui,[F(s("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>a.value=k),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,a.value]]),F(s("select",{"onUpdate:modelValue":p[1]||(p[1]=k=>o.value=k),onChange:i,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[pt('<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),[[Ie,o.value]]),F(s("select",{"onUpdate:modelValue":p[2]||(p[2]=k=>r.value=k),onChange:i,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[4]||(p[4]=[s("option",{value:"created_at"},"Newest",-1),s("option",{value:"confidence"},"Confidence",-1),s("option",{value:"access_count"},"Most accessed",-1)])],544),[[Ie,r.value]])]),n.value?(m(),x("div",ci,"Loading notes...")):t.value.length===0?(m(),x("div",fi,"No notes found")):(m(),x("div",pi,[(m(!0),x(se,null,me(t.value,k=>(m(),x("div",{key:k.noteId,class:G(["glass rounded-xl p-4 animate-fade-in",`priority-${k.priority||0}`])},[s("div",mi,[s("div",xi,[s("div",vi,[s("span",{class:G(["type-badge",`type-${k.type}`])},b(k.type),3),k.priority>=2?(m(),x("span",gi,"HIGH IMPORTANCE")):k.priority===1?(m(),x("span",bi,"NOTABLE")):U("",!0),s("span",hi,b(k.noteId),1)]),s("p",yi,b(k.content),1),s("div",_i,[(m(!0),x(se,null,me(k.keywords||[],S=>(m(),x("span",{key:S,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b(S),1))),128))])]),s("div",wi,[s("div",ki,b(((Number(k.confidence)||0)*100).toFixed(0))+"%",1),s("div",$i,b(v(k.createdAt)),1),s("div",Si,b(k.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Ti={class:"animate-fade-in space-y-6"},Pi={class:"glass rounded-xl p-4"},Ei={class:"flex flex-wrap items-center gap-4 mb-4"},Ii={key:0,class:"text-sm text-success"},Ai={class:"flex flex-wrap items-center gap-3 mb-4"},Mi={key:0,class:"text-sm text-success"},Oi={class:"glass rounded-xl p-6"},Di={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ri={class:"flex items-center gap-2"},Li={key:0,class:"text-sm text-success"},ji={key:0,class:"mb-3"},Ui={class:"mt-4"},Ni=["innerHTML"],Vi={class:"glass rounded-xl p-6"},Bi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Hi={class:"flex items-center gap-2"},Fi={key:0,class:"text-sm text-success"},Ki={class:"flex gap-2 mb-4"},Wi=["onClick"],zi={key:0,class:"mb-3"},Ji=["value","placeholder"],qi={class:"glass rounded-xl p-6"},Gi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Yi={class:"flex items-center gap-2"},Zi={key:0,class:"text-sm text-success"},Qi={class:"mb-4 flex flex-wrap items-center gap-3"},Xi={class:"flex items-center gap-2"},ed={class:"font-mono text-sm text-textPrimary"},td={key:0,class:"mb-3"},sd={class:"flex flex-wrap gap-2 mb-3"},nd=["onClick"],od={class:"mt-4"},rd=["innerHTML"],ad=Oe({__name:"TemplatesTab",setup(e){function t(O){return O.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const n=w("copilot"),o=w(""),r=w(50),a=w(""),l=w(""),i=w(!0),c=w(""),v=w(!1),f=w({}),p=w("copilot"),k=w(""),S=w(""),E=w(!0),y=w(""),H=w(!1),C=w([]),M=w("");async function L(){await Promise.all([D(),X(),te(),re()])}async function D(){try{const O=await ce("/api/settings/agent-type");n.value=O.agentType||"copilot"}catch{}}async function X(){try{const O=await ce("/api/settings/bootstrap-message-count");r.value=O.count??50}catch{}}async function te(){try{const O=await ce("/api/templates");if(O.templates&&O.templates.length>0){const P=O.templates[0];l.value=P.content||"",i.value=P.isDefault??!0}O.agentReminders&&(f.value=O.agentReminders)}catch{}}async function re(){try{const[O,P,z]=await Promise.all([ce("/api/templates/drive"),ce("/api/templates/drive-presets"),ce("/api/settings/dmn-activation-hours")]);C.value=P.presets||[],M.value=String(z.value??"not set"),O.custom?(S.value=O.custom,E.value=!1):(S.value=O.default||"",E.value=!0)}catch{}}async function pe(){try{await ce("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:n.value})}),await ce("/api/templates/reminders",{method:"DELETE"}),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3),await te()}catch(O){o.value="Error: "+O.message}}async function be(){try{await ce("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),a.value="Saved ✓",setTimeout(()=>{a.value=""},3e3)}catch(O){a.value="Error: "+O.message}}async function ne(){try{const O=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({content:l.value})});if(!O.ok)throw new Error(O.statusText);i.value=!1,c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3)}catch(O){c.value="Error: "+O.message}}async function $(){if(confirm("Reset to default template? Your customizations will be lost."))try{const O=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!O.ok)throw new Error(O.statusText);await te(),c.value="Reset to default ✓",setTimeout(()=>{c.value=""},3e3)}catch(O){c.value="Error: "+O.message}}async function h(){var z;const O=p.value,P=((z=f.value[O])==null?void 0:z.content)??"";try{const ve=await fetch(`/api/templates/reminders-${O}`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({content:P})});if(!ve.ok)throw new Error(ve.statusText);f.value[O]={content:P,isDefault:!1},k.value=`Saved ${O} ✓`,setTimeout(()=>{k.value=""},3e3)}catch(ve){k.value="Error: "+ve.message}}async function _(){const O=p.value;if(confirm(`Reset ${O} agent reminder? The custom template will be removed.`))try{const P=await fetch(`/api/templates/reminders-${O}`,{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!P.ok)throw new Error(P.statusText);await te(),k.value=`Reset ${O} ✓`,setTimeout(()=>{k.value=""},3e3)}catch(P){k.value="Error: "+P.message}}async function I(){const O=S.value;if(!O.trim()){y.value="Template is empty — load a preset first",setTimeout(()=>{y.value=""},3e3);return}try{const P=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({content:O})});if(!P.ok)throw new Error(P.statusText);E.value=!1,y.value="Saved ✓",setTimeout(()=>{y.value=""},3e3)}catch(P){y.value="Error: "+P.message}}async function R(){if(confirm("Reset drive template? The custom template will be removed."))try{const O=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!O.ok)throw new Error(O.statusText);await re(),y.value="Reset to default ✓",setTimeout(()=>{y.value=""},3e3)}catch(O){y.value="Error: "+O.message}}function W(O){S.value=O.content,E.value=!1}const ue=Te(()=>t(l.value)),oe=Te(()=>S.value?t(S.value):'<span style="color:#6b7280">(no template loaded)</span>');return De(L),(O,P)=>{var z,ve;return m(),x("div",Ti,[s("div",Pi,[s("div",Ei,[P[8]||(P[8]=s("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),F(s("select",{"onUpdate:modelValue":P[0]||(P[0]=le=>n.value=le),onChange:pe,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...P[7]||(P[7]=[s("option",{value:"claude"},"Claude",-1),s("option",{value:"copilot"},"Copilot",-1),s("option",{value:"codex"},"Codex",-1)])],544),[[Ie,n.value]]),o.value?(m(),x("span",Ii,b(o.value),1)):U("",!0),P[9]||(P[9]=s("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),s("div",Ai,[P[10]||(P[10]=s("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),F(s("input",{"onUpdate:modelValue":P[1]||(P[1]=le=>r.value=le),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}]]),s("button",{onClick:be,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),a.value?(m(),x("span",Mi,b(a.value),1)):U("",!0),P[11]||(P[11]=s("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),s("div",Oi,[s("div",Di,[P[12]||(P[12]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Reminders Template"),s("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),s("div",Ri,[c.value?(m(),x("span",Li,b(c.value),1)):U("",!0),s("button",{onClick:$,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"),s("button",{onClick:ne,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i.value?(m(),x("div",ji,[...P[13]||(P[13]=[s("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):U("",!0),F(s("textarea",{"onUpdate:modelValue":P[2]||(P[2]=le=>l.value=le),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,l.value]]),s("div",Ui,[s("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:P[3]||(P[3]=le=>v.value=!v.value)},[(m(),x("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",v.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...P[14]||(P[14]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),P[15]||(P[15]=s("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),v.value?(m(),x("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ue.value},null,8,Ni)):U("",!0)]),P[16]||(P[16]=pt('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),s("div",Vi,[s("div",Bi,[P[17]||(P[17]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),s("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),s("div",Hi,[k.value?(m(),x("span",Fi,b(k.value),1)):U("",!0),s("button",{onClick:_,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"),s("button",{onClick:h,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),s("div",Ki,[(m(),x(se,null,me(["claude","copilot","codex"],le=>s("button",{key:le,onClick:A=>p.value=le,class:G(["px-4 py-2 rounded-xl text-sm font-medium transition",p.value===le?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},b(le.charAt(0).toUpperCase()+le.slice(1)),11,Wi)),64))]),((z=f.value[p.value])==null?void 0:z.isDefault)!==!1?(m(),x("div",zi,[...P[18]||(P[18]=[s("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)])])):U("",!0),s("textarea",{value:((ve=f.value[p.value])==null?void 0:ve.content)??"",onInput:P[4]||(P[4]=le=>{const A=le.target;f.value[p.value]={content:A.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,Ji)]),s("div",qi,[s("div",Gi,[P[19]||(P[19]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),s("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),s("div",Yi,[y.value?(m(),x("span",Zi,b(y.value),1)):U("",!0),s("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 to Default"),s("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),s("div",Qi,[P[21]||(P[21]=s("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),s("div",Xi,[s("span",ed,b(M.value),1),P[20]||(P[20]=s("span",{class:"text-sm text-textSecondary"},"hours",-1))]),P[22]||(P[22]=s("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),E.value?(m(),x("div",td,[...P[23]||(P[23]=[s("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):U("",!0),s("div",sd,[P[24]||(P[24]=s("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(m(!0),x(se,null,me(C.value,le=>(m(),x("button",{key:le.key,onClick:A=>W(le),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"},b(le.label),9,nd))),128))]),F(s("textarea",{"onUpdate:modelValue":P[5]||(P[5]=le=>S.value=le),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,S.value]]),s("div",od,[s("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:P[6]||(P[6]=le=>H.value=!H.value)},[(m(),x("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",H.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...P[25]||(P[25]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),P[26]||(P[26]=s("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),H.value?(m(),x("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:oe.value},null,8,rd)):U("",!0)]),P[27]||(P[27]=pt('<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))])])}}}),ld={class:"animate-fade-in"},id={class:"glass rounded-xl p-6 mb-6"},dd={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ud={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},cd={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},fd={class:"flex items-center gap-4 mb-3"},pd={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},md={class:"flex items-center gap-2"},xd={key:0,class:"text-sm text-warn"},vd={class:"glass rounded-xl p-4 mb-4 border border-gray-700/50"},gd={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3"},bd={class:"sm:col-span-2"},hd={class:"flex items-center gap-2 mb-3"},yd={key:0,class:"space-y-2"},_d={class:"flex items-center gap-2 min-w-0"},wd=["title"],kd=["onClick"],$d={key:1,class:"text-center py-8 text-textSecondary text-sm"},Sd={key:2,class:"text-center text-textSecondary py-12"},Cd={key:3,class:"space-y-2"},Td=["onClick"],Pd={class:"flex items-start justify-between gap-3"},Ed={class:"flex-1 min-w-0"},Id={class:"flex items-center gap-2 mb-1"},Ad={class:"font-medium text-sm"},Md={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},Od={class:"flex flex-wrap gap-1.5 mt-1"},Dd=["title"],Rd={key:0,class:"glass rounded-xl p-6"},Ld={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},jd={class:"text-lg font-semibold"},Ud={class:"text-sm text-textSecondary mt-1"},Nd={class:"flex items-center gap-2"},Vd={key:0,class:"text-sm text-success"},Bd={key:1,class:"text-sm text-warn"},Hd={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Fd=["value"],Kd={class:"flex items-end"},Wd={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},zd=Oe({__name:"SkillsTab",setup(e){const t=w([]),n=w(!0),o=w(null),r=w(""),a=w(""),l=w(!1),i=w(""),c=w(""),v=w(!1),f=w(""),p=w(""),k=w(!1),S=w(""),E=w([]),y=w(""),H=w("sensorium"),C=w("");async function M(){n.value=!0;try{const I=await ce("/api/skills");t.value=I.skills||[]}finally{n.value=!1}}async function L(){const I=await ce("/api/skills/imported");E.value=I.imported||[]}async function D(){const I=y.value.trim();if(!I){C.value="Path is required";return}try{const R=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({path:I,type:H.value})});if(!R.ok){const W=await R.json().catch(()=>({error:R.statusText}));throw new Error(W.error??R.statusText)}y.value="",C.value="Imported ✓",setTimeout(()=>{C.value=""},3e3),await L()}catch(R){C.value="Error: "+R.message}}async function X(I){try{const R=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({path:I})});if(!R.ok)throw new Error(R.statusText);await L()}catch(R){C.value="Error: "+R.message}}function te(I){return I?I.includes(".remote-copilot-mcp")&&I.includes("skills")?"user":I.endsWith(".default.md")?"default":I.endsWith(".skill.md")?"project":"unknown":"unknown"}function re(I){const R={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return R[I]||R.unknown}function pe(I){o.value=I,r.value=I.content,a.value=(I.triggers||[]).join(", "),l.value=!!I.replacesOrchestrator,v.value=!1}function be(){o.value=null,c.value=""}function ne(I,R,W,ue){let oe=`---
65
- name: ${I}
64
+ **/let ln;const Yn=typeof window<"u"&&window.trustedTypes;if(Yn)try{ln=Yn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=ln?e=>ln.createHTML(e):e=>e,ha="http://www.w3.org/2000/svg",ba="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,Gn=ct&&ct.createElement("template"),ya={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(ba,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{Gn.innerHTML=gr(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const u=Gn.content;if(o==="svg"||o==="mathml"){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}t.insertBefore(u,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"),$a=Symbol(""),Sa=/(?:^|;)\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 u=a.slice(0,a.indexOf(":")).trim();s[u]==null&&_s(o,u,"")}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[$a];a&&(s+=";"+a),o.cssText=s,l=Sa.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(re(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(St(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?"":lt(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 u=l==="OPTION"?e.getAttribute("value")||"":e.value,d=s==null?e.type==="checkbox"?"on":"":String(s);(u!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const u=typeof e[t];u==="boolean"?s=ho(s):s==null&&u==="string"?(s="",a=!0):u==="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[u,d]=Aa(t);if(o){const x=l[t]=Ma(o,r);kt(e,u,x,d)}else a&&(Pa(e,u,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):St(e.slice(2)),t]}let Ys=0;const Ia=Promise.resolve(),Oa=()=>Ys||(Ia.then(()=>Ys=0),Ys=Date.now());function Ma(e,t){const s=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=s.attached)return;at(Da(o,s.value),t,5,[o])};return s.value=e,s.attached=Oa(),s}function Da(e,t){if(re(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 re(t)?s=>gs(t,s):t};function Ua(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const xt=Symbol("_assign");function ao(e,t,s){return t&&(e=e.trim()),s&&(e=Os(e)),e}const Z={created(e,{modifiers:{lazy:t,trim:s,number:o}},r){e[xt]=Bt(r);const l=o||r.props&&r.props.type==="number";kt(e,t?"change":"input",a=>{a.target.composing||e[xt](ao(e.value,s,l))}),(s||l)&&kt(e,"change",()=>{e.value=ao(e.value,s,l)}),t||(kt(e,"compositionstart",Ua),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[xt]=Bt(a),e.composing)return;const u=(l||e.type==="number")&&!/^0\d/.test(e.value)?Os(e.value):e.value,d=t??"";if(u===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[xt]=Bt(s),kt(e,"change",()=>{const o=e._modelValue,r=us(e),l=e.checked,a=e[xt];if(re(o)){const u=dn(o,r),d=u!==-1;if(l&&!d)a(o.concat(r));else if(!l&&d){const x=[...o];x.splice(u,1),a(x)}}else if(Ft(o)){const u=new Set(o);l?u.add(r):u.delete(r),a(u)}else a(hr(e,l))})},mounted:uo,beforeUpdate(e,t,s){e[xt]=Bt(s),uo(e,t,s)}};function uo(e,{value:t,oldValue:s},o){e._modelValue=t;let r;if(re(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 ze={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(us(a)):us(a));e[xt](e.multiple?r?new Set(l):l:l[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[xt]=Bt(o)},mounted(e,{value:t}){co(e,t)},beforeUpdate(e,t,s){e[xt]=Bt(s)},updated(e,{value:t}){e._assigning||co(e,t)}};function co(e,t){const s=e.multiple,o=re(t);if(!(s&&!o&&!Ft(t))){for(let r=0,l=e.options.length;r<l;r++){const a=e.options[r],u=us(a);if(s)if(o){const d=typeof u;d==="string"||d==="number"?a.selected=t.some(x=>String(x)===String(u)):a.selected=dn(t,u)>-1}else a.selected=t.has(u);else if(Ht(us(a),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function us(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 Na={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},et=(e,t)=>{const s=e._withKeys||(e._withKeys={}),o=t.join(".");return s[o]||(s[o]=(r=>{if(!("key"in r))return;const l=St(r.key);if(t.some(a=>a===l||Na[a]===l))return e(r)}))},Va=Ee({patchProp:Ra},ya);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 de(){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 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"},Ya={class:"flex items-center justify-between"},Ga={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=Ne({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=k([]),o=k(!0);async function r(){o.value=!0;try{const x=await pe("/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,w)=>p.status==="active"&&w.status!=="active"?-1:p.status!=="active"&&w.status==="active"?1:w.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 u(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 je(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(te,null,ce(l.value,p=>(v(),g("div",{key:p.mcpSessionId,class:q(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[n("div",Ya,[n("div",Ga,[n("span",{class:q(["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(te,{key:0},[n("span",Qa,y(p.topicName),1),n("span",Xa," (thread "+y(p.threadId)+")",1)],64)):p.threadId!=null?(v(),g(te,{key:1},[Y("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:q(["text-sm font-medium",a(p).color])},y(a(p).label),3),u(p)?(v(),g("span",{key:0,class:q(["text-xs ml-2",d(p)])},y(u(p)),3)):F("",!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"},ui={key:1,class:"text-center py-12 text-textSecondary"},ci={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"},bi={class:"text-right shrink-0"},yi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=Ne({__name:"MemoryNotesTab",setup(e){const t=k([]),s=k(!1),o=k(""),r=k("created_at"),l=k("");let a=null;async function u(){s.value=!0;try{const f=l.value.trim();let p;if(f)p=await pe(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const w=new URLSearchParams({limit:"50",sort:r.value});o.value&&w.set("type",o.value),p=await pe(`/api/notes?${w}`)}t.value=p}finally{s.value=!1}}function d(){a&&clearTimeout(a),a=setTimeout(u,300)}function x(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),w=Math.floor(p/6e4);if(w<1)return"just now";if(w<60)return`${w}m ago`;const T=Math.floor(w/60);return T<24?`${T}h ago`:`${Math.floor(T/24)}d ago`}return je(u),(f,p)=>(v(),g("div",li,[n("div",ai,[J(n("input",{"onUpdate:modelValue":p[0]||(p[0]=w=>l.value=w),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),[[Z,l.value]]),J(n("select",{"onUpdate:modelValue":p[1]||(p[1]=w=>o.value=w),onChange:u,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[dt('<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),[[ze,o.value]]),J(n("select",{"onUpdate:modelValue":p[2]||(p[2]=w=>r.value=w),onChange:u,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),[[ze,r.value]])]),s.value?(v(),g("div",ii,"Loading notes...")):t.value.length===0?(v(),g("div",ui,"No notes found")):(v(),g("div",ci,[(v(!0),g(te,null,ce(t.value,w=>(v(),g("div",{key:w.noteId,class:q(["glass rounded-xl p-4 animate-fade-in",`priority-${w.priority||0}`])},[n("div",di,[n("div",fi,[n("div",pi,[n("span",{class:q(["type-badge",`type-${w.type}`])},y(w.type),3),w.priority>=2?(v(),g("span",mi,"HIGH IMPORTANCE")):w.priority===1?(v(),g("span",xi,"NOTABLE")):F("",!0),n("span",vi,y(w.noteId),1)]),n("p",gi,y(w.content),1),n("div",hi,[(v(!0),g(te,null,ce(w.keywords||[],T=>(v(),g("span",{key:T,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(T),1))),128))])]),n("div",bi,[n("div",yi,y(((Number(w.confidence)||0)*100).toFixed(0))+"%",1),n("div",_i,y(x(w.createdAt)),1),n("div",wi,y(w.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),$i={class:"animate-fade-in space-y-6"},Si={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"},Ui={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ni={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"},Yi={class:"mb-4 flex flex-wrap items-center gap-3"},Gi={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"},eu=["onClick"],tu={class:"mt-4"},su=["innerHTML"],nu=Ne({__name:"TemplatesTab",setup(e){function t(B){return B.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=k("copilot"),o=k(""),r=k(50),l=k(""),a=k(""),u=k(!0),d=k(""),x=k(!1),f=k({}),p=k("copilot"),w=k(""),T=k(""),P=k(!0),C=k(""),N=k(!1),S=k([]),A=k("");async function j(){await Promise.all([O(),G(),oe(),ne()])}async function O(){try{const B=await pe("/api/settings/agent-type");s.value=B.agentType||"copilot"}catch{}}async function G(){try{const B=await pe("/api/settings/bootstrap-message-count");r.value=B.count??50}catch{}}async function oe(){try{const B=await pe("/api/templates");if(B.templates&&B.templates.length>0){const U=B.templates[0];a.value=U.content||"",u.value=U.isDefault??!0}B.agentReminders&&(f.value=B.agentReminders)}catch{}}async function ne(){try{const[B,U,$e]=await Promise.all([pe("/api/templates/drive"),pe("/api/templates/drive-presets"),pe("/api/settings/dmn-activation-hours")]);S.value=U.presets||[],A.value=String($e.value??"not set"),B.custom?(T.value=B.custom,P.value=!1):(T.value=B.default||"",P.value=!0)}catch{}}async function ue(){try{await pe("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await pe("/api/templates/reminders",{method:"DELETE"}),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3),await oe()}catch(B){o.value="Error: "+B.message}}async function ve(){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(B){l.value="Error: "+B.message}}async function X(){try{const B=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!B.ok)throw new Error(B.statusText);u.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(B){d.value="Error: "+B.message}}async function _(){if(confirm("Reset to default template? Your customizations will be lost."))try{const B=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!B.ok)throw new Error(B.statusText);await oe(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(B){d.value="Error: "+B.message}}async function h(){var $e;const B=p.value,U=(($e=f.value[B])==null?void 0:$e.content)??"";try{const ke=await fetch(`/api/templates/reminders-${B}`,{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:U})});if(!ke.ok)throw new Error(ke.statusText);f.value[B]={content:U,isDefault:!1},w.value=`Saved ${B} ✓`,setTimeout(()=>{w.value=""},3e3)}catch(ke){w.value="Error: "+ke.message}}async function b(){const B=p.value;if(confirm(`Reset ${B} agent reminder? The custom template will be removed.`))try{const U=await fetch(`/api/templates/reminders-${B}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!U.ok)throw new Error(U.statusText);await oe(),w.value=`Reset ${B} ✓`,setTimeout(()=>{w.value=""},3e3)}catch(U){w.value="Error: "+U.message}}async function E(){const B=T.value;if(!B.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const U=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!U.ok)throw new Error(U.statusText);P.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(U){C.value="Error: "+U.message}}async function I(){if(confirm("Reset drive template? The custom template will be removed."))try{const B=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!B.ok)throw new Error(B.statusText);await ne(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(B){C.value="Error: "+B.message}}function W(B){T.value=B.content,P.value=!1}const ie=Pe(()=>t(a.value)),ee=Pe(()=>T.value?t(T.value):'<span style="color:#6b7280">(no template loaded)</span>');return je(j),(B,U)=>{var $e,ke;return v(),g("div",$i,[n("div",Si,[n("div",Ci,[U[8]||(U[8]=n("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),J(n("select",{"onUpdate:modelValue":U[0]||(U[0]=ge=>s.value=ge),onChange:ue,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...U[7]||(U[7]=[n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1),n("option",{value:"codex"},"Codex",-1)])],544),[[ze,s.value]]),o.value?(v(),g("span",Ti,y(o.value),1)):F("",!0),U[9]||(U[9]=n("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),n("div",Pi,[U[10]||(U[10]=n("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),J(n("input",{"onUpdate:modelValue":U[1]||(U[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),[[Z,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)):F("",!0),U[11]||(U[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,[U[12]||(U[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)):F("",!0),n("button",{onClick:_,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:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),u.value?(v(),g("div",Di,[...U[13]||(U[13]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):F("",!0),J(n("textarea",{"onUpdate:modelValue":U[2]||(U[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),[[Z,a.value]]),n("div",Ri,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:U[3]||(U[3]=ge=>x.value=!x.value)},[(v(),g("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...U[14]||(U[14]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),U[15]||(U[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)):F("",!0)]),U[16]||(U[16]=dt('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),n("div",Li,[n("div",Ui,[U[17]||(U[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",Ni,[w.value?(v(),g("span",Vi,y(w.value),1)):F("",!0),n("button",{onClick:b,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:h,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(te,null,ce(["claude","copilot","codex"],ge=>n("button",{key:ge,onClick:it=>p.value=ge,class:q(["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))]),(($e=f.value[p.value])==null?void 0:$e.isDefault)!==!1?(v(),g("div",Hi,[...U[18]||(U[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)])])):F("",!0),n("textarea",{value:((ke=f.value[p.value])==null?void 0:ke.content)??"",onInput:U[4]||(U[4]=ge=>{const it=ge.target;f.value[p.value]={content:it.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,[U[19]||(U[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)):F("",!0),n("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"},"Reset to Default"),n("button",{onClick:E,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Yi,[U[21]||(U[21]=n("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),n("div",Gi,[n("span",Zi,y(A.value),1),U[20]||(U[20]=n("span",{class:"text-sm text-textSecondary"},"hours",-1))]),U[22]||(U[22]=n("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),P.value?(v(),g("div",Qi,[...U[23]||(U[23]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):F("",!0),n("div",Xi,[U[24]||(U[24]=n("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(v(!0),g(te,null,ce(S.value,ge=>(v(),g("button",{key:ge.key,onClick:it=>W(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,eu))),128))]),J(n("textarea",{"onUpdate:modelValue":U[5]||(U[5]=ge=>T.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),[[Z,T.value]]),n("div",tu,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:U[6]||(U[6]=ge=>N.value=!N.value)},[(v(),g("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",N.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...U[25]||(U[25]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),U[26]||(U[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,su)):F("",!0)]),U[27]||(U[27]=dt('<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))])])}}}),ou={class:"animate-fade-in"},ru={class:"glass rounded-xl p-6 mb-6"},lu={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},au={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},iu={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},uu={class:"flex items-center gap-4 mb-3"},cu={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},du={class:"flex items-center gap-2"},fu={key:0,class:"text-sm text-warn"},pu={class:"glass rounded-xl p-4 mb-4 border border-gray-700/50"},mu={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3"},xu={class:"sm:col-span-2"},vu={class:"flex items-center gap-2 mb-3"},gu={key:0,class:"space-y-2"},hu={class:"flex items-center gap-2 min-w-0"},bu=["title"],yu=["onClick"],_u={key:1,class:"text-center py-8 text-textSecondary text-sm"},wu={key:2,class:"text-center text-textSecondary py-12"},ku={key:3,class:"space-y-2"},$u=["onClick"],Su={class:"flex items-start justify-between gap-3"},Cu={class:"flex-1 min-w-0"},Tu={class:"flex items-center gap-2 mb-1"},Pu={class:"font-medium text-sm"},Eu={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},Au={class:"flex flex-wrap gap-1.5 mt-1"},Iu=["title"],Ou={key:0,class:"glass rounded-xl p-6"},Mu={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Du={class:"text-lg font-semibold"},Ru={class:"text-sm text-textSecondary mt-1"},ju={class:"flex items-center gap-2"},Lu={key:0,class:"text-sm text-success"},Uu={key:1,class:"text-sm text-warn"},Nu={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Vu=["value"],Bu={class:"flex items-end"},Fu={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Hu=Ne({__name:"SkillsTab",setup(e){const t=k([]),s=k(!0),o=k(null),r=k(""),l=k(""),a=k(!1),u=k(""),d=k(""),x=k(!1),f=k(""),p=k(""),w=k(!1),T=k(""),P=k([]),C=k(""),N=k("sensorium"),S=k("");async function A(){s.value=!0;try{const E=await pe("/api/skills");t.value=E.skills||[]}finally{s.value=!1}}async function j(){const E=await pe("/api/skills/imported");P.value=E.imported||[]}async function O(){const E=C.value.trim();if(!E){S.value="Path is required";return}try{const I=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({path:E,type:N.value})});if(!I.ok){const W=await I.json().catch(()=>({error:I.statusText}));throw new Error(W.error??I.statusText)}C.value="",S.value="Imported ✓",setTimeout(()=>{S.value=""},3e3),await j()}catch(I){S.value="Error: "+I.message}}async function G(E){try{const I=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({path:E})});if(!I.ok)throw new Error(I.statusText);await j()}catch(I){S.value="Error: "+I.message}}function oe(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 ne(E){const I={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 I[E]||I.unknown}function ue(E){o.value=E,r.value=E.content,l.value=(E.triggers||[]).join(", "),a.value=!!E.replacesOrchestrator,x.value=!1}function ve(){o.value=null,d.value=""}function X(E,I,W,ie){let ee=`---
65
+ name: ${E}
66
66
  triggers:
67
- `;return R.forEach(O=>{oe+=` - ${O.trim()}
68
- `}),W&&(oe+=`replaces_orchestrator: true
69
- `),oe+=`---
67
+ `;return I.forEach(B=>{ee+=` - ${B.trim()}
68
+ `}),W&&(ee+=`replaces_orchestrator: true
69
+ `),ee+=`---
70
70
 
71
- `,oe+ue}async function $(){if(!o.value)return;const I=o.value.name;try{const R=a.value.split(",").map(O=>O.trim()).filter(Boolean),W=r.value;let ue;W.trimStart().startsWith("---")?ue=W:ue=ne(I,R,l.value,W);const oe=await fetch(`/api/skills/${encodeURIComponent(I)}`,{method:"PUT",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!oe.ok)throw new Error(oe.statusText);i.value="Saved ✓",setTimeout(()=>{i.value=""},3e3),await M()}catch(R){i.value="Error: "+R.message}}async function h(){if(!o.value)return;const I=o.value.name;try{const R=await fetch(`/api/skills/${encodeURIComponent(I)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!R.ok)throw new Error(R.statusText);be(),await M()}catch(R){c.value="Error: "+R.message}}async function _(){const I=f.value.trim(),R=p.value;if(!I){S.value="Name is required";return}const W=R.split(",").map(oe=>oe.trim()).filter(Boolean);if(!W.length){S.value="At least one trigger is required";return}const ue=ne(I,W,k.value,`\x3C!-- Write your skill instructions here -->
72
- `);try{const oe=await fetch(`/api/skills/${encodeURIComponent(I)}`,{method:"PUT",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!oe.ok)throw new Error(oe.statusText);S.value="Created ✓",v.value=!1,await M();const O=t.value.find(P=>P.name===I);O&&pe(O)}catch(oe){S.value="Error: "+oe.message}}return De(()=>{M(),L()}),(I,R)=>(m(),x("div",ld,[s("div",id,[s("div",dd,[R[10]||(R[10]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Skill Library"),s("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),s("button",{onClick:R[0]||(R[0]=W=>{v.value=!v.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 ")]),v.value?(m(),x("div",ud,[R[14]||(R[14]=s("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),s("div",cd,[s("div",null,[R[11]||(R[11]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),F(s("input",{"onUpdate:modelValue":R[1]||(R[1]=W=>f.value=W),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,f.value]])]),s("div",null,[R[12]||(R[12]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),F(s("input",{"onUpdate:modelValue":R[2]||(R[2]=W=>p.value=W),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,p.value]])])]),s("div",fd,[s("label",pd,[F(s("input",{"onUpdate:modelValue":R[3]||(R[3]=W=>k.value=W),type:"checkbox",class:"rounded"},null,512),[[ot,k.value]]),R[13]||(R[13]=s("span",null,"Replaces orchestrator",-1))])]),s("div",md,[s("button",{onClick:_,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),s("button",{onClick:R[4]||(R[4]=W=>v.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?(m(),x("span",xd,b(S.value),1)):U("",!0)])])):U("",!0),s("div",vd,[R[18]||(R[18]=s("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),R[19]||(R[19]=s("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)),s("div",gd,[s("div",bd,[R[15]||(R[15]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),F(s("input",{"onUpdate:modelValue":R[5]||(R[5]=W=>y.value=W),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),[[ee,y.value]])]),s("div",null,[R[17]||(R[17]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),F(s("select",{"onUpdate:modelValue":R[6]||(R[6]=W=>H.value=W),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...R[16]||(R[16]=[s("option",{value:"sensorium"},"Sensorium",-1),s("option",{value:"claude"},"Claude",-1),s("option",{value:"copilot"},"Copilot",-1)])],512),[[Ie,H.value]])])]),s("div",hd,[s("button",{onClick:D,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),C.value?(m(),x("span",{key:0,class:G([C.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(C.value),3)):U("",!0)]),E.value.length?(m(),x("div",yd,[(m(!0),x(se,null,me(E.value,W=>(m(),x("div",{key:W.path,class:"flex items-center justify-between gap-3 rounded-lg bg-surface/50 border border-gray-700/50 px-3 py-2"},[s("div",_d,[s("span",{class:"type-badge",style:bt(re("user"))},b(W.type),5),s("span",{class:"text-xs font-mono text-textSecondary truncate",title:W.path},b(W.path),9,wd)]),s("button",{onClick:ue=>X(W.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,kd)]))),128))])):U("",!0)]),n.value?(m(),x("div",$d,"Loading...")):t.value.length===0?(m(),x("div",Sd,"No skills loaded")):(m(),x("div",Cd,[(m(!0),x(se,null,me(t.value,W=>{var ue;return m(),x("div",{key:W.name,onClick:oe=>pe(W),class:G(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=o.value)==null?void 0:ue.name)===W.name?"border-accent":"border-transparent"])},[s("div",Pd,[s("div",Ed,[s("div",Id,[s("span",Ad,b(W.name),1),s("span",{class:"type-badge",style:bt(re(te(W.source)))},b(te(W.source)),5),W.replacesOrchestrator?(m(),x("span",Md,"REPLACES ORCH")):U("",!0)]),s("div",Od,[(m(!0),x(se,null,me(W.triggers||[],oe=>(m(),x("span",{key:oe,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b(oe),1))),128))])]),s("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:W.source||""},b((W.source||"").split(/[\\/]/).pop()||""),9,Dd)])],10,Td)}),128))]))]),o.value?(m(),x("div",Rd,[s("div",Ld,[s("div",null,[s("h3",jd,"Edit: "+b(o.value.name),1),s("p",Ud,b(o.value.source||"(unknown source)"),1)]),s("div",Nd,[i.value?(m(),x("span",Vd,b(i.value),1)):U("",!0),c.value?(m(),x("span",Bd,b(c.value),1)):U("",!0),te(o.value.source)==="user"?(m(),x("button",{key:2,onClick:h,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")):U("",!0),s("button",{onClick:be,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"),s("button",{onClick:$,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),s("div",Hd,[s("div",null,[R[20]||(R[20]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),s("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,Fd)]),s("div",null,[R[21]||(R[21]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),F(s("input",{"onUpdate:modelValue":R[7]||(R[7]=W=>a.value=W),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,a.value]])]),s("div",Kd,[s("label",Wd,[F(s("input",{"onUpdate:modelValue":R[8]||(R[8]=W=>l.value=W),type:"checkbox",class:"rounded"},null,512),[[ot,l.value]]),R[22]||(R[22]=s("span",null,"Replaces orchestrator",-1))])])]),F(s("textarea",{"onUpdate:modelValue":R[9]||(R[9]=W=>r.value=W),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]])])):U("",!0)]))}}),Jd={class:"animate-fade-in space-y-6"},qd={class:"glass rounded-xl p-6"},Gd={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Yd={class:"flex items-center gap-3"},Zd={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Qd={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Xd=["value"],eu={class:"flex justify-end"},tu=["disabled"],su={key:0,class:"text-center py-12 text-textSecondary"},nu={key:1,class:"text-center py-8 text-danger text-sm"},ou={key:2,class:"text-center py-12 text-textSecondary"},ru={key:3},au={class:"space-y-3"},lu={class:"p-4"},iu={class:"flex flex-wrap items-center gap-3"},du=["onBlur"],uu=["onDblclick"],cu={class:"text-xs text-muted font-mono"},fu=["value","onChange"],pu=["value"],mu=["value"],xu={class:"text-xs text-muted"},vu=["onKeyup","onBlur"],gu=["title","onDblclick"],bu={class:"ml-auto flex items-center gap-3"},hu=["onClick","disabled"],yu={class:"flex items-center gap-1.5"},_u=["onClick"],wu={class:"flex items-center gap-1.5"},ku=["onClick"],$u={class:"flex items-center gap-1.5"},Su=["onClick"],Cu=["onClick"],Tu=["onClick"],Pu=["onClick"],Eu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},Iu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},Au=["value"],Mu={class:"flex items-center gap-2"},Ou=["onClick","disabled"],Du={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Ru={key:0,class:"text-xs text-muted py-1"},Lu={class:"text-sm font-medium"},ju={class:"text-xs text-muted font-mono"},Uu=["value","onChange"],Nu=["value"],Vu=["value"],Bu={class:"text-xs text-muted"},Hu=["onBlur","onKeyup"],Fu=["title","onDblclick"],Ku={class:"ml-auto flex items-center gap-3"},Wu=["onClick","disabled"],zu=["onClick","disabled"],Ju=["onClick","disabled"],qu={key:2,class:"flex items-center gap-1.5"},Gu=["onClick"],Yu={key:3,class:"flex items-center gap-1.5"},Zu=["onClick"],Qu={key:4,class:"flex items-center gap-1.5"},Xu=["onClick"],ec=["onClick"],tc={key:4},sc={class:"space-y-2"},nc={class:"font-medium"},oc={class:"text-xs text-muted font-mono"},rc={class:"text-xs text-textSecondary"},ac={class:"text-xs text-muted"},lc={class:"ml-auto flex items-center gap-2"},ic=["onClick","disabled"],dc=["onClick","disabled"],uc=["onClick"],cc={key:5},fc={class:"space-y-2"},pc={class:"font-medium"},mc={class:"text-xs text-muted font-mono"},xc=["value","onChange"],vc=["value"],gc=["value"],bc={class:"text-xs text-muted"},hc=["onBlur","onKeyup"],yc=["title","onDblclick"],_c={class:"ml-auto flex items-center gap-3"},wc=["onClick","disabled"],kc=["onClick","disabled"],$c={class:"flex items-center gap-1.5"},Sc=["onClick"],Cc={class:"flex items-center gap-1.5"},Tc=["onClick"],Pc={class:"flex items-center gap-1.5"},Ec=["onClick"],Ic=["onClick"],Ac={key:6},Mc={class:"space-y-2"},Oc={class:"font-medium"},Dc={class:"text-xs text-muted font-mono"},Rc=["value","onChange"],Lc=["value"],jc=["value"],Uc={class:"text-xs text-muted"},Nc=Oe({__name:"ThreadsTab",setup(e){const t=w([]),n=w(!0),o=w(""),r=w({}),a=w(new Set),l=w(!1),i=w({name:"",threadId:0,client:"claude",workingDirectory:""}),c=w(""),v=w(!1),f=w(null),p=w(""),k=w(null),S=w(""),E=w(null),y=w({name:"",threadId:0,client:"claude",workingDirectory:""}),H=w(""),C=w(!1),M=w(null),L=w(null),D=w(null),X=["claude","copilot","codex","fable"];function te(J){return X.includes(J)}const re={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"}},pe=Te(()=>t.value.filter(J=>J.type==="root")),be=Te(()=>t.value.filter(J=>J.type==="daily")),ne=Te(()=>t.value.filter(J=>J.type==="branch")),$=Te(()=>t.value.filter(J=>J.type==="worker"));async function h(){n.value=!0,o.value="";try{const J=await ce("/api/threads");t.value=J.threads??[]}catch(J){o.value=J.message||"Failed to load threads"}finally{n.value=!1}}async function _(J){try{const d=await ce(`/api/threads/${J}/children`);r.value[J]=d.threads??[]}catch{r.value[J]=[]}}function I(J){a.value.has(J)?a.value.delete(J):(a.value.add(J),_(J))}async function R(){if(!(!i.value.name.trim()||!i.value.threadId)){v.value=!0,c.value="";try{const J=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"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(!J.ok){const d=await J.json().catch(()=>({error:J.statusText}));throw new Error(d.error??J.statusText)}c.value="Created ✓",i.value={name:"",threadId:0,client:"claude",workingDirectory:""},l.value=!1,setTimeout(()=>{c.value=""},3e3),await h()}catch(J){c.value="Error: "+J.message}finally{v.value=!1}}}async function W(J){if(!(!y.value.name.trim()||!y.value.threadId)){C.value=!0,H.value="";try{const d=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:y.value.threadId,name:y.value.name.trim(),type:"branch",rootThreadId:J,client:y.value.client,...y.value.workingDirectory.trim()?{workingDirectory:y.value.workingDirectory.trim()}:{}})});if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Error(u.error??d.statusText)}H.value="Branch created ✓",y.value={name:"",threadId:0,client:"claude",workingDirectory:""},E.value=null,setTimeout(()=>{H.value=""},3e3),await h(),_(J)}catch(d){H.value="Error: "+d.message}finally{C.value=!1}}}function ue(J){f.value=J.threadId,p.value=J.name}async function oe(J){const d=p.value.trim();if(f.value=null,!!d)try{const u=await fetch(`/api/threads/${J}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({name:d})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to rename thread: "+u.message}}function O(J){k.value=J.threadId,S.value=J.workingDirectory??""}async function P(J){const d=S.value.trim();k.value=null;try{const u=await fetch(`/api/threads/${J}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:d||null})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to update working directory: "+u.message}}async function z(J){try{const d=await fetch(`/api/threads/${J.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!J.keepAlive})});if(!d.ok)throw new Error(d.statusText);await h()}catch(d){o.value="Failed to toggle keep-alive: "+d.message}}async function ve(J,d){try{const u=await fetch(`/api/threads/${J.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({client:d})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to change agent type: "+u.message}}async function le(J){try{const d=await fetch(`/api/threads/${J.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!J.dailyRotation})});if(!d.ok)throw new Error(d.statusText);await h()}catch(d){o.value="Failed to toggle daily rotation: "+d.message}}async function A(J){try{const d=await fetch(`/api/threads/${J.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!J.autonomousMode})});if(!d.ok)throw new Error(d.statusText);await h()}catch(d){o.value="Failed to toggle autonomous mode: "+d.message}}async function Z(J){if(confirm(`Archive thread "${J.name}" (${J.threadId})?`))try{const d=await fetch(`/api/threads/${J.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!d.ok)throw new Error(d.statusText);await h()}catch(d){o.value="Failed to archive: "+d.message}}async function Qe(J){if(confirm(`Start thread "${J.name}" (${J.threadId})?`)){M.value=J.threadId;try{const d=await fetch(`/api/threads/${J.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`}});if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Error(u.error??d.statusText)}await h()}catch(d){o.value="Failed to start thread: "+d.message}finally{M.value=null}}}function kt(J){c.value="Sync to Root — not yet implemented",setTimeout(()=>{c.value=""},3e3)}async function zt(J){if(confirm(`Convert "${J.name}" to a root thread? This will detach it from its parent.`)){D.value=J.threadId;try{const d=await fetch(`/api/threads/${J.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`}});if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Error(u.error??d.statusText)}o.value="",c.value=`Converted "${J.name}" to root ✓`,setTimeout(()=>{c.value=""},3e3),await h()}catch(d){o.value="Failed to convert: "+d.message}finally{D.value=null}}}function $t(J){if(!J)return"—";const d=new Date(J),T=Date.now()-d.getTime();return T<6e4?"just now":T<36e5?`${Math.floor(T/6e4)}m ago`:T<864e5?`${Math.floor(T/36e5)}h ago`:d.toLocaleDateString()}function Je(J){return J==="active"?"text-success":J==="archived"?"text-muted":"text-warn"}return De(h),(J,d)=>(m(),x("div",Jd,[s("div",qd,[s("div",Gd,[d[18]||(d[18]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Thread Registry"),s("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),s("div",Yd,[c.value?(m(),x("span",{key:0,class:G([c.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(c.value),3)):U("",!0),s("button",{onClick:d[0]||(d[0]=u=>l.value=!l.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},b(l.value?"Cancel":"+ New Root Thread"),1),s("button",{onClick:h,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),l.value?(m(),x("div",Zd,[s("div",Qd,[s("div",null,[d[19]||(d[19]=s("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),F(s("input",{"onUpdate:modelValue":d[1]||(d[1]=u=>i.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),[[ee,i.value.name]])]),s("div",null,[d[20]||(d[20]=s("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),F(s("input",{"onUpdate:modelValue":d[2]||(d[2]=u=>i.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),[[ee,i.value.threadId,void 0,{number:!0}]])]),s("div",null,[d[21]||(d[21]=s("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),F(s("select",{"onUpdate:modelValue":d[3]||(d[3]=u=>i.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"},[(m(),x(se,null,me(X,u=>s("option",{key:u,value:u},b(u),9,Xd)),64))],512),[[Ie,i.value.client]])])]),s("div",null,[d[22]||(d[22]=s("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),F(s("input",{"onUpdate:modelValue":d[4]||(d[4]=u=>i.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),[[ee,i.value.workingDirectory]])]),s("div",eu,[s("button",{onClick:R,disabled:v.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"},b(v.value?"Creating…":"Create Root Thread"),9,tu)])])):U("",!0)]),n.value&&t.value.length===0?(m(),x("div",su,"Loading threads…")):o.value?(m(),x("div",nu,b(o.value),1)):t.value.length===0?(m(),x("div",ou,"No threads registered")):U("",!0),pe.value.length>0?(m(),x("div",ru,[d[29]||(d[29]=s("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),s("div",au,[(m(!0),x(se,null,me(pe.value,u=>{var T,j;return m(),x("div",{key:u.id,class:"glass rounded-xl overflow-hidden"},[s("div",lu,[s("div",iu,[s("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(T=re[u.type])==null?void 0:T.classes])},b((j=re[u.type])==null?void 0:j.emoji)+" "+b(u.type.toUpperCase()),3),f.value===u.threadId?F((m(),x("input",{key:0,"onUpdate:modelValue":d[5]||(d[5]=g=>p.value=g),onBlur:g=>oe(u.threadId),onKeyup:[d[6]||(d[6]=qe(g=>g.target.blur(),["enter"])),d[7]||(d[7]=qe(g=>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,du)),[[ee,p.value]]):(m(),x("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:g=>ue(u),title:"Double-click to rename"},b(u.name),41,uu)),s("span",{class:G(["text-xs font-medium",Je(u.status)])},b(u.status),3),s("span",cu,"ID: "+b(u.threadId),1),s("select",{value:u.client,onChange:g=>ve(u,g.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"},[te(u.client)?U("",!0):(m(),x("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,pu)),(m(),x(se,null,me(X,g=>s("option",{key:g,value:g},b(g),9,mu)),64))],40,fu),s("span",xu,b($t(u.lastActiveAt)),1),k.value===u.threadId?F((m(),x("input",{key:2,"onUpdate:modelValue":d[8]||(d[8]=g=>S.value=g),onKeyup:[qe(g=>P(u.threadId),["enter"]),d[9]||(d[9]=qe(g=>k.value=null,["escape"]))],onBlur:g=>P(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,vu)),[[ee,S.value]]):(m(),x("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:g=>O(u)},"📁 "+b(u.workingDirectory??"—"),41,gu)),s("div",bu,[s("button",{onClick:g=>Qe(u),disabled:M.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"},b(M.value===u.threadId?"Starting…":"▶ Start"),9,hu),s("div",yu,[s("button",{onClick:g=>z(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[s("span",{class:G(["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,_u),d[23]||(d[23]=s("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),s("div",wu,[s("button",{onClick:g=>le(u),class:G(["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"},[s("span",{class:G(["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,ku),d[24]||(d[24]=s("span",{class:"text-xs text-muted"},"Daily",-1))]),s("div",$u,[s("button",{onClick:g=>A(u),class:G(["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"},[s("span",{class:G(["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,Su),d[25]||(d[25]=s("span",{class:"text-xs text-muted"},"Auto",-1))]),s("button",{onClick:g=>I(u.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},b(a.value.has(u.threadId)?"▾ Children":"▸ Children"),9,Cu),s("button",{onClick:g=>{E.value=E.value===u.threadId?null:u.threadId,y.value={name:"",threadId:0,client:"claude",workingDirectory:""},H.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,Tu),s("button",{onClick:g=>Z(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,Pu)])]),E.value===u.threadId?(m(),x("div",Eu,[s("div",Iu,[F(s("input",{"onUpdate:modelValue":d[10]||(d[10]=g=>y.value.name=g),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,y.value.name]]),F(s("input",{"onUpdate:modelValue":d[11]||(d[11]=g=>y.value.threadId=g),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,y.value.threadId,void 0,{number:!0}]]),F(s("select",{"onUpdate:modelValue":d[12]||(d[12]=g=>y.value.client=g),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"},[(m(),x(se,null,me(X,g=>s("option",{key:g,value:g},b(g),9,Au)),64))],512),[[Ie,y.value.client]])]),F(s("input",{"onUpdate:modelValue":d[13]||(d[13]=g=>y.value.workingDirectory=g),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,y.value.workingDirectory]]),s("div",Mu,[s("button",{onClick:g=>W(u.threadId),disabled:C.value||!y.value.name.trim()||!y.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"},b(C.value?"Creating…":"Create Branch"),9,Ou),H.value?(m(),x("span",{key:0,class:G([H.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},b(H.value),3)):U("",!0)])])):U("",!0)]),a.value.has(u.threadId)&&r.value[u.threadId]?(m(),x("div",Du,[r.value[u.threadId].length===0?(m(),x("div",Ru,"No children")):U("",!0),(m(!0),x(se,null,me(r.value[u.threadId],g=>{var N,q;return m(),x("div",{key:g.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[s("span",{class:G(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(N=re[g.type])==null?void 0:N.classes])},b((q=re[g.type])==null?void 0:q.emoji)+" "+b(g.type.toUpperCase()),3),s("span",Lu,b(g.name),1),s("span",{class:G(["text-xs",Je(g.status)])},b(g.status),3),s("span",ju,"ID: "+b(g.threadId),1),s("select",{value:g.client,onChange:B=>ve(g,B.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"},[te(g.client)?U("",!0):(m(),x("option",{key:0,value:g.client,disabled:""},b(g.client)+" (legacy)",9,Nu)),(m(),x(se,null,me(X,B=>s("option",{key:B,value:B},b(B),9,Vu)),64))],40,Uu),s("span",Bu,b($t(g.lastActiveAt)),1),g.type==="branch"&&k.value===g.threadId?F((m(),x("input",{key:0,"onUpdate:modelValue":d[14]||(d[14]=B=>S.value=B),onBlur:B=>P(g.threadId),onKeyup:[qe(B=>P(g.threadId),["enter"]),d[15]||(d[15]=qe(B=>k.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,Hu)),[[ee,S.value]]):g.type==="branch"?(m(),x("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(g.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:B=>O(g)},"📁 "+b(g.workingDirectory??"—"),41,Fu)):U("",!0),s("div",Ku,[s("button",{onClick:B=>Qe(g),disabled:M.value===g.threadId||g.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"},b(M.value===g.threadId?"Starting…":"▶ Start"),9,Wu),g.rootThreadId?(m(),x("button",{key:0,onClick:B=>kt(),disabled:L.value===g.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"},b(L.value===g.threadId?"Syncing…":"⟳ Sync to Root"),9,zu)):U("",!0),g.type==="branch"||g.type==="daily"?(m(),x("button",{key:1,onClick:B=>zt(g),disabled:D.value===g.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"},b(D.value===g.threadId?"Converting…":"↑ To Root"),9,Ju)):U("",!0),g.type==="branch"?(m(),x("div",qu,[s("button",{onClick:B=>z(g),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",g.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[s("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",g.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,Gu),d[26]||(d[26]=s("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):U("",!0),g.type==="branch"?(m(),x("div",Yu,[s("button",{onClick:B=>le(g),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",g.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[s("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",g.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Zu),d[27]||(d[27]=s("span",{class:"text-xs text-muted"},"Daily",-1))])):U("",!0),g.type==="branch"?(m(),x("div",Qu,[s("button",{onClick:B=>A(g),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",g.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[s("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",g.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Xu),d[28]||(d[28]=s("span",{class:"text-xs text-muted"},"Auto",-1))])):U("",!0),g.type!=="root"?(m(),x("button",{key:5,onClick:B=>Z(g),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,ec)):U("",!0)])])}),128))])):U("",!0)])}),128))])])):U("",!0),be.value.length>0?(m(),x("div",tc,[d[30]||(d[30]=s("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),s("div",sc,[(m(!0),x(se,null,me(be.value,u=>{var T,j;return m(),x("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[s("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(T=re[u.type])==null?void 0:T.classes])},b((j=re[u.type])==null?void 0:j.emoji)+" "+b(u.type.toUpperCase()),3),s("span",nc,b(u.name),1),s("span",{class:G(["text-xs font-medium",Je(u.status)])},b(u.status),3),s("span",oc,"ID: "+b(u.threadId),1),s("span",rc,b(u.client),1),s("span",ac,b($t(u.lastActiveAt)),1),s("div",lc,[s("button",{onClick:g=>Qe(u),disabled:M.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"},b(M.value===u.threadId?"Starting…":"▶ Start"),9,ic),u.rootThreadId?(m(),x("button",{key:0,onClick:g=>kt(),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"},b(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,dc)):U("",!0),s("button",{onClick:g=>Z(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,uc)])])}),128))])])):U("",!0),ne.value.length>0?(m(),x("div",cc,[d[34]||(d[34]=s("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),s("div",fc,[(m(!0),x(se,null,me(ne.value,u=>{var T,j;return m(),x("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[s("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(T=re[u.type])==null?void 0:T.classes])},b((j=re[u.type])==null?void 0:j.emoji)+" "+b(u.type.toUpperCase()),3),s("span",pc,b(u.name),1),s("span",{class:G(["text-xs font-medium",Je(u.status)])},b(u.status),3),s("span",mc,"ID: "+b(u.threadId),1),s("select",{value:u.client,onChange:g=>ve(u,g.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"},[te(u.client)?U("",!0):(m(),x("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,vc)),(m(),x(se,null,me(X,g=>s("option",{key:g,value:g},b(g),9,gc)),64))],40,xc),s("span",bc,b($t(u.lastActiveAt)),1),k.value===u.threadId?F((m(),x("input",{key:0,"onUpdate:modelValue":d[16]||(d[16]=g=>S.value=g),onBlur:g=>P(u.threadId),onKeyup:[qe(g=>P(u.threadId),["enter"]),d[17]||(d[17]=qe(g=>k.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,hc)),[[ee,S.value]]):(m(),x("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:g=>O(u)},"📁 "+b(u.workingDirectory??"—"),41,yc)),s("div",_c,[s("button",{onClick:g=>Qe(u),disabled:M.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"},b(M.value===u.threadId?"Starting…":"▶ Start"),9,wc),u.rootThreadId?(m(),x("button",{key:0,onClick:g=>kt(),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"},b(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,kc)):U("",!0),s("div",$c,[s("button",{onClick:g=>z(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[s("span",{class:G(["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,Sc),d[31]||(d[31]=s("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),s("div",Cc,[s("button",{onClick:g=>le(u),class:G(["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"},[s("span",{class:G(["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,Tc),d[32]||(d[32]=s("span",{class:"text-xs text-muted"},"Daily",-1))]),s("div",Pc,[s("button",{onClick:g=>A(u),class:G(["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"},[s("span",{class:G(["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,Ec),d[33]||(d[33]=s("span",{class:"text-xs text-muted"},"Auto",-1))]),s("button",{onClick:g=>Z(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,Ic)])])}),128))])])):U("",!0),$.value.length>0?(m(),x("div",Ac,[d[36]||(d[36]=s("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),s("div",Mc,[(m(!0),x(se,null,me($.value,u=>{var T,j;return m(),x("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[s("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(T=re[u.type])==null?void 0:T.classes])},b((j=re[u.type])==null?void 0:j.emoji)+" "+b(u.type.toUpperCase()),3),s("span",Oc,b(u.name),1),s("span",{class:G(["text-xs font-medium",Je(u.status)])},b(u.status),3),s("span",Dc,"ID: "+b(u.threadId),1),s("select",{value:u.client,onChange:g=>ve(u,g.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"},[te(u.client)?U("",!0):(m(),x("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,Lc)),(m(),x(se,null,me(X,g=>s("option",{key:g,value:g},b(g),9,jc)),64))],40,Rc),s("span",Uc,b($t(u.lastActiveAt)),1),d[35]||(d[35]=s("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):U("",!0)]))}}),Vc={class:"animate-fade-in"},Bc={class:"glass rounded-xl p-6 mb-6"},Hc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Fc={class:"flex items-center gap-3"},Kc={key:0,class:"text-center py-8 text-textSecondary text-sm"},Wc={key:1,class:"text-center py-8 text-danger text-sm"},zc={key:2,class:"text-center text-textSecondary py-12"},Jc={key:3,class:"space-y-2"},qc={class:"flex items-center justify-between gap-3"},Gc={class:"flex-1 min-w-0"},Yc={class:"flex items-center gap-2 mb-1"},Zc={class:"font-medium text-sm"},Qc={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Xc={key:0,class:"type-badge",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"}},ef={class:"text-xs text-muted font-mono truncate"},tf={class:"flex items-center gap-2 shrink-0"},sf=["onClick","disabled"],nf=["onClick"],of=["onClick","disabled"],rf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},af={class:"text-lg font-semibold mb-4"},lf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},df=["value"],uf={class:"mb-4"},cf={class:"mb-4"},ff={class:"mb-4"},pf={class:"flex items-center gap-3 flex-wrap"},mf=["disabled"],xf={key:0,class:"text-sm text-danger"},vf=Oe({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],n=w([]),o=w(!0),r=w(""),a=w(""),l=w(!0),i=w(!1),c=w(null),v=w(null),f=w(!1),p=w(null),k=w(""),S=w("claude"),E=w(""),y=w(""),H=w(""),C=w("");async function M(){o.value=!0,r.value="";try{const $=await ce("/api/agent-templates");n.value=$.templates||[]}catch($){r.value="Failed to load templates: "+$.message}finally{o.value=!1}}function L(){p.value=null,k.value="",S.value="claude",E.value="",y.value="",H.value="",C.value="",f.value=!0}function D($){p.value=$.id,k.value=$.name,S.value=$.client,E.value=$.workingDirectory,y.value=$.systemPrompt||"",H.value=$.mcpServers&&Object.keys($.mcpServers).length?JSON.stringify($.mcpServers,null,2):"",C.value="",f.value=!0}function X(){f.value=!1,p.value=null}function te(){C.value="";const $=k.value.trim(),h=E.value.trim();if(!$)return C.value="Name is required",null;if(!h)return C.value="Working directory is required",null;let _={};const I=H.value.trim();if(I){try{_=JSON.parse(I)}catch{return C.value="MCP servers must be valid JSON",null}if(typeof _!="object"||_===null||Array.isArray(_))return C.value="MCP servers must be a JSON object",null}return{name:$,client:S.value,workingDirectory:h,systemPrompt:y.value.trim()||null,mcpServers:_}}async function re(){if(i.value)return;const $=te();if($){i.value=!0;try{const h=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",_=p.value?"PATCH":"POST",I=await fetch(h,{method:_,headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify($)});if(!I.ok){const R=await I.json().catch(()=>({}));throw new Error(R.error||I.statusText)}ne("Saved ✓",!0),X(),await M()}catch(h){C.value="Error: "+h.message}finally{i.value=!1}}}async function pe($){if(!c.value){c.value=$.id;try{const h=await fetch(`/api/agent-templates/${$.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`}});if(!h.ok){const I=await h.json().catch(()=>({}));throw new Error(I.error||h.statusText)}const _=await h.json();ne(`Started thread ${_.threadId} ✓`,!0)}catch(h){ne("Error: "+h.message,!1)}finally{c.value=null}}}async function be($){if(confirm(`Delete template "${$.name}"?`)&&!v.value){v.value=$.id;try{const h=await fetch(`/api/agent-templates/${$.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!h.ok)throw new Error(h.statusText);ne("Deleted ✓",!0),await M()}catch(h){ne("Error: "+h.message,!1)}finally{v.value=null}}}function ne($,h){a.value=$,l.value=h,setTimeout(()=>{a.value=""},3e3)}return De(M),($,h)=>(m(),x("div",Vc,[s("div",Bc,[s("div",Hc,[h[5]||(h[5]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Agent Templates"),s("p",{class:"text-sm text-textSecondary mt-1"},"Reusable spawn presets. Starting one stamps out a fresh root thread.")],-1)),s("div",Fc,[a.value?(m(),x("span",{key:0,class:G(["text-sm",l.value?"text-success":"text-danger"])},b(a.value),3)):U("",!0),s("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?(m(),x("div",Kc,"Loading...")):r.value?(m(),x("div",Wc,b(r.value),1)):n.value.length===0?(m(),x("div",zc,"No agent templates yet")):(m(),x("div",Jc,[(m(!0),x(se,null,me(n.value,_=>(m(),x("div",{key:_.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[s("div",qc,[s("div",Gc,[s("div",Yc,[s("span",Zc,b(_.name),1),s("span",Qc,b(_.client),1),_.mcpServers&&Object.keys(_.mcpServers).length?(m(),x("span",Xc,b(Object.keys(_.mcpServers).length)+" mcp",1)):U("",!0)]),s("div",ef,b(_.workingDirectory),1)]),s("div",tf,[s("button",{onClick:I=>pe(_),disabled:c.value===_.id,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight text-xs text-white font-medium transition disabled:opacity-50"},b(c.value===_.id?"Starting…":"Start"),9,sf),s("button",{onClick:I=>D(_),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,nf),s("button",{onClick:I=>be(_),disabled:v.value===_.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"},b(v.value===_.id?"…":"Delete"),9,of)])])]))),128))]))]),f.value?(m(),x("div",rf,[s("h3",af,b(p.value?`Edit: ${k.value}`:"New Agent Template"),1),s("div",lf,[s("div",null,[h[6]||(h[6]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Name "),s("span",{class:"text-danger"},"*")],-1)),F(s("input",{"onUpdate:modelValue":h[0]||(h[0]=_=>k.value=_),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,k.value]])]),s("div",null,[h[7]||(h[7]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Client "),s("span",{class:"text-danger"},"*")],-1)),F(s("select",{"onUpdate:modelValue":h[1]||(h[1]=_=>S.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"},[(m(),x(se,null,me(t,_=>s("option",{key:_,value:_},b(_),9,df)),64))],512),[[Ie,S.value]])])]),s("div",uf,[h[8]||(h[8]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Working Directory "),s("span",{class:"text-danger"},"*")],-1)),F(s("input",{"onUpdate:modelValue":h[2]||(h[2]=_=>E.value=_),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,E.value]])]),s("div",cf,[h[9]||(h[9]=s("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),F(s("textarea",{"onUpdate:modelValue":h[3]||(h[3]=_=>y.value=_),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,y.value]])]),s("div",ff,[h[10]||(h[10]=s("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),F(s("textarea",{"onUpdate:modelValue":h[4]||(h[4]=_=>H.value=_),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]]),h[11]||(h[11]=s("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),s("div",pf,[s("button",{onClick:re,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"},b(i.value?"Saving…":p.value?"Save Changes":"Create Template"),9,mf),s("button",{onClick:X,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 "),C.value?(m(),x("span",xf,b(C.value),1)):U("",!0)])])):U("",!0)]))}}),gf={class:"animate-fade-in"},bf={class:"glass rounded-xl p-6 mb-6"},hf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},yf={class:"flex items-center gap-3"},_f={key:0,class:"text-center py-8 text-textSecondary text-sm"},wf={key:1,class:"text-center py-8 text-danger text-sm"},kf={key:2,class:"text-center text-textSecondary py-12"},$f={key:3,class:"space-y-2"},Sf={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Cf={class:"flex items-center justify-between gap-3"},Tf={class:"flex items-center gap-2 min-w-0"},Pf={class:"flex items-center justify-between gap-3"},Ef={class:"flex-1 min-w-0"},If={class:"flex items-center gap-2 mb-1"},Af={class:"font-medium text-sm font-mono"},Mf={class:"text-xs text-muted font-mono truncate"},Of={class:"flex items-center gap-2 shrink-0"},Df=["onClick"],Rf=["onClick","disabled"],Lf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},jf={class:"text-lg font-semibold mb-4"},Uf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Nf=["readonly"],Vf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Bf={class:"mb-4"},Hf={class:"flex items-center justify-between mb-2"},Ff=["onUpdate:modelValue"],Kf=["onUpdate:modelValue"],Wf=["onClick"],zf={key:0,class:"text-xs text-muted italic"},Jf={class:"mb-4"},qf={class:"mb-4"},Gf={class:"flex items-center justify-between mb-2"},Yf=["onUpdate:modelValue"],Zf=["onUpdate:modelValue"],Qf=["onClick"],Xf={key:0,class:"text-xs text-muted italic"},ep={class:"flex items-center gap-3 flex-wrap"},tp=["disabled"],sp={key:0,class:"text-sm text-danger"},Zt="sensorium-mcp",np=Oe({__name:"McpServersTab",setup(e){const t=w({}),n=w(!0),o=w(""),r=w(""),a=w(!0),l=w(!1),i=w(null),c=w(!1),v=w(null),f=w(""),p=w("stdio"),k=w(""),S=w(""),E=w(""),y=w([]),H=w([]),C=w(""),M=Te(()=>Object.entries(t.value).filter(([$])=>$!==Zt));async function L(){n.value=!0,o.value="";try{const $=await ce("/api/mcp-servers");t.value=$.servers||{}}catch($){o.value="Failed to load MCP servers: "+$.message}finally{n.value=!1}}function D($){return $==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function X(){v.value=null,f.value="",p.value="stdio",k.value="",S.value="",E.value="",y.value=[],H.value=[],C.value="",c.value=!0}function te($,h){v.value=$,f.value=$,p.value=h.type,k.value=h.command||"",S.value=(h.args||[]).join(" "),E.value=h.url||"",y.value=Object.entries(h.env||{}).map(([_,I])=>({k:_,v:I})),H.value=Object.entries(h.headers||{}).map(([_,I])=>({k:_,v:I})),C.value="",c.value=!0}function re(){c.value=!1,v.value=null}function pe(){if(C.value="",!f.value.trim())return C.value="Name is required",!1;if(p.value==="stdio"&&!k.value.trim())return C.value="Command is required for stdio type",!1;if(p.value==="http"){const $=E.value.trim();if(!$)return C.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test($))return C.value="URL must start with http:// or https://",!1}return!0}async function be(){if(!pe()||l.value)return;l.value=!0;const $=f.value.trim(),h={type:p.value};if(p.value==="stdio"){h.command=k.value.trim();const _=S.value.trim();_&&(h.args=_.split(/\s+/));const I=Object.fromEntries(y.value.filter(R=>R.k.trim()).map(R=>[R.k.trim(),R.v]));Object.keys(I).length&&(h.env=I)}else{h.url=E.value.trim();const _=Object.fromEntries(H.value.filter(I=>I.k.trim()).map(I=>[I.k.trim(),I.v]));Object.keys(_).length&&(h.headers=_)}try{const _=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({name:$,config:h})});if(!_.ok)throw new Error(_.statusText);r.value="Saved ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),re(),await L()}catch(_){C.value="Error: "+_.message}finally{l.value=!1}}async function ne($){if(confirm(`Delete MCP server "${$}"?`)&&!i.value){i.value=$;try{const h=await fetch(`/api/mcp-servers/${encodeURIComponent($)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ge()}`}});if(!h.ok)throw new Error(h.statusText);r.value="Deleted ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await L()}catch(h){r.value="Error: "+h.message,a.value=!1}finally{i.value=null}}}return De(L),($,h)=>(m(),x("div",gf,[s("div",bf,[s("div",hf,[h[7]||(h[7]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"MCP Servers"),s("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),s("div",yf,[r.value?(m(),x("span",{key:0,class:G(["text-sm",a.value?"text-success":"text-danger"])},b(r.value),3)):U("",!0),s("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),n.value?(m(),x("div",_f,"Loading...")):o.value?(m(),x("div",wf,b(o.value),1)):Object.keys(t.value).length===0?(m(),x("div",kf,"No MCP servers configured")):(m(),x("div",$f,[t.value[Zt]?(m(),x("div",Sf,[s("div",Cf,[s("div",Tf,[s("span",{class:"font-medium text-sm font-mono"},b(Zt)),s("span",{class:"type-badge",style:bt(D(t.value[Zt].type))},b(t.value[Zt].type),5),h[8]||(h[8]=s("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),h[9]||(h[9]=s("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):U("",!0),(m(!0),x(se,null,me(M.value,([_,I])=>{var R;return m(),x("div",{key:_,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[s("div",Pf,[s("div",Ef,[s("div",If,[s("span",Af,b(_),1),s("span",{class:"type-badge",style:bt(D(I.type))},b(I.type),5)]),s("div",Mf,[I.type==="stdio"?(m(),x(se,{key:0},[Y(b(I.command)+b((R=I.args)!=null&&R.length?" "+I.args.join(" "):""),1)],64)):(m(),x(se,{key:1},[Y(b(I.url),1)],64))])]),s("div",Of,[s("button",{onClick:W=>te(_,I),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,Df),s("button",{onClick:W=>ne(_),disabled:i.value===_,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"},b(i.value===_?"…":"Delete"),9,Rf)])])])}),128))]))]),c.value?(m(),x("div",Lf,[s("h3",jf,b(v.value?`Edit: ${v.value}`:"Add MCP Server"),1),s("div",Uf,[s("div",null,[h[10]||(h[10]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Name "),s("span",{class:"text-danger"},"*")],-1)),F(s("input",{"onUpdate:modelValue":h[0]||(h[0]=_=>f.value=_),type:"text",readonly:!!v.value,placeholder:"my-server",class:G(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",v.value?"opacity-60 cursor-not-allowed":""])},null,10,Nf),[[ee,f.value]])]),s("div",null,[h[12]||(h[12]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Type "),s("span",{class:"text-danger"},"*")],-1)),F(s("select",{"onUpdate:modelValue":h[1]||(h[1]=_=>p.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"},[...h[11]||(h[11]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[Ie,p.value]])])]),p.value==="stdio"?(m(),x(se,{key:0},[s("div",Vf,[s("div",null,[h[13]||(h[13]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Command "),s("span",{class:"text-danger"},"*")],-1)),F(s("input",{"onUpdate:modelValue":h[2]||(h[2]=_=>k.value=_),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,k.value]])]),s("div",null,[h[14]||(h[14]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),F(s("input",{"onUpdate:modelValue":h[3]||(h[3]=_=>S.value=_),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,S.value]])])]),s("div",Bf,[s("div",Hf,[h[15]||(h[15]=s("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),s("button",{onClick:h[4]||(h[4]=_=>y.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(m(!0),x(se,null,me(y.value,(_,I)=>(m(),x("div",{key:I,class:"flex items-center gap-2 mb-2"},[F(s("input",{"onUpdate:modelValue":R=>_.k=R,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,Ff),[[ee,_.k]]),h[16]||(h[16]=s("span",{class:"text-muted text-xs"},"=",-1)),F(s("input",{"onUpdate:modelValue":R=>_.v=R,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,Kf),[[ee,_.v]]),s("button",{onClick:R=>y.value.splice(I,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Wf)]))),128)),y.value.length===0?(m(),x("div",zf,"No env vars")):U("",!0)])],64)):(m(),x(se,{key:1},[s("div",Jf,[h[17]||(h[17]=s("label",{class:"text-xs text-textSecondary block mb-1"},[Y("URL "),s("span",{class:"text-danger"},"*")],-1)),F(s("input",{"onUpdate:modelValue":h[5]||(h[5]=_=>E.value=_),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,E.value]])]),s("div",qf,[s("div",Gf,[h[18]||(h[18]=s("label",{class:"text-xs text-textSecondary"},"Headers",-1)),s("button",{onClick:h[6]||(h[6]=_=>H.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(m(!0),x(se,null,me(H.value,(_,I)=>(m(),x("div",{key:I,class:"flex items-center gap-2 mb-2"},[F(s("input",{"onUpdate:modelValue":R=>_.k=R,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,Yf),[[ee,_.k]]),h[19]||(h[19]=s("span",{class:"text-muted text-xs"},":",-1)),F(s("input",{"onUpdate:modelValue":R=>_.v=R,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,Zf),[[ee,_.v]]),s("button",{onClick:R=>H.value.splice(I,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Qf)]))),128)),H.value.length===0?(m(),x("div",Xf,"No headers")):U("",!0)])],64)),s("div",ep,[s("button",{onClick:be,disabled:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(l.value?"Saving…":v.value?"Save Changes":"Add Server"),9,tp),s("button",{onClick:re,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 "),C.value?(m(),x("span",sp,b(C.value),1)):U("",!0)])])):U("",!0)]))}}),op={class:"animate-fade-in"},rp={class:"glass rounded-xl p-6 mb-6"},ap={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},lp={class:"flex items-center gap-3"},ip=["disabled"],dp={key:0,class:"text-center py-8 text-textSecondary text-sm"},up={key:1,class:"text-center py-8 text-danger text-sm"},cp={key:2,class:"text-center text-textSecondary py-12"},fp={key:3,class:"space-y-3"},pp={class:"flex items-start gap-2"},mp={class:"flex-1 space-y-2"},xp=["onUpdate:modelValue"],vp=["onUpdate:modelValue"],gp=["onClick"],bp=Oe({__name:"PromptsTab",setup(e){const t=w([]),n=w(!0),o=w(""),r=w(""),a=w(!0),l=w(!1);async function i(){n.value=!0,o.value="";try{const p=await ce("/api/prompts");t.value=(p.prompts||[]).map(k=>({label:k.label,text:k.text}))}catch(p){o.value="Failed to load prompts: "+p.message}finally{n.value=!1}}function c(){t.value.push({label:"",text:""})}function v(p){t.value.splice(p,1)}async function f(){if(l.value)return;l.value=!0,r.value="";const p=t.value.map(k=>({label:k.label.trim(),text:k.text.trim()})).filter(k=>k.label&&k.text);try{const k=await fetch("/api/prompts",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify({prompts:p})});if(!k.ok)throw new Error(k.statusText);r.value="Saved ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await i()}catch(k){r.value="Error: "+k.message,a.value=!1}finally{l.value=!1}}return De(i),(p,k)=>(m(),x("div",op,[s("div",rp,[s("div",ap,[k[0]||(k[0]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Predefined Prompts"),s("p",{class:"text-sm text-textSecondary mt-1"},[Y(" Each prompt becomes a button in the Telegram "),s("span",{class:"font-mono"},"/prompts"),Y(" keyboard. Pressing a button injects its text into the target thread as if you typed it. ")])],-1)),s("div",lp,[r.value?(m(),x("span",{key:0,class:G(["text-sm",a.value?"text-success":"text-danger"])},b(r.value),3)):U("",!0),s("button",{onClick:c,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," + Add Prompt "),s("button",{onClick:f,disabled:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(l.value?"Saving…":"Save"),9,ip)])]),n.value?(m(),x("div",dp,"Loading...")):o.value?(m(),x("div",up,b(o.value),1)):t.value.length===0?(m(),x("div",cp," No prompts yet — click “+ Add Prompt” to create one. ")):(m(),x("div",fp,[(m(!0),x(se,null,me(t.value,(S,E)=>(m(),x("div",{key:E,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[s("div",pp,[s("div",mp,[s("div",null,[k[1]||(k[1]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Label (button text, ≤64 chars)",-1)),F(s("input",{"onUpdate:modelValue":y=>S.label=y,type:"text",maxlength:"64",placeholder:"Run tests",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,8,xp),[[ee,S.label]])]),s("div",null,[k[2]||(k[2]=s("label",{class:"text-xs text-textSecondary block mb-1"},"Prompt text (≤4000 chars)",-1)),F(s("textarea",{"onUpdate:modelValue":y=>S.text=y,rows:"3",maxlength:"4000",placeholder:"Run the full test suite and report failures.",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,8,vp),[[ee,S.text]])])]),s("button",{onClick:y=>v(E),class:"text-muted hover:text-danger transition text-sm px-2 pt-6 shrink-0",title:"Remove prompt"},"✕",8,gp)])]))),128))]))])]))}}),hp={class:"animate-fade-in"},yp={class:"glass rounded-xl p-6 mb-6"},_p={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},wp={class:"flex items-center gap-3"},kp=["disabled"],$p={key:0,class:"text-center py-8 text-textSecondary text-sm"},Sp={key:1,class:"space-y-6"},Cp={class:"glass rounded-xl p-4 border border-gray-700/50"},Tp={class:"glass rounded-xl p-4 border border-gray-700/50"},Pp={class:"glass rounded-xl p-4 border border-gray-700/50"},Ep={class:"glass rounded-xl p-4 border border-gray-700/50"},Ip={class:"glass rounded-xl p-4 border border-gray-700/50"},Ap={class:"glass rounded-xl p-4 border border-gray-700/50"},Mp={class:"flex items-center justify-between gap-4"},Op=["aria-checked"],Dp={class:"glass rounded-xl p-4 border border-gray-700/50"},Rp={class:"text-xs text-textSecondary mb-3"},Lp={class:"flex items-center gap-2"},jp=["placeholder"],Up=["disabled"],Np={class:"glass rounded-xl p-4 border border-gray-700/50"},Vp={key:0,class:"space-y-2 mb-4"},Bp=["value"],Hp=["value"],Fp={class:"flex items-center justify-between mb-2"},Kp=["onUpdate:modelValue"],Wp=["onUpdate:modelValue"],zp=["onClick"],Jp={key:1,class:"text-xs text-muted italic"},qp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Gp={class:"grid grid-cols-2 gap-4"},Yp={class:"text-sm font-medium font-mono text-textSecondary"},Zp={class:"text-sm font-medium font-mono text-textSecondary"},Qp={class:"mt-3"},Xp=Oe({__name:"ClaudeTab",setup(e){const t=w(!0),n=w(!1),o=w(""),r=w("claude-opus-4-6"),a=w("claude-opus-4-6"),l=w("claude-sonnet-4-5"),i=w("claude-sonnet-4-5"),c=w(!1),v=w(""),f=w(""),p=w(""),k=w(""),S=w(20),E=w(20),y=w(""),H=w(!1),C=w(!1),M=w(!1),L=w([]),D=w([]),X=w("{}");function te(){const h={};for(const _ of D.value){const I=_.k.trim();I&&(h[I]=_.v)}return h}const re=Te(()=>r.value!==a.value||l.value!==i.value||v.value!==f.value||p.value!==k.value||S.value!==E.value||y.value.length>0||C.value!==M.value||JSON.stringify(te())!==X.value);function pe(h){L.value=h.filter(_=>_.locked),D.value=h.filter(_=>!_.locked).map(_=>({k:_.key,v:_.value})),X.value=JSON.stringify(te())}async function be(){t.value=!0;try{const[h,_,I]=await Promise.all([ce("/api/settings/default-thread-model"),ce("/api/settings/default-worker-model"),ce("/api/settings/claude")]);r.value=h.defaultThreadModel,a.value=h.defaultThreadModel,l.value=_.defaultWorkerModel,i.value=_.defaultWorkerModel,v.value=I.cliPath,f.value=I.cliPath,p.value=I.gitBashPath,k.value=I.gitBashPath,S.value=I.maxConcurrentThreads,E.value=I.maxConcurrentThreads,H.value=I.oauthTokenSet,y.value="",C.value=I.autoMemoryEnabled,M.value=I.autoMemoryEnabled,pe(I.env??[])}finally{t.value=!1}}async function ne(){if(n.value=!0,o.value="",!r.value){o.value="Error: Thread model cannot be empty",n.value=!1;return}if(!l.value){o.value="Error: Worker model cannot be empty",n.value=!1;return}if(!Number.isFinite(S.value)||S.value<1){o.value="Error: Max concurrent threads must be at least 1",n.value=!1;return}try{const h={Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},_={cliPath:v.value,gitBashPath:p.value,maxConcurrentThreads:S.value,autoMemoryEnabled:C.value,customEnvVars:te()};y.value.length>0&&(_.oauthToken=y.value);const[I,R,W]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:h,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:h,body:JSON.stringify({model:l.value})}),fetch("/api/settings/claude",{method:"POST",headers:h,body:JSON.stringify(_)})]);for(const P of[I,R,W])if(!P.ok){const z=await P.json().catch(()=>({error:P.statusText}));throw new Error(z.error??P.statusText)}const ue=await I.json(),oe=await R.json(),O=await W.json();a.value=ue.defaultThreadModel,r.value=ue.defaultThreadModel,i.value=oe.defaultWorkerModel,l.value=oe.defaultWorkerModel,v.value=O.cliPath,f.value=O.cliPath,p.value=O.gitBashPath,k.value=O.gitBashPath,S.value=O.maxConcurrentThreads,E.value=O.maxConcurrentThreads,H.value=O.oauthTokenSet,y.value="",C.value=O.autoMemoryEnabled,M.value=O.autoMemoryEnabled,pe(O.env??[]),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{n.value=!1}}async function $(){c.value=!0,o.value="";try{const h={Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},_=await fetch("/api/settings/claude",{method:"POST",headers:h,body:JSON.stringify({clearOauthToken:!0})});if(!_.ok){const R=await _.json().catch(()=>({error:_.statusText}));throw new Error(R.error??_.statusText)}const I=await _.json();H.value=I.oauthTokenSet,y.value="",pe(I.env??[]),o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{c.value=!1}}return De(be),(h,_)=>(m(),x("div",hp,[s("div",yp,[s("div",_p,[_[8]||(_[8]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Claude"),s("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),s("div",wp,[o.value?(m(),x("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):U("",!0),s("button",{onClick:ne,disabled:n.value||t.value||!re.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(n.value?"Saving…":"Save"),9,kp)])]),t.value?(m(),x("div",$p,"Loading…")):(m(),x("div",Sp,[s("div",Cp,[_[9]||(_[9]=s("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),_[10]||(_[10]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),s("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),Y(" env var if set. ")],-1)),F(s("input",{"onUpdate:modelValue":_[0]||(_[0]=I=>r.value=I),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}]])]),s("div",Tp,[_[11]||(_[11]=s("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),_[12]||(_[12]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Model used when spawning a worker Claude thread. Overridden by the "),s("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),Y(" env var if set. ")],-1)),F(s("input",{"onUpdate:modelValue":_[1]||(_[1]=I=>l.value=I),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,l.value,void 0,{trim:!0}]])]),s("div",Pp,[_[13]||(_[13]=s("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),_[14]||(_[14]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),s("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),Y(" env var if set. ")],-1)),F(s("input",{"onUpdate:modelValue":_[2]||(_[2]=I=>v.value=I),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,v.value,void 0,{trim:!0}]])]),s("div",Ep,[_[15]||(_[15]=s("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),_[16]||(_[16]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Path to "),s("span",{class:"font-mono text-accentLight"},"bash.exe"),Y(" passed to Claude via "),s("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),Y(". Leave empty to auto-detect. ")],-1)),F(s("input",{"onUpdate:modelValue":_[3]||(_[3]=I=>p.value=I),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,p.value,void 0,{trim:!0}]])]),s("div",Ip,[_[17]||(_[17]=s("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),_[18]||(_[18]=s("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),F(s("input",{"onUpdate:modelValue":_[4]||(_[4]=I=>S.value=I),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,S.value,void 0,{number:!0}]])]),s("div",Ap,[s("div",Mp,[_[19]||(_[19]=s("div",null,[s("label",{class:"block text-sm font-medium mb-1"},"Claude Native Auto-Memory"),s("p",{class:"text-xs text-textSecondary"},[Y(" Claude Code's built-in "),s("span",{class:"font-mono text-accentLight"},"MEMORY.md"),Y(" memory. Off by default — it conflicts with Sensorium's own memory system. Applied to each thread's config at spawn. ")])],-1)),s("button",{type:"button",role:"switch","aria-checked":C.value,onClick:_[5]||(_[5]=I=>C.value=!C.value),class:G([C.value?"bg-accent":"bg-gray-700","relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition"])},[s("span",{class:G([C.value?"translate-x-6":"translate-x-1","inline-block h-4 w-4 rounded-full bg-white transition"])},null,2)],10,Op)])]),s("div",Dp,[_[23]||(_[23]=s("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),s("p",Rp,[_[20]||(_[20]=Y(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),_[21]||(_[21]=s("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),_[22]||(_[22]=Y(" env var if set. ",-1)),s("span",{class:G(H.value?"text-success":"text-muted")},b(H.value?"A token is currently stored.":"No token stored."),3)]),s("div",Lp,[F(s("input",{"onUpdate:modelValue":_[6]||(_[6]=I=>y.value=I),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,jp),[[ee,y.value]]),H.value?(m(),x("button",{key:0,onClick:$,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"},b(c.value?"Clearing…":"Clear"),9,Up)):U("",!0)])]),s("div",Np,[_[28]||(_[28]=s("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),_[29]||(_[29]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Variables injected into every Claude child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),s("span",{class:"font-mono text-accentLight"},"Additional Variables"),Y(". ")],-1)),L.value.length?(m(),x("div",Vp,[(m(!0),x(se,null,me(L.value,I=>(m(),x("div",{key:I.key,class:"flex items-center gap-2"},[s("input",{value:I.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Bp),_[24]||(_[24]=s("span",{class:"text-muted text-xs"},"=",-1)),s("input",{value:I.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Hp),_[25]||(_[25]=s("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):U("",!0),s("div",Fp,[_[26]||(_[26]=s("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),s("button",{onClick:_[7]||(_[7]=I=>D.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(m(!0),x(se,null,me(D.value,(I,R)=>(m(),x("div",{key:R,class:"flex items-center gap-2 mb-2"},[F(s("input",{"onUpdate:modelValue":W=>I.k=W,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,Kp),[[ee,I.k]]),_[27]||(_[27]=s("span",{class:"text-muted text-xs"},"=",-1)),F(s("input",{"onUpdate:modelValue":W=>I.v=W,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,Wp),[[ee,I.v]]),s("button",{onClick:W=>D.value.splice(R,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,zp)]))),128)),D.value.length===0?(m(),x("div",Jp,"No additional variables")):U("",!0)]),s("div",qp,[_[32]||(_[32]=s("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),s("div",Gp,[s("div",null,[_[30]||(_[30]=s("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),s("span",Yp,b(a.value),1)]),s("div",null,[_[31]||(_[31]=s("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),s("span",Zp,b(i.value),1)])]),s("div",Qp,[s("span",{class:G(["text-sm font-medium",re.value?"text-warn":"text-textSecondary"])},b(re.value?"Unsaved changes":"Saved"),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"},am={key:1,class:"space-y-6"},lm={class:"glass rounded-xl p-4 border border-gray-700/50"},im={id:"copilot-models"},dm=["value"],um={key:0,class:"text-xs text-success mt-2"},cm={class:"grid grid-cols-2 gap-3 mt-4"},fm={class:"glass rounded-xl p-4 border border-gray-700/50"},pm={class:"flex items-center justify-between"},mm={class:"glass rounded-xl p-4 border border-gray-700/50"},xm=["disabled"],vm={class:"glass rounded-xl p-4 border border-gray-700/50"},gm=["disabled"],bm={class:"glass rounded-xl p-4 border border-gray-700/50"},hm={class:"text-xs text-textSecondary mb-3"},ym={key:0,class:"text-success"},_m={key:1,class:"text-warn"},wm=["disabled","placeholder"],km={class:"glass rounded-xl p-4 border border-gray-700/50"},$m={key:0,class:"mt-4 space-y-4"},Sm={class:"text-xs text-textSecondary mb-2"},Cm=["disabled"],Tm={class:"text-xs text-textSecondary mb-2"},Pm=["disabled"],Em={class:"glass rounded-xl p-4 border border-gray-700/50"},Im={class:"flex items-center justify-between gap-3"},Am=["disabled"],Mm={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},Om={class:"glass rounded-xl p-4 border border-gray-700/50"},Dm={key:0,class:"space-y-2 mb-4"},Rm=["value"],Lm=["value"],jm={class:"flex items-center justify-between mb-2"},Um=["onUpdate:modelValue"],Nm=["onUpdate:modelValue"],Vm=["onClick"],Bm={key:1,class:"text-xs text-muted italic"},Hm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Fm={class:"grid grid-cols-2 gap-4"},Km={class:"text-sm font-medium font-mono text-textSecondary"},Wm=Oe({__name:"CopilotTab",setup(e){const t=w(!0),n=w(!1),o=w(""),r=w(""),a=w("high"),l=w("long_context"),i=w(!1),c=w("openai"),v=w(""),f=w(""),p=w(""),k=w(""),S=w(!1),E=w(!1),y=w(!1),H=w(""),C=w([]),M=w([]),L=w([]);function D(){const ne={};for(const $ of L.value){const h=$.k.trim();h&&(ne[h]=$.v)}return ne}async function X(){t.value=!0;try{const ne=await ce("/api/settings/copilot");te(ne),i.value&&S.value&&be(!0)}finally{t.value=!1}}function te(ne){r.value=ne.model,a.value=ne.effortLevel,l.value=ne.contextTier,i.value=ne.byok.enabled,c.value=ne.byok.providerType,v.value=ne.byok.baseUrl,f.value=ne.byok.modelId,p.value=ne.byok.wireModel,S.value=ne.byok.apiKeySet,k.value="";const $=ne.env??[];M.value=$.filter(h=>h.locked),L.value=$.filter(h=>!h.locked).map(h=>({k:h.key,v:h.value}))}const re=Te(()=>!(!r.value.trim()||i.value&&(!v.value.trim()||!S.value&&!k.value.trim())));async function pe(){if(n.value=!0,o.value="",!r.value.trim()){o.value="Error: Model cannot be empty",n.value=!1;return}try{const ne={enabled:i.value,providerType:c.value,baseUrl:v.value.trim(),modelId:f.value.trim(),wireModel:p.value.trim()};k.value.trim()&&(ne.apiKey=k.value.trim());const $={Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},h=await fetch("/api/settings/copilot",{method:"POST",headers:$,body:JSON.stringify({model:r.value.trim(),effortLevel:a.value,contextTier:l.value,byok:ne,customEnvVars:D()})});if(!h.ok){const I=await h.json().catch(()=>({error:h.statusText}));throw new Error(I.error??h.statusText)}const _=await h.json();te(_),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(ne){o.value="Error: "+ne.message}finally{n.value=!1}}async function be(ne=!1){y.value=!0,H.value="",C.value=[];try{const $={baseUrl:v.value.trim(),providerType:c.value};k.value.trim()&&($.apiKey=k.value.trim());const h=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},body:JSON.stringify($)}),_=await h.json();if(!h.ok||!_.ok)throw new Error(_.error??h.statusText);C.value=_.models??[],H.value=`OK — ${_.count??C.value.length} models`}catch($){ne||(H.value="Error: "+$.message)}finally{y.value=!1}}return De(X),(ne,$)=>(m(),x("div",em,[s("div",tm,[s("div",sm,[$[12]||($[12]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Copilot"),s("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),s("div",nm,[o.value?(m(),x("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):U("",!0),s("button",{onClick:pe,disabled:n.value||t.value||!re.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(n.value?"Saving…":"Save"),9,om)])]),t.value?(m(),x("div",rm,"Loading…")):(m(),x("div",am,[s("div",lm,[$[17]||($[17]=s("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),$[18]||($[18]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Written to the Copilot CLI's "),s("span",{class:"font-mono text-accentLight"},"settings.json"),Y(" (avoids the flaky "),s("span",{class:"font-mono text-accentLight"},"--model"),Y(" flag). ")],-1)),F(s("input",{"onUpdate:modelValue":$[0]||($[0]=h=>r.value=h),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}]]),s("datalist",im,[(m(!0),x(se,null,me(C.value,h=>(m(),x("option",{key:h,value:h},null,8,dm))),128))]),C.value.length?(m(),x("p",um,b(C.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):U("",!0),s("div",cm,[s("div",null,[$[14]||($[14]=s("label",{class:"block text-sm font-medium mb-1"},"Effort Level",-1)),F(s("select",{"onUpdate:modelValue":$[1]||($[1]=h=>a.value=h),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"},[...$[13]||($[13]=[s("option",{value:"low"},"low",-1),s("option",{value:"medium"},"medium",-1),s("option",{value:"high"},"high",-1)])],512),[[Ie,a.value]])]),s("div",null,[$[16]||($[16]=s("label",{class:"block text-sm font-medium mb-1"},"Context Tier",-1)),F(s("select",{"onUpdate:modelValue":$[2]||($[2]=h=>l.value=h),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"},[...$[15]||($[15]=[s("option",{value:"normal"},"normal",-1),s("option",{value:"long_context"},"long_context",-1)])],512),[[Ie,l.value]])])])]),s("div",fm,[s("div",pm,[$[19]||($[19]=s("div",null,[s("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),s("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),s("button",{onClick:$[3]||($[3]=h=>i.value=!i.value),class:G(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",i.value?"bg-accent":"bg-gray-700"])},[s("span",{class:G(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",i.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),s("div",{class:G(["space-y-4 transition",i.value?"":"opacity-40 pointer-events-none select-none"])},[s("div",mm,[$[21]||($[21]=s("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),$[22]||($[22]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Wire protocol of the endpoint ("),s("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),Y("). ")],-1)),F(s("select",{"onUpdate:modelValue":$[4]||($[4]=h=>c.value=h),disabled:!i.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"},[...$[20]||($[20]=[s("option",{value:"openai"},"openai",-1),s("option",{value:"azure"},"azure",-1),s("option",{value:"anthropic"},"anthropic",-1)])],8,xm),[[Ie,c.value]])]),s("div",vm,[$[23]||($[23]=s("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),$[24]||($[24]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" e.g. "),s("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),Y(" ("),s("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),Y("). ")],-1)),F(s("input",{"onUpdate:modelValue":$[5]||($[5]=h=>v.value=h),type:"text",disabled:!i.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,gm),[[ee,v.value,void 0,{trim:!0}]])]),s("div",bm,[$[28]||($[28]=s("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),s("p",hm,[$[25]||($[25]=Y(" Stored server-side and never echoed back (",-1)),$[26]||($[26]=s("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),$[27]||($[27]=Y("). ",-1)),S.value?(m(),x("span",ym,"A key is currently set — leave blank to keep it.")):(m(),x("span",_m,"No key set."))]),F(s("input",{"onUpdate:modelValue":$[6]||($[6]=h=>k.value=h),type:"password",disabled:!i.value,placeholder:S.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,wm),[[ee,k.value]])]),s("div",km,[s("button",{type:"button",onClick:$[7]||($[7]=h=>E.value=!E.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[s("span",null,b(E.value?"▾":"▸"),1),$[29]||($[29]=Y(" Advanced (model mapping) ",-1))]),E.value?(m(),x("div",$m,[s("div",null,[$[32]||($[32]=s("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),s("p",Sm,[$[30]||($[30]=Y(" Well-known base model for tool config (",-1)),$[31]||($[31]=s("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),Y("). Defaults to Copilot Model. "+b(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),F(s("input",{"onUpdate:modelValue":$[8]||($[8]=h=>f.value=h),type:"text",list:"copilot-models",disabled:!i.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,Cm),[[ee,f.value,void 0,{trim:!0}]])]),s("div",null,[$[35]||($[35]=s("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),s("p",Tm,[$[33]||($[33]=Y(" Exact model name sent to the provider (",-1)),$[34]||($[34]=s("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),Y("). Defaults to Copilot Model. "+b(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),F(s("input",{"onUpdate:modelValue":$[9]||($[9]=h=>p.value=h),type:"text",list:"copilot-models",disabled:!i.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,Pm),[[ee,p.value,void 0,{trim:!0}]])])])):U("",!0)]),s("div",Em,[s("div",Im,[$[36]||($[36]=s("div",null,[s("div",{class:"text-sm font-medium"},"Test Connection"),s("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)),s("button",{onClick:$[10]||($[10]=h=>be()),disabled:y.value||!i.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"},b(y.value?"Testing…":"Test"),9,Am)]),H.value?(m(),x("div",{key:0,class:G([H.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},b(H.value),3)):U("",!0),C.value.length?(m(),x("div",Mm,[(m(!0),x(se,null,me(C.value,h=>(m(),x("div",{key:h,class:"text-xs font-mono text-textSecondary py-0.5"},b(h),1))),128))])):U("",!0)])],2),s("div",Om,[$[41]||($[41]=s("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),$[42]||($[42]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Variables injected into every Copilot child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),s("span",{class:"font-mono text-accentLight"},"Additional Variables"),Y(". ")],-1)),M.value.length?(m(),x("div",Dm,[(m(!0),x(se,null,me(M.value,h=>(m(),x("div",{key:h.key,class:"flex items-center gap-2"},[s("input",{value:h.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Rm),$[37]||($[37]=s("span",{class:"text-muted text-xs"},"=",-1)),s("input",{value:h.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Lm),$[38]||($[38]=s("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):U("",!0),s("div",jm,[$[39]||($[39]=s("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),s("button",{onClick:$[11]||($[11]=h=>L.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(m(!0),x(se,null,me(L.value,(h,_)=>(m(),x("div",{key:_,class:"flex items-center gap-2 mb-2"},[F(s("input",{"onUpdate:modelValue":I=>h.k=I,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,Um),[[ee,h.k]]),$[40]||($[40]=s("span",{class:"text-muted text-xs"},"=",-1)),F(s("input",{"onUpdate:modelValue":I=>h.v=I,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,Nm),[[ee,h.v]]),s("button",{onClick:I=>L.value.splice(_,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Vm)]))),128)),L.value.length===0?(m(),x("div",Bm,"No additional variables")):U("",!0)]),s("div",Hm,[$[45]||($[45]=s("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),s("div",Fm,[s("div",null,[$[43]||($[43]=s("div",{class:"text-xs text-muted mb-1"},"Model",-1)),s("span",Km,b(r.value||"—"),1)]),s("div",null,[$[44]||($[44]=s("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),s("span",{class:G(["text-sm font-medium",i.value?"text-success":"text-textSecondary"])},b(i.value?"Enabled":"Disabled"),3)])])])]))])]))}}),zm={class:"animate-fade-in"},Jm={class:"glass rounded-xl p-6 mb-6"},qm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Gm={class:"flex items-center gap-3"},Ym=["disabled"],Zm={key:0,class:"text-center py-8 text-textSecondary text-sm"},Qm={key:1,class:"space-y-6"},Xm={class:"glass rounded-xl p-4 border border-gray-700/50"},ex={class:"flex items-center gap-4"},tx={class:"flex justify-between text-xs text-muted mt-2"},sx={class:"font-mono"},nx={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},ox={class:"glass rounded-xl p-4 border border-gray-700/50"},rx={class:"flex items-center gap-4"},ax={class:"flex justify-between text-xs text-muted mt-2"},lx={class:"font-mono"},ix={class:"glass rounded-xl p-4 border border-gray-700/50"},dx={class:"flex items-center gap-4"},ux={class:"flex justify-between text-xs text-muted mt-2"},cx={class:"font-mono"},fx={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},px={class:"grid grid-cols-2 gap-4"},mx={class:"text-sm font-medium text-textSecondary"},xx={class:"mt-3"},vx=Oe({__name:"SettingsTab",setup(e){const t=w(!0),n=w(!1),o=w(""),r=w(50),a=w(50),l=w(300),i=w(300),c=w(1440),v=w(1440),f=Te(()=>r.value!==a.value||l.value!==i.value||c.value!==v.value);async function p(){t.value=!0;try{const[S,E,y]=await Promise.all([ce("/api/settings/bootstrap-message-count"),ce("/api/settings/reply-max-chars"),ce("/api/settings/wait-timeout")]);r.value=S.count,a.value=S.count,l.value=E.chars,i.value=E.chars,c.value=y.minutes,v.value=y.minutes}finally{t.value=!1}}async function k(){n.value=!0,o.value="";try{const S={Authorization:`Bearer ${ge()}`,"Content-Type":"application/json"},[E,y,H]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:S,body:JSON.stringify({count:r.value})}),fetch("/api/settings/reply-max-chars",{method:"POST",headers:S,body:JSON.stringify({chars:l.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:S,body:JSON.stringify({minutes:c.value})})]);for(const D of[E,y,H])if(!D.ok){const X=await D.json().catch(()=>({error:D.statusText}));throw new Error(X.error??D.statusText)}const C=await E.json(),M=await y.json(),L=await H.json();a.value=C.count,r.value=C.count,i.value=M.chars,l.value=M.chars,v.value=L.minutes,c.value=L.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(S){o.value="Error: "+S.message}finally{n.value=!1}}return De(p),(S,E)=>(m(),x("div",zm,[s("div",Jm,[s("div",qm,[E[6]||(E[6]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Settings"),s("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),s("div",Gm,[o.value?(m(),x("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):U("",!0),s("button",{onClick:k,disabled:n.value||t.value||!f.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(n.value?"Saving…":"Save"),9,Ym)])]),t.value?(m(),x("div",Zm,"Loading…")):(m(),x("div",Qm,[s("div",Xm,[E[10]||(E[10]=s("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),E[11]||(E[11]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Number of recent messages injected into the agent's bootstrap context. Set to "),s("span",{class:"font-mono text-accentLight"},"0"),Y(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),s("div",ex,[F(s("input",{"onUpdate:modelValue":E[0]||(E[0]=y=>r.value=y),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[ee,r.value,void 0,{number:!0}]]),F(s("input",{"onUpdate:modelValue":E[1]||(E[1]=y=>r.value=y),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}]])]),s("div",tx,[E[7]||(E[7]=s("span",null,"Off",-1)),s("span",sx,b(r.value)+" messages",1),E[8]||(E[8]=s("span",null,"Max",-1))]),r.value===0?(m(),x("div",nx,[...E[9]||(E[9]=[Y(" Message buffer injection is ",-1),s("strong",null,"disabled",-1),Y(". 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)])])):U("",!0)]),s("div",ox,[E[14]||(E[14]=s("label",{class:"block text-sm font-medium mb-1"},"Reply Length Limit",-1)),E[15]||(E[15]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Maximum length (in characters) of a single text reply ("),s("span",{class:"font-mono text-accentLight"},"report_progress"),Y("). Longer messages are rejected so the agent shortens them or sends a voice message instead. The agent is also told this limit each turn. ")],-1)),s("div",rx,[F(s("input",{"onUpdate:modelValue":E[2]||(E[2]=y=>l.value=y),type:"range",min:"100",max:"2000",step:"50",class:"flex-1 accent-accent"},null,512),[[ee,l.value,void 0,{number:!0}]]),F(s("input",{"onUpdate:modelValue":E[3]||(E[3]=y=>l.value=y),type:"number",min:"1",max:"4000",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,l.value,void 0,{number:!0}]])]),s("div",ax,[E[12]||(E[12]=s("span",null,"Short",-1)),s("span",lx,b(l.value)+" chars",1),E[13]||(E[13]=s("span",null,"Long",-1))])]),s("div",ix,[E[18]||(E[18]=s("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),E[19]||(E[19]=s("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Maximum time (in minutes) a single "),s("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),Y(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),s("div",dx,[F(s("input",{"onUpdate:modelValue":E[4]||(E[4]=y=>c.value=y),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[ee,c.value,void 0,{number:!0}]]),F(s("input",{"onUpdate:modelValue":E[5]||(E[5]=y=>c.value=y),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,c.value,void 0,{number:!0}]])]),s("div",ux,[E[16]||(E[16]=s("span",null,"1 min",-1)),s("span",cx,b(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1),E[17]||(E[17]=s("span",null,"24h",-1))])]),s("div",fx,[E[22]||(E[22]=s("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),s("div",px,[s("div",null,[E[20]||(E[20]=s("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),s("span",{class:G(["text-sm font-medium",a.value>0?"text-success":"text-textSecondary"])},b(a.value>0?`${a.value} messages`:"Disabled"),3)]),s("div",null,[E[21]||(E[21]=s("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),s("span",mx,b(v.value>=60?Math.floor(v.value/60)+"h "+v.value%60+"m":v.value+" min"),1)])]),s("div",xx,[s("span",{class:G(["text-sm font-medium",f.value?"text-warn":"text-textSecondary"])},b(f.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),gx={class:"animate-fade-in"},bx={class:"glass rounded-xl p-6 mb-6"},hx={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},yx={class:"flex flex-wrap gap-3 items-center"},_x=["disabled"],wx={key:0,class:"flex items-center gap-2"},kx={key:1},$x={class:"glass rounded-xl p-6"},Sx={key:0,class:"text-center py-8 text-textSecondary text-sm"},Cx={key:1,class:"text-center py-12 text-textSecondary text-sm"},Tx={key:2,class:"space-y-2"},Px={class:"flex items-center justify-between gap-3"},Ex={class:"flex-1 min-w-0"},Ix={class:"flex flex-wrap items-center gap-2 mb-1"},Ax={class:"font-medium text-sm font-mono"},Mx={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Ox={class:"text-xs text-muted"},Dx={class:"text-xs text-muted"},Rx=["onClick","disabled"],Lx={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},jx={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Ux={class:"text-sm text-textSecondary mb-4"},Nx={class:"font-mono text-textPrimary"},Vx=Oe({__name:"SnapshotsTab",setup(e){const t=w([]),n=w(!0),o=w(!1),r=w(null),a=w(""),l=w(""),i=w(!0),c=w(null);function v(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}function f(C){try{return new Date(C).toLocaleString()}catch{return C}}function p(C,M){l.value=C,i.value=M,setTimeout(()=>{l.value=""},4e3)}async function k(){n.value=!0;try{const C=await ce("/api/snapshots");t.value=C.snapshots}catch(C){p("Failed to load snapshots: "+C.message,!1)}finally{n.value=!1}}async function S(){if(!o.value){o.value=!0;try{await ce("/api/snapshots",{method:"POST",body:JSON.stringify({description:a.value})}),a.value="",p("Snapshot created ✓",!0),await k()}catch(C){p("Error: "+C.message,!1)}finally{o.value=!1}}}function E(C){c.value=C}function y(){c.value=null}async function H(){const C=c.value;if(!(!C||r.value)){c.value=null,r.value=C;try{await ce(`/api/snapshots/${encodeURIComponent(C)}`,{method:"DELETE"}),p("Deleted ✓",!0),await k()}catch(M){p("Error: "+M.message,!1)}finally{r.value=null}}}return De(k),(C,M)=>(m(),x("div",gx,[s("div",bx,[s("div",hx,[M[1]||(M[1]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Snapshots"),s("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),l.value?(m(),x("span",{key:0,class:G(["text-sm",i.value?"text-success":"text-danger"])},b(l.value),3)):U("",!0)]),s("div",yx,[F(s("input",{"onUpdate:modelValue":M[0]||(M[0]=L=>a.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:qe(S,["enter"])},null,544),[[ee,a.value]]),s("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?(m(),x("span",wx,[...M[2]||(M[2]=[s("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),Y(" Creating… ",-1)])])):(m(),x("span",kx,"+ Create Snapshot"))],8,_x)])]),s("div",$x,[n.value?(m(),x("div",Sx,"Loading…")):t.value.length===0?(m(),x("div",Cx,"No snapshots yet")):(m(),x("div",Tx,[(m(!0),x(se,null,me(t.value,L=>(m(),x("div",{key:L.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[s("div",Px,[s("div",Ex,[s("div",Ix,[s("span",Ax,b(L.name),1),s("span",Mx,"v"+b(L.mcpVersion),1),s("span",Ox,b(v(L.sizeBytes)),1)]),s("div",Dx,[Y(b(f(L.createdAt)),1),L.description?(m(),x(se,{key:0},[Y(" · "+b(L.description),1)],64)):U("",!0)])]),s("button",{onClick:D=>E(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"},b(r.value===L.name?"…":"Delete"),9,Rx)])]))),128))]))]),c.value?(m(),x("div",Lx,[s("div",jx,[M[5]||(M[5]=s("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),s("p",Ux,[M[3]||(M[3]=Y(" Delete ",-1)),s("span",Nx,b(c.value),1),M[4]||(M[4]=Y("? This cannot be undone. ",-1))]),s("div",{class:"flex gap-3"},[s("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"),s("button",{onClick:y,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")])])])):U("",!0)]))}}),Bx={class:"animate-fade-in space-y-6"},Hx={class:"glass rounded-xl p-6"},Fx={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Kx={class:"text-sm text-textSecondary mt-1"},Wx={class:"flex items-center gap-3"},zx={key:0,class:"text-xs text-accentLight animate-pulse"},Jx={key:0,class:"flex flex-wrap gap-2 mt-3"},qx=["onClick"],Gx={class:"ml-1 opacity-60"},Yx={key:0,class:"text-center py-12 text-textSecondary"},Zx={key:1,class:"text-center py-8 text-danger text-sm"},Qx={key:2,class:"text-center py-12 text-textSecondary"},Xx={key:3,class:"space-y-3"},ev={class:"flex flex-wrap items-start gap-3"},tv={class:"flex-1 min-w-0 space-y-2"},sv={class:"flex flex-wrap items-center gap-2"},nv={class:"font-semibold truncate"},ov={class:"text-xs text-muted font-mono"},rv={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},av={title:"Created"},lv={title:"Archived"},iv={key:0,class:"text-muted"},dv={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},uv={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},cv={class:"flex items-center gap-2 shrink-0"},fv=["onClick","disabled"],pv=3,mv=Oe({__name:"ArchivedThreadsTab",setup(e){const t=w([]),n=w(!0),o=w(""),r=w({}),a=w({}),l=w({done:0,total:0}),i=w(null),c=w("all");let v=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=Te(()=>c.value==="all"?t.value:t.value.filter(M=>M.type===c.value)),k=Te(()=>{const M={all:t.value.length};for(const L of t.value)M[L.type]=(M[L.type]??0)+1;return M}),S=Te(()=>Object.values(a.value).some(Boolean));async function E(){n.value=!0,o.value="";try{const M=await ce("/api/threads/archived");t.value=M.threads??[],r.value={},a.value={},t.value.length>0&&y()}catch(M){o.value=M.message||"Failed to load archived threads"}finally{n.value=!1}}async function y(){const M=++v,L=[...t.value];l.value={done:0,total:L.length};async function D(){for(;L.length>0&&M===v;){const te=L.shift();a.value={...a.value,[te.threadId]:!0};try{const re=await fetch(`/api/threads/${te.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`}});if(M!==v)return;if(re.ok){const pe=await re.json();pe.summary&&(r.value={...r.value,[te.threadId]:pe.summary})}}catch{}finally{if(M===v){const{[te.threadId]:re,...pe}=a.value;a.value=pe,l.value={...l.value,done:l.value.done+1}}}}}const X=Array.from({length:Math.min(pv,L.length)},()=>D());await Promise.all(X)}function H(M){if(!M)return"—";const L=new Date(M),X=Date.now()-L.getTime(),te=Math.floor(X/6e4),re=Math.floor(X/36e5),pe=Math.floor(X/864e5),be=Math.floor(pe/30);return te<1?"just now":te<60?`${te}m ago`:re<24?`${re}h ago`:pe<30?`${pe}d ago`:be<12?`${be}mo ago`:`${Math.floor(be/12)}y ago`}async function C(M){if(confirm(`Unarchive thread "${M.name}" (${M.threadId})?`)){i.value=M.threadId;try{const L=await fetch(`/api/threads/${M.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${ge()}`}});if(!L.ok){const D=await L.json().catch(()=>({error:L.statusText}));throw new Error(D.error??L.statusText)}await E()}catch(L){o.value="Failed to unarchive: "+L.message}finally{i.value=null}}}return De(E),(M,L)=>(m(),x("div",Bx,[s("div",Hx,[s("div",Fx,[s("div",null,[L[0]||(L[0]=s("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),s("p",Kx,b(t.value.length)+" archived thread"+b(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),s("div",Wx,[S.value?(m(),x("span",zx," Building summaries… "+b(l.value.done)+"/"+b(l.value.total),1)):U("",!0),s("button",{onClick:E,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(m(),x("div",Jx,[(m(),x(se,null,me(["all","root","branch","daily"],D=>s("button",{key:D,onClick:X=>c.value=D,class:G(["px-3 py-1 rounded-full text-xs font-medium border transition",c.value===D?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[Y(b(D==="all"?"All":D.charAt(0).toUpperCase()+D.slice(1))+" ",1),s("span",Gx,"("+b(k.value[D]??0)+")",1)],10,qx)),64))])):U("",!0)]),n.value&&t.value.length===0?(m(),x("div",Yx,"Loading archived threads…")):o.value?(m(),x("div",Zx,b(o.value),1)):t.value.length===0?(m(),x("div",Qx,"No archived threads")):U("",!0),p.value.length>0?(m(),x("div",Xx,[(m(!0),x(se,null,me(p.value,D=>{var X,te;return m(),x("div",{key:D.id,class:"glass rounded-xl p-4"},[s("div",ev,[s("div",tv,[s("div",sv,[s("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(X=f[D.type])==null?void 0:X.classes])},b((te=f[D.type])==null?void 0:te.emoji)+" "+b(D.type.toUpperCase()),3),s("span",nv,b(D.name),1),s("span",ov,"ID: "+b(D.threadId),1)]),s("div",rv,[s("span",av,"Created "+b(H(D.createdAt)),1),s("span",lv,"Archived "+b(H(D.archivedAt??D.lastActiveAt)),1),D.client?(m(),x("span",iv,b(D.client),1)):U("",!0)]),r.value[D.threadId]?(m(),x("div",dv,b(r.value[D.threadId]),1)):a.value[D.threadId]?(m(),x("div",uv," Generating summary… ")):U("",!0)]),s("div",cv,[s("button",{onClick:re=>C(D),disabled:i.value===D.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"},b(i.value===D.threadId?"Restoring…":"↩ Unarchive"),9,fv)])])])}),128))])):U("",!0)]))}}),xv=["title"],vv={class:"flex items-center justify-between px-1 mb-3"},gv={class:"text-xs font-semibold uppercase tracking-wider text-textSecondary"},bv={class:"text-xs font-mono text-muted"},hv={class:"space-y-2 flex-1"},yv=["onDragstart","onClick"],_v={class:"flex items-start justify-between gap-2 mb-1.5"},wv={class:"text-sm font-medium leading-snug"},kv={class:"flex items-center gap-1 shrink-0 text-xs"},$v={key:0,title:"Escalated to main thread",class:"text-warn"},Sv={key:1,title:"Recurring",class:"text-accentLight"},Cv={key:2,class:"font-mono text-muted"},Tv={class:"flex flex-wrap items-center gap-1.5"},Pv={class:"text-[0.65rem] text-muted truncate"},Ev={key:0,class:"mt-2 text-xs text-danger/90 line-clamp-2"},Iv={key:1,class:"mt-2 text-[0.65rem] font-mono text-muted"},Av={key:0,class:"text-center text-xs text-muted py-6"},Mv=Oe({__name:"KanbanColumn",props:{title:{},status:{},cards:{},laneNames:{},hot:{type:Boolean},dragBlocked:{type:Boolean}},emits:["drop-card","open","dragstart-card","dragend-card"],setup(e,{emit:t}){const n=e,o=t,r=w(0),a=Te(()=>r.value>0);function l(v){var k;if(r.value=0,n.dragBlocked)return;const f=(k=v.dataTransfer)==null?void 0:k.getData("text/board-card"),p=f?Number(f):NaN;Number.isInteger(p)&&o("drop-card",p,n.status)}function i(v,f){var p;(p=v.dataTransfer)==null||p.setData("text/board-card",String(f.cardId)),v.dataTransfer&&(v.dataTransfer.effectAllowed="move"),o("dragstart-card",f)}const c={bug:"background:rgba(239,68,68,0.15);color:#f87171",feature:"background:rgba(99,102,241,0.15);color:#818cf8","tech-debt":"background:rgba(245,158,11,0.15);color:#fbbf24",chore:"background:rgba(107,114,128,0.2);color:#9ca3af",research:"background:rgba(34,197,94,0.15);color:#4ade80","recurring-ops":"background:rgba(168,85,247,0.15);color:#c084fc"};return(v,f)=>(m(),x("div",{class:G(["rounded-2xl p-3 flex flex-col min-h-[16rem] transition","glass",e.hot&&e.cards.length>0?"board-col-hot":"",a.value&&e.dragBlocked?"ring-1 ring-danger/70 cursor-not-allowed":"",a.value&&!e.dragBlocked?"ring-1 ring-accent/60 bg-cardHover/40":""]),title:e.dragBlocked?"Stop the running card first — a live card can only reach Blocked via Stop":"",onDragover:f[1]||(f[1]=Dt(()=>{},["prevent"])),onDragenter:f[2]||(f[2]=Dt(p=>r.value++,["prevent"])),onDragleave:f[3]||(f[3]=p=>r.value=Math.max(0,r.value-1)),onDrop:Dt(l,["prevent"])},[s("div",vv,[s("span",gv,b(e.title),1),s("span",bv,b(e.cards.length),1)]),s("div",hv,[(m(!0),x(se,null,me(e.cards,p=>(m(),x("div",{key:p.cardId,draggable:"true",onDragstart:k=>i(k,p),onDragend:f[0]||(f[0]=k=>o("dragend-card")),onClick:k=>o("open",p),class:"board-card glass rounded-xl p-3 cursor-pointer border border-transparent hover:border-accent/40 transition select-none"},[s("div",_v,[s("span",wv,b(p.title),1),s("span",kv,[p.escalate?(m(),x("span",$v,"⚑")):U("",!0),p.recurDelayMin!=null?(m(),x("span",Sv,"↻")):U("",!0),p.priority>0?(m(),x("span",Cv,"P"+b(p.priority),1)):U("",!0)])]),s("div",Tv,[s("span",{class:"type-badge",style:bt(c[p.type]??c.chore)},b(p.type),5),s("span",Pv,b(e.laneNames[p.laneThreadId]??`Thread ${p.laneThreadId}`),1)]),p.status==="blocked"&&p.blockedReason?(m(),x("div",Ev,b(p.blockedReason),1)):p.status==="in_progress"&&p.workerThreadId?(m(),x("div",Iv," worker "+b(p.workerThreadId),1)):U("",!0)],40,yv))),128)),e.cards.length===0?(m(),x("div",Av,"—")):U("",!0)])],42,xv))}}),Ov={class:"glass rounded-2xl p-6 max-w-2xl w-full mx-4 animate-slide-up"},Dv={class:"flex items-start justify-between gap-3 mb-5"},Rv={class:"text-lg font-semibold"},Lv={key:0,class:"ml-2 type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},jv={class:"space-y-4"},Uv={class:"grid grid-cols-2 sm:grid-cols-4 gap-3"},Nv={class:"block"},Vv=["disabled","title"],Bv=["value"],Hv={class:"block"},Fv=["disabled","title"],Kv=["value"],Wv={class:"block"},zv={class:"block"},Jv={class:"block"},qv={class:"block"},Gv={class:"flex items-center gap-2 text-sm cursor-pointer"},Yv={class:"rounded-xl border border-gray-800"},Zv=["disabled","title"],Qv={key:0,class:"col-span-2 sm:col-span-3 text-xs text-warn"},Xv={class:"flex items-center gap-2"},eg={class:"flex items-center gap-2"},tg={class:"flex items-center gap-2"},sg={class:"flex items-center gap-2"},ng={class:"flex items-center gap-2"},og={class:"flex items-center gap-2"},rg={class:"flex items-center gap-2"},ag={class:"block col-span-2 sm:col-span-1"},lg={class:"block"},ig={class:"block"},dg={class:"block"},ug={class:"block col-span-2"},cg={key:0,class:"text-sm text-danger"},fg={class:"flex flex-wrap gap-2"},pg=["disabled"],mg=["disabled"],xg=["disabled"],vg=["disabled"],gg=["disabled"],bg={key:1,class:"rounded-xl border border-red-900/60 bg-red-950/30 px-3 py-2 text-sm text-red-300"},hg={key:2,class:"pt-2 border-t border-gray-800"},yg={key:0,class:"text-xs text-muted mb-3"},_g={key:1,class:"space-y-2 mb-3 max-h-64 overflow-y-auto pr-1"},wg={class:"flex items-center gap-2 mb-1"},kg={class:"text-[0.65rem] text-muted"},$g={class:"text-xs whitespace-pre-wrap font-sans text-textSecondary"},Sg={class:"flex gap-2"},Cg=["disabled"],Tg=["disabled"],Pg={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Eg={class:"text-sm text-textSecondary mb-4"},Ig={key:0,class:"block mt-2 text-warn"},Ag={class:"flex gap-3"},Mg=["disabled"],Og={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Dg={class:"text-base font-semibold mb-2"},Rg={class:"flex gap-3"},Lg=["disabled"],jg=Oe({__name:"CardModal",props:{card:{},lanes:{},profiles:{}},emits:["close","refresh"],setup(e,{emit:t}){var _,I,R,W,ue,oe,O,P,z,ve;const n=e,o=t,r=Te(()=>n.card===null),a=Te(()=>{var le;return((le=n.card)==null?void 0:le.status)==="in_progress"}),l=w(!1),i=w(""),c=w(!1),v=w(!1),f=w([]),p=w(""),k=w(!1),S=w(!1),E=["bug","feature","tech-debt","chore","research","recurring-ops"],y=w({title:((_=n.card)==null?void 0:_.title)??"",type:((I=n.card)==null?void 0:I.type)??"chore",laneThreadId:((R=n.card)==null?void 0:R.laneThreadId)??((W=n.lanes[0])==null?void 0:W.threadId)??0,priority:((ue=n.card)==null?void 0:ue.priority)??0,description:((oe=n.card)==null?void 0:oe.description)??"",acceptance:((O=n.card)==null?void 0:O.acceptance)??"",escalate:((P=n.card)==null?void 0:P.escalate)??!1,recurDelayMin:((z=n.card)==null?void 0:z.recurDelayMin)??null,profile:{...((ve=n.card)==null?void 0:ve.profile)??n.profiles.chore??{}}});function H(){r.value&&(y.value.profile={...n.profiles[y.value.type]??{}})}async function C(){if(n.card)try{const le=await ce(`/api/board/cards/${n.card.cardId}`);f.value=le.comments}catch{}}async function M(){if(l.value)return;if(!y.value.title.trim()){i.value="Title is required";return}if(!y.value.laneThreadId){i.value="Lane (thread) is required";return}l.value=!0,i.value="";const le={title:y.value.title,type:y.value.type,laneThreadId:y.value.laneThreadId,priority:y.value.priority,description:y.value.description,acceptance:y.value.acceptance,escalate:y.value.escalate,recurDelayMin:typeof y.value.recurDelayMin=="number"&&y.value.recurDelayMin>=1?y.value.recurDelayMin:null,profile:y.value.profile};try{r.value?await ce("/api/board/cards",{method:"POST",body:JSON.stringify(le)}):await ce(`/api/board/cards/${n.card.cardId}`,{method:"PATCH",body:JSON.stringify(le)}),o("refresh"),o("close")}catch(A){i.value=A.message||"Save failed"}finally{l.value=!1}}const L=w(!1);async function D(le){if(!(!n.card||L.value)){L.value=!0;try{await le(),o("refresh"),o("close")}catch(A){i.value=A.message}finally{L.value=!1}}}const X=le=>D(()=>ce(`/api/board/cards/${n.card.cardId}`,{method:"PATCH",body:JSON.stringify({status:le})}));function te(){a.value?v.value=!0:X("done")}const re=()=>D(()=>ce(`/api/board/cards/${n.card.cardId}/stop`,{method:"POST"})),pe=()=>D(()=>ce(`/api/board/cards/${n.card.cardId}`,{method:"PATCH",body:JSON.stringify({archivedAt:"now"})})),be=()=>D(()=>ce(`/api/board/cards/${n.card.cardId}`,{method:"DELETE"}));async function ne(){if(!n.card||k.value)return;const le=p.value.trim();if(le){k.value=!0,p.value="";try{await ce(`/api/board/cards/${n.card.cardId}/comments`,{method:"POST",body:JSON.stringify({content:le})}),await C()}catch(A){i.value=A.message,p.value=le}finally{k.value=!1}}}function $(le){try{return new Date(le).toLocaleString()}catch{return le}}const h={operator:"background:rgba(99,102,241,0.15);color:#818cf8",worker:"background:rgba(34,197,94,0.15);color:#4ade80",board:"background:rgba(107,114,128,0.2);color:#9ca3af"};return De(C),(le,A)=>(m(),x("div",{class:"fixed inset-0 z-50 flex items-start justify-center bg-surface/85 backdrop-blur-sm overflow-y-auto py-8",onClick:A[30]||(A[30]=Dt(Z=>o("close"),["self"]))},[s("div",Ov,[s("div",Dv,[s("h3",Rv,[Y(b(r.value?"New Card":`Card #${e.card.cardId}`)+" ",1),r.value?U("",!0):(m(),x("span",Lv,b(e.card.status),1))]),s("button",{onClick:A[0]||(A[0]=Z=>o("close")),class:"text-muted hover:text-textPrimary transition text-xl leading-none"},"×")]),s("div",jv,[F(s("input",{"onUpdate:modelValue":A[1]||(A[1]=Z=>y.value.title=Z),placeholder:"Title",class:"w-full px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent transition"},null,512),[[ee,y.value.title]]),s("div",Uv,[s("label",Nv,[A[31]||(A[31]=s("span",{class:"text-xs text-textSecondary"},"Type",-1)),F(s("select",{"onUpdate:modelValue":A[2]||(A[2]=Z=>y.value.type=Z),onChange:H,disabled:a.value,title:a.value?"Stop the card first — its type is locked while running":"",class:"mt-1 w-full px-2 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent disabled:opacity-50 disabled:cursor-not-allowed"},[(m(),x(se,null,me(E,Z=>s("option",{key:Z,value:Z},b(Z),9,Bv)),64))],40,Vv),[[Ie,y.value.type]])]),s("label",Hv,[A[32]||(A[32]=s("span",{class:"text-xs text-textSecondary"},"Lane (thread)",-1)),F(s("select",{"onUpdate:modelValue":A[3]||(A[3]=Z=>y.value.laneThreadId=Z),disabled:a.value,title:a.value?"Stop the card first — re-laning is locked while running":"",class:"mt-1 w-full px-2 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent disabled:opacity-50 disabled:cursor-not-allowed"},[(m(!0),x(se,null,me(e.lanes,Z=>(m(),x("option",{key:Z.threadId,value:Z.threadId},b(Z.name??`Thread ${Z.threadId}`),9,Kv))),128))],8,Fv),[[Ie,y.value.laneThreadId,void 0,{number:!0}]])]),s("label",Wv,[A[33]||(A[33]=s("span",{class:"text-xs text-textSecondary"},"Priority",-1)),F(s("input",{"onUpdate:modelValue":A[4]||(A[4]=Z=>y.value.priority=Z),type:"number",min:"0",max:"10",class:"mt-1 w-full px-2 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent"},null,512),[[ee,y.value.priority,void 0,{number:!0}]])]),s("label",zv,[A[34]||(A[34]=s("span",{class:"text-xs text-textSecondary"},"Recur (min)",-1)),F(s("input",{"onUpdate:modelValue":A[5]||(A[5]=Z=>y.value.recurDelayMin=Z),type:"number",min:"1",placeholder:"—",class:"mt-1 w-full px-2 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent"},null,512),[[ee,y.value.recurDelayMin,void 0,{number:!0}]])])]),s("label",Jv,[A[35]||(A[35]=s("span",{class:"text-xs text-textSecondary"},[Y("Description "),s("span",{class:"text-muted"},"(may reference an implementation_plans/ file)")],-1)),F(s("textarea",{"onUpdate:modelValue":A[6]||(A[6]=Z=>y.value.description=Z),rows:"4",class:"mt-1 w-full px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm font-mono focus:outline-none focus:border-accent"},null,512),[[ee,y.value.description]])]),s("label",qv,[A[36]||(A[36]=s("span",{class:"text-xs text-textSecondary"},"Acceptance criteria",-1)),F(s("textarea",{"onUpdate:modelValue":A[7]||(A[7]=Z=>y.value.acceptance=Z),rows:"2",class:"mt-1 w-full px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm font-mono focus:outline-none focus:border-accent"},null,512),[[ee,y.value.acceptance]])]),s("label",Gv,[F(s("input",{"onUpdate:modelValue":A[8]||(A[8]=Z=>y.value.escalate=Z),type:"checkbox",class:"accent-amber-500"},null,512),[[ot,y.value.escalate]]),A[37]||(A[37]=s("span",{class:"text-warn"},"⚑ Important to me",-1)),A[38]||(A[38]=s("span",{class:"text-xs text-muted"},"— mirror this card's updates into the main thread (FYI)",-1))]),s("div",Yv,[s("button",{onClick:A[9]||(A[9]=Z=>S.value=!S.value),class:"w-full px-3 py-2 flex items-center justify-between text-sm text-textSecondary hover:text-textPrimary transition"},[A[39]||(A[39]=s("span",null,[Y("Execution profile "),s("span",{class:"text-xs text-muted"},"(seeded by type — the standing orders)")],-1)),s("span",null,b(S.value?"▾":"▸"),1)]),S.value?(m(),x("fieldset",{key:0,disabled:a.value,title:a.value?"Stop the card first — the profile is baked at spawn and locked while running":"",class:"px-3 pb-3 grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-2 text-sm disabled:opacity-50"},[a.value?(m(),x("p",Qv,"Locked while running — Stop the card to change its profile.")):U("",!0),s("label",Xv,[F(s("input",{"onUpdate:modelValue":A[10]||(A[10]=Z=>y.value.profile.createBranch=Z),type:"checkbox"},null,512),[[ot,y.value.profile.createBranch]]),A[40]||(A[40]=Y(" Create branch",-1))]),s("label",eg,[F(s("input",{"onUpdate:modelValue":A[11]||(A[11]=Z=>y.value.profile.runTests=Z),type:"checkbox"},null,512),[[ot,y.value.profile.runTests]]),A[41]||(A[41]=Y(" Run tests",-1))]),s("label",tg,[F(s("input",{"onUpdate:modelValue":A[12]||(A[12]=Z=>y.value.profile.build=Z),type:"checkbox"},null,512),[[ot,y.value.profile.build]]),A[42]||(A[42]=Y(" Build",-1))]),s("label",sg,[F(s("input",{"onUpdate:modelValue":A[13]||(A[13]=Z=>y.value.profile.openPr=Z),type:"checkbox"},null,512),[[ot,y.value.profile.openPr]]),A[43]||(A[43]=Y(" Open PR",-1))]),s("label",ng,[F(s("input",{"onUpdate:modelValue":A[14]||(A[14]=Z=>y.value.profile.push=Z),type:"checkbox"},null,512),[[ot,y.value.profile.push]]),A[44]||(A[44]=Y(" Push",-1))]),s("label",og,[F(s("input",{"onUpdate:modelValue":A[15]||(A[15]=Z=>y.value.profile.expertReview=Z),type:"checkbox"},null,512),[[ot,y.value.profile.expertReview]]),A[45]||(A[45]=Y(" Expert review",-1))]),s("label",rg,[F(s("input",{"onUpdate:modelValue":A[16]||(A[16]=Z=>y.value.profile.operatorReview=Z),type:"checkbox"},null,512),[[ot,y.value.profile.operatorReview]]),A[46]||(A[46]=Y(" Operator review",-1))]),s("label",ag,[A[48]||(A[48]=s("span",{class:"text-xs text-textSecondary"},"CI check",-1)),F(s("select",{"onUpdate:modelValue":A[17]||(A[17]=Z=>y.value.profile.ciCheck=Z),class:"mt-1 w-full px-2 py-1.5 rounded-lg bg-surface border border-gray-700 text-xs"},[...A[47]||(A[47]=[s("option",{value:"none"},"none",-1),s("option",{value:"github"},"GitHub",-1),s("option",{value:"azure"},"Azure DevOps",-1)])],512),[[Ie,y.value.profile.ciCheck]])]),s("label",lg,[A[50]||(A[50]=s("span",{class:"text-xs text-textSecondary"},"Agent",-1)),F(s("select",{"onUpdate:modelValue":A[18]||(A[18]=Z=>y.value.profile.agentType=Z),class:"mt-1 w-full px-2 py-1.5 rounded-lg bg-surface border border-gray-700 text-xs"},[...A[49]||(A[49]=[s("option",{value:void 0},"default",-1),s("option",{value:"claude"},"claude",-1),s("option",{value:"copilot"},"copilot",-1),s("option",{value:"codex"},"codex",-1),s("option",{value:"fable"},"fable (explicit)",-1)])],512),[[Ie,y.value.profile.agentType]])]),s("label",ig,[A[52]||(A[52]=s("span",{class:"text-xs text-textSecondary"},"Reviewer",-1)),F(s("select",{"onUpdate:modelValue":A[19]||(A[19]=Z=>y.value.profile.reviewAgentType=Z),class:"mt-1 w-full px-2 py-1.5 rounded-lg bg-surface border border-gray-700 text-xs"},[...A[51]||(A[51]=[s("option",{value:void 0},"default",-1),s("option",{value:"claude"},"claude",-1),s("option",{value:"copilot"},"copilot",-1),s("option",{value:"fable"},"fable",-1)])],512),[[Ie,y.value.profile.reviewAgentType]])]),s("label",dg,[A[54]||(A[54]=s("span",{class:"text-xs text-textSecondary"},"Size",-1)),F(s("select",{"onUpdate:modelValue":A[20]||(A[20]=Z=>y.value.profile.size=Z),class:"mt-1 w-full px-2 py-1.5 rounded-lg bg-surface border border-gray-700 text-xs"},[...A[53]||(A[53]=[s("option",{value:void 0},"auto",-1),s("option",{value:"operational"},"operational",-1),s("option",{value:"code"},"code",-1)])],512),[[Ie,y.value.profile.size]])]),s("label",ug,[A[55]||(A[55]=s("span",{class:"text-xs text-textSecondary"},"Repository (blank = worker default)",-1)),F(s("input",{"onUpdate:modelValue":A[21]||(A[21]=Z=>y.value.profile.repository=Z),class:"mt-1 w-full px-2 py-1.5 rounded-lg bg-surface border border-gray-700 text-xs font-mono"},null,512),[[ee,y.value.profile.repository]])])],8,Zv)):U("",!0)]),i.value?(m(),x("p",cg,b(i.value),1)):U("",!0),s("div",fg,[s("button",{onClick:M,disabled:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(l.value?"Saving…":r.value?"Create Card":"Save Changes"),9,pg),r.value?U("",!0):(m(),x(se,{key:0},[a.value?(m(),x("button",{key:0,onClick:re,disabled:L.value,title:"Decommission the running worker and park this card in Blocked",class:"px-3 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-warn hover:text-red-400 transition"},"■ Stop",8,mg)):U("",!0),e.card.status==="blocked"||e.card.status==="done"?(m(),x("button",{key:1,onClick:A[22]||(A[22]=Z=>X("backlog")),disabled:L.value,class:"px-3 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"↩ Resume (fresh worker)",8,xg)):U("",!0),e.card.status!=="done"?(m(),x("button",{key:2,onClick:te,disabled:L.value,class:"px-3 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-success transition"},"✓ Mark Done",8,vg)):U("",!0),e.card.status==="done"?(m(),x("button",{key:3,onClick:pe,disabled:L.value,class:"px-3 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary transition"},"Archive",8,gg)):U("",!0),s("button",{onClick:A[23]||(A[23]=Z=>c.value=!0),class:"px-3 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 ml-auto"},"Delete")],64))]),!r.value&&e.card.blockedReason?(m(),x("div",bg,[A[56]||(A[56]=s("span",{class:"font-semibold"},"Blocked:",-1)),Y(" "+b(e.card.blockedReason),1)])):U("",!0),r.value?U("",!0):(m(),x("div",hg,[A[57]||(A[57]=s("h4",{class:"text-sm font-semibold mb-3"},"Card history",-1)),f.value.length===0?(m(),x("div",yg,"No comments yet — the card is its own inbox; worker reports land here.")):(m(),x("div",_g,[(m(!0),x(se,null,me(f.value,Z=>(m(),x("div",{key:Z.id,class:"rounded-xl bg-surface/60 border border-gray-800 px-3 py-2"},[s("div",wg,[s("span",{class:"type-badge",style:bt(h[Z.author])},b(Z.author),5),s("span",kg,b($(Z.createdAt)),1)]),s("pre",$g,b(Z.content),1)]))),128))])),s("div",Sg,[F(s("input",{"onUpdate:modelValue":A[24]||(A[24]=Z=>p.value=Z),disabled:k.value,placeholder:"Add guidance for the next worker…",class:"flex-1 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent disabled:opacity-50",onKeydown:qe(ne,["enter"])},null,40,Cg),[[ee,p.value]]),s("button",{onClick:ne,disabled:k.value,class:"px-3 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition disabled:opacity-50"},"Comment",8,Tg)])]))]),c.value?(m(),x("div",{key:0,class:"fixed inset-0 z-[60] flex items-center justify-center bg-surface/80 backdrop-blur-sm",onClick:A[26]||(A[26]=Dt(Z=>c.value=!1,["self"]))},[s("div",Pg,[A[58]||(A[58]=s("h3",{class:"text-base font-semibold mb-2"},"Delete Card",-1)),s("p",Eg,[Y(" Delete card #"+b(e.card.cardId)+" and its history? This cannot be undone. ",1),a.value?(m(),x("span",Ig,"The running worker will be stopped and its in-flight work discarded.")):U("",!0)]),s("div",Ag,[s("button",{onClick:be,disabled:L.value,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete",8,Mg),s("button",{onClick:A[25]||(A[25]=Z=>c.value=!1),class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary transition"},"Cancel")])])])):U("",!0),v.value?(m(),x("div",{key:1,class:"fixed inset-0 z-[60] flex items-center justify-center bg-surface/80 backdrop-blur-sm",onClick:A[29]||(A[29]=Dt(Z=>v.value=!1,["self"]))},[s("div",Og,[s("h3",Dg,"Mark card #"+b(e.card.cardId)+" done?",1),A[59]||(A[59]=s("p",{class:"text-sm text-textSecondary mb-4"},"This card is running. Marking it done stops the running worker and discards its in-flight work.",-1)),s("div",Rg,[s("button",{onClick:A[27]||(A[27]=Z=>{v.value=!1,X("done")}),disabled:L.value,class:"flex-1 px-4 py-2 rounded-xl bg-success/80 hover:opacity-80 text-white text-sm font-medium transition"},"Stop & mark done",8,Lg),s("button",{onClick:A[28]||(A[28]=Z=>v.value=!1),class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary transition"},"Cancel")])])])):U("",!0)])]))}}),Ug={class:"animate-fade-in"},Ng={class:"glass rounded-xl p-4 mb-6"},Vg={class:"flex flex-wrap items-center gap-3"},Bg={class:"flex items-center gap-2 ml-auto"},Hg={key:0,class:"flex flex-wrap items-center gap-2 mt-3"},Fg=["onClick"],Kg={key:1,class:"mt-4 pt-4 border-t border-gray-800"},Wg={class:"flex flex-wrap items-center gap-2 mb-3"},zg=["value"],Jg=["disabled"],qg={key:0,class:"space-y-2"},Gg={class:"flex-1 truncate"},Yg={class:"text-xs text-muted font-mono"},Zg={class:"flex items-center gap-1.5 text-xs text-muted"},Qg=["value","onChange"],Xg=["onClick"],eb={key:0,class:"text-center py-12 text-textSecondary text-sm"},tb={key:1,class:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4"},sb={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},nb={class:"text-base font-semibold mb-2"},ob={class:"text-sm text-textSecondary mb-4"},rb={class:"flex gap-3"},ab=Oe({__name:"BoardTab",setup(e){const t=w([]),n=w([]),o=w({}),r=w([]),a=w(!0),l=w(""),i=w(!0),c=w(null),v=w(!1),f=w(!1),p=w(""),k=w(!1),S=w(null),E=w(null),y=w(null);let H=null;const C=[{status:"backlog",title:"To-Do"},{status:"in_progress",title:"In Progress"},{status:"blocked",title:"Blocked",hot:!0},{status:"done",title:"Done"}],M=Te(()=>Object.fromEntries(n.value.map(O=>[O.threadId,O.name??`Thread ${O.threadId}`]))),L=Te(()=>t.value.filter(O=>c.value===null||O.laneThreadId===c.value)),D=O=>L.value.filter(P=>P.status===O);function X(O,P){l.value=O,i.value=P,setTimeout(()=>{l.value=""},4e3)}async function te(O=!1){if(!(!O&&(k.value||document.hidden)))try{const[P,z,ve]=await Promise.all([ce(`/api/board/cards${v.value?"?includeArchived=1":""}`),ce("/api/board/lanes"),ce("/api/board/profiles")]);t.value=P.cards,n.value=z.lanes,o.value=ve.profiles}catch(P){X("Load failed: "+P.message,!1)}finally{a.value=!1}}async function re(){try{const O=await ce("/api/threads/roots");r.value=O.threads}catch{}}const pe=new Set;async function be(O,P){const z=t.value.find(ve=>ve.cardId===O);if(!(!z||z.status===P||pe.has(O))){if(z.status==="in_progress"&&(P==="backlog"||P==="done")){y.value={card:z,status:P};return}await ne(O,P)}}async function ne(O,P){if(!pe.has(O)){pe.add(O);try{await ce(`/api/board/cards/${O}`,{method:"PATCH",body:JSON.stringify({status:P})}),await te(!0)}catch(z){X("Move failed: "+z.message,!1)}finally{pe.delete(O)}}}async function $(){const O=y.value;y.value=null,O&&await ne(O.card.cardId,O.status)}function h(O){S.value=O,k.value=!0}function _(){k.value=!1,te(!0)}function I(){if(n.value.length===0){X("Connect a lane (thread) first",!1),f.value=!0;return}S.value=null,k.value=!0}async function R(){if(p.value!=="")try{await ce("/api/board/lanes",{method:"POST",body:JSON.stringify({threadId:p.value,connected:!0})}),p.value="",await te(),X("Lane connected ✓",!0)}catch(O){X("Connect failed: "+O.message,!1)}}async function W(O){try{await ce("/api/board/lanes",{method:"POST",body:JSON.stringify({threadId:O.threadId,connected:!O.connected})}),await te()}catch(P){X("Update failed: "+P.message,!1)}}async function ue(O,P){const z=Number(P.target.value);if(!(!Number.isInteger(z)||z<1))try{await ce("/api/board/lanes",{method:"POST",body:JSON.stringify({threadId:O.threadId,maxConcurrent:z})}),await te()}catch(ve){X("Update failed: "+ve.message,!1)}}async function oe(){v.value=!v.value,await te()}return De(()=>{te(),re(),H=setInterval(te,1e4)}),Ns(()=>{H&&clearInterval(H)}),(O,P)=>(m(),x("div",Ug,[s("div",Ng,[s("div",Vg,[P[8]||(P[8]=s("div",null,[s("h3",{class:"text-lg font-semibold"},"Task Board"),s("p",{class:"text-xs text-textSecondary"},"Fire and forget — create a card, the board drives the workers")],-1)),l.value?(m(),x("span",{key:0,class:G(["text-sm ml-2",i.value?"text-success":"text-danger"])},b(l.value),3)):U("",!0),s("div",Bg,[s("button",{onClick:oe,class:G(["px-3 py-1.5 rounded-lg text-xs border transition",v.value?"border-accent text-accentLight":"border-gray-700 text-muted hover:text-textSecondary"])},b(v.value?"Hide archived":"Show archived"),3),s("button",{onClick:P[0]||(P[0]=z=>f.value=!f.value),class:"px-3 py-1.5 rounded-lg text-xs border border-gray-700 text-textSecondary hover:text-textPrimary transition"},"Lanes"),s("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"+ New Card")])]),n.value.length>0?(m(),x("div",Hg,[s("button",{onClick:P[1]||(P[1]=z=>c.value=null),class:G(["px-3 py-1 rounded-full text-xs border transition",c.value===null?"border-accent text-accentLight bg-accent/10":"border-gray-700 text-muted hover:text-textSecondary"])},"All lanes",2),(m(!0),x(se,null,me(n.value,z=>(m(),x("button",{key:z.threadId,onClick:ve=>c.value=c.value===z.threadId?null:z.threadId,class:G(["px-3 py-1 rounded-full text-xs border transition flex items-center gap-1.5",c.value===z.threadId?"border-accent text-accentLight bg-accent/10":"border-gray-700 text-muted hover:text-textSecondary"])},[s("span",{class:G(["w-1.5 h-1.5 rounded-full",z.connected?"bg-success":"bg-gray-600"])},null,2),Y(" "+b(z.name??`Thread ${z.threadId}`),1)],10,Fg))),128))])):U("",!0),f.value?(m(),x("div",Kg,[s("div",Wg,[F(s("select",{"onUpdate:modelValue":P[2]||(P[2]=z=>p.value=z),class:"px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm focus:outline-none focus:border-accent"},[P[9]||(P[9]=s("option",{value:"",disabled:""},"Connect a thread…",-1)),(m(!0),x(se,null,me(r.value.filter(z=>!n.value.some(ve=>ve.threadId===z.threadId)),z=>(m(),x("option",{key:z.threadId,value:z.threadId},b(z.name),9,zg))),128))],512),[[Ie,p.value]]),s("button",{onClick:R,disabled:p.value==="",class:"px-3 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm transition"},"Connect",8,Jg)]),n.value.length>0?(m(),x("div",qg,[(m(!0),x(se,null,me(n.value,z=>(m(),x("div",{key:z.threadId,class:"flex items-center gap-3 text-sm"},[s("span",{class:G(["w-2 h-2 rounded-full shrink-0",z.connected?"bg-success":"bg-gray-600"])},null,2),s("span",Gg,[Y(b(z.name??`Thread ${z.threadId}`)+" ",1),s("span",Yg,"("+b(z.threadId)+")",1)]),s("label",Zg,[P[10]||(P[10]=Y(" concurrent ",-1)),s("input",{type:"number",min:"1",max:"5",value:z.maxConcurrent,onChange:ve=>ue(z,ve),class:"w-14 px-2 py-1 rounded-lg bg-surface border border-gray-700 text-xs text-center"},null,40,Qg)]),s("button",{onClick:ve=>W(z),class:G(["px-2.5 py-1 rounded-lg text-xs border transition",z.connected?"border-gray-700 text-muted hover:text-warn":"border-gray-700 text-success"])},b(z.connected?"Disconnect":"Reconnect"),11,Xg)]))),128))])):U("",!0)])):U("",!0)]),a.value?(m(),x("div",eb,"Loading…")):(m(),x("div",tb,[(m(),x(se,null,me(C,z=>{var ve;return Ye(Mv,{key:z.status,title:z.title,status:z.status,cards:D(z.status),"lane-names":M.value,hot:z.hot,"drag-blocked":z.status==="blocked"&&((ve=E.value)==null?void 0:ve.status)==="in_progress",onDropCard:be,onOpen:h,onDragstartCard:P[3]||(P[3]=le=>E.value=le),onDragendCard:P[4]||(P[4]=le=>E.value=null)},null,8,["title","status","cards","lane-names","hot","drag-blocked"])}),64))])),y.value?(m(),x("div",{key:2,class:"fixed inset-0 z-[60] flex items-center justify-center bg-surface/80 backdrop-blur-sm",onClick:P[6]||(P[6]=Dt(z=>y.value=null,["self"]))},[s("div",sb,[s("h3",nb,b(y.value.status==="backlog"?"Re-run card":"Mark card done")+" #"+b(y.value.card.cardId)+"? ",1),s("p",ob," This card is running. Moving it "+b(y.value.status==="backlog"?"back to To-Do re-runs it from scratch":"to Done")+" — that stops the running worker and discards its in-flight work. ",1),s("div",rb,[s("button",{onClick:$,class:"flex-1 px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},b(y.value.status==="backlog"?"Stop & re-run":"Stop & mark done"),1),s("button",{onClick:P[5]||(P[5]=z=>y.value=null),class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary transition"},"Cancel")])])])):U("",!0),k.value?(m(),Tn(jg,{key:3,card:S.value,lanes:n.value,profiles:o.value,onClose:_,onRefresh:P[7]||(P[7]=z=>te(!0))},null,8,["card","lanes","profiles"])):U("",!0)]))}}),lb={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},ib={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},db=["disabled"],ub={key:0,class:"mt-3 text-sm text-danger"},cb={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},fb={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},pb={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},mb={class:"flex items-center gap-4"},xb={class:"text-sm text-textSecondary font-mono"},vb={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},gb={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},bb={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},hb={class:"text-2xl font-bold font-mono"},yb={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},_b={class:"text-2xl font-bold font-mono"},wb={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},kb={class:"text-2xl font-bold font-mono"},$b={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Sb={class:"flex items-center gap-2 mb-2"},Cb={class:"text-2xl font-bold font-mono"},Tb={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Pb={class:"text-2xl font-bold font-mono"},Eb={class:"max-w-7xl mx-auto px-4 sm:px-6"},Ib={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Ab=["onClick"],Mb={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},bs="sensorium_token",Ob=Oe({__name:"App",setup(e){const t=w(!1),n=w(""),o=w(""),r=w(!1),a=w(null),l=w("sessions");let i=null;const c=[{id:"board",label:"Board"},{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:"prompts",label:"Prompts"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],v={board:ab,sessions:ii,notes:Ci,templates:ad,skills:zd,agents:vf,threads:Nc,archived:mv,mcp:np,prompts:bp,snapshots:Vx,claude:Xp,copilot:Wm,settings:vx},f=Te(()=>v[l.value]),p=Te(()=>{if(!a.value)return"—";const H=Math.floor(a.value.uptime),C=Math.floor(H/86400),M=Math.floor(H%86400/3600),L=Math.floor(H%3600/60);return C>0?`${C}d ${M}h`:M>0?`${M}h ${L}m`:`${L}m`});async function k(){const H=n.value.trim()||"no-auth";r.value=!0,o.value="";try{Yt(H),await E(),localStorage.setItem(bs,H),t.value=!0,y()}catch(C){const M=C;M.status===401?o.value="Invalid token":o.value=M.message??"Connection failed",Yt("")}finally{r.value=!1}}function S(){localStorage.removeItem(bs),t.value=!1,n.value="",a.value=null,i&&clearInterval(i),Yt("")}async function E(){a.value=await ce("/api/status")}function y(){i&&clearInterval(i),i=setInterval(E,3e4)}return De(async()=>{const H=localStorage.getItem(bs);if(H){n.value=H;try{Yt(H),await E(),t.value=!0,y()}catch{localStorage.removeItem(bs),Yt("")}}}),Ns(()=>{i&&clearInterval(i)}),(H,C)=>{var M,L,D,X,te,re,pe,be,ne;return t.value?(m(),x("div",cb,[s("header",fb,[s("div",pb,[C[3]||(C[3]=pt('<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)),s("div",mb,[C[2]||(C[2]=s("div",{class:"flex items-center gap-2 text-sm"},[s("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),s("span",{class:"text-textSecondary"},"Connected")],-1)),s("div",xb,b(p.value),1),s("button",{onClick:S,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),s("div",vb,[s("div",gb,[s("div",bb,[C[4]||(C[4]=pt('<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)),s("div",hb,b(((M=a.value)==null?void 0:M.activeSessions)??0),1)]),s("div",yb,[C[5]||(C[5]=pt('<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)),s("div",_b,b(((D=(L=a.value)==null?void 0:L.memory)==null?void 0:D.totalSemanticNotes)??0),1)]),s("div",wb,[C[6]||(C[6]=pt('<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)),s("div",kb,b(((te=(X=a.value)==null?void 0:X.memory)==null?void 0:te.totalEpisodes)??0),1)]),s("div",$b,[s("div",Sb,[s("span",{class:G((((pe=(re=a.value)==null?void 0:re.memory)==null?void 0:pe.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...C[7]||(C[7]=[s("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("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),C[8]||(C[8]=s("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),s("div",Cb,b(((ne=(be=a.value)==null?void 0:be.memory)==null?void 0:ne.unconsolidatedEpisodes)??0),1)]),s("div",Tb,[C[9]||(C[9]=pt('<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)),s("div",Pb,b(p.value),1)])])]),s("div",Eb,[s("nav",Ib,[(m(),x(se,null,me(c,$=>s("button",{key:$.id,onClick:h=>l.value=$.id,class:G(["pb-3 text-sm font-medium transition",l.value===$.id?"tab-active":"tab-inactive"])},b($.label),11,Ab)),64))])]),s("div",Mb,[(m(),Tn(Ia(f.value),{status:a.value},null,8,["status"]))])])):(m(),x("div",lb,[s("div",ib,[C[1]||(C[1]=pt('<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)),F(s("input",{"onUpdate:modelValue":C[0]||(C[0]=$=>n.value=$),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:qe(k,["enter"])},null,544),[[ee,n.value]]),s("button",{onClick:k,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"},b(r.value?"Connecting...":"Connect"),9,db),o.value?(m(),x("p",ub,b(o.value),1)):U("",!0)])]))}}});Wl(Ob).mount("#app");</script>
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}.board-col-hot{border-color:#ef444459;box-shadow:0 0 24px #ef44441f}.board-card{box-shadow:0 2px 12px #00000040}.board-card:hover{box-shadow:0 4px 18px #6366f12e}.tab-active{border-bottom:2px solid #6366f1;color:#e5e7eb}.tab-inactive{border-bottom:2px solid transparent;color:#6b7280}.tab-inactive:hover{color:#9ca3af}</style>
71
+ `,ee+ie}async function _(){if(!o.value)return;const E=o.value.name;try{const I=l.value.split(",").map(B=>B.trim()).filter(Boolean),W=r.value;let ie;W.trimStart().startsWith("---")?ie=W:ie=X(E,I,a.value,W);const ee=await fetch(`/api/skills/${encodeURIComponent(E)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!ee.ok)throw new Error(ee.statusText);u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3),await A()}catch(I){u.value="Error: "+I.message}}async function h(){if(!o.value)return;const E=o.value.name;try{const I=await fetch(`/api/skills/${encodeURIComponent(E)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!I.ok)throw new Error(I.statusText);ve(),await A()}catch(I){d.value="Error: "+I.message}}async function b(){const E=f.value.trim(),I=p.value;if(!E){T.value="Name is required";return}const W=I.split(",").map(ee=>ee.trim()).filter(Boolean);if(!W.length){T.value="At least one trigger is required";return}const ie=X(E,W,w.value,`\x3C!-- Write your skill instructions here -->
72
+ `);try{const ee=await fetch(`/api/skills/${encodeURIComponent(E)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!ee.ok)throw new Error(ee.statusText);T.value="Created ✓",x.value=!1,await A();const B=t.value.find(U=>U.name===E);B&&ue(B)}catch(ee){T.value="Error: "+ee.message}}return je(()=>{A(),j()}),(E,I)=>(v(),g("div",ou,[n("div",ru,[n("div",lu,[I[10]||(I[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:I[0]||(I[0]=W=>{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",au,[I[14]||(I[14]=n("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),n("div",iu,[n("div",null,[I[11]||(I[11]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),J(n("input",{"onUpdate:modelValue":I[1]||(I[1]=W=>f.value=W),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),[[Z,f.value]])]),n("div",null,[I[12]||(I[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),J(n("input",{"onUpdate:modelValue":I[2]||(I[2]=W=>p.value=W),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),[[Z,p.value]])])]),n("div",uu,[n("label",cu,[J(n("input",{"onUpdate:modelValue":I[3]||(I[3]=W=>w.value=W),type:"checkbox",class:"rounded"},null,512),[[io,w.value]]),I[13]||(I[13]=n("span",null,"Replaces orchestrator",-1))])]),n("div",du,[n("button",{onClick:b,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),n("button",{onClick:I[4]||(I[4]=W=>x.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),T.value?(v(),g("span",fu,y(T.value),1)):F("",!0)])])):F("",!0),n("div",pu,[I[18]||(I[18]=n("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),I[19]||(I[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",mu,[n("div",xu,[I[15]||(I[15]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),J(n("input",{"onUpdate:modelValue":I[5]||(I[5]=W=>C.value=W),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),[[Z,C.value]])]),n("div",null,[I[17]||(I[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),J(n("select",{"onUpdate:modelValue":I[6]||(I[6]=W=>N.value=W),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"},[...I[16]||(I[16]=[n("option",{value:"sensorium"},"Sensorium",-1),n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1)])],512),[[ze,N.value]])])]),n("div",vu,[n("button",{onClick:O,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),S.value?(v(),g("span",{key:0,class:q([S.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(S.value),3)):F("",!0)]),P.value.length?(v(),g("div",gu,[(v(!0),g(te,null,ce(P.value,W=>(v(),g("div",{key:W.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",hu,[n("span",{class:"type-badge",style:It(ne("user"))},y(W.type),5),n("span",{class:"text-xs font-mono text-textSecondary truncate",title:W.path},y(W.path),9,bu)]),n("button",{onClick:ie=>G(W.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,yu)]))),128))])):F("",!0)]),s.value?(v(),g("div",_u,"Loading...")):t.value.length===0?(v(),g("div",wu,"No skills loaded")):(v(),g("div",ku,[(v(!0),g(te,null,ce(t.value,W=>{var ie;return v(),g("div",{key:W.name,onClick:ee=>ue(W),class:q(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ie=o.value)==null?void 0:ie.name)===W.name?"border-accent":"border-transparent"])},[n("div",Su,[n("div",Cu,[n("div",Tu,[n("span",Pu,y(W.name),1),n("span",{class:"type-badge",style:It(ne(oe(W.source)))},y(oe(W.source)),5),W.replacesOrchestrator?(v(),g("span",Eu,"REPLACES ORCH")):F("",!0)]),n("div",Au,[(v(!0),g(te,null,ce(W.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:W.source||""},y((W.source||"").split(/[\\/]/).pop()||""),9,Iu)])],10,$u)}),128))]))]),o.value?(v(),g("div",Ou,[n("div",Mu,[n("div",null,[n("h3",Du,"Edit: "+y(o.value.name),1),n("p",Ru,y(o.value.source||"(unknown source)"),1)]),n("div",ju,[u.value?(v(),g("span",Lu,y(u.value),1)):F("",!0),d.value?(v(),g("span",Uu,y(d.value),1)):F("",!0),oe(o.value.source)==="user"?(v(),g("button",{key:2,onClick:h,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")):F("",!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:_,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Nu,[n("div",null,[I[20]||(I[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,Vu)]),n("div",null,[I[21]||(I[21]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),J(n("input",{"onUpdate:modelValue":I[7]||(I[7]=W=>l.value=W),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),[[Z,l.value]])]),n("div",Bu,[n("label",Fu,[J(n("input",{"onUpdate:modelValue":I[8]||(I[8]=W=>a.value=W),type:"checkbox",class:"rounded"},null,512),[[io,a.value]]),I[22]||(I[22]=n("span",null,"Replaces orchestrator",-1))])])]),J(n("textarea",{"onUpdate:modelValue":I[9]||(I[9]=W=>r.value=W),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),[[Z,r.value]])])):F("",!0)]))}}),Ku={class:"animate-fade-in space-y-6"},Wu={class:"glass rounded-xl p-6"},zu={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Ju={class:"flex items-center gap-3"},qu={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Yu={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Gu=["value"],Zu={class:"flex justify-end"},Qu=["disabled"],Xu={key:0,class:"text-center py-12 text-textSecondary"},ec={key:1,class:"text-center py-8 text-danger text-sm"},tc={key:2,class:"text-center py-12 text-textSecondary"},sc={key:3},nc={class:"space-y-3"},oc={class:"p-4"},rc={class:"flex flex-wrap items-center gap-3"},lc=["onBlur"],ac=["onDblclick"],ic={class:"text-xs text-muted font-mono"},uc=["value","onChange"],cc=["value"],dc=["value"],fc={class:"text-xs text-muted"},pc=["onKeyup","onBlur"],mc=["title","onDblclick"],xc={class:"ml-auto flex items-center gap-3"},vc=["onClick","disabled"],gc={class:"flex items-center gap-1.5"},hc=["onClick"],bc={class:"flex items-center gap-1.5"},yc=["onClick"],_c={class:"flex items-center gap-1.5"},wc=["onClick"],kc=["onClick"],$c=["onClick"],Sc=["onClick"],Cc={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},Tc={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},Pc=["value"],Ec={class:"flex items-center gap-2"},Ac=["onClick","disabled"],Ic={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Oc={key:0,class:"text-xs text-muted py-1"},Mc={class:"text-sm font-medium"},Dc={class:"text-xs text-muted font-mono"},Rc=["value","onChange"],jc=["value"],Lc=["value"],Uc={class:"text-xs text-muted"},Nc=["onBlur","onKeyup"],Vc=["title","onDblclick"],Bc={class:"ml-auto flex items-center gap-3"},Fc=["onClick","disabled"],Hc=["onClick","disabled"],Kc=["onClick","disabled"],Wc={key:2,class:"flex items-center gap-1.5"},zc=["onClick"],Jc={key:3,class:"flex items-center gap-1.5"},qc=["onClick"],Yc={key:4,class:"flex items-center gap-1.5"},Gc=["onClick"],Zc=["onClick"],Qc={key:4},Xc={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},ud={class:"space-y-2"},cd={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"},bd=["onClick","disabled"],yd=["onClick","disabled"],_d={class:"flex items-center gap-1.5"},wd=["onClick"],kd={class:"flex items-center gap-1.5"},$d=["onClick"],Sd={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=Ne({__name:"ThreadsTab",setup(e){const t=k([]),s=k(!0),o=k(""),r=k({}),l=k(new Set),a=k(!1),u=k({name:"",threadId:0,client:"claude",workingDirectory:""}),d=k(""),x=k(!1),f=k(null),p=k(""),w=k(null),T=k(""),P=k(null),C=k({name:"",threadId:0,client:"claude",workingDirectory:""}),N=k(""),S=k(!1),A=k(null),j=k(null),O=k(null),G=["claude","copilot","codex","fable"];function oe(H){return G.includes(H)}const ne={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},ue=Pe(()=>t.value.filter(H=>H.type==="root")),ve=Pe(()=>t.value.filter(H=>H.type==="daily")),X=Pe(()=>t.value.filter(H=>H.type==="branch")),_=Pe(()=>t.value.filter(H=>H.type==="worker"));async function h(){s.value=!0,o.value="";try{const H=await pe("/api/threads");t.value=H.threads??[]}catch(H){o.value=H.message||"Failed to load threads"}finally{s.value=!1}}async function b(H){try{const i=await pe(`/api/threads/${H}/children`);r.value[H]=i.threads??[]}catch{r.value[H]=[]}}function E(H){l.value.has(H)?l.value.delete(H):(l.value.add(H),b(H))}async function I(){if(!(!u.value.name.trim()||!u.value.threadId)){x.value=!0,d.value="";try{const H=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:u.value.threadId,name:u.value.name.trim(),type:"root",client:u.value.client,keepAlive:!0,...u.value.workingDirectory.trim()?{workingDirectory:u.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 ✓",u.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{d.value=""},3e3),await h()}catch(H){d.value="Error: "+H.message}finally{x.value=!1}}}async function W(H){if(!(!C.value.name.trim()||!C.value.threadId)){S.value=!0,N.value="";try{const i=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"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 c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}N.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},P.value=null,setTimeout(()=>{N.value=""},3e3),await h(),b(H)}catch(i){N.value="Error: "+i.message}finally{S.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 c=await fetch(`/api/threads/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({name:i})});if(!c.ok)throw new Error(c.statusText);await h()}catch(c){o.value="Failed to rename thread: "+c.message}}function B(H){w.value=H.threadId,T.value=H.workingDirectory??""}async function U(H){const i=T.value.trim();w.value=null;try{const c=await fetch(`/api/threads/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:i||null})});if(!c.ok)throw new Error(c.statusText);await h()}catch(c){o.value="Failed to update working directory: "+c.message}}async function $e(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!H.keepAlive})});if(!i.ok)throw new Error(i.statusText);await h()}catch(i){o.value="Failed to toggle keep-alive: "+i.message}}async function ke(H,i){try{const c=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({client:i})});if(!c.ok)throw new Error(c.statusText);await h()}catch(c){o.value="Failed to change agent type: "+c.message}}async function ge(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!H.dailyRotation})});if(!i.ok)throw new Error(i.statusText);await h()}catch(i){o.value="Failed to toggle daily rotation: "+i.message}}async function it(H){try{const i=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!H.autonomousMode})});if(!i.ok)throw new Error(i.statusText);await h()}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 ${de()}`}});if(!i.ok)throw new Error(i.statusText);await h()}catch(i){o.value="Failed to archive: "+i.message}}async function qe(H){if(confirm(`Start thread "${H.name}" (${H.threadId})?`)){A.value=H.threadId;try{const i=await fetch(`/api/threads/${H.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}await h()}catch(i){o.value="Failed to start thread: "+i.message}finally{A.value=null}}}function yt(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.`)){O.value=H.threadId;try{const i=await fetch(`/api/threads/${H.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}o.value="",d.value=`Converted "${H.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await h()}catch(i){o.value="Failed to convert: "+i.message}finally{O.value=null}}}function _t(H){if(!H)return"—";const i=new Date(H),$=Date.now()-i.getTime();return $<6e4?"just now":$<36e5?`${Math.floor($/6e4)}m ago`:$<864e5?`${Math.floor($/36e5)}h ago`:i.toLocaleDateString()}function Ke(H){return H==="active"?"text-success":H==="archived"?"text-muted":"text-warn"}return je(h),(H,i)=>(v(),g("div",Ku,[n("div",Wu,[n("div",zu,[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",Ju,[d.value?(v(),g("span",{key:0,class:q([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(d.value),3)):F("",!0),n("button",{onClick:i[0]||(i[0]=c=>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:h,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",qu,[n("div",Yu,[n("div",null,[i[19]||(i[19]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),J(n("input",{"onUpdate:modelValue":i[1]||(i[1]=c=>u.value.name=c),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),[[Z,u.value.name]])]),n("div",null,[i[20]||(i[20]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),J(n("input",{"onUpdate:modelValue":i[2]||(i[2]=c=>u.value.threadId=c),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),[[Z,u.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)),J(n("select",{"onUpdate:modelValue":i[3]||(i[3]=c=>u.value.client=c),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(te,null,ce(G,c=>n("option",{key:c,value:c},y(c),9,Gu)),64))],512),[[ze,u.value.client]])])]),n("div",null,[i[22]||(i[22]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),J(n("input",{"onUpdate:modelValue":i[4]||(i[4]=c=>u.value.workingDirectory=c),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),[[Z,u.value.workingDirectory]])]),n("div",Zu,[n("button",{onClick:I,disabled:x.value||!u.value.name.trim()||!u.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,Qu)])])):F("",!0)]),s.value&&t.value.length===0?(v(),g("div",Xu,"Loading threads…")):o.value?(v(),g("div",ec,y(o.value),1)):t.value.length===0?(v(),g("div",tc,"No threads registered")):F("",!0),ue.value.length>0?(v(),g("div",sc,[i[29]||(i[29]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),n("div",nc,[(v(!0),g(te,null,ce(ue.value,c=>{var $,M;return v(),g("div",{key:c.id,class:"glass rounded-xl overflow-hidden"},[n("div",oc,[n("div",rc,[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",($=ne[c.type])==null?void 0:$.classes])},y((M=ne[c.type])==null?void 0:M.emoji)+" "+y(c.type.toUpperCase()),3),f.value===c.threadId?J((v(),g("input",{key:0,"onUpdate:modelValue":i[5]||(i[5]=m=>p.value=m),onBlur:m=>ee(c.threadId),onKeyup:[i[6]||(i[6]=et(m=>m.target.blur(),["enter"])),i[7]||(i[7]=et(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,lc)),[[Z,p.value]]):(v(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:m=>ie(c),title:"Double-click to rename"},y(c.name),41,ac)),n("span",{class:q(["text-xs font-medium",Ke(c.status)])},y(c.status),3),n("span",ic,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:m=>ke(c,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"},[oe(c.client)?F("",!0):(v(),g("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,cc)),(v(),g(te,null,ce(G,m=>n("option",{key:m,value:m},y(m),9,dc)),64))],40,uc),n("span",fc,y(_t(c.lastActiveAt)),1),w.value===c.threadId?J((v(),g("input",{key:2,"onUpdate:modelValue":i[8]||(i[8]=m=>T.value=m),onKeyup:[et(m=>U(c.threadId),["enter"]),i[9]||(i[9]=et(m=>w.value=null,["escape"]))],onBlur:m=>U(c.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,pc)),[[Z,T.value]]):(v(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(c.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>B(c)},"📁 "+y(c.workingDirectory??"—"),41,mc)),n("div",xc,[n("button",{onClick:m=>qe(c),disabled:A.value===c.threadId||c.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(A.value===c.threadId?"Starting…":"▶ Start"),9,vc),n("div",gc,[n("button",{onClick:m=>$e(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,hc),i[23]||(i[23]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",bc,[n("button",{onClick:m=>ge(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,yc),i[24]||(i[24]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",_c,[n("button",{onClick:m=>it(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,wc),i[25]||(i[25]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>E(c.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},y(l.value.has(c.threadId)?"▾ Children":"▸ Children"),9,kc),n("button",{onClick:m=>{P.value=P.value===c.threadId?null:c.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,$c),n("button",{onClick:m=>Ot(c),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,Sc)])]),P.value===c.threadId?(v(),g("div",Cc,[n("div",Tc,[J(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),[[Z,C.value.name]]),J(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),[[Z,C.value.threadId,void 0,{number:!0}]]),J(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(te,null,ce(G,m=>n("option",{key:m,value:m},y(m),9,Pc)),64))],512),[[ze,C.value.client]])]),J(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),[[Z,C.value.workingDirectory]]),n("div",Ec,[n("button",{onClick:m=>W(c.threadId),disabled:S.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(S.value?"Creating…":"Create Branch"),9,Ac),N.value?(v(),g("span",{key:0,class:q([N.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},y(N.value),3)):F("",!0)])])):F("",!0)]),l.value.has(c.threadId)&&r.value[c.threadId]?(v(),g("div",Ic,[r.value[c.threadId].length===0?(v(),g("div",Oc,"No children")):F("",!0),(v(!0),g(te,null,ce(r.value[c.threadId],m=>{var D,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:q(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(D=ne[m.type])==null?void 0:D.classes])},y((K=ne[m.type])==null?void 0:K.emoji)+" "+y(m.type.toUpperCase()),3),n("span",Mc,y(m.name),1),n("span",{class:q(["text-xs",Ke(m.status)])},y(m.status),3),n("span",Dc,"ID: "+y(m.threadId),1),n("select",{value:m.client,onChange:L=>ke(m,L.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"},[oe(m.client)?F("",!0):(v(),g("option",{key:0,value:m.client,disabled:""},y(m.client)+" (legacy)",9,jc)),(v(),g(te,null,ce(G,L=>n("option",{key:L,value:L},y(L),9,Lc)),64))],40,Rc),n("span",Uc,y(_t(m.lastActiveAt)),1),m.type==="branch"&&w.value===m.threadId?J((v(),g("input",{key:0,"onUpdate:modelValue":i[14]||(i[14]=L=>T.value=L),onBlur:L=>U(m.threadId),onKeyup:[et(L=>U(m.threadId),["enter"]),i[15]||(i[15]=et(L=>w.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,Nc)),[[Z,T.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:L=>B(m)},"📁 "+y(m.workingDirectory??"—"),41,Vc)):F("",!0),n("div",Bc,[n("button",{onClick:L=>qe(m),disabled:A.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(A.value===m.threadId?"Starting…":"▶ Start"),9,Fc),m.rootThreadId?(v(),g("button",{key:0,onClick:L=>yt(),disabled:j.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(j.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,Hc)):F("",!0),m.type==="branch"||m.type==="daily"?(v(),g("button",{key:1,onClick:L=>Kt(m),disabled:O.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(O.value===m.threadId?"Converting…":"↑ To Root"),9,Kc)):F("",!0),m.type==="branch"?(v(),g("div",Wc,[n("button",{onClick:L=>$e(m),class:q(["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:q(["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,zc),i[26]||(i[26]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):F("",!0),m.type==="branch"?(v(),g("div",Jc,[n("button",{onClick:L=>ge(m),class:q(["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:q(["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,qc),i[27]||(i[27]=n("span",{class:"text-xs text-muted"},"Daily",-1))])):F("",!0),m.type==="branch"?(v(),g("div",Yc,[n("button",{onClick:L=>it(m),class:q(["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:q(["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,Gc),i[28]||(i[28]=n("span",{class:"text-xs text-muted"},"Auto",-1))])):F("",!0),m.type!=="root"?(v(),g("button",{key:5,onClick:L=>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,Zc)):F("",!0)])])}),128))])):F("",!0)])}),128))])])):F("",!0),ve.value.length>0?(v(),g("div",Qc,[i[30]||(i[30]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),n("div",Xc,[(v(!0),g(te,null,ce(ve.value,c=>{var $,M;return v(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",($=ne[c.type])==null?void 0:$.classes])},y((M=ne[c.type])==null?void 0:M.emoji)+" "+y(c.type.toUpperCase()),3),n("span",ed,y(c.name),1),n("span",{class:q(["text-xs font-medium",Ke(c.status)])},y(c.status),3),n("span",td,"ID: "+y(c.threadId),1),n("span",sd,y(c.client),1),n("span",nd,y(_t(c.lastActiveAt)),1),n("div",od,[n("button",{onClick:m=>qe(c),disabled:A.value===c.threadId||c.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(A.value===c.threadId?"Starting…":"▶ Start"),9,rd),c.rootThreadId?(v(),g("button",{key:0,onClick:m=>yt(),disabled:j.value===c.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(j.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,ld)):F("",!0),n("button",{onClick:m=>Ot(c),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))])])):F("",!0),X.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",ud,[(v(!0),g(te,null,ce(X.value,c=>{var $,M;return v(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",($=ne[c.type])==null?void 0:$.classes])},y((M=ne[c.type])==null?void 0:M.emoji)+" "+y(c.type.toUpperCase()),3),n("span",cd,y(c.name),1),n("span",{class:q(["text-xs font-medium",Ke(c.status)])},y(c.status),3),n("span",dd,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:m=>ke(c,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"},[oe(c.client)?F("",!0):(v(),g("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,pd)),(v(),g(te,null,ce(G,m=>n("option",{key:m,value:m},y(m),9,md)),64))],40,fd),n("span",xd,y(_t(c.lastActiveAt)),1),w.value===c.threadId?J((v(),g("input",{key:0,"onUpdate:modelValue":i[16]||(i[16]=m=>T.value=m),onBlur:m=>U(c.threadId),onKeyup:[et(m=>U(c.threadId),["enter"]),i[17]||(i[17]=et(m=>w.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)),[[Z,T.value]]):(v(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(c.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>B(c)},"📁 "+y(c.workingDirectory??"—"),41,gd)),n("div",hd,[n("button",{onClick:m=>qe(c),disabled:A.value===c.threadId||c.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(A.value===c.threadId?"Starting…":"▶ Start"),9,bd),c.rootThreadId?(v(),g("button",{key:0,onClick:m=>yt(),disabled:j.value===c.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(j.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,yd)):F("",!0),n("div",_d,[n("button",{onClick:m=>$e(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.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(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,$d),i[32]||(i[32]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",Sd,[n("button",{onClick:m=>it(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.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(c),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))])])):F("",!0),_.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(te,null,ce(_.value,c=>{var $,M;return v(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",($=ne[c.type])==null?void 0:$.classes])},y((M=ne[c.type])==null?void 0:M.emoji)+" "+y(c.type.toUpperCase()),3),n("span",Ad,y(c.name),1),n("span",{class:q(["text-xs font-medium",Ke(c.status)])},y(c.status),3),n("span",Id,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:m=>ke(c,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"},[oe(c.client)?F("",!0):(v(),g("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,Md)),(v(),g(te,null,ce(G,m=>n("option",{key:m,value:m},y(m),9,Dd)),64))],40,Od),n("span",Rd,y(_t(c.lastActiveAt)),1),i[35]||(i[35]=n("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):F("",!0)]))}}),Ld={class:"animate-fade-in"},Ud={class:"glass rounded-xl p-6 mb-6"},Nd={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"},Yd={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Gd={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"},uf={class:"mb-4"},cf={class:"flex items-center gap-3 flex-wrap"},df=["disabled"],ff={key:0,class:"text-sm text-danger"},pf=Ne({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],s=k([]),o=k(!0),r=k(""),l=k(""),a=k(!0),u=k(!1),d=k(null),x=k(null),f=k(!1),p=k(null),w=k(""),T=k("claude"),P=k(""),C=k(""),N=k(""),S=k("");async function A(){o.value=!0,r.value="";try{const _=await pe("/api/agent-templates");s.value=_.templates||[]}catch(_){r.value="Failed to load templates: "+_.message}finally{o.value=!1}}function j(){p.value=null,w.value="",T.value="claude",P.value="",C.value="",N.value="",S.value="",f.value=!0}function O(_){p.value=_.id,w.value=_.name,T.value=_.client,P.value=_.workingDirectory,C.value=_.systemPrompt||"",N.value=_.mcpServers&&Object.keys(_.mcpServers).length?JSON.stringify(_.mcpServers,null,2):"",S.value="",f.value=!0}function G(){f.value=!1,p.value=null}function oe(){S.value="";const _=w.value.trim(),h=P.value.trim();if(!_)return S.value="Name is required",null;if(!h)return S.value="Working directory is required",null;let b={};const E=N.value.trim();if(E){try{b=JSON.parse(E)}catch{return S.value="MCP servers must be valid JSON",null}if(typeof b!="object"||b===null||Array.isArray(b))return S.value="MCP servers must be a JSON object",null}return{name:_,client:T.value,workingDirectory:h,systemPrompt:C.value.trim()||null,mcpServers:b}}async function ne(){if(u.value)return;const _=oe();if(_){u.value=!0;try{const h=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",b=p.value?"PATCH":"POST",E=await fetch(h,{method:b,headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify(_)});if(!E.ok){const I=await E.json().catch(()=>({}));throw new Error(I.error||E.statusText)}X("Saved ✓",!0),G(),await A()}catch(h){S.value="Error: "+h.message}finally{u.value=!1}}}async function ue(_){if(!d.value){d.value=_.id;try{const h=await fetch(`/api/agent-templates/${_.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok){const E=await h.json().catch(()=>({}));throw new Error(E.error||h.statusText)}const b=await h.json();X(`Started thread ${b.threadId} ✓`,!0)}catch(h){X("Error: "+h.message,!1)}finally{d.value=null}}}async function ve(_){if(confirm(`Delete template "${_.name}"?`)&&!x.value){x.value=_.id;try{const h=await fetch(`/api/agent-templates/${_.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok)throw new Error(h.statusText);X("Deleted ✓",!0),await A()}catch(h){X("Error: "+h.message,!1)}finally{x.value=null}}}function X(_,h){l.value=_,a.value=h,setTimeout(()=>{l.value=""},3e3)}return je(A),(_,h)=>(v(),g("div",Ld,[n("div",Ud,[n("div",Nd,[h[5]||(h[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:q(["text-sm",a.value?"text-success":"text-danger"])},y(l.value),3)):F("",!0),n("button",{onClick:j,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(te,null,ce(s.value,b=>(v(),g("div",{key:b.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(b.name),1),n("span",Yd,y(b.client),1),b.mcpServers&&Object.keys(b.mcpServers).length?(v(),g("span",Gd,y(Object.keys(b.mcpServers).length)+" mcp",1)):F("",!0)]),n("div",Zd,y(b.workingDirectory),1)]),n("div",Qd,[n("button",{onClick:E=>ue(b),disabled:d.value===b.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===b.id?"Starting…":"Start"),9,Xd),n("button",{onClick:E=>O(b),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:E=>ve(b),disabled:x.value===b.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===b.id?"…":"Delete"),9,tf)])])]))),128))]))]),f.value?(v(),g("div",sf,[n("h3",nf,y(p.value?`Edit: ${w.value}`:"New Agent Template"),1),n("div",of,[n("div",null,[h[6]||(h[6]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Name "),n("span",{class:"text-danger"},"*")],-1)),J(n("input",{"onUpdate:modelValue":h[0]||(h[0]=b=>w.value=b),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),[[Z,w.value]])]),n("div",null,[h[7]||(h[7]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Client "),n("span",{class:"text-danger"},"*")],-1)),J(n("select",{"onUpdate:modelValue":h[1]||(h[1]=b=>T.value=b),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(te,null,ce(t,b=>n("option",{key:b,value:b},y(b),9,rf)),64))],512),[[ze,T.value]])])]),n("div",lf,[h[8]||(h[8]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Working Directory "),n("span",{class:"text-danger"},"*")],-1)),J(n("input",{"onUpdate:modelValue":h[2]||(h[2]=b=>P.value=b),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),[[Z,P.value]])]),n("div",af,[h[9]||(h[9]=n("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),J(n("textarea",{"onUpdate:modelValue":h[3]||(h[3]=b=>C.value=b),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),[[Z,C.value]])]),n("div",uf,[h[10]||(h[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),J(n("textarea",{"onUpdate:modelValue":h[4]||(h[4]=b=>N.value=b),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),[[Z,N.value]]),h[11]||(h[11]=n("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),n("div",cf,[n("button",{onClick:ne,disabled:u.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(u.value?"Saving…":p.value?"Save Changes":"Create Template"),9,df),n("button",{onClick:G,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",ff,y(S.value),1)):F("",!0)])])):F("",!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"},bf={key:1,class:"text-center py-8 text-danger text-sm"},yf={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"},$f={class:"flex items-center gap-2 min-w-0"},Sf={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"},Uf={class:"mb-4"},Nf={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"],Yf=["onClick"],Gf={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"},Yt="sensorium-mcp",ep=Ne({__name:"McpServersTab",setup(e){const t=k({}),s=k(!0),o=k(""),r=k(""),l=k(!0),a=k(!1),u=k(null),d=k(!1),x=k(null),f=k(""),p=k("stdio"),w=k(""),T=k(""),P=k(""),C=k([]),N=k([]),S=k(""),A=Pe(()=>Object.entries(t.value).filter(([_])=>_!==Yt));async function j(){s.value=!0,o.value="";try{const _=await pe("/api/mcp-servers");t.value=_.servers||{}}catch(_){o.value="Failed to load MCP servers: "+_.message}finally{s.value=!1}}function O(_){return _==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function G(){x.value=null,f.value="",p.value="stdio",w.value="",T.value="",P.value="",C.value=[],N.value=[],S.value="",d.value=!0}function oe(_,h){x.value=_,f.value=_,p.value=h.type,w.value=h.command||"",T.value=(h.args||[]).join(" "),P.value=h.url||"",C.value=Object.entries(h.env||{}).map(([b,E])=>({k:b,v:E})),N.value=Object.entries(h.headers||{}).map(([b,E])=>({k:b,v:E})),S.value="",d.value=!0}function ne(){d.value=!1,x.value=null}function ue(){if(S.value="",!f.value.trim())return S.value="Name is required",!1;if(p.value==="stdio"&&!w.value.trim())return S.value="Command is required for stdio type",!1;if(p.value==="http"){const _=P.value.trim();if(!_)return S.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(_))return S.value="URL must start with http:// or https://",!1}return!0}async function ve(){if(!ue()||a.value)return;a.value=!0;const _=f.value.trim(),h={type:p.value};if(p.value==="stdio"){h.command=w.value.trim();const b=T.value.trim();b&&(h.args=b.split(/\s+/));const E=Object.fromEntries(C.value.filter(I=>I.k.trim()).map(I=>[I.k.trim(),I.v]));Object.keys(E).length&&(h.env=E)}else{h.url=P.value.trim();const b=Object.fromEntries(N.value.filter(E=>E.k.trim()).map(E=>[E.k.trim(),E.v]));Object.keys(b).length&&(h.headers=b)}try{const b=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({name:_,config:h})});if(!b.ok)throw new Error(b.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),ne(),await j()}catch(b){S.value="Error: "+b.message}finally{a.value=!1}}async function X(_){if(confirm(`Delete MCP server "${_}"?`)&&!u.value){u.value=_;try{const h=await fetch(`/api/mcp-servers/${encodeURIComponent(_)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok)throw new Error(h.statusText);r.value="Deleted ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await j()}catch(h){r.value="Error: "+h.message,l.value=!1}finally{u.value=null}}}return je(j),(_,h)=>(v(),g("div",mf,[n("div",xf,[n("div",vf,[h[7]||(h[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:q(["text-sm",l.value?"text-success":"text-danger"])},y(r.value),3)):F("",!0),n("button",{onClick:G,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",bf,y(o.value),1)):Object.keys(t.value).length===0?(v(),g("div",yf,"No MCP servers configured")):(v(),g("div",_f,[t.value[Yt]?(v(),g("div",wf,[n("div",kf,[n("div",$f,[n("span",{class:"font-medium text-sm font-mono"},y(Yt)),n("span",{class:"type-badge",style:It(O(t.value[Yt].type))},y(t.value[Yt].type),5),h[8]||(h[8]=n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),h[9]||(h[9]=n("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):F("",!0),(v(!0),g(te,null,ce(A.value,([b,E])=>{var I;return v(),g("div",{key:b,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Sf,[n("div",Cf,[n("div",Tf,[n("span",Pf,y(b),1),n("span",{class:"type-badge",style:It(O(E.type))},y(E.type),5)]),n("div",Ef,[E.type==="stdio"?(v(),g(te,{key:0},[Y(y(E.command)+y((I=E.args)!=null&&I.length?" "+E.args.join(" "):""),1)],64)):(v(),g(te,{key:1},[Y(y(E.url),1)],64))])]),n("div",Af,[n("button",{onClick:W=>oe(b,E),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:W=>X(b),disabled:u.value===b,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(u.value===b?"…":"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,[h[10]||(h[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Name "),n("span",{class:"text-danger"},"*")],-1)),J(n("input",{"onUpdate:modelValue":h[0]||(h[0]=b=>f.value=b),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,jf),[[Z,f.value]])]),n("div",null,[h[12]||(h[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Type "),n("span",{class:"text-danger"},"*")],-1)),J(n("select",{"onUpdate:modelValue":h[1]||(h[1]=b=>p.value=b),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[11]||(h[11]=[n("option",{value:"stdio"},"stdio",-1),n("option",{value:"http"},"http",-1)])],512),[[ze,p.value]])])]),p.value==="stdio"?(v(),g(te,{key:0},[n("div",Lf,[n("div",null,[h[13]||(h[13]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Command "),n("span",{class:"text-danger"},"*")],-1)),J(n("input",{"onUpdate:modelValue":h[2]||(h[2]=b=>w.value=b),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),[[Z,w.value]])]),n("div",null,[h[14]||(h[14]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),J(n("input",{"onUpdate:modelValue":h[3]||(h[3]=b=>T.value=b),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),[[Z,T.value]])])]),n("div",Uf,[n("div",Nf,[h[15]||(h[15]=n("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),n("button",{onClick:h[4]||(h[4]=b=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(te,null,ce(C.value,(b,E)=>(v(),g("div",{key:E,class:"flex items-center gap-2 mb-2"},[J(n("input",{"onUpdate:modelValue":I=>b.k=I,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),[[Z,b.k]]),h[16]||(h[16]=n("span",{class:"text-muted text-xs"},"=",-1)),J(n("input",{"onUpdate:modelValue":I=>b.v=I,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),[[Z,b.v]]),n("button",{onClick:I=>C.value.splice(E,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")):F("",!0)])],64)):(v(),g(te,{key:1},[n("div",Kf,[h[17]||(h[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("URL "),n("span",{class:"text-danger"},"*")],-1)),J(n("input",{"onUpdate:modelValue":h[5]||(h[5]=b=>P.value=b),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),[[Z,P.value]])]),n("div",Wf,[n("div",zf,[h[18]||(h[18]=n("label",{class:"text-xs text-textSecondary"},"Headers",-1)),n("button",{onClick:h[6]||(h[6]=b=>N.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(te,null,ce(N.value,(b,E)=>(v(),g("div",{key:E,class:"flex items-center gap-2 mb-2"},[J(n("input",{"onUpdate:modelValue":I=>b.k=I,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),[[Z,b.k]]),h[19]||(h[19]=n("span",{class:"text-muted text-xs"},":",-1)),J(n("input",{"onUpdate:modelValue":I=>b.v=I,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),[[Z,b.v]]),n("button",{onClick:I=>N.value.splice(E,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Yf)]))),128)),N.value.length===0?(v(),g("div",Gf,"No headers")):F("",!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:ne,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",Xf,y(S.value),1)):F("",!0)])])):F("",!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-4"},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:"text-center py-8 text-danger text-sm"},ip={key:2,class:"text-center text-textSecondary py-12"},up={key:3,class:"space-y-3"},cp={class:"flex items-start gap-2"},dp={class:"flex-1 space-y-2"},fp=["onUpdate:modelValue"],pp=["onUpdate:modelValue"],mp=["onClick"],xp=Ne({__name:"PromptsTab",setup(e){const t=k([]),s=k(!0),o=k(""),r=k(""),l=k(!0),a=k(!1);async function u(){s.value=!0,o.value="";try{const p=await pe("/api/prompts");t.value=(p.prompts||[]).map(w=>({label:w.label,text:w.text}))}catch(p){o.value="Failed to load prompts: "+p.message}finally{s.value=!1}}function d(){t.value.push({label:"",text:""})}function x(p){t.value.splice(p,1)}async function f(){if(a.value)return;a.value=!0,r.value="";const p=t.value.map(w=>({label:w.label.trim(),text:w.text.trim()})).filter(w=>w.label&&w.text);try{const w=await fetch("/api/prompts",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({prompts:p})});if(!w.ok)throw new Error(w.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await u()}catch(w){r.value="Error: "+w.message,l.value=!1}finally{a.value=!1}}return je(u),(p,w)=>(v(),g("div",tp,[n("div",sp,[n("div",np,[w[0]||(w[0]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Predefined Prompts"),n("p",{class:"text-sm text-textSecondary mt-1"},[Y(" Each prompt becomes a button in the Telegram "),n("span",{class:"font-mono"},"/prompts"),Y(" keyboard. Pressing a button injects its text into the target thread as if you typed it. ")])],-1)),n("div",op,[r.value?(v(),g("span",{key:0,class:q(["text-sm",l.value?"text-success":"text-danger"])},y(r.value),3)):F("",!0),n("button",{onClick:d,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," + Add Prompt "),n("button",{onClick:f,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…":"Save"),9,rp)])]),s.value?(v(),g("div",lp,"Loading...")):o.value?(v(),g("div",ap,y(o.value),1)):t.value.length===0?(v(),g("div",ip," No prompts yet — click “+ Add Prompt” to create one. ")):(v(),g("div",up,[(v(!0),g(te,null,ce(t.value,(T,P)=>(v(),g("div",{key:P,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",cp,[n("div",dp,[n("div",null,[w[1]||(w[1]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Label (button text, ≤64 chars)",-1)),J(n("input",{"onUpdate:modelValue":C=>T.label=C,type:"text",maxlength:"64",placeholder:"Run tests",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,8,fp),[[Z,T.label]])]),n("div",null,[w[2]||(w[2]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Prompt text (≤4000 chars)",-1)),J(n("textarea",{"onUpdate:modelValue":C=>T.text=C,rows:"3",maxlength:"4000",placeholder:"Run the full test suite and report failures.",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,8,pp),[[Z,T.text]])])]),n("button",{onClick:C=>x(P),class:"text-muted hover:text-danger transition text-sm px-2 pt-6 shrink-0",title:"Remove prompt"},"✕",8,mp)])]))),128))]))])]))}}),vp={class:"animate-fade-in"},gp={class:"glass rounded-xl p-6 mb-6"},hp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},bp={class:"flex items-center gap-3"},yp=["disabled"],_p={key:0,class:"text-center py-8 text-textSecondary text-sm"},wp={key:1,class:"space-y-6"},kp={class:"glass rounded-xl p-4 border border-gray-700/50"},$p={class:"glass rounded-xl p-4 border border-gray-700/50"},Sp={class:"glass rounded-xl p-4 border border-gray-700/50"},Cp={class:"glass rounded-xl p-4 border border-gray-700/50"},Tp={class:"glass rounded-xl p-4 border border-gray-700/50"},Pp={class:"glass rounded-xl p-4 border border-gray-700/50"},Ep={class:"flex items-center justify-between gap-4"},Ap=["aria-checked"],Ip={class:"glass rounded-xl p-4 border border-gray-700/50"},Op={class:"text-xs text-textSecondary mb-3"},Mp={class:"flex items-center gap-2"},Dp=["placeholder"],Rp=["disabled"],jp={class:"glass rounded-xl p-4 border border-gray-700/50"},Lp={key:0,class:"space-y-2 mb-4"},Up=["value"],Np=["value"],Vp={class:"flex items-center justify-between mb-2"},Bp=["onUpdate:modelValue"],Fp=["onUpdate:modelValue"],Hp=["onClick"],Kp={key:1,class:"text-xs text-muted italic"},Wp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},zp={class:"grid grid-cols-2 gap-4"},Jp={class:"text-sm font-medium font-mono text-textSecondary"},qp={class:"text-sm font-medium font-mono text-textSecondary"},Yp={class:"mt-3"},Gp=Ne({__name:"ClaudeTab",setup(e){const t=k(!0),s=k(!1),o=k(""),r=k("claude-opus-4-6"),l=k("claude-opus-4-6"),a=k("claude-sonnet-4-5"),u=k("claude-sonnet-4-5"),d=k(!1),x=k(""),f=k(""),p=k(""),w=k(""),T=k(20),P=k(20),C=k(""),N=k(!1),S=k(!1),A=k(!1),j=k([]),O=k([]),G=k("{}");function oe(){const h={};for(const b of O.value){const E=b.k.trim();E&&(h[E]=b.v)}return h}const ne=Pe(()=>r.value!==l.value||a.value!==u.value||x.value!==f.value||p.value!==w.value||T.value!==P.value||C.value.length>0||S.value!==A.value||JSON.stringify(oe())!==G.value);function ue(h){j.value=h.filter(b=>b.locked),O.value=h.filter(b=>!b.locked).map(b=>({k:b.key,v:b.value})),G.value=JSON.stringify(oe())}async function ve(){t.value=!0;try{const[h,b,E]=await Promise.all([pe("/api/settings/default-thread-model"),pe("/api/settings/default-worker-model"),pe("/api/settings/claude")]);r.value=h.defaultThreadModel,l.value=h.defaultThreadModel,a.value=b.defaultWorkerModel,u.value=b.defaultWorkerModel,x.value=E.cliPath,f.value=E.cliPath,p.value=E.gitBashPath,w.value=E.gitBashPath,T.value=E.maxConcurrentThreads,P.value=E.maxConcurrentThreads,N.value=E.oauthTokenSet,C.value="",S.value=E.autoMemoryEnabled,A.value=E.autoMemoryEnabled,ue(E.env??[])}finally{t.value=!1}}async function X(){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(T.value)||T.value<1){o.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const h={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},b={cliPath:x.value,gitBashPath:p.value,maxConcurrentThreads:T.value,autoMemoryEnabled:S.value,customEnvVars:oe()};C.value.length>0&&(b.oauthToken=C.value);const[E,I,W]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:h,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:h,body:JSON.stringify({model:a.value})}),fetch("/api/settings/claude",{method:"POST",headers:h,body:JSON.stringify(b)})]);for(const U of[E,I,W])if(!U.ok){const $e=await U.json().catch(()=>({error:U.statusText}));throw new Error($e.error??U.statusText)}const ie=await E.json(),ee=await I.json(),B=await W.json();l.value=ie.defaultThreadModel,r.value=ie.defaultThreadModel,u.value=ee.defaultWorkerModel,a.value=ee.defaultWorkerModel,x.value=B.cliPath,f.value=B.cliPath,p.value=B.gitBashPath,w.value=B.gitBashPath,T.value=B.maxConcurrentThreads,P.value=B.maxConcurrentThreads,N.value=B.oauthTokenSet,C.value="",S.value=B.autoMemoryEnabled,A.value=B.autoMemoryEnabled,ue(B.env??[]),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{s.value=!1}}async function _(){d.value=!0,o.value="";try{const h={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},b=await fetch("/api/settings/claude",{method:"POST",headers:h,body:JSON.stringify({clearOauthToken:!0})});if(!b.ok){const I=await b.json().catch(()=>({error:b.statusText}));throw new Error(I.error??b.statusText)}const E=await b.json();N.value=E.oauthTokenSet,C.value="",ue(E.env??[]),o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{d.value=!1}}return je(ve),(h,b)=>(v(),g("div",vp,[n("div",gp,[n("div",hp,[b[8]||(b[8]=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",bp,[o.value?(v(),g("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):F("",!0),n("button",{onClick:X,disabled:s.value||t.value||!ne.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,yp)])]),t.value?(v(),g("div",_p,"Loading…")):(v(),g("div",wp,[n("div",kp,[b[9]||(b[9]=n("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),b[10]||(b[10]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),Y(" env var if set. ")],-1)),J(n("input",{"onUpdate:modelValue":b[0]||(b[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),[[Z,r.value,void 0,{trim:!0}]])]),n("div",$p,[b[11]||(b[11]=n("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),b[12]||(b[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Model used when spawning a worker Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),Y(" env var if set. ")],-1)),J(n("input",{"onUpdate:modelValue":b[1]||(b[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),[[Z,a.value,void 0,{trim:!0}]])]),n("div",Sp,[b[13]||(b[13]=n("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),b[14]||(b[14]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),Y(" env var if set. ")],-1)),J(n("input",{"onUpdate:modelValue":b[2]||(b[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),[[Z,x.value,void 0,{trim:!0}]])]),n("div",Cp,[b[15]||(b[15]=n("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),b[16]||(b[16]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Path to "),n("span",{class:"font-mono text-accentLight"},"bash.exe"),Y(" passed to Claude via "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),Y(". Leave empty to auto-detect. ")],-1)),J(n("input",{"onUpdate:modelValue":b[3]||(b[3]=E=>p.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),[[Z,p.value,void 0,{trim:!0}]])]),n("div",Tp,[b[17]||(b[17]=n("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),b[18]||(b[18]=n("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),J(n("input",{"onUpdate:modelValue":b[4]||(b[4]=E=>T.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),[[Z,T.value,void 0,{number:!0}]])]),n("div",Pp,[n("div",Ep,[b[19]||(b[19]=n("div",null,[n("label",{class:"block text-sm font-medium mb-1"},"Claude Native Auto-Memory"),n("p",{class:"text-xs text-textSecondary"},[Y(" Claude Code's built-in "),n("span",{class:"font-mono text-accentLight"},"MEMORY.md"),Y(" memory. Off by default — it conflicts with Sensorium's own memory system. Applied to each thread's config at spawn. ")])],-1)),n("button",{type:"button",role:"switch","aria-checked":S.value,onClick:b[5]||(b[5]=E=>S.value=!S.value),class:q([S.value?"bg-accent":"bg-gray-700","relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition"])},[n("span",{class:q([S.value?"translate-x-6":"translate-x-1","inline-block h-4 w-4 rounded-full bg-white transition"])},null,2)],10,Ap)])]),n("div",Ip,[b[23]||(b[23]=n("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),n("p",Op,[b[20]||(b[20]=Y(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),b[21]||(b[21]=n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),b[22]||(b[22]=Y(" env var if set. ",-1)),n("span",{class:q(N.value?"text-success":"text-muted")},y(N.value?"A token is currently stored.":"No token stored."),3)]),n("div",Mp,[J(n("input",{"onUpdate:modelValue":b[6]||(b[6]=E=>C.value=E),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,Dp),[[Z,C.value]]),N.value?(v(),g("button",{key:0,onClick:_,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,Rp)):F("",!0)])]),n("div",jp,[b[28]||(b[28]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),b[29]||(b[29]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Variables injected into every Claude child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),Y(". ")],-1)),j.value.length?(v(),g("div",Lp,[(v(!0),g(te,null,ce(j.value,E=>(v(),g("div",{key:E.key,class:"flex items-center gap-2"},[n("input",{value:E.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Up),b[24]||(b[24]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:E.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Np),b[25]||(b[25]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):F("",!0),n("div",Vp,[b[26]||(b[26]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:b[7]||(b[7]=E=>O.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(te,null,ce(O.value,(E,I)=>(v(),g("div",{key:I,class:"flex items-center gap-2 mb-2"},[J(n("input",{"onUpdate:modelValue":W=>E.k=W,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,Bp),[[Z,E.k]]),b[27]||(b[27]=n("span",{class:"text-muted text-xs"},"=",-1)),J(n("input",{"onUpdate:modelValue":W=>E.v=W,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,Fp),[[Z,E.v]]),n("button",{onClick:W=>O.value.splice(I,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Hp)]))),128)),O.value.length===0?(v(),g("div",Kp,"No additional variables")):F("",!0)]),n("div",Wp,[b[32]||(b[32]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",zp,[n("div",null,[b[30]||(b[30]=n("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),n("span",Jp,y(l.value),1)]),n("div",null,[b[31]||(b[31]=n("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),n("span",qp,y(u.value),1)])]),n("div",Yp,[n("span",{class:q(["text-sm font-medium",ne.value?"text-warn":"text-textSecondary"])},y(ne.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Zp={class:"animate-fade-in"},Qp={class:"glass rounded-xl p-6 mb-6"},Xp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},em={class:"flex items-center gap-3"},tm=["disabled"],sm={key:0,class:"text-center py-8 text-textSecondary text-sm"},nm={key:1,class:"space-y-6"},om={class:"glass rounded-xl p-4 border border-gray-700/50"},rm={id:"copilot-models"},lm=["value"],am={key:0,class:"text-xs text-success mt-2"},im={class:"grid grid-cols-2 gap-3 mt-4"},um={class:"glass rounded-xl p-4 border border-gray-700/50"},cm={class:"flex items-center justify-between"},dm={class:"glass rounded-xl p-4 border border-gray-700/50"},fm=["disabled"],pm={class:"glass rounded-xl p-4 border border-gray-700/50"},mm=["disabled"],xm={class:"glass rounded-xl p-4 border border-gray-700/50"},vm={class:"text-xs text-textSecondary mb-3"},gm={key:0,class:"text-success"},hm={key:1,class:"text-warn"},bm=["disabled","placeholder"],ym={class:"glass rounded-xl p-4 border border-gray-700/50"},_m={key:0,class:"mt-4 space-y-4"},wm={class:"text-xs text-textSecondary mb-2"},km=["disabled"],$m={class:"text-xs text-textSecondary mb-2"},Sm=["disabled"],Cm={class:"glass rounded-xl p-4 border border-gray-700/50"},Tm={class:"flex items-center justify-between gap-3"},Pm=["disabled"],Em={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},Am={class:"glass rounded-xl p-4 border border-gray-700/50"},Im={key:0,class:"space-y-2 mb-4"},Om=["value"],Mm=["value"],Dm={class:"flex items-center justify-between mb-2"},Rm=["onUpdate:modelValue"],jm=["onUpdate:modelValue"],Lm=["onClick"],Um={key:1,class:"text-xs text-muted italic"},Nm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Vm={class:"grid grid-cols-2 gap-4"},Bm={class:"text-sm font-medium font-mono text-textSecondary"},Fm=Ne({__name:"CopilotTab",setup(e){const t=k(!0),s=k(!1),o=k(""),r=k(""),l=k("high"),a=k("long_context"),u=k(!1),d=k("openai"),x=k(""),f=k(""),p=k(""),w=k(""),T=k(!1),P=k(!1),C=k(!1),N=k(""),S=k([]),A=k([]),j=k([]);function O(){const X={};for(const _ of j.value){const h=_.k.trim();h&&(X[h]=_.v)}return X}async function G(){t.value=!0;try{const X=await pe("/api/settings/copilot");oe(X),u.value&&T.value&&ve(!0)}finally{t.value=!1}}function oe(X){r.value=X.model,l.value=X.effortLevel,a.value=X.contextTier,u.value=X.byok.enabled,d.value=X.byok.providerType,x.value=X.byok.baseUrl,f.value=X.byok.modelId,p.value=X.byok.wireModel,T.value=X.byok.apiKeySet,w.value="";const _=X.env??[];A.value=_.filter(h=>h.locked),j.value=_.filter(h=>!h.locked).map(h=>({k:h.key,v:h.value}))}const ne=Pe(()=>!(!r.value.trim()||u.value&&(!x.value.trim()||!T.value&&!w.value.trim())));async function ue(){if(s.value=!0,o.value="",!r.value.trim()){o.value="Error: Model cannot be empty",s.value=!1;return}try{const X={enabled:u.value,providerType:d.value,baseUrl:x.value.trim(),modelId:f.value.trim(),wireModel:p.value.trim()};w.value.trim()&&(X.apiKey=w.value.trim());const _={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},h=await fetch("/api/settings/copilot",{method:"POST",headers:_,body:JSON.stringify({model:r.value.trim(),effortLevel:l.value,contextTier:a.value,byok:X,customEnvVars:O()})});if(!h.ok){const E=await h.json().catch(()=>({error:h.statusText}));throw new Error(E.error??h.statusText)}const b=await h.json();oe(b),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(X){o.value="Error: "+X.message}finally{s.value=!1}}async function ve(X=!1){C.value=!0,N.value="",S.value=[];try{const _={baseUrl:x.value.trim(),providerType:d.value};w.value.trim()&&(_.apiKey=w.value.trim());const h=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify(_)}),b=await h.json();if(!h.ok||!b.ok)throw new Error(b.error??h.statusText);S.value=b.models??[],N.value=`OK — ${b.count??S.value.length} models`}catch(_){X||(N.value="Error: "+_.message)}finally{C.value=!1}}return je(G),(X,_)=>(v(),g("div",Zp,[n("div",Qp,[n("div",Xp,[_[12]||(_[12]=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",em,[o.value?(v(),g("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):F("",!0),n("button",{onClick:ue,disabled:s.value||t.value||!ne.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,tm)])]),t.value?(v(),g("div",sm,"Loading…")):(v(),g("div",nm,[n("div",om,[_[17]||(_[17]=n("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),_[18]||(_[18]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Written to the Copilot CLI's "),n("span",{class:"font-mono text-accentLight"},"settings.json"),Y(" (avoids the flaky "),n("span",{class:"font-mono text-accentLight"},"--model"),Y(" flag). ")],-1)),J(n("input",{"onUpdate:modelValue":_[0]||(_[0]=h=>r.value=h),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),[[Z,r.value,void 0,{trim:!0}]]),n("datalist",rm,[(v(!0),g(te,null,ce(S.value,h=>(v(),g("option",{key:h,value:h},null,8,lm))),128))]),S.value.length?(v(),g("p",am,y(S.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):F("",!0),n("div",im,[n("div",null,[_[14]||(_[14]=n("label",{class:"block text-sm font-medium mb-1"},"Effort Level",-1)),J(n("select",{"onUpdate:modelValue":_[1]||(_[1]=h=>l.value=h),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"},[..._[13]||(_[13]=[n("option",{value:"low"},"low",-1),n("option",{value:"medium"},"medium",-1),n("option",{value:"high"},"high",-1)])],512),[[ze,l.value]])]),n("div",null,[_[16]||(_[16]=n("label",{class:"block text-sm font-medium mb-1"},"Context Tier",-1)),J(n("select",{"onUpdate:modelValue":_[2]||(_[2]=h=>a.value=h),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"},[..._[15]||(_[15]=[n("option",{value:"normal"},"normal",-1),n("option",{value:"long_context"},"long_context",-1)])],512),[[ze,a.value]])])])]),n("div",um,[n("div",cm,[_[19]||(_[19]=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:_[3]||(_[3]=h=>u.value=!u.value),class:q(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",u.value?"bg-accent":"bg-gray-700"])},[n("span",{class:q(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",u.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),n("div",{class:q(["space-y-4 transition",u.value?"":"opacity-40 pointer-events-none select-none"])},[n("div",dm,[_[21]||(_[21]=n("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),_[22]||(_[22]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Wire protocol of the endpoint ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),Y("). ")],-1)),J(n("select",{"onUpdate:modelValue":_[4]||(_[4]=h=>d.value=h),disabled:!u.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"},[..._[20]||(_[20]=[n("option",{value:"openai"},"openai",-1),n("option",{value:"azure"},"azure",-1),n("option",{value:"anthropic"},"anthropic",-1)])],8,fm),[[ze,d.value]])]),n("div",pm,[_[23]||(_[23]=n("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),_[24]||(_[24]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" e.g. "),n("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),Y(" ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),Y("). ")],-1)),J(n("input",{"onUpdate:modelValue":_[5]||(_[5]=h=>x.value=h),type:"text",disabled:!u.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,mm),[[Z,x.value,void 0,{trim:!0}]])]),n("div",xm,[_[28]||(_[28]=n("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),n("p",vm,[_[25]||(_[25]=Y(" Stored server-side and never echoed back (",-1)),_[26]||(_[26]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),_[27]||(_[27]=Y("). ",-1)),T.value?(v(),g("span",gm,"A key is currently set — leave blank to keep it.")):(v(),g("span",hm,"No key set."))]),J(n("input",{"onUpdate:modelValue":_[6]||(_[6]=h=>w.value=h),type:"password",disabled:!u.value,placeholder:T.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,bm),[[Z,w.value]])]),n("div",ym,[n("button",{type:"button",onClick:_[7]||(_[7]=h=>P.value=!P.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[n("span",null,y(P.value?"▾":"▸"),1),_[29]||(_[29]=Y(" Advanced (model mapping) ",-1))]),P.value?(v(),g("div",_m,[n("div",null,[_[32]||(_[32]=n("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),n("p",wm,[_[30]||(_[30]=Y(" Well-known base model for tool config (",-1)),_[31]||(_[31]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),Y("). Defaults to Copilot Model. "+y(S.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),J(n("input",{"onUpdate:modelValue":_[8]||(_[8]=h=>f.value=h),type:"text",list:"copilot-models",disabled:!u.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,km),[[Z,f.value,void 0,{trim:!0}]])]),n("div",null,[_[35]||(_[35]=n("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),n("p",$m,[_[33]||(_[33]=Y(" Exact model name sent to the provider (",-1)),_[34]||(_[34]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),Y("). Defaults to Copilot Model. "+y(S.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),J(n("input",{"onUpdate:modelValue":_[9]||(_[9]=h=>p.value=h),type:"text",list:"copilot-models",disabled:!u.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,Sm),[[Z,p.value,void 0,{trim:!0}]])])])):F("",!0)]),n("div",Cm,[n("div",Tm,[_[36]||(_[36]=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:_[10]||(_[10]=h=>ve()),disabled:C.value||!u.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(C.value?"Testing…":"Test"),9,Pm)]),N.value?(v(),g("div",{key:0,class:q([N.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},y(N.value),3)):F("",!0),S.value.length?(v(),g("div",Em,[(v(!0),g(te,null,ce(S.value,h=>(v(),g("div",{key:h,class:"text-xs font-mono text-textSecondary py-0.5"},y(h),1))),128))])):F("",!0)])],2),n("div",Am,[_[41]||(_[41]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),_[42]||(_[42]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Variables injected into every Copilot child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),Y(". ")],-1)),A.value.length?(v(),g("div",Im,[(v(!0),g(te,null,ce(A.value,h=>(v(),g("div",{key:h.key,class:"flex items-center gap-2"},[n("input",{value:h.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Om),_[37]||(_[37]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:h.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Mm),_[38]||(_[38]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):F("",!0),n("div",Dm,[_[39]||(_[39]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:_[11]||(_[11]=h=>j.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(v(!0),g(te,null,ce(j.value,(h,b)=>(v(),g("div",{key:b,class:"flex items-center gap-2 mb-2"},[J(n("input",{"onUpdate:modelValue":E=>h.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,Rm),[[Z,h.k]]),_[40]||(_[40]=n("span",{class:"text-muted text-xs"},"=",-1)),J(n("input",{"onUpdate:modelValue":E=>h.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,jm),[[Z,h.v]]),n("button",{onClick:E=>j.value.splice(b,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Lm)]))),128)),j.value.length===0?(v(),g("div",Um,"No additional variables")):F("",!0)]),n("div",Nm,[_[45]||(_[45]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",Vm,[n("div",null,[_[43]||(_[43]=n("div",{class:"text-xs text-muted mb-1"},"Model",-1)),n("span",Bm,y(r.value||"—"),1)]),n("div",null,[_[44]||(_[44]=n("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),n("span",{class:q(["text-sm font-medium",u.value?"text-success":"text-textSecondary"])},y(u.value?"Enabled":"Disabled"),3)])])])]))])]))}}),Hm={class:"animate-fade-in"},Km={class:"glass rounded-xl p-6 mb-6"},Wm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},zm={class:"flex items-center gap-3"},Jm=["disabled"],qm={key:0,class:"text-center py-8 text-textSecondary text-sm"},Ym={key:1,class:"space-y-6"},Gm={class:"glass rounded-xl p-4 border border-gray-700/50"},Zm={class:"flex items-center gap-4"},Qm={class:"flex justify-between text-xs text-muted mt-2"},Xm={class:"font-mono"},ex={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},tx={class:"glass rounded-xl p-4 border border-gray-700/50"},sx={class:"flex items-center gap-4"},nx={class:"flex justify-between text-xs text-muted mt-2"},ox={class:"font-mono"},rx={class:"glass rounded-xl p-4 border border-gray-700/50"},lx={class:"flex items-center gap-4"},ax={class:"flex justify-between text-xs text-muted mt-2"},ix={class:"font-mono"},ux={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},cx={class:"grid grid-cols-2 gap-4"},dx={class:"text-sm font-medium text-textSecondary"},fx={class:"mt-3"},px=Ne({__name:"SettingsTab",setup(e){const t=k(!0),s=k(!1),o=k(""),r=k(50),l=k(50),a=k(300),u=k(300),d=k(1440),x=k(1440),f=Pe(()=>r.value!==l.value||a.value!==u.value||d.value!==x.value);async function p(){t.value=!0;try{const[T,P,C]=await Promise.all([pe("/api/settings/bootstrap-message-count"),pe("/api/settings/reply-max-chars"),pe("/api/settings/wait-timeout")]);r.value=T.count,l.value=T.count,a.value=P.chars,u.value=P.chars,d.value=C.minutes,x.value=C.minutes}finally{t.value=!1}}async function w(){s.value=!0,o.value="";try{const T={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},[P,C,N]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:T,body:JSON.stringify({count:r.value})}),fetch("/api/settings/reply-max-chars",{method:"POST",headers:T,body:JSON.stringify({chars:a.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:T,body:JSON.stringify({minutes:d.value})})]);for(const O of[P,C,N])if(!O.ok){const G=await O.json().catch(()=>({error:O.statusText}));throw new Error(G.error??O.statusText)}const S=await P.json(),A=await C.json(),j=await N.json();l.value=S.count,r.value=S.count,u.value=A.chars,a.value=A.chars,x.value=j.minutes,d.value=j.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(T){o.value="Error: "+T.message}finally{s.value=!1}}return je(p),(T,P)=>(v(),g("div",Hm,[n("div",Km,[n("div",Wm,[P[6]||(P[6]=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",zm,[o.value?(v(),g("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):F("",!0),n("button",{onClick:w,disabled:s.value||t.value||!f.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,Jm)])]),t.value?(v(),g("div",qm,"Loading…")):(v(),g("div",Ym,[n("div",Gm,[P[10]||(P[10]=n("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),P[11]||(P[11]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Number of recent messages injected into the agent's bootstrap context. Set to "),n("span",{class:"font-mono text-accentLight"},"0"),Y(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),n("div",Zm,[J(n("input",{"onUpdate:modelValue":P[0]||(P[0]=C=>r.value=C),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[Z,r.value,void 0,{number:!0}]]),J(n("input",{"onUpdate:modelValue":P[1]||(P[1]=C=>r.value=C),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),[[Z,r.value,void 0,{number:!0}]])]),n("div",Qm,[P[7]||(P[7]=n("span",null,"Off",-1)),n("span",Xm,y(r.value)+" messages",1),P[8]||(P[8]=n("span",null,"Max",-1))]),r.value===0?(v(),g("div",ex,[...P[9]||(P[9]=[Y(" Message buffer injection is ",-1),n("strong",null,"disabled",-1),Y(". 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)])])):F("",!0)]),n("div",tx,[P[14]||(P[14]=n("label",{class:"block text-sm font-medium mb-1"},"Reply Length Limit",-1)),P[15]||(P[15]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Maximum length (in characters) of a single text reply ("),n("span",{class:"font-mono text-accentLight"},"report_progress"),Y("). Longer messages are rejected so the agent shortens them or sends a voice message instead. The agent is also told this limit each turn. ")],-1)),n("div",sx,[J(n("input",{"onUpdate:modelValue":P[2]||(P[2]=C=>a.value=C),type:"range",min:"100",max:"2000",step:"50",class:"flex-1 accent-accent"},null,512),[[Z,a.value,void 0,{number:!0}]]),J(n("input",{"onUpdate:modelValue":P[3]||(P[3]=C=>a.value=C),type:"number",min:"1",max:"4000",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),[[Z,a.value,void 0,{number:!0}]])]),n("div",nx,[P[12]||(P[12]=n("span",null,"Short",-1)),n("span",ox,y(a.value)+" chars",1),P[13]||(P[13]=n("span",null,"Long",-1))])]),n("div",rx,[P[18]||(P[18]=n("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),P[19]||(P[19]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Maximum time (in minutes) a single "),n("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),Y(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),n("div",lx,[J(n("input",{"onUpdate:modelValue":P[4]||(P[4]=C=>d.value=C),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[Z,d.value,void 0,{number:!0}]]),J(n("input",{"onUpdate:modelValue":P[5]||(P[5]=C=>d.value=C),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),[[Z,d.value,void 0,{number:!0}]])]),n("div",ax,[P[16]||(P[16]=n("span",null,"1 min",-1)),n("span",ix,y(d.value>=60?Math.floor(d.value/60)+"h "+d.value%60+"m":d.value+" min"),1),P[17]||(P[17]=n("span",null,"24h",-1))])]),n("div",ux,[P[22]||(P[22]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",cx,[n("div",null,[P[20]||(P[20]=n("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),n("span",{class:q(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},y(l.value>0?`${l.value} messages`:"Disabled"),3)]),n("div",null,[P[21]||(P[21]=n("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),n("span",dx,y(x.value>=60?Math.floor(x.value/60)+"h "+x.value%60+"m":x.value+" min"),1)])]),n("div",fx,[n("span",{class:q(["text-sm font-medium",f.value?"text-warn":"text-textSecondary"])},y(f.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),mx={class:"animate-fade-in"},xx={class:"glass rounded-xl p-6 mb-6"},vx={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},gx={class:"flex flex-wrap gap-3 items-center"},hx=["disabled"],bx={key:0,class:"flex items-center gap-2"},yx={key:1},_x={class:"glass rounded-xl p-6"},wx={key:0,class:"text-center py-8 text-textSecondary text-sm"},kx={key:1,class:"text-center py-12 text-textSecondary text-sm"},$x={key:2,class:"space-y-2"},Sx={class:"flex items-center justify-between gap-3"},Cx={class:"flex-1 min-w-0"},Tx={class:"flex flex-wrap items-center gap-2 mb-1"},Px={class:"font-medium text-sm font-mono"},Ex={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Ax={class:"text-xs text-muted"},Ix={class:"text-xs text-muted"},Ox=["onClick","disabled"],Mx={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Dx={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Rx={class:"text-sm text-textSecondary mb-4"},jx={class:"font-mono text-textPrimary"},Lx=Ne({__name:"SnapshotsTab",setup(e){const t=k([]),s=k(!0),o=k(!1),r=k(null),l=k(""),a=k(""),u=k(!0),d=k(null);function x(S){return S<1024?`${S} B`:S<1024*1024?`${(S/1024).toFixed(1)} KB`:`${(S/(1024*1024)).toFixed(1)} MB`}function f(S){try{return new Date(S).toLocaleString()}catch{return S}}function p(S,A){a.value=S,u.value=A,setTimeout(()=>{a.value=""},4e3)}async function w(){s.value=!0;try{const S=await pe("/api/snapshots");t.value=S.snapshots}catch(S){p("Failed to load snapshots: "+S.message,!1)}finally{s.value=!1}}async function T(){if(!o.value){o.value=!0;try{await pe("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",p("Snapshot created ✓",!0),await w()}catch(S){p("Error: "+S.message,!1)}finally{o.value=!1}}}function P(S){d.value=S}function C(){d.value=null}async function N(){const S=d.value;if(!(!S||r.value)){d.value=null,r.value=S;try{await pe(`/api/snapshots/${encodeURIComponent(S)}`,{method:"DELETE"}),p("Deleted ✓",!0),await w()}catch(A){p("Error: "+A.message,!1)}finally{r.value=null}}}return je(w),(S,A)=>(v(),g("div",mx,[n("div",xx,[n("div",vx,[A[1]||(A[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:q(["text-sm",u.value?"text-success":"text-danger"])},y(a.value),3)):F("",!0)]),n("div",gx,[J(n("input",{"onUpdate:modelValue":A[0]||(A[0]=j=>l.value=j),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:et(T,["enter"])},null,544),[[Z,l.value]]),n("button",{onClick:T,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",bx,[...A[2]||(A[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),Y(" Creating… ",-1)])])):(v(),g("span",yx,"+ Create Snapshot"))],8,hx)])]),n("div",_x,[s.value?(v(),g("div",wx,"Loading…")):t.value.length===0?(v(),g("div",kx,"No snapshots yet")):(v(),g("div",$x,[(v(!0),g(te,null,ce(t.value,j=>(v(),g("div",{key:j.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Sx,[n("div",Cx,[n("div",Tx,[n("span",Px,y(j.name),1),n("span",Ex,"v"+y(j.mcpVersion),1),n("span",Ax,y(x(j.sizeBytes)),1)]),n("div",Ix,[Y(y(f(j.createdAt)),1),j.description?(v(),g(te,{key:0},[Y(" · "+y(j.description),1)],64)):F("",!0)])]),n("button",{onClick:O=>P(j.name),disabled:r.value===j.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===j.name?"…":"Delete"),9,Ox)])]))),128))]))]),d.value?(v(),g("div",Mx,[n("div",Dx,[A[5]||(A[5]=n("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),n("p",Rx,[A[3]||(A[3]=Y(" Delete ",-1)),n("span",jx,y(d.value),1),A[4]||(A[4]=Y("? 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")])])])):F("",!0)]))}}),Ux={class:"animate-fade-in space-y-6"},Nx={class:"glass rounded-xl p-6"},Vx={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Bx={class:"text-sm text-textSecondary mt-1"},Fx={class:"flex items-center gap-3"},Hx={key:0,class:"text-xs text-accentLight animate-pulse"},Kx={key:0,class:"flex flex-wrap gap-2 mt-3"},Wx=["onClick"],zx={class:"ml-1 opacity-60"},Jx={key:0,class:"text-center py-12 text-textSecondary"},qx={key:1,class:"text-center py-8 text-danger text-sm"},Yx={key:2,class:"text-center py-12 text-textSecondary"},Gx={key:3,class:"space-y-3"},Zx={class:"flex flex-wrap items-start gap-3"},Qx={class:"flex-1 min-w-0 space-y-2"},Xx={class:"flex flex-wrap items-center gap-2"},ev={class:"font-semibold truncate"},tv={class:"text-xs text-muted font-mono"},sv={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},nv={title:"Created"},ov={title:"Archived"},rv={key:0,class:"text-muted"},lv={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},av={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},iv={class:"flex items-center gap-2 shrink-0"},uv=["onClick","disabled"],cv=3,dv=Ne({__name:"ArchivedThreadsTab",setup(e){const t=k([]),s=k(!0),o=k(""),r=k({}),l=k({}),a=k({done:0,total:0}),u=k(null),d=k("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(A=>A.type===d.value)),w=Pe(()=>{const A={all:t.value.length};for(const j of t.value)A[j.type]=(A[j.type]??0)+1;return A}),T=Pe(()=>Object.values(l.value).some(Boolean));async function P(){s.value=!0,o.value="";try{const A=await pe("/api/threads/archived");t.value=A.threads??[],r.value={},l.value={},t.value.length>0&&C()}catch(A){o.value=A.message||"Failed to load archived threads"}finally{s.value=!1}}async function C(){const A=++x,j=[...t.value];a.value={done:0,total:j.length};async function O(){for(;j.length>0&&A===x;){const oe=j.shift();l.value={...l.value,[oe.threadId]:!0};try{const ne=await fetch(`/api/threads/${oe.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(A!==x)return;if(ne.ok){const ue=await ne.json();ue.summary&&(r.value={...r.value,[oe.threadId]:ue.summary})}}catch{}finally{if(A===x){const{[oe.threadId]:ne,...ue}=l.value;l.value=ue,a.value={...a.value,done:a.value.done+1}}}}}const G=Array.from({length:Math.min(cv,j.length)},()=>O());await Promise.all(G)}function N(A){if(!A)return"—";const j=new Date(A),G=Date.now()-j.getTime(),oe=Math.floor(G/6e4),ne=Math.floor(G/36e5),ue=Math.floor(G/864e5),ve=Math.floor(ue/30);return oe<1?"just now":oe<60?`${oe}m ago`:ne<24?`${ne}h ago`:ue<30?`${ue}d ago`:ve<12?`${ve}mo ago`:`${Math.floor(ve/12)}y ago`}async function S(A){if(confirm(`Unarchive thread "${A.name}" (${A.threadId})?`)){u.value=A.threadId;try{const j=await fetch(`/api/threads/${A.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!j.ok){const O=await j.json().catch(()=>({error:j.statusText}));throw new Error(O.error??j.statusText)}await P()}catch(j){o.value="Failed to unarchive: "+j.message}finally{u.value=null}}}return je(P),(A,j)=>(v(),g("div",Ux,[n("div",Nx,[n("div",Vx,[n("div",null,[j[0]||(j[0]=n("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),n("p",Bx,y(t.value.length)+" archived thread"+y(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),n("div",Fx,[T.value?(v(),g("span",Hx," Building summaries… "+y(a.value.done)+"/"+y(a.value.total),1)):F("",!0),n("button",{onClick:P,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",Kx,[(v(),g(te,null,ce(["all","root","branch","daily"],O=>n("button",{key:O,onClick:G=>d.value=O,class:q(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===O?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[Y(y(O==="all"?"All":O.charAt(0).toUpperCase()+O.slice(1))+" ",1),n("span",zx,"("+y(w.value[O]??0)+")",1)],10,Wx)),64))])):F("",!0)]),s.value&&t.value.length===0?(v(),g("div",Jx,"Loading archived threads…")):o.value?(v(),g("div",qx,y(o.value),1)):t.value.length===0?(v(),g("div",Yx,"No archived threads")):F("",!0),p.value.length>0?(v(),g("div",Gx,[(v(!0),g(te,null,ce(p.value,O=>{var G,oe;return v(),g("div",{key:O.id,class:"glass rounded-xl p-4"},[n("div",Zx,[n("div",Qx,[n("div",Xx,[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(G=f[O.type])==null?void 0:G.classes])},y((oe=f[O.type])==null?void 0:oe.emoji)+" "+y(O.type.toUpperCase()),3),n("span",ev,y(O.name),1),n("span",tv,"ID: "+y(O.threadId),1)]),n("div",sv,[n("span",nv,"Created "+y(N(O.createdAt)),1),n("span",ov,"Archived "+y(N(O.archivedAt??O.lastActiveAt)),1),O.client?(v(),g("span",rv,y(O.client),1)):F("",!0)]),r.value[O.threadId]?(v(),g("div",lv,y(r.value[O.threadId]),1)):l.value[O.threadId]?(v(),g("div",av," Generating summary… ")):F("",!0)]),n("div",iv,[n("button",{onClick:ne=>S(O),disabled:u.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"},y(u.value===O.threadId?"Restoring…":"↩ Unarchive"),9,uv)])])])}),128))])):F("",!0)]))}}),fv={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},pv={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},mv=["disabled"],xv={key:0,class:"mt-3 text-sm text-danger"},vv={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},gv={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},hv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},bv={class:"flex items-center gap-4"},yv={class:"text-sm text-textSecondary font-mono"},_v={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},wv={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},kv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},$v={class:"text-2xl font-bold font-mono"},Sv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Cv={class:"text-2xl font-bold font-mono"},Tv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Pv={class:"text-2xl font-bold font-mono"},Ev={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Av={class:"flex items-center gap-2 mb-2"},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:"max-w-7xl mx-auto px-4 sm:px-6"},Rv={class:"flex gap-6 border-b border-gray-800/50 mb-6"},jv=["onClick"],Lv={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",Uv=Ne({__name:"App",setup(e){const t=k(!1),s=k(""),o=k(""),r=k(!1),l=k(null),a=k("sessions");let u=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:"prompts",label:"Prompts"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],x={sessions:ri,notes:ki,templates:nu,skills:Hu,agents:pf,threads:jd,archived:dv,mcp:ep,prompts:xp,snapshots:Lx,claude:Gp,copilot:Fm,settings:px},f=Pe(()=>x[a.value]),p=Pe(()=>{if(!l.value)return"—";const N=Math.floor(l.value.uptime),S=Math.floor(N/86400),A=Math.floor(N%86400/3600),j=Math.floor(N%3600/60);return S>0?`${S}d ${A}h`:A>0?`${A}h ${j}m`:`${j}m`});async function w(){const N=s.value.trim()||"no-auth";r.value=!0,o.value="";try{qt(N),await P(),localStorage.setItem(vs,N),t.value=!0,C()}catch(S){const A=S;A.status===401?o.value="Invalid token":o.value=A.message??"Connection failed",qt("")}finally{r.value=!1}}function T(){localStorage.removeItem(vs),t.value=!1,s.value="",l.value=null,u&&clearInterval(u),qt("")}async function P(){l.value=await pe("/api/status")}function C(){u&&clearInterval(u),u=setInterval(P,3e4)}return je(async()=>{const N=localStorage.getItem(vs);if(N){s.value=N;try{qt(N),await P(),t.value=!0,C()}catch{localStorage.removeItem(vs),qt("")}}}),wn(()=>{u&&clearInterval(u)}),(N,S)=>{var A,j,O,G,oe,ne,ue,ve,X;return t.value?(v(),g("div",vv,[n("header",gv,[n("div",hv,[S[3]||(S[3]=dt('<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",bv,[S[2]||(S[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",yv,y(p.value),1),n("button",{onClick:T,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),n("div",_v,[n("div",wv,[n("div",kv,[S[4]||(S[4]=dt('<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",$v,y(((A=l.value)==null?void 0:A.activeSessions)??0),1)]),n("div",Sv,[S[5]||(S[5]=dt('<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",Cv,y(((O=(j=l.value)==null?void 0:j.memory)==null?void 0:O.totalSemanticNotes)??0),1)]),n("div",Tv,[S[6]||(S[6]=dt('<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",Pv,y(((oe=(G=l.value)==null?void 0:G.memory)==null?void 0:oe.totalEpisodes)??0),1)]),n("div",Ev,[n("div",Av,[n("span",{class:q((((ue=(ne=l.value)==null?void 0:ne.memory)==null?void 0:ue.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...S[7]||(S[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),S[8]||(S[8]=n("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),n("div",Iv,y(((X=(ve=l.value)==null?void 0:ve.memory)==null?void 0:X.unconsolidatedEpisodes)??0),1)]),n("div",Ov,[S[9]||(S[9]=dt('<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",Mv,y(p.value),1)])])]),n("div",Dv,[n("nav",Rv,[(v(),g(te,null,ce(d,_=>n("button",{key:_.id,onClick:h=>a.value=_.id,class:q(["pb-3 text-sm font-medium transition",a.value===_.id?"tab-active":"tab-inactive"])},y(_.label),11,jv)),64))])]),n("div",Lv,[(v(),fr(El(f.value),{status:l.value},null,8,["status"]))])])):(v(),g("div",fv,[n("div",pv,[S[1]||(S[1]=dt('<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)),J(n("input",{"onUpdate:modelValue":S[0]||(S[0]=_=>s.value=_),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:et(w,["enter"])},null,544),[[Z,s.value]]),n("button",{onClick:w,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,mv),o.value?(v(),g("p",xv,y(o.value),1)):F("",!0)])]))}}});Fa(Uv).mount("#app");</script>
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">
76
76
  <div id="app"></div>