sensorium-mcp 3.1.3 → 3.1.5

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 (203) hide show
  1. package/Install-Sensorium.ps1 +251 -39
  2. package/dist/config/agent-settings.d.ts +11 -0
  3. package/dist/config/agent-settings.d.ts.map +1 -1
  4. package/dist/config/agent-settings.js +79 -0
  5. package/dist/config/agent-settings.js.map +1 -1
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.d.ts.map +1 -1
  8. package/dist/config/index.js +12 -0
  9. package/dist/config/index.js.map +1 -1
  10. package/dist/config/misc-settings.d.ts +7 -0
  11. package/dist/config/misc-settings.d.ts.map +1 -1
  12. package/dist/config/misc-settings.js +38 -1
  13. package/dist/config/misc-settings.js.map +1 -1
  14. package/dist/dashboard/routes/codex.d.ts +14 -0
  15. package/dist/dashboard/routes/codex.d.ts.map +1 -0
  16. package/dist/dashboard/routes/codex.js +92 -0
  17. package/dist/dashboard/routes/codex.js.map +1 -0
  18. package/dist/dashboard/routes/prompts.d.ts +2 -2
  19. package/dist/dashboard/routes/prompts.d.ts.map +1 -1
  20. package/dist/dashboard/routes/prompts.js +2 -2
  21. package/dist/dashboard/routes/prompts.js.map +1 -1
  22. package/dist/dashboard/routes/threads-read.d.ts +10 -7
  23. package/dist/dashboard/routes/threads-read.d.ts.map +1 -1
  24. package/dist/dashboard/routes/threads-read.js +21 -16
  25. package/dist/dashboard/routes/threads-read.js.map +1 -1
  26. package/dist/dashboard/routes.d.ts.map +1 -1
  27. package/dist/dashboard/routes.js +3 -0
  28. package/dist/dashboard/routes.js.map +1 -1
  29. package/dist/dashboard/spa.html +11 -11
  30. package/dist/data/memory/bootstrap.d.ts +1 -8
  31. package/dist/data/memory/bootstrap.d.ts.map +1 -1
  32. package/dist/data/memory/bootstrap.js +27 -37
  33. package/dist/data/memory/bootstrap.js.map +1 -1
  34. package/dist/data/memory/consolidation.d.ts +20 -1
  35. package/dist/data/memory/consolidation.d.ts.map +1 -1
  36. package/dist/data/memory/consolidation.js +53 -3
  37. package/dist/data/memory/consolidation.js.map +1 -1
  38. package/dist/data/memory/index.d.ts +0 -4
  39. package/dist/data/memory/index.d.ts.map +1 -1
  40. package/dist/data/memory/index.js +0 -4
  41. package/dist/data/memory/index.js.map +1 -1
  42. package/dist/data/memory/key-knowledge.d.ts +51 -0
  43. package/dist/data/memory/key-knowledge.d.ts.map +1 -0
  44. package/dist/data/memory/key-knowledge.js +128 -0
  45. package/dist/data/memory/key-knowledge.js.map +1 -0
  46. package/dist/data/memory/migration-runner.d.ts +1 -1
  47. package/dist/data/memory/migration-runner.d.ts.map +1 -1
  48. package/dist/data/memory/migration-runner.js +23 -1
  49. package/dist/data/memory/migration-runner.js.map +1 -1
  50. package/dist/data/memory/narrative-lint.d.ts +2 -2
  51. package/dist/data/memory/narrative-lint.d.ts.map +1 -1
  52. package/dist/data/memory/narrative-lint.js +23 -13
  53. package/dist/data/memory/narrative-lint.js.map +1 -1
  54. package/dist/data/memory/narrative-resolutions.d.ts +7 -2
  55. package/dist/data/memory/narrative-resolutions.d.ts.map +1 -1
  56. package/dist/data/memory/narrative-resolutions.js +7 -8
  57. package/dist/data/memory/narrative-resolutions.js.map +1 -1
  58. package/dist/data/memory/narrative-sources.d.ts +1 -1
  59. package/dist/data/memory/narrative-sources.d.ts.map +1 -1
  60. package/dist/data/memory/narrative-sources.js +8 -3
  61. package/dist/data/memory/narrative-sources.js.map +1 -1
  62. package/dist/data/memory/narrative-store.d.ts +14 -0
  63. package/dist/data/memory/narrative-store.d.ts.map +1 -1
  64. package/dist/data/memory/narrative-store.js +36 -0
  65. package/dist/data/memory/narrative-store.js.map +1 -1
  66. package/dist/data/memory/narrative.d.ts.map +1 -1
  67. package/dist/data/memory/narrative.js +47 -29
  68. package/dist/data/memory/narrative.js.map +1 -1
  69. package/dist/data/memory/note-archival.d.ts +1 -1
  70. package/dist/data/memory/note-archival.d.ts.map +1 -1
  71. package/dist/data/memory/note-archival.js +7 -3
  72. package/dist/data/memory/note-archival.js.map +1 -1
  73. package/dist/data/memory/note-embeddings.d.ts +7 -0
  74. package/dist/data/memory/note-embeddings.d.ts.map +1 -1
  75. package/dist/data/memory/note-embeddings.js +6 -2
  76. package/dist/data/memory/note-embeddings.js.map +1 -1
  77. package/dist/data/memory/schema-ddl.d.ts +1 -1
  78. package/dist/data/memory/schema-ddl.d.ts.map +1 -1
  79. package/dist/data/memory/schema-ddl.js +3 -1
  80. package/dist/data/memory/schema-ddl.js.map +1 -1
  81. package/dist/data/memory/semantic-notes.d.ts +13 -8
  82. package/dist/data/memory/semantic-notes.d.ts.map +1 -1
  83. package/dist/data/memory/semantic-notes.js +12 -17
  84. package/dist/data/memory/semantic-notes.js.map +1 -1
  85. package/dist/data/memory/thread-registry.d.ts +7 -1
  86. package/dist/data/memory/thread-registry.d.ts.map +1 -1
  87. package/dist/data/memory/thread-registry.js +14 -5
  88. package/dist/data/memory/thread-registry.js.map +1 -1
  89. package/dist/data/memory/utils.d.ts +6 -0
  90. package/dist/data/memory/utils.d.ts.map +1 -1
  91. package/dist/data/memory/utils.js +13 -0
  92. package/dist/data/memory/utils.js.map +1 -1
  93. package/dist/integrations/openai/speech.js +4 -4
  94. package/dist/integrations/openai/speech.js.map +1 -1
  95. package/dist/lib/http-retry.d.ts +91 -0
  96. package/dist/lib/http-retry.d.ts.map +1 -0
  97. package/dist/lib/http-retry.js +177 -0
  98. package/dist/lib/http-retry.js.map +1 -0
  99. package/dist/lib/usage-metering/pricing.js +1 -1
  100. package/dist/lib/usage-metering/pricing.js.map +1 -1
  101. package/dist/llm/prompts/narrative.d.ts.map +1 -1
  102. package/dist/llm/prompts/narrative.js +27 -86
  103. package/dist/llm/prompts/narrative.js.map +1 -1
  104. package/dist/services/claude-spawn.service.d.ts.map +1 -1
  105. package/dist/services/claude-spawn.service.js +6 -1
  106. package/dist/services/claude-spawn.service.js.map +1 -1
  107. package/dist/services/codex-spawn.service.d.ts +2 -2
  108. package/dist/services/codex-spawn.service.d.ts.map +1 -1
  109. package/dist/services/codex-spawn.service.js +64 -58
  110. package/dist/services/codex-spawn.service.js.map +1 -1
  111. package/dist/services/consolidation.service.d.ts.map +1 -1
  112. package/dist/services/consolidation.service.js +10 -43
  113. package/dist/services/consolidation.service.js.map +1 -1
  114. package/dist/services/copilot-spawn.service.d.ts.map +1 -1
  115. package/dist/services/copilot-spawn.service.js +6 -1
  116. package/dist/services/copilot-spawn.service.js.map +1 -1
  117. package/dist/services/daily-session.d.ts +22 -11
  118. package/dist/services/daily-session.d.ts.map +1 -1
  119. package/dist/services/daily-session.js +69 -24
  120. package/dist/services/daily-session.js.map +1 -1
  121. package/dist/services/dispatcher/poller.d.ts.map +1 -1
  122. package/dist/services/dispatcher/poller.js +8 -15
  123. package/dist/services/dispatcher/poller.js.map +1 -1
  124. package/dist/services/http-retry.d.ts +1 -90
  125. package/dist/services/http-retry.d.ts.map +1 -1
  126. package/dist/services/http-retry.js +1 -176
  127. package/dist/services/http-retry.js.map +1 -1
  128. package/dist/services/mcp-config.service.d.ts.map +1 -1
  129. package/dist/services/mcp-config.service.js +14 -1
  130. package/dist/services/mcp-config.service.js.map +1 -1
  131. package/dist/services/memory-briefing.service.d.ts +1 -1
  132. package/dist/services/memory-briefing.service.d.ts.map +1 -1
  133. package/dist/services/memory-briefing.service.js +27 -73
  134. package/dist/services/memory-briefing.service.js.map +1 -1
  135. package/dist/services/memory-pruning.service.d.ts.map +1 -1
  136. package/dist/services/memory-pruning.service.js +22 -4
  137. package/dist/services/memory-pruning.service.js.map +1 -1
  138. package/dist/services/predefined-prompts.d.ts +11 -0
  139. package/dist/services/predefined-prompts.d.ts.map +1 -0
  140. package/dist/services/predefined-prompts.js +25 -0
  141. package/dist/services/predefined-prompts.js.map +1 -0
  142. package/dist/services/spawn-common.d.ts +10 -2
  143. package/dist/services/spawn-common.d.ts.map +1 -1
  144. package/dist/services/spawn-common.js +25 -4
  145. package/dist/services/spawn-common.js.map +1 -1
  146. package/dist/services/telegram.d.ts +7 -5
  147. package/dist/services/telegram.d.ts.map +1 -1
  148. package/dist/services/telegram.js +18 -13
  149. package/dist/services/telegram.js.map +1 -1
  150. package/dist/sessions/mcp-registry.d.ts +7 -2
  151. package/dist/sessions/mcp-registry.d.ts.map +1 -1
  152. package/dist/sessions/mcp-registry.js +52 -30
  153. package/dist/sessions/mcp-registry.js.map +1 -1
  154. package/dist/tools/defs/memory-defs.d.ts.map +1 -1
  155. package/dist/tools/defs/memory-defs.js +4 -0
  156. package/dist/tools/defs/memory-defs.js.map +1 -1
  157. package/dist/tools/delegate-tool.js +2 -2
  158. package/dist/tools/delegate-tool.js.map +1 -1
  159. package/dist/tools/memory-tools.d.ts.map +1 -1
  160. package/dist/tools/memory-tools.js +9 -1
  161. package/dist/tools/memory-tools.js.map +1 -1
  162. package/dist/tools/start-session-tool.d.ts.map +1 -1
  163. package/dist/tools/start-session-tool.js +13 -1
  164. package/dist/tools/start-session-tool.js.map +1 -1
  165. package/dist/tools/wait/consolidation-strategy.d.ts +42 -0
  166. package/dist/tools/wait/consolidation-strategy.d.ts.map +1 -0
  167. package/dist/tools/wait/consolidation-strategy.js +50 -0
  168. package/dist/tools/wait/consolidation-strategy.js.map +1 -0
  169. package/dist/tools/wait/drive-handler.d.ts +5 -7
  170. package/dist/tools/wait/drive-handler.d.ts.map +1 -1
  171. package/dist/tools/wait/drive-handler.js +45 -59
  172. package/dist/tools/wait/drive-handler.js.map +1 -1
  173. package/dist/tools/wait/message-delivery.d.ts.map +1 -1
  174. package/dist/tools/wait/message-delivery.js +4 -21
  175. package/dist/tools/wait/message-delivery.js.map +1 -1
  176. package/dist/tools/wait/message-processing.d.ts.map +1 -1
  177. package/dist/tools/wait/message-processing.js +2 -1
  178. package/dist/tools/wait/message-processing.js.map +1 -1
  179. package/dist/tools/wait/poll-loop.d.ts.map +1 -1
  180. package/dist/tools/wait/poll-loop.js +8 -8
  181. package/dist/tools/wait/poll-loop.js.map +1 -1
  182. package/package.json +1 -1
  183. package/templates/increment-pr-pipeline.default.md +79 -0
  184. package/dist/data/memory/reflection-dedup.d.ts +0 -17
  185. package/dist/data/memory/reflection-dedup.d.ts.map +0 -1
  186. package/dist/data/memory/reflection-dedup.js +0 -55
  187. package/dist/data/memory/reflection-dedup.js.map +0 -1
  188. package/dist/data/memory/reflection-gates.d.ts +0 -40
  189. package/dist/data/memory/reflection-gates.d.ts.map +0 -1
  190. package/dist/data/memory/reflection-gates.js +0 -220
  191. package/dist/data/memory/reflection-gates.js.map +0 -1
  192. package/dist/data/memory/reflection-sources.d.ts +0 -13
  193. package/dist/data/memory/reflection-sources.d.ts.map +0 -1
  194. package/dist/data/memory/reflection-sources.js +0 -115
  195. package/dist/data/memory/reflection-sources.js.map +0 -1
  196. package/dist/data/memory/reflection.d.ts +0 -43
  197. package/dist/data/memory/reflection.d.ts.map +0 -1
  198. package/dist/data/memory/reflection.js +0 -329
  199. package/dist/data/memory/reflection.js.map +0 -1
  200. package/dist/llm/prompts/reflection.d.ts +0 -6
  201. package/dist/llm/prompts/reflection.d.ts.map +0 -1
  202. package/dist/llm/prompts/reflection.js +0 -77
  203. package/dist/llm/prompts/reflection.js.map +0 -1
@@ -45,31 +45,31 @@
45
45
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
46
46
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
47
47
 
48
- <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))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)}})();/**
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 s(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=s(r);fetch(r.href,a)}})();/**
49
49
  * @vue/shared v3.5.31
50
50
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
51
51
  * @license MIT
52
- **/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const 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};/**
52
+ **/function un(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ye={},Lt=[],rt=()=>{},po=()=>!1,Ps=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Es=e=>e.startsWith("onUpdate:"),Ee=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},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]",Mn=e=>cs(e)==="[object Date]",le=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)||le(e))&&le(e.then)&&le(e.catch),xo=Object.prototype.toString,cs=e=>xo.call(e),yr=e=>cs(e).slice(8,-1),vo=e=>cs(e)==="[object Object]",dn=e=>Se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xt=un(",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,je=As(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=As(e=>e.replace(wr,"-$1").toLowerCase()),Ms=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ns=As(e=>e?`on${Ms(e)}`:""),ot=(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})},Is=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let In;const Os=()=>In||(In=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mt(e){if(re(e)){const t={};for(let s=0;s<e.length;s++){const o=e[s],r=Se(o)?Cr(o):Mt(o);if(r)for(const a in r)t[a]=r[a]}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=un(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=Mn(e),o=Mn(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,a=Object.keys(t).length;if(r!==a)return!1;for(const l in e){const i=e.hasOwnProperty(l),d=t.hasOwnProperty(l);if(i&&!d||!i&&d||!Ht(e[l],t[l]))return!1}}return String(e)===String(t)}function fn(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||!le(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],a)=>(s[Bs(o,a)+" =>"]=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 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}/**
56
+ **/let Ve;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=Ve,!t&&Ve&&(this.index=(Ve.scopes||(Ve.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=Ve;try{return Ve=this,t()}finally{Ve=s}}}on(){++this._on===1&&(this.prevScope=Ve,Ve=this)}off(){this._on>0&&--this._on===0&&(Ve=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 Mr(){return Ve}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,Ve&&Ve.active&&Ve.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=Je;we=this,Je=!0;try{return this.fn()}finally{So(this),we=t,Je=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)xn(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,Zt,Qt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Qt,Qt=e;return}e.next=Zt,Zt=e}function pn(){wo++}function mn(){if(--wo>0)return;if(Qt){let t=Qt;for(Qt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Zt;){let t=Zt;for(Zt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(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),xn(o),Ir(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=Je;we=e,Je=!0;try{$o(e);const r=e.fn(e._value);(t.version===0||ot(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{we=s,Je=o,So(e),e.flags&=-3}}function xn(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 a=s.computed.deps;a;a=a.nextDep)xn(a,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ir(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Je=!0;const To=[];function vt(){To.push(Je),Je=!1}function gt(){const e=To.pop();Je=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 Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class vn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!we||!Je||we===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==we)s=this.activeLink=new Or(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){pn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{mn()}}}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 Xs=new WeakMap,Et=Symbol(""),Zs=Symbol(""),rs=Symbol("");function Ae(e,t,s){if(Je&&we){let o=Xs.get(e);o||Xs.set(e,o=new Map);let r=o.get(s);r||(o.set(s,r=new vn),r.map=o,r.key=s),r.track()}}function pt(e,t,s,o,r,a){const l=Xs.get(e);if(!l){os++;return}const i=d=>{d&&d.trigger()};if(pn(),t==="clear")l.forEach(i);else{const d=re(e),m=d&&dn(s);if(d&&s==="length"){const f=Number(o);l.forEach((p,w)=>{(w==="length"||w===rs||!lt(w)&&w>=f)&&i(p)})}else switch((s!==void 0||l.has(void 0))&&i(l.get(s)),m&&i(l.get(rs)),t){case"add":d?m&&i(l.get("length")):(i(l.get(Et)),jt(e)&&i(l.get(Zs)));break;case"delete":d||(i(l.get(Et)),jt(e)&&i(l.get(Zs)));break;case"set":jt(e)&&i(l.get(Et));break}}mn()}function Ot(e){const t=me(e);return t===e?t:(Ae(t,"iterate",rs),Ke(e)?t:t.map(qe))}function Ds(e){return Ae(e=me(e),"iterate",rs),e}function st(e,t){return ht(e)?Vt(At(e)?qe(t):t):qe(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>st(this,e))},concat(...e){return Ot(this).concat(...e.map(t=>re(t)?Ot(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=st(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,s=>s.map(o=>st(this,o)),arguments)},find(e,t){return ct(this,"find",e,t,s=>st(this,s),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,s=>st(this,s),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ws(this,"includes",e)},indexOf(...e){return Ws(this,"indexOf",e)},join(e){return Ot(this).join(e)},lastIndexOf(...e){return Ws(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Dn(this,"reduce",e,t)},reduceRight(e,...t){return Dn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Ot(this).toReversed()},toSorted(e){return Ot(this).toSorted(e)},toSpliced(...e){return Ot(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Hs(this,"values",e=>st(this,e))}};function Hs(e,t,s){const o=Ds(e),r=o[t]();return o!==e&&!Ke(e)&&(r._next=r.next,r.next=()=>{const a=r._next();return a.done||(a.value=s(a.value)),a}),r}const Lr=Array.prototype;function ct(e,t,s,o,r,a){const l=Ds(e),i=l!==e&&!Ke(e),d=l[t];if(d!==Lr[t]){const p=d.apply(e,a);return i?qe(p):p}let m=s;l!==e&&(i?m=function(p,w){return s.call(this,st(e,p),w,e)}:s.length>2&&(m=function(p,w){return s.call(this,p,w,e)}));const f=d.call(l,m,o);return i&&r?r(f):f}function Dn(e,t,s,o){const r=Ds(e),a=r!==e&&!Ke(e);let l=s,i=!1;r!==e&&(a?(i=o.length===0,l=function(m,f,p){return i&&(i=!1,m=st(e,m)),s.call(this,m,st(e,f),p,e)}):s.length>3&&(l=function(m,f,p){return s.call(this,m,f,p,e)}));const d=r[t](l,...o);return i?st(e,d):d}function Ws(e,t,s){const o=me(e);Ae(o,"iterate",rs);const r=o[t](...s);return(r===-1||r===!1)&&yn(s[0])?(s[0]=me(s[0]),o[t](...s)):r}function zt(e,t,s=[]){vt(),pn();const o=me(e)[t].apply(e,s);return mn(),gt(),o}const jr=un("__proto__,__v_isRef,__isVue"),Eo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(lt));function Rr(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,a=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return a;if(s==="__v_raw")return o===(r?a?Jr:Do:a?Oo:Io).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const l=re(t);if(!r){let d;if(l&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Rr}const i=Reflect.get(t,s,Ie(t)?t:o);if((lt(s)?Eo.has(s):jr(s))||(r||Ae(t,"get",s),a))return i;if(Ie(i)){const d=l&&dn(s)?i:i.value;return r&&he(d)?en(d):d}return he(i)?r?en(i):hn(i):i}}class Mo extends Ao{constructor(t=!1){super(!1,t)}set(t,s,o,r){let a=t[s];const l=re(t)&&dn(s);if(!this._isShallow){const m=ht(a);if(!Ke(o)&&!ht(o)&&(a=me(a),o=me(o)),!l&&Ie(a)&&!Ie(o))return m||(a.value=o),!0}const i=l?Number(s)<t.length:xe(t,s),d=Reflect.set(t,s,o,Ie(t)?t:r);return t===me(r)&&(i?ot(o,a)&&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 Vr=new Mo,Nr=new Ur,Br=new Mo(!0);const Qs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...o){const r=this.__v_raw,a=me(r),l=jt(a),i=e==="entries"||e===Symbol.iterator&&l,d=e==="keys"&&l,m=r[e](...o),f=s?Qs:t?Vt:qe;return!t&&Ae(a,"iterate",d?Zs:Et),Ee(Object.create(m),{next(){const{value:p,done:w}=m.next();return w?{value:p,done:w}:{value:i?[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 a=this.__v_raw,l=me(a),i=me(r);e||(ot(r,i)&&Ae(l,"get",r),Ae(l,"get",i));const{has:d}=ps(l),m=t?Qs:e?Vt:qe;if(d.call(l,r))return m(a.get(r));if(d.call(l,i))return m(a.get(i));a!==l&&a.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(me(r),"iterate",Et),r.size},has(r){const a=this.__v_raw,l=me(a),i=me(r);return e||(ot(r,i)&&Ae(l,"has",r),Ae(l,"has",i)),r===i?a.has(r):a.has(r)||a.has(i)},forEach(r,a){const l=this,i=l.__v_raw,d=me(i),m=t?Qs:e?Vt:qe;return!e&&Ae(d,"iterate",Et),i.forEach((f,p)=>r.call(a,m(f),m(p),l))}};return Ee(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(r){const a=me(this),l=ps(a),i=me(r),d=!t&&!Ke(r)&&!ht(r)?i:r;return l.has.call(a,d)||ot(r,d)&&l.has.call(a,r)||ot(i,d)&&l.has.call(a,i)||(a.add(d),pt(a,"add",d,d)),this},set(r,a){!t&&!Ke(a)&&!ht(a)&&(a=me(a));const l=me(this),{has:i,get:d}=ps(l);let m=i.call(l,r);m||(r=me(r),m=i.call(l,r));const f=d.call(l,r);return l.set(r,a),m?ot(a,f)&&pt(l,"set",r,a):pt(l,"add",r,a),this},delete(r){const a=me(this),{has:l,get:i}=ps(a);let d=l.call(a,r);d||(r=me(r),d=l.call(a,r)),i&&i.call(a,r);const m=a.delete(r);return d&&pt(a,"delete",r,void 0),m},clear(){const r=me(this),a=r.size!==0,l=r.clear();return a&&pt(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function gn(e,t){const s=Hr(e,t);return(o,r,a)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(xe(s,r)&&r in o?s:o,r,a)}const Wr={get:gn(!1,!1)},Kr={get:gn(!1,!0)},zr={get:gn(!0,!1)};const Io=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(yr(e))}function hn(e){return ht(e)?e:bn(e,!1,Vr,Wr,Io)}function Gr(e){return bn(e,!1,Br,Kr,Oo)}function en(e){return bn(e,!0,Nr,zr,Do)}function bn(e,t,s,o,r){if(!he(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:s);return r.set(e,i),i}function At(e){return ht(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function ht(e){return!!(e&&e.__v_isReadonly)}function Ke(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Xr(e){return!xe(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const qe=e=>he(e)?hn(e):e,Vt=e=>he(e)?en(e):e;function Ie(e){return e?e.__v_isRef===!0:!1}function _(e){return Zr(e,!1)}function Zr(e,t){return Ie(e)?e:new Qr(e,t)}class Qr{constructor(t,s){this.dep=new vn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:me(t),this._value=s?t:qe(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,o=this.__v_isShallow||Ke(t)||ht(t);t=o?t:me(t),ot(t,s)&&(this._rawValue=t,this._value=o?t:qe(t),this.dep.trigger())}}function ea(e){return Ie(e)?e.value:e}const ta={get:(e,t,s)=>t==="__v_raw"?e:ea(Reflect.get(e,t,s)),set:(e,t,s,o)=>{const r=e[t];return Ie(r)&&!Ie(s)?(r.value=s,!0):Reflect.set(e,t,s,o)}};function Lo(e){return At(e)?e:new Proxy(e,ta)}class sa{constructor(t,s,o){this.fn=t,this.setter=s,this._value=void 0,this.dep=new vn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=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 na(e,t,s=!1){let o,r;return le(e)?o=e:(o=e.get,r=e.set),new sa(o,r,s)}const xs={},ws=new WeakMap;let Pt;function oa(e,t=!1,s=Pt){if(s){let o=ws.get(s);o||ws.set(s,o=[]),o.push(e)}}function ra(e,t,s=ye){const{immediate:o,deep:r,once:a,scheduler:l,augmentJob:i,call:d}=s,m=I=>r?I:Ke(I)||r===!1||r===0?mt(I,1):mt(I);let f,p,w,P,E=!1,T=!1;if(Ie(e)?(p=()=>e.value,E=Ke(e)):At(e)?(p=()=>m(e),E=!0):re(e)?(T=!0,E=e.some(I=>At(I)||Ke(I)),p=()=>e.map(I=>{if(Ie(I))return I.value;if(At(I))return m(I);if(le(I))return d?d(I,2):I()})):le(e)?t?p=d?()=>d(e,2):e:p=()=>{if(w){vt();try{w()}finally{gt()}}const I=Pt;Pt=f;try{return d?d(e,3,[P]):e(P)}finally{Pt=I}}:p=rt,t&&r){const I=p,X=r===!0?1/0:r;p=()=>mt(I(),X)}const V=Mr(),$=()=>{f.stop(),V&&V.active&&cn(V.effects,f)};if(a&&t){const I=t;t=(...X)=>{I(...X),$()}}let S=T?new Array(e.length).fill(xs):xs;const M=I=>{if(!(!(f.flags&1)||!f.dirty&&!I))if(t){const X=f.run();if(r||E||(T?X.some((oe,ne)=>ot(oe,S[ne])):ot(X,S))){w&&w();const oe=Pt;Pt=f;try{const ne=[X,S===xs?void 0:T&&S[0]===xs?[]:S,P];S=X,d?d(t,3,ne):t(...ne)}finally{Pt=oe}}}else f.run()};return i&&i(M),f=new _o(p),f.scheduler=l?()=>l(M,!1):M,P=I=>oa(I,!1,f),w=f.onStop=()=>{const I=ws.get(f);if(I){if(d)d(I,4);else for(const X of I)X();ws.delete(f)}},t?o?M(!0):S=f.run():l?l(M.bind(null,!0),!0):f.run(),$.pause=f.pause.bind(f),$.resume=f.resume.bind(f),$.stop=$,$}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--,Ie(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 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";/**
60
+ **/function ds(e,t,s,o){try{return o?e(...o):e()}catch(r){Ls(r,t,s)}}function it(e,t,s,o){if(le(e)){const r=ds(e,t,s,o);return r&&mo(r)&&r.catch(a=>{Ls(a,t,s)}),r}if(re(e)){const r=[];for(let a=0;a<e.length;a++)r.push(it(e[a],t,s,o));return r}}function Ls(e,t,s,o=!0){const r=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||ye;if(t){let i=t.parent;const d=t.proxy,m=`https://vuejs.org/error-reference/#runtime-${s}`;for(;i;){const f=i.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,m)===!1)return}i=i.parent}if(a){vt(),ds(a,null,10,[e,d,m]),gt();return}}aa(e,s,r,o,l)}function aa(e,t,s,o=!0,r=!1){if(r)throw e;console.error(e)}const Le=[];let et=-1;const Rt=[];let wt=null,Dt=0;const jo=Promise.resolve();let ks=null;function Ro(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function la(e){let t=et+1,s=Le.length;for(;t<s;){const o=t+s>>>1,r=Le[o],a=as(r);a<e||a===e&&r.flags&2?t=o+1:s=o}return t}function _n(e){if(!(e.flags&1)){const t=as(e),s=Le[Le.length-1];!s||!(e.flags&2)&&t>=as(s)?Le.push(e):Le.splice(la(t),0,e),e.flags|=1,Uo()}}function Uo(){ks||(ks=jo.then(No))}function ia(e){re(e)?Rt.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Rt.push(e),e.flags|=1),Uo()}function Ln(e,t,s=et+1){for(;s<Le.length;s++){const o=Le[s];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Le.splice(s,1),s--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Vo(e){if(Rt.length){const t=[...new Set(Rt)].sort((s,o)=>as(s)-as(o));if(Rt.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 as=e=>e.id==null?e.flags&2?-1:1/0:e.id;function No(e){try{for(et=0;et<Le.length;et++){const t=Le[et];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(;et<Le.length;et++){const t=Le[et];t&&(t.flags&=-2)}et=-1,Le.length=0,Vo(),ks=null,(Le.length||Rt.length)&&No()}}let Fe=null,Bo=null;function $s(e){const t=Fe;return Fe=e,Bo=e&&e.type.__scopeId||null,t}function ua(e,t=Fe,s){if(!t||e._n)return e;const o=(...r)=>{o._d&&Jn(-1);const a=$s(t);let l;try{l=e(...r)}finally{$s(a),o._d&&Jn(1)}return l};return o._n=!0,o._c=!0,o._d=!0,o}function z(e,t){if(Fe===null)return e;const s=Vs(Fe),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[a,l,i,d=ye]=t[r];a&&(le(a)&&(a={mounted:a,updated:a}),a.deep&&mt(l),o.push({dir:a,instance:s,value:l,oldValue:void 0,arg:i,modifiers:d}))}return e}function Ct(e,t,s,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 d=i.dir[o];d&&(vt(),it(d,s,8,[e.el,i,e,t]),gt())}}function ca(e,t){if(Me){let s=Me.provides;const o=Me.parent&&Me.parent.provides;o===s&&(s=Me.provides=Object.create(o)),s[e]=t}}function hs(e,t,s=!1){const o=cl();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&&le(t)?t.call(o&&o.proxy):t}}const da=Symbol.for("v-scx"),fa=()=>hs(da);function Ks(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=ye){const{immediate:o,deep:r,flush:a,once:l}=s,i=Ee({},s),d=t&&o||!t&&a!=="post";let m;if(is){if(a==="sync"){const P=fa();m=P.__watcherHandles||(P.__watcherHandles=[])}else if(!d){const P=()=>{};return P.stop=rt,P.resume=rt,P.pause=rt,P}}const f=Me;i.call=(P,E,T)=>it(P,f,E,T);let p=!1;a==="post"?i.scheduler=P=>{Ue(P,f&&f.suspense)}:a!=="sync"&&(p=!0,i.scheduler=(P,E)=>{E?P():_n(P)}),i.augmentJob=P=>{t&&(P.flags|=4),p&&(P.flags|=2,f&&(P.id=f.uid,P.i=f))};const w=ra(e,t,i);return is&&(m?m.push(w):d&&w()),w}function pa(e,t,s){const o=this.proxy,r=Se(e)?e.includes(".")?Ho(o,e):()=>o[e]:e.bind(o,o);let a;le(t)?a=t:(a=t.handler,s=t);const l=fs(this),i=Fo(r,a.bind(o),s);return l(),i}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 ma=Symbol("_vte"),xa=e=>e.__isTeleport,va=Symbol("_leaveCb");function wn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,wn(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 Re(e,t){return le(e)?Ee({name:e.name},t,{setup:e}):e}function Wo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function jn(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((T,V)=>es(T,t&&(re(t)?t[V]: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 a=o.shapeFlag&4?Vs(o.component):o.el,l=r?null:a,{i,r:d}=e,m=t&&t.r,f=i.refs===ye?i.refs={}:i.refs,p=i.setupState,w=me(p),P=p===ye?po:T=>jn(f,T)?!1:xe(w,T),E=(T,V)=>!(V&&jn(f,V));if(m!=null&&m!==d){if(Rn(t),Se(m))f[m]=null,P(m)&&(p[m]=null);else if(Ie(m)){const T=t;E(m,T.k)&&(m.value=null),T.k&&(f[T.k]=null)}}if(le(d))ds(d,i,12,[l,f]);else{const T=Se(d),V=Ie(d);if(T||V){const $=()=>{if(e.f){const S=T?P(d)?p[d]:f[d]:E()||!e.k?d.value:f[e.k];if(r)re(S)&&cn(S,a);else if(re(S))S.includes(a)||S.push(a);else if(T)f[d]=[a],P(d)&&(p[d]=f[d]);else{const M=[a];E(d,e.k)&&(d.value=M),e.k&&(f[e.k]=M)}}else T?(f[d]=l,P(d)&&(p[d]=l)):V&&(E(d,e.k)&&(d.value=l),e.k&&(f[e.k]=l))};if(l){const S=()=>{$(),Ss.delete(e)};S.id=-1,Ss.set(e,S),Ue(S,s)}else Rn(e),$()}}}function Rn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Ko=e=>e.type.__isKeepAlive;function ga(e,t){zo(e,"a",t)}function ha(e,t){zo(e,"da",t)}function zo(e,t,s=Me){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;)Ko(r.parent.vnode)&&ba(o,t,s,r),r=r.parent}}function ba(e,t,s,o){const r=js(t,e,o,!0);kn(()=>{cn(o[t],r)},s)}function js(e,t,s=Me,o=!1){if(s){const r=s[e]||(s[e]=[]),a=t.__weh||(t.__weh=(...l)=>{vt();const i=fs(s),d=it(t,s,e,l);return i(),gt(),d});return o?r.unshift(a):r.push(a),a}}const bt=e=>(t,s=Me)=>{(!is||e==="sp")&&js(e,(...o)=>t(...o),s)},ya=bt("bm"),Oe=bt("m"),_a=bt("bu"),wa=bt("u"),ka=bt("bum"),kn=bt("um"),$a=bt("sp"),Sa=bt("rtg"),Ca=bt("rtc");function Ta(e,t=Me){js("ec",e,t)}const Pa="components",Jo=Symbol.for("v-ndc");function Ea(e){return Se(e)?Aa(Pa,e,!1)||e:e||Jo}function Aa(e,t,s=!0,o=!1){const r=Fe||Me;if(r){const a=r.type;{const i=xl(a,!1);if(i&&(i===t||i===je(t)||i===Ms(je(t))))return a}const l=Un(r[e]||a[e],t)||Un(r.appContext[e],t);return!l&&o?a:l}}function Un(e,t){return e&&(e[t]||e[je(t)]||e[Ms(je(t))])}function ce(e,t,s,o){let r;const a=s,l=re(e);if(l||Se(e)){const i=l&&At(e);let d=!1,m=!1;i&&(d=!Ke(e),m=ht(e),e=Ds(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(d?m?Vt(qe(e[f])):qe(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(he(e))if(e[Symbol.iterator])r=Array.from(e,(i,d)=>t(i,d,void 0,a));else{const i=Object.keys(e);r=new Array(i.length);for(let d=0,m=i.length;d<m;d++){const f=i[d];r[d]=t(e[f],f,d,a)}}else r=[];return r}const tn=e=>e?xr(e)?Vs(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=()=>{_n(e.update)}),$nextTick:e=>e.n||(e.n=Ro.bind(e.proxy)),$watch:e=>pa.bind(e)}),zs=(e,t)=>e!==ye&&!e.__isScriptSetup&&xe(e,t),Ma={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:o,data:r,props:a,accessCache:l,type:i,appContext:d}=e;if(t[0]!=="$"){const w=l[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 a[t]}else{if(zs(o,t))return l[t]=1,o[t];if(r!==ye&&xe(r,t))return l[t]=2,r[t];if(xe(a,t))return l[t]=3,a[t];if(s!==ye&&xe(s,t))return l[t]=4,s[t];sn&&(l[t]=0)}}const m=ss[t];let f,p;if(m)return t==="$attrs"&&Ae(e.attrs,"get",""),m(e);if((f=i.__cssModules)&&(f=f[t]))return f;if(s!==ye&&xe(s,t))return l[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:a}=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:(a[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:o,appContext:r,props:a,type:l}},i){let d;return!!(s[i]||e!==ye&&i[0]!=="$"&&xe(e,i)||zs(t,i)||xe(a,i)||xe(o,i)||xe(ss,i)||xe(r.config.globalProperties,i)||(d=l.__cssModules)&&d[i])},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 Vn(e){return re(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ia(e){const t=Yo(e),s=e.proxy,o=e.ctx;sn=!1,t.beforeCreate&&Nn(t.beforeCreate,e,"bc");const{data:r,computed:a,methods:l,watch:i,provide:d,inject:m,created:f,beforeMount:p,mounted:w,beforeUpdate:P,updated:E,activated:T,deactivated:V,beforeDestroy:$,beforeUnmount:S,destroyed:M,unmounted:I,render:X,renderTracked:oe,renderTriggered:ne,errorCaptured:ue,serverPrefetch:ve,expose:ee,inheritAttrs:k,components:h,directives:b,filters:A}=t;if(m&&Oa(m,o,null),l)for(const ie in l){const te=l[ie];le(te)&&(o[ie]=te.bind(s))}if(r){const ie=r.call(s,s);he(ie)&&(e.data=hn(ie))}if(sn=!0,a)for(const ie in a){const te=a[ie],F=le(te)?te.bind(s,s):le(te.get)?te.get.bind(s,s):rt,U=!le(te)&&le(te.set)?te.set.bind(s):rt,$e=Te({get:F,set:U});Object.defineProperty(o,ie,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(i)for(const ie in i)qo(i[ie],o,s,ie);if(d){const ie=le(d)?d.call(s):d;Reflect.ownKeys(ie).forEach(te=>{ca(te,ie[te])})}f&&Nn(f,e,"c");function K(ie,te){re(te)?te.forEach(F=>ie(F.bind(s))):te&&ie(te.bind(s))}if(K(ya,p),K(Oe,w),K(_a,P),K(wa,E),K(ga,T),K(ha,V),K(Ta,ue),K(Ca,oe),K(Sa,ne),K(ka,S),K(kn,I),K($a,ve),re(ee))if(ee.length){const ie=e.exposed||(e.exposed={});ee.forEach(te=>{Object.defineProperty(ie,te,{get:()=>s[te],set:F=>s[te]=F,enumerable:!0})})}else e.exposed||(e.exposed={});X&&e.render===rt&&(e.render=X),k!=null&&(e.inheritAttrs=k),h&&(e.components=h),b&&(e.directives=b),ve&&Wo(e)}function Oa(e,t,s=rt){re(e)&&(e=nn(e));for(const o in e){const r=e[o];let a;he(r)?"default"in r?a=hs(r.from||o,r.default,!0):a=hs(r.from||o):a=hs(r),Ie(a)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):t[o]=a}}function Nn(e,t,s){it(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 a=t[e];le(a)&&Ks(r,a)}else if(le(e))Ks(r,e.bind(s));else if(he(e))if(re(e))e.forEach(a=>qo(a,t,s,o));else{const a=le(e.handler)?e.handler.bind(s):t[e.handler];le(a)&&Ks(r,a,e)}}function Yo(e){const t=e.type,{mixins:s,extends:o}=t,{mixins:r,optionsCache:a,config:{optionMergeStrategies:l}}=e.appContext,i=a.get(t);let d;return i?d=i:!r.length&&!s&&!o?d=t:(d={},r.length&&r.forEach(m=>Cs(d,m,l,!0)),Cs(d,t,l)),he(t)&&a.set(t,d),d}function Cs(e,t,s,o=!1){const{mixins:r,extends:a}=t;a&&Cs(e,a,s,!0),r&&r.forEach(l=>Cs(e,l,s,!0));for(const l in t)if(!(o&&l==="expose")){const i=Da[l]||s&&s[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const Da={data:Bn,props:Fn,emits:Fn,methods:Gt,computed:Gt,beforeCreate:De,created:De,beforeMount:De,mounted:De,beforeUpdate:De,updated:De,beforeDestroy:De,beforeUnmount:De,destroyed:De,unmounted:De,activated:De,deactivated:De,errorCaptured:De,serverPrefetch:De,components:Gt,directives:Gt,watch:ja,provide:Bn,inject:La};function Bn(e,t){return t?e?function(){return Ee(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function La(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 De(e,t){return e?[...new Set([].concat(e,t))]:t}function Gt(e,t){return e?Ee(Object.create(null),e,t):t}function Fn(e,t){return e?re(e)&&re(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Vn(e),Vn(t??{})):t}function ja(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const o in t)s[o]=De(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 Ra=0;function Ua(e,t){return function(o,r=null){le(o)||(o=Ee({},o)),r!=null&&!he(r)&&(r=null);const a=Go(),l=new WeakSet,i=[];let d=!1;const m=a.app={_uid:Ra++,_component:o,_props:r,_container:null,_context:a,_instance:null,version:gl,get config(){return a.config},set config(f){},use(f,...p){return l.has(f)||(f&&le(f.install)?(l.add(f),f.install(m,...p)):le(f)&&(l.add(f),f(m,...p))),m},mixin(f){return a.mixins.includes(f)||a.mixins.push(f),m},component(f,p){return p?(a.components[f]=p,m):a.components[f]},directive(f,p){return p?(a.directives[f]=p,m):a.directives[f]},mount(f,p,w){if(!d){const P=m._ceVNode||at(o,r);return P.appContext=a,w===!0?w="svg":w===!1&&(w=void 0),e(P,f,w),d=!0,m._container=f,f.__vue_app__=m,Vs(P.component)}},onUnmount(f){i.push(f)},unmount(){d&&(it(i,m._instance,16),e(null,m._container),delete m._container.__vue_app__)},provide(f,p){return a.provides[f]=p,m},runWithContext(f){const p=Ut;Ut=m;try{return f()}finally{Ut=p}}};return m}}let Ut=null;const Va=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${je(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Na(e,t,...s){if(e.isUnmounted)return;const o=e.vnode.props||ye;let r=s;const a=t.startsWith("update:"),l=a&&Va(o,t.slice(7));l&&(l.trim&&(r=s.map(f=>Se(f)?f.trim():f)),l.number&&(r=s.map(Is)));let i,d=o[i=Ns(t)]||o[i=Ns(je(t))];!d&&a&&(d=o[i=Ns(St(t))]),d&&it(d,e,6,r);const m=o[i+"Once"];if(m){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,it(m,e,6,r)}}const Ba=new WeakMap;function Xo(e,t,s=!1){const o=s?Ba:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const a=e.emits;let l={},i=!1;if(!le(e)){const d=m=>{const f=Xo(m,t,!0);f&&(i=!0,Ee(l,f))};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!a&&!i?(he(e)&&o.set(e,null),null):(re(a)?a.forEach(d=>l[d]=null):Ee(l,a),he(e)&&o.set(e,l),l)}function Rs(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 Hn(e){const{type:t,vnode:s,proxy:o,withProxy:r,propsOptions:[a],slots:l,attrs:i,emit:d,render:m,renderCache:f,props:p,data:w,setupState:P,ctx:E,inheritAttrs:T}=e,V=$s(e);let $,S;try{if(s.shapeFlag&4){const I=r||o,X=I;$=nt(m.call(X,I,f,p,P,w,E)),S=i}else{const I=t;$=nt(I.length>1?I(p,{attrs:i,slots:l,emit:d}):I(p,null)),S=t.props?i:Fa(i)}}catch(I){ns.length=0,Ls(I,e,1),$=at($t)}let M=$;if(S&&T!==!1){const I=Object.keys(S),{shapeFlag:X}=M;I.length&&X&7&&(a&&I.some(Es)&&(S=Ha(S,a)),M=Nt(M,S,!1,!0))}return s.dirs&&(M=Nt(M,null,!1,!0),M.dirs=M.dirs?M.dirs.concat(s.dirs):s.dirs),s.transition&&wn(M,s.transition),$=M,$s(V),$}const Fa=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ps(s))&&((t||(t={}))[s]=e[s]);return t},Ha=(e,t)=>{const s={};for(const o in e)(!Es(o)||!(o.slice(9)in t))&&(s[o]=e[o]);return s};function Wa(e,t,s){const{props:o,children:r,component:a}=e,{props:l,children:i,patchFlag:d}=t,m=a.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return o?Wn(o,l,m):!!l;if(d&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const w=f[p];if(Zo(l,o,w)&&!Rs(m,w))return!0}}}else return(r||i)&&(!i||!i.$stable)?!0:o===l?!1:o?l?Wn(o,l,m):!0:!!l;return!1}function Wn(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 a=o[r];if(Zo(t,e,a)&&!Rs(s,a))return!0}return!1}function Zo(e,t,s){const o=e[s],r=t[s];return s==="style"&&he(o)&&he(r)?!Ht(o,r):o!==r}function Ka({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 Qo={},er=()=>Object.create(Qo),tr=e=>Object.getPrototypeOf(e)===Qo;function za(e,t,s,o=!1){const r={},a=er();e.propsDefaults=Object.create(null),sr(e,t,r,a);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);s?e.props=o?r:Gr(r):e.type.props?e.props=r:e.props=a,e.attrs=a}function Ja(e,t,s,o){const{props:r,attrs:a,vnode:{patchFlag:l}}=e,i=me(r),[d]=e.propsOptions;let m=!1;if((o||l>0)&&!(l&16)){if(l&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let w=f[p];if(Rs(e.emitsOptions,w))continue;const P=t[w];if(d)if(xe(a,w))P!==a[w]&&(a[w]=P,m=!0);else{const E=je(w);r[E]=on(d,i,E,P,e,!1)}else P!==a[w]&&(a[w]=P,m=!0)}}}else{sr(e,t,r,a)&&(m=!0);let f;for(const p in i)(!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,i,p,void 0,e,!0)):delete r[p]);if(a!==i)for(const p in a)(!t||!xe(t,p))&&(delete a[p],m=!0)}m&&pt(e.attrs,"set","")}function sr(e,t,s,o){const[r,a]=e.propsOptions;let l=!1,i;if(t)for(let d in t){if(Xt(d))continue;const m=t[d];let f;r&&xe(r,f=je(d))?!a||!a.includes(f)?s[f]=m:(i||(i={}))[f]=m:Rs(e.emitsOptions,d)||(!(d in o)||m!==o[d])&&(o[d]=m,l=!0)}if(a){const d=me(s),m=i||ye;for(let f=0;f<a.length;f++){const p=a[f];s[p]=on(r,d,p,m[p],e,!xe(m,p))}}return l}function on(e,t,s,o,r,a){const l=e[s];if(l!=null){const i=xe(l,"default");if(i&&o===void 0){const d=l.default;if(l.type!==Function&&!l.skipFactory&&le(d)){const{propsDefaults:m}=r;if(s in m)o=m[s];else{const f=fs(r);o=m[s]=d.call(null,t),f()}}else o=d;r.ce&&r.ce._setProp(s,o)}l[0]&&(a&&!i?o=!1:l[1]&&(o===""||o===St(s))&&(o=!0))}return o}const qa=new WeakMap;function nr(e,t,s=!1){const o=s?qa:t.propsCache,r=o.get(e);if(r)return r;const a=e.props,l={},i=[];let d=!1;if(!le(e)){const f=p=>{d=!0;const[w,P]=nr(p,t,!0);Ee(l,w),P&&i.push(...P)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!a&&!d)return he(e)&&o.set(e,Lt),Lt;if(re(a))for(let f=0;f<a.length;f++){const p=je(a[f]);Kn(p)&&(l[p]=ye)}else if(a)for(const f in a){const p=je(f);if(Kn(p)){const w=a[f],P=l[p]=re(w)||le(w)?{type:w}:Ee({},w),E=P.type;let T=!1,V=!0;if(re(E))for(let $=0;$<E.length;++$){const S=E[$],M=le(S)&&S.name;if(M==="Boolean"){T=!0;break}else M==="String"&&(V=!1)}else T=le(E)&&E.name==="Boolean";P[0]=T,P[1]=V,(T||xe(P,"default"))&&i.push(p)}}const m=[l,i];return he(e)&&o.set(e,m),m}function Kn(e){return e[0]!=="$"&&!Xt(e)}const $n=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>re(e)?e.map(nt):[nt(e)],Ya=(e,t,s)=>{if(t._n)return t;const o=ua((...r)=>Sn(t(...r)),s);return o._c=!1,o},or=(e,t,s)=>{const o=e._ctx;for(const r in e){if($n(r))continue;const a=e[r];if(le(a))t[r]=Ya(r,a,o);else if(a!=null){const l=Sn(a);t[r]=()=>l}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},ar=(e,t,s)=>{for(const o in t)(s||!$n(o))&&(e[o]=t[o])},Ga=(e,t,s)=>{const o=e.slots=er();if(e.vnode.shapeFlag&32){const r=t._;r?(ar(o,t,s),s&&go(o,"_",r,!0)):or(t,o)}else t&&rr(e,t)},Xa=(e,t,s)=>{const{vnode:o,slots:r}=e;let a=!0,l=ye;if(o.shapeFlag&32){const i=t._;i?s&&i===1?a=!1:ar(r,t,s):(a=!t.$stable,or(t,r)),l=t}else t&&(rr(e,t),l={default:1});if(a)for(const i in r)!$n(i)&&l[i]==null&&delete r[i]},Ue=sl;function Za(e){return Qa(e)}function Qa(e,t){const s=Os();s.__VUE__=!0;const{insert:o,remove:r,patchProp:a,createElement:l,createText:i,createComment:d,setText:m,setElementText:f,parentNode:p,nextSibling:w,setScopeId:P=rt,insertStaticContent:E}=e,T=(u,c,C,D=null,g=null,L=null,W=void 0,R=null,N=!!c.dynamicChildren)=>{if(u===c)return;u&&!Jt(u,c)&&(D=yt(u),ke(u,g,L,!0),u=null),c.patchFlag===-2&&(N=!1,c.dynamicChildren=null);const{type:j,ref:se,shapeFlag:J}=c;switch(j){case Us:V(u,c,C,D);break;case $t:$(u,c,C,D);break;case bs:u==null&&S(c,C,D,W);break;case Q:h(u,c,C,D,g,L,W,R,N);break;default:J&1?X(u,c,C,D,g,L,W,R,N):J&6?b(u,c,C,D,g,L,W,R,N):(J&64||J&128)&&j.process(u,c,C,D,g,L,W,R,N,ze)}se!=null&&g?es(se,u&&u.ref,L,c||u,!c):se==null&&u&&u.ref!=null&&es(u.ref,null,L,u,!0)},V=(u,c,C,D)=>{if(u==null)o(c.el=i(c.children),C,D);else{const g=c.el=u.el;c.children!==u.children&&m(g,c.children)}},$=(u,c,C,D)=>{u==null?o(c.el=d(c.children||""),C,D):c.el=u.el},S=(u,c,C,D)=>{[u.el,u.anchor]=E(u.children,c,C,D,u.el,u.anchor)},M=({el:u,anchor:c},C,D)=>{let g;for(;u&&u!==c;)g=w(u),o(u,C,D),u=g;o(c,C,D)},I=({el:u,anchor:c})=>{let C;for(;u&&u!==c;)C=w(u),r(u),u=C;r(c)},X=(u,c,C,D,g,L,W,R,N)=>{if(c.type==="svg"?W="svg":c.type==="math"&&(W="mathml"),u==null)oe(c,C,D,g,L,W,R,N);else{const j=u.el&&u.el._isVueCE?u.el:null;try{j&&j._beginPatch(),ve(u,c,g,L,W,R,N)}finally{j&&j._endPatch()}}},oe=(u,c,C,D,g,L,W,R)=>{let N,j;const{props:se,shapeFlag:J,transition:Z,dirs:ae}=u;if(N=u.el=l(u.type,L,se&&se.is,se),J&8?f(N,u.children):J&16&&ue(u.children,N,null,D,g,Js(u,L),W,R),ae&&Ct(u,null,D,"created"),ne(N,u,u.scopeId,W,D),se){for(const be in se)be!=="value"&&!Xt(be)&&a(N,be,null,se[be],L,D);"value"in se&&a(N,"value",null,se.value,L),(j=se.onVnodeBeforeMount)&&Qe(j,D,u)}ae&&Ct(u,null,D,"beforeMount");const fe=el(g,Z);fe&&Z.beforeEnter(N),o(N,c,C),((j=se&&se.onVnodeMounted)||fe||ae)&&Ue(()=>{try{j&&Qe(j,D,u),fe&&Z.enter(N),ae&&Ct(u,null,D,"mounted")}finally{}},g)},ne=(u,c,C,D,g)=>{if(C&&P(u,C),D)for(let L=0;L<D.length;L++)P(u,D[L]);if(g){let L=g.subTree;if(c===L||cr(L.type)&&(L.ssContent===c||L.ssFallback===c)){const W=g.vnode;ne(u,W,W.scopeId,W.slotScopeIds,g.parent)}}},ue=(u,c,C,D,g,L,W,R,N=0)=>{for(let j=N;j<u.length;j++){const se=u[j]=R?ft(u[j]):nt(u[j]);T(null,se,c,C,D,g,L,W,R)}},ve=(u,c,C,D,g,L,W)=>{const R=c.el=u.el;let{patchFlag:N,dynamicChildren:j,dirs:se}=c;N|=u.patchFlag&16;const J=u.props||ye,Z=c.props||ye;let ae;if(C&&Tt(C,!1),(ae=Z.onVnodeBeforeUpdate)&&Qe(ae,C,c,u),se&&Ct(c,u,C,"beforeUpdate"),C&&Tt(C,!0),(J.innerHTML&&Z.innerHTML==null||J.textContent&&Z.textContent==null)&&f(R,""),j?ee(u.dynamicChildren,j,R,C,D,Js(c,g),L):W||te(u,c,R,null,C,D,Js(c,g),L,!1),N>0){if(N&16)k(R,J,Z,C,g);else if(N&2&&J.class!==Z.class&&a(R,"class",null,Z.class,g),N&4&&a(R,"style",J.style,Z.style,g),N&8){const fe=c.dynamicProps;for(let be=0;be<fe.length;be++){const _e=fe[be],Ce=J[_e],Pe=Z[_e];(Pe!==Ce||_e==="value")&&a(R,_e,Ce,Pe,g,C)}}N&1&&u.children!==c.children&&f(R,c.children)}else!W&&j==null&&k(R,J,Z,C,g);((ae=Z.onVnodeUpdated)||se)&&Ue(()=>{ae&&Qe(ae,C,c,u),se&&Ct(c,u,C,"updated")},D)},ee=(u,c,C,D,g,L,W)=>{for(let R=0;R<c.length;R++){const N=u[R],j=c[R],se=N.el&&(N.type===Q||!Jt(N,j)||N.shapeFlag&198)?p(N.el):C;T(N,j,se,null,D,g,L,W,!0)}},k=(u,c,C,D,g)=>{if(c!==C){if(c!==ye)for(const L in c)!Xt(L)&&!(L in C)&&a(u,L,c[L],null,g,D);for(const L in C){if(Xt(L))continue;const W=C[L],R=c[L];W!==R&&L!=="value"&&a(u,L,R,W,g,D)}"value"in C&&a(u,"value",c.value,C.value,g)}},h=(u,c,C,D,g,L,W,R,N)=>{const j=c.el=u?u.el:i(""),se=c.anchor=u?u.anchor:i("");let{patchFlag:J,dynamicChildren:Z,slotScopeIds:ae}=c;ae&&(R=R?R.concat(ae):ae),u==null?(o(j,C,D),o(se,C,D),ue(c.children||[],C,se,g,L,W,R,N)):J>0&&J&64&&Z&&u.dynamicChildren&&u.dynamicChildren.length===Z.length?(ee(u.dynamicChildren,Z,C,g,L,W,R),(c.key!=null||g&&c===g.subTree)&&lr(u,c,!0)):te(u,c,C,se,g,L,W,R,N)},b=(u,c,C,D,g,L,W,R,N)=>{c.slotScopeIds=R,u==null?c.shapeFlag&512?g.ctx.activate(c,C,D,W,N):A(c,C,D,g,L,W,N):O(u,c,N)},A=(u,c,C,D,g,L,W)=>{const R=u.component=ul(u,D,g);if(Ko(u)&&(R.ctx.renderer=ze),dl(R,!1,W),R.asyncDep){if(g&&g.registerDep(R,K,W),!u.el){const N=R.subTree=at($t);$(null,N,c,C),u.placeholder=N.el}}else K(R,u,c,C,g,L,W)},O=(u,c,C)=>{const D=c.component=u.component;if(Wa(u,c,C))if(D.asyncDep&&!D.asyncResolved){ie(D,c,C);return}else D.next=c,D.update();else c.el=u.el,D.vnode=c},K=(u,c,C,D,g,L,W)=>{const R=()=>{if(u.isMounted){let{next:J,bu:Z,u:ae,parent:fe,vnode:be}=u;{const Xe=ir(u);if(Xe){J&&(J.el=be.el,ie(u,J,W)),Xe.asyncDep.then(()=>{Ue(()=>{u.isUnmounted||j()},g)});return}}let _e=J,Ce;Tt(u,!1),J?(J.el=be.el,ie(u,J,W)):J=be,Z&&gs(Z),(Ce=J.props&&J.props.onVnodeBeforeUpdate)&&Qe(Ce,fe,J,be),Tt(u,!0);const Pe=Hn(u),Ge=u.subTree;u.subTree=Pe,T(Ge,Pe,p(Ge.el),yt(Ge),u,g,L),J.el=Pe.el,_e===null&&Ka(u,Pe.el),ae&&Ue(ae,g),(Ce=J.props&&J.props.onVnodeUpdated)&&Ue(()=>Qe(Ce,fe,J,be),g)}else{let J;const{el:Z,props:ae}=c,{bm:fe,m:be,parent:_e,root:Ce,type:Pe}=u,Ge=ts(c);Tt(u,!1),fe&&gs(fe),!Ge&&(J=ae&&ae.onVnodeBeforeMount)&&Qe(J,_e,c),Tt(u,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Pe,u.parent?u.parent.type:void 0);const Xe=u.subTree=Hn(u);T(null,Xe,C,D,u,g,L),c.el=Xe.el}if(be&&Ue(be,g),!Ge&&(J=ae&&ae.onVnodeMounted)){const Xe=c;Ue(()=>Qe(J,_e,Xe),g)}(c.shapeFlag&256||_e&&ts(_e.vnode)&&_e.vnode.shapeFlag&256)&&u.a&&Ue(u.a,g),u.isMounted=!0,c=C=D=null}};u.scope.on();const N=u.effect=new _o(R);u.scope.off();const j=u.update=N.run.bind(N),se=u.job=N.runIfDirty.bind(N);se.i=u,se.id=u.uid,N.scheduler=()=>_n(se),Tt(u,!0),j()},ie=(u,c,C)=>{c.component=u;const D=u.vnode.props;u.vnode=c,u.next=null,Ja(u,c.props,D,C),Xa(u,c.children,C),vt(),Ln(u),gt()},te=(u,c,C,D,g,L,W,R,N=!1)=>{const j=u&&u.children,se=u?u.shapeFlag:0,J=c.children,{patchFlag:Z,shapeFlag:ae}=c;if(Z>0){if(Z&128){U(j,J,C,D,g,L,W,R,N);return}else if(Z&256){F(j,J,C,D,g,L,W,R,N);return}}ae&8?(se&16&&Ye(j,g,L),J!==j&&f(C,J)):se&16?ae&16?U(j,J,C,D,g,L,W,R,N):Ye(j,g,L,!0):(se&8&&f(C,""),ae&16&&ue(J,C,D,g,L,W,R,N))},F=(u,c,C,D,g,L,W,R,N)=>{u=u||Lt,c=c||Lt;const j=u.length,se=c.length,J=Math.min(j,se);let Z;for(Z=0;Z<J;Z++){const ae=c[Z]=N?ft(c[Z]):nt(c[Z]);T(u[Z],ae,C,null,g,L,W,R,N)}j>se?Ye(u,g,L,!0,!1,J):ue(c,C,D,g,L,W,R,N,J)},U=(u,c,C,D,g,L,W,R,N)=>{let j=0;const se=c.length;let J=u.length-1,Z=se-1;for(;j<=J&&j<=Z;){const ae=u[j],fe=c[j]=N?ft(c[j]):nt(c[j]);if(Jt(ae,fe))T(ae,fe,C,null,g,L,W,R,N);else break;j++}for(;j<=J&&j<=Z;){const ae=u[J],fe=c[Z]=N?ft(c[Z]):nt(c[Z]);if(Jt(ae,fe))T(ae,fe,C,null,g,L,W,R,N);else break;J--,Z--}if(j>J){if(j<=Z){const ae=Z+1,fe=ae<se?c[ae].el:D;for(;j<=Z;)T(null,c[j]=N?ft(c[j]):nt(c[j]),C,fe,g,L,W,R,N),j++}}else if(j>Z)for(;j<=J;)ke(u[j],g,L,!0),j++;else{const ae=j,fe=j,be=new Map;for(j=fe;j<=Z;j++){const Be=c[j]=N?ft(c[j]):nt(c[j]);Be.key!=null&&be.set(Be.key,j)}let _e,Ce=0;const Pe=Z-fe+1;let Ge=!1,Xe=0;const Kt=new Array(Pe);for(j=0;j<Pe;j++)Kt[j]=0;for(j=ae;j<=J;j++){const Be=u[j];if(Ce>=Pe){ke(Be,g,L,!0);continue}let Ze;if(Be.key!=null)Ze=be.get(Be.key);else for(_e=fe;_e<=Z;_e++)if(Kt[_e-fe]===0&&Jt(Be,c[_e])){Ze=_e;break}Ze===void 0?ke(Be,g,L,!0):(Kt[Ze-fe]=j+1,Ze>=Xe?Xe=Ze:Ge=!0,T(Be,c[Ze],C,null,g,L,W,R,N),Ce++)}const Pn=Ge?tl(Kt):Lt;for(_e=Pn.length-1,j=Pe-1;j>=0;j--){const Be=fe+j,Ze=c[Be],En=c[Be+1],An=Be+1<se?En.el||ur(En):D;Kt[j]===0?T(null,Ze,C,An,g,L,W,R,N):Ge&&(_e<0||j!==Pn[_e]?$e(Ze,C,An,2):_e--)}}},$e=(u,c,C,D,g=null)=>{const{el:L,type:W,transition:R,children:N,shapeFlag:j}=u;if(j&6){$e(u.component.subTree,c,C,D);return}if(j&128){u.suspense.move(c,C,D);return}if(j&64){W.move(u,c,C,ze);return}if(W===Q){o(L,c,C);for(let J=0;J<N.length;J++)$e(N[J],c,C,D);o(u.anchor,c,C);return}if(W===bs){M(u,c,C);return}if(D!==2&&j&1&&R)if(D===0)R.beforeEnter(L),o(L,c,C),Ue(()=>R.enter(L),g);else{const{leave:J,delayLeave:Z,afterLeave:ae}=R,fe=()=>{u.ctx.isUnmounted?r(L):o(L,c,C)},be=()=>{L._isLeaving&&L[va](!0),J(L,()=>{fe(),ae&&ae()})};Z?Z(L,fe,be):be()}else o(L,c,C)},ke=(u,c,C,D=!1,g=!1)=>{const{type:L,props:W,ref:R,children:N,dynamicChildren:j,shapeFlag:se,patchFlag:J,dirs:Z,cacheIndex:ae,memo:fe}=u;if(J===-2&&(g=!1),R!=null&&(vt(),es(R,null,C,u,!0),gt()),ae!=null&&(c.renderCache[ae]=void 0),se&256){c.ctx.deactivate(u);return}const be=se&1&&Z,_e=!ts(u);let Ce;if(_e&&(Ce=W&&W.onVnodeBeforeUnmount)&&Qe(Ce,c,u),se&6)It(u.component,C,D);else{if(se&128){u.suspense.unmount(C,D);return}be&&Ct(u,null,c,"beforeUnmount"),se&64?u.type.remove(u,c,C,ze,D):j&&!j.hasOnce&&(L!==Q||J>0&&J&64)?Ye(j,c,C,!1,!0):(L===Q&&J&384||!g&&se&16)&&Ye(N,c,C),D&&ge(u)}const Pe=fe!=null&&ae==null;(_e&&(Ce=W&&W.onVnodeUnmounted)||be||Pe)&&Ue(()=>{Ce&&Qe(Ce,c,u),be&&Ct(u,null,c,"unmounted"),Pe&&(u.el=null)},C)},ge=u=>{const{type:c,el:C,anchor:D,transition:g}=u;if(c===Q){ut(C,D);return}if(c===bs){I(u);return}const L=()=>{r(C),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(u.shapeFlag&1&&g&&!g.persisted){const{leave:W,delayLeave:R}=g,N=()=>W(C,L);R?R(u.el,L,N):N()}else L()},ut=(u,c)=>{let C;for(;u!==c;)C=w(u),r(u),u=C;r(c)},It=(u,c,C)=>{const{bum:D,scope:g,job:L,subTree:W,um:R,m:N,a:j}=u;zn(N),zn(j),D&&gs(D),g.stop(),L&&(L.flags|=8,ke(W,u,c,C)),R&&Ue(R,c),Ue(()=>{u.isUnmounted=!0},c)},Ye=(u,c,C,D=!1,g=!1,L=0)=>{for(let W=L;W<u.length;W++)ke(u[W],c,C,D,g)},yt=u=>{if(u.shapeFlag&6)return yt(u.component.subTree);if(u.shapeFlag&128)return u.suspense.next();const c=w(u.anchor||u.el),C=c&&c[ma];return C?w(C):c};let Wt=!1;const _t=(u,c,C)=>{let D;u==null?c._vnode&&(ke(c._vnode,null,null,!0),D=c._vnode.component):T(c._vnode||null,u,c,null,null,null,C),c._vnode=u,Wt||(Wt=!0,Ln(D),Vo(),Wt=!1)},ze={p:T,um:ke,m:$e,r:ge,mt:A,mc:ue,pc:te,pbc:ee,n:yt,o:e};return{render:_t,hydrate:void 0,createApp:Ua(_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 el(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lr(e,t,s=!1){const o=e.children,r=t.children;if(re(o)&&re(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]=ft(r[a]),i.el=l.el),!s&&i.patchFlag!==-2&&lr(l,i)),i.type===Us&&(i.patchFlag===-1&&(i=r[a]=ft(i)),i.el=l.el),i.type===$t&&!i.el&&(i.el=l.el)}}function tl(e){const t=e.slice(),s=[0];let o,r,a,l,i;const d=e.length;for(o=0;o<d;o++){const m=e[o];if(m!==0){if(r=s[s.length-1],e[r]<m){t[o]=r,s.push(o);continue}for(a=0,l=s.length-1;a<l;)i=a+l>>1,e[s[i]]<m?a=i+1:l=i;m<e[s[a]]&&(a>0&&(t[o]=s[a-1]),s[a]=o)}}for(a=s.length,l=s[a-1];a-- >0;)s[a]=l,l=t[l];return s}function ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(t)}function zn(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 sl(e,t){t&&t.pendingBranch?re(e)?t.effects.push(...e):t.effects.push(e):ia(e)}const Q=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),bs=Symbol.for("v-stc"),ns=[];let He=null;function x(e=!1){ns.push(He=e?null:[])}function nl(){ns.pop(),He=ns[ns.length-1]||null}let ls=1;function Jn(e,t=!1){ls+=e,e<0&&He&&t&&(He.hasOnce=!0)}function dr(e){return e.dynamicChildren=ls>0?He||Lt:null,nl(),ls>0&&He&&He.push(e),e}function v(e,t,s,o,r,a){return dr(n(e,t,s,o,r,a,!0))}function fr(e,t,s,o,r){return dr(at(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)||Ie(e)||le(e)?{i:Fe,r:e,k:t,f:!!s}:e:null);function n(e,t=null,s=null,o=0,r=null,a=e===Q?0:1,l=!1,i=!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:a,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Fe};return i?(Cn(d,s),a&128&&e.normalize(d)):s&&(d.shapeFlag|=Se(s)?8:16),ls>0&&!l&&He&&(d.patchFlag>0||a&6)&&d.patchFlag!==32&&He.push(d),d}const at=ol;function ol(e,t=null,s=null,o=0,r=null,a=!1){if((!e||e===Jo)&&(e=$t),pr(e)){const i=Nt(e,t,!0);return s&&Cn(i,s),ls>0&&!a&&He&&(i.shapeFlag&6?He[He.indexOf(e)]=i:He.push(i)),i.patchFlag=-2,i}if(vl(e)&&(e=e.__vccOpts),t){t=rl(t);let{class:i,style:d}=t;i&&!Se(i)&&(t.class=q(i)),he(d)&&(yn(d)&&!re(d)&&(d=Ee({},d)),t.style=Mt(d))}const l=Se(e)?1:cr(e)?128:xa(e)?64:he(e)?4:le(e)?2:0;return n(e,t,s,o,r,l,a,!0)}function rl(e){return e?yn(e)||tr(e)?Ee({},e):e:null}function Nt(e,t,s=!1,o=!1){const{props:r,ref:a,patchFlag:l,children:i,transition:d}=e,m=t?al(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:m,key:m&&mr(m),ref:t&&t.ref?s&&a?re(a)?a.concat(ys(t)):[a,ys(t)]:ys(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!==Q?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Nt(e.ssContent),ssFallback:e.ssFallback&&Nt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&o&&wn(f,d.clone(f)),f}function Y(e=" ",t=0){return at(Us,null,e,t)}function We(e,t){const s=at(bs,null,e);return s.staticCount=t,s}function B(e="",t=!1){return t?(x(),fr($t,null,e)):at($t,null,e)}function nt(e){return e==null||typeof e=="boolean"?at($t):re(e)?at(Q,null,e.slice()):pr(e)?ft(e):at(Us,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Nt(e)}function Cn(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),Cn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Fe:r===3&&Fe&&(Fe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else le(t)?(t={default:t,_ctx:Fe},s=32):(t=String(t),o&64?(s=16,t=[Y(t)]):s=8);e.children=t,e.shapeFlag|=s}function al(...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=Mt([t.style,o.style]);else if(Ps(r)){const a=t[r],l=o[r];l&&a!==l&&!(re(a)&&a.includes(l))?t[r]=a?[].concat(a,l):l:l==null&&a==null&&!Es(r)&&(t[r]=l)}else r!==""&&(t[r]=o[r])}return t}function Qe(e,t,s,o=null){it(e,t,7,[s,o])}const ll=Go();let il=0;function ul(e,t,s){const o=e.type,r=(t?t.appContext:e.appContext)||ll,a={uid:il++,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:Xo(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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Na.bind(null,a),e.ce&&e.ce(a),a}let Me=null;const cl=()=>Me||Fe;let Ts,rn;{const e=Os(),t=(s,o)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(o),a=>{r.length>1?r.forEach(l=>l(a)):r[0](a)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Me=s),rn=t("__VUE_SSR_SETTERS__",s=>is=s)}const fs=e=>{const t=Me;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},qn=()=>{Me&&Me.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let is=!1;function dl(e,t=!1,s=!1){t&&rn(t);const{props:o,children:r}=e.vnode,a=xr(e);za(e,o,a,t),Ga(e,r,s||t);const l=a?fl(e,t):void 0;return t&&rn(!1),l}function fl(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ma);const{setup:o}=s;if(o){vt();const r=e.setupContext=o.length>1?ml(e):null,a=fs(e),l=ds(o,e,0,[e.props,r]),i=mo(l);if(gt(),a(),(i||e.sp)&&!ts(e)&&Wo(e),i){if(l.then(qn,qn),t)return l.then(d=>{Yn(e,d)}).catch(d=>{Ls(d,e,0)});e.asyncDep=l}else Yn(e,l)}else vr(e)}function Yn(e,t,s){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=Lo(t)),vr(e)}function vr(e,t,s){const o=e.type;e.render||(e.render=o.render||rt);{const r=fs(e);vt();try{Ia(e)}finally{gt(),r()}}}const pl={get(e,t){return Ae(e,"get",""),e[t]}};function ml(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pl),slots:e.slots,emit:e.emit,expose:t}}function Vs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Lo(Xr(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 xl(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function vl(e){return le(e)&&"__vccOpts"in e}const Te=(e,t)=>na(e,t,is),gl="3.5.31";/**
61
61
  * @vue/runtime-dom v3.5.31
62
62
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
63
63
  * @license MIT
64
- **/let ln;const 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}
64
+ **/let an;const Gn=typeof window<"u"&&window.trustedTypes;if(Gn)try{an=Gn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=an?e=>an.createHTML(e):e=>e,hl="http://www.w3.org/2000/svg",bl="http://www.w3.org/1998/Math/MathML",dt=typeof document<"u"?document:null,Xn=dt&&dt.createElement("template"),yl={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"?dt.createElementNS(hl,e):t==="mathml"?dt.createElementNS(bl,e):s?dt.createElement(e,{is:s}):dt.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>dt.createTextNode(e),createComment:e=>dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,o,r,a){const l=s?s.previousSibling:t.lastChild;if(r&&(r===a||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===a||!(r=r.nextSibling)););else{Xn.innerHTML=gr(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const i=Xn.content;if(o==="svg"||o==="mathml"){const d=i.firstChild;for(;d.firstChild;)i.appendChild(d.firstChild);i.removeChild(d)}t.insertBefore(i,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_l=Symbol("_vtc");function wl(e,t,s){const o=e[_l];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),kl=Symbol("_vsh"),$l=Symbol(""),Sl=/(?:^|;)\s*display\s*:/;function Cl(e,t,s){const o=e.style,r=Se(s);let a=!1;if(s&&!r){if(t)if(Se(t))for(const l of t.split(";")){const i=l.slice(0,l.indexOf(":")).trim();s[i]==null&&_s(o,i,"")}else for(const l in t)s[l]==null&&_s(o,l,"");for(const l in s)l==="display"&&(a=!0),_s(o,l,s[l])}else if(r){if(t!==s){const l=o[$l];l&&(s+=";"+l),o.cssText=s,a=Sl.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=a?o.display:"",e[kl]&&(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=Tl(e,t);Qn.test(s)?e.setProperty(St(o),s.replace(Qn,""),"important"):e[o]=s}}const eo=["Webkit","Moz","ms"],qs={};function Tl(e,t){const s=qs[t];if(s)return s;let o=je(t);if(o!=="filter"&&o in e)return qs[t]=o;o=Ms(o);for(let r=0;r<eo.length;r++){const a=eo[r]+o;if(a in e)return qs[t]=a}return t}const to="http://www.w3.org/1999/xlink";function so(e,t,s,o,r,a=Pr(t)){o&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(to,t.slice(6,t.length)):e.setAttributeNS(to,t,s):s==null||a&&!ho(s)?e.removeAttribute(t):e.setAttribute(t,a?"":lt(s)?String(s):s)}function no(e,t,s,o,r){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const i=a==="OPTION"?e.getAttribute("value")||"":e.value,d=s==null?e.type==="checkbox"?"on":"":String(s);(i!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let l=!1;if(s===""||s==null){const i=typeof e[t];i==="boolean"?s=ho(s):s==null&&i==="string"?(s="",l=!0):i==="number"&&(s=0,l=!0)}try{e[t]=s}catch{}l&&e.removeAttribute(r||t)}function kt(e,t,s,o){e.addEventListener(t,s,o)}function Pl(e,t,s,o){e.removeEventListener(t,s,o)}const oo=Symbol("_vei");function El(e,t,s,o,r=null){const a=e[oo]||(e[oo]={}),l=a[t];if(o&&l)l.value=o;else{const[i,d]=Al(t);if(o){const m=a[t]=Ol(o,r);kt(e,i,m,d)}else l&&(Pl(e,i,l,d),a[t]=void 0)}}const ro=/(?:Once|Passive|Capture)$/;function Al(e){let t;if(ro.test(e)){t={};let o;for(;o=e.match(ro);)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 Ml=Promise.resolve(),Il=()=>Ys||(Ml.then(()=>Ys=0),Ys=Date.now());function Ol(e,t){const s=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=s.attached)return;it(Dl(o,s.value),t,5,[o])};return s.value=e,s.attached=Il(),s}function Dl(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 ao=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ll=(e,t,s,o,r,a)=>{const l=r==="svg";t==="class"?wl(e,o,l):t==="style"?Cl(e,s,o):Ps(t)?Es(t)||El(e,t,s,o,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jl(e,t,o,l))?(no(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&so(e,t,o,l,a,t!=="value")):e._isVueCE&&(Rl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Se(o)))?no(e,je(t),o,a,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),so(e,t,o,l))};function jl(e,t,s,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ao(t)&&le(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 ao(t)&&Se(s)?!1:t in e}function Rl(e,t){const s=e._def.props;if(!s)return!1;const o=je(t);return Array.isArray(s)?s.some(r=>je(r)===o):Object.keys(s).some(r=>je(r)===o)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return re(t)?s=>gs(t,s):t};function Ul(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 io(e,t,s){return t&&(e=e.trim()),s&&(e=Is(e)),e}const G={created(e,{modifiers:{lazy:t,trim:s,number:o}},r){e[xt]=Bt(r);const a=o||r.props&&r.props.type==="number";kt(e,t?"change":"input",l=>{l.target.composing||e[xt](io(e.value,s,a))}),(s||a)&&kt(e,"change",()=>{e.value=io(e.value,s,a)}),t||(kt(e,"compositionstart",Ul),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:a}},l){if(e[xt]=Bt(l),e.composing)return;const i=(a||e.type==="number")&&!/^0\d/.test(e.value)?Is(e.value):e.value,d=t??"";if(i===d)return;const m=e.getRootNode();(m instanceof Document||m instanceof ShadowRoot)&&m.activeElement===e&&e.type!=="range"&&(o&&t===s||r&&e.value.trim()===d)||(e.value=d)}},ln={deep:!0,created(e,t,s){e[xt]=Bt(s),kt(e,"change",()=>{const o=e._modelValue,r=us(e),a=e.checked,l=e[xt];if(re(o)){const i=fn(o,r),d=i!==-1;if(a&&!d)l(o.concat(r));else if(!a&&d){const m=[...o];m.splice(i,1),l(m)}}else if(Ft(o)){const i=new Set(o);a?i.add(r):i.delete(r),l(i)}else l(hr(e,a))})},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=fn(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 Ne={deep:!0,created(e,{value:t,modifiers:{number:s}},o){const r=Ft(t);kt(e,"change",()=>{const a=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?Is(us(l)):us(l));e[xt](e.multiple?r?new Set(a):a:a[0]),e._assigning=!0,Ro(()=>{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,a=e.options.length;r<a;r++){const l=e.options[r],i=us(l);if(s)if(o){const d=typeof i;d==="string"||d==="number"?l.selected=t.some(m=>String(m)===String(i)):l.selected=fn(t,i)>-1}else l.selected=t.has(i);else if(Ht(us(l),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 Vl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},tt=(e,t)=>{const s=e._withKeys||(e._withKeys={}),o=t.join(".");return s[o]||(s[o]=(r=>{if(!("key"in r))return;const a=St(r.key);if(t.some(l=>l===a||Vl[l]===a))return e(r)}))},Nl=Ee({patchProp:Ll},yl);let fo;function Bl(){return fo||(fo=Za(Nl))}const Fl=((...e)=>{const t=Bl().createApp(...e),{mount:s}=t;return t.mount=o=>{const r=Wl(o);if(!r)return;const a=t._component;!le(a)&&!a.render&&!a.template&&(a.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const l=s(r,!1,Hl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t});function Hl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wl(e){return Se(e)?document.querySelector(e):e}let Tn="";function qt(e){Tn=e}function de(){return Tn}async function pe(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${Tn}`,"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 Kl={class:"animate-fade-in"},zl={key:0,class:"text-center py-12 text-textSecondary"},Jl={key:1,class:"text-center text-textSecondary py-12"},ql={key:2,class:"space-y-3"},Yl={class:"flex items-center justify-between"},Gl={class:"flex items-center gap-3"},Xl={class:"font-medium"},Zl={class:"text-accentLight"},Ql={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=Re({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=_([]),o=_(!0);async function r(){o.value=!0;try{const m=await pe("/api/status");s.value=(m.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)??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 l(m){const f=Math.floor((Date.now()-m.lastActivity)/6e4);return m.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(m){if(!m.lastWaitCallAt)return"";const f=Math.floor((Date.now()-m.lastWaitCallAt)/6e4);return f<5?`Polling — ${f===0?"just now":f+"m ago"}`:`Last poll — ${f}m ago`}function d(m){return m.lastWaitCallAt?Math.floor((Date.now()-m.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return Oe(r),(m,f)=>(x(),v("div",Kl,[o.value&&a.value.length===0?(x(),v("div",zl,"Loading sessions...")):a.value.length===0?(x(),v("div",Jl,"No sessions")):(x(),v("div",ql,[(x(!0),v(Q,null,ce(a.value,p=>(x(),v("div",{key:p.mcpSessionId,class:q(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[n("div",Yl,[n("div",Gl,[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",Xl,[p.topicName?(x(),v(Q,{key:0},[n("span",Zl,y(p.topicName),1),n("span",Ql," (thread "+y(p.threadId)+")",1)],64)):p.threadId!=null?(x(),v(Q,{key:1},[Y("Thread "+y(p.threadId),1)],64)):(x(),v("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",l(p).color])},y(l(p).label),3),i(p)?(x(),v("span",{key:0,class:q(["text-xs ml-2",d(p)])},y(i(p)),3)):B("",!0)]),n("div",oi,y(p.transportType),1)])])],2))),128))]))]))}}),ai={class:"animate-fade-in"},li={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=Re({__name:"MemoryNotesTab",setup(e){const t=_([]),s=_(!1),o=_(""),r=_("created_at"),a=_("");let l=null;async function i(){s.value=!0;try{const f=a.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(){l&&clearTimeout(l),l=setTimeout(i,300)}function m(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 P=Math.floor(w/60);return P<24?`${P}h ago`:`${Math.floor(P/24)}d ago`}return Oe(i),(f,p)=>(x(),v("div",ai,[n("div",li,[z(n("input",{"onUpdate:modelValue":p[0]||(p[0]=w=>a.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),[[G,a.value]]),z(n("select",{"onUpdate:modelValue":p[1]||(p[1]=w=>o.value=w),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]=[We('<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),[[Ne,o.value]]),z(n("select",{"onUpdate:modelValue":p[2]||(p[2]=w=>r.value=w),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]=[n("option",{value:"created_at"},"Newest",-1),n("option",{value:"confidence"},"Confidence",-1),n("option",{value:"access_count"},"Most accessed",-1)])],544),[[Ne,r.value]])]),s.value?(x(),v("div",ii,"Loading notes...")):t.value.length===0?(x(),v("div",ui,"No notes found")):(x(),v("div",ci,[(x(!0),v(Q,null,ce(t.value,w=>(x(),v("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?(x(),v("span",mi,"HIGH IMPORTANCE")):w.priority===1?(x(),v("span",xi,"NOTABLE")):B("",!0),n("span",vi,y(w.noteId),1)]),n("p",gi,y(w.content),1),n("div",hi,[(x(!0),v(Q,null,ce(w.keywords||[],P=>(x(),v("span",{key:P,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(P),1))),128))])]),n("div",bi,[n("div",yi,y(((Number(w.confidence)||0)*100).toFixed(0))+"%",1),n("div",_i,y(m(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"},Mi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ii={class:"flex items-center gap-2"},Oi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Li={class:"mt-4"},ji=["innerHTML"],Ri={class:"glass rounded-xl p-6"},Ui={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Vi={class:"flex items-center gap-2"},Ni={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Wi=["value","placeholder"],Ki={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"},Xi={class:"font-mono text-sm text-textPrimary"},Zi={key:0,class:"mb-3"},Qi={class:"flex flex-wrap gap-2 mb-3"},eu=["onClick"],tu={class:"mt-4"},su=["innerHTML"],nu=Re({__name:"TemplatesTab",setup(e){function t(F){return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=_("copilot"),o=_(""),r=_(50),a=_(""),l=_(""),i=_(!0),d=_(""),m=_(!1),f=_({}),p=_("copilot"),w=_(""),P=_(""),E=_(!0),T=_(""),V=_(!1),$=_([]),S=_("");async function M(){await Promise.all([I(),X(),oe(),ne()])}async function I(){try{const F=await pe("/api/settings/agent-type");s.value=F.agentType||"copilot"}catch{}}async function X(){try{const F=await pe("/api/settings/bootstrap-message-count");r.value=F.count??50}catch{}}async function oe(){try{const F=await pe("/api/templates");if(F.templates&&F.templates.length>0){const U=F.templates[0];l.value=U.content||"",i.value=U.isDefault??!0}F.agentReminders&&(f.value=F.agentReminders)}catch{}}async function ne(){try{const[F,U,$e]=await Promise.all([pe("/api/templates/drive"),pe("/api/templates/drive-presets"),pe("/api/settings/dmn-activation-hours")]);$.value=U.presets||[],S.value=String($e.value??"not set"),F.custom?(P.value=F.custom,E.value=!1):(P.value=F.default||"",E.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(F){o.value="Error: "+F.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})}),a.value="Saved ✓",setTimeout(()=>{a.value=""},3e3)}catch(F){a.value="Error: "+F.message}}async function ee(){try{const F=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:l.value})});if(!F.ok)throw new Error(F.statusText);i.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(F){d.value="Error: "+F.message}}async function k(){if(confirm("Reset to default template? Your customizations will be lost."))try{const F=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!F.ok)throw new Error(F.statusText);await oe(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(F){d.value="Error: "+F.message}}async function h(){var $e;const F=p.value,U=(($e=f.value[F])==null?void 0:$e.content)??"";try{const ke=await fetch(`/api/templates/reminders-${F}`,{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[F]={content:U,isDefault:!1},w.value=`Saved ${F} ✓`,setTimeout(()=>{w.value=""},3e3)}catch(ke){w.value="Error: "+ke.message}}async function b(){const F=p.value;if(confirm(`Reset ${F} agent reminder? The custom template will be removed.`))try{const U=await fetch(`/api/templates/reminders-${F}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!U.ok)throw new Error(U.statusText);await oe(),w.value=`Reset ${F} ✓`,setTimeout(()=>{w.value=""},3e3)}catch(U){w.value="Error: "+U.message}}async function A(){const F=P.value;if(!F.trim()){T.value="Template is empty — load a preset first",setTimeout(()=>{T.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:F})});if(!U.ok)throw new Error(U.statusText);E.value=!1,T.value="Saved ✓",setTimeout(()=>{T.value=""},3e3)}catch(U){T.value="Error: "+U.message}}async function O(){if(confirm("Reset drive template? The custom template will be removed."))try{const F=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!F.ok)throw new Error(F.statusText);await ne(),T.value="Reset to default ✓",setTimeout(()=>{T.value=""},3e3)}catch(F){T.value="Error: "+F.message}}function K(F){P.value=F.content,E.value=!1}const ie=Te(()=>t(l.value)),te=Te(()=>P.value?t(P.value):'<span style="color:#6b7280">(no template loaded)</span>');return Oe(M),(F,U)=>{var $e,ke;return x(),v("div",$i,[n("div",Si,[n("div",Ci,[U[8]||(U[8]=n("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),z(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),[[Ne,s.value]]),o.value?(x(),v("span",Ti,y(o.value),1)):B("",!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)),z(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),[[G,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"),a.value?(x(),v("span",Ei,y(a.value),1)):B("",!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",Mi,[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",Ii,[d.value?(x(),v("span",Oi,y(d.value),1)):B("",!0),n("button",{onClick:k,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),n("button",{onClick:ee,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i.value?(x(),v("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)])])):B("",!0),z(n("textarea",{"onUpdate:modelValue":U[2]||(U[2]=ge=>l.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),[[G,l.value]]),n("div",Li,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:U[3]||(U[3]=ge=>m.value=!m.value)},[(x(),v("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",m.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))]),m.value?(x(),v("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)):B("",!0)]),U[16]||(U[16]=We('<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",Ri,[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",Vi,[w.value?(x(),v("span",Ni,y(w.value),1)):B("",!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,[(x(),v(Q,null,ce(["claude","copilot","codex"],ge=>n("button",{key:ge,onClick:ut=>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?(x(),v("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)])])):B("",!0),n("textarea",{value:((ke=f.value[p.value])==null?void 0:ke.content)??"",onInput:U[4]||(U[4]=ge=>{const ut=ge.target;f.value[p.value]={content:ut.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,Wi)]),n("div",Ki,[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,[T.value?(x(),v("span",qi,y(T.value),1)):B("",!0),n("button",{onClick:O,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),n("button",{onClick:A,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",Xi,y(S.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))]),E.value?(x(),v("div",Zi,[...U[23]||(U[23]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):B("",!0),n("div",Qi,[U[24]||(U[24]=n("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(x(!0),v(Q,null,ce($.value,ge=>(x(),v("button",{key:ge.key,onClick:ut=>K(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))]),z(n("textarea",{"onUpdate:modelValue":U[5]||(U[5]=ge=>P.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),[[G,P.value]]),n("div",tu,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:U[6]||(U[6]=ge=>V.value=!V.value)},[(x(),v("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",V.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))]),V.value?(x(),v("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:te.value},null,8,su)):B("",!0)]),U[27]||(U[27]=We('<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"},au={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},lu={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"},Mu=["title"],Iu={key:0,class:"glass rounded-xl p-6"},Ou={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Du={class:"text-lg font-semibold"},Lu={class:"text-sm text-textSecondary mt-1"},ju={class:"flex items-center gap-2"},Ru={key:0,class:"text-sm text-success"},Uu={key:1,class:"text-sm text-warn"},Vu={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Nu=["value"],Bu={class:"flex items-end"},Fu={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Hu=Re({__name:"SkillsTab",setup(e){const t=_([]),s=_(!0),o=_(null),r=_(""),a=_(""),l=_(!1),i=_(""),d=_(""),m=_(!1),f=_(""),p=_(""),w=_(!1),P=_(""),E=_([]),T=_(""),V=_("sensorium"),$=_("");async function S(){s.value=!0;try{const A=await pe("/api/skills");t.value=A.skills||[]}finally{s.value=!1}}async function M(){const A=await pe("/api/skills/imported");E.value=A.imported||[]}async function I(){const A=T.value.trim();if(!A){$.value="Path is required";return}try{const O=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({path:A,type:V.value})});if(!O.ok){const K=await O.json().catch(()=>({error:O.statusText}));throw new Error(K.error??O.statusText)}T.value="",$.value="Imported ✓",setTimeout(()=>{$.value=""},3e3),await M()}catch(O){$.value="Error: "+O.message}}async function X(A){try{const O=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({path:A})});if(!O.ok)throw new Error(O.statusText);await M()}catch(O){$.value="Error: "+O.message}}function oe(A){return A?A.includes(".remote-copilot-mcp")&&A.includes("skills")?"user":A.endsWith(".default.md")?"default":A.endsWith(".skill.md")?"project":"unknown":"unknown"}function ne(A){const O={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 O[A]||O.unknown}function ue(A){o.value=A,r.value=A.content,a.value=(A.triggers||[]).join(", "),l.value=!!A.replacesOrchestrator,m.value=!1}function ve(){o.value=null,d.value=""}function ee(A,O,K,ie){let te=`---
65
+ name: ${A}
66
66
  triggers:
67
- `;return I.forEach(B=>{ee+=` - ${B.trim()}
68
- `}),W&&(ee+=`replaces_orchestrator: true
69
- `),ee+=`---
67
+ `;return O.forEach(F=>{te+=` - ${F.trim()}
68
+ `}),K&&(te+=`replaces_orchestrator: true
69
+ `),te+=`---
70
70
 
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>
71
+ `,te+ie}async function k(){if(!o.value)return;const A=o.value.name;try{const O=a.value.split(",").map(F=>F.trim()).filter(Boolean),K=r.value;let ie;K.trimStart().startsWith("---")?ie=K:ie=ee(A,O,l.value,K);const te=await fetch(`/api/skills/${encodeURIComponent(A)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!te.ok)throw new Error(te.statusText);i.value="Saved ✓",setTimeout(()=>{i.value=""},3e3),await S()}catch(O){i.value="Error: "+O.message}}async function h(){if(!o.value)return;const A=o.value.name;try{const O=await fetch(`/api/skills/${encodeURIComponent(A)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!O.ok)throw new Error(O.statusText);ve(),await S()}catch(O){d.value="Error: "+O.message}}async function b(){const A=f.value.trim(),O=p.value;if(!A){P.value="Name is required";return}const K=O.split(",").map(te=>te.trim()).filter(Boolean);if(!K.length){P.value="At least one trigger is required";return}const ie=ee(A,K,w.value,`\x3C!-- Write your skill instructions here -->
72
+ `);try{const te=await fetch(`/api/skills/${encodeURIComponent(A)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ie})});if(!te.ok)throw new Error(te.statusText);P.value="Created ✓",m.value=!1,await S();const F=t.value.find(U=>U.name===A);F&&ue(F)}catch(te){P.value="Error: "+te.message}}return Oe(()=>{S(),M()}),(A,O)=>(x(),v("div",ou,[n("div",ru,[n("div",au,[O[10]||(O[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:O[0]||(O[0]=K=>{m.value=!m.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 ")]),m.value?(x(),v("div",lu,[O[14]||(O[14]=n("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),n("div",iu,[n("div",null,[O[11]||(O[11]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),z(n("input",{"onUpdate:modelValue":O[1]||(O[1]=K=>f.value=K),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),[[G,f.value]])]),n("div",null,[O[12]||(O[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),z(n("input",{"onUpdate:modelValue":O[2]||(O[2]=K=>p.value=K),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),[[G,p.value]])])]),n("div",uu,[n("label",cu,[z(n("input",{"onUpdate:modelValue":O[3]||(O[3]=K=>w.value=K),type:"checkbox",class:"rounded"},null,512),[[ln,w.value]]),O[13]||(O[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:O[4]||(O[4]=K=>m.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),P.value?(x(),v("span",fu,y(P.value),1)):B("",!0)])])):B("",!0),n("div",pu,[O[18]||(O[18]=n("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),O[19]||(O[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,[O[15]||(O[15]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),z(n("input",{"onUpdate:modelValue":O[5]||(O[5]=K=>T.value=K),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),[[G,T.value]])]),n("div",null,[O[17]||(O[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),z(n("select",{"onUpdate:modelValue":O[6]||(O[6]=K=>V.value=K),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...O[16]||(O[16]=[n("option",{value:"sensorium"},"Sensorium",-1),n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1)])],512),[[Ne,V.value]])])]),n("div",vu,[n("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),$.value?(x(),v("span",{key:0,class:q([$.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y($.value),3)):B("",!0)]),E.value.length?(x(),v("div",gu,[(x(!0),v(Q,null,ce(E.value,K=>(x(),v("div",{key:K.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:Mt(ne("user"))},y(K.type),5),n("span",{class:"text-xs font-mono text-textSecondary truncate",title:K.path},y(K.path),9,bu)]),n("button",{onClick:ie=>X(K.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))])):B("",!0)]),s.value?(x(),v("div",_u,"Loading...")):t.value.length===0?(x(),v("div",wu,"No skills loaded")):(x(),v("div",ku,[(x(!0),v(Q,null,ce(t.value,K=>{var ie;return x(),v("div",{key:K.name,onClick:te=>ue(K),class:q(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ie=o.value)==null?void 0:ie.name)===K.name?"border-accent":"border-transparent"])},[n("div",Su,[n("div",Cu,[n("div",Tu,[n("span",Pu,y(K.name),1),n("span",{class:"type-badge",style:Mt(ne(oe(K.source)))},y(oe(K.source)),5),K.replacesOrchestrator?(x(),v("span",Eu,"REPLACES ORCH")):B("",!0)]),n("div",Au,[(x(!0),v(Q,null,ce(K.triggers||[],te=>(x(),v("span",{key:te,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(te),1))),128))])]),n("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:K.source||""},y((K.source||"").split(/[\\/]/).pop()||""),9,Mu)])],10,$u)}),128))]))]),o.value?(x(),v("div",Iu,[n("div",Ou,[n("div",null,[n("h3",Du,"Edit: "+y(o.value.name),1),n("p",Lu,y(o.value.source||"(unknown source)"),1)]),n("div",ju,[i.value?(x(),v("span",Ru,y(i.value),1)):B("",!0),d.value?(x(),v("span",Uu,y(d.value),1)):B("",!0),oe(o.value.source)==="user"?(x(),v("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")):B("",!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:k,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Vu,[n("div",null,[O[20]||(O[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,Nu)]),n("div",null,[O[21]||(O[21]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),z(n("input",{"onUpdate:modelValue":O[7]||(O[7]=K=>a.value=K),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),[[G,a.value]])]),n("div",Bu,[n("label",Fu,[z(n("input",{"onUpdate:modelValue":O[8]||(O[8]=K=>l.value=K),type:"checkbox",class:"rounded"},null,512),[[ln,l.value]]),O[22]||(O[22]=n("span",null,"Replaces orchestrator",-1))])])]),z(n("textarea",{"onUpdate:modelValue":O[9]||(O[9]=K=>r.value=K),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),[[G,r.value]])])):B("",!0)]))}}),Wu={class:"animate-fade-in space-y-6"},Ku={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"],Xu={class:"flex justify-end"},Zu=["disabled"],Qu={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"},ac=["onBlur"],lc=["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"],Mc={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Ic={key:0,class:"text-xs text-muted py-1"},Oc={class:"text-sm font-medium"},Dc={class:"text-xs text-muted font-mono"},Lc=["value","onChange"],jc=["value"],Rc=["value"],Uc={class:"text-xs text-muted"},Vc=["onBlur","onKeyup"],Nc=["title","onDblclick"],Bc={class:"ml-auto flex items-center gap-3"},Fc=["onClick","disabled"],Hc=["onClick","disabled"],Wc=["onClick","disabled"],Kc={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"],Xc=["onClick"],Zc={key:4},Qc={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"],ad=["onClick","disabled"],ld=["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"},Md={class:"text-xs text-muted font-mono"},Id=["value","onChange"],Od=["value"],Dd=["value"],Ld={class:"text-xs text-muted"},jd=Re({__name:"ThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),a=_(new Set),l=_(!1),i=_({name:"",threadId:0,client:"claude",workingDirectory:""}),d=_(""),m=_(!1),f=_(null),p=_(""),w=_(null),P=_(""),E=_(null),T=_({name:"",threadId:0,client:"claude",workingDirectory:""}),V=_(""),$=_(!1),S=_(null),M=_(null),I=_(null),X=["claude","copilot","codex","fable"];function oe(H){return X.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=Te(()=>t.value.filter(H=>H.type==="root")),ve=Te(()=>t.value.filter(H=>H.type==="daily")),ee=Te(()=>t.value.filter(H=>H.type==="branch")),k=Te(()=>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 u=await pe(`/api/threads/${H}/children`);r.value[H]=u.threads??[]}catch{r.value[H]=[]}}function A(H){a.value.has(H)?a.value.delete(H):(a.value.add(H),b(H))}async function O(){if(!(!i.value.name.trim()||!i.value.threadId)){m.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: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(!H.ok){const u=await H.json().catch(()=>({error:H.statusText}));throw new Error(u.error??H.statusText)}d.value="Created ✓",i.value={name:"",threadId:0,client:"claude",workingDirectory:""},l.value=!1,setTimeout(()=>{d.value=""},3e3),await h()}catch(H){d.value="Error: "+H.message}finally{m.value=!1}}}async function K(H){if(!(!T.value.name.trim()||!T.value.threadId)){$.value=!0,V.value="";try{const u=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:T.value.threadId,name:T.value.name.trim(),type:"branch",rootThreadId:H,client:T.value.client,...T.value.workingDirectory.trim()?{workingDirectory:T.value.workingDirectory.trim()}:{}})});if(!u.ok){const c=await u.json().catch(()=>({error:u.statusText}));throw new Error(c.error??u.statusText)}V.value="Branch created ✓",T.value={name:"",threadId:0,client:"claude",workingDirectory:""},E.value=null,setTimeout(()=>{V.value=""},3e3),await h(),b(H)}catch(u){V.value="Error: "+u.message}finally{$.value=!1}}}function ie(H){f.value=H.threadId,p.value=H.name}async function te(H){const u=p.value.trim();if(f.value=null,!!u)try{const c=await fetch(`/api/threads/${H}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({name:u})});if(!c.ok)throw new Error(c.statusText);await h()}catch(c){o.value="Failed to rename thread: "+c.message}}function F(H){w.value=H.threadId,P.value=H.workingDirectory??""}async function U(H){const u=P.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:u||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 u=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!H.keepAlive})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to toggle keep-alive: "+u.message}}async function ke(H,u){try{const c=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({client:u})});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 u=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!H.dailyRotation})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to toggle daily rotation: "+u.message}}async function ut(H){try{const u=await fetch(`/api/threads/${H.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!H.autonomousMode})});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to toggle autonomous mode: "+u.message}}async function It(H){if(confirm(`Archive thread "${H.name}" (${H.threadId})?`))try{const u=await fetch(`/api/threads/${H.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!u.ok)throw new Error(u.statusText);await h()}catch(u){o.value="Failed to archive: "+u.message}}async function Ye(H){if(confirm(`Start thread "${H.name}" (${H.threadId})?`)){S.value=H.threadId;try{const u=await fetch(`/api/threads/${H.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!u.ok){const c=await u.json().catch(()=>({error:u.statusText}));throw new Error(c.error??u.statusText)}await h()}catch(u){o.value="Failed to start thread: "+u.message}finally{S.value=null}}}function yt(H){d.value="Sync to Root — not yet implemented",setTimeout(()=>{d.value=""},3e3)}async function Wt(H){if(confirm(`Convert "${H.name}" to a root thread? This will detach it from its parent.`)){I.value=H.threadId;try{const u=await fetch(`/api/threads/${H.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!u.ok){const c=await u.json().catch(()=>({error:u.statusText}));throw new Error(c.error??u.statusText)}o.value="",d.value=`Converted "${H.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await h()}catch(u){o.value="Failed to convert: "+u.message}finally{I.value=null}}}function _t(H){if(!H)return"—";const u=new Date(H),C=Date.now()-u.getTime();return C<6e4?"just now":C<36e5?`${Math.floor(C/6e4)}m ago`:C<864e5?`${Math.floor(C/36e5)}h ago`:u.toLocaleDateString()}function ze(H){return H==="active"?"text-success":H==="archived"?"text-muted":"text-warn"}return Oe(h),(H,u)=>(x(),v("div",Wu,[n("div",Ku,[n("div",zu,[u[18]||(u[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?(x(),v("span",{key:0,class:q([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(d.value),3)):B("",!0),n("button",{onClick:u[0]||(u[0]=c=>l.value=!l.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},y(l.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 ")])]),l.value?(x(),v("div",qu,[n("div",Yu,[n("div",null,[u[19]||(u[19]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),z(n("input",{"onUpdate:modelValue":u[1]||(u[1]=c=>i.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),[[G,i.value.name]])]),n("div",null,[u[20]||(u[20]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),z(n("input",{"onUpdate:modelValue":u[2]||(u[2]=c=>i.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),[[G,i.value.threadId,void 0,{number:!0}]])]),n("div",null,[u[21]||(u[21]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),z(n("select",{"onUpdate:modelValue":u[3]||(u[3]=c=>i.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"},[(x(),v(Q,null,ce(X,c=>n("option",{key:c,value:c},y(c),9,Gu)),64))],512),[[Ne,i.value.client]])])]),n("div",null,[u[22]||(u[22]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),z(n("input",{"onUpdate:modelValue":u[4]||(u[4]=c=>i.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),[[G,i.value.workingDirectory]])]),n("div",Xu,[n("button",{onClick:O,disabled:m.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"},y(m.value?"Creating…":"Create Root Thread"),9,Zu)])])):B("",!0)]),s.value&&t.value.length===0?(x(),v("div",Qu,"Loading threads…")):o.value?(x(),v("div",ec,y(o.value),1)):t.value.length===0?(x(),v("div",tc,"No threads registered")):B("",!0),ue.value.length>0?(x(),v("div",sc,[u[29]||(u[29]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),n("div",nc,[(x(!0),v(Q,null,ce(ue.value,c=>{var C,D;return x(),v("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",(C=ne[c.type])==null?void 0:C.classes])},y((D=ne[c.type])==null?void 0:D.emoji)+" "+y(c.type.toUpperCase()),3),f.value===c.threadId?z((x(),v("input",{key:0,"onUpdate:modelValue":u[5]||(u[5]=g=>p.value=g),onBlur:g=>te(c.threadId),onKeyup:[u[6]||(u[6]=tt(g=>g.target.blur(),["enter"])),u[7]||(u[7]=tt(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,ac)),[[G,p.value]]):(x(),v("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:g=>ie(c),title:"Double-click to rename"},y(c.name),41,lc)),n("span",{class:q(["text-xs font-medium",ze(c.status)])},y(c.status),3),n("span",ic,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:g=>ke(c,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"},[oe(c.client)?B("",!0):(x(),v("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,cc)),(x(),v(Q,null,ce(X,g=>n("option",{key:g,value:g},y(g),9,dc)),64))],40,uc),n("span",fc,y(_t(c.lastActiveAt)),1),w.value===c.threadId?z((x(),v("input",{key:2,"onUpdate:modelValue":u[8]||(u[8]=g=>P.value=g),onKeyup:[tt(g=>U(c.threadId),["enter"]),u[9]||(u[9]=tt(g=>w.value=null,["escape"]))],onBlur:g=>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)),[[G,P.value]]):(x(),v("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:g=>F(c)},"📁 "+y(c.workingDirectory??"—"),41,mc)),n("div",xc,[n("button",{onClick:g=>Ye(c),disabled:S.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(S.value===c.threadId?"Starting…":"▶ Start"),9,vc),n("div",gc,[n("button",{onClick:g=>$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),u[23]||(u[23]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",bc,[n("button",{onClick:g=>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),u[24]||(u[24]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",_c,[n("button",{onClick:g=>ut(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),u[25]||(u[25]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:g=>A(c.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},y(a.value.has(c.threadId)?"▾ Children":"▸ Children"),9,kc),n("button",{onClick:g=>{E.value=E.value===c.threadId?null:c.threadId,T.value={name:"",threadId:0,client:"claude",workingDirectory:""},V.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:g=>It(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)])]),E.value===c.threadId?(x(),v("div",Cc,[n("div",Tc,[z(n("input",{"onUpdate:modelValue":u[10]||(u[10]=g=>T.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),[[G,T.value.name]]),z(n("input",{"onUpdate:modelValue":u[11]||(u[11]=g=>T.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),[[G,T.value.threadId,void 0,{number:!0}]]),z(n("select",{"onUpdate:modelValue":u[12]||(u[12]=g=>T.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"},[(x(),v(Q,null,ce(X,g=>n("option",{key:g,value:g},y(g),9,Pc)),64))],512),[[Ne,T.value.client]])]),z(n("input",{"onUpdate:modelValue":u[13]||(u[13]=g=>T.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),[[G,T.value.workingDirectory]]),n("div",Ec,[n("button",{onClick:g=>K(c.threadId),disabled:$.value||!T.value.name.trim()||!T.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},y($.value?"Creating…":"Create Branch"),9,Ac),V.value?(x(),v("span",{key:0,class:q([V.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},y(V.value),3)):B("",!0)])])):B("",!0)]),a.value.has(c.threadId)&&r.value[c.threadId]?(x(),v("div",Mc,[r.value[c.threadId].length===0?(x(),v("div",Ic,"No children")):B("",!0),(x(!0),v(Q,null,ce(r.value[c.threadId],g=>{var L,W;return x(),v("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"},[n("span",{class:q(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(L=ne[g.type])==null?void 0:L.classes])},y((W=ne[g.type])==null?void 0:W.emoji)+" "+y(g.type.toUpperCase()),3),n("span",Oc,y(g.name),1),n("span",{class:q(["text-xs",ze(g.status)])},y(g.status),3),n("span",Dc,"ID: "+y(g.threadId),1),n("select",{value:g.client,onChange:R=>ke(g,R.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[oe(g.client)?B("",!0):(x(),v("option",{key:0,value:g.client,disabled:""},y(g.client)+" (legacy)",9,jc)),(x(),v(Q,null,ce(X,R=>n("option",{key:R,value:R},y(R),9,Rc)),64))],40,Lc),n("span",Uc,y(_t(g.lastActiveAt)),1),g.type==="branch"&&w.value===g.threadId?z((x(),v("input",{key:0,"onUpdate:modelValue":u[14]||(u[14]=R=>P.value=R),onBlur:R=>U(g.threadId),onKeyup:[tt(R=>U(g.threadId),["enter"]),u[15]||(u[15]=tt(R=>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,Vc)),[[G,P.value]]):g.type==="branch"?(x(),v("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:R=>F(g)},"📁 "+y(g.workingDirectory??"—"),41,Nc)):B("",!0),n("div",Bc,[n("button",{onClick:R=>Ye(g),disabled:S.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"},y(S.value===g.threadId?"Starting…":"▶ Start"),9,Fc),g.rootThreadId?(x(),v("button",{key:0,onClick:R=>yt(),disabled:M.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"},y(M.value===g.threadId?"Syncing…":"⟳ Sync to Root"),9,Hc)):B("",!0),g.type==="branch"||g.type==="daily"?(x(),v("button",{key:1,onClick:R=>Wt(g),disabled:I.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"},y(I.value===g.threadId?"Converting…":"↑ To Root"),9,Wc)):B("",!0),g.type==="branch"?(x(),v("div",Kc,[n("button",{onClick:R=>$e(g),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",g.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",g.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,zc),u[26]||(u[26]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):B("",!0),g.type==="branch"?(x(),v("div",Jc,[n("button",{onClick:R=>ge(g),class:q(["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"},[n("span",{class:q(["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,qc),u[27]||(u[27]=n("span",{class:"text-xs text-muted"},"Daily",-1))])):B("",!0),g.type==="branch"?(x(),v("div",Yc,[n("button",{onClick:R=>ut(g),class:q(["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"},[n("span",{class:q(["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,Gc),u[28]||(u[28]=n("span",{class:"text-xs text-muted"},"Auto",-1))])):B("",!0),g.type!=="root"?(x(),v("button",{key:5,onClick:R=>It(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,Xc)):B("",!0)])])}),128))])):B("",!0)])}),128))])])):B("",!0),ve.value.length>0?(x(),v("div",Zc,[u[30]||(u[30]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),n("div",Qc,[(x(!0),v(Q,null,ce(ve.value,c=>{var C,D;return x(),v("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",(C=ne[c.type])==null?void 0:C.classes])},y((D=ne[c.type])==null?void 0:D.emoji)+" "+y(c.type.toUpperCase()),3),n("span",ed,y(c.name),1),n("span",{class:q(["text-xs font-medium",ze(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:g=>Ye(c),disabled:S.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(S.value===c.threadId?"Starting…":"▶ Start"),9,rd),c.rootThreadId?(x(),v("button",{key:0,onClick:g=>yt(),disabled:M.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(M.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,ad)):B("",!0),n("button",{onClick:g=>It(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,ld)])])}),128))])])):B("",!0),ee.value.length>0?(x(),v("div",id,[u[34]||(u[34]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),n("div",ud,[(x(!0),v(Q,null,ce(ee.value,c=>{var C,D;return x(),v("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",(C=ne[c.type])==null?void 0:C.classes])},y((D=ne[c.type])==null?void 0:D.emoji)+" "+y(c.type.toUpperCase()),3),n("span",cd,y(c.name),1),n("span",{class:q(["text-xs font-medium",ze(c.status)])},y(c.status),3),n("span",dd,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:g=>ke(c,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"},[oe(c.client)?B("",!0):(x(),v("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,pd)),(x(),v(Q,null,ce(X,g=>n("option",{key:g,value:g},y(g),9,md)),64))],40,fd),n("span",xd,y(_t(c.lastActiveAt)),1),w.value===c.threadId?z((x(),v("input",{key:0,"onUpdate:modelValue":u[16]||(u[16]=g=>P.value=g),onBlur:g=>U(c.threadId),onKeyup:[tt(g=>U(c.threadId),["enter"]),u[17]||(u[17]=tt(g=>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)),[[G,P.value]]):(x(),v("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:g=>F(c)},"📁 "+y(c.workingDirectory??"—"),41,gd)),n("div",hd,[n("button",{onClick:g=>Ye(c),disabled:S.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(S.value===c.threadId?"Starting…":"▶ Start"),9,bd),c.rootThreadId?(x(),v("button",{key:0,onClick:g=>yt(),disabled:M.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(M.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,yd)):B("",!0),n("div",_d,[n("button",{onClick:g=>$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),u[31]||(u[31]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",kd,[n("button",{onClick:g=>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),u[32]||(u[32]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",Sd,[n("button",{onClick:g=>ut(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),u[33]||(u[33]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:g=>It(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))])])):B("",!0),k.value.length>0?(x(),v("div",Pd,[u[36]||(u[36]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),n("div",Ed,[(x(!0),v(Q,null,ce(k.value,c=>{var C,D;return x(),v("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",(C=ne[c.type])==null?void 0:C.classes])},y((D=ne[c.type])==null?void 0:D.emoji)+" "+y(c.type.toUpperCase()),3),n("span",Ad,y(c.name),1),n("span",{class:q(["text-xs font-medium",ze(c.status)])},y(c.status),3),n("span",Md,"ID: "+y(c.threadId),1),n("select",{value:c.client,onChange:g=>ke(c,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"},[oe(c.client)?B("",!0):(x(),v("option",{key:0,value:c.client,disabled:""},y(c.client)+" (legacy)",9,Od)),(x(),v(Q,null,ce(X,g=>n("option",{key:g,value:g},y(g),9,Dd)),64))],40,Id),n("span",Ld,y(_t(c.lastActiveAt)),1),u[35]||(u[35]=n("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):B("",!0)]))}}),Rd={class:"animate-fade-in"},Ud={class:"glass rounded-xl p-6 mb-6"},Vd={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Nd={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"},Wd={key:3,class:"space-y-2"},Kd={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"}},Xd={class:"text-xs text-muted font-mono truncate"},Zd={class:"flex items-center gap-2 shrink-0"},Qd=["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"],af={class:"mb-4"},lf={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=Re({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],s=_([]),o=_(!0),r=_(""),a=_(""),l=_(!0),i=_(!1),d=_(null),m=_(null),f=_(!1),p=_(null),w=_(""),P=_("claude"),E=_(""),T=_(""),V=_(""),$=_("");async function S(){o.value=!0,r.value="";try{const k=await pe("/api/agent-templates");s.value=k.templates||[]}catch(k){r.value="Failed to load templates: "+k.message}finally{o.value=!1}}function M(){p.value=null,w.value="",P.value="claude",E.value="",T.value="",V.value="",$.value="",f.value=!0}function I(k){p.value=k.id,w.value=k.name,P.value=k.client,E.value=k.workingDirectory,T.value=k.systemPrompt||"",V.value=k.mcpServers&&Object.keys(k.mcpServers).length?JSON.stringify(k.mcpServers,null,2):"",$.value="",f.value=!0}function X(){f.value=!1,p.value=null}function oe(){$.value="";const k=w.value.trim(),h=E.value.trim();if(!k)return $.value="Name is required",null;if(!h)return $.value="Working directory is required",null;let b={};const A=V.value.trim();if(A){try{b=JSON.parse(A)}catch{return $.value="MCP servers must be valid JSON",null}if(typeof b!="object"||b===null||Array.isArray(b))return $.value="MCP servers must be a JSON object",null}return{name:k,client:P.value,workingDirectory:h,systemPrompt:T.value.trim()||null,mcpServers:b}}async function ne(){if(i.value)return;const k=oe();if(k){i.value=!0;try{const h=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",b=p.value?"PATCH":"POST",A=await fetch(h,{method:b,headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify(k)});if(!A.ok){const O=await A.json().catch(()=>({}));throw new Error(O.error||A.statusText)}ee("Saved ✓",!0),X(),await S()}catch(h){$.value="Error: "+h.message}finally{i.value=!1}}}async function ue(k){if(!d.value){d.value=k.id;try{const h=await fetch(`/api/agent-templates/${k.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok){const A=await h.json().catch(()=>({}));throw new Error(A.error||h.statusText)}const b=await h.json();ee(`Started thread ${b.threadId} ✓`,!0)}catch(h){ee("Error: "+h.message,!1)}finally{d.value=null}}}async function ve(k){if(confirm(`Delete template "${k.name}"?`)&&!m.value){m.value=k.id;try{const h=await fetch(`/api/agent-templates/${k.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok)throw new Error(h.statusText);ee("Deleted ✓",!0),await S()}catch(h){ee("Error: "+h.message,!1)}finally{m.value=null}}}function ee(k,h){a.value=k,l.value=h,setTimeout(()=>{a.value=""},3e3)}return Oe(S),(k,h)=>(x(),v("div",Rd,[n("div",Ud,[n("div",Vd,[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",Nd,[a.value?(x(),v("span",{key:0,class:q(["text-sm",l.value?"text-success":"text-danger"])},y(a.value),3)):B("",!0),n("button",{onClick:M,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Template ")])]),o.value?(x(),v("div",Bd,"Loading...")):r.value?(x(),v("div",Fd,y(r.value),1)):s.value.length===0?(x(),v("div",Hd,"No agent templates yet")):(x(),v("div",Wd,[(x(!0),v(Q,null,ce(s.value,b=>(x(),v("div",{key:b.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Kd,[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?(x(),v("span",Gd,y(Object.keys(b.mcpServers).length)+" mcp",1)):B("",!0)]),n("div",Xd,y(b.workingDirectory),1)]),n("div",Zd,[n("button",{onClick:A=>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,Qd),n("button",{onClick:A=>I(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:A=>ve(b),disabled:m.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(m.value===b.id?"…":"Delete"),9,tf)])])]))),128))]))]),f.value?(x(),v("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)),z(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),[[G,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)),z(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"},[(x(),v(Q,null,ce(t,b=>n("option",{key:b,value:b},y(b),9,rf)),64))],512),[[Ne,P.value]])])]),n("div",af,[h[8]||(h[8]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("Working Directory "),n("span",{class:"text-danger"},"*")],-1)),z(n("input",{"onUpdate:modelValue":h[2]||(h[2]=b=>E.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),[[G,E.value]])]),n("div",lf,[h[9]||(h[9]=n("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),z(n("textarea",{"onUpdate:modelValue":h[3]||(h[3]=b=>T.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),[[G,T.value]])]),n("div",uf,[h[10]||(h[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),z(n("textarea",{"onUpdate:modelValue":h[4]||(h[4]=b=>V.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),[[G,V.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:i.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(i.value?"Saving…":p.value?"Save Changes":"Create Template"),9,df),n("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 "),$.value?(x(),v("span",ff,y($.value),1)):B("",!0)])])):B("",!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"},Mf=["onClick"],If=["onClick","disabled"],Of={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Df={class:"text-lg font-semibold mb-4"},Lf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},jf=["readonly"],Rf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Uf={class:"mb-4"},Vf={class:"flex items-center justify-between mb-2"},Nf=["onUpdate:modelValue"],Bf=["onUpdate:modelValue"],Ff=["onClick"],Hf={key:0,class:"text-xs text-muted italic"},Wf={class:"mb-4"},Kf={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"},Xf={class:"flex items-center gap-3 flex-wrap"},Zf=["disabled"],Qf={key:0,class:"text-sm text-danger"},Yt="sensorium-mcp",ep=Re({__name:"McpServersTab",setup(e){const t=_({}),s=_(!0),o=_(""),r=_(""),a=_(!0),l=_(!1),i=_(null),d=_(!1),m=_(null),f=_(""),p=_("stdio"),w=_(""),P=_(""),E=_(""),T=_([]),V=_([]),$=_(""),S=Te(()=>Object.entries(t.value).filter(([k])=>k!==Yt));async function M(){s.value=!0,o.value="";try{const k=await pe("/api/mcp-servers");t.value=k.servers||{}}catch(k){o.value="Failed to load MCP servers: "+k.message}finally{s.value=!1}}function I(k){return k==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function X(){m.value=null,f.value="",p.value="stdio",w.value="",P.value="",E.value="",T.value=[],V.value=[],$.value="",d.value=!0}function oe(k,h){m.value=k,f.value=k,p.value=h.type,w.value=h.command||"",P.value=(h.args||[]).join(" "),E.value=h.url||"",T.value=Object.entries(h.env||{}).map(([b,A])=>({k:b,v:A})),V.value=Object.entries(h.headers||{}).map(([b,A])=>({k:b,v:A})),$.value="",d.value=!0}function ne(){d.value=!1,m.value=null}function ue(){if($.value="",!f.value.trim())return $.value="Name is required",!1;if(p.value==="stdio"&&!w.value.trim())return $.value="Command is required for stdio type",!1;if(p.value==="http"){const k=E.value.trim();if(!k)return $.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(k))return $.value="URL must start with http:// or https://",!1}return!0}async function ve(){if(!ue()||l.value)return;l.value=!0;const k=f.value.trim(),h={type:p.value};if(p.value==="stdio"){h.command=w.value.trim();const b=P.value.trim();b&&(h.args=b.split(/\s+/));const A=Object.fromEntries(T.value.filter(O=>O.k.trim()).map(O=>[O.k.trim(),O.v]));Object.keys(A).length&&(h.env=A)}else{h.url=E.value.trim();const b=Object.fromEntries(V.value.filter(A=>A.k.trim()).map(A=>[A.k.trim(),A.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:k,config:h})});if(!b.ok)throw new Error(b.statusText);r.value="Saved ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),ne(),await M()}catch(b){$.value="Error: "+b.message}finally{l.value=!1}}async function ee(k){if(confirm(`Delete MCP server "${k}"?`)&&!i.value){i.value=k;try{const h=await fetch(`/api/mcp-servers/${encodeURIComponent(k)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!h.ok)throw new Error(h.statusText);r.value="Deleted ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await M()}catch(h){r.value="Error: "+h.message,a.value=!1}finally{i.value=null}}}return Oe(M),(k,h)=>(x(),v("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?(x(),v("span",{key:0,class:q(["text-sm",a.value?"text-success":"text-danger"])},y(r.value),3)):B("",!0),n("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(x(),v("div",hf,"Loading...")):o.value?(x(),v("div",bf,y(o.value),1)):Object.keys(t.value).length===0?(x(),v("div",yf,"No MCP servers configured")):(x(),v("div",_f,[t.value[Yt]?(x(),v("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:Mt(I(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))])])):B("",!0),(x(!0),v(Q,null,ce(S.value,([b,A])=>{var O;return x(),v("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:Mt(I(A.type))},y(A.type),5)]),n("div",Ef,[A.type==="stdio"?(x(),v(Q,{key:0},[Y(y(A.command)+y((O=A.args)!=null&&O.length?" "+A.args.join(" "):""),1)],64)):(x(),v(Q,{key:1},[Y(y(A.url),1)],64))])]),n("div",Af,[n("button",{onClick:K=>oe(b,A),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,Mf),n("button",{onClick:K=>ee(b),disabled:i.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(i.value===b?"…":"Delete"),9,If)])])])}),128))]))]),d.value?(x(),v("div",Of,[n("h3",Df,y(m.value?`Edit: ${m.value}`:"Add MCP Server"),1),n("div",Lf,[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)),z(n("input",{"onUpdate:modelValue":h[0]||(h[0]=b=>f.value=b),type:"text",readonly:!!m.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",m.value?"opacity-60 cursor-not-allowed":""])},null,10,jf),[[G,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)),z(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),[[Ne,p.value]])])]),p.value==="stdio"?(x(),v(Q,{key:0},[n("div",Rf,[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)),z(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),[[G,w.value]])]),n("div",null,[h[14]||(h[14]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),z(n("input",{"onUpdate:modelValue":h[3]||(h[3]=b=>P.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),[[G,P.value]])])]),n("div",Uf,[n("div",Vf,[h[15]||(h[15]=n("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),n("button",{onClick:h[4]||(h[4]=b=>T.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(Q,null,ce(T.value,(b,A)=>(x(),v("div",{key:A,class:"flex items-center gap-2 mb-2"},[z(n("input",{"onUpdate:modelValue":O=>b.k=O,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,Nf),[[G,b.k]]),h[16]||(h[16]=n("span",{class:"text-muted text-xs"},"=",-1)),z(n("input",{"onUpdate:modelValue":O=>b.v=O,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),[[G,b.v]]),n("button",{onClick:O=>T.value.splice(A,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Ff)]))),128)),T.value.length===0?(x(),v("div",Hf,"No env vars")):B("",!0)])],64)):(x(),v(Q,{key:1},[n("div",Wf,[h[17]||(h[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Y("URL "),n("span",{class:"text-danger"},"*")],-1)),z(n("input",{"onUpdate:modelValue":h[5]||(h[5]=b=>E.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),[[G,E.value]])]),n("div",Kf,[n("div",zf,[h[18]||(h[18]=n("label",{class:"text-xs text-textSecondary"},"Headers",-1)),n("button",{onClick:h[6]||(h[6]=b=>V.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(Q,null,ce(V.value,(b,A)=>(x(),v("div",{key:A,class:"flex items-center gap-2 mb-2"},[z(n("input",{"onUpdate:modelValue":O=>b.k=O,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),[[G,b.k]]),h[19]||(h[19]=n("span",{class:"text-muted text-xs"},":",-1)),z(n("input",{"onUpdate:modelValue":O=>b.v=O,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),[[G,b.v]]),n("button",{onClick:O=>V.value.splice(A,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Yf)]))),128)),V.value.length===0?(x(),v("div",Gf,"No headers")):B("",!0)])],64)),n("div",Xf,[n("button",{onClick:ve,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"},y(l.value?"Saving…":m.value?"Save Changes":"Add Server"),9,Zf),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 "),$.value?(x(),v("span",Qf,y($.value),1)):B("",!0)])])):B("",!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"],ap={key:0,class:"text-center py-8 text-textSecondary text-sm"},lp={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={class:"flex items-center gap-2 text-xs text-textSecondary cursor-pointer"},mp=["onUpdate:modelValue"],xp=["onUpdate:modelValue"],vp=["onClick"],gp=Re({__name:"PromptsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_(""),a=_(!0),l=_(!1);async function i(){s.value=!0,o.value="";try{const p=await pe("/api/prompts");t.value=(p.prompts||[]).map(w=>({label:w.label,text:w.text,isStartup:w.isStartup===!0}))}catch(p){o.value="Failed to load prompts: "+p.message}finally{s.value=!1}}function d(){t.value.push({label:"",text:"",isStartup:!1})}function m(p){t.value.splice(p,1)}async function f(){if(l.value)return;l.value=!0,r.value="";const p=t.value.map(w=>({label:w.label.trim(),text:w.text.trim(),isStartup:w.isStartup})).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 ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await i()}catch(w){r.value="Error: "+w.message,a.value=!1}finally{l.value=!1}}return Oe(i),(p,w)=>(x(),v("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?(x(),v("span",{key:0,class:q(["text-sm",a.value?"text-success":"text-danger"])},y(r.value),3)):B("",!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:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(l.value?"Saving…":"Save"),9,rp)])]),s.value?(x(),v("div",ap,"Loading...")):o.value?(x(),v("div",lp,y(o.value),1)):t.value.length===0?(x(),v("div",ip," No prompts yet — click “+ Add Prompt” to create one. ")):(x(),v("div",up,[(x(!0),v(Q,null,ce(t.value,(P,E)=>(x(),v("div",{key:E,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)),z(n("input",{"onUpdate:modelValue":T=>P.label=T,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),[[G,P.label]])]),n("label",pp,[z(n("input",{"onUpdate:modelValue":T=>P.isStartup=T,type:"checkbox",class:"accent-accent"},null,8,mp),[[ln,P.isStartup]]),w[2]||(w[2]=Y(" Show this prompt when a root session starts ",-1))]),n("div",null,[w[3]||(w[3]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Prompt text (≤4000 chars)",-1)),z(n("textarea",{"onUpdate:modelValue":T=>P.text=T,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,xp),[[G,P.text]])])]),n("button",{onClick:T=>m(E),class:"text-muted hover:text-danger transition text-sm px-2 pt-6 shrink-0",title:"Remove prompt"},"✕",8,vp)])]))),128))]))])]))}}),hp={class:"animate-fade-in"},bp={class:"glass rounded-xl p-6 mb-6"},yp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},_p={class:"flex items-center gap-3"},wp=["disabled"],kp={key:0,class:"text-center py-8 text-textSecondary text-sm"},$p={key:1,class:"space-y-6"},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:"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"},Ip=["aria-checked"],Op={class:"glass rounded-xl p-4 border border-gray-700/50"},Dp={class:"text-xs text-textSecondary mb-3"},Lp={class:"flex items-center gap-2"},jp=["placeholder"],Rp=["disabled"],Up={class:"glass rounded-xl p-4 border border-gray-700/50"},Vp={key:0,class:"space-y-2 mb-4"},Np=["value"],Bp=["value"],Fp={class:"flex items-center justify-between mb-2"},Hp=["onUpdate:modelValue"],Wp=["onUpdate:modelValue"],Kp=["onClick"],zp={key:1,class:"text-xs text-muted italic"},Jp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},qp={class:"grid grid-cols-2 gap-4"},Yp={class:"text-sm font-medium font-mono text-textSecondary"},Gp={class:"text-sm font-medium font-mono text-textSecondary"},Xp={class:"mt-3"},Zp=Re({__name:"ClaudeTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_("claude-opus-4-6"),a=_("claude-opus-4-6"),l=_("claude-sonnet-4-5"),i=_("claude-sonnet-4-5"),d=_(!1),m=_(""),f=_(""),p=_(""),w=_(""),P=_(20),E=_(20),T=_(""),V=_(!1),$=_(!1),S=_(!1),M=_([]),I=_([]),X=_("{}");function oe(){const h={};for(const b of I.value){const A=b.k.trim();A&&(h[A]=b.v)}return h}const ne=Te(()=>r.value!==a.value||l.value!==i.value||m.value!==f.value||p.value!==w.value||P.value!==E.value||T.value.length>0||$.value!==S.value||JSON.stringify(oe())!==X.value);function ue(h){M.value=h.filter(b=>b.locked),I.value=h.filter(b=>!b.locked).map(b=>({k:b.key,v:b.value})),X.value=JSON.stringify(oe())}async function ve(){t.value=!0;try{const[h,b,A]=await Promise.all([pe("/api/settings/default-thread-model"),pe("/api/settings/default-worker-model"),pe("/api/settings/claude")]);r.value=h.defaultThreadModel,a.value=h.defaultThreadModel,l.value=b.defaultWorkerModel,i.value=b.defaultWorkerModel,m.value=A.cliPath,f.value=A.cliPath,p.value=A.gitBashPath,w.value=A.gitBashPath,P.value=A.maxConcurrentThreads,E.value=A.maxConcurrentThreads,V.value=A.oauthTokenSet,T.value="",$.value=A.autoMemoryEnabled,S.value=A.autoMemoryEnabled,ue(A.env??[])}finally{t.value=!1}}async function ee(){if(s.value=!0,o.value="",!r.value){o.value="Error: Thread model cannot be empty",s.value=!1;return}if(!l.value){o.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite(P.value)||P.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:m.value,gitBashPath:p.value,maxConcurrentThreads:P.value,autoMemoryEnabled:$.value,customEnvVars:oe()};T.value.length>0&&(b.oauthToken=T.value);const[A,O,K]=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(b)})]);for(const U of[A,O,K])if(!U.ok){const $e=await U.json().catch(()=>({error:U.statusText}));throw new Error($e.error??U.statusText)}const ie=await A.json(),te=await O.json(),F=await K.json();a.value=ie.defaultThreadModel,r.value=ie.defaultThreadModel,i.value=te.defaultWorkerModel,l.value=te.defaultWorkerModel,m.value=F.cliPath,f.value=F.cliPath,p.value=F.gitBashPath,w.value=F.gitBashPath,P.value=F.maxConcurrentThreads,E.value=F.maxConcurrentThreads,V.value=F.oauthTokenSet,T.value="",$.value=F.autoMemoryEnabled,S.value=F.autoMemoryEnabled,ue(F.env??[]),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{s.value=!1}}async function k(){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 O=await b.json().catch(()=>({error:b.statusText}));throw new Error(O.error??b.statusText)}const A=await b.json();V.value=A.oauthTokenSet,T.value="",ue(A.env??[]),o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(h){o.value="Error: "+h.message}finally{d.value=!1}}return Oe(ve),(h,b)=>(x(),v("div",hp,[n("div",bp,[n("div",yp,[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",_p,[o.value?(x(),v("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):B("",!0),n("button",{onClick:ee,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,wp)])]),t.value?(x(),v("div",kp,"Loading…")):(x(),v("div",$p,[n("div",Sp,[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)),z(n("input",{"onUpdate:modelValue":b[0]||(b[0]=A=>r.value=A),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),[[G,r.value,void 0,{trim:!0}]])]),n("div",Cp,[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)),z(n("input",{"onUpdate:modelValue":b[1]||(b[1]=A=>l.value=A),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),[[G,l.value,void 0,{trim:!0}]])]),n("div",Tp,[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)),z(n("input",{"onUpdate:modelValue":b[2]||(b[2]=A=>m.value=A),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),[[G,m.value,void 0,{trim:!0}]])]),n("div",Pp,[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)),z(n("input",{"onUpdate:modelValue":b[3]||(b[3]=A=>p.value=A),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),[[G,p.value,void 0,{trim:!0}]])]),n("div",Ep,[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)),z(n("input",{"onUpdate:modelValue":b[4]||(b[4]=A=>P.value=A),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),[[G,P.value,void 0,{number:!0}]])]),n("div",Ap,[n("div",Mp,[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":$.value,onClick:b[5]||(b[5]=A=>$.value=!$.value),class:q([$.value?"bg-accent":"bg-gray-700","relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition"])},[n("span",{class:q([$.value?"translate-x-6":"translate-x-1","inline-block h-4 w-4 rounded-full bg-white transition"])},null,2)],10,Ip)])]),n("div",Op,[b[23]||(b[23]=n("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),n("p",Dp,[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(V.value?"text-success":"text-muted")},y(V.value?"A token is currently stored.":"No token stored."),3)]),n("div",Lp,[z(n("input",{"onUpdate:modelValue":b[6]||(b[6]=A=>T.value=A),type:"password",placeholder:V.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),[[G,T.value]]),V.value?(x(),v("button",{key:0,onClick:k,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)):B("",!0)])]),n("div",Up,[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)),M.value.length?(x(),v("div",Vp,[(x(!0),v(Q,null,ce(M.value,A=>(x(),v("div",{key:A.key,class:"flex items-center gap-2"},[n("input",{value:A.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,Np),b[24]||(b[24]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:A.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,Bp),b[25]||(b[25]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):B("",!0),n("div",Fp,[b[26]||(b[26]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:b[7]||(b[7]=A=>I.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(Q,null,ce(I.value,(A,O)=>(x(),v("div",{key:O,class:"flex items-center gap-2 mb-2"},[z(n("input",{"onUpdate:modelValue":K=>A.k=K,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,Hp),[[G,A.k]]),b[27]||(b[27]=n("span",{class:"text-muted text-xs"},"=",-1)),z(n("input",{"onUpdate:modelValue":K=>A.v=K,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),[[G,A.v]]),n("button",{onClick:K=>I.value.splice(O,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Kp)]))),128)),I.value.length===0?(x(),v("div",zp,"No additional variables")):B("",!0)]),n("div",Jp,[b[32]||(b[32]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",qp,[n("div",null,[b[30]||(b[30]=n("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),n("span",Yp,y(a.value),1)]),n("div",null,[b[31]||(b[31]=n("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),n("span",Gp,y(i.value),1)])]),n("div",Xp,[n("span",{class:q(["text-sm font-medium",ne.value?"text-warn":"text-textSecondary"])},y(ne.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Qp={class:"animate-fade-in"},em={class:"glass rounded-xl p-6 mb-6"},tm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},sm={class:"flex items-center gap-3"},nm=["disabled"],om={key:0,class:"text-center py-8 text-textSecondary text-sm"},rm={key:1,class:"space-y-6"},am={class:"glass rounded-xl p-4 border border-gray-700/50"},lm={id:"copilot-models"},im=["value"],um={key:0,class:"text-xs text-success mt-2"},cm={class:"grid grid-cols-2 gap-3 mt-4"},dm={class:"glass rounded-xl p-4 border border-gray-700/50"},fm={class:"flex items-center justify-between"},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=["disabled"],gm={class:"glass rounded-xl p-4 border border-gray-700/50"},hm={class:"text-xs text-textSecondary mb-3"},bm={key:0,class:"text-success"},ym={key:1,class:"text-warn"},_m=["disabled","placeholder"],wm={class:"glass rounded-xl p-4 border border-gray-700/50"},km={key:0,class:"mt-4 space-y-4"},$m={class:"text-xs text-textSecondary mb-2"},Sm=["disabled"],Cm={class:"text-xs text-textSecondary mb-2"},Tm=["disabled"],Pm={class:"glass rounded-xl p-4 border border-gray-700/50"},Em={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"},Im={class:"glass rounded-xl p-4 border border-gray-700/50"},Om={key:0,class:"space-y-2 mb-4"},Dm=["value"],Lm=["value"],jm={class:"flex items-center justify-between mb-2"},Rm=["onUpdate:modelValue"],Um=["onUpdate:modelValue"],Vm=["onClick"],Nm={key:1,class:"text-xs text-muted italic"},Bm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Fm={class:"grid grid-cols-2 gap-4"},Hm={class:"text-sm font-medium font-mono text-textSecondary"},Wm=Re({__name:"CopilotTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(""),a=_("high"),l=_("long_context"),i=_(!1),d=_("openai"),m=_(""),f=_(""),p=_(""),w=_(""),P=_(!1),E=_(!1),T=_(!1),V=_(""),$=_([]),S=_([]),M=_([]);function I(){const ee={};for(const k of M.value){const h=k.k.trim();h&&(ee[h]=k.v)}return ee}async function X(){t.value=!0;try{const ee=await pe("/api/settings/copilot");oe(ee),i.value&&P.value&&ve(!0)}finally{t.value=!1}}function oe(ee){r.value=ee.model,a.value=ee.effortLevel,l.value=ee.contextTier,i.value=ee.byok.enabled,d.value=ee.byok.providerType,m.value=ee.byok.baseUrl,f.value=ee.byok.modelId,p.value=ee.byok.wireModel,P.value=ee.byok.apiKeySet,w.value="";const k=ee.env??[];S.value=k.filter(h=>h.locked),M.value=k.filter(h=>!h.locked).map(h=>({k:h.key,v:h.value}))}const ne=Te(()=>!(!r.value.trim()||i.value&&(!m.value.trim()||!P.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 ee={enabled:i.value,providerType:d.value,baseUrl:m.value.trim(),modelId:f.value.trim(),wireModel:p.value.trim()};w.value.trim()&&(ee.apiKey=w.value.trim());const k={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},h=await fetch("/api/settings/copilot",{method:"POST",headers:k,body:JSON.stringify({model:r.value.trim(),effortLevel:a.value,contextTier:l.value,byok:ee,customEnvVars:I()})});if(!h.ok){const A=await h.json().catch(()=>({error:h.statusText}));throw new Error(A.error??h.statusText)}const b=await h.json();oe(b),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(ee){o.value="Error: "+ee.message}finally{s.value=!1}}async function ve(ee=!1){T.value=!0,V.value="",$.value=[];try{const k={baseUrl:m.value.trim(),providerType:d.value};w.value.trim()&&(k.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(k)}),b=await h.json();if(!h.ok||!b.ok)throw new Error(b.error??h.statusText);$.value=b.models??[],V.value=`OK — ${b.count??$.value.length} models`}catch(k){ee||(V.value="Error: "+k.message)}finally{T.value=!1}}return Oe(X),(ee,k)=>(x(),v("div",Qp,[n("div",em,[n("div",tm,[k[12]||(k[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",sm,[o.value?(x(),v("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):B("",!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,nm)])]),t.value?(x(),v("div",om,"Loading…")):(x(),v("div",rm,[n("div",am,[k[17]||(k[17]=n("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),k[18]||(k[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)),z(n("input",{"onUpdate:modelValue":k[0]||(k[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),[[G,r.value,void 0,{trim:!0}]]),n("datalist",lm,[(x(!0),v(Q,null,ce($.value,h=>(x(),v("option",{key:h,value:h},null,8,im))),128))]),$.value.length?(x(),v("p",um,y($.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):B("",!0),n("div",cm,[n("div",null,[k[14]||(k[14]=n("label",{class:"block text-sm font-medium mb-1"},"Effort Level",-1)),z(n("select",{"onUpdate:modelValue":k[1]||(k[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"},[...k[13]||(k[13]=[n("option",{value:"low"},"low",-1),n("option",{value:"medium"},"medium",-1),n("option",{value:"high"},"high",-1)])],512),[[Ne,a.value]])]),n("div",null,[k[16]||(k[16]=n("label",{class:"block text-sm font-medium mb-1"},"Context Tier",-1)),z(n("select",{"onUpdate:modelValue":k[2]||(k[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"},[...k[15]||(k[15]=[n("option",{value:"normal"},"normal",-1),n("option",{value:"long_context"},"long_context",-1)])],512),[[Ne,l.value]])])])]),n("div",dm,[n("div",fm,[k[19]||(k[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:k[3]||(k[3]=h=>i.value=!i.value),class:q(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",i.value?"bg-accent":"bg-gray-700"])},[n("span",{class:q(["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)])]),n("div",{class:q(["space-y-4 transition",i.value?"":"opacity-40 pointer-events-none select-none"])},[n("div",pm,[k[21]||(k[21]=n("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),k[22]||(k[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)),z(n("select",{"onUpdate:modelValue":k[4]||(k[4]=h=>d.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"},[...k[20]||(k[20]=[n("option",{value:"openai"},"openai",-1),n("option",{value:"azure"},"azure",-1),n("option",{value:"anthropic"},"anthropic",-1)])],8,mm),[[Ne,d.value]])]),n("div",xm,[k[23]||(k[23]=n("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),k[24]||(k[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)),z(n("input",{"onUpdate:modelValue":k[5]||(k[5]=h=>m.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,vm),[[G,m.value,void 0,{trim:!0}]])]),n("div",gm,[k[28]||(k[28]=n("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),n("p",hm,[k[25]||(k[25]=Y(" Stored server-side and never echoed back (",-1)),k[26]||(k[26]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),k[27]||(k[27]=Y("). ",-1)),P.value?(x(),v("span",bm,"A key is currently set — leave blank to keep it.")):(x(),v("span",ym,"No key set."))]),z(n("input",{"onUpdate:modelValue":k[6]||(k[6]=h=>w.value=h),type:"password",disabled:!i.value,placeholder:P.value?"•••••••• (unchanged)":"sk-…",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,_m),[[G,w.value]])]),n("div",wm,[n("button",{type:"button",onClick:k[7]||(k[7]=h=>E.value=!E.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[n("span",null,y(E.value?"▾":"▸"),1),k[29]||(k[29]=Y(" Advanced (model mapping) ",-1))]),E.value?(x(),v("div",km,[n("div",null,[k[32]||(k[32]=n("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),n("p",$m,[k[30]||(k[30]=Y(" Well-known base model for tool config (",-1)),k[31]||(k[31]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),Y("). Defaults to Copilot Model. "+y($.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),z(n("input",{"onUpdate:modelValue":k[8]||(k[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,Sm),[[G,f.value,void 0,{trim:!0}]])]),n("div",null,[k[35]||(k[35]=n("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),n("p",Cm,[k[33]||(k[33]=Y(" Exact model name sent to the provider (",-1)),k[34]||(k[34]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),Y("). Defaults to Copilot Model. "+y($.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),z(n("input",{"onUpdate:modelValue":k[9]||(k[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,Tm),[[G,p.value,void 0,{trim:!0}]])])])):B("",!0)]),n("div",Pm,[n("div",Em,[k[36]||(k[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:k[10]||(k[10]=h=>ve()),disabled:T.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"},y(T.value?"Testing…":"Test"),9,Am)]),V.value?(x(),v("div",{key:0,class:q([V.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},y(V.value),3)):B("",!0),$.value.length?(x(),v("div",Mm,[(x(!0),v(Q,null,ce($.value,h=>(x(),v("div",{key:h,class:"text-xs font-mono text-textSecondary py-0.5"},y(h),1))),128))])):B("",!0)])],2),n("div",Im,[k[41]||(k[41]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),k[42]||(k[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)),S.value.length?(x(),v("div",Om,[(x(!0),v(Q,null,ce(S.value,h=>(x(),v("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,Dm),k[37]||(k[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,Lm),k[38]||(k[38]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):B("",!0),n("div",jm,[k[39]||(k[39]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:k[11]||(k[11]=h=>M.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(Q,null,ce(M.value,(h,b)=>(x(),v("div",{key:b,class:"flex items-center gap-2 mb-2"},[z(n("input",{"onUpdate:modelValue":A=>h.k=A,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),[[G,h.k]]),k[40]||(k[40]=n("span",{class:"text-muted text-xs"},"=",-1)),z(n("input",{"onUpdate:modelValue":A=>h.v=A,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,Um),[[G,h.v]]),n("button",{onClick:A=>M.value.splice(b,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Vm)]))),128)),M.value.length===0?(x(),v("div",Nm,"No additional variables")):B("",!0)]),n("div",Bm,[k[45]||(k[45]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",Fm,[n("div",null,[k[43]||(k[43]=n("div",{class:"text-xs text-muted mb-1"},"Model",-1)),n("span",Hm,y(r.value||"—"),1)]),n("div",null,[k[44]||(k[44]=n("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),n("span",{class:q(["text-sm font-medium",i.value?"text-success":"text-textSecondary"])},y(i.value?"Enabled":"Disabled"),3)])])])]))])]))}}),Km={class:"animate-fade-in"},zm={class:"glass rounded-xl p-6 mb-6"},Jm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},qm={class:"flex items-center gap-3"},Ym=["disabled"],Gm={key:0,class:"text-center py-8 text-textSecondary text-sm"},Xm={key:1,class:"space-y-6"},Zm={class:"glass rounded-xl p-4 border border-gray-700/50"},Qm=["value"],ex={class:"glass rounded-xl p-4 border border-gray-700/50"},tx=["value"],sx={class:"glass rounded-xl p-4 border border-gray-700/50"},nx={class:"glass rounded-xl p-4 border border-gray-700/50"},ox=Re({__name:"CodexTab",setup(e){const t=["gpt-5.3-codex","gpt-5.4","gpt-5.5","gpt-5.6"],s=_(!0),o=_(!1),r=_(""),a=_("default"),l=_("default"),i=_(9e4),d=_(9e4),m=_(""),f=_(""),p=_(""),w=_(""),P=Te(()=>a.value!==l.value||i.value!==d.value||m.value!==f.value||p.value!==w.value);function E($){a.value=$.codexModelVerbosity,l.value=$.codexModelVerbosity,i.value=$.codexToolTimeoutSec,d.value=$.codexToolTimeoutSec,m.value=$.codexRootModel,f.value=$.codexRootModel,p.value=$.codexWorkerModel,w.value=$.codexWorkerModel}async function T(){s.value=!0;try{E(await pe("/api/settings/codex"))}finally{s.value=!1}}async function V(){if(o.value=!0,r.value="",!Number.isFinite(i.value)||i.value<1){r.value="Error: Codex MCP tool timeout must be at least 1 second",o.value=!1;return}try{const $={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},S={codexModelVerbosity:a.value,codexToolTimeoutSec:i.value,codexRootModel:m.value,codexWorkerModel:p.value},M=await fetch("/api/settings/codex",{method:"POST",headers:$,body:JSON.stringify(S)});if(!M.ok){const I=await M.json().catch(()=>({error:M.statusText}));throw new Error(I.error??M.statusText)}E(await M.json()),r.value="Saved ✓",setTimeout(()=>{r.value=""},3e3)}catch($){r.value="Error: "+$.message}finally{o.value=!1}}return Oe(T),($,S)=>(x(),v("div",Km,[n("div",zm,[n("div",Jm,[S[4]||(S[4]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Codex"),n("p",{class:"text-sm text-textSecondary mt-1"},"Spawn settings for Codex threads and workers")],-1)),n("div",qm,[r.value?(x(),v("span",{key:0,class:q([r.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(r.value),3)):B("",!0),n("button",{onClick:V,disabled:o.value||s.value||!P.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(o.value?"Saving…":"Save"),9,Ym)])]),s.value?(x(),v("div",Gm,"Loading…")):(x(),v("div",Xm,[n("div",Zm,[S[6]||(S[6]=We('<label class="block text-sm font-medium mb-1">Root Model</label><p class="text-xs text-textSecondary mb-3"> Model used when spawning a root/orchestrator (or branch) Codex thread, emitted as <span class="font-mono text-accentLight">-m</span>. Overridden by the <span class="font-mono text-accentLight">CODEX_MODEL</span> env var if set. <span class="font-mono text-accentLight">default (unset)</span> emits no <span class="font-mono text-accentLight">-m</span> — Codex uses its own default. </p>',2)),z(n("select",{"onUpdate:modelValue":S[0]||(S[0]=M=>m.value=M),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"},[S[5]||(S[5]=n("option",{value:""},"default (unset)",-1)),(x(),v(Q,null,ce(t,M=>n("option",{key:M,value:M},y(M),9,Qm)),64))],512),[[Ne,m.value]])]),n("div",ex,[S[8]||(S[8]=We('<label class="block text-sm font-medium mb-1">Worker Model</label><p class="text-xs text-textSecondary mb-3"> Model used when spawning a worker Codex thread, emitted as <span class="font-mono text-accentLight">-m</span>. Overridden by the <span class="font-mono text-accentLight">CODEX_MODEL</span> env var if set. <span class="font-mono text-accentLight">default (unset)</span> emits no <span class="font-mono text-accentLight">-m</span> — Codex uses its own default. </p>',2)),z(n("select",{"onUpdate:modelValue":S[1]||(S[1]=M=>p.value=M),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"},[S[7]||(S[7]=n("option",{value:""},"default (unset)",-1)),(x(),v(Q,null,ce(t,M=>n("option",{key:M,value:M},y(M),9,tx)),64))],512),[[Ne,p.value]])]),n("div",sx,[S[10]||(S[10]=We('<label class="block text-sm font-medium mb-1">Model Verbosity</label><p class="text-xs text-textSecondary mb-3"> Injected into Codex threads as <span class="font-mono text-accentLight">model_verbosity</span>. Controls how long the model&#39;s output is. <span class="font-mono text-accentLight">low</span> reduces Codex output tokens, but it is double-edged — it also shortens genuine answers. Off by default (<span class="font-mono text-accentLight">default</span> injects no override); opt-in only. </p>',2)),z(n("select",{"onUpdate:modelValue":S[2]||(S[2]=M=>a.value=M),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"},[...S[9]||(S[9]=[n("option",{value:"default"},"default",-1),n("option",{value:"low"},"low",-1),n("option",{value:"medium"},"medium",-1),n("option",{value:"high"},"high",-1)])],512),[[Ne,a.value]])]),n("div",nx,[S[11]||(S[11]=n("label",{class:"block text-sm font-medium mb-1"},"MCP Tool Timeout (seconds)",-1)),S[12]||(S[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[Y(" Injected into Codex threads as "),n("span",{class:"font-mono text-accentLight"},"tool_timeout_sec"),Y(". Codex cancels an MCP tool call after this budget (its own default is 300s), which would sever a long-polling "),n("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),Y(". Default 90000 (25h) lets a thread park through a full 24h wait. ")],-1)),z(n("input",{"onUpdate:modelValue":S[3]||(S[3]=M=>i.value=M),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),[[G,i.value,void 0,{number:!0}]])])]))])]))}}),rx={class:"animate-fade-in"},ax={class:"glass rounded-xl p-6 mb-6"},lx={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},ix={class:"flex items-center gap-3"},ux=["disabled"],cx={key:0,class:"text-center py-8 text-textSecondary text-sm"},dx={key:1,class:"space-y-6"},fx={class:"glass rounded-xl p-4 border border-gray-700/50"},px={class:"flex items-center gap-4"},mx={class:"flex justify-between text-xs text-muted mt-2"},xx={class:"font-mono"},vx={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},gx={class:"glass rounded-xl p-4 border border-gray-700/50"},hx={class:"flex items-center gap-4"},bx={class:"flex justify-between text-xs text-muted mt-2"},yx={class:"font-mono"},_x={class:"glass rounded-xl p-4 border border-gray-700/50"},wx={class:"flex items-center gap-4"},kx={class:"flex justify-between text-xs text-muted mt-2"},$x={class:"font-mono"},Sx={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Cx={class:"grid grid-cols-2 gap-4"},Tx={class:"text-sm font-medium text-textSecondary"},Px={class:"mt-3"},Ex=Re({__name:"SettingsTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(50),a=_(50),l=_(300),i=_(300),d=_(1440),m=_(1440),f=Te(()=>r.value!==a.value||l.value!==i.value||d.value!==m.value);async function p(){t.value=!0;try{const[P,E,T]=await Promise.all([pe("/api/settings/bootstrap-message-count"),pe("/api/settings/reply-max-chars"),pe("/api/settings/wait-timeout")]);r.value=P.count,a.value=P.count,l.value=E.chars,i.value=E.chars,d.value=T.minutes,m.value=T.minutes}finally{t.value=!1}}async function w(){s.value=!0,o.value="";try{const P={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},[E,T,V]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:P,body:JSON.stringify({count:r.value})}),fetch("/api/settings/reply-max-chars",{method:"POST",headers:P,body:JSON.stringify({chars:l.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:P,body:JSON.stringify({minutes:d.value})})]);for(const I of[E,T,V])if(!I.ok){const X=await I.json().catch(()=>({error:I.statusText}));throw new Error(X.error??I.statusText)}const $=await E.json(),S=await T.json(),M=await V.json();a.value=$.count,r.value=$.count,i.value=S.chars,l.value=S.chars,m.value=M.minutes,d.value=M.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(P){o.value="Error: "+P.message}finally{s.value=!1}}return Oe(p),(P,E)=>(x(),v("div",rx,[n("div",ax,[n("div",lx,[E[6]||(E[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",ix,[o.value?(x(),v("span",{key:0,class:q([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):B("",!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,ux)])]),t.value?(x(),v("div",cx,"Loading…")):(x(),v("div",dx,[n("div",fx,[E[10]||(E[10]=n("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),E[11]||(E[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",px,[z(n("input",{"onUpdate:modelValue":E[0]||(E[0]=T=>r.value=T),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[G,r.value,void 0,{number:!0}]]),z(n("input",{"onUpdate:modelValue":E[1]||(E[1]=T=>r.value=T),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),[[G,r.value,void 0,{number:!0}]])]),n("div",mx,[E[7]||(E[7]=n("span",null,"Off",-1)),n("span",xx,y(r.value)+" messages",1),E[8]||(E[8]=n("span",null,"Max",-1))]),r.value===0?(x(),v("div",vx,[...E[9]||(E[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)])])):B("",!0)]),n("div",gx,[E[14]||(E[14]=n("label",{class:"block text-sm font-medium mb-1"},"Reply Length Limit",-1)),E[15]||(E[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",hx,[z(n("input",{"onUpdate:modelValue":E[2]||(E[2]=T=>l.value=T),type:"range",min:"100",max:"2000",step:"50",class:"flex-1 accent-accent"},null,512),[[G,l.value,void 0,{number:!0}]]),z(n("input",{"onUpdate:modelValue":E[3]||(E[3]=T=>l.value=T),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),[[G,l.value,void 0,{number:!0}]])]),n("div",bx,[E[12]||(E[12]=n("span",null,"Short",-1)),n("span",yx,y(l.value)+" chars",1),E[13]||(E[13]=n("span",null,"Long",-1))])]),n("div",_x,[E[18]||(E[18]=n("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),E[19]||(E[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",wx,[z(n("input",{"onUpdate:modelValue":E[4]||(E[4]=T=>d.value=T),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[G,d.value,void 0,{number:!0}]]),z(n("input",{"onUpdate:modelValue":E[5]||(E[5]=T=>d.value=T),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),[[G,d.value,void 0,{number:!0}]])]),n("div",kx,[E[16]||(E[16]=n("span",null,"1 min",-1)),n("span",$x,y(d.value>=60?Math.floor(d.value/60)+"h "+d.value%60+"m":d.value+" min"),1),E[17]||(E[17]=n("span",null,"24h",-1))])]),n("div",Sx,[E[22]||(E[22]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",Cx,[n("div",null,[E[20]||(E[20]=n("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),n("span",{class:q(["text-sm font-medium",a.value>0?"text-success":"text-textSecondary"])},y(a.value>0?`${a.value} messages`:"Disabled"),3)]),n("div",null,[E[21]||(E[21]=n("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),n("span",Tx,y(m.value>=60?Math.floor(m.value/60)+"h "+m.value%60+"m":m.value+" min"),1)])]),n("div",Px,[n("span",{class:q(["text-sm font-medium",f.value?"text-warn":"text-textSecondary"])},y(f.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Ax={class:"animate-fade-in"},Mx={class:"glass rounded-xl p-6 mb-6"},Ix={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ox={class:"flex flex-wrap gap-3 items-center"},Dx=["disabled"],Lx={key:0,class:"flex items-center gap-2"},jx={key:1},Rx={class:"glass rounded-xl p-6"},Ux={key:0,class:"text-center py-8 text-textSecondary text-sm"},Vx={key:1,class:"text-center py-12 text-textSecondary text-sm"},Nx={key:2,class:"space-y-2"},Bx={class:"flex items-center justify-between gap-3"},Fx={class:"flex-1 min-w-0"},Hx={class:"flex flex-wrap items-center gap-2 mb-1"},Wx={class:"font-medium text-sm font-mono"},Kx={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},zx={class:"text-xs text-muted"},Jx={class:"text-xs text-muted"},qx=["onClick","disabled"],Yx={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Gx={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Xx={class:"text-sm text-textSecondary mb-4"},Zx={class:"font-mono text-textPrimary"},Qx=Re({__name:"SnapshotsTab",setup(e){const t=_([]),s=_(!0),o=_(!1),r=_(null),a=_(""),l=_(""),i=_(!0),d=_(null);function m($){return $<1024?`${$} B`:$<1024*1024?`${($/1024).toFixed(1)} KB`:`${($/(1024*1024)).toFixed(1)} MB`}function f($){try{return new Date($).toLocaleString()}catch{return $}}function p($,S){l.value=$,i.value=S,setTimeout(()=>{l.value=""},4e3)}async function w(){s.value=!0;try{const $=await pe("/api/snapshots");t.value=$.snapshots}catch($){p("Failed to load snapshots: "+$.message,!1)}finally{s.value=!1}}async function P(){if(!o.value){o.value=!0;try{await pe("/api/snapshots",{method:"POST",body:JSON.stringify({description:a.value})}),a.value="",p("Snapshot created ✓",!0),await w()}catch($){p("Error: "+$.message,!1)}finally{o.value=!1}}}function E($){d.value=$}function T(){d.value=null}async function V(){const $=d.value;if(!(!$||r.value)){d.value=null,r.value=$;try{await pe(`/api/snapshots/${encodeURIComponent($)}`,{method:"DELETE"}),p("Deleted ✓",!0),await w()}catch(S){p("Error: "+S.message,!1)}finally{r.value=null}}}return Oe(w),($,S)=>(x(),v("div",Ax,[n("div",Mx,[n("div",Ix,[S[1]||(S[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)),l.value?(x(),v("span",{key:0,class:q(["text-sm",i.value?"text-success":"text-danger"])},y(l.value),3)):B("",!0)]),n("div",Ox,[z(n("input",{"onUpdate:modelValue":S[0]||(S[0]=M=>a.value=M),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:tt(P,["enter"])},null,544),[[G,a.value]]),n("button",{onClick:P,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?(x(),v("span",Lx,[...S[2]||(S[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)])])):(x(),v("span",jx,"+ Create Snapshot"))],8,Dx)])]),n("div",Rx,[s.value?(x(),v("div",Ux,"Loading…")):t.value.length===0?(x(),v("div",Vx,"No snapshots yet")):(x(),v("div",Nx,[(x(!0),v(Q,null,ce(t.value,M=>(x(),v("div",{key:M.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Bx,[n("div",Fx,[n("div",Hx,[n("span",Wx,y(M.name),1),n("span",Kx,"v"+y(M.mcpVersion),1),n("span",zx,y(m(M.sizeBytes)),1)]),n("div",Jx,[Y(y(f(M.createdAt)),1),M.description?(x(),v(Q,{key:0},[Y(" · "+y(M.description),1)],64)):B("",!0)])]),n("button",{onClick:I=>E(M.name),disabled:r.value===M.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===M.name?"…":"Delete"),9,qx)])]))),128))]))]),d.value?(x(),v("div",Yx,[n("div",Gx,[S[5]||(S[5]=n("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),n("p",Xx,[S[3]||(S[3]=Y(" Delete ",-1)),n("span",Zx,y(d.value),1),S[4]||(S[4]=Y("? This cannot be undone. ",-1))]),n("div",{class:"flex gap-3"},[n("button",{onClick:V,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:T,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")])])])):B("",!0)]))}}),ev={class:"animate-fade-in space-y-6"},tv={class:"glass rounded-xl p-6"},sv={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},nv={class:"text-sm text-textSecondary mt-1"},ov={class:"flex items-center gap-3"},rv={key:0,class:"text-xs text-accentLight animate-pulse"},av={key:0,class:"flex flex-wrap gap-2 mt-3"},lv=["onClick"],iv={class:"ml-1 opacity-60"},uv={key:0,class:"text-center py-12 text-textSecondary"},cv={key:1,class:"text-center py-8 text-danger text-sm"},dv={key:2,class:"text-center py-12 text-textSecondary"},fv={key:3,class:"space-y-3"},pv={class:"flex flex-wrap items-start gap-3"},mv={class:"flex-1 min-w-0 space-y-2"},xv={class:"flex flex-wrap items-center gap-2"},vv={class:"font-semibold truncate"},gv={class:"text-xs text-muted font-mono"},hv={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},bv={title:"Created"},yv={title:"Archived"},_v={key:0,class:"text-muted"},wv={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},kv={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},$v={class:"flex items-center gap-2 shrink-0"},Sv=["onClick","disabled"],Cv=3,Tv=Re({__name:"ArchivedThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),a=_({}),l=_({done:0,total:0}),i=_(null),d=_("all");let m=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(()=>d.value==="all"?t.value:t.value.filter(S=>S.type===d.value)),w=Te(()=>{const S={all:t.value.length};for(const M of t.value)S[M.type]=(S[M.type]??0)+1;return S}),P=Te(()=>Object.values(a.value).some(Boolean));async function E(){s.value=!0,o.value="";try{const S=await pe("/api/threads/archived");t.value=S.threads??[],r.value={},a.value={},t.value.length>0&&T()}catch(S){o.value=S.message||"Failed to load archived threads"}finally{s.value=!1}}async function T(){const S=++m,M=[...t.value];l.value={done:0,total:M.length};async function I(){for(;M.length>0&&S===m;){const oe=M.shift();a.value={...a.value,[oe.threadId]:!0};try{const ne=await fetch(`/api/threads/${oe.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(S!==m)return;if(ne.ok){const ue=await ne.json();ue.summary&&(r.value={...r.value,[oe.threadId]:ue.summary})}}catch{}finally{if(S===m){const{[oe.threadId]:ne,...ue}=a.value;a.value=ue,l.value={...l.value,done:l.value.done+1}}}}}const X=Array.from({length:Math.min(Cv,M.length)},()=>I());await Promise.all(X)}function V(S){if(!S)return"—";const M=new Date(S),X=Date.now()-M.getTime(),oe=Math.floor(X/6e4),ne=Math.floor(X/36e5),ue=Math.floor(X/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){if(confirm(`Unarchive thread "${S.name}" (${S.threadId})?`)){i.value=S.threadId;try{const M=await fetch(`/api/threads/${S.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!M.ok){const I=await M.json().catch(()=>({error:M.statusText}));throw new Error(I.error??M.statusText)}await E()}catch(M){o.value="Failed to unarchive: "+M.message}finally{i.value=null}}}return Oe(E),(S,M)=>(x(),v("div",ev,[n("div",tv,[n("div",sv,[n("div",null,[M[0]||(M[0]=n("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),n("p",nv,y(t.value.length)+" archived thread"+y(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),n("div",ov,[P.value?(x(),v("span",rv," Building summaries… "+y(l.value.done)+"/"+y(l.value.total),1)):B("",!0),n("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?(x(),v("div",av,[(x(),v(Q,null,ce(["all","root","branch","daily"],I=>n("button",{key:I,onClick:X=>d.value=I,class:q(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===I?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[Y(y(I==="all"?"All":I.charAt(0).toUpperCase()+I.slice(1))+" ",1),n("span",iv,"("+y(w.value[I]??0)+")",1)],10,lv)),64))])):B("",!0)]),s.value&&t.value.length===0?(x(),v("div",uv,"Loading archived threads…")):o.value?(x(),v("div",cv,y(o.value),1)):t.value.length===0?(x(),v("div",dv,"No archived threads")):B("",!0),p.value.length>0?(x(),v("div",fv,[(x(!0),v(Q,null,ce(p.value,I=>{var X,oe;return x(),v("div",{key:I.id,class:"glass rounded-xl p-4"},[n("div",pv,[n("div",mv,[n("div",xv,[n("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(X=f[I.type])==null?void 0:X.classes])},y((oe=f[I.type])==null?void 0:oe.emoji)+" "+y(I.type.toUpperCase()),3),n("span",vv,y(I.name),1),n("span",gv,"ID: "+y(I.threadId),1)]),n("div",hv,[n("span",bv,"Created "+y(V(I.createdAt)),1),n("span",yv,"Archived "+y(V(I.archivedAt??I.lastActiveAt)),1),I.client?(x(),v("span",_v,y(I.client),1)):B("",!0)]),r.value[I.threadId]?(x(),v("div",wv,y(r.value[I.threadId]),1)):a.value[I.threadId]?(x(),v("div",kv," Generating summary… ")):B("",!0)]),n("div",$v,[n("button",{onClick:ne=>$(I),disabled:i.value===I.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition"},y(i.value===I.threadId?"Restoring…":"↩ Unarchive"),9,Sv)])])])}),128))])):B("",!0)]))}}),Pv={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Ev={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},Av=["disabled"],Mv={key:0,class:"mt-3 text-sm text-danger"},Iv={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Ov={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Dv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Lv={class:"flex items-center gap-4"},jv={class:"text-sm text-textSecondary font-mono"},Rv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},Uv={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},Vv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Nv={class:"text-2xl font-bold font-mono"},Bv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Fv={class:"text-2xl font-bold font-mono"},Hv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Wv={class:"text-2xl font-bold font-mono"},Kv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},zv={class:"flex items-center gap-2 mb-2"},Jv={class:"text-2xl font-bold font-mono"},qv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Yv={class:"text-2xl font-bold font-mono"},Gv={class:"max-w-7xl mx-auto px-4 sm:px-6"},Xv={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Zv=["onClick"],Qv={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",eg=Re({__name:"App",setup(e){const t=_(!1),s=_(""),o=_(""),r=_(!1),a=_(null),l=_("sessions");let i=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:"codex",label:"Codex"},{id:"settings",label:"Settings"}],m={sessions:ri,notes:ki,templates:nu,skills:Hu,agents:pf,threads:jd,archived:Tv,mcp:ep,prompts:gp,snapshots:Qx,claude:Zp,copilot:Wm,codex:ox,settings:Ex},f=Te(()=>m[l.value]),p=Te(()=>{if(!a.value)return"—";const V=Math.floor(a.value.uptime),$=Math.floor(V/86400),S=Math.floor(V%86400/3600),M=Math.floor(V%3600/60);return $>0?`${$}d ${S}h`:S>0?`${S}h ${M}m`:`${M}m`});async function w(){const V=s.value.trim()||"no-auth";r.value=!0,o.value="";try{qt(V),await E(),localStorage.setItem(vs,V),t.value=!0,T()}catch($){const S=$;S.status===401?o.value="Invalid token":o.value=S.message??"Connection failed",qt("")}finally{r.value=!1}}function P(){localStorage.removeItem(vs),t.value=!1,s.value="",a.value=null,i&&clearInterval(i),qt("")}async function E(){a.value=await pe("/api/status")}function T(){i&&clearInterval(i),i=setInterval(E,3e4)}return Oe(async()=>{const V=localStorage.getItem(vs);if(V){s.value=V;try{qt(V),await E(),t.value=!0,T()}catch{localStorage.removeItem(vs),qt("")}}}),kn(()=>{i&&clearInterval(i)}),(V,$)=>{var S,M,I,X,oe,ne,ue,ve,ee;return t.value?(x(),v("div",Iv,[n("header",Ov,[n("div",Dv,[$[3]||($[3]=We('<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",Lv,[$[2]||($[2]=n("div",{class:"flex items-center gap-2 text-sm"},[n("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),n("span",{class:"text-textSecondary"},"Connected")],-1)),n("div",jv,y(p.value),1),n("button",{onClick:P,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),n("div",Rv,[n("div",Uv,[n("div",Vv,[$[4]||($[4]=We('<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",Nv,y(((S=a.value)==null?void 0:S.activeSessions)??0),1)]),n("div",Bv,[$[5]||($[5]=We('<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",Fv,y(((I=(M=a.value)==null?void 0:M.memory)==null?void 0:I.totalSemanticNotes)??0),1)]),n("div",Hv,[$[6]||($[6]=We('<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",Wv,y(((oe=(X=a.value)==null?void 0:X.memory)==null?void 0:oe.totalEpisodes)??0),1)]),n("div",Kv,[n("div",zv,[n("span",{class:q((((ue=(ne=a.value)==null?void 0:ne.memory)==null?void 0:ue.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...$[7]||($[7]=[n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),$[8]||($[8]=n("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),n("div",Jv,y(((ee=(ve=a.value)==null?void 0:ve.memory)==null?void 0:ee.unconsolidatedEpisodes)??0),1)]),n("div",qv,[$[9]||($[9]=We('<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",Yv,y(p.value),1)])])]),n("div",Gv,[n("nav",Xv,[(x(),v(Q,null,ce(d,k=>n("button",{key:k.id,onClick:h=>l.value=k.id,class:q(["pb-3 text-sm font-medium transition",l.value===k.id?"tab-active":"tab-inactive"])},y(k.label),11,Zv)),64))])]),n("div",Qv,[(x(),fr(Ea(f.value),{status:a.value},null,8,["status"]))])])):(x(),v("div",Pv,[n("div",Ev,[$[1]||($[1]=We('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),z(n("input",{"onUpdate:modelValue":$[0]||($[0]=k=>s.value=k),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:tt(w,["enter"])},null,544),[[G,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,Av),o.value?(x(),v("p",Mv,y(o.value),1)):B("",!0)])]))}}});Fl(eg).mount("#app");</script>
73
73
  <style rel="stylesheet" crossorigin>body{background:#0f1419}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:#1a1f2e}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#4b5563}.glass{background:#1a1f2ecc;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid rgba(99,102,241,.1)}.stat-glow{box-shadow:0 0 20px #6366f114}.priority-2{border-left:3px solid #ef4444}.priority-1{border-left:3px solid #f59e0b}.priority-0{border-left:3px solid transparent}.type-badge{font-size:.65rem;padding:2px 6px;border-radius:9999px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.type-fact{background:#3b82f626;color:#60a5fa}.type-preference{background:#a855f726;color:#c084fc}.type-pattern{background:#22c55e26;color:#4ade80}.type-entity{background:#fbbf2426;color:#fbbf24}.type-relationship{background:#f472b626;color:#f472b6}.tab-active{border-bottom:2px solid #6366f1;color:#e5e7eb}.tab-inactive{border-bottom:2px solid transparent;color:#6b7280}.tab-inactive:hover{color:#9ca3af}</style>
74
74
  </head>
75
75
  <body class="font-sans text-textPrimary min-h-screen">