@arcforge/axon 2.0.164 → 2.0.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.js CHANGED
@@ -683,7 +683,7 @@ ${ea.stack??""}`}),_O(RA,"reload")}});let Ei=new Map;if(Te.provide($Jn,Ei),Te.pr
683
683
  ${Wi}`:""}`})},Te.config.performance=!1,Te.config.compilerOptions.isCustomElement=()=>!0,Te.config.errorHandler=(RA,ea,Wi)=>{_O(RA,`vue:${Wi}`)};let Ot=(RA)=>{if(QO.value===null)_O(RA,"uncaughtException")},Xn=(RA)=>{if(QO.value===null)_O(RA,"unhandledRejection")};process.on("uncaughtException",Ot),process.on("unhandledRejection",Xn),N5("vterm:app:mount"),Te.mount(vn),await new Promise((RA)=>queueMicrotask(RA)),nn(),N5("vterm:boot:complete",{durationMs:Date.now()-(Q??Date.now())});let hn={screen:A,app:Te,inputParser:i,snapshot:Qzi(A),async unmount(){if(Pfn(),process.off("uncaughtException",Ot),process.off("unhandledRejection",Xn),A.off("resize",Cn),A.off("drain",ja),$e!==null)clearTimeout($e),$e=null;for(let RA of Ei.values())await RA.close();Te.unmount(),A.cleanup(),A.destroy()},render(){nn()}};if(A.key(w,()=>void zi()),n.onMounted)try{n.onMounted(hn)}catch(RA){_O(RA,"onMounted")}return hn}var y5e;var X4A=dt(()=>{BiA();U4A();R4A();gvt();z4A();Ofn();Wfn();B0t();ODn();gIe();Lkn();Mbn();Jmt();Fkt();DTe();e1n();y5e=mp(nh(),1)});async function t1n(e){let n=Date.now(),{entry:A,layout:i,highlight:s,ui:u}=e;if(N5("vterm:boot",{cwd:process.cwd()}),kJn(),qJn(),N5("vterm:console:capture"),s)Cdt(s);N5("vterm:highlight:config",{theme:s?.theme});let g=new xkt,d=new Gbn({inputParser:g,alternateScreen:!0,hideCursor:!0,cursor:u?.cursor,width:e.dimensions?.width,height:e.dimensions?.height});if(d.initialize(),N5("vterm:driver:init",{width:d.width,height:d.height}),e.styles?.length)for(let[V,W]of e.styles.entries()){if(!W||typeof W!=="object"||Array.isArray(W))continue;vTe.register(`__bundled__${V}`,W)}let f=vTe.proxy,B=typeof i==="object"&&i!==null?i:null,E=e.routes??[],Q=e.layouts instanceof Map?e.layouts:new Map;N5("vterm:routes:load",{count:E.length,paths:E.map((V)=>V.path??V.name??"?")});let w=e.errorPage??cR.defineComponent({name:"VTermError",setup(){return()=>cR.h("div",{style:{color:"red",padding:"1",display:"flex",flexDirection:"column"}},[cR.h("p",{style:{color:"brightred"}},"Runtime Error"),cR.h("p",{style:{color:"white"}},String(QO.value?.message??QO.value??"Unknown error")),cR.h("p",{style:{color:"yellow"}},String(QO.value?.stack?.split(`
684
684
  `)[1]??""))])}}),S;if(E.length>0)S=B??cR.defineComponent({name:"AppRoot",setup(){return()=>cR.h(dQ)}});else{if(!A)throw Error("No entry component or routes provided to vterm()");S=typeof A==="string"?(()=>{throw Error(`vterm build error: entry must be a component object in production, got string "${A}"`)})():A}let G=S;S=cR.defineComponent({name:"VTermRoot",setup(){return cR.onErrorCaptured((V)=>{return _O(V,"component"),!1}),()=>QO.value!==null?cR.h(w):cR.h(G)}});let q=e.middleware??[],P=q.length>0?async(V,W)=>{V.beforeEach(async(z,te)=>{for(let ie of q){let ae=await ie(z,te);if(ae!==void 0)return ae}return})}:void 0;return V4A({options:e,driver:d,inputParser:g,component:S,allStyles:f,routes:E,layoutsMap:Q,notFoundComponent:e.notFoundComponent,bootStart:n,onMiddleware:P})}var cR;var e8A=dt(()=>{oiA();siA();gIe();Jmt();DTe();ehn();Mbn();Fkt();B0t();X4A();cR=mp(nh(),1)});var ha;var Ks=dt(()=>{B0t();Ofn();Wfn();M0t();ehn();gIe();e8A();Kkn();e1n();ha=mp(nh(),1)});import t8A from"fs";function _zi(){try{return t8A.statSync("/.dockerenv"),!0}catch{return!1}}function wzi(){try{return t8A.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function A1n(){if(n1n===void 0)n1n=_zi()||wzi();return n1n}var n1n;var n8A=()=>{};import kzi from"fs";function HLe(){if(a1n===void 0)a1n=Dzi()||A1n();return a1n}var a1n,Dzi=()=>{try{return kzi.statSync("/run/.containerenv"),!0}catch{return!1}};var i1n=dt(()=>{n8A()});import a8A from"process";import xzi from"os";import r1n from"fs";var A8A=()=>{if(a8A.platform!=="linux")return!1;if(xzi.release().toLowerCase().includes("microsoft")){if(HLe())return!1;return!0}try{if(r1n.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!HLe()}catch{}if(r1n.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||r1n.existsSync("/run/WSL"))return!HLe();return!1},BBe;var o1n=dt(()=>{i1n();BBe=a8A.env.__IS_WSL_TEST__?A8A:A8A()});import i8A from"process";import{Buffer as Fzi}from"buffer";import{promisify as vzi}from"util";import Szi from"child_process";var Nzi,s1n=()=>`${i8A.env.SYSTEMROOT||i8A.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,F$=async(e,n={})=>{let{powerShellPath:A,...i}=n,s=F$.encodeCommand(e);return Nzi(A??s1n(),[...F$.argumentsPrefix,s],{encoding:"utf8",...i})};var c1n=dt(()=>{Nzi=vzi(Szi.execFile);F$.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];F$.encodeCommand=(e)=>Fzi.from(e,"utf16le").toString("base64");F$.escapeArgument=(e)=>`'${String(e).replaceAll("'","''")}'`});function r8A(e){for(let n of e.split(`
685
685
  `)){if(/^\s*#/.test(n))continue;let A=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(n);if(!A)continue;return A.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}import{promisify as Gzi}from"util";import Mzi from"child_process";import u1n,{constants as s8A}from"fs/promises";var Lzi,qzi,Uzi=async()=>{return`${await qzi()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},eSt,o8A,c8A=async()=>{return o8A??=(async()=>{try{let e=await eSt();return await u1n.access(e,s8A.X_OK),!0}catch{return!1}})(),o8A},u8A=async()=>{let e=await eSt(),n=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:A}=await F$(n,{powerShellPath:e});return A.trim()},l8A=async(e)=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:n}=await Lzi("wslpath",["-aw",e],{encoding:"utf8"});return n.trim()}catch{return e}};var g8A=dt(()=>{o1n();c1n();o1n();Lzi=Gzi(Mzi.execFile),qzi=(()=>{let n;return async function(){if(n)return n;let A="/etc/wsl.conf",i=!1;try{await u1n.access(A,s8A.F_OK),i=!0}catch{}if(!i)return"/mnt/";let s=await u1n.readFile(A,{encoding:"utf8"}),u=r8A(s);if(u===void 0)return"/mnt/";return n=u,n=n.endsWith("/")?n:`${n}/`,n}})(),eSt=BBe?Uzi:s1n});function PLe(e,n,A){let i=(s)=>Object.defineProperty(e,n,{value:s,enumerable:!0,writable:!0});return Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){let s=A();return i(s),s},set(s){i(s)}}),e}import{promisify as Tzi}from"util";import Kzi from"process";import{execFile as Rzi}from"child_process";async function l1n(){if(Kzi.platform!=="darwin")throw Error("macOS only");let{stdout:e}=await Yzi("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),A=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";if(A==="com.apple.safari")return"com.apple.Safari";return A}var Yzi;var p8A=dt(()=>{Yzi=Tzi(Rzi)});import jzi from"process";import{promisify as Hzi}from"util";import{execFile as Pzi,execFileSync as LIo}from"child_process";async function m8A(e,{humanReadableOutput:n=!0,signal:A}={}){if(jzi.platform!=="darwin")throw Error("macOS only");let i=n?[]:["-ss"],s={};if(A)s.signal=A;let{stdout:u}=await Jzi("osascript",["-e",e,i],s);return u.trim()}var Jzi;var d8A=dt(()=>{Jzi=Hzi(Pzi)});async function g1n(e){return m8A(`tell application "Finder" to set app_path to application file id "${e}" as string
686
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var f8A=dt(()=>{d8A()});import{promisify as $zi}from"util";import{execFile as Ozi}from"child_process";async function p1n(e=zzi){let{stdout:n}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),A=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(n);if(!A)throw new h8A(`Cannot find Windows browser in stdout: ${JSON.stringify(n)}`);let{id:i}=A.groups,s=i.lastIndexOf("."),u=i.lastIndexOf("-"),g=s===-1?void 0:i.slice(0,s),d=u===-1?void 0:i.slice(0,u);return tSt[i]??tSt[g]??tSt[d]??{name:i,id:i}}var zzi,tSt,nSt,h8A;var m1n=dt(()=>{zzi=$zi(Ozi),tSt={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},nSt=new Map(Object.entries(tSt));h8A=class h8A extends Error{}});import{promisify as Wzi}from"util";import d1n from"process";import{execFile as Zzi}from"child_process";async function f1n(){if(d1n.platform==="darwin"){let e=await l1n();return{name:await g1n(e),id:e}}if(d1n.platform==="linux"){let{stdout:e}=await Vzi("xdg-mime",["query","default","x-scheme-handler/http"]),n=e.trim();return{name:Xzi(n.replace(/.desktop$/,"").replace("-"," ")),id:n}}if(d1n.platform==="win32")return p1n();throw Error("Only macOS, Linux, and Windows are supported")}var Vzi,Xzi=(e)=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(n)=>n.toUpperCase());var b8A=dt(()=>{p8A();f8A();m1n();m1n();Vzi=Wzi(Zzi)});import h1n from"process";var eWi,B8A;var C8A=dt(()=>{eWi=Boolean(h1n.env.SSH_CONNECTION||h1n.env.SSH_CLIENT||h1n.env.SSH_TTY),B8A=eWi});import b1n from"process";import _8A from"path";import{fileURLToPath as tWi}from"url";import nWi from"child_process";import AWi,{constants as aWi}from"fs/promises";function Q8A(e){if(typeof e==="string"||Array.isArray(e))return e;let{[E8A]:n}=e;if(!n)throw Error(`${E8A} is not supported`);return n}function RBt({[Q5e]:e},{wsl:n}={}){if(n&&BBe)return Q8A(n);if(!e)throw Error(`${Q5e} is not supported`);return Q8A(e)}var ASt,B1n,I8A,Q5e,E8A,y8A=async(e,n)=>{if(e.length===0)return;let A=[];for(let i of e)try{return await n(i)}catch(s){A.push(s)}throw AggregateError(A,"Failed to open in all supported apps")},aSt=async(e)=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let n=e[ASt]===!0;if(delete e[ASt],Array.isArray(e.app))return y8A(e.app,(B)=>aSt({...e,app:B,[ASt]:!0}));let{name:A,arguments:i=[]}=e.app??{};if(i=[...i],Array.isArray(A))return y8A(A,(B)=>aSt({...e,app:{name:B,arguments:i},[ASt]:!0}));if(A==="browser"||A==="browserPrivate"){let B={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},E={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},Q;if(BBe){let w=await u8A();Q=nSt.get(w)??{}}else Q=await f1n();if(Q.id in B){let w=B[Q.id.toLowerCase()];if(A==="browserPrivate"){if(w==="safari")throw Error("Safari doesn't support opening in private mode via command line");i.push(E[w])}return aSt({...e,app:{name:_5e[w],arguments:i}})}throw Error(`${Q.name} is not supported as a default browser`)}let s,u=[],g={},d=!1;if(BBe&&!HLe()&&!B8A&&!A)d=await c8A();if(Q5e==="darwin"){if(s="open",e.wait)u.push("--wait-apps");if(e.background)u.push("--background");if(e.newInstance)u.push("--new");if(A)u.push("-a",A)}else if(Q5e==="win32"||d){if(s=await eSt(),u.push(...F$.argumentsPrefix),!BBe)g.windowsVerbatimArguments=!0;if(BBe&&e.target)e.target=await l8A(e.target);let B=["$ProgressPreference = 'SilentlyContinue';","Start"];if(e.wait)B.push("-Wait");if(A){if(B.push(F$.escapeArgument(A)),e.target)i.push(e.target)}else if(e.target)B.push(F$.escapeArgument(e.target));if(i.length>0)i=i.map((E)=>F$.escapeArgument(E)),B.push("-ArgumentList",i.join(","));if(e.target=F$.encodeCommand(B.join(" ")),!e.wait)g.stdio="ignore"}else{if(A)s=A;else{let B=!B1n||B1n==="/",E=!1;try{await AWi.access(I8A,aWi.X_OK),E=!0}catch{}s=b1n.versions.electron??(Q5e==="android"||B||!E)?"xdg-open":I8A}if(i.length>0)u.push(...i);if(!e.wait)g.stdio="ignore",g.detached=!0}if(Q5e==="darwin"&&i.length>0)u.push("--args",...i);if(e.target)u.push(e.target);let f=nWi.spawn(s,u,g);if(e.wait)return new Promise((B,E)=>{f.once("error",E),f.once("close",(Q)=>{if(!e.allowNonzeroExitCode&&Q!==0){E(Error(`Exited with code ${Q}`));return}B(f)})});if(n)return new Promise((B,E)=>{f.once("error",E),f.once("spawn",()=>{f.once("close",(Q)=>{if(f.off("error",E),Q!==0){E(Error(`Exited with code ${Q}`));return}f.unref(),B(f)})})});return f.unref(),new Promise((B,E)=>{f.once("error",E),f.once("spawn",()=>{f.off("error",E),B(f)})})},iWi=(e,n)=>{if(typeof e!=="string")throw TypeError("Expected a `target`");return aSt({...n,target:e})},_5e,CBe;var YBt=dt(()=>{g8A();c1n();b8A();i1n();C8A();ASt=Symbol("fallbackAttempt"),B1n=import.meta.url?_8A.dirname(tWi(import.meta.url)):"",I8A=_8A.join(B1n,"xdg-open"),{platform:Q5e,arch:E8A}=b1n;_5e={browser:"browser",browserPrivate:"browserPrivate"};PLe(_5e,"chrome",()=>RBt({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));PLe(_5e,"brave",()=>RBt({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));PLe(_5e,"firefox",()=>RBt({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));PLe(_5e,"edge",()=>RBt({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));PLe(_5e,"safari",()=>RBt({darwin:"Safari"}));CBe=iWi});var iSt;var C1n=dt(()=>{iSt={UNKNOWN:{code:"AX-UNKNOWN-001",title:"Unclassified Error",description:"An error occurred that hasn't been given a proper code yet. This is itself worth fixing \u2014 see the err(cause) call site that produced it.",source:"runtime",severity:"fatal"},PROMPT_NOT_FOUND:{code:"AX-PROMPT-001",title:"Prompt Not Found",description:"The requested prompt could not be resolved \u2014 it is not declared by the agent, or the published package it names ships no prompt by that name.",source:"runtime",severity:"fatal",expected:!0},PROMPT_FILE_NOT_FOUND:{code:"AX-PROMPT-002",title:"Prompt File Missing",description:"The prompt is declared but its source file no longer exists on disk.",source:"runtime",severity:"fatal",expected:!0},PROMPT_RENDER_FAILED:{code:"AX-PROMPT-003",title:"Prompt Render Failed",description:"The prompt's source file failed to compile or render \u2014 likely a malformed SFC (content outside <template>/<script>/<style>) or an error thrown while rendering. See the cause for the underlying parser/render error.",source:"runtime",severity:"fatal"},OUTPUT_INVALID:{code:"AX-OUTPUT-001",title:"Invalid Output Type",description:"The `output` type passed to request() is not valid TypeScript, or references a type that does not exist. Checked before the model is called, so no inference was spent \u2014 fix the type string at the call site.",source:"runtime",severity:"fatal"},OUTPUT_UNSATISFIED:{code:"AX-OUTPUT-002",title:"Output Type Not Satisfied",description:"The model could not produce a response matching the declared `output` type within its retry budget. The accumulated TypeScript diagnostics describe what it got wrong on each attempt.",source:"runtime",severity:"fatal"},OUTPUT_EMPTY:{code:"AX-OUTPUT-003",title:"Model Produced No Output Block",description:"Every reply must wrap its content in a <text> or <script> block \u2014 text outside a block is discarded by the parser. The model replied with none, on every attempt in its retry budget, so there was nothing to render or run. Usually means the model is not following the block protocol rather than that anything is misconfigured: the reply itself is often correct, just unwrapped. Try a different model, or check that the protocol the cognet renders matches the one it parses with.",source:"runtime",severity:"fatal",expected:!0},SCRIPT_NOT_FOUND:{code:"AX-SCRIPT-001",title:"Script Not Found",description:"The requested script was not found in the agent's blueprint. It may not be declared, or the agent needs to be re-prepared.",source:"runtime",severity:"fatal",expected:!0},SCRIPT_FILE_NOT_FOUND:{code:"AX-SCRIPT-002",title:"Script File Missing",description:"The script is declared but its source file no longer exists on disk.",source:"runtime",severity:"fatal",expected:!0},SUBAGENT_LINK_UNSUPPORTED:{code:"AX-SCRIPT-004",title:"Subagent Not Supported Over The Link",description:"An agent asked to spawn a subagent whose child runs as a confined process. `axon.request()` returns a wake's collected entries, while the link's `stimulus` verb returns only admission \u2014 the supervisor needs a verb that collects a wake and answers when it settles. Until that exists this fails rather than returning an admission receipt the caller would read as a result.",source:"runtime",severity:"fatal"},AGENT_BOOT_FAILED:{code:"AX-AGENT-006",title:"Agent Failed To Boot",description:"The agent process exited before it connected to its supervisor. Its own stderr is carried as the detail \u2014 the agent usually knows exactly what went wrong (a missing cognet, a tool that would not compile), and without this that diagnosis died in a pipe while the supervisor reported only a closed socket.",source:"runtime",severity:"fatal"},CAPSULE_NOT_LOCAL:{code:"AX-AGENT-007",title:"No Capsule On This Machine",description:'A console eval was requested against an attached deployment. Its capsule runs wherever the deployment is hosted, so there is nothing here to execute in \u2014 and quietly resolving would read as "it ran and did nothing".',source:"runtime",severity:"fatal",expected:!0},LINK_NO_HANDLER:{code:"AX-LINK-001",title:"No Handler For Link Verb",description:"The peer sent a verb this side does not implement. Both ends speak a versioned contract, so this means they disagree about it \u2014 a wiring fault, not something a user did.",source:"runtime",severity:"fatal"},LINK_PEER_CLOSED:{code:"AX-LINK-002",title:"Agent Disconnected",description:"The agent process closed its side of the link. Every call still in flight is rejected rather than left hanging \u2014 a dead peer must be an error, never a wait that never ends.",source:"runtime",severity:"fatal"},LINK_CLOSED:{code:"AX-LINK-003",title:"Link Closed",description:"The link to the agent was torn down by this side \u2014 a shutdown, a dispose, or a failed boot. Outstanding calls are rejected with this rather than hanging.",source:"runtime",severity:"fatal"},LINK_FRAME_TOO_LARGE:{code:"AX-LINK-004",title:"Link Frame Too Large",description:"A message on the link exceeded the maximum frame size, or a length prefix declared one that did. The prefix is peer-controlled input, so an oversized declaration is refused rather than allocated \u2014 a desynchronised stream cannot be recovered by reading past it.",source:"runtime",severity:"fatal"},LINK_UNKNOWN_PROMPT_ACTION:{code:"AX-LINK-005",title:"Unknown Prompt Action",description:"The prompt verb was called with an action this side does not know. Loud rather than silent: an unrecognised action would otherwise return undefined, which a caller renders as an empty prompt list.",source:"runtime",severity:"fatal"},AGENT_LINK_MISSING:{code:"AX-AGENT-001",title:"Agent Started Without A Supervisor",description:"An agent process was started with no link paths in its environment, which means nothing is supervising it. It cannot guess a socket path \u2014 doing so risks connecting to a different agent's supervisor entirely.",source:"runtime",severity:"fatal"},AGENT_LINK_MALFORMED:{code:"AX-AGENT-002",title:"Malformed Agent Link",description:"The link carrier in the agent's environment is not valid JSON, or does not name both a control and a data socket. Both are required \u2014 an agent with only one connected can accept work it has no way to answer.",source:"runtime",severity:"fatal"},AGENT_BLUEPRINT_MISSING:{code:"AX-AGENT-003",title:"Agent Started Without A Blueprint",description:"An agent process was started with no blueprint path in its environment. The supervisor writes the blueprint beside the sockets before spawning; its absence means the spawn path is broken.",source:"runtime",severity:"fatal"},AGENT_NOT_READY:{code:"AX-AGENT-004",title:"Agent Still Booting",description:"A verb arrived before the agent's runtime finished booting. The link connects first so that boot failures are reportable, which leaves a brief window where the agent can be addressed but cannot answer.",source:"runtime",severity:"fatal"},CLI_AGENT_NOT_LOCAL:{code:"AX-AGENT-005",title:"Command Needs An In-Process Agent",description:"A headless CLI command booted an agent that runs as a separate process, but the command reaches into the runtime directly. This is a wiring fault: the command needs either an in-process agent or a link verb.",source:"runtime",severity:"fatal"},ENGINE_ROLE_UNBOUND_LINK:{code:"AX-ENGINE-010",title:"No Engine For Role",description:"A confined agent asked for inference on a role the supervisor has no engine bound to. Roles are resolved on the supervisor's side before the agent starts, so an unbound one here means resolution and the cognet's declaration disagree.",source:"runtime",severity:"fatal"},ENGINE_KIND_MISMATCH_LINK:{code:"AX-ENGINE-011",title:"Engine Kind Mismatch",description:"A role bound to a transform or session engine was asked to serve a generate call. Resolution already matched the declared type, so reaching here means a provider's create() disagreed with the capability it was handed.",source:"runtime",severity:"fatal"},ENGINE_MISSING:{code:"AX-ENGINE-001",title:"No Engine Configured",description:"The agent's blueprint has no engine \u2014 it cannot dispatch to a model. Set `engine` in axon.config.ts.",source:"runtime",severity:"fatal"},ENGINE_ROLE_UNBOUND:{code:"AX-ENGINE-002",title:"Engine Role Not Bound",description:"The cognet asked for an engine role that resolution did not fill. A required role stops the boot, so reaching this means an OPTIONAL role was used without checking `kernel.engine.has()` first \u2014 or the role was never declared in the cognet's `engines:` block.",source:"runtime",severity:"fatal"},RESOURCES_EXHAUSTED:{code:"AX-RES-001",title:"Not Enough Memory",description:"A local model does not fit in what is left of this machine's video memory. Nothing was evicted: another agent is using it, and taking memory out from under a running agent would slow it down invisibly. Stop an agent that is holding a model, or raise the ceiling in your profile's `resources`.",source:"runtime",severity:"degraded",expected:!0},ENGINE_PIN_UNAVAILABLE:{code:"AX-ENGINE-004",title:"Model Not Available",description:"The agent pins a model no declared provider can supply. The agent still runs \u2014 resolution picked the best available model instead \u2014 but it is NOT the one that was asked for. Declare the provider that supplies it in your profile, or pick a model from a provider you have.",source:"runtime",severity:"degraded",expected:!0},ENGINE_REQUIREMENTS_UNMET:{code:"AX-ENGINE-003",title:"Inference Requirements Unmet",description:"This cognet declares engine roles that nothing among the user's providers can fill. Add a provider that supplies what is missing, or run a cognet whose requirements this machine meets.",source:"runtime",severity:"fatal",expected:!0},INJECT_OUTSIDE_RUNTIME:{code:"AX-RUNTIME-001",title:"Runtime Accessed Before Boot",description:"A runtime global (axon, args) was read before the runtime finished booting.",source:"runtime",severity:"fatal"},BOOT_FAILED:{code:"AX-BOOT-001",title:"Agent Failed To Start",description:"The agent's runtime crashed while starting, before it could accept requests.",source:"runtime",severity:"fatal"},BOOT_SCRIPT_FAILED:{code:"AX-BOOT-002",title:"Boot Script Failed",description:"The agent's boot.vue threw while rendering \u2014 check the script setup block for the error.",source:"runtime",severity:"fatal"},BOOT_SCRIPT_INVALID:{code:"AX-BOOT-003",title:"Boot Script Malformed",description:"The agent's boot.vue has content outside its recognized <script>/<template> blocks, or otherwise failed to parse as a valid SFC.",source:"runtime",severity:"fatal"},COGNET_ACCESSED_BEFORE_LOAD:{code:"AX-COGNET-001",title:"Cognet Accessed Before Load",description:"A cognet global (kernel, phase, system, blueprint) was read before the brain finished loading, or outside the loop body that owns it.",source:"cognet",severity:"fatal"},COGNET_LOOP_ALREADY_DECLARED:{code:"AX-COGNET-002",title:"Loop Already Declared",description:"A cognet's main() called loop() more than once \u2014 the loop is the program's entire main body and can only be declared once.",source:"cognet",severity:"fatal"},COGNET_ALREADY_LOADED:{code:"AX-COGNET-003",title:"Cognet Bound To A Different Kernel",description:"This cognet instance already loaded against a different kernel ABI \u2014 a reload produced a conflicting bind instead of a clean swap.",source:"cognet",severity:"fatal"},COGNET_NO_LOOP:{code:"AX-COGNET-004",title:"Cognet Declared No Loop",description:"The cognet's main() ran (or was woken) without ever declaring loop() \u2014 there is no program to run.",source:"cognet",severity:"fatal"},COGNET_LOAD_FAILED:{code:"AX-COGNET-016",title:"Cognet Failed To Load",description:"The cognet's own main() threw while running at load(). The brain never finished booting, so the agent has nothing to think with. The cause below is the error the cognet's code raised \u2014 it comes from the brain's source, not from Axon.",source:"cognet",severity:"fatal"},COGNET_MAX_TICKS:{code:"AX-COGNET-005",title:"Cognet Exceeded Max Ticks",description:"The cognet's loop ran more ticks in one wake than its configured limit allows \u2014 likely a runaway loop that never calls stop().",source:"cognet",severity:"fatal"},COGNET_ABI_MISMATCH:{code:"AX-COGNET-006",title:"Cognet ABI Mismatch",description:"The compiled cognet targets a kernel ABI version the running kernel doesn't provide \u2014 rebuild the cognet against the current framework version.",source:"cognet",severity:"fatal"},COGNET_MISSING:{code:"AX-COGNET-007",title:"No Compiled Cognet",description:"The blueprint points at a compiled cognet bundle that doesn't exist on disk yet \u2014 run `axon prepare` before booting.",source:"cognet",severity:"fatal"},COGNET_HASH_MISMATCH:{code:"AX-COGNET-008",title:"Cognet Bundle Hash Mismatch",description:"The compiled cognet bundle on disk doesn't match the hash the blueprint expects \u2014 it's stale or was tampered with. Run `axon prepare` again.",source:"cognet",severity:"fatal"},COGNET_INVALID:{code:"AX-COGNET-009",title:"Invalid Cognet Bundle",description:"The compiled cognet's default export isn't a real cognet definition \u2014 the compile step produced something malformed.",source:"cognet",severity:"fatal"},COGNET_IDENTITY_MISMATCH:{code:"AX-COGNET-010",title:"Cognet Identity Mismatch",description:"The compiled cognet artifact's own name doesn't match what the blueprint declared \u2014 the wrong bundle may be at this path.",source:"cognet",severity:"fatal"},COGNET_CONFIG_MISSING:{code:"AX-COGNET-011",title:"Cognet Config Missing",description:"No cognet.config.ts was found in the cognet's source directory \u2014 every cognet needs one to declare its identity.",source:"cognet",severity:"fatal"},COGNET_BUILD_FAILED:{code:"AX-COGNET-012",title:"Cognet Failed To Compile",description:"Bundling the cognet's source into a runnable artifact failed \u2014 check the build log for the underlying syntax or import error.",source:"cognet",severity:"fatal"},COGNET_RUNTIME_UNAVAILABLE:{code:"AX-COGNET-014",title:"Cognet Runtime Temporarily Unavailable",description:"The cognet runtime is declared but not present on disk \u2014 the dependency tree is mid-rewrite. Transient: the reload keeps the previous blueprint and picks the change up on the next watch event.",source:"cognet",severity:"recovered"},COGNET_AMBIGUOUS:{code:"AX-COGNET-015",title:"Two Cognets Declared",description:"The agent both declares `cognet:` in axon.config.ts and holds an inline cognet at `cognet/`. An agent has exactly one brain, and choosing between them silently would either ignore a directory of source or overrule what the author wrote. Keep one.",source:"cognet",severity:"fatal"},COGNET_NOT_FOUND:{code:"AX-COGNET-013",title:"Cognet Not Found",description:"The cognet named by `cognet:` in axon.config.ts could not be located. The detail says where it was looked for \u2014 a registry that answered 404, or a node_modules tree it was missing from. Check the specifier for a typo, and check which registry the CLI is pointed at (AXON_API_BASE).",source:"cognet",severity:"fatal",expected:!0},MODULE_SPECIFIER_INVALID:{code:"AX-PROJECT-005",title:"Invalid Module Specifier",description:"Module names must be scoped as @scope/name. The registry does not accept unscoped packages, so an unscoped specifier can never resolve.",source:"manifest",severity:"fatal"},CONFIG_MODULES_UNPARSEABLE:{code:"AX-PROJECT-006",title:"Could Not Edit axon.config.ts",description:"The install succeeded but the module entry could not be written into the config's modules array automatically \u2014 add or remove it by hand.",source:"manifest",severity:"fatal"},CONFIG_ENGINE_DEPRECATED:{code:"AX-PROJECT-033",title:"`engine:` Is Deprecated And Ignored",description:"This agent's axon.config.ts declares `engine:`, which the runtime no longer reads \u2014 inference is resolving against the profile's providers instead. Use `model: \"codex:gpt-5.6-terra\"` for a cortex pin, and `providers: [...]` for a source the user would not otherwise have.",source:"manifest",severity:"degraded"},MODULE_DEPENDENCY_INSTALL_FAILED:{code:"AX-PROJECT-004",title:"Module Dependencies Failed To Install",description:"The module source was downloaded, but its npm dependencies could not be materialized for the agent. Resolve the package-manager error and run the install again.",source:"manifest",severity:"fatal"},BLUEPRINT_NOT_LOADED:{code:"AX-PROJECT-002",title:"Blueprint Accessed Before Load",description:"Something read the blueprint's current value before load() had ever run.",source:"manifest",severity:"fatal"},AGENT_INVALID:{code:"AX-PROJECT-003",title:"Invalid Agent Directory",description:"The agent root has no package.json \u2014 every agent is a real package, this one isn't.",source:"manifest",severity:"fatal"},CORRUPT_JSON:{code:"AX-PROJECT-016",title:"Corrupt JSON File",description:"A stored JSON file failed to parse \u2014 it may have been hand-edited into an invalid state, or a write was interrupted mid-flight.",source:"manifest",severity:"fatal"},FILE_UNREADABLE:{code:"AX-PROJECT-032",title:"File Could Not Be Read",description:"A file exists but could not be read \u2014 most often a permissions problem, a directory where a file was expected, or a disk error. Distinct from a missing file, which is an ordinary absent-surface state.",source:"manifest",severity:"fatal"},PROVIDER_NOT_CONNECTED:{code:"AX-TUI-011",title:"Provider Not Connected",description:"The selected model routes through a provider (OpenRouter, Codex) that isn't connected yet \u2014 connect it before picking a model on that route.",source:"tui",severity:"fatal",expected:!0},PALETTE_INPUT_REQUIRED:{code:"AX-TUI-012",title:"Required Input Missing",description:"A palette command needs a value for this field before it can run.",source:"tui",severity:"fatal",expected:!0},BENCH_NO_CASES:{code:"AX-TUI-013",title:"Bench Declared No Cases",description:"The bench's test file ran to completion under Bun but never declared a single benchmark case.",source:"tui",severity:"fatal"},TOOL_GLOBAL_COLLISION:{code:"AX-TOOL-409",title:"Tool Global Collides With A Builtin",description:"A flattened tool export has the same name as something that already exists in the agent's global scope, and replacing it would break the code around it. Reach this member through `axon.tools.<namespace>.<member>`, rename the export, or drop `flat` so the module lands under its own namespace instead.",source:"manifest",severity:"fatal",expected:!0},SCRIPT_FAILED:{code:"AX-SCRIPT-500",title:"Script Failed",description:"A script declared by this agent was invoked and threw. The agent's own error follows \u2014 this is the script's failure, not the runtime's.",source:"runtime",severity:"fatal",expected:!0},AGENT_SERVE_NO_PORT:{code:"AX-AGENT-503",title:"No Free Port",description:"The agent tried to bind its HTTP surface and every port in the range it walked was already in use. Free one, or pass a different port with --port.",source:"runtime",severity:"fatal",expected:!0},AGENT_NOT_FOUND:{code:"AX-AGENT-404",title:"Agent Not Found",description:"No local agent goes by this name. Agent references resolve against your local pools only \u2014 watched paths first, then installed agents \u2014 and never fetch from the registry. Install it first with `axon install`.",source:"manifest",severity:"fatal",expected:!0},AGENT_AMBIGUOUS:{code:"AX-AGENT-409",title:"Ambiguous Agent Name",description:"More than one local pool holds an agent with this name, and there is no correct way to guess which was meant \u2014 pass an explicit path, or unwatch one of the roots.",source:"manifest",severity:"fatal",expected:!0},PROJECT_NOT_FOUND:{code:"AX-PROJECT-017",title:"Project Not Found",description:"No axon.config.ts, module.config.ts, cognet.config.ts, bench.config.ts, or prompt.config.ts was found at this path \u2014 it isn't a recognized project directory.",source:"manifest",severity:"fatal",expected:!0},PROJECT_WRONG_KIND:{code:"AX-PROJECT-011",title:"Wrong Project Kind",description:"This command targets one project kind, and the directory holds another \u2014 run the command that matches what is actually here.",source:"manifest",severity:"fatal",expected:!0},PROJECT_EXISTS:{code:"AX-PROJECT-018",title:"Project Already Exists",description:"Scaffolding refused to overwrite a directory that already exists \u2014 remove it or pick a different name first.",source:"manifest",severity:"fatal"},TYPEGEN_NO_BLUEPRINT:{code:"AX-PROJECT-007",title:"Typegen Needs A Loaded Blueprint",description:"Agent-kind typegen was called without a blueprint \u2014 its declared surfaces are the source of the generated types.",source:"manifest",severity:"fatal"},DEPLOY_AGENTS_ONLY:{code:"AX-PROJECT-008",title:"Only Agents Can Deploy",description:"A module was asked to deploy on its own \u2014 modules only run installed inside an agent, deploy the agent instead.",source:"manifest",severity:"fatal"},BUNDLE_IMAGE_FAILED:{code:"AX-PROJECT-039",title:"Image Build Failed",description:"`docker build` did not succeed. Its own output is above \u2014 that is the real diagnostic. Check that a Docker daemon is running, and that the base image can be pulled.",source:"manifest",severity:"fatal",expected:!0},CONFIG_IMPORT_ESCAPES_ROOT:{code:"AX-PROJECT-038",title:"Config Imports Outside The Project",description:"axon.config.ts imports a file from outside this project's directory. A bundle contains the project and nothing above it, so that file is not published with it \u2014 the agent loads locally and then fails at boot in the cloud, after provisioning has already been paid for. Move what it needs inside the project, or publish it and import it by name.",source:"manifest",severity:"fatal",expected:!0},PUBLISH_NAMESPACE_DENIED:{code:"AX-PROJECT-036",title:"That Namespace Is Not Yours",description:"Publishing writes to a scope you own. This package is named for a scope owned by someone else, or by an org you are not a member of \u2014 rename it in package.json to a scope you own, or switch to the account that owns this one.",source:"cloud",severity:"fatal",expected:!0},PUBLISH_USERNAME_REQUIRED:{code:"AX-PROJECT-037",title:"A Username Is Required",description:"A username owns your registry namespace, and nothing can be published until one is set. It is set once, on the account, and every package you publish is scoped under it.",source:"cloud",severity:"fatal",expected:!0},PUBLISH_UNSUPPORTED_KIND:{code:"AX-PROJECT-009",title:"This Project Kind Cannot Publish",description:"The registry accepts agents, modules, cognets, benches and prompts. Extensions are not accepted yet \u2014 the `registry_artifact_kind` enum needs the value first, and publishing before then would register under the wrong kind and claim the name in the shared namespace. A profile is never publishable: it holds one person's credentials, history and agents. See KINDS[kind].publishable.",source:"manifest",severity:"fatal"},MODEL_SPECIFIER_INVALID:{code:"AX-MODEL-001",title:"Malformed Model Specifier",description:"A `models:` entry in cognet.config.ts could not be parsed. The short form is `hf:owner/repo/path/to/file` \u2014 a repo alone is ambiguous, since one repo holds many weights.",source:"manifest",severity:"fatal"},MODEL_FETCH_FAILED:{code:"AX-MODEL-002",title:"Model Weights Could Not Be Fetched",description:"A declared model could not be downloaded. Check the repo, file path and revision, and that the machine can reach the registry. A brain without its weights is broken rather than degraded, so this fails at prepare instead of at first inference.",source:"manifest",severity:"fatal"},MODEL_HASH_MISMATCH:{code:"AX-MODEL-003",title:"Model Weights Failed Verification",description:"Downloaded bytes did not hash to the expected value \u2014 the upstream file changed, or the download was corrupted. Nothing is cached: storing unverified weights would make every later run trust them.",source:"manifest",severity:"fatal"},MODEL_NOT_CACHED:{code:"AX-MODEL-004",title:"Declared Model Is Not Cached",description:"`--frozen` asserts the machine is already provisioned, so it will not fetch. Run `axon prepare` without --frozen to populate the model cache.",source:"manifest",severity:"fatal"},PREPARE_FROZEN_DRIFT:{code:"AX-PROJECT-014",title:"Dependencies Drifted From The Lockfile",description:"`--frozen` asserts that package.json, the lockfile and node_modules already agree. Something did not: a dependency is missing, at a version outside its declared range, or declared but no longer selected. Run `axon prepare` without --frozen to reconcile, and commit the result.",source:"manifest",severity:"fatal"},PUBLISH_VERIFY_FAILED:{code:"AX-PROJECT-013",title:"Artifact Does Not Compile",description:"The package was built, but compiling it the way a consumer would failed \u2014 so publishing it would ship something nobody can install. Usually a file the source imports was left out of the package. Published versions are immutable, so this is caught before upload rather than after.",source:"manifest",severity:"fatal"},DEPLOY_PROVISION_FAILED:{code:"AX-PROJECT-012",title:"Deployment Provisioning Failed",description:"The agent was published, but the cloud control plane could not provision its runtime. The request ID identifies the server-side failure.",source:"manifest",severity:"fatal"},DEPLOY_RUNTIME_FAILED:{code:"AX-PROJECT-035",title:"Agent Failed To Start",description:"Cloud infrastructure was provisioned, but the agent process failed during boot. The reported runtime diagnostic identifies the immediate cause.",source:"runtime",severity:"fatal"},DEPLOY_ENV_RESERVED:{code:"AX-PROJECT-036",title:"Reserved Deployment Variable",description:"The production .env file attempts to override a variable owned by the Axon runtime or Cloud Run.",source:"manifest",severity:"fatal"},DEPLOY_ENV_INVALID:{code:"AX-PROJECT-015",title:"Invalid Deployment Variable",description:"The production .env file contains a key that is not a valid environment variable name.",source:"manifest",severity:"fatal"},BUNDLE_MODULE_COLLISION:{code:"AX-PROJECT-019",title:"Module Name Collision",description:"A hard-imported source module's name collides with an already-installed registry module of the same name.",source:"manifest",severity:"fatal"},BUNDLE_INVALID:{code:"AX-PROJECT-010",title:"Invalid Bundle Source",description:"The directory being bundled has no package.json, or its package.json has no name \u2014 every bundle needs a real package identity.",source:"manifest",severity:"fatal"},BUNDLE_TAR_MISSING:{code:"AX-PROJECT-020",title:"tar Not Found",description:"Bundling shells out to the system's tar binary, which isn't on PATH \u2014 install Git for Windows or use WSL on that platform.",source:"manifest",severity:"fatal"},BUNDLE_TAR_FAILED:{code:"AX-PROJECT-021",title:"tar Failed",description:"The tar subprocess exited non-zero while building a bundle archive.",source:"manifest",severity:"fatal"},BENCH_RUN_NOT_FOUND:{code:"AX-BENCH-001",title:"Bench Run Not Found",description:"No recorded bench run exists with this id.",source:"bench",severity:"fatal",expected:!0},BENCH_NOT_FOUND:{code:"AX-BENCH-002",title:"Bench Not Found",description:"No bench.config.ts was found at this path \u2014 it isn't a recognized bench project.",source:"bench",severity:"fatal",expected:!0},BENCH_TESTS_NOT_FOUND:{code:"AX-BENCH-003",title:"Bench Test Files Not Found",description:"The bench config declares test files that don't exist on disk.",source:"bench",severity:"fatal",expected:!0},BENCH_LOCAL_REF_NOT_FOUND:{code:"AX-BENCH-004",title:"Bench Local Reference Not Found",description:"A factor variable references a local file/directory that doesn't exist.",source:"bench",severity:"fatal",expected:!0},BENCH_CONFIG_INVALID:{code:"AX-BENCH-005",title:"Bench Config Invalid",description:"bench.config.ts failed to evaluate or didn't produce a valid bench definition.",source:"bench",severity:"fatal"},BENCH_PACKAGE_NOT_FOUND:{code:"AX-BENCH-006",title:"Bench Package Not Found",description:"No package.json exists at the bench root \u2014 every bench project needs one for identity.",source:"bench",severity:"fatal",expected:!0},BENCH_PACKAGE_NAME_REQUIRED:{code:"AX-BENCH-007",title:"Bench Package Name Required",description:"The bench's package.json has no name field.",source:"bench",severity:"fatal",expected:!0},BENCH_PACKAGE_VERSION_REQUIRED:{code:"AX-BENCH-008",title:"Bench Package Version Required",description:"The bench's package.json has no version field.",source:"bench",severity:"fatal",expected:!0},BENCH_CONTEXT_MISSING:{code:"AX-BENCH-009",title:"Bench Context Missing",description:"The benchmark preload needs AXON_BENCH_CONTEXT set \u2014 it was run outside the bench harness.",source:"bench",severity:"fatal"},BENCH_NO_ACTIVE_CASE:{code:"AX-BENCH-010",title:"No Active Bench Case",description:"A bench emission (measurement, artifact) happened outside any running Bun test \u2014 these calls must occur inside a test case.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_UNAVAILABLE:{code:"AX-BENCH-011",title:"Bench Workspace Unavailable",description:"The bench's workspace directory hasn't been materialized yet for this run.",source:"bench",severity:"fatal"},BENCH_AGENT_UNRESOLVED:{code:"AX-BENCH-012",title:"Bench Agent Unresolved",description:"The bench's declared subject agent isn't a prepared local agent \u2014 run `axon prepare` on it first.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_UNKNOWN:{code:"AX-BENCH-013",title:"Unknown Bench Measurement",description:"A measurement was emitted under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_TYPE:{code:"AX-BENCH-014",title:"Bench Measurement Type Mismatch",description:"A measurement's emitted value doesn't match the type its bench config declaration expects.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_DOMAIN:{code:"AX-BENCH-015",title:"Bench Measurement Out Of Domain",description:"A measurement's emitted value falls outside the range or category the bench config declares for it.",source:"bench",severity:"fatal"},BENCH_DIMENSION_UNKNOWN:{code:"AX-BENCH-016",title:"Unknown Bench Dimension",description:"A dimension value was set under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_DIMENSION_DOMAIN:{code:"AX-BENCH-017",title:"Bench Dimension Out Of Domain",description:"A dimension's set value isn't one of the categories its bench config declares.",source:"bench",severity:"fatal"},BENCH_AXIS_UNKNOWN:{code:"AX-BENCH-018",title:"Unknown Bench Factor",description:"Something referenced a factor id the running bench's coordinate never assigned a value to.",source:"bench",severity:"fatal"},BENCH_ARTIFACT_UNKNOWN:{code:"AX-BENCH-019",title:"Unknown Bench Artifact",description:"An artifact was emitted under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_ARTIFACT_MEDIA_TYPE:{code:"AX-BENCH-020",title:"Bench Artifact Media Type Not Allowed",description:"An artifact was emitted with a media type its bench config declaration doesn't allow.",source:"bench",severity:"fatal"},BENCH_SCHEMA_UNREADABLE:{code:"AX-BENCH-030",title:"Bench Schema Unreadable",description:"bench.config.ts could not be parsed while extracting the measurement schema.",source:"bench",severity:"fatal"},BENCH_SCHEMA_EMPTY:{code:"AX-BENCH-031",title:"Bench Schema Empty",description:"defineBench<Schema> was given a type with no properties \u2014 an empty schema and a failed extraction must never look alike.",source:"bench",severity:"fatal"},BENCH_SCHEMA_UNSUPPORTED_TYPE:{code:"AX-BENCH-032",title:"Bench Measurement Type Unsupported",description:"A measurement is not a boolean, number, union of string literals, or string.",source:"bench",severity:"fatal"},BENCH_SCHEMA_EXTRACTION_FAILED:{code:"AX-BENCH-033",title:"Bench Schema Extraction Failed",description:"The schema worker did not return a schema. Prepare fails rather than continuing with an empty one, which would silently make every measurement undeclared.",source:"bench",severity:"fatal"},BENCH_AXIS_NOT_FOUND:{code:"AX-BENCH-021",title:"Bench Axis Not Found",description:"The bench config's matrix has no axis with this key.",source:"bench",severity:"fatal",expected:!0},BENCH_AXIS_VALUE_NOT_FOUND:{code:"AX-BENCH-022",title:"Bench Axis Value Not Found",description:"The bench config's matrix axis has no declared value with this id.",source:"bench",severity:"fatal",expected:!0},BENCH_WORKSPACE_ESCAPE:{code:"AX-BENCH-023",title:"Bench Workspace Path Escapes Root",description:"A workspace source entry resolved to a path outside the workspace directory \u2014 refused rather than materialized.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_SYMLINK_UNSUPPORTED:{code:"AX-BENCH-024",title:"Bench Workspace Symlinks Unsupported",description:"A workspace source contains a symlink \u2014 not supported when materializing a bench workspace.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_OUTSIDE_ROOT:{code:"AX-BENCH-025",title:"Bench Template Outside Root",description:"A workspace template's declared source path resolves outside the bench project root.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_SOURCE_NOT_FOUND:{code:"AX-BENCH-026",title:"Bench Template Not Found",description:"A workspace template's declared source path isn't a real directory.",source:"bench",severity:"fatal",expected:!0},BENCH_LOG_INVALID:{code:"AX-BENCH-027",title:"Bench Log Invalid",description:"A bench run's event log is missing an entry its projection requires \u2014 the log is incomplete or was written out of order.",source:"bench",severity:"fatal"},TOOL_DECLARE_FAILED:{code:"AX-BLUEPRINT-002",title:"Tool Declaration Failed",description:"Compiling a src/tools/*.ts file's TypeScript declarations failed \u2014 the worker subprocess reported a compile error.",source:"manifest",severity:"fatal"},TOOL_BUNDLE_FAILED:{code:"AX-BLUEPRINT-006",title:"Tool Bundle Failed",description:"Bundling a src/tools/*.ts file to self-contained source failed \u2014 the bundler subprocess reported an error. Tools are bundled so the sandbox loads them without mounting the project; a bundle failure means the tool cannot enter the box.",source:"manifest",severity:"fatal"},ROUTE_LOAD_FAILED:{code:"AX-BLUEPRINT-007",title:"Route Load Failed",description:"A file in server/api/ could not be imported. The agent would serve an endpoint set that is not the declared one \u2014 a caller gets a 404 for a route whose file exists.",source:"manifest",severity:"fatal"},SCRIPT_LOAD_FAILED:{code:"AX-BLUEPRINT-008",title:"Script Load Failed",description:"A file in src/scripts/ could not be processed. `axon run <name>` would report the script as not found while its file sits in the project.",source:"manifest",severity:"fatal"},PLUGIN_LOAD_FAILED:{code:"AX-BLUEPRINT-009",title:"Plugin Load Failed",description:"A plugin could not be imported. Plugins wire server behaviour at boot; one silently missing means the agent runs without behaviour its author declared.",source:"manifest",severity:"fatal"},MIDDLEWARE_LOAD_FAILED:{code:"AX-BLUEPRINT-010",title:"Middleware Load Failed",description:"A middleware file could not be imported. Middleware commonly carries auth and validation, so a silently skipped one is a request path running without the checks its author wrote.",source:"manifest",severity:"fatal"},PROMPT_INTROSPECT_FAILED:{code:"AX-BLUEPRINT-011",title:"Prompt Introspection Failed",description:"A .vue prompt could not be introspected for its props. The prompt would render without the inputs it declares, or not at all.",source:"manifest",severity:"fatal"},CONFIG_NOT_FOUND:{code:"AX-BLUEPRINT-003",title:"Config Not Found",description:"No axon.config.ts exists at this path.",source:"manifest",severity:"fatal",expected:!0},CONFIG_LOAD_FAILED:{code:"AX-BLUEPRINT-004",title:"Config Failed To Load",description:"axon.config.ts threw or failed to evaluate \u2014 check the file for a syntax or runtime error.",source:"manifest",severity:"fatal"},CONFIG_INVALID:{code:"AX-BLUEPRINT-005",title:"Config Invalid",description:"axon.config.ts evaluated but never called defineAgent() \u2014 every agent config must produce one.",source:"manifest",severity:"fatal"},ENGINE_NO_DONE:{code:"AX-KERNEL-001",title:"Engine Stream Ended Without Completing",description:"The model driver's stream ended without ever emitting a completion event \u2014 the engine likely disconnected or crashed mid-response.",source:"kernel",severity:"fatal"},ENGINE_NOT_CONNECTED:{code:"AX-KERNEL-015",title:"Provider Not Connected",description:"This model's route is not connected to your account yet \u2014 run `:provider <name> connect` for the provider named below, or pick a model on a route you are already signed in to.",source:"kernel",severity:"fatal",expected:!0},ENGINE_AUTH_FAILED:{code:"AX-KERNEL-016",title:"Provider Rejected Your Credentials",description:"The provider refused the credential this agent is using \u2014 it has expired, been revoked, or is for a different account. Reconnect the provider, or pick a model on a route you are signed in to.",source:"kernel",severity:"fatal",expected:!0},ENGINE_RATE_LIMITED:{code:"AX-KERNEL-017",title:"Provider Rate Limit Reached",description:"The provider is refusing further calls right now \u2014 either too many requests in a short window, or a subscription whose allowance is spent. Waiting usually clears the first; the second needs a plan change or a different model.",source:"kernel",severity:"fatal",expected:!0},ENGINE_QUOTA_EXHAUSTED:{code:"AX-KERNEL-018",title:"Provider Credits Exhausted",description:"This route has no credit left to spend. Top it up, or switch to a model on a route that does \u2014 the conversation is intact either way.",source:"kernel",severity:"fatal",expected:!0},ENGINE_REQUEST_REJECTED:{code:"AX-KERNEL-019",title:"Provider Rejected The Request",description:"The provider refused this call as malformed or unsupported \u2014 commonly a model id it does not serve, a context window this conversation has outgrown, or a parameter that route does not accept.",source:"kernel",severity:"fatal",expected:!0},ENGINE_UNREACHABLE:{code:"AX-KERNEL-020",title:"Could Not Reach The Provider",description:"The provider could not be reached, or kept failing, across every retry \u2014 usually a network problem on this machine or an outage on their side. Nothing about this agent needs changing; try again.",source:"kernel",severity:"fatal",expected:!0},ENGINE_STREAM_FAILED:{code:"AX-KERNEL-008",title:"Engine Stream Failed",description:"The model driver's stream failed and exhausted its retries (or the failure wasn't retryable) \u2014 see context for the provider's fault code.",source:"kernel",severity:"fatal"},CODEX_NOT_CONNECTED:{code:"AX-KERNEL-012",title:"Codex Subscription Not Connected",description:"This agent uses a Codex model, but your Axon account is not connected to ChatGPT \u2014 run :provider codex connect and try again.",source:"kernel",severity:"fatal",expected:!0},RUN_IN_PROGRESS:{code:"AX-KERNEL-002",title:"A Wake Is Already Running",description:"The kernel only executes one wake at a time \u2014 a new run was requested while the previous one was still active.",source:"kernel",severity:"recovered"},RUN_RESERVATION_EXPIRED:{code:"AX-KERNEL-003",title:"Wake Reservation Expired",description:"The reserved execution slot for this wake is no longer active \u2014 it was released before the run could start.",source:"kernel",severity:"fatal"},NO_COGNET_LOADED:{code:"AX-KERNEL-004",title:"No Cognet Loaded",description:"The kernel tried to execute a wake, but the blueprint carried no cognet definition to run it against.",source:"kernel",severity:"fatal"},SYSCALL_OUTSIDE_RUN:{code:"AX-KERNEL-005",title:"Syscall Outside An Active Run",description:"A kernel syscall (engine.stream and similar) was made with no active wake to attribute it to.",source:"kernel",severity:"fatal"},CAPSULE_ACCESSED_BEFORE_BOOT:{code:"AX-KERNEL-007",title:"Capsule Accessed Before Boot",description:"Something reached for the live capsule instance before boot() had run \u2014 there is no sandbox yet to hand back.",source:"kernel",severity:"fatal"},COGNET_EMIT_FORBIDDEN:{code:"AX-KERNEL-009",title:"Cognet Emit Forbidden",description:"A cognet tried to emit an event outside the cognet:* namespace \u2014 the ABI only lets a cognet narrate its own telemetry, never forge kernel machinery events.",source:"kernel",severity:"fatal"},KNOWLEDGE_NOT_FOUND:{code:"AX-KERNEL-011",title:"Knowledge Entry Not Found",description:"A cognet read a knowledge entry that does not exist. The knowledge store is not a cache \u2014 a brain reading something the catalogue advertised has hit a real inconsistency, so this is loud rather than an empty result.",source:"kernel",severity:"fatal",expected:!0},KNOWLEDGE_READONLY:{code:"AX-KERNEL-013",title:"Knowledge Entry Is Read-Only",description:"A cognet tried to write or remove knowledge contributed by a module. Module material lives inside its own package and the next install would destroy any change \u2014 so this fails loudly rather than succeeding and vanishing later. An agent's own data/knowledge/ is writable.",source:"kernel",severity:"fatal",expected:!0},KNOWLEDGE_RECORD_FAILED:{code:"AX-KERNEL-014",title:"Knowledge Mutation Went Unrecorded",description:"A knowledge write or remove succeeded on disk, but the session record of it could not be committed. The mutation is real and already visible to the agent; only its audit trail is missing, so this is reported rather than thrown \u2014 the caller cannot undo a completed write. It matters because 'the agent rewrote its own memory' is the fact you want weeks later when behaviour drifts, and here the ledger and the filesystem disagree.",source:"kernel",severity:"degraded"},KNOWLEDGE_ESCAPE:{code:"AX-KERNEL-021",title:"Knowledge Path Escapes Store",description:"A knowledge name resolved outside the store root. Names are identifiers, not paths \u2014 traversal is refused at the boundary rather than trusted not to happen.",source:"kernel",severity:"fatal"},SCHEDULER_MODE_MISMATCH:{code:"AX-KERNEL-010",title:"Scheduler Mode Mismatch",description:"A caller used the wrong wake verb for the cognet's mode: continuous cognets advance via tick(), driven by the body's clock; invocation cognets wake on a stimulus via request()/stream().",source:"kernel",severity:"fatal"},THREAD_UNKNOWN_PARENT:{code:"AX-SESSION-001",title:"Thread Branched From Unknown Parent",description:"A thread's recorded lineage points at a parent thread id that isn't registered in this session \u2014 the session index is inconsistent.",source:"thread",severity:"fatal"},THREAD_NOT_FOUND:{code:"AX-SESSION-002",title:"Thread Not Found",description:"The requested thread id isn't registered in this session.",source:"thread",severity:"fatal",expected:!0},THREAD_BRANCH_UNKNOWN:{code:"AX-SESSION-003",title:"Cannot Branch Unknown Thread",description:"A branch was requested from a parent thread id that isn't registered in this session.",source:"thread",severity:"fatal"},SENSORY_WRITE_FAILED:{code:"AX-SESSION-004",title:"Sensory Ring Write Failed",description:"A dense sense entry (audio or visual) could not be written to the session's sensory ring \u2014 usually a full or read-only data directory. Delivery to the cognet is unaffected; the debug window for this session will have a gap.",source:"runtime",severity:"degraded"},NO_COGNET:{code:"AX-BLUEPRINT-001",title:"No Cognet Declared",description:"The blueprint carries no cognet definition \u2014 an agent cannot run without a brain. The CLI or test harness must construct and pass one.",source:"runtime",severity:"fatal"},CONTROL_PATH_NOT_FOUND:{code:"AX-CONTROL-001",title:"Control Path Not Found",description:"A control-channel call named a method the peer does not expose. The two ends disagree about the surface \u2014 usually a TUI and an extension built from different versions.",source:"server",severity:"fatal",expected:!0},CONTROL_PATH_NOT_CALLABLE:{code:"AX-CONTROL-002",title:"Control Path Not Callable",description:"A control-channel call resolved to a value on the peer's handle that is not a function.",source:"server",severity:"fatal"},CONTROL_CALL_FAILED:{code:"AX-CONTROL-003",title:"Control Call Failed",description:"The peer served a control-channel call and it threw. The remote message is carried here \u2014 the failure surfaces at the local call site rather than being returned as a falsy value.",source:"server",severity:"fatal"},CONTROL_CLOSED:{code:"AX-CONTROL-004",title:"Control Channel Closed",description:"A control-channel call was made, or was still in flight, when the channel closed. In-flight calls reject on close rather than hanging forever on an answer that is no longer coming.",source:"server",severity:"fatal"},CONTROL_UNAUTHORIZED:{code:"AX-CONTROL-005",title:"Control Handshake Rejected",description:"A connection to the control socket presented a missing or incorrect token. The token lives in the instance record, which is readable only by the owning user \u2014 a mismatch means the caller is not the local Fleet extension.",source:"server",severity:"fatal"},PLUGIN_BOOT_FAILED:{code:"AX-SERVER-001",title:"Plugin Failed During Boot",description:"A server plugin threw while running at boot \u2014 plugins are the one place in server startup where a failure must abort the boot rather than being warned and skipped.",source:"server",severity:"fatal"},HANDLE_SHUTDOWN_FAILED:{code:"AX-RUNTIME-002",title:"Handle Failed To Shut Down",description:"One of the runtime's owned handles (kernel, etc.) threw during shutdown \u2014 teardown is error-isolated, so the others still ran, but this one didn't close cleanly.",source:"runtime",severity:"fatal"},BUS_HANDLER_FAILED:{code:"AX-RUNTIME-004",title:"Bus Handler Failed",description:"A handler subscribed to a runtime bus event threw. Handler failures are non-fatal by design \u2014 the remaining handlers still run \u2014 but they are recorded rather than swallowed, since plugins and modules register handlers and a silently-broken one is invisible rot.",source:"runtime",severity:"degraded"},TOOL_CALL_FAILED:{code:"AX-RUNTIME-003",title:"Tool Call Failed",description:"An axon.tools.<namespace>.<fn>() call from script-land completed with a non-ok result from the capsule \u2014 unwrapped here into a normal throw, since script-land expects the ordinary call/throw contract, not the kernel's own stable-result shape.",source:"runtime",severity:"fatal"},CAPSULE_TOOL_TIMEOUT:{code:"AX-CAPSULE-001",title:"Tool Load Timed Out",description:"The sandbox never confirmed loading a declared tool within the timeout \u2014 it may be stuck on a slow import or the subprocess is unresponsive.",source:"capsule",severity:"fatal"},CAPSULE_TOOL_SCOPE_MISMATCH:{code:"AX-CAPSULE-002",title:"Tool Scope Mismatch",description:"A tool's declared exports don't match what it actually exported once loaded in the sandbox \u2014 the bundled source and its declaration have drifted apart.",source:"capsule",severity:"fatal"},CAPSULE_TOOL_FAILED:{code:"AX-CAPSULE-003",title:"Tool Failed To Load",description:"A declared tool failed to load into the sandbox \u2014 its source may be malformed, too large to import, or the subprocess exited before confirming.",source:"capsule",severity:"fatal"},AGENT_ENV_RESERVED:{code:"AX-CAPSULE-012",title:"Reserved Environment Variable",description:"An agent's .env sets a framework-owned variable the runtime controls (AGENT_ID, AXON_API_BASE and similar). These identify the agent to the platform, so overriding one locally would make the agent report itself as something it is not. The deploy path has always refused this; the local path now refuses it identically.",source:"capsule",severity:"fatal"},CAPSULE_NET_UNRESOLVED:{code:"AX-CAPSULE-010",title:"Network Policy Did Not Resolve",description:"A `net.allow` entry names a hostname that did not resolve to any address. Egress rules are installed as addresses, so an unresolvable name becomes no rule at all \u2014 a grant you believe you made and did not. The box refuses to boot rather than run with an allowlist quietly smaller than the one you wrote. Check the hostname, or use a literal address if the name is resolvable only from inside the box.",source:"capsule",severity:"fatal"},CAPSULE_NET_UNAVAILABLE:{code:"AX-CAPSULE-011",title:"Network Confinement Unavailable",description:"The policy declares a `net` allowlist, which needs a userspace network stack (slirp4netns) and nftables inside the box's namespace. One of them is missing on this host. Install slirp4netns and nftables, or drop the `net` block to run with no network at all \u2014 the box will not fall back to unfiltered egress.",source:"capsule",severity:"fatal"},CAPSULE_CONFINE_UNAVAILABLE:{code:"AX-CAPSULE-004",title:"OS Confinement Unavailable",description:"The policy requested OS confinement (isolation: auto) but the host is missing a required primitive (bubblewrap, systemd, nft, or the axon-agent user). Run `axon install`, or set isolation: none to opt out explicitly. The capsule refuses to boot rather than silently run unconfined.",source:"capsule",severity:"fatal"},CAPSULE_CONFINE_USER_UNRESOLVED:{code:"AX-CAPSULE-005",title:"Confinement User Unresolved",description:"The confinement user exists but its numeric uid/gid could not be read \u2014 the box cannot drop privileges without them. The host user database may be inconsistent.",source:"capsule",severity:"fatal"},CAPSULE_BOOT_FAILED:{code:"AX-CAPSULE-006",title:"Capsule Failed To Boot",description:"The sandbox subprocess exited or reported failure before completing the boot handshake. The captured stderr in the error context is the real cause \u2014 most often a confinement mount that could not be satisfied (a declared fs path that does not exist) or a runtime that could not start.",source:"capsule",severity:"fatal"},CAPSULE_BOOT_TIMEOUT:{code:"AX-CAPSULE-007",title:"Capsule Boot Timed Out",description:"The sandbox subprocess did not report ready within the boot timeout. Its captured stderr is in the error context; if empty, the subprocess may be hung rather than crashed.",source:"capsule",severity:"fatal"},CAPSULE_SPAWN_FAILED:{code:"AX-CAPSULE-008",title:"Capsule Spawn Failed",description:"The capsule subprocess command could not be spawned at all \u2014 the interpreter or confinement wrapper was not found, or PATH is unset. Check that bun (and, under confinement, bwrap/systemd-run) are on PATH.",source:"capsule",severity:"fatal"},CAPSULE_WIRE_CLOSED:{code:"AX-CAPSULE-009",title:"Capsule Wire Closed",description:"A command was sent to the sandbox after its stdin pipe was gone \u2014 the subprocess has exited or is mid-teardown. The caller is racing the capsule lifecycle.",source:"capsule",severity:"fatal"},CAPSULE_DOWN:{code:"AX-CAPSULE-010",title:"No Live Capsule",description:"An operation needed a running sandbox subprocess, but none is live \u2014 it is booting, restarting after a crash, or has been declared dead.",source:"capsule",severity:"fatal"},CAPSULE_ALREADY_BOOTED:{code:"AX-CAPSULE-011",title:"Capsule Already Booted",description:"boot() was called on a capsule that already has a live subprocess. Boot is once per lifetime; use update()/reload() to replace a running incarnation.",source:"capsule",severity:"fatal"},CAPSULE_INSTALL_FAILED:{code:"AX-CAPSULE-013",title:"Confinement Install Failed",description:"Provisioning the host for the hardened confinement tier failed \u2014 most often because creating the dedicated system user needs root. Re-run `axon install` with sufficient privilege.",source:"capsule",severity:"fatal"},CAPSULE_HOST_UNAVAILABLE:{code:"AX-CAPSULE-014",title:"Host Bridge Unavailable",description:"Sandboxed code called a host service, but this capsule was built with no host provider. Host calls require a wired host bridge on the manager side.",source:"capsule",severity:"fatal"},CAPSULE_CRASHED:{code:"AX-CAPSULE-015",title:"Capsule Crashed",description:"An unhandled error escaped inside the sandbox subprocess. The capsule reports it on the wire and exits immediately \u2014 after an unhandled throw the sandbox's state is unknown, and a capsule that keeps serving is worse than one that dies loudly.",source:"capsule",severity:"fatal"},CAPSULE_DEAD:{code:"AX-CAPSULE-016",title:"Capsule Dead",description:"The capsule subprocess is gone and supervision gave up restarting it. Every subsequent execution request fails until a new capsule is booted.",source:"capsule",severity:"fatal"},CAPSULE_PARSE_ERROR:{code:"AX-CAPSULE-017",title:"Capsule Wire Parse Error",description:"A line arriving from the sandbox was not a valid protocol event. The sandbox is speaking garbage \u2014 a protocol mismatch or corrupted output \u2014 and the line is dropped rather than acted on, never silently.",source:"capsule",severity:"degraded"},CAPSULE_CMD_FAILED:{code:"AX-CAPSULE-018",title:"Capsule Command Failed",description:"Code executed in the sandbox threw. This is the ordinary failure path for an agent-emitted block or a script-land run() \u2014 the error is the sandboxed code's own, surfaced verbatim.",source:"capsule",severity:"degraded"},CAPSULE_FN_FAILED:{code:"AX-CAPSULE-019",title:"Tool Call Threw",description:"A mediated tool function threw inside the sandbox. The failure is the tool's own; it propagates to the calling code unchanged and is recorded as the closing half of the call's span.",source:"capsule",severity:"degraded"},CAPSULE_PROC_DENIED:{code:"AX-CAPSULE-020",title:"Process Spawn Denied",description:"A process the sandbox tried to start was refused \u2014 denied by policy, killed before it could spawn, or the spawn itself failed. No process was created.",source:"capsule",severity:"degraded"},CAPSULE_PROC_FAILED:{code:"AX-CAPSULE-022",title:"Managed Process Failed",description:"A spawned child process errored without ever producing an exit code \u2014 an exec failure or a broken IPC channel. Distinct from a non-zero exit, which is the process running correctly and reporting a result.",source:"capsule",severity:"degraded"},CAPSULE_PROC_STDIN_FAILED:{code:"AX-CAPSULE-021",title:"Process Stdin Write Failed",description:"Writing to a managed child process's stdin failed \u2014 the process is no longer running, or its stdin has already closed.",source:"capsule",severity:"degraded"},NOT_BOOTED:{code:"AX-TUI-001",title:"No Agent Running",description:"A message was sent, or an action requiring a live agent was taken, before any agent finished booting.",source:"tui",severity:"fatal"},NOT_AUTHENTICATED:{code:"AX-TUI-002",title:"Not Logged In",description:"The action needs an active profile, but none is logged in yet.",source:"tui",severity:"fatal",expected:!0},PROFILE_NOT_AUTHENTICATED:{code:"AX-TUI-003",title:"Profile Has No Session",description:"The target profile exists but has no stored session \u2014 it has never logged in, or its session was cleared.",source:"tui",severity:"fatal",expected:!0},BACKEND_UNREACHABLE:{code:"AX-TUI-044",title:"Backend Unreachable",description:"A stored credential could not be verified because the backend could not be reached. The credential is NOT discarded \u2014 it may be perfectly valid \u2014 but it cannot be trusted until it is checked, so the action is refused rather than proceeding unverified.",source:"tui",severity:"fatal",expected:!0},PROFILE_UNKNOWN:{code:"AX-TUI-004",title:"Unknown Profile",description:"The requested profile id isn't one of the profiles stored on this machine.",source:"tui",severity:"fatal",expected:!0},SESSION_NOT_FOUND:{code:"AX-SESSION-005",title:"Session Not Found",description:"No session log exists at that path. A session is a .jsonl file under the agent's frame (`.agent/data/sessions/`); it may have been deleted, or belong to an agent that has since been removed.",source:"runtime",severity:"fatal",expected:!0},SESSION_UNREADABLE:{code:"AX-SESSION-006",title:"Session Log Unreadable",description:"The session log does not begin with a `session:header` line, so it cannot be forked or renamed. Either the file is truncated, or it was written by a version predating the header \u2014 an older log can still be read and resumed, just not copied.",source:"runtime",severity:"fatal",expected:!0},SESSION_ALREADY_RUNNING:{code:"AX-TUI-005",title:"Session Is Already Running",description:"spawn() was asked to resume a session that already has a live instance. Focus the running instance instead of booting a second runtime over the same log.",source:"tui",severity:"fatal",expected:!0},SESSION_NOT_RUNNING:{code:"AX-TUI-016",title:"Session Is Not Running",description:"focus() was pointed at a sessionId with no live instance behind it. Spawn (or resume) it first \u2014 focus is pure selection over running instances.",source:"tui",severity:"fatal",expected:!0},NO_ACTIVE_AGENT:{code:"AX-TUI-045",title:"No Active Agent",description:"The action needs a running agent, but none is active \u2014 start one first.",source:"tui",severity:"fatal",expected:!0},NO_LOCAL_PROJECT:{code:"AX-TUI-050",title:"No Local Project",description:"This agent has no project directory on this machine \u2014 it was attached over the network, so its source lives wherever it is running. Opening its config, or any other file verb, has to happen there. Focus a local agent instead.",source:"tui",severity:"fatal",expected:!0},NO_FOCUSED_INSTANCE:{code:"AX-TUI-017",title:"No Focused Agent Instance",description:"A module install/uninstall was requested with no running agent instance focused \u2014 spawn or focus one first.",source:"tui",severity:"fatal",expected:!0},MODEL_UNAVAILABLE:{code:"AX-TUI-051",title:"Model Not Available From Any Declared Provider",description:"The picked model was saved to the agent's config, but no provider this profile declares can supply it \u2014 so the running agent still uses its previous model. Connect the provider that serves it, or pick a model from the offered list.",source:"tui",severity:"fatal",expected:!0},MODEL_IMMUTABLE_DEPLOYED:{code:"AX-TUI-006",title:"Cannot Change A Deployment's Model",description:"A deployed agent's config lives in the cloud, not on this machine \u2014 its model is fixed at deploy time. Change it in the local project and deploy again.",source:"tui",severity:"fatal",expected:!0},MODULE_INSTALL_FAILED:{code:"AX-TUI-018",title:"Module Install Failed",description:"The registry installer returned an error for this module specifier \u2014 check the specifier and registry connectivity.",source:"tui",severity:"fatal"},NO_MODULES_INSTALLED:{code:"AX-TUI-019",title:"No Modules Installed",description:"The `:module uninstall` command was opened with no modules resolved into the focused instance's blueprint.",source:"tui",severity:"fatal"},SETTINGS_NOT_WRITABLE:{code:"AX-EXT-027",title:"Settings Cannot Be Written",description:"A settings change was requested on a store with no profile config behind it \u2014 nobody is logged in, or this Store was built without one (tests). Settings live in `profile.config.ts`, so there is nowhere to write them; the change was refused rather than saved somewhere nothing reads back.",source:"tui",severity:"fatal",expected:!0},REGISTRY_EMPTY:{code:"AX-TUI-047",title:"Nothing To Install",description:"The install palette was opened with no rows to show \u2014 the catalogue is still loading, the registry could not be reached, or everything published for that kind is already installed. The row itself says which.",source:"tui",severity:"fatal",expected:!0},NO_EXTENSIONS_INSTALLED:{code:"AX-TUI-046",title:"No Extensions Installed",description:"The `:ext uninstall` command was opened with no extensions declared in the active profile's profile.config.ts.",source:"tui",severity:"fatal",expected:!0},ATTACH_URL_REQUIRED:{code:"AX-TUI-048",title:"Attach URL Required",description:"`:attach` needs the address of a running agent \u2014 e.g. `:attach http://localhost:3010`. The agent must already be serving; attach binds to it and never boots anything.",source:"tui",severity:"fatal"},AGENT_NAME_REQUIRED:{code:"AX-CLI-001",title:"A Name Is Required",description:"Scaffolding a project needs a name \u2014 it becomes the directory and the package name.",source:"cli",severity:"fatal",expected:!0},MODULE_SPECIFIER_REQUIRED:{code:"AX-CLI-002",title:"A Module Name Is Required",description:"The command needs at least one module to act on, named as a scoped registry package.",source:"cli",severity:"fatal",expected:!0},FLAG_VALUE_REQUIRED:{code:"AX-CLI-007",title:"A Flag Is Missing Its Value",description:"The flag takes a value and none followed it. Quote the value if it contains spaces, and check it was not consumed as another flag.",source:"cli",severity:"fatal",expected:!0},RUN_INSTRUCTION_REQUIRED:{code:"AX-CLI-006",title:"Nothing To Run",description:"The agent was named but not told what to do. A reference on its own opens the terminal on that agent; giving it work needs an instruction, a declared prompt, or a script.",source:"cli",severity:"fatal",expected:!0},BENCH_RUN_ID_REQUIRED:{code:"AX-CLI-003",title:"A Run Id Is Required",description:"Reading a benchmark result needs the id of the run to read.",source:"cli",severity:"fatal",expected:!0},PROFILE_INCOMPLETE:{code:"AX-CLI-004",title:"Profile Is Missing Its Identity",description:"Credentials are stored for this profile but no identity is, so there is nothing to report. Logging out and back in rewrites both.",source:"cli",severity:"fatal",expected:!0},BUNDLE_KIND_MISMATCH:{code:"AX-CLI-005",title:"Wrong Bundle Kind",description:"The bundler produced an artifact of a different kind than the command expected. This is a wiring fault in our own code, not something a project can cause.",source:"cli",severity:"fatal"},ATTACH_UNREACHABLE:{code:"AX-TUI-045",title:"Agent Not Reachable",description:"Nothing answered at that address. The agent may not be running, may be on a different port, or may be behind something that refused the connection. `axon dev` prints the address it bound to.",source:"tui",severity:"fatal",expected:!0},ATTACH_URL_INVALID:{code:"AX-TUI-049",title:"Attach URL Invalid",description:"The address is not a usable agent URL. An agent is reached over http or https and the scheme is required \u2014 `localhost:3010` is a path, `http://localhost:3010` is an address. Checked before anything connects, so a typo fails immediately rather than as a transport error.",source:"tui",severity:"fatal"},DEPLOYMENT_NOT_CONNECTABLE:{code:"AX-TUI-028",title:"Deployment Not Connectable",description:"The deployment is not in the connectable list \u2014 it may have stopped, errored, or never finished provisioning. Refresh the deployment list and try again.",source:"tui",severity:"fatal"},SUBAGENT_REMOTE_PARENT:{code:"AX-TUI-027",title:"Cannot Spawn A Subagent From A Deployment",description:"A subagent is forked from its parent's local project, and an attached deployment has no local project here \u2014 the deployed agent runs its own subagents inside its own capsule.",source:"tui",severity:"fatal"},BASE_MODEL_INSTANCE_CONFLICT:{code:"AX-TUI-026",title:"Managed Model Instance Already Running",description:"A managed base instance is already running on a different engine. The base workspace holds one shared config, so spawning a second naked model would rewrite it underneath the live instance \u2014 close the running one first.",source:"tui",severity:"fatal"},NOT_WIRED:{code:"AX-TUI-008",title:"Not Wired Yet",description:"This surface is a declared stub \u2014 the real implementation hasn't been built yet.",source:"tui",severity:"fatal"},MIC_ALREADY_CAPTURING:{code:"AX-TUI-009",title:"Mic Already Capturing",description:"capture.start() was called while a capture was already in progress \u2014 stop the current one first.",source:"tui",severity:"fatal"},MIC_CAPTURE_UNAVAILABLE:{code:"AX-TUI-010",title:"No Audio Capture Tool Found",description:"Voice input needs one of arecord, sox, or ffmpeg installed and on PATH.",source:"tui",severity:"fatal"},MIC_FFT_SIZE_MISMATCH:{code:"AX-TUI-014",title:"FFT Sample Size Mismatch",description:"computeBuckets() was called with a sample buffer that isn't exactly config.fftSize long \u2014 an internal invariant, callers must pad/trim first.",source:"tui",severity:"fatal"},MIC_CAPTURE_FAILED:{code:"AX-TUI-015",title:"Mic Capture Failed",description:"The audio capture subprocess produced no output or exited immediately \u2014 check that a microphone is available.",source:"tui",severity:"fatal"},WATCH_PATH_REQUIRED:{code:"AX-TUI-021",title:"Watch Path Required",description:"`axon watch`/`axon unwatch` need a directory argument.",source:"tui",severity:"fatal",expected:!0},WATCH_PATH_NOT_FOUND:{code:"AX-TUI-022",title:"Watch Path Not Found",description:"`axon watch` was given a directory that doesn't exist on disk.",source:"tui",severity:"fatal",expected:!0},EDITOR_NOT_SET:{code:"AX-TUI-023",title:"No Editor Configured",description:"`axon settings` needs the $EDITOR environment variable set to know which editor to open.",source:"tui",severity:"fatal"},EDITOR_LAUNCH_FAILED:{code:"AX-TUI-024",title:"Editor Failed To Launch",description:"The command in $EDITOR could not be spawned \u2014 check that it's installed and on PATH.",source:"tui",severity:"fatal"},WATCH_AND_INIT_ARGS_REQUIRED:{code:"AX-TUI-025",title:"Directory And Name Required",description:`The init palette's "watch a new directory" entry needs both a directory path and an agent name, space-separated.`,source:"tui",severity:"fatal",expected:!0},MODULE_CONFIG_LOAD_FAILED:{code:"AX-MODULE-001",title:"Module Config Failed To Load",description:"The runtime could not import a module's module.config.ts at boot \u2014 the file is missing at its resolved path, or importing it threw. A module that cannot load contributes nothing, so boot fails rather than run a partially-wired agent.",source:"runtime",severity:"fatal"},MODULE_SOURCE_DECLARED:{code:"AX-MODULE-008",title:"Module Declared As Source",description:"Uninstall was asked to remove a module that axon.config.ts declares as an IMPORT rather than by registry name. The import statement is the author's own code, so uninstall does not rewrite it \u2014 and removing the dependency alone would leave the config importing a package that is no longer declared, with the agent still loading it. Nothing was changed: delete the import and its entry in modules: [...] by hand.",source:"cli",severity:"fatal"},MODULE_NOT_INSTALLED:{code:"AX-MODULE-003",title:"Module Not Installed",description:"A plugin asked for the options of a module this agent does not have installed \u2014 almost always a name mismatch between the plugin and the module that ships it. Reported rather than defaulted: handing back an empty options bag would let a hardware module open the wrong device and never say so.",source:"runtime",severity:"fatal"},MODULE_OPTIONS_INVALID:{code:"AX-MODULE-002",title:"Invalid Module Options",description:"The options declared for a module under modules.<name> in axon.config.ts do not satisfy the module's options schema \u2014 a required option is missing or a value has the wrong type.",source:"runtime",severity:"fatal"},MODULE_SETUP_FAILED:{code:"AX-MODULE-007",title:"Module Setup Failed",description:"A module's setup() threw during agent boot. Setup runs sequentially in blueprint order and a failure is total \u2014 no later module is wired, and the agent does not boot half-configured.",source:"runtime",severity:"fatal"},MODULE_SERVER_NOT_WIRED:{code:"AX-MODULE-004",title:"Module Server API Not Wired",description:"A module's setup() called ctx.server.addRoute/addMiddleware or ctx.tools.get, but that surface is not implemented yet. Declare routes as server/api/ files in the module instead.",source:"runtime",severity:"fatal"},MODULE_ENV_REQUIRED:{code:"AX-MODULE-005",title:"Module Env Var Missing",description:"A module's setup() called ctx.env.require() for a variable the agent's resolved environment does not provide. The module declares required env in module.config.ts; the agent must supply it (e.g. in .env).",source:"runtime",severity:"fatal",expected:!0},MODULE_POLICY_IMMUTABLE:{code:"AX-MODULE-006",title:"Module Policy Is Immutable At Boot",description:"A module's setup() called ctx.policy.update(). The resolved agent policy is authoritative and cannot be mutated at boot \u2014 declare policy needs statically in module.config.ts so the CLI reconciles them at install.",source:"runtime",severity:"fatal",expected:!0},CLONE_REF_REQUIRED:{code:"AX-PROJECT-022",title:"No Artifact Named",description:"`axon clone` was run without an artifact to clone. Name one, for example: axon clone @axon/arxiv",source:"cli",severity:"fatal",expected:!0},FORK_REF_REQUIRED:{code:"AX-PROJECT-023",title:"No Artifact Named",description:"`axon fork` was run without an artifact to fork. Name one, for example: axon fork @axon/arxiv --as @you/arxiv",source:"cli",severity:"fatal"},FORK_NAME_REQUIRED:{code:"AX-PROJECT-024",title:"Fork Needs A New Name",description:"A fork is published under your own namespace, so it needs a name: pass --as <package-name>, for example: axon fork @axon/arxiv --as @you/arxiv",source:"cli",severity:"fatal"},CLONE_TARGET_EXISTS:{code:"AX-PROJECT-025",title:"Clone Target Not Empty",description:"The directory the artifact would be cloned into already has files in it. Clone into a new directory, or clear this one first.",source:"cli",severity:"fatal"},ARTIFACT_DOWNLOAD_FAILED:{code:"AX-PROJECT-026",title:"Artifact Download Failed",description:"The registry did not serve the artifact's source archive. The version may have been unpublished, or the network request failed.",source:"cli",severity:"fatal"},ARTIFACT_EXTRACT_FAILED:{code:"AX-PROJECT-027",title:"Artifact Extract Failed",description:"The downloaded archive could not be unpacked. It may be truncated, or `tar` is unavailable on this machine.",source:"cli",severity:"fatal"},VERSION_INVALID:{code:"AX-PROJECT-028",title:"Invalid Version",description:"The project's package.json version is not valid semver, so the next version cannot be derived from it. Fix the version field by hand.",source:"cli",severity:"fatal"},FRAMEWORK_NOT_INSTALLED:{code:"AX-PROJECT-029",title:"Framework Packages Not Installed",description:"The generated type frame references @arcforge/types, @arcforge/engines and h3, none of which resolve from this project. Run `bun install` before `axon prepare`.",source:"cli",severity:"fatal"},FRAME_MIGRATION_CONFLICT:{code:"AX-PROJECT-034",title:"Frame Migration Cannot Proceed Safely",description:"Runtime output exists in BOTH the old location and the new one, so migrating would have to merge or overwrite two sets of session history. Nothing was moved. Inspect both directories and remove or merge them by hand.",source:"cli",severity:"fatal"},CONFIG_EVALUATION_ESCAPED:{code:"AX-PROJECT-030",title:"defineAgent() Called Outside Config Evaluation",description:"defineAgent() ran outside the loader that evaluates axon.config.ts \u2014 it is a declaration helper, not a runtime function, and cannot be called from application code.",source:"cli",severity:"fatal"},PROMPT_NOT_INSTALLABLE:{code:"AX-PROJECT-037",title:"Prompts Are Not Installed Into Agents",description:"A prompt is content, not a capability: it resolves from the global cache and renders on demand, so every agent can already use it without declaring anything. Installing one into an agent would put content through the code path \u2014 an ABI check, a node_modules link, an agent reload \u2014 for something that needs none of it.",source:"manifest",severity:"fatal"},ASSET_TYPE_REFUSED:{code:"AX-PROJECT-038",title:"Unsupported Asset Type",description:"A file in assets/ is not a type the registry serves. Images (png, jpg, jpeg, webp, gif) and video (mp4, webm, mov) are accepted. SVG is deliberately refused: it is an executable document that would be served from our own storage origin, so a published SVG is a script-injection surface for every visitor reading that README.",source:"manifest",severity:"fatal",expected:!0},ASSET_TOO_LARGE:{code:"AX-PROJECT-039",title:"Asset Exceeds Size Limit",description:"A single file in assets/ is over the per-asset limit. Assets exist to illustrate a README, not to distribute media \u2014 compress the file or link to it externally.",source:"manifest",severity:"fatal",expected:!0},ASSETS_BUDGET_EXCEEDED:{code:"AX-PROJECT-040",title:"Assets Exceed Total Budget",description:"The assets/ folder as a whole is over budget for one published version. Every version stores its own copy of every asset, so the total is what determines how much a package costs to host forever.",source:"manifest",severity:"fatal",expected:!0},ASSET_PATH_INVALID:{code:"AX-PROJECT-041",title:"Unsafe Asset Path",description:"An entry under assets/ is a symlink, or its name escapes the assets directory. Both are refused: a published asset must be a real file that lands where its name says it does, or extraction on the server could write outside the target directory.",source:"manifest",severity:"fatal",expected:!0},ASSET_UNREADABLE:{code:"AX-PROJECT-042",title:"Asset Could Not Be Processed",description:"A file in assets/ has an image extension but could not be decoded, so it is either corrupt or not the format its name claims. Publishing it would ship a broken image into a README.",source:"manifest",severity:"fatal",expected:!0},PORT_UNAVAILABLE:{code:"AX-PROJECT-031",title:"No Free Port",description:"Every port in the range the agent scanned is already in use. Stop whatever is holding them, or start the agent on a different port.",source:"cli",severity:"fatal"},PARENT_INSTANCE_NOT_RUNNING:{code:"AX-RUNTIME-005",title:"Parent Agent Not Running",description:"A subagent was requested against a parent session that is no longer live \u2014 the parent shut down, crashed, or was never booted by this process.",source:"runtime",severity:"fatal"},SUBAGENT_DEPTH_EXCEEDED:{code:"AX-RUNTIME-006",title:"Subagent Depth Limit Reached",description:"An agent tried to spawn a subagent beyond the maximum nesting depth. The limit exists so a recursive delegation cannot spawn processes without bound.",source:"runtime",severity:"fatal"},SUBAGENT_CHILD_LIMIT_EXCEEDED:{code:"AX-RUNTIME-007",title:"Subagent Child Limit Reached",description:"One agent tried to hold more live children than the limit allows. Existing children must finish before more can be spawned.",source:"runtime",severity:"fatal"},SUBAGENT_DESCENDANT_LIMIT_EXCEEDED:{code:"AX-RUNTIME-008",title:"Subagent Descendant Limit Reached",description:"The whole subagent tree beneath one root exceeded its live-descendant budget. The limit bounds total concurrent processes, not just direct children.",source:"runtime",severity:"fatal"},SUBAGENT_REQUEST_INVALID:{code:"AX-RUNTIME-009",title:"Malformed Subagent Request",description:"A subagent request did not carry a usable prompt. It must be an object with `prompt` as a string or an array of strings.",source:"runtime",severity:"fatal"},INSTANCE_NOT_LOCAL:{code:"AX-RUNTIME-010",title:"Agent Instance Is Not Local",description:"An operation that only works against a locally booted agent was given a remote one. Subagent spawning and the managed base workspace both require a local process.",source:"runtime",severity:"fatal"},HOST_METHOD_UNKNOWN:{code:"AX-RUNTIME-011",title:"Unknown Host Method",description:"A booted agent called a host method this platform does not implement. The agent's framework version is likely newer than the CLI running it.",source:"runtime",severity:"fatal"},UPDATE_CURRENT_VERSION_INVALID:{code:"AX-TUI-029",title:"Running Version Is Not Semver",description:"The version this app reports for itself is not valid semver, so it cannot be compared against the latest release.",source:"cli",severity:"fatal"},UPDATE_RELEASE_INVALID:{code:"AX-TUI-030",title:"Malformed Release Record",description:"The backend's release record did not describe a valid @arcforge/axon `latest` version, so there is nothing safe to update to.",source:"cli",severity:"fatal"},UPDATE_UNAVAILABLE_IN_DEVELOPMENT:{code:"AX-TUI-031",title:"Update Not Available Here",description:"Self-update needs the packaged update helper and a supervisor request path, neither of which exists in a source checkout. Update the installed app instead.",source:"cli",severity:"fatal"},UPDATE_SUPERVISOR_UNAVAILABLE:{code:"AX-TUI-032",title:"Update Supervisor Unavailable",description:"The running app has no supervisor request path, so it cannot hand an update off to be applied after exit.",source:"cli",severity:"fatal"},UPDATE_HELPER_ARGS_INVALID:{code:"AX-TUI-033",title:"Malformed Update Helper Arguments",description:"The update helper was invoked without the --from/--to/--bun/--axon/--state arguments it requires. It is spawned by the app, not run by hand.",source:"cli",severity:"fatal"},UPDATE_HELPER_VERSION_INVALID:{code:"AX-TUI-034",title:"Update Helper Given Bad Versions",description:"The update helper received a --from or --to value that is not valid semver, so it refused to install anything.",source:"cli",severity:"fatal"},TEST_FILES_NOT_FOUND:{code:"AX-TUI-035",title:"No Test Files Matched",description:"No files matched the requested test patterns, so there was nothing to run. Check the pattern, or the directory it was resolved against.",source:"cli",severity:"fatal"},OLLAMA_UNAVAILABLE:{code:"AX-TUI-037",title:"Ollama Is Not Running",description:"No Ollama daemon answered on this machine. Start it with `ollama serve`, or install Ollama from https://ollama.com to run models locally.",source:"cli",severity:"fatal"},OLLAMA_REQUEST_FAILED:{code:"AX-TUI-038",title:"Ollama Request Failed",description:"The local Ollama daemon is running but refused a request \u2014 most often an unknown model name. The daemon's own message is included.",source:"cli",severity:"fatal"},OLLAMA_REGISTRY_UNREACHABLE:{code:"AX-TUI-039",title:"Ollama Registry Unreachable",description:"Could not reach the Ollama model registry to look a model up. Downloading needs a network connection; models already on disk still work offline.",source:"cli",severity:"fatal"},NO_EDITOR_ATTACHED:{code:"AX-TUI-042",title:"No Editor Attached",description:"Opening a pane hands it to a connected editor, and none is listening. Open this project in an editor running the Axon Fleet extension \u2014 it dials each running TUI itself, so the connection appears on its own once the window is up.",source:"tui",severity:"fatal"},NO_SESSION_TO_OPEN:{code:"AX-TUI-043",title:"No Session To Open",description:"A runtime pane is a view of one conversation, and no agent is focused yet \u2014 so there is nothing to point it at. Start or focus an agent first.",source:"tui",severity:"fatal"},CLEAR_IMMUTABLE_DEPLOYED:{code:"AX-TUI-041",title:"Cannot Clear A Deployment's Conversation",description:"A deployed agent owns its own session in the cloud \u2014 the TUI attaches to whatever session it is already running, so there is no fresh one to start from here. Use `:close` to detach, or clear it on a local instance of the same agent.",source:"tui",severity:"fatal"},OLLAMA_PULL_FAILED:{code:"AX-TUI-040",title:"Model Download Failed",description:"Ollama could not finish downloading the model. The name may not exist in the registry, or the transfer was interrupted \u2014 a retry resumes from whatever was already fetched.",source:"cli",severity:"fatal"},TEST_PRELOAD_MISSING:{code:"AX-TUI-036",title:"Test API Loaded Without Its Preload",description:"The instrumented test API was imported without the preload that installs it. Tests must run through `axon test`, which wires the preload.",source:"cli",severity:"fatal"},PROFILE_CONFIG_INVALID:{code:"AX-EXT-001",title:"profile.config.ts Did Not Call defineProfile()",description:"A profile's config must default-export defineProfile({ ... }). Without it there is no extension list to read, so nothing can be installed, enabled or disabled. The rest of the profile \u2014 main.ts and plugins/ \u2014 still loads.",source:"tui",severity:"fatal",expected:!0},PROFILE_CONFIG_FAILED:{code:"AX-EXT-002",title:"profile.config.ts Failed to Load",description:"The file threw while being evaluated, so its extension list could not be read and no extensions were loaded. The profile's own main.ts and plugins/ are unaffected \u2014 a typo in an extension list must not cost you the config you already had working.",source:"tui",severity:"degraded",expected:!0},EXTENSION_ENTRY_INVALID:{code:"AX-EXT-003",title:"Malformed Extension Entry",description:'An entry in profile.config.ts\'s `extensions` array is neither a string nor an object with a `source`. Accepted forms are "@scope/name" for a registry extension and "./extensions/name" for a local one.',source:"tui",severity:"degraded",expected:!0},EXTENSION_NOT_FOUND:{code:"AX-EXT-004",title:"Extension Not Found",description:"An extension listed in profile.config.ts is not on disk. A local path may have moved or been deleted; a registry name may never have been installed. Everything else in the list still loads.",source:"tui",severity:"degraded",expected:!0},EXTENSION_INSTALL_FAILED:{code:"AX-EXT-005",title:"Extension Install Failed",description:"A registry extension could not be fetched or prepared \u2014 most often no network, or a name that does not exist in the registry. It is skipped for this session and retried on the next launch.",source:"tui",severity:"degraded",expected:!0},EXTENSION_UNINSTALL_FAILED:{code:"AX-EXT-028",title:"Extension Uninstall Failed",description:"An extension could not be removed from profile.config.ts \u2014 most often the file is unreadable or has been edited into a shape the editor cannot find the extensions list in. The extension is still declared and will load on the next launch.",source:"tui",severity:"degraded",expected:!0},EXTENSION_NOT_AN_EXTENSION:{code:"AX-EXT-006",title:"Not an Extension",description:"The directory has no extension.config.ts, which is the file that marks a directory as an extension. A path pointing at an agent, a module, or an ordinary folder is not loadable as one.",source:"tui",severity:"degraded",expected:!0},EXTENSION_LOAD_FAILED:{code:"AX-EXT-007",title:"Extension Failed to Load",description:"An extension's main.ts threw while it was being loaded, so whatever it had not yet registered is missing. Its commands, keys and palettes are removed and the rest of your config loads normally.",source:"tui",severity:"degraded",expected:!0},PROFILE_MAIN_FAILED:{code:"AX-EXT-008",title:"main.ts Failed to Load",description:"Your profile's main.ts threw while being evaluated. Anything it registered before the error survives; everything after it did not run. Plugins and extensions still load.",source:"tui",severity:"degraded",expected:!0},AGENT_NO_SUPERVISOR:{code:"AX-AGENT-030",title:"No Supervisor to Boot This Agent",description:"Something asked a platform to spawn an agent, but that platform was built without a supervisor. Supervision holds the provider credential and the session log, so it lives in the daemon rather than in whichever process happened to ask \u2014 a platform used only to read the store or publish a project does not need one, and this is where the difference surfaces.",source:"runtime",severity:"fatal",expected:!0},MODEL_RUNTIME_MISSING:{code:"AX-MODEL-031",title:"That Runtime Is Not Installed",description:"An adapter recognised the model and the library that executes it is not on this machine. Local inference runtimes are optional because they are large \u2014 ONNX Runtime alone is around 300MB of native binaries \u2014 so they are installed when first wanted rather than shipped with the CLI.",source:"daemon",severity:"fatal",expected:!0},MODEL_LOAD_FAILED:{code:"AX-MODEL-032",title:"The Model Could Not Be Loaded",description:"A runtime recognised the file and failed to read it. Distinct from an unsupported format: this weight is one this machine can execute in principle, so the file itself is the problem \u2014 truncated, corrupt, or not the model its name claims.",source:"daemon",severity:"fatal"},MODEL_WILL_NOT_FIT:{code:"AX-MODEL-033",title:"Not Enough Memory for This Model",description:"The weight loaded and did not fit within this machine's ceiling, so it was unloaded again. The refusal names what is holding the memory \u2014 a model already resident, or another process entirely, since the check measures the whole card rather than Axon's share. Nothing is evicted automatically: a silent eviction is another agent mysteriously slowing down.",source:"daemon",severity:"degraded",expected:!0},MODEL_NOT_RESIDENT:{code:"AX-MODEL-034",title:"That Model Is Not Loaded",description:"Inference was asked of a weight that is not in memory. Loading is never implicit: it is a claim on the machine's memory, and taking one a caller did not ask for would make admission invisible at the moment it matters.",source:"daemon",severity:"degraded",expected:!0},MODEL_NOT_CACHED:{code:"AX-MODEL-035",title:"That Model Is Not On This Machine",description:"A weight was asked for that has not been fetched. The daemon caches models content-addressed and machine-wide, so one download serves every agent \u2014 but it only serves what has actually been downloaded.",source:"daemon",severity:"degraded",expected:!0},MODEL_NO_SINGLE_WEIGHT:{code:"AX-MODEL-036",title:"That Repository Has No Single Weight",description:"A repository was asked for by name and publishes several weights with no obvious one to take \u2014 an encoder-decoder export ships both halves and needs both, and a quantised set is a choice about quality rather than a default. Name the file to fetch. Guessing would download half a model that fails at load with something obscure.",source:"daemon",severity:"degraded",expected:!0},MODEL_NO_RUNTIME:{code:"AX-MODEL-030",title:"No Runtime Can Execute This Model",description:"The weight is on this machine and no adapter claims it. Runtimes are registered per format \u2014 ONNX, llama.cpp \u2014 and a file none of them recognises can be fetched and cached but not loaded. Either the format needs an adapter, or the file is not the model it appears to be.",source:"daemon",severity:"fatal",expected:!0},DAEMON_NOT_RUNNING:{code:"AX-DAEMON-001",title:"The Axon Daemon Is Not Running",description:"Something asked axond for machine-wide state \u2014 what is loaded on the GPU, which agents are running \u2014 and no daemon is listening. Start it with `axon daemon up`. Local work that does not need shared state is unaffected.",source:"daemon",severity:"degraded",expected:!0},DAEMON_ALREADY_RUNNING:{code:"AX-DAEMON-002",title:"A Daemon Is Already Running",description:"A second axond was asked to start while one is already listening on this socket. One daemon per user per machine is the whole point \u2014 two would each believe they owned the GPU. Nothing was started; the existing one is untouched.",source:"daemon",severity:"degraded",expected:!0},DAEMON_SOCKET_UNAVAILABLE:{code:"AX-DAEMON-003",title:"Could Not Bind the Daemon Socket",description:"axond could not listen on its unix socket. Usually a stale socket file left by a process killed with -9, which the daemon removes on start; if it persists, the path may be unwritable or on a filesystem that does not support unix sockets.",source:"daemon",severity:"fatal"},DAEMON_START_FAILED:{code:"AX-DAEMON-004",title:"The Daemon Failed to Start",description:"axond was spawned but never reported itself ready. Its output is in the daemon log named by the detail; the usual causes are a port or socket conflict and a broken profile config.",source:"daemon",severity:"fatal"},DAEMON_NOT_WIRED:{code:"AX-DAEMON-005",title:"That Part of the Daemon Is Not Built Yet",description:"A domain the daemon declares exists but is not implemented. It throws rather than answering, because a stub returning an empty list is indistinguishable from a real answer and gets built on top of.",source:"daemon",severity:"degraded",expected:!0},EXTENSION_LOAD_TIMEOUT:{code:"AX-EXT-034",title:"Extension Took Too Long to Load",description:"A config file did not finish evaluating within the load budget \u2014 usually a blocking loop or a synchronous wait at module scope. Loading continued without it, so its commands, keys and palettes are missing; everything else in your config still loaded. The file itself keeps running until it finishes, because there is no safe way to interrupt code mid-execution.",source:"tui",severity:"degraded",expected:!0},PLUGIN_FAILED:{code:"AX-EXT-009",title:"Plugin Failed to Load",description:"A file in plugins/ threw while being imported, so its hooks were not registered. Other plugins in the same folder are unaffected \u2014 each file is loaded independently.",source:"tui",severity:"degraded",expected:!0},HOOK_FAILED:{code:"AX-EXT-010",title:"Lifecycle Hook Failed",description:"A tui.hook() handler threw while the event it listens for was firing. For a notification hook nothing else is affected; for a gating hook (tui:boot, tui:shutdown) the operation continues anyway rather than leaving the terminal stuck.",source:"tui",severity:"degraded",expected:!0},HOOK_TIMED_OUT:{code:"AX-EXT-011",title:"Hook Blocked Too Long",description:"A gating hook (tui:boot or tui:shutdown) did not finish within its budget, so the TUI continued without waiting. A config must never be able to hang the terminal silently \u2014 whatever the handler was doing may not have completed.",source:"tui",severity:"degraded",expected:!0},COMMAND_NOT_FOUND:{code:"AX-EXT-012",title:"No Such Command",description:"commands.run() was given a path that resolves to nothing in the command tree. The path must name a leaf, spelled exactly as it appears in the `:` palette.",source:"tui",severity:"fatal",expected:!0},PALETTE_NOT_FOUND:{code:"AX-EXT-013",title:"No Such Palette",description:"palette.open() was given a name no palette was registered under. Palettes are created with palette.create(name, ...) \u2014 a name is only openable once its registration has run.",source:"tui",severity:"fatal",expected:!0},PALETTE_NAME_TAKEN:{code:"AX-EXT-014",title:"Palette Name Already Registered",description:"Two palettes tried to claim the same name. Names are how palette.open() addresses one, so they have to be unique \u2014 silently replacing the first would make whichever loaded last win, invisibly.",source:"tui",severity:"degraded",expected:!0},PALETTE_ALREADY_OPEN:{code:"AX-EXT-015",title:"A Palette Is Already Open",description:"Something tried to open a palette, or ask a question, while the user was already navigating one. Stealing it mid-navigation would drop whatever they were doing, so the call fails instead \u2014 check palette.isOpen first.",source:"tui",severity:"degraded",expected:!0},KEY_CHORD_UNBOUND:{code:"AX-EXT-022",title:"No Such Key Binding",description:"keys.send() was given a chord nothing is bound to \u2014 neither a mode key nor a registered binding. Sending it would do nothing at all, which is indistinguishable from a binding that ran and had no effect.",source:"tui",severity:"fatal",expected:!0},AGENT_SPAWN_NO_INSTANCE:{code:"AX-EXT-023",title:"Agent Started but No Instance Appeared",description:"A spawn reported success without producing a focused instance, so there is no id to hand back. This is a fault in Axon rather than in your config \u2014 the agent may or may not be running.",source:"tui",severity:"fatal"},PROFILE_CONFIG_MISSING:{code:"AX-EXT-025",title:"No profile.config.ts",description:"The profile has no config file to record the extension in. It is normally created on first launch \u2014 starting Axon once will scaffold it.",source:"tui",severity:"fatal",expected:!0},PROFILE_CONFIG_UNEDITABLE:{code:"AX-EXT-026",title:"profile.config.ts Could Not Be Edited",description:"The `defineProfile({ ... })` call could not be located, or editing it would have produced invalid TypeScript. Nothing was written \u2014 this file is yours, and a botched edit costs your whole TUI config. Add or remove the entry by hand.",source:"tui",severity:"fatal",expected:!0},COMMAND_INVALID:{code:"AX-EXT-029",title:"Command Is Not Registerable",description:"A command was registered with no path, or with no `run` to call. Both are caught here rather than when someone presses Enter on it \u2014 a command that registers cleanly and then does nothing reads as a broken terminal instead of a config mistake, and gives no clue which file to open. Use `commands.register(path, fn)` or `commands.register(path, { run })`.",source:"tui",severity:"degraded",expected:!0},COMPONENT_NAME_TAKEN:{code:"AX-EXT-030",title:"Component Already Registered",description:"Two sources registered the same line component name. The first one loaded keeps it \u2014 your own config beats any extension. A silently shadowed component would render someone else's value under your name, so the second registration fails instead. Component names are `provider:name`; pick a prefix of your own.",source:"tui",severity:"degraded",expected:!0},COMPONENT_UNKNOWN:{code:"AX-EXT-031",title:"No Such Component",description:"A line named a component that is not registered. Caught when the line is created rather than when it paints, because a missing component renders as an empty gap \u2014 which reads as a layout bug instead of a typo, and gives no clue which name was wrong. components.list() returns everything available.",source:"tui",severity:"degraded",expected:!0},LINE_NAME_TAKEN:{code:"AX-EXT-032",title:"Line Already Registered",description:"Two sources registered the same line name. The first one loaded keeps it, the same rule commands and key chords follow.",source:"tui",severity:"degraded",expected:!0},LINE_UNKNOWN:{code:"AX-EXT-033",title:"No Such Line",description:"lines.set(), move(), show(), hide() or toggle() named a line that is not registered. Doing nothing would be indistinguishable from a line that registered and then rendered empty, so this fails instead. lines.list() returns what exists.",source:"tui",severity:"degraded",expected:!0},COMMAND_PATH_TAKEN:{code:"AX-EXT-020",title:"Command Already Registered",description:"Two sources registered the same command path. The first one loaded keeps it \u2014 your own config beats any extension, and between extensions the one listed earlier in profile.config.ts wins. Rename one of them.",source:"tui",severity:"degraded",expected:!0},KEY_CHORD_TAKEN:{code:"AX-EXT-021",title:"Key Chord Already Bound",description:"Two sources bound the same key chord. The first one loaded keeps it. A silently shadowed binding is unbearable to debug in someone else's config, so the second registration fails instead of replacing it.",source:"tui",severity:"degraded",expected:!0},MODE_KEY_TAKEN:{code:"AX-EXT-016",title:"Mode Key Already Bound",description:"A palette asked for a mode key that is already in use \u2014 either by a built-in mode or by another extension. A silently shadowed key is unbearable to debug in someone else's config, so the registration fails loudly instead.",source:"tui",severity:"degraded",expected:!0},MODE_UNKNOWN:{code:"AX-EXT-017",title:"No Such Mode",description:"mode.set() was given a name that is neither a built-in mode nor a registered palette. Doing nothing would look identical to a mode that simply does not render, so this fails instead.",source:"tui",severity:"fatal",expected:!0},NO_FOCUSED_AGENT:{code:"AX-EXT-018",title:"No Agent Focused",description:"A verb that acts on the focused agent \u2014 send, stop, reboot \u2014 was called while nothing was running. Start one with agents.spawn(name) or tui.nav(name) first.",source:"tui",severity:"fatal",expected:!0},INSTANCE_NOT_RUNNING:{code:"AX-EXT-019",title:"Instance Not Running",description:"An instance id was given for a conversation that is not live \u2014 it may already have been stopped, or it belongs to an earlier session. agents.list() returns what is currently running.",source:"tui",severity:"fatal",expected:!0},CONNECT_REJECTED:{code:"AX-EXT-020",title:"Connector Credential Rejected",description:"The platform refused the credential pasted during `:connect`. Verification runs before the value is written, so nothing was stored \u2014 the detail carries the platform's own reason, and the most common cause is copying the wrong secret from the developer portal.",source:"tui",severity:"fatal",expected:!0}}});import{readFileSync as rWi}from"fs";function I1n(e=1){let n=Error().stack;if(!n)return[];return n.split(`
686
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var f8A=dt(()=>{d8A()});import{promisify as $zi}from"util";import{execFile as Ozi}from"child_process";async function p1n(e=zzi){let{stdout:n}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),A=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(n);if(!A)throw new h8A(`Cannot find Windows browser in stdout: ${JSON.stringify(n)}`);let{id:i}=A.groups,s=i.lastIndexOf("."),u=i.lastIndexOf("-"),g=s===-1?void 0:i.slice(0,s),d=u===-1?void 0:i.slice(0,u);return tSt[i]??tSt[g]??tSt[d]??{name:i,id:i}}var zzi,tSt,nSt,h8A;var m1n=dt(()=>{zzi=$zi(Ozi),tSt={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},nSt=new Map(Object.entries(tSt));h8A=class h8A extends Error{}});import{promisify as Wzi}from"util";import d1n from"process";import{execFile as Zzi}from"child_process";async function f1n(){if(d1n.platform==="darwin"){let e=await l1n();return{name:await g1n(e),id:e}}if(d1n.platform==="linux"){let{stdout:e}=await Vzi("xdg-mime",["query","default","x-scheme-handler/http"]),n=e.trim();return{name:Xzi(n.replace(/.desktop$/,"").replace("-"," ")),id:n}}if(d1n.platform==="win32")return p1n();throw Error("Only macOS, Linux, and Windows are supported")}var Vzi,Xzi=(e)=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(n)=>n.toUpperCase());var b8A=dt(()=>{p8A();f8A();m1n();m1n();Vzi=Wzi(Zzi)});import h1n from"process";var eWi,B8A;var C8A=dt(()=>{eWi=Boolean(h1n.env.SSH_CONNECTION||h1n.env.SSH_CLIENT||h1n.env.SSH_TTY),B8A=eWi});import b1n from"process";import _8A from"path";import{fileURLToPath as tWi}from"url";import nWi from"child_process";import AWi,{constants as aWi}from"fs/promises";function Q8A(e){if(typeof e==="string"||Array.isArray(e))return e;let{[E8A]:n}=e;if(!n)throw Error(`${E8A} is not supported`);return n}function RBt({[Q5e]:e},{wsl:n}={}){if(n&&BBe)return Q8A(n);if(!e)throw Error(`${Q5e} is not supported`);return Q8A(e)}var ASt,B1n,I8A,Q5e,E8A,y8A=async(e,n)=>{if(e.length===0)return;let A=[];for(let i of e)try{return await n(i)}catch(s){A.push(s)}throw AggregateError(A,"Failed to open in all supported apps")},aSt=async(e)=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let n=e[ASt]===!0;if(delete e[ASt],Array.isArray(e.app))return y8A(e.app,(B)=>aSt({...e,app:B,[ASt]:!0}));let{name:A,arguments:i=[]}=e.app??{};if(i=[...i],Array.isArray(A))return y8A(A,(B)=>aSt({...e,app:{name:B,arguments:i},[ASt]:!0}));if(A==="browser"||A==="browserPrivate"){let B={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},E={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},Q;if(BBe){let w=await u8A();Q=nSt.get(w)??{}}else Q=await f1n();if(Q.id in B){let w=B[Q.id.toLowerCase()];if(A==="browserPrivate"){if(w==="safari")throw Error("Safari doesn't support opening in private mode via command line");i.push(E[w])}return aSt({...e,app:{name:_5e[w],arguments:i}})}throw Error(`${Q.name} is not supported as a default browser`)}let s,u=[],g={},d=!1;if(BBe&&!HLe()&&!B8A&&!A)d=await c8A();if(Q5e==="darwin"){if(s="open",e.wait)u.push("--wait-apps");if(e.background)u.push("--background");if(e.newInstance)u.push("--new");if(A)u.push("-a",A)}else if(Q5e==="win32"||d){if(s=await eSt(),u.push(...F$.argumentsPrefix),!BBe)g.windowsVerbatimArguments=!0;if(BBe&&e.target)e.target=await l8A(e.target);let B=["$ProgressPreference = 'SilentlyContinue';","Start"];if(e.wait)B.push("-Wait");if(A){if(B.push(F$.escapeArgument(A)),e.target)i.push(e.target)}else if(e.target)B.push(F$.escapeArgument(e.target));if(i.length>0)i=i.map((E)=>F$.escapeArgument(E)),B.push("-ArgumentList",i.join(","));if(e.target=F$.encodeCommand(B.join(" ")),!e.wait)g.stdio="ignore"}else{if(A)s=A;else{let B=!B1n||B1n==="/",E=!1;try{await AWi.access(I8A,aWi.X_OK),E=!0}catch{}s=b1n.versions.electron??(Q5e==="android"||B||!E)?"xdg-open":I8A}if(i.length>0)u.push(...i);if(!e.wait)g.stdio="ignore",g.detached=!0}if(Q5e==="darwin"&&i.length>0)u.push("--args",...i);if(e.target)u.push(e.target);let f=nWi.spawn(s,u,g);if(e.wait)return new Promise((B,E)=>{f.once("error",E),f.once("close",(Q)=>{if(!e.allowNonzeroExitCode&&Q!==0){E(Error(`Exited with code ${Q}`));return}B(f)})});if(n)return new Promise((B,E)=>{f.once("error",E),f.once("spawn",()=>{f.once("close",(Q)=>{if(f.off("error",E),Q!==0){E(Error(`Exited with code ${Q}`));return}f.unref(),B(f)})})});return f.unref(),new Promise((B,E)=>{f.once("error",E),f.once("spawn",()=>{f.off("error",E),B(f)})})},iWi=(e,n)=>{if(typeof e!=="string")throw TypeError("Expected a `target`");return aSt({...n,target:e})},_5e,CBe;var YBt=dt(()=>{g8A();c1n();b8A();i1n();C8A();ASt=Symbol("fallbackAttempt"),B1n=import.meta.url?_8A.dirname(tWi(import.meta.url)):"",I8A=_8A.join(B1n,"xdg-open"),{platform:Q5e,arch:E8A}=b1n;_5e={browser:"browser",browserPrivate:"browserPrivate"};PLe(_5e,"chrome",()=>RBt({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));PLe(_5e,"brave",()=>RBt({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));PLe(_5e,"firefox",()=>RBt({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));PLe(_5e,"edge",()=>RBt({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));PLe(_5e,"safari",()=>RBt({darwin:"Safari"}));CBe=iWi});var iSt;var C1n=dt(()=>{iSt={UNKNOWN:{code:"AX-UNKNOWN-001",title:"Unclassified Error",description:"An error occurred that hasn't been given a proper code yet. This is itself worth fixing \u2014 see the err(cause) call site that produced it.",source:"runtime",severity:"fatal"},PROMPT_NOT_FOUND:{code:"AX-PROMPT-001",title:"Prompt Not Found",description:"The requested prompt could not be resolved \u2014 it is not declared by the agent, or the published package it names ships no prompt by that name.",source:"runtime",severity:"fatal",expected:!0},PROMPT_FILE_NOT_FOUND:{code:"AX-PROMPT-002",title:"Prompt File Missing",description:"The prompt is declared but its source file no longer exists on disk.",source:"runtime",severity:"fatal",expected:!0},PROMPT_RENDER_FAILED:{code:"AX-PROMPT-003",title:"Prompt Render Failed",description:"The prompt's source file failed to compile or render \u2014 likely a malformed SFC (content outside <template>/<script>/<style>) or an error thrown while rendering. See the cause for the underlying parser/render error.",source:"runtime",severity:"fatal"},OUTPUT_INVALID:{code:"AX-OUTPUT-001",title:"Invalid Output Type",description:"The `output` type passed to request() is not valid TypeScript, or references a type that does not exist. Checked before the model is called, so no inference was spent \u2014 fix the type string at the call site.",source:"runtime",severity:"fatal"},OUTPUT_UNSATISFIED:{code:"AX-OUTPUT-002",title:"Output Type Not Satisfied",description:"The model could not produce a response matching the declared `output` type within its retry budget. The accumulated TypeScript diagnostics describe what it got wrong on each attempt.",source:"runtime",severity:"fatal"},OUTPUT_EMPTY:{code:"AX-OUTPUT-003",title:"Model Produced No Output Block",description:"Every reply must wrap its content in a <text> or <script> block \u2014 text outside a block is discarded by the parser. The model replied with none, on every attempt in its retry budget, so there was nothing to render or run. Usually means the model is not following the block protocol rather than that anything is misconfigured: the reply itself is often correct, just unwrapped. Try a different model, or check that the protocol the cognet renders matches the one it parses with.",source:"runtime",severity:"fatal",expected:!0},SCRIPT_NOT_FOUND:{code:"AX-SCRIPT-001",title:"Script Not Found",description:"The requested script was not found in the agent's blueprint. It may not be declared, or the agent needs to be re-prepared.",source:"runtime",severity:"fatal",expected:!0},SCRIPT_FILE_NOT_FOUND:{code:"AX-SCRIPT-002",title:"Script File Missing",description:"The script is declared but its source file no longer exists on disk.",source:"runtime",severity:"fatal",expected:!0},SUBAGENT_LINK_UNSUPPORTED:{code:"AX-SCRIPT-004",title:"Subagent Not Supported Over The Link",description:"An agent asked to spawn a subagent whose child runs as a confined process. `axon.request()` returns a wake's collected entries, while the link's `stimulus` verb returns only admission \u2014 the supervisor needs a verb that collects a wake and answers when it settles. Until that exists this fails rather than returning an admission receipt the caller would read as a result.",source:"runtime",severity:"fatal"},AGENT_BOOT_FAILED:{code:"AX-AGENT-006",title:"Agent Failed To Boot",description:"The agent process exited before it connected to its supervisor. Its own stderr is carried as the detail \u2014 the agent usually knows exactly what went wrong (a missing cognet, a tool that would not compile), and without this that diagnosis died in a pipe while the supervisor reported only a closed socket.",source:"runtime",severity:"fatal"},CAPSULE_NOT_LOCAL:{code:"AX-AGENT-007",title:"No Capsule On This Machine",description:'A console eval was requested against an attached deployment. Its capsule runs wherever the deployment is hosted, so there is nothing here to execute in \u2014 and quietly resolving would read as "it ran and did nothing".',source:"runtime",severity:"fatal",expected:!0},LINK_NO_HANDLER:{code:"AX-LINK-001",title:"No Handler For Link Verb",description:"The peer sent a verb this side does not implement. Both ends speak a versioned contract, so this means they disagree about it \u2014 a wiring fault, not something a user did.",source:"runtime",severity:"fatal"},LINK_PEER_CLOSED:{code:"AX-LINK-002",title:"Agent Disconnected",description:"The agent process closed its side of the link. Every call still in flight is rejected rather than left hanging \u2014 a dead peer must be an error, never a wait that never ends.",source:"runtime",severity:"fatal"},LINK_CLOSED:{code:"AX-LINK-003",title:"Link Closed",description:"The link to the agent was torn down by this side \u2014 a shutdown, a dispose, or a failed boot. Outstanding calls are rejected with this rather than hanging.",source:"runtime",severity:"fatal"},LINK_FRAME_TOO_LARGE:{code:"AX-LINK-004",title:"Link Frame Too Large",description:"A message on the link exceeded the maximum frame size, or a length prefix declared one that did. The prefix is peer-controlled input, so an oversized declaration is refused rather than allocated \u2014 a desynchronised stream cannot be recovered by reading past it.",source:"runtime",severity:"fatal"},LINK_UNKNOWN_PROMPT_ACTION:{code:"AX-LINK-005",title:"Unknown Prompt Action",description:"The prompt verb was called with an action this side does not know. Loud rather than silent: an unrecognised action would otherwise return undefined, which a caller renders as an empty prompt list.",source:"runtime",severity:"fatal"},AGENT_LINK_MISSING:{code:"AX-AGENT-001",title:"Agent Started Without A Supervisor",description:"An agent process was started with no link paths in its environment, which means nothing is supervising it. It cannot guess a socket path \u2014 doing so risks connecting to a different agent's supervisor entirely.",source:"runtime",severity:"fatal"},AGENT_LINK_MALFORMED:{code:"AX-AGENT-002",title:"Malformed Agent Link",description:"The link carrier in the agent's environment is not valid JSON, or does not name both a control and a data socket. Both are required \u2014 an agent with only one connected can accept work it has no way to answer.",source:"runtime",severity:"fatal"},AGENT_BLUEPRINT_MISSING:{code:"AX-AGENT-003",title:"Agent Started Without A Blueprint",description:"An agent process was started with no blueprint path in its environment. The supervisor writes the blueprint beside the sockets before spawning; its absence means the spawn path is broken.",source:"runtime",severity:"fatal"},AGENT_NOT_READY:{code:"AX-AGENT-004",title:"Agent Still Booting",description:"A verb arrived before the agent's runtime finished booting. The link connects first so that boot failures are reportable, which leaves a brief window where the agent can be addressed but cannot answer.",source:"runtime",severity:"fatal"},CLI_AGENT_NOT_LOCAL:{code:"AX-AGENT-005",title:"Command Needs An In-Process Agent",description:"A headless CLI command booted an agent that runs as a separate process, but the command reaches into the runtime directly. This is a wiring fault: the command needs either an in-process agent or a link verb.",source:"runtime",severity:"fatal"},ENGINE_ROLE_UNBOUND_LINK:{code:"AX-ENGINE-010",title:"No Engine For Role",description:"A confined agent asked for inference on a role the supervisor has no engine bound to. Roles are resolved on the supervisor's side before the agent starts, so an unbound one here means resolution and the cognet's declaration disagree.",source:"runtime",severity:"fatal"},ENGINE_KIND_MISMATCH_LINK:{code:"AX-ENGINE-011",title:"Engine Kind Mismatch",description:"A role bound to a transform or session engine was asked to serve a generate call. Resolution already matched the declared type, so reaching here means a provider's create() disagreed with the capability it was handed.",source:"runtime",severity:"fatal"},ENGINE_MISSING:{code:"AX-ENGINE-001",title:"No Engine Configured",description:"The agent's blueprint has no engine \u2014 it cannot dispatch to a model. Set `engine` in axon.config.ts.",source:"runtime",severity:"fatal"},ENGINE_ROLE_UNBOUND:{code:"AX-ENGINE-002",title:"Engine Role Not Bound",description:"The cognet asked for an engine role that resolution did not fill. A required role stops the boot, so reaching this means an OPTIONAL role was used without checking `kernel.engine.has()` first \u2014 or the role was never declared in the cognet's `engines:` block.",source:"runtime",severity:"fatal"},RESOURCES_EXHAUSTED:{code:"AX-RES-001",title:"Not Enough Memory",description:"A local model does not fit in what is left of this machine's video memory. Nothing was evicted: another agent is using it, and taking memory out from under a running agent would slow it down invisibly. Stop an agent that is holding a model, or raise the ceiling in your profile's `resources`.",source:"runtime",severity:"degraded",expected:!0},ENGINE_PIN_UNAVAILABLE:{code:"AX-ENGINE-004",title:"Model Not Available",description:"The agent pins a model no declared provider can supply. The agent still runs \u2014 resolution picked the best available model instead \u2014 but it is NOT the one that was asked for. Declare the provider that supplies it in your profile, or pick a model from a provider you have.",source:"runtime",severity:"degraded",expected:!0},ENGINE_REQUIREMENTS_UNMET:{code:"AX-ENGINE-003",title:"Inference Requirements Unmet",description:"This cognet declares engine roles that nothing among the user's providers can fill. Add a provider that supplies what is missing, or run a cognet whose requirements this machine meets.",source:"runtime",severity:"fatal",expected:!0},INJECT_OUTSIDE_RUNTIME:{code:"AX-RUNTIME-001",title:"Runtime Accessed Before Boot",description:"A runtime global (axon, args) was read before the runtime finished booting.",source:"runtime",severity:"fatal"},BOOT_FAILED:{code:"AX-BOOT-001",title:"Agent Failed To Start",description:"The agent's runtime crashed while starting, before it could accept requests.",source:"runtime",severity:"fatal"},BOOT_SCRIPT_FAILED:{code:"AX-BOOT-002",title:"Boot Script Failed",description:"The agent's boot.vue threw while rendering \u2014 check the script setup block for the error.",source:"runtime",severity:"fatal"},BOOT_SCRIPT_INVALID:{code:"AX-BOOT-003",title:"Boot Script Malformed",description:"The agent's boot.vue has content outside its recognized <script>/<template> blocks, or otherwise failed to parse as a valid SFC.",source:"runtime",severity:"fatal"},COGNET_ACCESSED_BEFORE_LOAD:{code:"AX-COGNET-001",title:"Cognet Accessed Before Load",description:"A cognet global (kernel, phase, system, blueprint) was read before the brain finished loading, or outside the loop body that owns it.",source:"cognet",severity:"fatal"},COGNET_LOOP_ALREADY_DECLARED:{code:"AX-COGNET-002",title:"Loop Already Declared",description:"A cognet's main() called loop() more than once \u2014 the loop is the program's entire main body and can only be declared once.",source:"cognet",severity:"fatal"},COGNET_ALREADY_LOADED:{code:"AX-COGNET-003",title:"Cognet Bound To A Different Kernel",description:"This cognet instance already loaded against a different kernel ABI \u2014 a reload produced a conflicting bind instead of a clean swap.",source:"cognet",severity:"fatal"},COGNET_NO_LOOP:{code:"AX-COGNET-004",title:"Cognet Declared No Loop",description:"The cognet's main() ran (or was woken) without ever declaring loop() \u2014 there is no program to run.",source:"cognet",severity:"fatal"},COGNET_LOAD_FAILED:{code:"AX-COGNET-016",title:"Cognet Failed To Load",description:"The cognet's own main() threw while running at load(). The brain never finished booting, so the agent has nothing to think with. The cause below is the error the cognet's code raised \u2014 it comes from the brain's source, not from Axon.",source:"cognet",severity:"fatal"},COGNET_MAX_TICKS:{code:"AX-COGNET-005",title:"Cognet Exceeded Max Ticks",description:"The cognet's loop ran more ticks in one wake than its configured limit allows \u2014 likely a runaway loop that never calls stop().",source:"cognet",severity:"fatal"},COGNET_ABI_MISMATCH:{code:"AX-COGNET-006",title:"Cognet ABI Mismatch",description:"The compiled cognet targets a kernel ABI version the running kernel doesn't provide \u2014 rebuild the cognet against the current framework version.",source:"cognet",severity:"fatal"},COGNET_MISSING:{code:"AX-COGNET-007",title:"No Compiled Cognet",description:"The blueprint points at a compiled cognet bundle that doesn't exist on disk yet \u2014 run `axon prepare` before booting.",source:"cognet",severity:"fatal"},COGNET_HASH_MISMATCH:{code:"AX-COGNET-008",title:"Cognet Bundle Hash Mismatch",description:"The compiled cognet bundle on disk doesn't match the hash the blueprint expects \u2014 it's stale or was tampered with. Run `axon prepare` again.",source:"cognet",severity:"fatal"},COGNET_INVALID:{code:"AX-COGNET-009",title:"Invalid Cognet Bundle",description:"The compiled cognet's default export isn't a real cognet definition \u2014 the compile step produced something malformed.",source:"cognet",severity:"fatal"},COGNET_IDENTITY_MISMATCH:{code:"AX-COGNET-010",title:"Cognet Identity Mismatch",description:"The compiled cognet artifact's own name doesn't match what the blueprint declared \u2014 the wrong bundle may be at this path.",source:"cognet",severity:"fatal"},COGNET_CONFIG_MISSING:{code:"AX-COGNET-011",title:"Cognet Config Missing",description:"No cognet.config.ts was found in the cognet's source directory \u2014 every cognet needs one to declare its identity.",source:"cognet",severity:"fatal"},COGNET_BUILD_FAILED:{code:"AX-COGNET-012",title:"Cognet Failed To Compile",description:"Bundling the cognet's source into a runnable artifact failed \u2014 check the build log for the underlying syntax or import error.",source:"cognet",severity:"fatal"},COGNET_RUNTIME_UNAVAILABLE:{code:"AX-COGNET-014",title:"Cognet Runtime Temporarily Unavailable",description:"The cognet runtime is declared but not present on disk \u2014 the dependency tree is mid-rewrite. Transient: the reload keeps the previous blueprint and picks the change up on the next watch event.",source:"cognet",severity:"recovered"},COGNET_AMBIGUOUS:{code:"AX-COGNET-015",title:"Two Cognets Declared",description:"The agent both declares `cognet:` in axon.config.ts and holds an inline cognet at `cognet/`. An agent has exactly one brain, and choosing between them silently would either ignore a directory of source or overrule what the author wrote. Keep one.",source:"cognet",severity:"fatal"},COGNET_NOT_FOUND:{code:"AX-COGNET-013",title:"Cognet Not Found",description:"The cognet named by `cognet:` in axon.config.ts could not be located. The detail says where it was looked for \u2014 a registry that answered 404, or a node_modules tree it was missing from. Check the specifier for a typo, and check which registry the CLI is pointed at (AXON_API_BASE).",source:"cognet",severity:"fatal",expected:!0},MODULE_SPECIFIER_INVALID:{code:"AX-PROJECT-005",title:"Invalid Module Specifier",description:"Module names must be scoped as @scope/name. The registry does not accept unscoped packages, so an unscoped specifier can never resolve.",source:"manifest",severity:"fatal"},CONFIG_MODULES_UNPARSEABLE:{code:"AX-PROJECT-006",title:"Could Not Edit axon.config.ts",description:"The install succeeded but the module entry could not be written into the config's modules array automatically \u2014 add or remove it by hand.",source:"manifest",severity:"fatal"},CONFIG_ENGINE_DEPRECATED:{code:"AX-PROJECT-033",title:"`engine:` Is Deprecated And Ignored",description:"This agent's axon.config.ts declares `engine:`, which the runtime no longer reads \u2014 inference is resolving against the profile's providers instead. Use `model: \"codex:gpt-5.6-terra\"` for a cortex pin, and `providers: [...]` for a source the user would not otherwise have.",source:"manifest",severity:"degraded"},MODULE_DEPENDENCY_INSTALL_FAILED:{code:"AX-PROJECT-004",title:"Module Dependencies Failed To Install",description:"The module source was downloaded, but its npm dependencies could not be materialized for the agent. Resolve the package-manager error and run the install again.",source:"manifest",severity:"fatal"},BLUEPRINT_NOT_LOADED:{code:"AX-PROJECT-002",title:"Blueprint Accessed Before Load",description:"Something read the blueprint's current value before load() had ever run.",source:"manifest",severity:"fatal"},AGENT_INVALID:{code:"AX-PROJECT-003",title:"Invalid Agent Directory",description:"The agent root has no package.json \u2014 every agent is a real package, this one isn't.",source:"manifest",severity:"fatal"},CORRUPT_JSON:{code:"AX-PROJECT-016",title:"Corrupt JSON File",description:"A stored JSON file failed to parse \u2014 it may have been hand-edited into an invalid state, or a write was interrupted mid-flight.",source:"manifest",severity:"fatal"},FILE_UNREADABLE:{code:"AX-PROJECT-032",title:"File Could Not Be Read",description:"A file exists but could not be read \u2014 most often a permissions problem, a directory where a file was expected, or a disk error. Distinct from a missing file, which is an ordinary absent-surface state.",source:"manifest",severity:"fatal"},PROVIDER_NOT_CONNECTED:{code:"AX-TUI-011",title:"Provider Not Connected",description:"The selected model routes through a provider (OpenRouter, Codex) that isn't connected yet \u2014 connect it before picking a model on that route.",source:"tui",severity:"fatal",expected:!0},PALETTE_INPUT_REQUIRED:{code:"AX-TUI-012",title:"Required Input Missing",description:"A palette command needs a value for this field before it can run.",source:"tui",severity:"fatal",expected:!0},BENCH_NO_CASES:{code:"AX-TUI-013",title:"Bench Declared No Cases",description:"The bench's test file ran to completion under Bun but never declared a single benchmark case.",source:"tui",severity:"fatal"},TOOL_GLOBAL_COLLISION:{code:"AX-TOOL-409",title:"Tool Global Collides With A Builtin",description:"A flattened tool export has the same name as something that already exists in the agent's global scope, and replacing it would break the code around it. Reach this member through `axon.tools.<namespace>.<member>`, rename the export, or drop `flat` so the module lands under its own namespace instead.",source:"manifest",severity:"fatal",expected:!0},SCRIPT_FAILED:{code:"AX-SCRIPT-500",title:"Script Failed",description:"A script declared by this agent was invoked and threw. The agent's own error follows \u2014 this is the script's failure, not the runtime's.",source:"runtime",severity:"fatal",expected:!0},AGENT_SERVE_NO_PORT:{code:"AX-AGENT-503",title:"No Free Port",description:"The agent tried to bind its HTTP surface and every port in the range it walked was already in use. Free one, or pass a different port with --port.",source:"runtime",severity:"fatal",expected:!0},AGENT_NOT_FOUND:{code:"AX-AGENT-404",title:"Agent Not Found",description:"No local agent goes by this name. Agent references resolve against your local pools only \u2014 watched paths first, then installed agents \u2014 and never fetch from the registry. Install it first with `axon install`.",source:"manifest",severity:"fatal",expected:!0},AGENT_AMBIGUOUS:{code:"AX-AGENT-409",title:"Ambiguous Agent Name",description:"More than one local pool holds an agent with this name, and there is no correct way to guess which was meant \u2014 pass an explicit path, or unwatch one of the roots.",source:"manifest",severity:"fatal",expected:!0},PROJECT_NOT_FOUND:{code:"AX-PROJECT-017",title:"Project Not Found",description:"No axon.config.ts, module.config.ts, cognet.config.ts, bench.config.ts, or prompt.config.ts was found at this path \u2014 it isn't a recognized project directory.",source:"manifest",severity:"fatal",expected:!0},PROJECT_WRONG_KIND:{code:"AX-PROJECT-011",title:"Wrong Project Kind",description:"This command targets one project kind, and the directory holds another \u2014 run the command that matches what is actually here.",source:"manifest",severity:"fatal",expected:!0},PROJECT_EXISTS:{code:"AX-PROJECT-018",title:"Project Already Exists",description:"Scaffolding refused to overwrite a directory that already exists \u2014 remove it or pick a different name first.",source:"manifest",severity:"fatal"},TYPEGEN_NO_BLUEPRINT:{code:"AX-PROJECT-007",title:"Typegen Needs A Loaded Blueprint",description:"Agent-kind typegen was called without a blueprint \u2014 its declared surfaces are the source of the generated types.",source:"manifest",severity:"fatal"},DEPLOY_AGENTS_ONLY:{code:"AX-PROJECT-008",title:"Only Agents Can Deploy",description:"A module was asked to deploy on its own \u2014 modules only run installed inside an agent, deploy the agent instead.",source:"manifest",severity:"fatal"},BUNDLE_IMAGE_FAILED:{code:"AX-PROJECT-039",title:"Image Build Failed",description:"`docker build` did not succeed. Its own output is above \u2014 that is the real diagnostic. Check that a Docker daemon is running, and that the base image can be pulled.",source:"manifest",severity:"fatal",expected:!0},CONFIG_IMPORT_ESCAPES_ROOT:{code:"AX-PROJECT-038",title:"Config Imports Outside The Project",description:"axon.config.ts imports a file from outside this project's directory. A bundle contains the project and nothing above it, so that file is not published with it \u2014 the agent loads locally and then fails at boot in the cloud, after provisioning has already been paid for. Move what it needs inside the project, or publish it and import it by name.",source:"manifest",severity:"fatal",expected:!0},PUBLISH_NAMESPACE_DENIED:{code:"AX-PROJECT-036",title:"That Namespace Is Not Yours",description:"Publishing writes to a scope you own. This package is named for a scope owned by someone else, or by an org you are not a member of \u2014 rename it in package.json to a scope you own, or switch to the account that owns this one.",source:"cloud",severity:"fatal",expected:!0},PUBLISH_USERNAME_REQUIRED:{code:"AX-PROJECT-037",title:"A Username Is Required",description:"A username owns your registry namespace, and nothing can be published until one is set. It is set once, on the account, and every package you publish is scoped under it.",source:"cloud",severity:"fatal",expected:!0},PUBLISH_UNSUPPORTED_KIND:{code:"AX-PROJECT-009",title:"This Project Kind Cannot Publish",description:"The registry accepts agents, modules, cognets, benches and prompts. Extensions are not accepted yet \u2014 the `registry_artifact_kind` enum needs the value first, and publishing before then would register under the wrong kind and claim the name in the shared namespace. A profile is never publishable: it holds one person's credentials, history and agents. See KINDS[kind].publishable.",source:"manifest",severity:"fatal"},MODEL_SPECIFIER_INVALID:{code:"AX-MODEL-001",title:"Malformed Model Specifier",description:"A `models:` entry in cognet.config.ts could not be parsed. The short form is `hf:owner/repo/path/to/file` \u2014 a repo alone is ambiguous, since one repo holds many weights.",source:"manifest",severity:"fatal"},MODEL_FETCH_FAILED:{code:"AX-MODEL-002",title:"Model Weights Could Not Be Fetched",description:"A declared model could not be downloaded. Check the repo, file path and revision, and that the machine can reach the registry. A brain without its weights is broken rather than degraded, so this fails at prepare instead of at first inference.",source:"manifest",severity:"fatal"},MODEL_HASH_MISMATCH:{code:"AX-MODEL-003",title:"Model Weights Failed Verification",description:"Downloaded bytes did not hash to the expected value \u2014 the upstream file changed, or the download was corrupted. Nothing is cached: storing unverified weights would make every later run trust them.",source:"manifest",severity:"fatal"},MODEL_NOT_CACHED:{code:"AX-MODEL-004",title:"Declared Model Is Not Cached",description:"`--frozen` asserts the machine is already provisioned, so it will not fetch. Run `axon prepare` without --frozen to populate the model cache.",source:"manifest",severity:"fatal"},PREPARE_FROZEN_DRIFT:{code:"AX-PROJECT-014",title:"Dependencies Drifted From The Lockfile",description:"`--frozen` asserts that package.json, the lockfile and node_modules already agree. Something did not: a dependency is missing, at a version outside its declared range, or declared but no longer selected. Run `axon prepare` without --frozen to reconcile, and commit the result.",source:"manifest",severity:"fatal"},PUBLISH_VERIFY_FAILED:{code:"AX-PROJECT-013",title:"Artifact Does Not Compile",description:"The package was built, but compiling it the way a consumer would failed \u2014 so publishing it would ship something nobody can install. Usually a file the source imports was left out of the package. Published versions are immutable, so this is caught before upload rather than after.",source:"manifest",severity:"fatal"},DEPLOY_PROVISION_FAILED:{code:"AX-PROJECT-012",title:"Deployment Provisioning Failed",description:"The agent was published, but the cloud control plane could not provision its runtime. The request ID identifies the server-side failure.",source:"manifest",severity:"fatal"},DEPLOY_RUNTIME_FAILED:{code:"AX-PROJECT-035",title:"Agent Failed To Start",description:"Cloud infrastructure was provisioned, but the agent process failed during boot. The reported runtime diagnostic identifies the immediate cause.",source:"runtime",severity:"fatal"},DEPLOY_ENV_RESERVED:{code:"AX-PROJECT-043",title:"Reserved Deployment Variable",description:"The production .env file attempts to override a variable owned by the Axon runtime or Cloud Run.",source:"manifest",severity:"fatal"},DEPLOY_ENV_INVALID:{code:"AX-PROJECT-015",title:"Invalid Deployment Variable",description:"The production .env file contains a key that is not a valid environment variable name.",source:"manifest",severity:"fatal"},BUNDLE_MODULE_COLLISION:{code:"AX-PROJECT-019",title:"Module Name Collision",description:"A hard-imported source module's name collides with an already-installed registry module of the same name.",source:"manifest",severity:"fatal"},BUNDLE_INVALID:{code:"AX-PROJECT-010",title:"Invalid Bundle Source",description:"The directory being bundled has no package.json, or its package.json has no name \u2014 every bundle needs a real package identity.",source:"manifest",severity:"fatal"},BUNDLE_TAR_MISSING:{code:"AX-PROJECT-020",title:"tar Not Found",description:"Bundling shells out to the system's tar binary, which isn't on PATH \u2014 install Git for Windows or use WSL on that platform.",source:"manifest",severity:"fatal"},BUNDLE_TAR_FAILED:{code:"AX-PROJECT-021",title:"tar Failed",description:"The tar subprocess exited non-zero while building a bundle archive.",source:"manifest",severity:"fatal"},BENCH_RUN_NOT_FOUND:{code:"AX-BENCH-001",title:"Bench Run Not Found",description:"No recorded bench run exists with this id.",source:"bench",severity:"fatal",expected:!0},BENCH_NOT_FOUND:{code:"AX-BENCH-002",title:"Bench Not Found",description:"No bench.config.ts was found at this path \u2014 it isn't a recognized bench project.",source:"bench",severity:"fatal",expected:!0},BENCH_TESTS_NOT_FOUND:{code:"AX-BENCH-003",title:"Bench Test Files Not Found",description:"The bench config declares test files that don't exist on disk.",source:"bench",severity:"fatal",expected:!0},BENCH_LOCAL_REF_NOT_FOUND:{code:"AX-BENCH-004",title:"Bench Local Reference Not Found",description:"A factor variable references a local file/directory that doesn't exist.",source:"bench",severity:"fatal",expected:!0},BENCH_CONFIG_INVALID:{code:"AX-BENCH-005",title:"Bench Config Invalid",description:"bench.config.ts failed to evaluate or didn't produce a valid bench definition.",source:"bench",severity:"fatal"},BENCH_PACKAGE_NOT_FOUND:{code:"AX-BENCH-006",title:"Bench Package Not Found",description:"No package.json exists at the bench root \u2014 every bench project needs one for identity.",source:"bench",severity:"fatal",expected:!0},BENCH_PACKAGE_NAME_REQUIRED:{code:"AX-BENCH-007",title:"Bench Package Name Required",description:"The bench's package.json has no name field.",source:"bench",severity:"fatal",expected:!0},BENCH_PACKAGE_VERSION_REQUIRED:{code:"AX-BENCH-008",title:"Bench Package Version Required",description:"The bench's package.json has no version field.",source:"bench",severity:"fatal",expected:!0},BENCH_CONTEXT_MISSING:{code:"AX-BENCH-009",title:"Bench Context Missing",description:"The benchmark preload needs AXON_BENCH_CONTEXT set \u2014 it was run outside the bench harness.",source:"bench",severity:"fatal"},BENCH_NO_ACTIVE_CASE:{code:"AX-BENCH-010",title:"No Active Bench Case",description:"A bench emission (measurement, artifact) happened outside any running Bun test \u2014 these calls must occur inside a test case.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_UNAVAILABLE:{code:"AX-BENCH-011",title:"Bench Workspace Unavailable",description:"The bench's workspace directory hasn't been materialized yet for this run.",source:"bench",severity:"fatal"},BENCH_AGENT_UNRESOLVED:{code:"AX-BENCH-012",title:"Bench Agent Unresolved",description:"The bench's declared subject agent isn't a prepared local agent \u2014 run `axon prepare` on it first.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_UNKNOWN:{code:"AX-BENCH-013",title:"Unknown Bench Measurement",description:"A measurement was emitted under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_TYPE:{code:"AX-BENCH-014",title:"Bench Measurement Type Mismatch",description:"A measurement's emitted value doesn't match the type its bench config declaration expects.",source:"bench",severity:"fatal"},BENCH_MEASUREMENT_DOMAIN:{code:"AX-BENCH-015",title:"Bench Measurement Out Of Domain",description:"A measurement's emitted value falls outside the range or category the bench config declares for it.",source:"bench",severity:"fatal"},BENCH_DIMENSION_UNKNOWN:{code:"AX-BENCH-016",title:"Unknown Bench Dimension",description:"A dimension value was set under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_DIMENSION_DOMAIN:{code:"AX-BENCH-017",title:"Bench Dimension Out Of Domain",description:"A dimension's set value isn't one of the categories its bench config declares.",source:"bench",severity:"fatal"},BENCH_AXIS_UNKNOWN:{code:"AX-BENCH-018",title:"Unknown Bench Factor",description:"Something referenced a factor id the running bench's coordinate never assigned a value to.",source:"bench",severity:"fatal"},BENCH_ARTIFACT_UNKNOWN:{code:"AX-BENCH-019",title:"Unknown Bench Artifact",description:"An artifact was emitted under an id the bench config never declared.",source:"bench",severity:"fatal"},BENCH_ARTIFACT_MEDIA_TYPE:{code:"AX-BENCH-020",title:"Bench Artifact Media Type Not Allowed",description:"An artifact was emitted with a media type its bench config declaration doesn't allow.",source:"bench",severity:"fatal"},BENCH_SCHEMA_UNREADABLE:{code:"AX-BENCH-030",title:"Bench Schema Unreadable",description:"bench.config.ts could not be parsed while extracting the measurement schema.",source:"bench",severity:"fatal"},BENCH_SCHEMA_EMPTY:{code:"AX-BENCH-031",title:"Bench Schema Empty",description:"defineBench<Schema> was given a type with no properties \u2014 an empty schema and a failed extraction must never look alike.",source:"bench",severity:"fatal"},BENCH_SCHEMA_UNSUPPORTED_TYPE:{code:"AX-BENCH-032",title:"Bench Measurement Type Unsupported",description:"A measurement is not a boolean, number, union of string literals, or string.",source:"bench",severity:"fatal"},BENCH_SCHEMA_EXTRACTION_FAILED:{code:"AX-BENCH-033",title:"Bench Schema Extraction Failed",description:"The schema worker did not return a schema. Prepare fails rather than continuing with an empty one, which would silently make every measurement undeclared.",source:"bench",severity:"fatal"},BENCH_AXIS_NOT_FOUND:{code:"AX-BENCH-021",title:"Bench Axis Not Found",description:"The bench config's matrix has no axis with this key.",source:"bench",severity:"fatal",expected:!0},BENCH_AXIS_VALUE_NOT_FOUND:{code:"AX-BENCH-022",title:"Bench Axis Value Not Found",description:"The bench config's matrix axis has no declared value with this id.",source:"bench",severity:"fatal",expected:!0},BENCH_WORKSPACE_ESCAPE:{code:"AX-BENCH-023",title:"Bench Workspace Path Escapes Root",description:"A workspace source entry resolved to a path outside the workspace directory \u2014 refused rather than materialized.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_SYMLINK_UNSUPPORTED:{code:"AX-BENCH-024",title:"Bench Workspace Symlinks Unsupported",description:"A workspace source contains a symlink \u2014 not supported when materializing a bench workspace.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_OUTSIDE_ROOT:{code:"AX-BENCH-025",title:"Bench Template Outside Root",description:"A workspace template's declared source path resolves outside the bench project root.",source:"bench",severity:"fatal"},BENCH_WORKSPACE_SOURCE_NOT_FOUND:{code:"AX-BENCH-026",title:"Bench Template Not Found",description:"A workspace template's declared source path isn't a real directory.",source:"bench",severity:"fatal",expected:!0},BENCH_LOG_INVALID:{code:"AX-BENCH-027",title:"Bench Log Invalid",description:"A bench run's event log is missing an entry its projection requires \u2014 the log is incomplete or was written out of order.",source:"bench",severity:"fatal"},TOOL_DECLARE_FAILED:{code:"AX-BLUEPRINT-002",title:"Tool Declaration Failed",description:"Compiling a src/tools/*.ts file's TypeScript declarations failed \u2014 the worker subprocess reported a compile error.",source:"manifest",severity:"fatal"},TOOL_BUNDLE_FAILED:{code:"AX-BLUEPRINT-006",title:"Tool Bundle Failed",description:"Bundling a src/tools/*.ts file to self-contained source failed \u2014 the bundler subprocess reported an error. Tools are bundled so the sandbox loads them without mounting the project; a bundle failure means the tool cannot enter the box.",source:"manifest",severity:"fatal"},ROUTE_LOAD_FAILED:{code:"AX-BLUEPRINT-007",title:"Route Load Failed",description:"A file in server/api/ could not be imported. The agent would serve an endpoint set that is not the declared one \u2014 a caller gets a 404 for a route whose file exists.",source:"manifest",severity:"fatal"},SCRIPT_LOAD_FAILED:{code:"AX-BLUEPRINT-008",title:"Script Load Failed",description:"A file in src/scripts/ could not be processed. `axon run <name>` would report the script as not found while its file sits in the project.",source:"manifest",severity:"fatal"},PLUGIN_LOAD_FAILED:{code:"AX-BLUEPRINT-009",title:"Plugin Load Failed",description:"A plugin could not be imported. Plugins wire server behaviour at boot; one silently missing means the agent runs without behaviour its author declared.",source:"manifest",severity:"fatal"},MIDDLEWARE_LOAD_FAILED:{code:"AX-BLUEPRINT-010",title:"Middleware Load Failed",description:"A middleware file could not be imported. Middleware commonly carries auth and validation, so a silently skipped one is a request path running without the checks its author wrote.",source:"manifest",severity:"fatal"},PROMPT_INTROSPECT_FAILED:{code:"AX-BLUEPRINT-011",title:"Prompt Introspection Failed",description:"A .vue prompt could not be introspected for its props. The prompt would render without the inputs it declares, or not at all.",source:"manifest",severity:"fatal"},CONFIG_NOT_FOUND:{code:"AX-BLUEPRINT-003",title:"Config Not Found",description:"No axon.config.ts exists at this path.",source:"manifest",severity:"fatal",expected:!0},CONFIG_LOAD_FAILED:{code:"AX-BLUEPRINT-004",title:"Config Failed To Load",description:"axon.config.ts threw or failed to evaluate \u2014 check the file for a syntax or runtime error.",source:"manifest",severity:"fatal"},CONFIG_INVALID:{code:"AX-BLUEPRINT-005",title:"Config Invalid",description:"axon.config.ts evaluated but never called defineAgent() \u2014 every agent config must produce one.",source:"manifest",severity:"fatal"},ENGINE_NO_DONE:{code:"AX-KERNEL-001",title:"Engine Stream Ended Without Completing",description:"The model driver's stream ended without ever emitting a completion event \u2014 the engine likely disconnected or crashed mid-response.",source:"kernel",severity:"fatal"},ENGINE_NOT_CONNECTED:{code:"AX-KERNEL-015",title:"Provider Not Connected",description:"This model's route is not connected to your account yet \u2014 run `:provider <name> connect` for the provider named below, or pick a model on a route you are already signed in to.",source:"kernel",severity:"fatal",expected:!0},ENGINE_AUTH_FAILED:{code:"AX-KERNEL-016",title:"Provider Rejected Your Credentials",description:"The provider refused the credential this agent is using \u2014 it has expired, been revoked, or is for a different account. Reconnect the provider, or pick a model on a route you are signed in to.",source:"kernel",severity:"fatal",expected:!0},ENGINE_RATE_LIMITED:{code:"AX-KERNEL-017",title:"Provider Rate Limit Reached",description:"The provider is refusing further calls right now \u2014 either too many requests in a short window, or a subscription whose allowance is spent. Waiting usually clears the first; the second needs a plan change or a different model.",source:"kernel",severity:"fatal",expected:!0},ENGINE_QUOTA_EXHAUSTED:{code:"AX-KERNEL-018",title:"Provider Credits Exhausted",description:"This route has no credit left to spend. Top it up, or switch to a model on a route that does \u2014 the conversation is intact either way.",source:"kernel",severity:"fatal",expected:!0},ENGINE_REQUEST_REJECTED:{code:"AX-KERNEL-019",title:"Provider Rejected The Request",description:"The provider refused this call as malformed or unsupported \u2014 commonly a model id it does not serve, a context window this conversation has outgrown, or a parameter that route does not accept.",source:"kernel",severity:"fatal",expected:!0},ENGINE_UNREACHABLE:{code:"AX-KERNEL-020",title:"Could Not Reach The Provider",description:"The provider could not be reached, or kept failing, across every retry \u2014 usually a network problem on this machine or an outage on their side. Nothing about this agent needs changing; try again.",source:"kernel",severity:"fatal",expected:!0},ENGINE_STREAM_FAILED:{code:"AX-KERNEL-008",title:"Engine Stream Failed",description:"The model driver's stream failed and exhausted its retries (or the failure wasn't retryable) \u2014 see context for the provider's fault code.",source:"kernel",severity:"fatal"},CODEX_NOT_CONNECTED:{code:"AX-KERNEL-012",title:"Codex Subscription Not Connected",description:"This agent uses a Codex model, but your Axon account is not connected to ChatGPT \u2014 run :provider codex connect and try again.",source:"kernel",severity:"fatal",expected:!0},RUN_IN_PROGRESS:{code:"AX-KERNEL-002",title:"A Wake Is Already Running",description:"The kernel only executes one wake at a time \u2014 a new run was requested while the previous one was still active.",source:"kernel",severity:"recovered"},RUN_RESERVATION_EXPIRED:{code:"AX-KERNEL-003",title:"Wake Reservation Expired",description:"The reserved execution slot for this wake is no longer active \u2014 it was released before the run could start.",source:"kernel",severity:"fatal"},NO_COGNET_LOADED:{code:"AX-KERNEL-004",title:"No Cognet Loaded",description:"The kernel tried to execute a wake, but the blueprint carried no cognet definition to run it against.",source:"kernel",severity:"fatal"},SYSCALL_OUTSIDE_RUN:{code:"AX-KERNEL-005",title:"Syscall Outside An Active Run",description:"A kernel syscall (engine.stream and similar) was made with no active wake to attribute it to.",source:"kernel",severity:"fatal"},CAPSULE_ACCESSED_BEFORE_BOOT:{code:"AX-KERNEL-007",title:"Capsule Accessed Before Boot",description:"Something reached for the live capsule instance before boot() had run \u2014 there is no sandbox yet to hand back.",source:"kernel",severity:"fatal"},COGNET_EMIT_FORBIDDEN:{code:"AX-KERNEL-009",title:"Cognet Emit Forbidden",description:"A cognet tried to emit an event outside the cognet:* namespace \u2014 the ABI only lets a cognet narrate its own telemetry, never forge kernel machinery events.",source:"kernel",severity:"fatal"},KNOWLEDGE_NOT_FOUND:{code:"AX-KERNEL-011",title:"Knowledge Entry Not Found",description:"A cognet read a knowledge entry that does not exist. The knowledge store is not a cache \u2014 a brain reading something the catalogue advertised has hit a real inconsistency, so this is loud rather than an empty result.",source:"kernel",severity:"fatal",expected:!0},KNOWLEDGE_READONLY:{code:"AX-KERNEL-013",title:"Knowledge Entry Is Read-Only",description:"A cognet tried to write or remove knowledge contributed by a module. Module material lives inside its own package and the next install would destroy any change \u2014 so this fails loudly rather than succeeding and vanishing later. An agent's own data/knowledge/ is writable.",source:"kernel",severity:"fatal",expected:!0},KNOWLEDGE_RECORD_FAILED:{code:"AX-KERNEL-014",title:"Knowledge Mutation Went Unrecorded",description:"A knowledge write or remove succeeded on disk, but the session record of it could not be committed. The mutation is real and already visible to the agent; only its audit trail is missing, so this is reported rather than thrown \u2014 the caller cannot undo a completed write. It matters because 'the agent rewrote its own memory' is the fact you want weeks later when behaviour drifts, and here the ledger and the filesystem disagree.",source:"kernel",severity:"degraded"},KNOWLEDGE_ESCAPE:{code:"AX-KERNEL-021",title:"Knowledge Path Escapes Store",description:"A knowledge name resolved outside the store root. Names are identifiers, not paths \u2014 traversal is refused at the boundary rather than trusted not to happen.",source:"kernel",severity:"fatal"},SCHEDULER_MODE_MISMATCH:{code:"AX-KERNEL-010",title:"Scheduler Mode Mismatch",description:"A caller used the wrong wake verb for the cognet's mode: continuous cognets advance via tick(), driven by the body's clock; invocation cognets wake on a stimulus via request()/stream().",source:"kernel",severity:"fatal"},THREAD_UNKNOWN_PARENT:{code:"AX-SESSION-001",title:"Thread Branched From Unknown Parent",description:"A thread's recorded lineage points at a parent thread id that isn't registered in this session \u2014 the session index is inconsistent.",source:"thread",severity:"fatal"},THREAD_NOT_FOUND:{code:"AX-SESSION-002",title:"Thread Not Found",description:"The requested thread id isn't registered in this session.",source:"thread",severity:"fatal",expected:!0},THREAD_BRANCH_UNKNOWN:{code:"AX-SESSION-003",title:"Cannot Branch Unknown Thread",description:"A branch was requested from a parent thread id that isn't registered in this session.",source:"thread",severity:"fatal"},SENSORY_WRITE_FAILED:{code:"AX-SESSION-004",title:"Sensory Ring Write Failed",description:"A dense sense entry (audio or visual) could not be written to the session's sensory ring \u2014 usually a full or read-only data directory. Delivery to the cognet is unaffected; the debug window for this session will have a gap.",source:"runtime",severity:"degraded"},NO_COGNET:{code:"AX-BLUEPRINT-001",title:"No Cognet Declared",description:"The blueprint carries no cognet definition \u2014 an agent cannot run without a brain. The CLI or test harness must construct and pass one.",source:"runtime",severity:"fatal"},CONTROL_PATH_NOT_FOUND:{code:"AX-CONTROL-001",title:"Control Path Not Found",description:"A control-channel call named a method the peer does not expose. The two ends disagree about the surface \u2014 usually a TUI and an extension built from different versions.",source:"server",severity:"fatal",expected:!0},CONTROL_PATH_NOT_CALLABLE:{code:"AX-CONTROL-002",title:"Control Path Not Callable",description:"A control-channel call resolved to a value on the peer's handle that is not a function.",source:"server",severity:"fatal"},CONTROL_CALL_FAILED:{code:"AX-CONTROL-003",title:"Control Call Failed",description:"The peer served a control-channel call and it threw. The remote message is carried here \u2014 the failure surfaces at the local call site rather than being returned as a falsy value.",source:"server",severity:"fatal"},CONTROL_CLOSED:{code:"AX-CONTROL-004",title:"Control Channel Closed",description:"A control-channel call was made, or was still in flight, when the channel closed. In-flight calls reject on close rather than hanging forever on an answer that is no longer coming.",source:"server",severity:"fatal"},CONTROL_UNAUTHORIZED:{code:"AX-CONTROL-005",title:"Control Handshake Rejected",description:"A connection to the control socket presented a missing or incorrect token. The token lives in the instance record, which is readable only by the owning user \u2014 a mismatch means the caller is not the local Fleet extension.",source:"server",severity:"fatal"},PLUGIN_BOOT_FAILED:{code:"AX-SERVER-001",title:"Plugin Failed During Boot",description:"A server plugin threw while running at boot \u2014 plugins are the one place in server startup where a failure must abort the boot rather than being warned and skipped.",source:"server",severity:"fatal"},HANDLE_SHUTDOWN_FAILED:{code:"AX-RUNTIME-002",title:"Handle Failed To Shut Down",description:"One of the runtime's owned handles (kernel, etc.) threw during shutdown \u2014 teardown is error-isolated, so the others still ran, but this one didn't close cleanly.",source:"runtime",severity:"fatal"},BUS_HANDLER_FAILED:{code:"AX-RUNTIME-004",title:"Bus Handler Failed",description:"A handler subscribed to a runtime bus event threw. Handler failures are non-fatal by design \u2014 the remaining handlers still run \u2014 but they are recorded rather than swallowed, since plugins and modules register handlers and a silently-broken one is invisible rot.",source:"runtime",severity:"degraded"},TOOL_CALL_FAILED:{code:"AX-RUNTIME-003",title:"Tool Call Failed",description:"An axon.tools.<namespace>.<fn>() call from script-land completed with a non-ok result from the capsule \u2014 unwrapped here into a normal throw, since script-land expects the ordinary call/throw contract, not the kernel's own stable-result shape.",source:"runtime",severity:"fatal"},CAPSULE_TOOL_TIMEOUT:{code:"AX-CAPSULE-001",title:"Tool Load Timed Out",description:"The sandbox never confirmed loading a declared tool within the timeout \u2014 it may be stuck on a slow import or the subprocess is unresponsive.",source:"capsule",severity:"fatal"},CAPSULE_TOOL_SCOPE_MISMATCH:{code:"AX-CAPSULE-002",title:"Tool Scope Mismatch",description:"A tool's declared exports don't match what it actually exported once loaded in the sandbox \u2014 the bundled source and its declaration have drifted apart.",source:"capsule",severity:"fatal"},CAPSULE_TOOL_FAILED:{code:"AX-CAPSULE-003",title:"Tool Failed To Load",description:"A declared tool failed to load into the sandbox \u2014 its source may be malformed, too large to import, or the subprocess exited before confirming.",source:"capsule",severity:"fatal"},AGENT_ENV_RESERVED:{code:"AX-CAPSULE-012",title:"Reserved Environment Variable",description:"An agent's .env sets a framework-owned variable the runtime controls (AGENT_ID, AXON_API_BASE and similar). These identify the agent to the platform, so overriding one locally would make the agent report itself as something it is not. The deploy path has always refused this; the local path now refuses it identically.",source:"capsule",severity:"fatal"},CAPSULE_NET_UNRESOLVED:{code:"AX-CAPSULE-010",title:"Network Policy Did Not Resolve",description:"A `net.allow` entry names a hostname that did not resolve to any address. Egress rules are installed as addresses, so an unresolvable name becomes no rule at all \u2014 a grant you believe you made and did not. The box refuses to boot rather than run with an allowlist quietly smaller than the one you wrote. Check the hostname, or use a literal address if the name is resolvable only from inside the box.",source:"capsule",severity:"fatal"},CAPSULE_NET_UNAVAILABLE:{code:"AX-CAPSULE-011",title:"Network Confinement Unavailable",description:"The policy declares a `net` allowlist, which needs a userspace network stack (slirp4netns) and nftables inside the box's namespace. One of them is missing on this host. Install slirp4netns and nftables, or drop the `net` block to run with no network at all \u2014 the box will not fall back to unfiltered egress.",source:"capsule",severity:"fatal"},CAPSULE_CONFINE_UNAVAILABLE:{code:"AX-CAPSULE-004",title:"OS Confinement Unavailable",description:"The policy requested OS confinement (isolation: auto) but the host is missing a required primitive (bubblewrap, systemd, nft, or the axon-agent user). Run `axon install`, or set isolation: none to opt out explicitly. The capsule refuses to boot rather than silently run unconfined.",source:"capsule",severity:"fatal"},CAPSULE_CONFINE_USER_UNRESOLVED:{code:"AX-CAPSULE-005",title:"Confinement User Unresolved",description:"The confinement user exists but its numeric uid/gid could not be read \u2014 the box cannot drop privileges without them. The host user database may be inconsistent.",source:"capsule",severity:"fatal"},CAPSULE_BOOT_FAILED:{code:"AX-CAPSULE-006",title:"Capsule Failed To Boot",description:"The sandbox subprocess exited or reported failure before completing the boot handshake. The captured stderr in the error context is the real cause \u2014 most often a confinement mount that could not be satisfied (a declared fs path that does not exist) or a runtime that could not start.",source:"capsule",severity:"fatal"},CAPSULE_BOOT_TIMEOUT:{code:"AX-CAPSULE-007",title:"Capsule Boot Timed Out",description:"The sandbox subprocess did not report ready within the boot timeout. Its captured stderr is in the error context; if empty, the subprocess may be hung rather than crashed.",source:"capsule",severity:"fatal"},CAPSULE_SPAWN_FAILED:{code:"AX-CAPSULE-008",title:"Capsule Spawn Failed",description:"The capsule subprocess command could not be spawned at all \u2014 the interpreter or confinement wrapper was not found, or PATH is unset. Check that bun (and, under confinement, bwrap/systemd-run) are on PATH.",source:"capsule",severity:"fatal"},CAPSULE_WIRE_CLOSED:{code:"AX-CAPSULE-009",title:"Capsule Wire Closed",description:"A command was sent to the sandbox after its stdin pipe was gone \u2014 the subprocess has exited or is mid-teardown. The caller is racing the capsule lifecycle.",source:"capsule",severity:"fatal"},CAPSULE_DOWN:{code:"AX-CAPSULE-023",title:"No Live Capsule",description:"An operation needed a running sandbox subprocess, but none is live \u2014 it is booting, restarting after a crash, or has been declared dead.",source:"capsule",severity:"fatal"},CAPSULE_ALREADY_BOOTED:{code:"AX-CAPSULE-024",title:"Capsule Already Booted",description:"boot() was called on a capsule that already has a live subprocess. Boot is once per lifetime; use update()/reload() to replace a running incarnation.",source:"capsule",severity:"fatal"},CAPSULE_INSTALL_FAILED:{code:"AX-CAPSULE-013",title:"Confinement Install Failed",description:"Provisioning the host for the hardened confinement tier failed \u2014 most often because creating the dedicated system user needs root. Re-run `axon install` with sufficient privilege.",source:"capsule",severity:"fatal"},CAPSULE_HOST_UNAVAILABLE:{code:"AX-CAPSULE-014",title:"Host Bridge Unavailable",description:"Sandboxed code called a host service, but this capsule was built with no host provider. Host calls require a wired host bridge on the manager side.",source:"capsule",severity:"fatal"},CAPSULE_CRASHED:{code:"AX-CAPSULE-015",title:"Capsule Crashed",description:"An unhandled error escaped inside the sandbox subprocess. The capsule reports it on the wire and exits immediately \u2014 after an unhandled throw the sandbox's state is unknown, and a capsule that keeps serving is worse than one that dies loudly.",source:"capsule",severity:"fatal"},CAPSULE_DEAD:{code:"AX-CAPSULE-016",title:"Capsule Dead",description:"The capsule subprocess is gone and supervision gave up restarting it. Every subsequent execution request fails until a new capsule is booted.",source:"capsule",severity:"fatal"},CAPSULE_PARSE_ERROR:{code:"AX-CAPSULE-017",title:"Capsule Wire Parse Error",description:"A line arriving from the sandbox was not a valid protocol event. The sandbox is speaking garbage \u2014 a protocol mismatch or corrupted output \u2014 and the line is dropped rather than acted on, never silently.",source:"capsule",severity:"degraded"},CAPSULE_CMD_FAILED:{code:"AX-CAPSULE-018",title:"Capsule Command Failed",description:"Code executed in the sandbox threw. This is the ordinary failure path for an agent-emitted block or a script-land run() \u2014 the error is the sandboxed code's own, surfaced verbatim.",source:"capsule",severity:"degraded"},CAPSULE_FN_FAILED:{code:"AX-CAPSULE-019",title:"Tool Call Threw",description:"A mediated tool function threw inside the sandbox. The failure is the tool's own; it propagates to the calling code unchanged and is recorded as the closing half of the call's span.",source:"capsule",severity:"degraded"},CAPSULE_PROC_DENIED:{code:"AX-CAPSULE-020",title:"Process Spawn Denied",description:"A process the sandbox tried to start was refused \u2014 denied by policy, killed before it could spawn, or the spawn itself failed. No process was created.",source:"capsule",severity:"degraded"},CAPSULE_PROC_FAILED:{code:"AX-CAPSULE-022",title:"Managed Process Failed",description:"A spawned child process errored without ever producing an exit code \u2014 an exec failure or a broken IPC channel. Distinct from a non-zero exit, which is the process running correctly and reporting a result.",source:"capsule",severity:"degraded"},CAPSULE_PROC_STDIN_FAILED:{code:"AX-CAPSULE-021",title:"Process Stdin Write Failed",description:"Writing to a managed child process's stdin failed \u2014 the process is no longer running, or its stdin has already closed.",source:"capsule",severity:"degraded"},NOT_BOOTED:{code:"AX-TUI-001",title:"No Agent Running",description:"A message was sent, or an action requiring a live agent was taken, before any agent finished booting.",source:"tui",severity:"fatal"},NOT_AUTHENTICATED:{code:"AX-TUI-002",title:"Not Logged In",description:"The action needs an active profile, but none is logged in yet.",source:"tui",severity:"fatal",expected:!0},PROFILE_NOT_AUTHENTICATED:{code:"AX-TUI-003",title:"Profile Has No Session",description:"The target profile exists but has no stored session \u2014 it has never logged in, or its session was cleared.",source:"tui",severity:"fatal",expected:!0},BACKEND_UNREACHABLE:{code:"AX-TUI-044",title:"Backend Unreachable",description:"A stored credential could not be verified because the backend could not be reached. The credential is NOT discarded \u2014 it may be perfectly valid \u2014 but it cannot be trusted until it is checked, so the action is refused rather than proceeding unverified.",source:"tui",severity:"fatal",expected:!0},PROFILE_UNKNOWN:{code:"AX-TUI-004",title:"Unknown Profile",description:"The requested profile id isn't one of the profiles stored on this machine.",source:"tui",severity:"fatal",expected:!0},SESSION_NOT_FOUND:{code:"AX-SESSION-005",title:"Session Not Found",description:"No session log exists at that path. A session is a .jsonl file under the agent's frame (`.agent/data/sessions/`); it may have been deleted, or belong to an agent that has since been removed.",source:"runtime",severity:"fatal",expected:!0},SESSION_UNREADABLE:{code:"AX-SESSION-006",title:"Session Log Unreadable",description:"The session log does not begin with a `session:header` line, so it cannot be forked or renamed. Either the file is truncated, or it was written by a version predating the header \u2014 an older log can still be read and resumed, just not copied.",source:"runtime",severity:"fatal",expected:!0},SESSION_ALREADY_RUNNING:{code:"AX-TUI-005",title:"Session Is Already Running",description:"spawn() was asked to resume a session that already has a live instance. Focus the running instance instead of booting a second runtime over the same log.",source:"tui",severity:"fatal",expected:!0},SESSION_NOT_RUNNING:{code:"AX-TUI-016",title:"Session Is Not Running",description:"focus() was pointed at a sessionId with no live instance behind it. Spawn (or resume) it first \u2014 focus is pure selection over running instances.",source:"tui",severity:"fatal",expected:!0},NO_ACTIVE_AGENT:{code:"AX-TUI-045",title:"No Active Agent",description:"The action needs a running agent, but none is active \u2014 start one first.",source:"tui",severity:"fatal",expected:!0},NO_LOCAL_PROJECT:{code:"AX-TUI-050",title:"No Local Project",description:"This agent has no project directory on this machine \u2014 it was attached over the network, so its source lives wherever it is running. Opening its config, or any other file verb, has to happen there. Focus a local agent instead.",source:"tui",severity:"fatal",expected:!0},NO_FOCUSED_INSTANCE:{code:"AX-TUI-017",title:"No Focused Agent Instance",description:"A module install/uninstall was requested with no running agent instance focused \u2014 spawn or focus one first.",source:"tui",severity:"fatal",expected:!0},MODEL_UNAVAILABLE:{code:"AX-TUI-051",title:"Model Not Available From Any Declared Provider",description:"The picked model was saved to the agent's config, but no provider this profile declares can supply it \u2014 so the running agent still uses its previous model. Connect the provider that serves it, or pick a model from the offered list.",source:"tui",severity:"fatal",expected:!0},MODEL_IMMUTABLE_DEPLOYED:{code:"AX-TUI-006",title:"Cannot Change A Deployment's Model",description:"A deployed agent's config lives in the cloud, not on this machine \u2014 its model is fixed at deploy time. Change it in the local project and deploy again.",source:"tui",severity:"fatal",expected:!0},MODULE_INSTALL_FAILED:{code:"AX-TUI-018",title:"Module Install Failed",description:"The registry installer returned an error for this module specifier \u2014 check the specifier and registry connectivity.",source:"tui",severity:"fatal"},NO_MODULES_INSTALLED:{code:"AX-TUI-019",title:"No Modules Installed",description:"The `:module uninstall` command was opened with no modules resolved into the focused instance's blueprint.",source:"tui",severity:"fatal"},SETTINGS_NOT_WRITABLE:{code:"AX-EXT-027",title:"Settings Cannot Be Written",description:"A settings change was requested on a store with no profile config behind it \u2014 nobody is logged in, or this Store was built without one (tests). Settings live in `profile.config.ts`, so there is nowhere to write them; the change was refused rather than saved somewhere nothing reads back.",source:"tui",severity:"fatal",expected:!0},REGISTRY_EMPTY:{code:"AX-TUI-047",title:"Nothing To Install",description:"The install palette was opened with no rows to show \u2014 the catalogue is still loading, the registry could not be reached, or everything published for that kind is already installed. The row itself says which.",source:"tui",severity:"fatal",expected:!0},NO_EXTENSIONS_INSTALLED:{code:"AX-TUI-046",title:"No Extensions Installed",description:"The `:ext uninstall` command was opened with no extensions declared in the active profile's profile.config.ts.",source:"tui",severity:"fatal",expected:!0},ATTACH_URL_REQUIRED:{code:"AX-TUI-048",title:"Attach URL Required",description:"`:attach` needs the address of a running agent \u2014 e.g. `:attach http://localhost:3010`. The agent must already be serving; attach binds to it and never boots anything.",source:"tui",severity:"fatal"},AGENT_NAME_REQUIRED:{code:"AX-CLI-001",title:"A Name Is Required",description:"Scaffolding a project needs a name \u2014 it becomes the directory and the package name.",source:"cli",severity:"fatal",expected:!0},MODULE_SPECIFIER_REQUIRED:{code:"AX-CLI-002",title:"A Module Name Is Required",description:"The command needs at least one module to act on, named as a scoped registry package.",source:"cli",severity:"fatal",expected:!0},FLAG_VALUE_REQUIRED:{code:"AX-CLI-007",title:"A Flag Is Missing Its Value",description:"The flag takes a value and none followed it. Quote the value if it contains spaces, and check it was not consumed as another flag.",source:"cli",severity:"fatal",expected:!0},RUN_INSTRUCTION_REQUIRED:{code:"AX-CLI-006",title:"Nothing To Run",description:"The agent was named but not told what to do. A reference on its own opens the terminal on that agent; giving it work needs an instruction, a declared prompt, or a script.",source:"cli",severity:"fatal",expected:!0},BENCH_RUN_ID_REQUIRED:{code:"AX-CLI-003",title:"A Run Id Is Required",description:"Reading a benchmark result needs the id of the run to read.",source:"cli",severity:"fatal",expected:!0},PROFILE_INCOMPLETE:{code:"AX-CLI-004",title:"Profile Is Missing Its Identity",description:"Credentials are stored for this profile but no identity is, so there is nothing to report. Logging out and back in rewrites both.",source:"cli",severity:"fatal",expected:!0},BUNDLE_KIND_MISMATCH:{code:"AX-CLI-005",title:"Wrong Bundle Kind",description:"The bundler produced an artifact of a different kind than the command expected. This is a wiring fault in our own code, not something a project can cause.",source:"cli",severity:"fatal"},ATTACH_UNREACHABLE:{code:"AX-TUI-052",title:"Agent Not Reachable",description:"Nothing answered at that address. The agent may not be running, may be on a different port, or may be behind something that refused the connection. `axon dev` prints the address it bound to.",source:"tui",severity:"fatal",expected:!0},ATTACH_URL_INVALID:{code:"AX-TUI-049",title:"Attach URL Invalid",description:"The address is not a usable agent URL. An agent is reached over http or https and the scheme is required \u2014 `localhost:3010` is a path, `http://localhost:3010` is an address. Checked before anything connects, so a typo fails immediately rather than as a transport error.",source:"tui",severity:"fatal"},DEPLOYMENT_NOT_CONNECTABLE:{code:"AX-TUI-028",title:"Deployment Not Connectable",description:"The deployment is not in the connectable list \u2014 it may have stopped, errored, or never finished provisioning. Refresh the deployment list and try again.",source:"tui",severity:"fatal"},SUBAGENT_REMOTE_PARENT:{code:"AX-TUI-027",title:"Cannot Spawn A Subagent From A Deployment",description:"A subagent is forked from its parent's local project, and an attached deployment has no local project here \u2014 the deployed agent runs its own subagents inside its own capsule.",source:"tui",severity:"fatal"},BASE_MODEL_INSTANCE_CONFLICT:{code:"AX-TUI-026",title:"Managed Model Instance Already Running",description:"A managed base instance is already running on a different engine. The base workspace holds one shared config, so spawning a second naked model would rewrite it underneath the live instance \u2014 close the running one first.",source:"tui",severity:"fatal"},NOT_WIRED:{code:"AX-TUI-008",title:"Not Wired Yet",description:"This surface is a declared stub \u2014 the real implementation hasn't been built yet.",source:"tui",severity:"fatal"},MIC_ALREADY_CAPTURING:{code:"AX-TUI-009",title:"Mic Already Capturing",description:"capture.start() was called while a capture was already in progress \u2014 stop the current one first.",source:"tui",severity:"fatal"},MIC_CAPTURE_UNAVAILABLE:{code:"AX-TUI-010",title:"No Audio Capture Tool Found",description:"Voice input needs one of arecord, sox, or ffmpeg installed and on PATH.",source:"tui",severity:"fatal"},MIC_FFT_SIZE_MISMATCH:{code:"AX-TUI-014",title:"FFT Sample Size Mismatch",description:"computeBuckets() was called with a sample buffer that isn't exactly config.fftSize long \u2014 an internal invariant, callers must pad/trim first.",source:"tui",severity:"fatal"},MIC_CAPTURE_FAILED:{code:"AX-TUI-015",title:"Mic Capture Failed",description:"The audio capture subprocess produced no output or exited immediately \u2014 check that a microphone is available.",source:"tui",severity:"fatal"},WATCH_PATH_REQUIRED:{code:"AX-TUI-021",title:"Watch Path Required",description:"`axon watch`/`axon unwatch` need a directory argument.",source:"tui",severity:"fatal",expected:!0},WATCH_PATH_NOT_FOUND:{code:"AX-TUI-022",title:"Watch Path Not Found",description:"`axon watch` was given a directory that doesn't exist on disk.",source:"tui",severity:"fatal",expected:!0},EDITOR_NOT_SET:{code:"AX-TUI-023",title:"No Editor Configured",description:"`axon settings` needs the $EDITOR environment variable set to know which editor to open.",source:"tui",severity:"fatal"},EDITOR_LAUNCH_FAILED:{code:"AX-TUI-024",title:"Editor Failed To Launch",description:"The command in $EDITOR could not be spawned \u2014 check that it's installed and on PATH.",source:"tui",severity:"fatal"},WATCH_AND_INIT_ARGS_REQUIRED:{code:"AX-TUI-025",title:"Directory And Name Required",description:`The init palette's "watch a new directory" entry needs both a directory path and an agent name, space-separated.`,source:"tui",severity:"fatal",expected:!0},MODULE_CONFIG_LOAD_FAILED:{code:"AX-MODULE-001",title:"Module Config Failed To Load",description:"The runtime could not import a module's module.config.ts at boot \u2014 the file is missing at its resolved path, or importing it threw. A module that cannot load contributes nothing, so boot fails rather than run a partially-wired agent.",source:"runtime",severity:"fatal"},MODULE_SOURCE_DECLARED:{code:"AX-MODULE-008",title:"Module Declared As Source",description:"Uninstall was asked to remove a module that axon.config.ts declares as an IMPORT rather than by registry name. The import statement is the author's own code, so uninstall does not rewrite it \u2014 and removing the dependency alone would leave the config importing a package that is no longer declared, with the agent still loading it. Nothing was changed: delete the import and its entry in modules: [...] by hand.",source:"cli",severity:"fatal"},MODULE_NOT_INSTALLED:{code:"AX-MODULE-003",title:"Module Not Installed",description:"A plugin asked for the options of a module this agent does not have installed \u2014 almost always a name mismatch between the plugin and the module that ships it. Reported rather than defaulted: handing back an empty options bag would let a hardware module open the wrong device and never say so.",source:"runtime",severity:"fatal"},MODULE_OPTIONS_INVALID:{code:"AX-MODULE-002",title:"Invalid Module Options",description:"The options declared for a module under modules.<name> in axon.config.ts do not satisfy the module's options schema \u2014 a required option is missing or a value has the wrong type.",source:"runtime",severity:"fatal"},MODULE_SETUP_FAILED:{code:"AX-MODULE-007",title:"Module Setup Failed",description:"A module's setup() threw during agent boot. Setup runs sequentially in blueprint order and a failure is total \u2014 no later module is wired, and the agent does not boot half-configured.",source:"runtime",severity:"fatal"},MODULE_SERVER_NOT_WIRED:{code:"AX-MODULE-004",title:"Module Server API Not Wired",description:"A module's setup() called ctx.server.addRoute/addMiddleware or ctx.tools.get, but that surface is not implemented yet. Declare routes as server/api/ files in the module instead.",source:"runtime",severity:"fatal"},MODULE_ENV_REQUIRED:{code:"AX-MODULE-005",title:"Module Env Var Missing",description:"A module's setup() called ctx.env.require() for a variable the agent's resolved environment does not provide. The module declares required env in module.config.ts; the agent must supply it (e.g. in .env).",source:"runtime",severity:"fatal",expected:!0},MODULE_POLICY_IMMUTABLE:{code:"AX-MODULE-006",title:"Module Policy Is Immutable At Boot",description:"A module's setup() called ctx.policy.update(). The resolved agent policy is authoritative and cannot be mutated at boot \u2014 declare policy needs statically in module.config.ts so the CLI reconciles them at install.",source:"runtime",severity:"fatal",expected:!0},CLONE_REF_REQUIRED:{code:"AX-PROJECT-022",title:"No Artifact Named",description:"`axon clone` was run without an artifact to clone. Name one, for example: axon clone @axon/arxiv",source:"cli",severity:"fatal",expected:!0},FORK_REF_REQUIRED:{code:"AX-PROJECT-023",title:"No Artifact Named",description:"`axon fork` was run without an artifact to fork. Name one, for example: axon fork @axon/arxiv --as @you/arxiv",source:"cli",severity:"fatal"},FORK_NAME_REQUIRED:{code:"AX-PROJECT-024",title:"Fork Needs A New Name",description:"A fork is published under your own namespace, so it needs a name: pass --as <package-name>, for example: axon fork @axon/arxiv --as @you/arxiv",source:"cli",severity:"fatal"},CLONE_TARGET_EXISTS:{code:"AX-PROJECT-025",title:"Clone Target Not Empty",description:"The directory the artifact would be cloned into already has files in it. Clone into a new directory, or clear this one first.",source:"cli",severity:"fatal"},ARTIFACT_DOWNLOAD_FAILED:{code:"AX-PROJECT-026",title:"Artifact Download Failed",description:"The registry did not serve the artifact's source archive. The version may have been unpublished, or the network request failed.",source:"cli",severity:"fatal"},ARTIFACT_EXTRACT_FAILED:{code:"AX-PROJECT-027",title:"Artifact Extract Failed",description:"The downloaded archive could not be unpacked. It may be truncated, or `tar` is unavailable on this machine.",source:"cli",severity:"fatal"},VERSION_INVALID:{code:"AX-PROJECT-028",title:"Invalid Version",description:"The project's package.json version is not valid semver, so the next version cannot be derived from it. Fix the version field by hand.",source:"cli",severity:"fatal"},FRAMEWORK_NOT_INSTALLED:{code:"AX-PROJECT-029",title:"Framework Packages Not Installed",description:"The generated type frame references @arcforge/types, @arcforge/engines and h3, none of which resolve from this project. Run `bun install` before `axon prepare`.",source:"cli",severity:"fatal"},FRAME_MIGRATION_CONFLICT:{code:"AX-PROJECT-034",title:"Frame Migration Cannot Proceed Safely",description:"Runtime output exists in BOTH the old location and the new one, so migrating would have to merge or overwrite two sets of session history. Nothing was moved. Inspect both directories and remove or merge them by hand.",source:"cli",severity:"fatal"},CONFIG_EVALUATION_ESCAPED:{code:"AX-PROJECT-030",title:"defineAgent() Called Outside Config Evaluation",description:"defineAgent() ran outside the loader that evaluates axon.config.ts \u2014 it is a declaration helper, not a runtime function, and cannot be called from application code.",source:"cli",severity:"fatal"},PROMPT_NOT_INSTALLABLE:{code:"AX-PROJECT-044",title:"Prompts Are Not Installed Into Agents",description:"A prompt is content, not a capability: it resolves from the global cache and renders on demand, so every agent can already use it without declaring anything. Installing one into an agent would put content through the code path \u2014 an ABI check, a node_modules link, an agent reload \u2014 for something that needs none of it.",source:"manifest",severity:"fatal"},ASSET_TYPE_REFUSED:{code:"AX-PROJECT-045",title:"Unsupported Asset Type",description:"A file in assets/ is not a type the registry serves. Images (png, jpg, jpeg, webp, gif) and video (mp4, webm, mov) are accepted. SVG is deliberately refused: it is an executable document that would be served from our own storage origin, so a published SVG is a script-injection surface for every visitor reading that README.",source:"manifest",severity:"fatal",expected:!0},ASSET_TOO_LARGE:{code:"AX-PROJECT-046",title:"Asset Exceeds Size Limit",description:"A single file in assets/ is over the per-asset limit. Assets exist to illustrate a README, not to distribute media \u2014 compress the file or link to it externally.",source:"manifest",severity:"fatal",expected:!0},ASSETS_BUDGET_EXCEEDED:{code:"AX-PROJECT-040",title:"Assets Exceed Total Budget",description:"The assets/ folder as a whole is over budget for one published version. Every version stores its own copy of every asset, so the total is what determines how much a package costs to host forever.",source:"manifest",severity:"fatal",expected:!0},ASSET_PATH_INVALID:{code:"AX-PROJECT-041",title:"Unsafe Asset Path",description:"An entry under assets/ is a symlink, or its name escapes the assets directory. Both are refused: a published asset must be a real file that lands where its name says it does, or extraction on the server could write outside the target directory.",source:"manifest",severity:"fatal",expected:!0},ASSET_UNREADABLE:{code:"AX-PROJECT-042",title:"Asset Could Not Be Processed",description:"A file in assets/ has an image extension but could not be decoded, so it is either corrupt or not the format its name claims. Publishing it would ship a broken image into a README.",source:"manifest",severity:"fatal",expected:!0},PORT_UNAVAILABLE:{code:"AX-PROJECT-031",title:"No Free Port",description:"Every port in the range the agent scanned is already in use. Stop whatever is holding them, or start the agent on a different port.",source:"cli",severity:"fatal"},PARENT_INSTANCE_NOT_RUNNING:{code:"AX-RUNTIME-005",title:"Parent Agent Not Running",description:"A subagent was requested against a parent session that is no longer live \u2014 the parent shut down, crashed, or was never booted by this process.",source:"runtime",severity:"fatal"},SUBAGENT_DEPTH_EXCEEDED:{code:"AX-RUNTIME-006",title:"Subagent Depth Limit Reached",description:"An agent tried to spawn a subagent beyond the maximum nesting depth. The limit exists so a recursive delegation cannot spawn processes without bound.",source:"runtime",severity:"fatal"},SUBAGENT_CHILD_LIMIT_EXCEEDED:{code:"AX-RUNTIME-007",title:"Subagent Child Limit Reached",description:"One agent tried to hold more live children than the limit allows. Existing children must finish before more can be spawned.",source:"runtime",severity:"fatal"},SUBAGENT_DESCENDANT_LIMIT_EXCEEDED:{code:"AX-RUNTIME-008",title:"Subagent Descendant Limit Reached",description:"The whole subagent tree beneath one root exceeded its live-descendant budget. The limit bounds total concurrent processes, not just direct children.",source:"runtime",severity:"fatal"},SUBAGENT_REQUEST_INVALID:{code:"AX-RUNTIME-009",title:"Malformed Subagent Request",description:"A subagent request did not carry a usable prompt. It must be an object with `prompt` as a string or an array of strings.",source:"runtime",severity:"fatal"},INSTANCE_NOT_LOCAL:{code:"AX-RUNTIME-010",title:"Agent Instance Is Not Local",description:"An operation that only works against a locally booted agent was given a remote one. Subagent spawning and the managed base workspace both require a local process.",source:"runtime",severity:"fatal"},HOST_METHOD_UNKNOWN:{code:"AX-RUNTIME-011",title:"Unknown Host Method",description:"A booted agent called a host method this platform does not implement. The agent's framework version is likely newer than the CLI running it.",source:"runtime",severity:"fatal"},UPDATE_CURRENT_VERSION_INVALID:{code:"AX-TUI-029",title:"Running Version Is Not Semver",description:"The version this app reports for itself is not valid semver, so it cannot be compared against the latest release.",source:"cli",severity:"fatal"},UPDATE_RELEASE_INVALID:{code:"AX-TUI-030",title:"Malformed Release Record",description:"The backend's release record did not describe a valid @arcforge/axon `latest` version, so there is nothing safe to update to.",source:"cli",severity:"fatal"},UPDATE_UNAVAILABLE_IN_DEVELOPMENT:{code:"AX-TUI-031",title:"Update Not Available Here",description:"Self-update needs the packaged update helper and a supervisor request path, neither of which exists in a source checkout. Update the installed app instead.",source:"cli",severity:"fatal"},UPDATE_SUPERVISOR_UNAVAILABLE:{code:"AX-TUI-032",title:"Update Supervisor Unavailable",description:"The running app has no supervisor request path, so it cannot hand an update off to be applied after exit.",source:"cli",severity:"fatal"},UPDATE_HELPER_ARGS_INVALID:{code:"AX-TUI-033",title:"Malformed Update Helper Arguments",description:"The update helper was invoked without the --from/--to/--bun/--axon/--state arguments it requires. It is spawned by the app, not run by hand.",source:"cli",severity:"fatal"},UPDATE_HELPER_VERSION_INVALID:{code:"AX-TUI-034",title:"Update Helper Given Bad Versions",description:"The update helper received a --from or --to value that is not valid semver, so it refused to install anything.",source:"cli",severity:"fatal"},TEST_FILES_NOT_FOUND:{code:"AX-TUI-035",title:"No Test Files Matched",description:"No files matched the requested test patterns, so there was nothing to run. Check the pattern, or the directory it was resolved against.",source:"cli",severity:"fatal"},OLLAMA_UNAVAILABLE:{code:"AX-TUI-037",title:"Ollama Is Not Running",description:"No Ollama daemon answered on this machine. Start it with `ollama serve`, or install Ollama from https://ollama.com to run models locally.",source:"cli",severity:"fatal"},OLLAMA_REQUEST_FAILED:{code:"AX-TUI-038",title:"Ollama Request Failed",description:"The local Ollama daemon is running but refused a request \u2014 most often an unknown model name. The daemon's own message is included.",source:"cli",severity:"fatal"},OLLAMA_REGISTRY_UNREACHABLE:{code:"AX-TUI-039",title:"Ollama Registry Unreachable",description:"Could not reach the Ollama model registry to look a model up. Downloading needs a network connection; models already on disk still work offline.",source:"cli",severity:"fatal"},NO_EDITOR_ATTACHED:{code:"AX-TUI-042",title:"No Editor Attached",description:"Opening a pane hands it to a connected editor, and none is listening. Open this project in an editor running the Axon Fleet extension \u2014 it dials each running TUI itself, so the connection appears on its own once the window is up.",source:"tui",severity:"fatal"},NO_SESSION_TO_OPEN:{code:"AX-TUI-043",title:"No Session To Open",description:"A runtime pane is a view of one conversation, and no agent is focused yet \u2014 so there is nothing to point it at. Start or focus an agent first.",source:"tui",severity:"fatal"},CLEAR_IMMUTABLE_DEPLOYED:{code:"AX-TUI-041",title:"Cannot Clear A Deployment's Conversation",description:"A deployed agent owns its own session in the cloud \u2014 the TUI attaches to whatever session it is already running, so there is no fresh one to start from here. Use `:close` to detach, or clear it on a local instance of the same agent.",source:"tui",severity:"fatal"},OLLAMA_PULL_FAILED:{code:"AX-TUI-040",title:"Model Download Failed",description:"Ollama could not finish downloading the model. The name may not exist in the registry, or the transfer was interrupted \u2014 a retry resumes from whatever was already fetched.",source:"cli",severity:"fatal"},TEST_PRELOAD_MISSING:{code:"AX-TUI-036",title:"Test API Loaded Without Its Preload",description:"The instrumented test API was imported without the preload that installs it. Tests must run through `axon test`, which wires the preload.",source:"cli",severity:"fatal"},PROFILE_CONFIG_INVALID:{code:"AX-EXT-001",title:"profile.config.ts Did Not Call defineProfile()",description:"A profile's config must default-export defineProfile({ ... }). Without it there is no extension list to read, so nothing can be installed, enabled or disabled. The rest of the profile \u2014 main.ts and plugins/ \u2014 still loads.",source:"tui",severity:"fatal",expected:!0},PROFILE_CONFIG_FAILED:{code:"AX-EXT-002",title:"profile.config.ts Failed to Load",description:"The file threw while being evaluated, so its extension list could not be read and no extensions were loaded. The profile's own main.ts and plugins/ are unaffected \u2014 a typo in an extension list must not cost you the config you already had working.",source:"tui",severity:"degraded",expected:!0},EXTENSION_ENTRY_INVALID:{code:"AX-EXT-003",title:"Malformed Extension Entry",description:'An entry in profile.config.ts\'s `extensions` array is neither a string nor an object with a `source`. Accepted forms are "@scope/name" for a registry extension and "./extensions/name" for a local one.',source:"tui",severity:"degraded",expected:!0},EXTENSION_NOT_FOUND:{code:"AX-EXT-004",title:"Extension Not Found",description:"An extension listed in profile.config.ts is not on disk. A local path may have moved or been deleted; a registry name may never have been installed. Everything else in the list still loads.",source:"tui",severity:"degraded",expected:!0},EXTENSION_INSTALL_FAILED:{code:"AX-EXT-005",title:"Extension Install Failed",description:"A registry extension could not be fetched or prepared \u2014 most often no network, or a name that does not exist in the registry. It is skipped for this session and retried on the next launch.",source:"tui",severity:"degraded",expected:!0},EXTENSION_UNINSTALL_FAILED:{code:"AX-EXT-028",title:"Extension Uninstall Failed",description:"An extension could not be removed from profile.config.ts \u2014 most often the file is unreadable or has been edited into a shape the editor cannot find the extensions list in. The extension is still declared and will load on the next launch.",source:"tui",severity:"degraded",expected:!0},EXTENSION_NOT_AN_EXTENSION:{code:"AX-EXT-006",title:"Not an Extension",description:"The directory has no extension.config.ts, which is the file that marks a directory as an extension. A path pointing at an agent, a module, or an ordinary folder is not loadable as one.",source:"tui",severity:"degraded",expected:!0},EXTENSION_LOAD_FAILED:{code:"AX-EXT-007",title:"Extension Failed to Load",description:"An extension's main.ts threw while it was being loaded, so whatever it had not yet registered is missing. Its commands, keys and palettes are removed and the rest of your config loads normally.",source:"tui",severity:"degraded",expected:!0},PROFILE_MAIN_FAILED:{code:"AX-EXT-008",title:"main.ts Failed to Load",description:"Your profile's main.ts threw while being evaluated. Anything it registered before the error survives; everything after it did not run. Plugins and extensions still load.",source:"tui",severity:"degraded",expected:!0},AGENT_NO_SUPERVISOR:{code:"AX-AGENT-030",title:"No Supervisor to Boot This Agent",description:"Something asked a platform to spawn an agent, but that platform was built without a supervisor. Supervision holds the provider credential and the session log, so it lives in the daemon rather than in whichever process happened to ask \u2014 a platform used only to read the store or publish a project does not need one, and this is where the difference surfaces.",source:"runtime",severity:"fatal",expected:!0},MODEL_RUNTIME_MISSING:{code:"AX-MODEL-031",title:"That Runtime Is Not Installed",description:"An adapter recognised the model and the library that executes it is not on this machine. Local inference runtimes are optional because they are large \u2014 ONNX Runtime alone is around 300MB of native binaries \u2014 so they are installed when first wanted rather than shipped with the CLI.",source:"daemon",severity:"fatal",expected:!0},MODEL_LOAD_FAILED:{code:"AX-MODEL-032",title:"The Model Could Not Be Loaded",description:"A runtime recognised the file and failed to read it. Distinct from an unsupported format: this weight is one this machine can execute in principle, so the file itself is the problem \u2014 truncated, corrupt, or not the model its name claims.",source:"daemon",severity:"fatal"},MODEL_WILL_NOT_FIT:{code:"AX-MODEL-033",title:"Not Enough Memory for This Model",description:"The weight loaded and did not fit within this machine's ceiling, so it was unloaded again. The refusal names what is holding the memory \u2014 a model already resident, or another process entirely, since the check measures the whole card rather than Axon's share. Nothing is evicted automatically: a silent eviction is another agent mysteriously slowing down.",source:"daemon",severity:"degraded",expected:!0},MODEL_NOT_RESIDENT:{code:"AX-MODEL-034",title:"That Model Is Not Loaded",description:"Inference was asked of a weight that is not in memory. Loading is never implicit: it is a claim on the machine's memory, and taking one a caller did not ask for would make admission invisible at the moment it matters.",source:"daemon",severity:"degraded",expected:!0},MODEL_NOT_CACHED:{code:"AX-MODEL-035",title:"That Model Is Not On This Machine",description:"A weight was asked for that has not been fetched. The daemon caches models content-addressed and machine-wide, so one download serves every agent \u2014 but it only serves what has actually been downloaded.",source:"daemon",severity:"degraded",expected:!0},MODEL_NO_SINGLE_WEIGHT:{code:"AX-MODEL-036",title:"That Repository Has No Single Weight",description:"A repository was asked for by name and publishes several weights with no obvious one to take \u2014 an encoder-decoder export ships both halves and needs both, and a quantised set is a choice about quality rather than a default. Name the file to fetch. Guessing would download half a model that fails at load with something obscure.",source:"daemon",severity:"degraded",expected:!0},MODEL_NO_RUNTIME:{code:"AX-MODEL-030",title:"No Runtime Can Execute This Model",description:"The weight is on this machine and no adapter claims it. Runtimes are registered per format \u2014 ONNX, llama.cpp \u2014 and a file none of them recognises can be fetched and cached but not loaded. Either the format needs an adapter, or the file is not the model it appears to be.",source:"daemon",severity:"fatal",expected:!0},DAEMON_NOT_RUNNING:{code:"AX-DAEMON-001",title:"The Axon Daemon Is Not Running",description:"Something asked axond for machine-wide state \u2014 what is loaded on the GPU, which agents are running \u2014 and no daemon is listening. Start it with `axon daemon up`. Every agent is supervised by the daemon, so this is not a degraded mode: nothing that boots an agent can proceed without one.",source:"daemon",severity:"fatal"},DAEMON_ALREADY_RUNNING:{code:"AX-DAEMON-002",title:"A Daemon Is Already Running",description:"A second axond was asked to start while one is already listening on this socket. One daemon per user per machine is the whole point \u2014 two would each believe they owned the GPU. Nothing was started; the existing one is untouched.",source:"daemon",severity:"degraded",expected:!0},DAEMON_SOCKET_UNAVAILABLE:{code:"AX-DAEMON-003",title:"Could Not Bind the Daemon Socket",description:"axond could not listen on its unix socket. Usually a stale socket file left by a process killed with -9, which the daemon removes on start; if it persists, the path may be unwritable or on a filesystem that does not support unix sockets.",source:"daemon",severity:"fatal"},DAEMON_START_FAILED:{code:"AX-DAEMON-004",title:"The Daemon Failed to Start",description:"axond was spawned but never reported itself ready. Every agent runs under the daemon's supervision, so a machine without one cannot boot an agent at all \u2014 this fails loudly rather than falling back, because a silent fallback is how a broken daemon went unnoticed in a published release. Its output is in the daemon log named by the detail; the usual causes are a port or socket conflict and a broken profile config.",source:"daemon",severity:"fatal"},DAEMON_NOT_WIRED:{code:"AX-DAEMON-005",title:"That Part of the Daemon Is Not Built Yet",description:"A domain the daemon declares exists but is not implemented. It throws rather than answering, because a stub returning an empty list is indistinguishable from a real answer and gets built on top of.",source:"daemon",severity:"degraded",expected:!0},EXTENSION_LOAD_TIMEOUT:{code:"AX-EXT-034",title:"Extension Took Too Long to Load",description:"A config file did not finish evaluating within the load budget \u2014 usually a blocking loop or a synchronous wait at module scope. Loading continued without it, so its commands, keys and palettes are missing; everything else in your config still loaded. The file itself keeps running until it finishes, because there is no safe way to interrupt code mid-execution.",source:"tui",severity:"degraded",expected:!0},PLUGIN_FAILED:{code:"AX-EXT-009",title:"Plugin Failed to Load",description:"A file in plugins/ threw while being imported, so its hooks were not registered. Other plugins in the same folder are unaffected \u2014 each file is loaded independently.",source:"tui",severity:"degraded",expected:!0},HOOK_FAILED:{code:"AX-EXT-010",title:"Lifecycle Hook Failed",description:"A tui.hook() handler threw while the event it listens for was firing. For a notification hook nothing else is affected; for a gating hook (tui:boot, tui:shutdown) the operation continues anyway rather than leaving the terminal stuck.",source:"tui",severity:"degraded",expected:!0},HOOK_TIMED_OUT:{code:"AX-EXT-011",title:"Hook Blocked Too Long",description:"A gating hook (tui:boot or tui:shutdown) did not finish within its budget, so the TUI continued without waiting. A config must never be able to hang the terminal silently \u2014 whatever the handler was doing may not have completed.",source:"tui",severity:"degraded",expected:!0},COMMAND_NOT_FOUND:{code:"AX-EXT-012",title:"No Such Command",description:"commands.run() was given a path that resolves to nothing in the command tree. The path must name a leaf, spelled exactly as it appears in the `:` palette.",source:"tui",severity:"fatal",expected:!0},PALETTE_NOT_FOUND:{code:"AX-EXT-013",title:"No Such Palette",description:"palette.open() was given a name no palette was registered under. Palettes are created with palette.create(name, ...) \u2014 a name is only openable once its registration has run.",source:"tui",severity:"fatal",expected:!0},PALETTE_NAME_TAKEN:{code:"AX-EXT-014",title:"Palette Name Already Registered",description:"Two palettes tried to claim the same name. Names are how palette.open() addresses one, so they have to be unique \u2014 silently replacing the first would make whichever loaded last win, invisibly.",source:"tui",severity:"degraded",expected:!0},PALETTE_ALREADY_OPEN:{code:"AX-EXT-015",title:"A Palette Is Already Open",description:"Something tried to open a palette, or ask a question, while the user was already navigating one. Stealing it mid-navigation would drop whatever they were doing, so the call fails instead \u2014 check palette.isOpen first.",source:"tui",severity:"degraded",expected:!0},KEY_CHORD_UNBOUND:{code:"AX-EXT-022",title:"No Such Key Binding",description:"keys.send() was given a chord nothing is bound to \u2014 neither a mode key nor a registered binding. Sending it would do nothing at all, which is indistinguishable from a binding that ran and had no effect.",source:"tui",severity:"fatal",expected:!0},AGENT_SPAWN_NO_INSTANCE:{code:"AX-EXT-023",title:"Agent Started but No Instance Appeared",description:"A spawn reported success without producing a focused instance, so there is no id to hand back. This is a fault in Axon rather than in your config \u2014 the agent may or may not be running.",source:"tui",severity:"fatal"},PROFILE_CONFIG_MISSING:{code:"AX-EXT-025",title:"No profile.config.ts",description:"The profile has no config file to record the extension in. It is normally created on first launch \u2014 starting Axon once will scaffold it.",source:"tui",severity:"fatal",expected:!0},PROFILE_CONFIG_UNEDITABLE:{code:"AX-EXT-026",title:"profile.config.ts Could Not Be Edited",description:"The `defineProfile({ ... })` call could not be located, or editing it would have produced invalid TypeScript. Nothing was written \u2014 this file is yours, and a botched edit costs your whole TUI config. Add or remove the entry by hand.",source:"tui",severity:"fatal",expected:!0},COMMAND_INVALID:{code:"AX-EXT-029",title:"Command Is Not Registerable",description:"A command was registered with no path, or with no `run` to call. Both are caught here rather than when someone presses Enter on it \u2014 a command that registers cleanly and then does nothing reads as a broken terminal instead of a config mistake, and gives no clue which file to open. Use `commands.register(path, fn)` or `commands.register(path, { run })`.",source:"tui",severity:"degraded",expected:!0},COMPONENT_NAME_TAKEN:{code:"AX-EXT-030",title:"Component Already Registered",description:"Two sources registered the same line component name. The first one loaded keeps it \u2014 your own config beats any extension. A silently shadowed component would render someone else's value under your name, so the second registration fails instead. Component names are `provider:name`; pick a prefix of your own.",source:"tui",severity:"degraded",expected:!0},COMPONENT_UNKNOWN:{code:"AX-EXT-031",title:"No Such Component",description:"A line named a component that is not registered. Caught when the line is created rather than when it paints, because a missing component renders as an empty gap \u2014 which reads as a layout bug instead of a typo, and gives no clue which name was wrong. components.list() returns everything available.",source:"tui",severity:"degraded",expected:!0},LINE_NAME_TAKEN:{code:"AX-EXT-032",title:"Line Already Registered",description:"Two sources registered the same line name. The first one loaded keeps it, the same rule commands and key chords follow.",source:"tui",severity:"degraded",expected:!0},LINE_UNKNOWN:{code:"AX-EXT-033",title:"No Such Line",description:"lines.set(), move(), show(), hide() or toggle() named a line that is not registered. Doing nothing would be indistinguishable from a line that registered and then rendered empty, so this fails instead. lines.list() returns what exists.",source:"tui",severity:"degraded",expected:!0},COMMAND_PATH_TAKEN:{code:"AX-EXT-020",title:"Command Already Registered",description:"Two sources registered the same command path. The first one loaded keeps it \u2014 your own config beats any extension, and between extensions the one listed earlier in profile.config.ts wins. Rename one of them.",source:"tui",severity:"degraded",expected:!0},KEY_CHORD_TAKEN:{code:"AX-EXT-021",title:"Key Chord Already Bound",description:"Two sources bound the same key chord. The first one loaded keeps it. A silently shadowed binding is unbearable to debug in someone else's config, so the second registration fails instead of replacing it.",source:"tui",severity:"degraded",expected:!0},MODE_KEY_TAKEN:{code:"AX-EXT-016",title:"Mode Key Already Bound",description:"A palette asked for a mode key that is already in use \u2014 either by a built-in mode or by another extension. A silently shadowed key is unbearable to debug in someone else's config, so the registration fails loudly instead.",source:"tui",severity:"degraded",expected:!0},MODE_UNKNOWN:{code:"AX-EXT-017",title:"No Such Mode",description:"mode.set() was given a name that is neither a built-in mode nor a registered palette. Doing nothing would look identical to a mode that simply does not render, so this fails instead.",source:"tui",severity:"fatal",expected:!0},NO_FOCUSED_AGENT:{code:"AX-EXT-018",title:"No Agent Focused",description:"A verb that acts on the focused agent \u2014 send, stop, reboot \u2014 was called while nothing was running. Start one with agents.spawn(name) or tui.nav(name) first.",source:"tui",severity:"fatal",expected:!0},INSTANCE_NOT_RUNNING:{code:"AX-EXT-019",title:"Instance Not Running",description:"An instance id was given for a conversation that is not live \u2014 it may already have been stopped, or it belongs to an earlier session. agents.list() returns what is currently running.",source:"tui",severity:"fatal",expected:!0},CONNECT_REJECTED:{code:"AX-EXT-035",title:"Connector Credential Rejected",description:"The platform refused the credential pasted during `:connect`. Verification runs before the value is written, so nothing was stored \u2014 the detail carries the platform's own reason, and the most common cause is copying the wrong secret from the developer portal.",source:"tui",severity:"fatal",expected:!0}}});import{readFileSync as rWi}from"fs";function I1n(e=1){let n=Error().stack;if(!n)return[];return n.split(`
687
687
  `).slice(1+e).map(D8A).filter(x8A).map(F8A)}function k8A(e){return e.split(`
688
688
  `).slice(1).map(D8A).filter(x8A).map(F8A)}function E1n(e){if(!e)return null;return k8A(e)[0]??null}function D8A(e){let n=e.match(oWi);if(n){let[,i,s,u,g]=n;return{functionName:i??null,fileName:s??null,lineNumber:rSt(u),columnNumber:rSt(g)}}let A=e.match(sWi);if(A){let[,i,s,u]=A;return{functionName:null,fileName:i??null,lineNumber:rSt(s),columnNumber:rSt(u)}}return{functionName:null,fileName:null,lineNumber:null,columnNumber:null}}function rSt(e){if(e===void 0)return null;let n=parseInt(e,10);return Number.isNaN(n)?null:n}function x8A(e){if(!e.fileName)return!1;return!cWi.some((n)=>e.fileName.includes(n))}function F8A(e){return{...e,source:uWi(e.fileName,e.lineNumber)}}function uWi(e,n){if(!e||n===null)return null;let A;try{A=rWi(e,"utf-8")}catch{return null}let i=A.split(`
689
689
  `),s=n-1;if(s<0||s>=i.length)return null;let u=Math.max(0,s-w8A),g=Math.min(i.length-1,s+w8A),d=[];for(let f=u;f<=g;f++)d.push({lineNumber:f+1,text:i[f]??""});return d}var oWi,sWi,cWi,w8A=2;var y1n=dt(()=>{oWi=/at\s+(.*?)\s+\((.*?):(\d+):(\d+)\)/,sWi=/at\s+(.*?):(\d+):(\d+)/,cWi=["node_modules","native:","internal","bun:"]});function S8A(e){if(!e.fileName||e.lineNumber===null)return e.functionName?`at ${e.functionName}`:"at <unknown>";let n=`${e.fileName}:${e.lineNumber}:${e.columnNumber??0}`,A=e.functionName?`at ${e.functionName} (${n})`:`at ${n}`,i=e.source?dWi(e.source,e.lineNumber,e.columnNumber):null;return i?`${A}
@@ -693,11 +693,11 @@ ${i}`:A}function jBt(e){let n=[`Axon Error: ${e.title}`,e.description];if(e.mess
693
693
  `)}function pWi(e){try{return JSON.stringify(e)}catch{return String(e)}}function mWi(e){return e instanceof Error?e.stack??e.message:String(e)}function v8A(e){return e.split(`
694
694
  `).map((n)=>` ${n}`).join(`
695
695
  `)}function dWi(e,n,A){if(!e||e.length===0)return null;let i=String(e[e.length-1].lineNumber).length,s=[];for(let u of e){let g=String(u.lineNumber).padStart(i," "),d=u.lineNumber===n?">":" ";if(s.push(` ${d} ${g} | ${u.text}`),u.lineNumber===n&&A!==null){let f=" ".repeat(i+6+Math.max(0,A-1));s.push(`${f}^`)}}return s.join(`
696
- `)}var lWi=80;import{AsyncLocalStorage as fWi}from"async_hooks";function G8A(e){N8A.getStore()?.(e);for(let n of hWi)try{n(e)}catch{}}var N8A,Q1n,hWi;var _1n=dt(()=>{N8A=new fWi,Q1n={run(e,n){return N8A.run(e,n)}},hWi=new Set});function w5e(e){return e instanceof Error&&e.isAxonError===!0}function oA(e,n){if(w5e(e))return e;if(typeof e!=="string"||!(e in iSt))return bWi(e);let i=iSt[e],s=Error(n?.detail??i.title,{cause:n?.cause});if(s.code=i.code,s.title=i.title,s.description=i.description,s.source=i.source,s.severity=n?.severity??i.severity,i.expected)s.expected=!0;return s.context=n?.context,s.frames=I1n(2),s.isAxonError=!0,s.render=()=>jBt(s),s.toJSON=()=>({isAxonError:!0,code:s.code,title:s.title,description:s.description,message:s.message,source:s.source,severity:s.severity,...s.context!==void 0?{context:BWi(s.context)}:{},frames:s.frames,...s.stack!==void 0?{stack:s.stack}:{},...s.cause!==void 0?{cause:CWi(s.cause)}:{}}),G8A(s),s}function bWi(e){let n=e instanceof Error?e.message:String(e),A=oA("UNKNOWN",{detail:n,cause:e,severity:"fatal"});if(e instanceof Error&&e.stack)A.stack=e.stack;return A}function BWi(e){try{return JSON.parse(JSON.stringify(e))}catch{return{unserializable:String(e)}}}function CWi(e){if(e instanceof Error)return{message:e.message,...e.stack!==void 0?{stack:e.stack}:{},frame:E1n(e.stack)};try{return JSON.stringify(e),String(e)}catch{return"[unserializable cause]"}}var M8A=dt(()=>{C1n();y1n();_1n()});var ps=dt(()=>{M8A();y1n();C1n();_1n()});import{homedir as IWi}from"os";import{join as oSt}from"path";function JLe(e){let n=e??process.env.AXON_DAEMON_DIR??oSt(IWi(),".axon","cache","daemon");return{root:n,socket:oSt(n,"axond.sock"),pid:oSt(n,"axond.pid"),log:oSt(n,"axond.log")}}var L8A=()=>{};import{spawn as EWi}from"child_process";import{existsSync as w1n,mkdirSync as q8A,openSync as yWi,readFileSync as QWi,rmSync as k1n,writeFileSync as _Wi}from"fs";function k5e(e){function i(){if(!w1n(e.paths.pid))return null;let s=Number.parseInt(QWi(e.paths.pid,"utf-8").trim(),10);if(!Number.isFinite(s))return k1n(e.paths.pid,{force:!0}),null;try{return process.kill(s,0),s}catch{return k1n(e.paths.pid,{force:!0}),null}}return{pid:i,status(){let s=i();if(s===null)return{running:!1};let u=w1n(e.paths.pid)?Math.floor((Date.now()-Number(wWi(e.paths.pid)))/1000):0;return{running:!0,pid:s,uptime:Math.max(0,u),version:e.version,socket:e.paths.socket}},claim(){q8A(e.paths.root,{recursive:!0}),_Wi(e.paths.pid,String(process.pid),"utf-8")},release(){k1n(e.paths.pid,{force:!0})},async up(){let s=i();if(s!==null)return{pid:s,socket:e.paths.socket,already:!0};q8A(e.paths.root,{recursive:!0});let u=yWi(e.paths.log,"a"),g=EWi(e.runtime??process.execPath,[e.entrypoint,"serve"],{stdio:["ignore",u,u],detached:!0});g.unref();let d=Date.now()+5000;while(Date.now()<d){if(w1n(e.paths.socket)&&i()!==null)return{pid:g.pid??0,socket:e.paths.socket,already:!1};await new Promise((f)=>setTimeout(f,50))}throw oA("DAEMON_START_FAILED",{detail:`axond did not bind ${e.paths.socket} within ${"5"}s \u2014 see ${e.paths.log}`,context:{socket:e.paths.socket,log:e.paths.log}})},down(){let s=i();if(s===null)return!1;return process.kill(s,"SIGTERM"),!0}}}function wWi(e){return Bun.file(e).lastModified}var U8A=dt(()=>{ps()});import{spawnSync as kWi}from"child_process";import{existsSync as T8A,mkdirSync as DWi,readFileSync as K8A,rmSync as xWi,writeFileSync as FWi}from"fs";import{homedir as vWi,platform as SWi}from"os";import{dirname as NWi,join as R8A}from"path";function x1n(e){let n=GWi(e.root);return{unit(){return{path:n,supported:sSt()}},installed(){if(!sSt()||!T8A(n))return!1;try{return K8A(n,"utf-8")===Y8A(e.command)}catch{return!1}},install(){if(!sSt())return!1;if(!MWi(e.command))return!1;let i=Y8A(e.command);if(DWi(NWi(n),{recursive:!0}),!T8A(n)||K8A(n,"utf-8")!==i)FWi(n,i,"utf-8");return A(),!0},disable(){if(!sSt())return;HBt(["systemctl","--user","disable","--now",D1n]),xWi(n,{force:!0})}};function A(){HBt(["systemctl","--user","daemon-reload"]),HBt(["systemctl","--user","enable",D1n])}}function sSt(){return SWi()==="linux"&&j8A("systemctl")}function GWi(e){let n=e??process.env.XDG_CONFIG_HOME??R8A(vWi(),".config");return R8A(n,"systemd","user",D1n)}function Y8A(e){return["[Unit]","Description=Axon daemon \u2014 machine-wide agent and resource supervisor","After=network.target","","[Service]","Type=simple",`ExecStart=${e.join(" ")}`,"Restart=on-failure","RestartSec=5","","[Install]","WantedBy=default.target",""].join(`
696
+ `)}var lWi=80;import{AsyncLocalStorage as fWi}from"async_hooks";function G8A(e){N8A.getStore()?.(e);for(let n of hWi)try{n(e)}catch{}}var N8A,Q1n,hWi;var _1n=dt(()=>{N8A=new fWi,Q1n={run(e,n){return N8A.run(e,n)}},hWi=new Set});function w5e(e){return e instanceof Error&&e.isAxonError===!0}function oA(e,n){if(w5e(e))return e;if(typeof e!=="string"||!(e in iSt))return bWi(e);let i=iSt[e],s=Error(n?.detail??i.title,{cause:n?.cause});if(s.code=i.code,s.title=i.title,s.description=i.description,s.source=i.source,s.severity=n?.severity??i.severity,i.expected)s.expected=!0;return s.context=n?.context,s.frames=I1n(2),s.isAxonError=!0,s.render=()=>jBt(s),s.toJSON=()=>({isAxonError:!0,code:s.code,title:s.title,description:s.description,message:s.message,source:s.source,severity:s.severity,...s.context!==void 0?{context:BWi(s.context)}:{},frames:s.frames,...s.stack!==void 0?{stack:s.stack}:{},...s.cause!==void 0?{cause:CWi(s.cause)}:{}}),G8A(s),s}function bWi(e){let n=e instanceof Error?e.message:String(e),A=oA("UNKNOWN",{detail:n,cause:e,severity:"fatal"});if(e instanceof Error&&e.stack)A.stack=e.stack;return A}function BWi(e){try{return JSON.parse(JSON.stringify(e))}catch{return{unserializable:String(e)}}}function CWi(e){if(e instanceof Error)return{message:e.message,...e.stack!==void 0?{stack:e.stack}:{},frame:E1n(e.stack)};try{return JSON.stringify(e),String(e)}catch{return"[unserializable cause]"}}var M8A=dt(()=>{C1n();y1n();_1n()});var ps=dt(()=>{M8A();y1n();C1n();_1n()});import{homedir as IWi}from"os";import{join as oSt}from"path";function JLe(e){let A=e??process.env.AXON_DAEMON_DIR??oSt(IWi(),".axon","cache","daemon");return{root:A,socket:oSt(A,"axond.sock"),pid:oSt(A,"axond.pid"),log:oSt(A,"axond.log")}}var L8A=()=>{};import{spawn as EWi}from"child_process";import{existsSync as w1n,mkdirSync as q8A,openSync as yWi,readFileSync as QWi,rmSync as k1n,writeFileSync as _Wi}from"fs";function k5e(e){function i(){if(!w1n(e.paths.pid))return null;let s=Number.parseInt(QWi(e.paths.pid,"utf-8").trim(),10);if(!Number.isFinite(s))return k1n(e.paths.pid,{force:!0}),null;try{return process.kill(s,0),s}catch{return k1n(e.paths.pid,{force:!0}),null}}return{pid:i,status(){let s=i();if(s===null)return{running:!1};let u=w1n(e.paths.pid)?Math.floor((Date.now()-Number(wWi(e.paths.pid)))/1000):0;return{running:!0,pid:s,uptime:Math.max(0,u),version:e.version,socket:e.paths.socket}},claim(){q8A(e.paths.root,{recursive:!0}),_Wi(e.paths.pid,String(process.pid),"utf-8")},release(){k1n(e.paths.pid,{force:!0})},async up(){let s=i();if(s!==null)return{pid:s,socket:e.paths.socket,already:!0};q8A(e.paths.root,{recursive:!0});let u=yWi(e.paths.log,"a"),g=EWi(e.runtime??process.execPath,[e.entrypoint,"serve"],{stdio:["ignore",u,u],detached:!0});g.unref();let d=Date.now()+5000;while(Date.now()<d){if(w1n(e.paths.socket)&&i()!==null)return{pid:g.pid??0,socket:e.paths.socket,already:!1};await new Promise((f)=>setTimeout(f,50))}throw oA("DAEMON_START_FAILED",{detail:`axond did not bind ${e.paths.socket} within ${"5"}s \u2014 see ${e.paths.log}`,context:{socket:e.paths.socket,log:e.paths.log}})},down(){let s=i();if(s===null)return!1;return process.kill(s,"SIGTERM"),!0}}}function wWi(e){return Bun.file(e).lastModified}var U8A=dt(()=>{ps()});import{spawnSync as kWi}from"child_process";import{existsSync as T8A,mkdirSync as DWi,readFileSync as K8A,rmSync as xWi,writeFileSync as FWi}from"fs";import{homedir as vWi,platform as SWi}from"os";import{dirname as NWi,join as R8A}from"path";function x1n(e){let n=GWi(e.root);return{unit(){return{path:n,supported:sSt()}},installed(){if(!sSt()||!T8A(n))return!1;try{return K8A(n,"utf-8")===Y8A(e.command)}catch{return!1}},install(){if(!sSt())return!1;if(!MWi(e.command))return!1;let i=Y8A(e.command);if(DWi(NWi(n),{recursive:!0}),!T8A(n)||K8A(n,"utf-8")!==i)FWi(n,i,"utf-8");return A(),!0},disable(){if(!sSt())return;HBt(["systemctl","--user","disable","--now",D1n]),xWi(n,{force:!0})}};function A(){HBt(["systemctl","--user","daemon-reload"]),HBt(["systemctl","--user","enable",D1n])}}function sSt(){return SWi()==="linux"&&j8A("systemctl")}function GWi(e){let n=e??process.env.XDG_CONFIG_HOME??R8A(vWi(),".config");return R8A(n,"systemd","user",D1n)}function Y8A(e){return["[Unit]","Description=Axon daemon \u2014 machine-wide agent and resource supervisor","After=network.target","","[Service]","Type=simple",`ExecStart=${e.join(" ")}`,"Restart=on-failure","RestartSec=5","","[Install]","WantedBy=default.target",""].join(`
697
697
  `)}function j8A(e){return HBt(["which",e])}function MWi(e){let[n,...A]=e;if(!n||!j8A(n))return!1;return HBt([n,...A.slice(0,-1),"status"])}function HBt(e){try{let[n,...A]=e;return kWi(n,A,{stdio:"ignore"}).status===0}catch{return!1}}var D1n="axond.service";var H8A=()=>{};function F1n(e){return async function(A,i){let s=e.domains,u=void 0;for(let g of A){if(typeof s!=="object"||s===null||!(g in s))throw oA("DAEMON_NOT_WIRED",{detail:`no such verb: ${A.join(".")}`,context:{path:A.join(".")}});u=s,s=s[g]}if(typeof s!=="function")throw oA("DAEMON_NOT_WIRED",{detail:`${A.join(".")} is not callable`,context:{path:A.join(".")}});return s.call(u,i)}}var P8A=dt(()=>{ps()});function v$(e,n){return`\x1B]8;;${e}\x1B\\${n}\x1B]8;;\x1B\\`}function v1n(e){return e.replace(LWi,"")}function B2(e){return v1n(e).length}function W3(e,n,A=" "){let i=B2(e);return i>=n?e:e+A.repeat(n-i)}function x5e(e,n){if(B2(e)<=n)return e;return v1n(e).slice(0,Math.max(0,n-1))+"\u2026"}var J8A="\x1B",cSt="\x1B[0m",$8A="\x1B[1m",O8A="\x1B[2m",$Le="\x1B[2K",vAe="\x1B[0G",PBt="\x1B[?25l",D5e="\x1B[?25h",SAe=(e)=>e>0?`\x1B[${e}A`:"",LWi;var uSt=dt(()=>{LWi=/\u001b\[[0-9;]*[a-zA-Z]|\u001b\]8;;[^\u001b]*\u001b\\/g});function z8A(e){let n=parseInt(e.slice(1),16);return`${J8A}[38;2;${n>>16&255};${n>>8&255};${n&255}m`}function lSt(e){if(!e.enabled)return{primary:IBe,text:IBe,dim:IBe,warn:IBe,error:IBe,bold:IBe,faint:IBe,plain:IBe};let n=e.theme??Ckt,A=(i)=>(s)=>`${z8A(i)}${s}${cSt}`;return{primary:A(String(n.primary)),text:A(String(n.text)),dim:A(String(n.dim)),warn:A(String(n.warn)),error:A(String(n.error)),bold:(i)=>`${$8A}${i}${cSt}`,faint:(i)=>`${O8A}${z8A(String(n.dim))}${i}${cSt}`,plain:IBe}}var IBe=(e)=>e;var S1n=dt(()=>{Ekt();uSt()});function qWi(e){if(process.env.NO_COLOR)return!1;if(process.env.FORCE_COLOR)return!0;return Boolean(e.isTTY)}function OLe(e={}){let n=e.stream??process.stdout,A=e.color??qWi(n);return{c:lSt({theme:e.theme,enabled:A}),links:A,get columns(){return e.columns??n.columns??80},get interactive(){return Boolean(n.isTTY)},write(s){n.write(s)},line(s=""){n.write(s+`
698
698
  `)}}}var W8A=dt(()=>{S1n();OLe.capture=function(n={}){let A="";return{c:lSt({theme:n.theme,enabled:n.color??!1}),links:n.color??!1,columns:n.columns??80,interactive:!1,write(s){A+=s},line(s=""){A+=s+`
699
699
  `},output(){return A}}}});var yb;var Z8A=dt(()=>{yb={ok:"\u2713",fail:"\u2717",pending:"\u2022",info:"\u2139",warn:"\u26A0",arrow:"\u279C",tee:"\u251C\u2500",elbow:"\u2514\u2500",pipe:"\u2502",star:"\u2605",installs:"\u2193"}});function F5e(e,n){if(n<=0)return[e];return e.split(`
700
- `).flatMap((A)=>{if(A==="")return[""];let i=[],s="";for(let u of A.split(/\s+/).filter(Boolean)){if(s===""){s=u;continue}if(B2(s)+1+B2(u)<=n){s+=" "+u;continue}i.push(s),s=u}if(s!=="")i.push(s);return i})}var V8A=dt(()=>{uSt()});var TM=dt(()=>{W8A();S1n();Z8A();V8A();uSt()});function dD(e,n){let A=e.c.bold(e.c.primary(n.title));if(!n.subtitle)return A;let i=e.c.dim(n.subtitle),s=n.href&&e.links?v$(n.href,i):i;return`${A} ${s}`}var X8A=dt(()=>{TM()});function HL(e,n,A={}){if(n.length===0)return[];let i=A.labelWidth??Math.max(...n.map((u)=>B2(u.label))),s=n.some((u)=>u.arrow!==!1);return n.map((u)=>{let g=u.arrow===!1?s?" ":"":e.c.primary(yb.arrow),d=e.c.dim(W3(u.label+":",i+1)),f=u.href?e.c.primary(u.value):e.c.text(u.value),B=u.href&&e.links?v$(u.href,f):f;return`${g}${g?" ":""}${d} ${B}`})}var eNA=dt(()=>{TM()});function JBt(e,n,A={}){let i=A.files?tNA(n):n,s=" ".repeat(A.indent??0);return ANA(e,i,s,0,A.counts??!0,nNA(i),A.files??!1)}function tNA(e){let n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return[...e].sort((A,i)=>{let s=Boolean(A.children),u=Boolean(i.children);if(s!==u)return s?-1:1;return n.compare(A.label,i.label)})}function nNA(e){let n=0;for(let A of e)if(A.note)n=Math.max(n,B2(A.label));return n}function ANA(e,n,A,i,s,u,g){let d=[];return n.forEach((f,B)=>{let E=B===n.length-1,Q=e.c.faint(E?yb.elbow:yb.tee),w=A+(E?" ":e.c.faint(yb.pipe)+" "),G=(g?Boolean(f.children):i===0)?e.c.primary(f.label):e.c.text(f.label),q=f.href&&e.links?v$(f.href,G):G,P=s&&f.children?.length?e.c.dim(` (${f.children.length})`):"",V=f.note?" ".repeat(Math.max(1,u-B2(f.label)+2))+e.c.dim(f.note):"";if(d.push(`${A}${Q} ${q}${P}${V}`),f.children?.length){let W=g?tNA(f.children):f.children;d.push(...ANA(e,W,w,i+1,s,nNA(W),g))}}),d}var aNA=dt(()=>{TM()});function yy(e,n,A,i,s){let u=n==="pending"&&s?e.c.primary(s):UWi[n](e)(TWi[n]),g=n==="fail"?e.c.error(A):e.c.text(A);return`${u} ${g}${i?" "+e.c.dim(i):""}`}function KM(e,n){return`${e.c.primary(yb.arrow)} ${e.c.text(n)}`}var UWi,TWi;var iNA=dt(()=>{TM();UWi={ok:(e)=>e.c.primary,fail:(e)=>e.c.error,pending:(e)=>e.c.dim,info:(e)=>e.c.primary,warn:(e)=>e.c.warn},TWi={ok:yb.ok,fail:yb.fail,pending:yb.pending,info:yb.info,warn:yb.warn}});function B7(e,n,A={}){if(n.length===0)return[];let i=Math.max(...n.map((s)=>B2(s.label)));return n.map((s)=>{let u=RWi(e,s,A.frame),g=s.state==="waiting"?e.c.dim(W3(s.label,i)):s.state==="failed"?e.c.error(W3(s.label,i)):e.c.text(W3(s.label,i)),d=s.state==="active"&&s.since!==void 0?performance.now()-s.since:s.ms,f=[d!==void 0?rNA(d):"",s.detail??""].filter(Boolean).join(" "),B=s.state==="active"&&s.progress!==void 0?" "+KWi(e,s.progress):"";return`${u} ${g}${f?" "+e.c.dim(f):""}${B}`.trimEnd()})}function KWi(e,n,A=16){let i=Math.round(Math.max(0,Math.min(1,n))*A);return e.c.primary("\u2501".repeat(i))+e.c.faint("\u2501".repeat(A-i))}function RWi(e,n,A){switch(n.state){case"done":return e.c.primary(yb.ok);case"failed":return e.c.error(yb.fail);case"active":return e.c.primary(A??yb.pending);case"waiting":return" "}}function rNA(e){if(e<1000)return`${Math.round(e)}ms`;if(e<60000)return`${(e/1000).toFixed(1)}s`;let n=Math.floor(e/60000),A=Math.round(e%60000/1000);return`${n}m ${A}s`}var gSt;var oNA=dt(()=>{TM();gSt=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]});function EBe(e,n,A={}){if(n.length===0)return[];let i=Math.max(...n.map((u)=>B2(u.name))),s=Math.max(0,...n.map((u)=>B2(u.detail??"")));return n.map((u)=>{let g=YWi(e,u.outcome,A.frame),f=(u.outcome==="noop"||u.outcome==="waiting"?e.c.dim:u.outcome==="fail"?e.c.error:e.c.text)(W3(u.name,i)),B=s>0?" "+e.c.dim(W3(u.detail??"",s)):"",E=u.note?" "+e.c.dim(u.note):"";return`${g} ${f}${B}${E}`.trimEnd()})}function YWi(e,n,A){switch(n){case"ok":return e.c.primary(yb.ok);case"fail":return e.c.error(yb.fail);case"active":return e.c.primary(A??yb.pending);case"noop":return e.c.dim(yb.pending);case"waiting":return" "}}function N1n(e,n){let A=e.filter((g)=>g.outcome==="ok").length,i=e.filter((g)=>g.outcome==="fail").length,s=e.filter((g)=>g.outcome==="noop").length;if(i>0)return{ok:!1,text:`${i} of ${e.length} failed`};if(A===0&&s>0)return{ok:!0,text:"nothing to do"};let u=A===1?n.noun:n.plural??`${n.noun}s`;return{ok:!0,text:`${n.verb} ${A} ${u}`}}var sNA=dt(()=>{TM()});function G1n(e,n,A={}){if(n.length===0)return[];let i=[],s=" ",u=Math.min(Math.max(...n.map((B)=>B2(B.name))),Math.max(20,Math.floor(e.columns*0.4))),g=Math.max(0,...n.map((B)=>B2(B.label??""))),d=Math.max(0,...n.map((B)=>B2(B.version??""))),f={stars:Math.max(0,...n.map((B)=>B.stats?.stars!==void 0?$Bt(B.stats.stars).length:0)),installs:Math.max(0,...n.map((B)=>B.stats?.installs!==void 0?$Bt(B.stats.installs).length:0))};return n.forEach((B,E)=>{if(E>0)i.push("");let Q=e.c.primary(W3(x5e(B.name,u),u)),w=B.label?e.c.dim(W3(B.label,g)):" ".repeat(g),S=B.version?e.c.dim(B.version):"",G=jWi(e,B.stats,f),q=[Q,w,W3(S,d),G??"",B.installed?e.c.dim("installed"):""];if(i.push(q.join(" ").trimEnd()),B.description){let P=e.columns-s.length,V=A.wrapDescriptions?F5e(B.description,P):[x5e(B.description,P)];for(let W of V)i.push(s+e.c.dim(W))}}),i}function jWi(e,n,A={stars:0,installs:0}){if(!n)return;let i=[];if(A.stars>0){let s=n.stars!==void 0?$Bt(n.stars):"";i.push(s?`${yb.star} ${s.padStart(A.stars)}`:" ".repeat(A.stars+2))}if(A.installs>0){let s=n.installs!==void 0?$Bt(n.installs):"";i.push(s?`${yb.installs} ${s.padStart(A.installs)}`:" ".repeat(A.installs+2))}if(i.length===0)return;return e.c.dim(i.join(" "))}function $Bt(e){if(e<1000)return String(e);if(e<1e6){let A=e/1000;return`${A<10?A.toFixed(1).replace(/\.0$/,""):Math.round(A)}k`}let n=e/1e6;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}m`}var cNA=dt(()=>{TM()});function M1n(e,n,A={}){if(n.length===0)return[e.c.dim("no output")];let i=A.limit??10,s=n.slice(-i),u=n.length-s.length,g=Math.max(...s.map((B)=>B2(B.severity))),d=e.columns-(g+4),f=s.map((B)=>{let E=W3(B.severity.toUpperCase(),g),Q=HWi.has(B.severity.toUpperCase())?e.c.error:PWi.has(B.severity.toUpperCase())?e.c.warn:e.c.dim;return`${e.c.dim(yb.pipe)} ${Q(E)} ${e.c.dim(x5e(B.message,d))}`});return u>0?[e.c.dim(`${yb.pipe} \u2026 ${u} earlier ${u===1?"line":"lines"}`),...f]:f}var HWi,PWi;var L1n=dt(()=>{TM();HWi=new Set(["ERROR","CRITICAL","ALERT","EMERGENCY","FATAL"]),PWi=new Set(["WARNING","WARN"])});function C7(e,n,A={}){let i=[],{c:s}=e;i.push(`${s.error(yb.fail)} ${s.bold(s.error(n.title))} ${s.dim(n.code)}`),i.push("");for(let u of F5e(n.description,uNA(e)))i.push(s.text(u));if(n.message&&n.message!==n.title){i.push("");for(let u of F5e(n.message,uNA(e)))i.push(s.dim(u))}if(n.context&&Object.keys(n.context).length>0)i.push(""),i.push(s.bold("Context")),i.push(...JWi(e,n.context));if(!n.expected&&(A.frames??!0)&&n.frames.length>0)i.push(""),i.push(s.bold("Trace")),i.push(...$Wi(e,n.frames));if(n.cause!==void 0)i.push(""),i.push(s.bold("Caused by")),i.push(`${s.dim(yb.elbow)} ${s.error(zWi(n.cause))}`);if(A.output?.length)i.push(""),i.push(s.bold("Container output")),i.push(...M1n(e,A.output));if(A.hint)i.push(""),i.push(`${s.primary(yb.arrow)} ${s.text(A.hint)}`);return i}function uNA(e){return Math.min(e.columns,84)}function JWi(e,n){let A=Object.entries(n),i=Math.max(...A.map(([s])=>s.length));return A.map(([s,u],g)=>{let d=g===A.length-1;return`${e.c.dim(d?yb.elbow:yb.tee)} ${e.c.dim(s.padEnd(i))} ${e.c.text(WWi(u))}`})}function $Wi(e,n){let A=[];return n.forEach((i,s)=>{let u=i.fileName!==null&&i.lineNumber!==null?`${i.fileName}:${i.lineNumber}:${i.columnNumber??0}`:null,g=i.functionName??"<anonymous>",d=u?`${g} ${e.c.dim(u)}`:g;if(A.push(`${e.c.dim(yb.pipe)} ${s===0?e.c.text(d):e.c.dim(d)}`),s===0&&i.source?.length)A.push(...OWi(e,i))}),A}function OWi(e,n){let A=n.source;if(!A?.length)return[];let i=String(A[A.length-1].lineNumber).length,s=[];for(let u of A){let g=String(u.lineNumber).padStart(i),d=u.lineNumber===n.lineNumber,f=d?e.c.error(">"):" ",B=d?e.c.text(u.text):e.c.dim(u.text);if(s.push(`${e.c.dim(yb.pipe)} ${f} ${e.c.dim(g)} ${e.c.dim(yb.pipe)} ${B}`),d&&n.columnNumber!==null){let E=` ${f} ${g} ${yb.pipe} `,Q=" ".repeat(B2(E)+Math.max(0,n.columnNumber-1));s.push(`${e.c.dim(yb.pipe)}${Q}${e.c.error("^")}`)}}return s}function zWi(e){if(e instanceof Error)return e.message;return String(e)}function WWi(e){if(typeof e==="string")return e;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var lNA=dt(()=>{TM();L1n()});var I7=dt(()=>{X8A();eNA();aNA();iNA();oNA();sNA();cNA();L1n();lNA()});function gNA(e,n={}){return["",dD(e,{title:"arcline",subtitle:"\u2014 unified CLI rendering for Axon"}),"",yy(e,"ok",`hello, ${n.name??"world"}`),""].join(`
700
+ `).flatMap((A)=>{if(A==="")return[""];let i=[],s="";for(let u of A.split(/\s+/).filter(Boolean)){if(s===""){s=u;continue}if(B2(s)+1+B2(u)<=n){s+=" "+u;continue}i.push(s),s=u}if(s!=="")i.push(s);return i})}var V8A=dt(()=>{uSt()});var TM=dt(()=>{W8A();S1n();Z8A();V8A();uSt()});function dD(e,n){let A=e.c.bold(e.c.primary(n.title));if(!n.subtitle)return A;let i=e.c.dim(n.subtitle),s=n.href&&e.links?v$(n.href,i):i;return`${A} ${s}`}var X8A=dt(()=>{TM()});function HL(e,n,A={}){if(n.length===0)return[];let i=A.labelWidth??Math.max(...n.map((u)=>B2(u.label))),s=n.some((u)=>u.arrow!==!1);return n.map((u)=>{let g=u.arrow===!1?s?" ":"":e.c.primary(yb.arrow),d=e.c.dim(W3(u.label+":",i+1)),f=u.href?e.c.primary(u.value):e.c.text(u.value),B=u.href&&e.links?v$(u.href,f):f;return`${g}${g?" ":""}${d} ${B}`})}var eNA=dt(()=>{TM()});function JBt(e,n,A={}){let i=A.files?tNA(n):n,s=" ".repeat(A.indent??0);return ANA(e,i,s,0,A.counts??!0,nNA(i),A.files??!1)}function tNA(e){let n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return[...e].sort((A,i)=>{let s=Boolean(A.children),u=Boolean(i.children);if(s!==u)return s?-1:1;return n.compare(A.label,i.label)})}function nNA(e){let n=0;for(let A of e)if(A.note)n=Math.max(n,B2(A.label));return n}function ANA(e,n,A,i,s,u,g){let d=[];return n.forEach((f,B)=>{let E=B===n.length-1,Q=e.c.faint(E?yb.elbow:yb.tee),w=A+(E?" ":e.c.faint(yb.pipe)+" "),G=(g?Boolean(f.children):i===0)?e.c.primary(f.label):e.c.text(f.label),q=f.href&&e.links?v$(f.href,G):G,P=s&&f.children?.length?e.c.dim(` (${f.children.length})`):"",V=f.note?" ".repeat(Math.max(1,u-B2(f.label)+2))+e.c.dim(f.note):"";if(d.push(`${A}${Q} ${q}${P}${V}`),f.children?.length){let W=g?tNA(f.children):f.children;d.push(...ANA(e,W,w,i+1,s,nNA(W),g))}}),d}var aNA=dt(()=>{TM()});function yy(e,n,A,i,s){let u=n==="pending"&&s?e.c.primary(s):UWi[n](e)(TWi[n]),g=n==="fail"?e.c.error(A):e.c.text(A);return`${u} ${g}${i?" "+e.c.dim(i):""}`}function KM(e,n){return`${e.c.primary(yb.arrow)} ${e.c.text(n)}`}var UWi,TWi;var iNA=dt(()=>{TM();UWi={ok:(e)=>e.c.primary,fail:(e)=>e.c.error,pending:(e)=>e.c.dim,info:(e)=>e.c.primary,warn:(e)=>e.c.warn},TWi={ok:yb.ok,fail:yb.fail,pending:yb.pending,info:yb.info,warn:yb.warn}});function B7(e,n,A={}){if(n.length===0)return[];let i=Math.max(...n.map((s)=>B2(s.label)));return n.map((s)=>{let u=RWi(e,s,A.frame),g=s.state==="waiting"?e.c.dim(W3(s.label,i)):s.state==="failed"?e.c.error(W3(s.label,i)):e.c.text(W3(s.label,i)),d=s.state==="active"&&s.since!==void 0?performance.now()-s.since:s.ms,f=[d!==void 0?rNA(d):"",s.detail??""].filter(Boolean).join(" "),B=s.state==="active"&&s.progress!==void 0?" "+KWi(e,s.progress):"";return`${u} ${g}${f?" "+e.c.dim(f):""}${B}`.trimEnd()})}function KWi(e,n,A=16){let i=Math.round(Math.max(0,Math.min(1,n))*A);return e.c.primary("\u2501".repeat(i))+e.c.faint("\u2501".repeat(A-i))}function RWi(e,n,A){switch(n.state){case"done":return e.c.primary(yb.ok);case"failed":return e.c.error(yb.fail);case"active":return e.c.primary(A??yb.pending);case"waiting":return" "}}function rNA(e){if(e<1000)return`${Math.round(e)}ms`;if(e<60000)return`${(e/1000).toFixed(1)}s`;let n=Math.floor(e/60000),A=Math.round(e%60000/1000);return`${n}m ${A}s`}var gSt;var oNA=dt(()=>{TM();gSt=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]});function EBe(e,n,A={}){if(n.length===0)return[];let i=Math.max(...n.map((u)=>B2(u.name))),s=Math.max(0,...n.map((u)=>B2(u.detail??"")));return n.map((u)=>{let g=YWi(e,u.outcome,A.frame),f=(u.outcome==="noop"||u.outcome==="waiting"?e.c.dim:u.outcome==="fail"?e.c.error:e.c.text)(W3(u.name,i)),B=s>0?" "+e.c.dim(W3(u.detail??"",s)):"",E=u.note?" "+e.c.dim(u.note):"";return`${g} ${f}${B}${E}`.trimEnd()})}function YWi(e,n,A){switch(n){case"ok":return e.c.primary(yb.ok);case"fail":return e.c.error(yb.fail);case"active":return e.c.primary(A??yb.pending);case"noop":return e.c.dim(yb.pending);case"waiting":return" "}}function N1n(e,n){let A=e.filter((g)=>g.outcome==="ok").length,i=e.filter((g)=>g.outcome==="fail").length,s=e.filter((g)=>g.outcome==="noop").length;if(i>0)return{ok:!1,text:`${i} of ${e.length} failed`};if(A===0&&s>0)return{ok:!0,text:"nothing to do"};let u=A===1?n.noun:n.plural??`${n.noun}s`;return{ok:!0,text:`${n.verb} ${A} ${u}`}}var sNA=dt(()=>{TM()});function G1n(e,n,A={}){if(n.length===0)return[];let i=[],s=" ",u=Math.min(Math.max(...n.map((B)=>B2(B.name))),Math.max(20,Math.floor(e.columns*0.4))),g=Math.max(0,...n.map((B)=>B2(B.label??""))),d=Math.max(0,...n.map((B)=>B2(B.version??""))),f={stars:Math.max(0,...n.map((B)=>B.stats?.stars!==void 0?$Bt(B.stats.stars).length:0)),installs:Math.max(0,...n.map((B)=>B.stats?.installs!==void 0?$Bt(B.stats.installs).length:0))};return n.forEach((B,E)=>{if(E>0)i.push("");let Q=e.c.primary(W3(x5e(B.name,u),u)),w=B.label?e.c.dim(W3(B.label,g)):" ".repeat(g),S=B.version?e.c.dim(B.version):"",G=jWi(e,B.stats,f),q=[Q,w,W3(S,d),G??"",B.installed?e.c.dim("installed"):""];if(i.push(q.join(" ").trimEnd()),B.description){let P=e.columns-s.length,V=A.wrapDescriptions?F5e(B.description,P):[x5e(B.description,P)];for(let W of V)i.push(s+e.c.dim(W))}}),i}function jWi(e,n,A={stars:0,installs:0}){if(!n)return;let i=[];if(A.stars>0){let s=n.stars!==void 0?$Bt(n.stars):"";i.push(s?`${yb.star} ${s.padStart(A.stars)}`:" ".repeat(A.stars+2))}if(A.installs>0){let s=n.installs!==void 0?$Bt(n.installs):"";i.push(s?`${yb.installs} ${s.padStart(A.installs)}`:" ".repeat(A.installs+2))}if(i.length===0)return;return e.c.dim(i.join(" "))}function $Bt(e){if(e<1000)return String(e);if(e<1e6){let A=e/1000;return`${A<10?A.toFixed(1).replace(/\.0$/,""):Math.round(A)}k`}let n=e/1e6;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}m`}var cNA=dt(()=>{TM()});function M1n(e,n,A={}){if(n.length===0)return[e.c.dim("no output")];let i=A.limit??10,s=n.slice(-i),u=n.length-s.length,g=Math.max(...s.map((B)=>B2(B.severity))),d=e.columns-(g+4),f=s.map((B)=>{let E=W3(B.severity.toUpperCase(),g),Q=HWi.has(B.severity.toUpperCase())?e.c.error:PWi.has(B.severity.toUpperCase())?e.c.warn:e.c.dim;return`${e.c.dim(yb.pipe)} ${Q(E)} ${e.c.dim(x5e(B.message,d))}`});return u>0?[e.c.dim(`${yb.pipe} \u2026 ${u} earlier ${u===1?"line":"lines"}`),...f]:f}var HWi,PWi;var L1n=dt(()=>{TM();HWi=new Set(["ERROR","CRITICAL","ALERT","EMERGENCY","FATAL"]),PWi=new Set(["WARNING","WARN"])});function C7(e,n,A={}){let i=[],{c:s}=e;i.push(`${s.error(yb.fail)} ${s.bold(s.error(n.title))} ${s.dim(n.code)}`),i.push("");for(let u of F5e(n.description,uNA(e)))i.push(s.text(u));if(n.message&&n.message!==n.title){i.push("");for(let u of F5e(n.message,uNA(e)))i.push(s.dim(u))}if(n.context&&Object.keys(n.context).length>0)i.push(""),i.push(s.bold("Context")),i.push(...JWi(e,n.context));if(!n.expected&&(A.frames??!0)&&n.frames.length>0)i.push(""),i.push(s.bold("Trace")),i.push(...$Wi(e,n.frames));if(n.cause!==void 0)i.push(""),i.push(s.bold("Caused by")),i.push(`${s.dim(yb.elbow)} ${s.error(zWi(n.cause))}`);if(A.output?.length)i.push(""),i.push(s.bold("Container output")),i.push(...M1n(e,A.output));if(A.hint)i.push(""),i.push(`${s.primary(yb.arrow)} ${s.text(A.hint)}`);return i}function uNA(e){return Math.min(e.columns,84)}function JWi(e,n){let A=Object.entries(n),i=Math.max(...A.map(([s])=>s.length));return A.map(([s,u],g)=>{let d=g===A.length-1;return`${e.c.dim(d?yb.elbow:yb.tee)} ${e.c.dim(s.padEnd(i))} ${e.c.text(WWi(u))}`})}function $Wi(e,n){let A=[];return n.forEach((i,s)=>{let u=i.fileName!==null&&i.lineNumber!==null?`${i.fileName}:${i.lineNumber}:${i.columnNumber??0}`:null,g=i.functionName??"<anonymous>",d=u?`${g} ${e.c.dim(u)}`:g;if(A.push(`${e.c.dim(yb.pipe)} ${s===0?e.c.text(d):e.c.dim(d)}`),s===0&&i.source?.length)A.push(...OWi(e,i))}),A}function OWi(e,n){let A=n.source;if(!A?.length)return[];let i=String(A[A.length-1].lineNumber).length,s=[];for(let u of A){let g=String(u.lineNumber).padStart(i),d=u.lineNumber===n.lineNumber,f=d?e.c.error(">"):" ",B=d?e.c.text(u.text):e.c.dim(u.text);if(s.push(`${e.c.dim(yb.pipe)} ${f} ${e.c.dim(g)} ${e.c.dim(yb.pipe)} ${B}`),d&&n.columnNumber!==null){let E=` ${f} ${g} ${yb.pipe} `,Q=" ".repeat(B2(E)+Math.max(0,n.columnNumber-1));s.push(`${e.c.dim(yb.pipe)}${Q}${e.c.error("^")}`)}}return s}function zWi(e){if(e instanceof Error)return e.message;return String(e)}function WWi(e){if(typeof e==="string")return e;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var lNA=dt(()=>{TM();L1n()});var I7=dt(()=>{X8A();eNA();aNA();iNA();oNA();sNA();cNA();L1n();lNA()});function gNA(e,n={}){return["",dD(e,{title:"@arcforge/arcline",subtitle:"\u2014 unified CLI rendering for Axon"}),"",yy(e,"ok",`hello, ${n.name??"world"}`),""].join(`
701
701
  `)}var pNA=dt(()=>{I7()});function pSt(e,n){let A=[];A.push(""),A.push(dD(e,{title:n.title,subtitle:"dev server"})),A.push("");let i=(n.info??[]).map(([g,d],f)=>({label:g,value:d,arrow:f===0})),s=(n.links??[]).map(([g,d])=>({label:g,value:d,href:d})),u=Math.max(...[...i,...s].map((g)=>g.label.length));if(i.length)A.push(...HL(e,i,{labelWidth:u}));if(i.length&&s.length)A.push("");if(s.length)A.push(...HL(e,s,{labelWidth:u}));return A.push(""),A.push(yy(e,"ok",n.readyMs!==void 0?`ready in ${n.readyMs}ms`:"ready")),A.push(""),A.join(`
702
702
  `)}var mNA=dt(()=>{I7()});function JEe(e){return`https://axon.arclabs.it/${e}`}function zBt(e,n){let A=[];if(A.push(""),A.push(dD(e,{title:"Publishing",subtitle:n.name,href:JEe(n.name)})),A.push(""),A.push(...B7(e,n.steps,n.frame!==void 0?{frame:n.frame}:{})),n.result){if(A.push(""),A.push(...HL(e,[{label:"Version",value:n.result.version,arrow:!1},{label:"Access",value:n.result.visibility,arrow:!1},...n.result.registeredId?[{label:"Registry",value:n.result.registeredId,arrow:!1}]:[]])),n.result.assets?.length)A.push(""),A.push(...EBe(e,n.result.assets.map((s)=>({name:s.path,outcome:s.from?"ok":"noop",detail:s.size,...s.from?{note:`from ${s.from}`}:{}}))));A.push("");let i=`${n.name}@${n.result.version}`;A.push(yy(e,"ok",e.links?`published ${v$(JEe(n.name),i)}`:`published ${i}`,n.result.ms!==void 0?`${(n.result.ms/1000).toFixed(1)}s`:void 0))}if(n.failure)A.push(""),A.push(...C7(e,n.failure.error,{...n.failure.hint?{hint:n.failure.hint}:{}}));return A.push(""),A.join(`
703
703
  `)}var OBt;var v5e=dt(()=>{I7();TM();OBt=["Bundling","Verifying","Registering","Uploading"]});function sv(e){let{renderer:n,view:A}=e,i=e.initial,s=0,u=0,g=!1;function d(){return gSt[u%gSt.length]}function f(){let Q=A(n,i,d()).split(`
@@ -2010,9 +2010,9 @@ const ${B.map((E)=>`_${ER[E]} = ${ER[E]}`).join(", ")}
2010
2010
  //@ts-ignore
2011
2011
  `:""}(...args)`} => ${S?"{":"("}`,f,S?"}":")"])}let E={props:[l8(d,f||jB("() => {}",!1,s))]};if(i)E=i(E);if(B)E.props[0].value=A.cache(E.props[0].value);return E.props.forEach((Q)=>Q.key.isHandlerKey=!0),E},W$A=(e,n,A)=>{let{modifiers:i,loc:s}=e,u=e.arg,{exp:g}=e;if(g&&g.type===4&&!g.content.trim())return A.onError(N0(34,s)),{props:[l8(u,jB("",!0,s))]};if(u.type!==4)u.children.unshift("("),u.children.push(') || ""');else if(!u.isStatic)u.content=u.content?`${u.content} || ""`:'""';if(i.some((d)=>d.content==="camel"))if(u.type===4)if(u.isStatic)u.content=Fg.camelize(u.content);else u.content=`${A.helperString(t3t)}(${u.content})`;else u.children.unshift(`${A.helperString(t3t)}(`),u.children.push(")");if(!A.inSSR){if(i.some((d)=>d.content==="prop"))OJA(u,".");if(i.some((d)=>d.content==="attr"))OJA(u,"^")}return{props:[l8(u,g)]}},OJA=(e,n)=>{if(e.type===4)if(e.isStatic)e.content=n+e.content;else e.content=`\`${n}\${${e.content}}\``;else e.children.unshift(`'${n}' + (`),e.children.push(")")},skr=(e,n)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{let A=e.children,i=void 0,s=!1;for(let u=0;u<A.length;u++){let g=A[u];if(zNt(g)){s=!0;for(let d=u+1;d<A.length;d++){let f=A[d];if(zNt(f)){if(!i)i=A[u]=j$([g],g.loc);i.children.push(" + ",f),A.splice(d,1),d--}else{i=void 0;break}}}}if(!s||A.length===1&&(e.type===0||e.type===1&&e.tagType===0&&!e.props.find((u)=>u.type===7&&!n.directiveTransforms[u.name])&&e.tag!=="template"))return;for(let u=0;u<A.length;u++){let g=A[u];if(zNt(g)||g.type===8){let d=[];if(g.type!==2||g.content!==" ")d.push(g);if(!n.ssr&&P$(g,n)===0)d.push("1");A[u]={type:12,content:g,loc:g.loc,codegenNode:$M(n.helper(l3t),d)}}}}},zJA=new WeakSet,ckr=(e,n)=>{if(e.type===1&&k7(e,"once",!0)){if(zJA.has(e)||n.inVOnce||n.inSSR)return;return zJA.add(e),n.inVOnce=!0,n.helper(QEt),()=>{n.inVOnce=!1;let A=n.currentNode;if(A.codegenNode)A.codegenNode=n.cache(A.codegenNode,!0,!0)}}},Z$A=(e,n,A)=>{let{exp:i,arg:s}=e;if(!i)return A.onError(N0(41,e.loc)),GRe();let u=i.loc.source.trim(),g=i.type===4?i.content:u,d=A.bindingMetadata[u];if(d==="props"||d==="props-aliased")return A.onError(N0(44,i.loc)),GRe();if(d==="literal-const"||d==="setup-const")return A.onError(N0(45,i.loc)),GRe();let f=A.inline&&(d==="setup-let"||d==="setup-ref"||d==="setup-maybe-ref");if(!g.trim()||!B6n(i,A)&&!f)return A.onError(N0(42,i.loc)),GRe();if(A.prefixIdentifiers&&nCe(g)&&A.identifiers[g])return A.onError(N0(43,i.loc)),GRe();let B=s?s:jB("modelValue",!0),E=s?JAe(s)?`onUpdate:${Fg.camelize(s.content)}`:j$(['"onUpdate:" + ',s]):"onUpdate:modelValue",Q,w=A.isTS?"($event: any)":"$event";if(f)if(d==="setup-ref")Q=j$([`${w} => ((`,jB(u,!1,i.loc),").value = $event)"]);else{let G=d==="setup-let"?`${u} = $event`:"null";Q=j$([`${w} => (${A.helperString(wEt)}(${u}) ? (`,jB(u,!1,i.loc),`).value = $event : ${G})`])}else Q=j$([`${w} => ((`,i,") = $event)"]);let S=[l8(B,e.exp),l8(E,Q)];if(A.prefixIdentifiers&&!A.inVOnce&&A.cacheHandlers&&!$L(i,A.identifiers))S[1].value=A.cache(S[1].value);if(e.modifiers.length&&n.tagType===1){let G=e.modifiers.map((P)=>P.content).map((P)=>(nCe(P)?P:JSON.stringify(P))+": true").join(", "),q=s?JAe(s)?`${s.content}Modifiers`:j$([s,' + "Modifiers"']):"modelModifiers";S.push(l8(q,jB(`{ ${G} }`,!1,e.loc,2)))}return GRe(S)};function GRe(e=[]){return{props:e}}var ukr=/[\w).+\-_$\]]/,lkr=(e,n)=>{if(!Lqe("COMPILER_FILTERS",n))return;if(e.type===5)o3t(e.content,n);else if(e.type===1)e.props.forEach((A)=>{if(A.type===7&&A.name!=="for"&&A.exp)o3t(A.exp,n)})};function o3t(e,n){if(e.type===4)WJA(e,n);else for(let A=0;A<e.children.length;A++){let i=e.children[A];if(typeof i!=="object")continue;if(i.type===4)WJA(i,n);else if(i.type===8)o3t(i,n);else if(i.type===5)o3t(i.content,n)}}function WJA(e,n){let A=e.content,i=!1,s=!1,u=!1,g=!1,d=0,f=0,B=0,E=0,Q,w,S,G,q=[];for(S=0;S<A.length;S++)if(w=Q,Q=A.charCodeAt(S),i){if(Q===39&&w!==92)i=!1}else if(s){if(Q===34&&w!==92)s=!1}else if(u){if(Q===96&&w!==92)u=!1}else if(g){if(Q===47&&w!==92)g=!1}else if(Q===124&&A.charCodeAt(S+1)!==124&&A.charCodeAt(S-1)!==124&&!d&&!f&&!B)if(G===void 0)E=S+1,G=A.slice(0,S).trim();else P();else{switch(Q){case 34:s=!0;break;case 39:i=!0;break;case 96:u=!0;break;case 40:B++;break;case 41:B--;break;case 91:f++;break;case 93:f--;break;case 123:d++;break;case 125:d--;break}if(Q===47){let V=S-1,W;for(;V>=0;V--)if(W=A.charAt(V),W!==" ")break;if(!W||!ukr.test(W))g=!0}}if(G===void 0)G=A.slice(0,S).trim();else if(E!==0)P();function P(){q.push(A.slice(E,S).trim()),E=S+1}if(q.length){for(S=0;S<q.length;S++)G=gkr(G,q[S],n);e.content=G,e.ast=void 0}}function gkr(e,n,A){A.helper(m3t);let i=n.indexOf("(");if(i<0)return A.filters.add(n),`${Kqe(n,"filter")}(${e})`;else{let s=n.slice(0,i),u=n.slice(i+1);return A.filters.add(s),`${Kqe(s,"filter")}(${e}${u!==")"?","+u:u}`}}var ZJA=new WeakSet,pkr=(e,n)=>{if(e.type===1){let A=k7(e,"memo");if(!A||ZJA.has(e)||n.inSSR)return;return ZJA.add(e),()=>{let i=e.codegenNode||n.currentNode.codegenNode;if(i&&i.type===13){if(e.tagType!==1)y3t(i,n);e.codegenNode=$M(n.helper(E3t),[A.exp,qqe(void 0,i),"_cache",String(n.cached.length)]),n.cached.push(null)}}}},V$A=(e,n)=>{if(e.type===1){for(let A of e.props)if(A.type===7&&A.name==="bind"&&(!A.exp||!1)&&A.arg){let i=A.arg;if(i.type!==4||!i.isStatic)n.onError(N0(53,i.loc)),A.exp=jB("",!0,i.loc);else{let s=Fg.camelize(i.content);if(b6n.test(s[0])||s[0]==="-")A.exp=jB(s,!1,i.loc)}}}};function X$A(e){return[[V$A,ckr,X0r,pkr,nkr,lkr,...e?[Y$A,U$A]:[],okr,P$A,R$A,skr],{on:z$A,bind:W$A,model:Z$A}]}function mkr(e,n={}){let A=n.onError||p6n,i=n.mode==="module",s=n.prefixIdentifiers===!0||i;if(!s&&n.cacheHandlers)A(N0(50));if(n.scopeId&&!i)A(N0(51));let u=Fg.extend({},n,{prefixIdentifiers:s}),g=Fg.isString(e)?w$A(e,u):e,[d,f]=X$A(s);if(n.isTS){let{expressionPlugins:B}=n;if(!B||!B.includes("typescript"))n.expressionPlugins=[...B||[],"typescript"]}return S$A(g,Fg.extend({},u,{nodeTransforms:[...d,...n.nodeTransforms||[]],directiveTransforms:Fg.extend({},f,n.directiveTransforms||{})})),N$A(g,u)}var dkr={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},fkr=()=>({props:[]});eOA.generateCodeFrame=Fg.generateCodeFrame;eOA.BASE_TRANSITION=r6n;eOA.BindingTypes=dkr;eOA.CAMELIZE=t3t;eOA.CAPITALIZE=VJA;eOA.CREATE_BLOCK=o6n;eOA.CREATE_COMMENT=YRe;eOA.CREATE_ELEMENT_BLOCK=s6n;eOA.CREATE_ELEMENT_VNODE=u3t;eOA.CREATE_SLOTS=l6n;eOA.CREATE_STATIC=c6n;eOA.CREATE_TEXT=l3t;eOA.CREATE_VNODE=c3t;eOA.CompilerDeprecationTypes=n0r;eOA.ConstantTypes=zwr;eOA.ElementTypes=Owr;eOA.ErrorCodes=i0r;eOA.FRAGMENT=URe;eOA.GUARD_REACTIVE_PROPS=jRe;eOA.IS_MEMO_SAME=g6n;eOA.IS_REF=wEt;eOA.KEEP_ALIVE=IEt;eOA.MERGE_PROPS=yEt;eOA.NORMALIZE_CLASS=b3t;eOA.NORMALIZE_PROPS=TRe;eOA.NORMALIZE_STYLE=B3t;eOA.Namespaces=Jwr;eOA.NodeTypes=$wr;eOA.OPEN_BLOCK=_ye;eOA.POP_SCOPE_ID=e$A;eOA.PUSH_SCOPE_ID=XJA;eOA.RENDER_LIST=f3t;eOA.RENDER_SLOT=u6n;eOA.RESOLVE_COMPONENT=EEt;eOA.RESOLVE_DIRECTIVE=p3t;eOA.RESOLVE_DYNAMIC_COMPONENT=g3t;eOA.RESOLVE_FILTER=m3t;eOA.SET_BLOCK_TRACKING=QEt;eOA.SUSPENSE=s3t;eOA.TELEPORT=qRe;eOA.TO_DISPLAY_STRING=h3t;eOA.TO_HANDLERS=C3t;eOA.TO_HANDLER_KEY=n3t;eOA.TS_NODE_TYPES=f6n;eOA.UNREF=_Et;eOA.WITH_CTX=I3t;eOA.WITH_DIRECTIVES=d3t;eOA.WITH_MEMO=E3t;eOA.advancePositionWithClone=e6n;eOA.advancePositionWithMutation=C6n;eOA.assert=p0r;eOA.baseCompile=mkr;eOA.baseParse=w$A;eOA.buildDirectiveArgs=$$A;eOA.buildProps=k6n;eOA.buildSlots=j$A;eOA.checkCompatEnabled=kEt;eOA.convertToBlock=y3t;eOA.createArrayExpression=Qye;eOA.createAssignmentExpression=Xwr;eOA.createBlockStatement=A$A;eOA.createCacheExpression=n$A;eOA.createCallExpression=$M;eOA.createCompilerError=N0;eOA.createCompoundExpression=j$;eOA.createConditionalExpression=A3t;eOA.createForLoopParams=r3t;eOA.createFunctionExpression=qqe;eOA.createIfStatement=Vwr;eOA.createInterpolation=Wwr;eOA.createObjectExpression=H$;eOA.createObjectProperty=l8;eOA.createReturnStatement=t0r;eOA.createRoot=t$A;eOA.createSequenceExpression=e0r;eOA.createSimpleExpression=jB;eOA.createStructuralDirectiveTransform=Q6n;eOA.createTemplateLiteral=Zwr;eOA.createTransformContext=v$A;eOA.createVNodeCall=KRe;eOA.errorMessages=r$A;eOA.extractIdentifiers=PAe;eOA.findDir=k7;eOA.findProp=DEt;eOA.forAliasRE=I$A;eOA.generate=N$A;eOA.getBaseTransformPreset=X$A;eOA.getConstantType=P$;eOA.getMemoedVNodeCall=C$A;eOA.getVNodeBlockHelper=Tqe;eOA.getVNodeHelper=Uqe;eOA.hasDynamicKeyVBind=m0r;eOA.hasScopeRef=$L;eOA.helperNameMap=ER;eOA.injectProp=FEt;eOA.isAllWhitespace=I6n;eOA.isCommentOrWhitespace=E6n;eOA.isCoreComponent=h6n;eOA.isFnExpression=b$A;eOA.isFnExpressionBrowser=g0r;eOA.isFnExpressionNode=h$A;eOA.isFunctionType=m$A;eOA.isInDestructureAssignment=i3t;eOA.isInNewExpression=c$A;eOA.isMemberExpression=B6n;eOA.isMemberExpressionBrowser=u0r;eOA.isMemberExpressionNode=f$A;eOA.isReferencedIdentifier=s$A;eOA.isSimpleIdentifier=nCe;eOA.isSlotOutlet=xEt;eOA.isStaticArgOf=yye;eOA.isStaticExp=JAe;eOA.isStaticProperty=d6n;eOA.isStaticPropertyKey=d$A;eOA.isTemplateNode=RRe;eOA.isText=zNt;eOA.isVPre=t6n;eOA.isVSlot=w3t;eOA.isWhitespaceText=k3t;eOA.locStub=g8;eOA.noopDirectiveTransform=fkr;eOA.processExpression=D7;eOA.processFor=K$A;eOA.processIf=T$A;eOA.processSlotOutlet=O$A;eOA.registerRuntimeHelpers=Pwr;eOA.resolveComponentType=J$A;eOA.stringifyExpression=_6n;eOA.toValidAssetId=Kqe;eOA.trackSlotScopes=R$A;eOA.trackVForSlotScopes=Y$A;eOA.transform=S$A;eOA.transformBind=W$A;eOA.transformElement=P$A;eOA.transformExpression=U$A;eOA.transformModel=Z$A;eOA.transformOn=z$A;eOA.transformVBindShorthand=V$A;eOA.traverseNode=SEt;eOA.unwrapTSNode=Q3t;eOA.validFirstIdentCharRE=b6n;eOA.walkBlockDeclarations=m6n;eOA.walkFunctionParams=u$A;eOA.walkIdentifiers=o$A;eOA.warnDeprecation=a0r});var cOA=Ar((v3t)=>{Object.defineProperty(v3t,"__esModule",{value:!0});var _I=tOA(),bE=Fqe(),D6n=Symbol(""),x6n=Symbol(""),F6n=Symbol(""),v6n=Symbol(""),F3t=Symbol(""),S6n=Symbol(""),N6n=Symbol(""),G6n=Symbol(""),M6n=Symbol(""),L6n=Symbol("");_I.registerRuntimeHelpers({[D6n]:"vModelRadio",[x6n]:"vModelCheckbox",[F6n]:"vModelText",[v6n]:"vModelSelect",[F3t]:"vModelDynamic",[S6n]:"withModifiers",[N6n]:"withKeys",[G6n]:"vShow",[M6n]:"Transition",[L6n]:"TransitionGroup"});var q6n={parseMode:"html",isVoidTag:bE.isVoidTag,isNativeTag:(e)=>bE.isHTMLTag(e)||bE.isSVGTag(e)||bE.isMathMLTag(e),isPreTag:(e)=>e==="pre",isIgnoreNewlineTag:(e)=>e==="pre"||e==="textarea",decodeEntities:void 0,isBuiltInComponent:(e)=>{if(e==="Transition"||e==="transition")return M6n;else if(e==="TransitionGroup"||e==="transition-group")return L6n},getNamespace(e,n,A){let i=n?n.ns:A;if(n&&i===2){if(n.tag==="annotation-xml"){if(e==="svg")return 1;if(n.props.some((s)=>s.type===6&&s.name==="encoding"&&s.value!=null&&(s.value.content==="text/html"||s.value.content==="application/xhtml+xml")))i=0}else if(/^m(?:[ions]|text)$/.test(n.tag)&&e!=="mglyph"&&e!=="malignmark")i=0}else if(n&&i===1){if(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")i=0}if(i===0){if(e==="svg")return 1;if(e==="math")return 2}return i}},aOA=(e)=>{if(e.type===1)e.props.forEach((n,A)=>{if(n.type===6&&n.name==="style"&&n.value)e.props[A]={type:7,name:"bind",arg:_I.createSimpleExpression("style",!0,n.loc),exp:e2r(n.value.content,n.loc),modifiers:[],loc:n.loc}})},e2r=(e,n)=>{let A=bE.parseStringStyle(e);return _I.createSimpleExpression(JSON.stringify(A),!1,n,3)};function ACe(e,n){return _I.createCompilerError(e,n,iOA)}var t2r={X_V_HTML_NO_EXPRESSION:54,"54":"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:55,"55":"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:56,"56":"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:57,"57":"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:58,"58":"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:59,"59":"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:60,"60":"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:61,"61":"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:62,"62":"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:63,"63":"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:64,"64":"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:65,"65":"__EXTEND_POINT__"},iOA={[54]:"v-html is missing expression.",[55]:"v-html will override element children.",[56]:"v-text is missing expression.",[57]:"v-text will override element children.",[58]:"v-model can only be used on <input>, <textarea> and <select> elements.",[59]:"v-model argument is not supported on plain elements.",[60]:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",[61]:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",[62]:"v-show is missing expression.",[63]:"<Transition> expects exactly one child element or component.",[64]:"Tags with side effect (<script> and <style>) are ignored in client component templates."},n2r=(e,n,A)=>{let{exp:i,loc:s}=e;if(!i)A.onError(ACe(54,s));if(n.children.length)A.onError(ACe(55,s)),n.children.length=0;return{props:[_I.createObjectProperty(_I.createSimpleExpression("innerHTML",!0,s),i||_I.createSimpleExpression("",!0))]}},A2r=(e,n,A)=>{let{exp:i,loc:s}=e;if(!i)A.onError(ACe(56,s));if(n.children.length)A.onError(ACe(57,s)),n.children.length=0;return{props:[_I.createObjectProperty(_I.createSimpleExpression("textContent",!0),i?_I.getConstantType(i,A)>0?i:_I.createCallExpression(A.helperString(_I.TO_DISPLAY_STRING),[i],s):_I.createSimpleExpression("",!0))]}},a2r=(e,n,A)=>{let i=_I.transformModel(e,n,A);if(!i.props.length||n.tagType===1)return i;if(e.arg)A.onError(ACe(59,e.arg.loc));let{tag:s}=n,u=A.isCustomElement(s);if(s==="input"||s==="textarea"||s==="select"||u){let g=F6n,d=!1;if(s==="input"||u){let f=_I.findProp(n,"type");if(f){if(f.type===7)g=F3t;else if(f.value)switch(f.value.content){case"radio":g=D6n;break;case"checkbox":g=x6n;break;case"file":d=!0,A.onError(ACe(60,e.loc));break}}else if(_I.hasDynamicKeyVBind(n))g=F3t}else if(s==="select")g=v6n;if(!d)i.needRuntime=A.helper(g)}else A.onError(ACe(58,e.loc));return i.props=i.props.filter((g)=>!(g.key.type===4&&g.key.content==="modelValue")),i},i2r=bE.makeMap("passive,once,capture"),r2r=bE.makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),o2r=bE.makeMap("left,right"),rOA=bE.makeMap("onkeyup,onkeydown,onkeypress"),s2r=(e,n,A,i)=>{let s=[],u=[],g=[];for(let d=0;d<n.length;d++){let f=n[d].content;if(f==="native"&&_I.checkCompatEnabled("COMPILER_V_ON_NATIVE",A,i))g.push(f);else if(i2r(f))g.push(f);else if(o2r(f))if(_I.isStaticExp(e))if(rOA(e.content.toLowerCase()))s.push(f);else u.push(f);else s.push(f),u.push(f);else if(r2r(f))u.push(f);else s.push(f)}return{keyModifiers:s,nonKeyModifiers:u,eventOptionModifiers:g}},nOA=(e,n)=>{return _I.isStaticExp(e)&&e.content.toLowerCase()==="onclick"?_I.createSimpleExpression(n,!0):e.type!==4?_I.createCompoundExpression(["(",e,`) === "onClick" ? "${n}" : (`,e,")"]):e},c2r=(e,n,A)=>{return _I.transformOn(e,n,A,(i)=>{let{modifiers:s}=e;if(!s.length)return i;let{key:u,value:g}=i.props[0],{keyModifiers:d,nonKeyModifiers:f,eventOptionModifiers:B}=s2r(u,s,A,e.loc);if(f.includes("right"))u=nOA(u,"onContextmenu");if(f.includes("middle"))u=nOA(u,"onMouseup");if(f.length)g=_I.createCallExpression(A.helper(S6n),[g,JSON.stringify(f)]);if(d.length&&(!_I.isStaticExp(u)||rOA(u.content.toLowerCase())))g=_I.createCallExpression(A.helper(N6n),[g,JSON.stringify(d)]);if(B.length){let E=B.map(bE.capitalize).join("");u=_I.isStaticExp(u)?_I.createSimpleExpression(`${u.content}${E}`,!0):_I.createCompoundExpression(["(",u,`) + "${E}"`])}return{props:[_I.createObjectProperty(u,g)]}})},u2r=(e,n,A)=>{let{exp:i,loc:s}=e;if(!i)A.onError(ACe(62,s));return{props:[],needRuntime:A.helper(G6n)}},l2r=/__VUE_EXP_START__(.*?)__VUE_EXP_END__/g,g2r=(e,n,A)=>{if(n.scopes.vSlot>0)return;let i=A.type===1&&A.codegenNode&&A.codegenNode.type===13&&A.codegenNode.children&&!bE.isArray(A.codegenNode.children)&&A.codegenNode.children.type===20,s=0,u=0,g=[],d=(B)=>{if(s>=20||u>=5){let E=_I.createCallExpression(n.helper(_I.CREATE_STATIC),[JSON.stringify(g.map((w)=>U6n(w,n)).join("")).replace(l2r,'" + $1 + "'),String(g.length)]),Q=g.length-1;if(i)e.splice(B-g.length,g.length,E);else if(g[0].codegenNode.value=E,g.length>1){e.splice(B-g.length+1,Q);let w=n.cached.indexOf(g[g.length-1].codegenNode);if(w>-1){for(let S=w;S<n.cached.length;S++){let G=n.cached[S];if(G)G.index-=Q}n.cached.splice(w-Q+1,Q)}}return Q}return 0},f=0;for(;f<e.length;f++){let B=e[f];if(i||p2r(B)){let Q=f2r(B);if(Q){s+=Q[0],u+=Q[1],g.push(B);continue}}f-=d(f),s=0,u=0,g.length=0}d(f)},p2r=(e)=>{if((e.type===1&&e.tagType===0||e.type===12)&&e.codegenNode&&e.codegenNode.type===20)return e.codegenNode},m2r=/^(?:data|aria)-/,AOA=(e,n)=>{return(n===0?bE.isKnownHtmlAttr(e):n===1?bE.isKnownSvgAttr(e):n===2?bE.isKnownMathMLAttr(e):!1)||m2r.test(e)},d2r=bE.makeMap("caption,thead,tr,th,tbody,td,tfoot,colgroup,col");function f2r(e){if(e.type===1&&d2r(e.tag))return!1;if(e.type===1&&_I.findDir(e,"once",!0))return!1;if(e.type===12)return[1,0];let n=1,A=e.props.length>0?1:0,i=!1,s=()=>{return i=!0,!1};function u(g){let d=g.tag==="option"&&g.ns===0;for(let f=0;f<g.props.length;f++){let B=g.props[f];if(B.type===6&&!AOA(B.name,g.ns))return s();if(B.type===7&&B.name==="bind"){if(B.arg&&(B.arg.type===8||B.arg.isStatic&&!AOA(B.arg.content,g.ns)))return s();if(B.exp&&(B.exp.type===8||B.exp.constType<3))return s();if(d&&_I.isStaticArgOf(B.arg,"value")&&B.exp&&!B.exp.isStatic)return s()}}for(let f=0;f<g.children.length;f++){n++;let B=g.children[f];if(B.type===1){if(B.props.length>0)A++;if(u(B),i)return!1}}return!0}return u(e)?[n,A]:!1}function U6n(e,n){if(bE.isString(e))return e;if(bE.isSymbol(e))return"";switch(e.type){case 1:return h2r(e,n);case 2:return bE.escapeHtml(e.content);case 3:return`<!--${bE.escapeHtml(e.content)}-->`;case 5:return bE.escapeHtml(bE.toDisplayString(Rqe(e.content)));case 8:return bE.escapeHtml(Rqe(e));case 12:return U6n(e.content,n);default:return""}}function h2r(e,n){let A=`<${e.tag}`,i="";for(let s=0;s<e.props.length;s++){let u=e.props[s];if(u.type===6){if(A+=` ${u.name}`,u.value)A+=`="${bE.escapeHtml(u.value.content)}"`}else if(u.type===7){if(u.name==="bind"){let g=u.exp;if(g.content[0]==="_"){A+=` ${u.arg.content}="__VUE_EXP_START__${g.content}__VUE_EXP_END__"`;continue}if(bE.isBooleanAttr(u.arg.content)&&g.content==="false")continue;let d=Rqe(g);if(d!=null){let f=u.arg&&u.arg.content;if(f==="class")d=bE.normalizeClass(d);else if(f==="style")d=bE.stringifyStyle(bE.normalizeStyle(d));A+=` ${u.arg.content}="${bE.escapeHtml(d)}"`}}else if(u.name==="html")i=Rqe(u.exp);else if(u.name==="text")i=bE.escapeHtml(bE.toDisplayString(Rqe(u.exp)))}}if(n.scopeId)A+=` ${n.scopeId}`;if(A+=">",i)A+=i;else for(let s=0;s<e.children.length;s++)A+=U6n(e.children[s],n);if(!bE.isVoidTag(e.tag))A+=`</${e.tag}>`;return A}function Rqe(e){if(e.type===4)return Function(`return (${e.content})`)();else{let n="";return e.children.forEach((A)=>{if(bE.isString(A)||bE.isSymbol(A))return;if(A.type===2)n+=A.content;else if(A.type===5)n+=bE.toDisplayString(Rqe(A.content));else n+=Rqe(A)}),n}}var b2r=(e,n)=>{if(e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style"))n.removeNode()},oOA=[aOA,...[]],sOA={cloak:_I.noopDirectiveTransform,html:n2r,text:A2r,model:a2r,on:c2r,show:u2r};function B2r(e,n={}){return _I.baseCompile(e,bE.extend({},q6n,n,{nodeTransforms:[b2r,...oOA,...n.nodeTransforms||[]],directiveTransforms:bE.extend({},sOA,n.directiveTransforms||{}),transformHoist:g2r}))}function C2r(e,n={}){return _I.baseParse(e,bE.extend({},q6n,n))}v3t.DOMDirectiveTransforms=sOA;v3t.DOMErrorCodes=t2r;v3t.DOMErrorMessages=iOA;v3t.DOMNodeTransforms=oOA;v3t.TRANSITION=M6n;v3t.TRANSITION_GROUP=L6n;v3t.V_MODEL_CHECKBOX=x6n;v3t.V_MODEL_DYNAMIC=F3t;v3t.V_MODEL_RADIO=D6n;v3t.V_MODEL_SELECT=v6n;v3t.V_MODEL_TEXT=F6n;v3t.V_ON_WITH_KEYS=N6n;v3t.V_ON_WITH_MODIFIERS=S6n;v3t.V_SHOW=G6n;v3t.compile=B2r;v3t.createDOMCompilerError=ACe;v3t.parse=C2r;v3t.parserOptions=q6n;v3t.transformStyle=aOA;Object.keys(_I).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(v3t,e))v3t[e]=_I[e]})});var qOA=Ar((LOA)=>{Object.defineProperty(LOA,"__esModule",{value:!0});var Fo=cOA(),x7=Fqe(),N3t=Symbol("ssrInterpolate"),mOA=Symbol("ssrRenderVNode"),dOA=Symbol("ssrRenderComponent"),fOA=Symbol("ssrRenderSlot"),hOA=Symbol("ssrRenderSlotInner"),bOA=Symbol("ssrRenderClass"),BOA=Symbol("ssrRenderStyle"),P6n=Symbol("ssrRenderAttrs"),COA=Symbol("ssrRenderAttr"),IOA=Symbol("ssrRenderDynamicAttr"),EOA=Symbol("ssrRenderList"),J6n=Symbol("ssrIncludeBooleanAttr"),S3t=Symbol("ssrLooseEqual"),R6n=Symbol("ssrLooseContain"),yOA=Symbol("ssrRenderDynamicModel"),QOA=Symbol("ssrGetDynamicModelProps"),_OA=Symbol("ssrRenderTeleport"),wOA=Symbol("ssrRenderSuspense"),kOA=Symbol("ssrGetDirectiveProps"),Y6n={[N3t]:"ssrInterpolate",[mOA]:"ssrRenderVNode",[dOA]:"ssrRenderComponent",[fOA]:"ssrRenderSlot",[hOA]:"ssrRenderSlotInner",[bOA]:"ssrRenderClass",[BOA]:"ssrRenderStyle",[P6n]:"ssrRenderAttrs",[COA]:"ssrRenderAttr",[IOA]:"ssrRenderDynamicAttr",[EOA]:"ssrRenderList",[J6n]:"ssrIncludeBooleanAttr",[S3t]:"ssrLooseEqual",[R6n]:"ssrLooseContain",[yOA]:"ssrRenderDynamicModel",[QOA]:"ssrGetDynamicModelProps",[_OA]:"ssrRenderTeleport",[wOA]:"ssrRenderSuspense",[kOA]:"ssrGetDirectiveProps"};Fo.registerRuntimeHelpers(Y6n);var K2r=Fo.createStructuralDirectiveTransform(/^(?:if|else|else-if)$/,Fo.processIf);function R2r(e,n,A=!1,i=!1){let[s]=e.branches,u=Fo.createIfStatement(s.condition,uOA(s,n,A));n.pushStatement(u);let g=u;for(let d=1;d<e.branches.length;d++){let f=e.branches[d],B=uOA(f,n,A);if(f.condition)g=g.alternate=Fo.createIfStatement(f.condition,B);else g.alternate=B}if(!g.alternate&&!i)g.alternate=Fo.createBlockStatement([Fo.createCallExpression("_push",["`<!---->`"])])}function uOA(e,n,A=!1){let{children:i}=e,s=!A&&(i.length!==1||i[0].type!==1)&&!(i.length===1&&i[0].type===11);return PRe(e,n,s)}var Y2r=Fo.createStructuralDirectiveTransform("for",Fo.processFor);function j2r(e,n,A=!1){let i=!A&&(e.children.length!==1||e.children[0].type!==1),s=Fo.createFunctionExpression(Fo.createForLoopParams(e.parseResult));if(s.body=PRe(e,n,i),!A)n.pushStringPart("<!--[-->");if(n.pushStatement(Fo.createCallExpression(n.helper(EOA),[e.source,s])),!A)n.pushStringPart("<!--]-->")}var H2r=(e,n)=>{if(Fo.isSlotOutlet(e)){let{slotName:A,slotProps:i}=Fo.processSlotOutlet(e,n),s=["_ctx.$slots",A,i||"{}","null","_push","_parent"];if(n.scopeId&&n.slotted!==!1)s.push(`"${n.scopeId}-s"`);let u=fOA,g=n.parent;if(g){let d=g.children;if(g.type===10)g=n.grandParent;let f;if(g.type===1&&g.tagType===1&&((f=Fo.resolveComponentType(g,n,!0))===Fo.TRANSITION||f===Fo.TRANSITION_GROUP)&&d.filter((B)=>B.type===1).length===1){if(u=hOA,!(n.scopeId&&n.slotted!==!1))s.push("null");s.push("true")}}e.ssrCodegenNode=Fo.createCallExpression(n.helper(u),s)}};function P2r(e,n){let A=e.ssrCodegenNode;if(e.children.length){let i=Fo.createFunctionExpression([]);i.body=PRe(e,n),A.arguments[3]=i}if(n.withSlotScopeId){let i=A.arguments[6];A.arguments[6]=i?`${i} + _scopeId`:"_scopeId"}n.pushStatement(e.ssrCodegenNode)}function GEt(e,n){return Fo.createCompilerError(e,n,J2r)}var J2r={[65]:"Unsafe attribute name for SSR.",[66]:"Missing the 'to' prop on teleport element.",[67]:"Invalid AST node during SSR transform."};function $2r(e,n){let A=Fo.findProp(e,"to");if(!A){n.onError(GEt(66,e.loc));return}let i;if(A.type===6)i=A.value&&Fo.createSimpleExpression(A.value.content,!0);else i=A.exp;if(!i){n.onError(GEt(66,A.loc));return}let s=Fo.findProp(e,"disabled",!1,!0),u=s?s.type===6?"true":s.exp||"false":"false",g=Fo.createFunctionExpression(["_push"],void 0,!0,!1,e.loc);g.body=PRe(e,n),n.pushStatement(Fo.createCallExpression(n.helper(_OA),["_push",g,i,u,"_parent"]))}var DOA=new WeakMap;function O2r(e,n){return()=>{if(e.children.length){let A={slotsExp:null,wipSlots:[]};DOA.set(e,A),A.slotsExp=Fo.buildSlots(e,n,(i,s,u,g)=>{let d=Fo.createFunctionExpression([],void 0,!0,!1,g);return A.wipSlots.push({fn:d,children:u}),d}).slots}}}function z2r(e,n){let A=DOA.get(e);if(!A)return;let{slotsExp:i,wipSlots:s}=A;for(let u=0;u<s.length;u++){let g=s[u];g.fn.body=PRe(g,n)}n.pushStatement(Fo.createCallExpression(n.helper(wOA),["_push",i]))}var NEt=new WeakMap,W2r=(e,n)=>{if(e.type!==1||e.tagType!==0)return;return function(){let i=[`<${e.tag}`],s=e.tag==="textarea"||e.tag.indexOf("-")>0,u=Fo.hasDynamicKeyVBind(e),g=e.props.some((w)=>w.type===7&&!x7.isBuiltInDirective(w.name)),d=e.props.findIndex((w)=>w.type===7&&w.name==="show");if(d!==-1){let w=e.props[d];e.props.splice(d,1),e.props.push(w)}let f=u||g;if(f){let{props:w,directives:S}=Fo.buildProps(e,n,e.props,!1,!1,!0);if(w||S.length){let G=$6n(w,S,n),q=Fo.createCallExpression(n.helper(P6n),[G]);if(e.tag==="textarea"){let P=e.children[0];if(!gOA(e)&&(!P||P.type!==5)){let V=`_temp${n.temps++}`;q.arguments=[Fo.createAssignmentExpression(Fo.createSimpleExpression(V,!1),G)],NEt.set(e,Fo.createCallExpression(n.helper(N3t),[Fo.createConditionalExpression(Fo.createSimpleExpression(`"value" in ${V}`,!1),Fo.createSimpleExpression(`${V}.value`,!1),Fo.createSimpleExpression(P?P.content:"",!0),!1)]))}}else if(e.tag==="input"){let P=exr(e);if(P){let V=`_temp${n.temps++}`,W=Fo.createSimpleExpression(V,!1);q.arguments=[Fo.createSequenceExpression([Fo.createAssignmentExpression(W,G),Fo.createCallExpression(n.helper(Fo.MERGE_PROPS),[W,Fo.createCallExpression(n.helper(QOA),[W,P.exp])])])]}}else if(S.length&&!e.children.length){if(!gOA(e)){let P=`_temp${n.temps++}`;q.arguments=[Fo.createAssignmentExpression(Fo.createSimpleExpression(P,!1),G)],NEt.set(e,Fo.createConditionalExpression(Fo.createSimpleExpression(`"textContent" in ${P}`,!1),Fo.createCallExpression(n.helper(N3t),[Fo.createSimpleExpression(`${P}.textContent`,!1)]),Fo.createSimpleExpression(`${P}.innerHTML ?? ''`,!1),!1))}}if(s)q.arguments.push(`"${e.tag}"`);i.push(q)}}let B=void 0,E=void 0,Q=void 0;for(let w=0;w<e.props.length;w++){let S=e.props[w];if(e.tag==="input"&&Z2r(S))continue;if(S.type===7){if(S.name==="html"&&S.exp)NEt.set(e,Fo.createCompoundExpression(["(",S.exp,") ?? ''"]));else if(S.name==="text"&&S.exp)e.children=[Fo.createInterpolation(S.exp,S.loc)];else if(S.name==="slot")n.onError(Fo.createCompilerError(40,S.loc));else if(V2r(e,S)&&S.exp){if(!f)e.children=[Fo.createInterpolation(S.exp,S.loc)]}else if(!f&&S.name!=="on"){let G=n.directiveTransforms[S.name];if(G){let{props:q,ssrTagParts:P}=G(S,e,n);if(P)i.push(...P);for(let V=0;V<q.length;V++){let{key:W,value:z}=q[V];if(Fo.isStaticExp(W)){let te=W.content;if(te==="key"||te==="ref")continue;if(te==="class")i.push(' class="',B=Fo.createCallExpression(n.helper(bOA),[z]),'"');else if(te==="style")if(Q)lOA(Q,z);else i.push(' style="',Q=Fo.createCallExpression(n.helper(BOA),[z]),'"');else if(te=e.tag.indexOf("-")>0?te:x7.propsToAttrMap[te]||te.toLowerCase(),x7.isBooleanAttr(te))i.push(Fo.createConditionalExpression(Fo.createCallExpression(n.helper(J6n),[z]),Fo.createSimpleExpression(" "+te,!0),Fo.createSimpleExpression("",!0),!1));else if(x7.isSSRSafeAttrName(te))i.push(Fo.createCallExpression(n.helper(COA),[W,z]));else n.onError(GEt(65,W.loc))}else{let te=[W,z];if(s)te.push(`"${e.tag}"`);i.push(Fo.createCallExpression(n.helper(IOA),te))}}}}}else{let G=S.name;if(e.tag==="textarea"&&G==="value"&&S.value)NEt.set(e,x7.escapeHtml(S.value.content));else if(!f){if(G==="key"||G==="ref")continue;if(G==="class"&&S.value)E=JSON.stringify(S.value.content);i.push(` ${S.name}`+(S.value?`="${x7.escapeHtml(S.value.content)}"`:""))}}}if(B&&E)lOA(B,E),X2r(i,"class");if(n.scopeId)i.push(` ${n.scopeId}`);e.ssrCodegenNode=Fo.createTemplateLiteral(i)}};function $6n(e,n,A){let i=[];if(e)if(e.type===14)i=e.arguments;else i.push(e);if(n.length)for(let s of n)i.push(Fo.createCallExpression(A.helper(kOA),["_ctx",...Fo.buildDirectiveArgs(s,A).elements]));return i.length>1?Fo.createCallExpression(A.helper(Fo.MERGE_PROPS),i):i[0]}function Z2r(e){if(e.type===7)return e.name==="bind"&&e.arg&&Fo.isStaticExp(e.arg)&&(e.arg.content==="true-value"||e.arg.content==="false-value");else return e.name==="true-value"||e.name==="false-value"}function V2r(e,n){return!!(e.tag==="textarea"&&n.name==="bind"&&Fo.isStaticArgOf(n.arg,"value"))}function lOA(e,n){let A=e.arguments[0];if(A.type===17)A.elements.push(n);else e.arguments[0]=Fo.createArrayExpression([A,n])}function X2r(e,n){let A=new RegExp(`^ ${n}=".+"$`),i=e.findIndex((s)=>typeof s==="string"&&A.test(s));if(i>-1)e.splice(i,1)}function exr(e){return e.props.find((n)=>n.type===7&&n.name==="model"&&n.exp)}function gOA(e){return!!Fo.findDir(e,"text")||!!Fo.findDir(e,"html")}function txr(e,n){let A=n.options.isVoidTag||x7.NO,i=e.ssrCodegenNode.elements;for(let u=0;u<i.length;u++)n.pushStringPart(i[u]);if(n.withSlotScopeId)n.pushStringPart(Fo.createSimpleExpression("_scopeId",!1));n.pushStringPart(">");let s=NEt.get(e);if(s)n.pushStringPart(s);else if(e.children.length)aCe(e,n);if(!A(e.tag))n.pushStringPart(`</${e.tag}>`)}var xOA=new WeakMap;function nxr(e,n){return()=>{let A=Fo.findProp(e,"tag");if(A){let i=e.props.filter((d)=>d!==A),{props:s,directives:u}=Fo.buildProps(e,n,i,!0,!1,!0),g=null;if(s||u.length)g=Fo.createCallExpression(n.helper(P6n),[$6n(s,u,n)]);xOA.set(e,{tag:A,propsExp:g,scopeId:n.scopeId||null})}}}function Axr(e,n){let A=xOA.get(e);if(A){let{tag:i,propsExp:s,scopeId:u}=A;if(i.type===7){if(n.pushStringPart("<"),n.pushStringPart(i.exp),s)n.pushStringPart(s);if(u)n.pushStringPart(` ${u}`);n.pushStringPart(">"),aCe(e,n,!1,!0,!0),n.pushStringPart("</"),n.pushStringPart(i.exp),n.pushStringPart(">")}else{if(n.pushStringPart(`<${i.value.content}`),s)n.pushStringPart(s);if(u)n.pushStringPart(` ${u}`);n.pushStringPart(">"),aCe(e,n,!1,!0,!0),n.pushStringPart(`</${i.value.content}>`)}}else aCe(e,n,!0,!0,!0)}var FOA=new WeakMap;function axr(e,n){return()=>{let A=Fo.findProp(e,"appear",!1,!0);FOA.set(e,!!A)}}function ixr(e,n){if(e.children=e.children.filter((i)=>i.type!==3),FOA.get(e))n.pushStringPart("<template>"),aCe(e,n,!1,!0),n.pushStringPart("</template>");else aCe(e,n,!1,!0)}var vOA=new WeakMap,SOA=Symbol(),NOA=new WeakMap,rxr=(e,n)=>{if(e.type!==1||e.tagType!==1)return;let A=Fo.resolveComponentType(e,n,!0),i=x7.isObject(A)&&A.callee===Fo.RESOLVE_DYNAMIC_COMPONENT;if(NOA.set(e,A),x7.isSymbol(A)){if(A===Fo.SUSPENSE)return O2r(e,n);else if(A===Fo.TRANSITION_GROUP)return nxr(e,n);else if(A===Fo.TRANSITION)return axr(e);return}let s=[],u=j6n(e);return function(){if(u.children.length)Fo.buildSlots(u,n,(Q,w,S)=>{return s.push(gxr(Q,w,S,n)),Fo.createFunctionExpression(void 0)});let d="null";if(e.props.length){let{props:Q,directives:w}=Fo.buildProps(e,n,void 0,!0,i);if(Q||w.length)d=$6n(Q,w,n)}let f=[];vOA.set(e,f);let B=(Q,w,S,G)=>{let q=Q&&Fo.stringifyExpression(Q)||"_",P=Fo.createFunctionExpression([q,"_push","_parent","_scopeId"],void 0,!0,!0,G);return f.push({type:SOA,fn:P,children:S,vnodeBranch:s[f.length]}),P},E=e.children.length?Fo.buildSlots(e,n,B).slots:"null";if(typeof A!=="string")e.ssrCodegenNode=Fo.createCallExpression(n.helper(mOA),["_push",Fo.createCallExpression(n.helper(Fo.CREATE_VNODE),[A,d,E]),"_parent"]);else e.ssrCodegenNode=Fo.createCallExpression(n.helper(dOA),[A,d,E,"_parent"])}};function oxr(e,n,A){let i=NOA.get(e);if(!e.ssrCodegenNode)if(i===Fo.TELEPORT)return $2r(e,n);else if(i===Fo.SUSPENSE)return z2r(e,n);else if(i===Fo.TRANSITION_GROUP)return Axr(e,n);else{if(A.type===SOA)n.pushStringPart("");if(i===Fo.TRANSITION)return ixr(e,n);aCe(e,n)}else{let s=vOA.get(e)||[];for(let u=0;u<s.length;u++){let{fn:g,vnodeBranch:d}=s[u];g.body=Fo.createIfStatement(Fo.createSimpleExpression("_push",!1),PRe(s[u],n,!1,!0),d)}if(n.withSlotScopeId)e.ssrCodegenNode.arguments.push("_scopeId");if(typeof i==="string")n.pushStatement(Fo.createCallExpression("_push",[e.ssrCodegenNode]));else n.pushStatement(e.ssrCodegenNode)}}var GOA=new WeakMap,[sxr,cxr]=Fo.getBaseTransformPreset(!0),uxr=[...sxr,...Fo.DOMNodeTransforms],lxr={...cxr,...Fo.DOMDirectiveTransforms};function gxr(e,n,A,i){let s=GOA.get(i.root),u={...s,nodeTransforms:[...uxr,...s.nodeTransforms||[]],directiveTransforms:{...lxr,...s.directiveTransforms||{}}},g=[];if(e)g.push({type:7,name:"slot",exp:e,arg:void 0,modifiers:[],loc:Fo.locStub});if(n)g.push(x7.extend({},n));let d={type:1,ns:0,tag:"template",tagType:3,props:g,children:A,loc:Fo.locStub,codegenNode:void 0};return pxr(d,u,i),Fo.createReturnStatement(A)}function pxr(e,n,A){let i=Fo.createRoot([e]),s=Fo.createTransformContext(i,n);s.ssr=!1,s.scopes={...A.scopes},s.identifiers={...A.identifiers},s.imports=A.imports,Fo.traverseNode(i,s),["helpers","components","directives"].forEach((u)=>{s[u].forEach((g,d)=>{if(u==="helpers"){let f=A.helpers.get(d);if(f===void 0)A.helpers.set(d,g);else A.helpers.set(d,g+f)}else A[u].add(g)})})}function j6n(e){if(x7.isArray(e))return e.map(j6n);else if(x7.isPlainObject(e)){let n={};for(let A in e)n[A]=j6n(e[A]);return n}else return e}function mxr(e,n){let A=MOA(e,n);if(n.ssrCssVars){let s=Fo.createTransformContext(Fo.createRoot([]),n),u=Fo.processExpression(Fo.createSimpleExpression(n.ssrCssVars,!1),s);A.body.push(Fo.createCompoundExpression(["const _cssVars = { style: ",u,"}"])),Array.from(s.helpers.keys()).forEach((g)=>{e.helpers.add(g)})}let i=e.children.length>1&&e.children.some((s)=>!Fo.isText(s));aCe(e,A,i),e.codegenNode=Fo.createBlockStatement(A.body),e.ssrHelpers=Array.from(new Set([...Array.from(e.helpers).filter((s)=>(s in Y6n)),...A.helpers])),e.helpers=new Set(Array.from(e.helpers).filter((s)=>!(s in Y6n)))}function MOA(e,n,A=new Set,i=!1){let s=[],u=null;return{root:e,options:n,body:s,helpers:A,withSlotScopeId:i,onError:n.onError||((g)=>{throw g}),helper(g){return A.add(g),g},pushStringPart(g){if(!u){let B=Fo.createCallExpression("_push");s.push(B),u=Fo.createTemplateLiteral([]),B.arguments.push(u)}let d=u.elements,f=d[d.length-1];if(x7.isString(g)&&x7.isString(f))d[d.length-1]+=g;else d.push(g)},pushStatement(g){u=null,s.push(g)}}}function dxr(e,n=e.withSlotScopeId){return MOA(e.root,e.options,e.helpers,n)}function aCe(e,n,A=!1,i=!1,s=!1){if(A)n.pushStringPart("<!--[-->");let{children:u}=e;for(let g=0;g<u.length;g++){let d=u[g];switch(d.type){case 1:switch(d.tagType){case 0:txr(d,n);break;case 1:oxr(d,n,e);break;case 2:P2r(d,n);break;case 3:break;default:return n.onError(GEt(67,d.loc)),d}break;case 2:n.pushStringPart(x7.escapeHtml(d.content));break;case 3:if(!s)n.pushStringPart(`<!--${d.content}-->`);break;case 5:n.pushStringPart(Fo.createCallExpression(n.helper(N3t),[d.content]));break;case 9:R2r(d,n,i,s);break;case 11:j2r(d,n,i);break;case 10:break;case 12:case 8:break;default:return n.onError(GEt(67,d.loc)),d}}if(A)n.pushStringPart("<!--]-->")}function PRe(e,n,A=!1,i=n.withSlotScopeId){let s=dxr(n,i);return aCe(e,s,A),Fo.createBlockStatement(s.body)}var fxr=(e,n,A)=>{let i=e.exp;function s(){let d=Fo.findProp(n,"value");if(d)A.onError(Fo.createDOMCompilerError(61,d.loc))}let u=(d)=>{d.forEach((f)=>{if(f.type===1)g(f);else if(f.type===11)u(f.children);else if(f.type===9)f.branches.forEach((B)=>u(B.children))})};function g(d){if(d.tag==="option"){if(d.props.findIndex((f)=>f.name==="selected")===-1){let f=pOA(d);d.ssrCodegenNode.elements.push(Fo.createConditionalExpression(Fo.createCallExpression(A.helper(J6n),[Fo.createConditionalExpression(Fo.createCallExpression("Array.isArray",[i]),Fo.createCallExpression(A.helper(R6n),[i,f]),Fo.createCallExpression(A.helper(S3t),[i,f]))]),Fo.createSimpleExpression(" selected",!0),Fo.createSimpleExpression("",!0),!1))}}else if(d.tag==="optgroup")u(d.children)}if(n.tagType===0){let d={props:[]};if(n.tag==="input"){let f=[Fo.createObjectProperty("value",i)],B=Fo.findProp(n,"type");if(B){let E=pOA(n);if(B.type===7)d.ssrTagParts=[Fo.createCallExpression(A.helper(yOA),[B.exp,i,E])];else if(B.value)switch(B.value.content){case"radio":d.props=[Fo.createObjectProperty("checked",Fo.createCallExpression(A.helper(S3t),[i,E]))];break;case"checkbox":let Q=Fo.findProp(n,"true-value");if(Q){let w=Q.type===6?JSON.stringify(Q.value.content):Q.exp;d.props=[Fo.createObjectProperty("checked",Fo.createCallExpression(A.helper(S3t),[i,w]))]}else d.props=[Fo.createObjectProperty("checked",Fo.createConditionalExpression(Fo.createCallExpression("Array.isArray",[i]),Fo.createCallExpression(A.helper(R6n),[i,E]),i))];break;case"file":A.onError(Fo.createDOMCompilerError(60,e.loc));break;default:s(),d.props=f;break}}else if(Fo.hasDynamicKeyVBind(n));else s(),d.props=f}else if(n.tag==="textarea")s(),n.children=[Fo.createInterpolation(i,i.loc)];else if(n.tag==="select")u(n.children);else A.onError(Fo.createDOMCompilerError(58,e.loc));return d}else return Fo.transformModel(e,n,A)};function pOA(e){let n=Fo.findProp(e,"value");return n?n.type===7?n.exp:Fo.createSimpleExpression(n.value.content,!0):Fo.createSimpleExpression("null",!1)}var hxr=(e,n,A)=>{if(!e.exp)A.onError(Fo.createDOMCompilerError(62));return{props:[Fo.createObjectProperty("style",Fo.createConditionalExpression(e.exp,Fo.createSimpleExpression("null",!1),Fo.createObjectExpression([Fo.createObjectProperty("display",Fo.createSimpleExpression("none",!0))]),!1))]}},H6n=(e)=>e.children.filter((n)=>!Fo.isCommentOrWhitespace(n)),T6n=(e)=>H6n(e).length===1,bxr=(e,n)=>{if(e.type===0)n.identifiers._attrs=1;if(e.type===1&&e.tagType===1&&(e.tag==="transition"||e.tag==="Transition"||e.tag==="KeepAlive"||e.tag==="keep-alive")){let i=H6n(n.root);if(i.length===1&&i[0]===e){if(T6n(e))K6n(e.children[0]);return}}let A=n.parent;if(!A||A.type!==0)return;if(e.type===10&&T6n(e)){let i=!1;for(let s of H6n(A))if(s.type===9||s.type===1&&Fo.findDir(s,"if")){if(i)return;i=!0}else if(!i||!(s.type===1&&Fo.findDir(s,/else/,!0)))return;K6n(e.children[0])}else if(T6n(A))K6n(e)};function K6n(e){if(e.type===1&&(e.tagType===0||e.tagType===1)&&!Fo.findDir(e,"for"))e.props.push({type:7,name:"bind",arg:void 0,exp:Fo.createSimpleExpression("_attrs",!1),modifiers:[],loc:Fo.locStub})}var Bxr=(e,n)=>{if(!n.ssrCssVars)return;if(e.type===0)n.identifiers._cssVars=1;let A=n.parent;if(!A||A.type!==0)return;if(e.type===10)for(let i of e.children)G3t(i);else G3t(e)};function G3t(e){if(e.type===1&&(e.tagType===0||e.tagType===1)&&!Fo.findDir(e,"for"))if(e.tag==="suspense"||e.tag==="Suspense")for(let n of e.children)if(n.type===1&&n.tagType===3)n.children.forEach(G3t);else G3t(n);else e.props.push({type:7,name:"bind",arg:void 0,exp:Fo.createSimpleExpression("_cssVars",!1),modifiers:[],loc:Fo.locStub})}function Cxr(e,n={}){n={...n,...Fo.parserOptions,ssr:!0,inSSR:!0,scopeId:n.mode==="function"?null:n.scopeId,prefixIdentifiers:!0,cacheHandlers:!1,hoistStatic:!1};let A=typeof e==="string"?Fo.baseParse(e,n):e;return GOA.set(A,n),Fo.transform(A,{...n,hoistStatic:!1,nodeTransforms:[Fo.transformVBindShorthand,K2r,Y2r,Fo.trackVForSlotScopes,Fo.transformExpression,H2r,bxr,Bxr,W2r,rxr,Fo.trackSlotScopes,Fo.transformStyle,...n.nodeTransforms||[]],directiveTransforms:{bind:Fo.transformBind,on:Fo.transformOn,model:fxr,show:hxr,cloak:Fo.noopDirectiveTransform,once:Fo.noopDirectiveTransform,memo:Fo.noopDirectiveTransform,...n.directiveTransforms||{}}}),mxr(A,n),Fo.generate(A,n)}LOA.compile=Cxr});var tGn=Ar((izA)=>{Object.defineProperty(izA,"__esModule",{value:!0});var z2=nh(),Tp=Fqe(),Exr=qOA();function yxr(e){var n=Object.create(null);if(e)for(var A in e)n[A]=e[A];return n.default=e,Object.freeze(n)}var Qxr=yxr(z2),_xr=Tp.makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");function O6n(e,n){let A="";for(let i in e){if(_xr(i)||Tp.isOn(i)||n==="textarea"&&i==="value"||i.startsWith("."))continue;let s=e[i];if(i.startsWith("^"))i=i.slice(1);if(i==="class")A+=` class="${Z6n(s)}"`;else if(i==="style")A+=` style="${V6n(s)}"`;else if(i==="className"){if(s!=null)A+=` class="${Tp.escapeHtml(String(s))}"`}else A+=z6n(i,s,n)}return A}function z6n(e,n,A){if(!Tp.isRenderableAttrValue(n))return"";let i=A&&(A.indexOf("-")>0||Tp.isSVGTag(A))?e:Tp.propsToAttrMap[e]||e.toLowerCase();if(Tp.isBooleanAttr(i))return Tp.includeBooleanAttr(n)?` ${i}`:"";else if(Tp.isSSRSafeAttrName(i))return n===""?` ${i}`:` ${i}="${Tp.escapeHtml(n)}"`;else return console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${i}`),""}function W6n(e,n){if(!Tp.isRenderableAttrValue(n))return"";return` ${e}="${Tp.escapeHtml(n)}"`}function Z6n(e){return Tp.escapeHtml(Tp.normalizeClass(e))}function V6n(e){if(!e)return"";if(Tp.isString(e))return Tp.escapeHtml(e);let n=Tp.normalizeStyle(wxr(e));return Tp.escapeHtml(Tp.stringifyStyle(n))}function wxr(e){if(!Tp.isArray(e)&&Tp.isObject(e)){let n={};for(let A in e)if(A.startsWith(":--"))n[A.slice(1)]=Tp.normalizeCssVarValue(e[A]);else n[A]=e[A];return n}return e}function YOA(e,n=null,A=null,i=null,s){return q3t(z2.createVNode(e,n,A),i,s)}var{ensureValidVNode:kxr}=z2.ssrUtils;function jOA(e,n,A,i,s,u,g){s("<!--[-->"),X6n(e,n,A,i,s,u,g),s("<!--]-->")}function X6n(e,n,A,i,s,u,g,d){let f=e[n];if(f){let B=[],Q=f(A,(w)=>{B.push(w)},u,g?" "+g:"");if(Tp.isArray(Q)){let w=kxr(Q);if(w)U3t(s,w,u,g);else if(i)i();else if(d)s("<!---->")}else{let w=!0;if(d)w=!1;else for(let S=0;S<B.length;S++)if(!Fxr(B[S])){w=!1;break}if(w){if(i)i()}else{let S=0,G=B.length;if(d&&B[0]==="<!--[-->"&&B[G-1]==="<!--]-->")S++,G--;if(S<G)for(let q=S;q<G;q++)s(B[q]);else if(d)s("<!---->")}}}else if(i)i();else if(d)s("<!---->")}var Dxr=/^<!--[\s\S]*-->$/,xxr=/<!--[^]*?-->/gm;function Fxr(e){if(typeof e!=="string"||!Dxr.test(e))return!1;if(e.length<=8)return!0;return!e.replace(xxr,"").trim()}function eGn(e,n,A,i,s){e("<!--teleport start-->");let u=s.appContext.provides[z2.ssrContextKey],g=u.__teleportBuffers||(u.__teleportBuffers={}),d=g[A]||(g[A]=[]),f=d.length,B;if(i)n(e),B="<!--teleport start anchor--><!--teleport anchor-->";else{let{getBuffer:E,push:Q}=ZOA();Q("<!--teleport start anchor-->"),n(Q),Q("<!--teleport anchor-->"),B=E()}if(d.splice(f,0,B),Tp.isPromise(B)||Tp.isArray(B)&&B.hasAsync)d.hasAsync=!0;e("<!--teleport end-->")}function HOA(e){return Tp.escapeHtml(Tp.toDisplayString(e))}function POA(e,n){if(Tp.isArray(e)||Tp.isString(e))for(let A=0,i=e.length;A<i;A++)n(e[A],A);else if(typeof e==="number")for(let A=0;A<e;A++)n(A+1,A);else if(Tp.isObject(e))if(e[Symbol.iterator]){let A=0;for(let i of e)n(i,A++)}else{let A=Object.keys(e);for(let i=0,s=A.length;i<s;i++){let u=A[i];n(e[u],u,i)}}}function JOA(e,{default:n}){if(n)n();else e("<!---->")}function $OA(e,n,A,i,s={}){if(typeof n!=="function"&&n.getSSRProps)return n.getSSRProps({dir:n,instance:z2.ssrUtils.getComponentPublicInstance(e.$),value:A,oldValue:void 0,arg:i,modifiers:s},null)||{};return{}}var OOA=Tp.looseEqual;function L3t(e,n){return Tp.looseIndexOf(e,n)>-1}function zOA(e,n,A){switch(e){case"radio":return Tp.looseEqual(n,A)?" checked":"";case"checkbox":return(Tp.isArray(n)?L3t(n,A):n)?" checked":"";default:return W6n("value",n)}}function WOA(e={},n){let{type:A,value:i}=e;switch(A){case"radio":return Tp.looseEqual(n,i)?{checked:!0}:null;case"checkbox":return(Tp.isArray(n)?L3t(n,i):n)?{checked:!0}:null;default:return{value:n}}}var vxr=Object.freeze({__proto__:null,ssrGetDirectiveProps:$OA,ssrGetDynamicModelProps:WOA,ssrIncludeBooleanAttr:Tp.includeBooleanAttr,ssrInterpolate:HOA,ssrLooseContain:L3t,ssrLooseEqual:OOA,ssrRenderAttr:W6n,ssrRenderAttrs:O6n,ssrRenderClass:Z6n,ssrRenderComponent:YOA,ssrRenderDynamicAttr:z6n,ssrRenderDynamicModel:zOA,ssrRenderList:POA,ssrRenderSlot:jOA,ssrRenderSlotInner:X6n,ssrRenderStyle:V6n,ssrRenderSuspense:JOA,ssrRenderTeleport:eGn,ssrRenderVNode:JRe}),UOA=Object.create(null);function Sxr(e,n){let A=n.type,{isCustomElement:i,compilerOptions:s}=n.appContext.config,{delimiters:u,compilerOptions:g}=A,d=Tp.extend(Tp.extend({isCustomElement:i,delimiters:u},s),g);d.isCustomElement=d.isCustomElement||Tp.NO,d.isNativeTag=d.isNativeTag||Tp.NO;let f=JSON.stringify({template:e,compilerOptions:d},(S,G)=>{return Tp.isFunction(G)?G.toString():G}),B=UOA[f];if(B)return B;d.onError=(S)=>{throw S};let{code:E}=Exr.compile(e,d),Q={vue:Qxr,"vue/server-renderer":vxr},w=(S)=>Q[S];return UOA[f]=Function("require",E)(w)}var{createComponentInstance:Nxr,setCurrentRenderingInstance:TOA,setupComponent:Gxr,renderComponentRoot:KOA,normalizeVNode:Mxr,pushWarningContext:G$o,popWarningContext:M$o}=z2.ssrUtils;function ZOA(){let e=!1,n=[];return{getBuffer(){return n},push(A){let i=Tp.isString(A);if(e&&i){n[n.length-1]+=A;return}if(n.push(A),e=i,Tp.isPromise(A)||Tp.isArray(A)&&A.hasAsync)n.hasAsync=!0}}}function q3t(e,n=null,A){let i=e.component=Nxr(e,n,null),s=Gxr(i,!0),u=Tp.isPromise(s),g=i.sp;if(u||g)return Promise.resolve(s).then(()=>{if(u)g=i.sp;if(g)return Promise.all(g.map((f)=>f.call(i.proxy)))}).catch(Tp.NOOP).then(()=>ROA(i,A));else return ROA(i,A)}function ROA(e,n){let A=e.type,{getBuffer:i,push:s}=ZOA();if(Tp.isFunction(A)){let u=KOA(e);if(!A.props){for(let g in e.attrs)if(g.startsWith("data-v-"))(u.props||(u.props={}))[g]=""}JRe(s,e.subTree=u,e,n)}else{if((!e.render||e.render===Tp.NOOP)&&!e.ssrRender&&!A.ssrRender&&Tp.isString(A.template))A.ssrRender=Sxr(A.template,e);let u=e.ssrRender||A.ssrRender;if(u){let g=e.inheritAttrs!==!1?e.attrs:void 0,d=!1,f=e;while(!0){let E=f.vnode.scopeId;if(E){if(!d)g={...g},d=!0;g[E]=""}let Q=f.parent;if(Q&&Q.subTree&&Q.subTree===f.vnode)f=Q;else break}if(n){if(!d)g={...g};let E=n.trim().split(" ");for(let Q=0;Q<E.length;Q++)g[E[Q]]=""}let B=TOA(e);try{u(e.proxy,s,e,g,e.props,e.setupState,e.data,e.ctx)}finally{TOA(B)}}else if(e.render&&e.render!==Tp.NOOP)JRe(s,e.subTree=KOA(e),e,n);else{let g=A.name||A.__file||"<Anonymous>";z2.warn(`Component ${g} is missing template or render function.`),s("<!---->")}}return i()}function JRe(e,n,A,i){let{type:s,shapeFlag:u,children:g,dirs:d,props:f}=n;if(d)n.props=qxr(n,f,d);switch(s){case z2.Text:e(Tp.escapeHtml(g));break;case z2.Comment:e(g?`<!--${Tp.escapeHtmlComment(g)}-->`:"<!---->");break;case z2.Static:e(g);break;case z2.Fragment:if(n.slotScopeIds)i=(i?i+" ":"")+n.slotScopeIds.join(" ");e("<!--[-->"),U3t(e,g,A,i),e("<!--]-->");break;default:if(u&1)Lxr(e,n,A,i);else if(u&6)e(q3t(n,A,i));else if(u&64)Uxr(e,n,A,i);else if(u&128)JRe(e,n.ssContent,A,i);else z2.warn("[@vue/server-renderer] Invalid VNode type:",s,`(${typeof s})`)}}function U3t(e,n,A,i){for(let s=0;s<n.length;s++)JRe(e,Mxr(n[s]),A,i)}function Lxr(e,n,A,i){let s=n.type,{props:u,children:g,shapeFlag:d,scopeId:f}=n,B=`<${s}`;if(u)B+=O6n(u,s);let E=[],Q=(G)=>{if(G&&(!u||!Tp.hasOwn(u,G))&&!E.includes(G))B+=` ${G}`,E.push(G)};if(f)Q(f);let w=A,S=n;while(w&&S===w.subTree){if(S=w.vnode,S.scopeId)Q(S.scopeId);w=w.parent}if(i){let G=i.trim().split(" ");for(let q=0;q<G.length;q++)Q(G[q])}if(e(B+">"),!Tp.isVoidTag(s)){let G=!1;if(u){if(u.innerHTML)G=!0,e(u.innerHTML);else if(u.textContent)G=!0,e(Tp.escapeHtml(u.textContent));else if(s==="textarea"&&u.value)G=!0,e(Tp.escapeHtml(u.value))}if(!G){if(d&8)e(Tp.escapeHtml(g));else if(d&16)U3t(e,g,A,i)}e(`</${s}>`)}}function qxr(e,n,A){let i=[];for(let s=0;s<A.length;s++){let u=A[s],{dir:{getSSRProps:g}}=u;if(g){let d=g(u,e);if(d)i.push(d)}}return z2.mergeProps(n||{},...i)}function Uxr(e,n,A,i){let s=n.props&&n.props.to,u=n.props&&n.props.disabled;if(!s){if(!u)z2.warn("[@vue/server-renderer] Teleport is missing target prop.");return[]}if(!Tp.isString(s))return z2.warn("[@vue/server-renderer] Teleport target must be a query selector string."),[];eGn(e,(g)=>{U3t(g,n.children,A,i)},s,u||u==="",A)}var{isVNode:Txr}=z2.ssrUtils;function M3t(e,n,A){if(!e.hasAsync)return n+XOA(e);let i=n;for(let s=A;s<e.length;s+=1){let u=e[s];if(Tp.isString(u)){i+=u;continue}if(Tp.isPromise(u))return u.then((d)=>{return e[s]=d,M3t(e,i,s)});let g=M3t(u,i,0);if(Tp.isPromise(g))return g.then((d)=>{return e[s]=d,M3t(e,"",s)});i=g}return i}function VOA(e){return M3t(e,"",0)}function XOA(e){let n="";for(let A=0;A<e.length;A++){let i=e[A];if(Tp.isString(i))n+=i;else n+=XOA(i)}return n}async function ezA(e,n={}){if(Txr(e))return ezA(z2.createApp({render:()=>e}),n);let A=z2.createVNode(e._component,e._props);A.appContext=e._context,e.provide(z2.ssrContextKey,n);let i=await q3t(A),s=await VOA(i);if(await tzA(n),n.__watcherHandles)for(let u of n.__watcherHandles)u();return s}async function tzA(e){if(e.__teleportBuffers){e.teleports=e.teleports||{};for(let n in e.__teleportBuffers)e.teleports[n]=await VOA(e.__teleportBuffers[n])}}var{isVNode:Kxr}=z2.ssrUtils;async function nzA(e,n){if(e.hasAsync)for(let A=0;A<e.length;A++){let i=e[A];if(Tp.isPromise(i))i=await i;if(Tp.isString(i))n.push(i);else await nzA(i,n)}else AzA(e,n)}function AzA(e,n){for(let A=0;A<e.length;A++){let i=e[A];if(Tp.isString(i))n.push(i);else AzA(i,n)}}function $Re(e,n,A){if(Kxr(e))return $Re(z2.createApp({render:()=>e}),n,A);let i=z2.createVNode(e._component,e._props);return i.appContext=e._context,e.provide(z2.ssrContextKey,n),Promise.resolve(q3t(i)).then((s)=>nzA(s,A)).then(()=>tzA(n)).then(()=>{if(n.__watcherHandles)for(let s of n.__watcherHandles)s()}).then(()=>A.push(null)).catch((s)=>{A.destroy(s)}),A}function Rxr(e,n={}){return console.warn("[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead."),azA(e,n)}function azA(e,n={}){let A=new(pE("stream")).Readable({read(){}});if(!A)throw Error("ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.");return $Re(e,n,A)}function Yxr(e,n={},A){$Re(e,n,{push(i){if(i!=null)A.write(i);else A.end()},destroy(i){A.destroy(i)}})}function jxr(e,n={}){if(typeof ReadableStream!=="function")throw Error("ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.");let A=new TextEncoder,i=!1;return new ReadableStream({start(s){$Re(e,n,{push(u){if(i)return;if(u!=null)s.enqueue(A.encode(u));else s.close()},destroy(u){s.error(u)}})},cancel(){i=!0}})}function Hxr(e,n={},A){let i=A.getWriter(),s=new TextEncoder,u=!1;try{u=Tp.isPromise(i.ready)}catch(g){}$Re(e,n,{async push(g){if(u)await i.ready;if(g!=null)return i.write(s.encode(g));else return i.close()},destroy(g){console.log(g),i.close()}})}z2.initDirectivesForSSR();izA.ssrIncludeBooleanAttr=Tp.includeBooleanAttr;izA.pipeToNodeWritable=Yxr;izA.pipeToWebWritable=Hxr;izA.renderToNodeStream=azA;izA.renderToSimpleStream=$Re;izA.renderToStream=Rxr;izA.renderToString=ezA;izA.renderToWebStream=jxr;izA.ssrGetDirectiveProps=$OA;izA.ssrGetDynamicModelProps=WOA;izA.ssrInterpolate=HOA;izA.ssrLooseContain=L3t;izA.ssrLooseEqual=OOA;izA.ssrRenderAttr=W6n;izA.ssrRenderAttrs=O6n;izA.ssrRenderClass=Z6n;izA.ssrRenderComponent=YOA;izA.ssrRenderDynamicAttr=z6n;izA.ssrRenderDynamicModel=zOA;izA.ssrRenderList=POA;izA.ssrRenderSlot=jOA;izA.ssrRenderSlotInner=X6n;izA.ssrRenderStyle=V6n;izA.ssrRenderSuspense=JOA;izA.ssrRenderTeleport=eGn;izA.ssrRenderVNode=JRe});var vzA=Ar((FzA)=>{Object.defineProperty(FzA,"__esModule",{value:!0});var Hm=Fqe(),X3;class oGn{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&X3)if(X3.active)this.parent=X3,this.index=(X3.scopes||(X3.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}}run(e){if(this._active){let n=X3;try{return X3=this,e()}finally{X3=n}}}on(){if(++this._on===1)this.prevScope=X3,X3=this}off(){if(this._on>0&&--this._on===0){if(X3===this)X3=this.prevScope;else{let e=X3;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let n,A;for(n=0,A=this.effects.length;n<A;n++)this.effects[n].stop();this.effects.length=0;for(n=0,A=this.cleanups.length;n<A;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,A=this.scopes.length;n<A;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let i=this.parent.scopes.pop();if(i&&i!==this)this.parent.scopes[this.index]=i,i.index=this.index}this.parent=void 0}}}function hFr(e){return new oGn(e)}function szA(){return X3}function bFr(e,n=!1){if(X3)X3.cleanups.push(e)}var G0,BFr={ACTIVE:1,"1":"ACTIVE",RUNNING:2,"2":"RUNNING",TRACKING:4,"4":"TRACKING",NOTIFIED:8,"8":"NOTIFIED",DIRTY:16,"16":"DIRTY",ALLOW_RECURSE:32,"32":"ALLOW_RECURSE",PAUSED:64,"64":"PAUSED",EVALUATED:128,"128":"EVALUATED"},nGn=new WeakSet;class ORe{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,X3)if(X3.active)X3.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,nGn.has(this))nGn.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))uzA(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rzA(this),lzA(this);let e=G0,n=J$;G0=this,J$=!0;try{return this.fn()}finally{gzA(this),G0=e,J$=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)uGn(e);this.deps=this.depsTail=void 0,rzA(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)nGn.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(iGn(this))this.run()}get dirty(){return iGn(this)}}var czA=0,LEt,qEt;function uzA(e,n=!1){if(e.flags|=8,n){e.next=qEt,qEt=e;return}e.next=LEt,LEt=e}function sGn(){czA++}function cGn(){if(--czA>0)return;if(qEt){let n=qEt;qEt=void 0;while(n){let A=n.next;n.next=void 0,n.flags&=-9,n=A}}let e;while(LEt){let n=LEt;LEt=void 0;while(n){let A=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(i){if(!e)e=i}n=A}}if(e)throw e}function lzA(e){for(let n=e.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function gzA(e){let n,A=e.depsTail,i=A;while(i){let s=i.prevDep;if(i.version===-1){if(i===A)A=s;uGn(i),CFr(i)}else n=i;i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}e.deps=n,e.depsTail=A}function iGn(e){for(let n=e.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(pzA(n.dep.computed)||n.dep.version!==n.version))return!0;if(e._dirty)return!0;return!1}function pzA(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===UEt)return;if(e.globalVersion=UEt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!iGn(e)))return;e.flags|=2;let n=e.dep,A=G0,i=J$;G0=e,J$=!0;try{lzA(e);let s=e.fn(e._value);if(n.version===0||Hm.hasChanged(s,e._value))e.flags|=128,e._value=s,n.version++}catch(s){throw n.version++,s}finally{G0=A,J$=i,gzA(e),e.flags&=-3}}function uGn(e,n=!1){let{dep:A,prevSub:i,nextSub:s}=e;if(i)i.nextSub=s,e.prevSub=void 0;if(s)s.prevSub=i,e.nextSub=void 0;if(A.subs===e){if(A.subs=i,!i&&A.computed){A.computed.flags&=-5;for(let u=A.computed.deps;u;u=u.nextDep)uGn(u,!0)}}if(!n&&!--A.sc&&A.map)A.map.delete(A.key)}function CFr(e){let{prevDep:n,nextDep:A}=e;if(n)n.nextDep=A,e.prevDep=void 0;if(A)A.prevDep=n,e.nextDep=void 0}function IFr(e,n){if(e.effect instanceof ORe)e=e.effect.fn;let A=new ORe(e);if(n)Hm.extend(A,n);try{A.run()}catch(s){throw A.stop(),s}let i=A.run.bind(A);return i.effect=A,i}function EFr(e){e.effect.stop()}var J$=!0,lGn=[];function gGn(){lGn.push(J$),J$=!1}function yFr(){lGn.push(J$),J$=!0}function pGn(){let e=lGn.pop();J$=e===void 0?!0:e}function QFr(e,n=!1){if(G0 instanceof ORe)G0.cleanup=e}function rzA(e){let{cleanup:n}=e;if(e.cleanup=void 0,n){let A=G0;G0=void 0;try{n()}finally{G0=A}}}var UEt=0;class mzA{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class TEt{constructor(e){this.computed=e,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(e){if(!G0||!J$||G0===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==G0){if(n=this.activeLink=new mzA(G0,this),!G0.deps)G0.deps=G0.depsTail=n;else n.prevDep=G0.depsTail,G0.depsTail.nextDep=n,G0.depsTail=n;dzA(n)}else if(n.version===-1){if(n.version=this.version,n.nextDep){let A=n.nextDep;if(A.prevDep=n.prevDep,n.prevDep)n.prevDep.nextDep=A;if(n.prevDep=G0.depsTail,n.nextDep=void 0,G0.depsTail.nextDep=n,G0.depsTail=n,G0.deps===n)G0.deps=A}}return n}trigger(e){this.version++,UEt++,this.notify(e)}notify(e){sGn();try{for(let n=this.subs;n;n=n.prevSub)if(n.sub.notify())n.sub.dep.notify()}finally{cGn()}}}function dzA(e){if(e.dep.sc++,e.sub.flags&4){let n=e.dep.computed;if(n&&!e.dep.subs){n.flags|=20;for(let i=n.deps;i;i=i.nextDep)dzA(i)}let A=e.dep.subs;if(A!==e){if(e.prevSub=A,A)A.nextSub=e}e.dep.subs=e}}var Y3t=new WeakMap,kye=Symbol(""),j3t=Symbol(""),zRe=Symbol("");function F7(e,n,A){if(J$&&G0){let i=Y3t.get(e);if(!i)Y3t.set(e,i=new Map);let s=i.get(A);if(!s)i.set(A,s=new TEt),s.map=i,s.key=A;s.track()}}function rCe(e,n,A,i,s,u){let g=Y3t.get(e);if(!g){UEt++;return}let d=(f)=>{if(f)f.trigger()};if(sGn(),n==="clear")g.forEach(d);else{let f=Hm.isArray(e),B=f&&Hm.isIntegerKey(A);if(f&&A==="length"){let E=Number(i);g.forEach((Q,w)=>{if(w==="length"||w===zRe||!Hm.isSymbol(w)&&w>=E)d(Q)})}else{if(A!==void 0||g.has(void 0))d(g.get(A));if(B)d(g.get(zRe));switch(n){case"add":if(!f){if(d(g.get(kye)),Hm.isMap(e))d(g.get(j3t))}else if(B)d(g.get("length"));break;case"delete":if(!f){if(d(g.get(kye)),Hm.isMap(e))d(g.get(j3t))}break;case"set":if(Hm.isMap(e))d(g.get(kye));break}}}cGn()}function _Fr(e,n){let A=Y3t.get(e);return A&&A.get(n)}function Yqe(e){let n=p0(e);if(n===e)return n;return F7(n,"iterate",zRe),$$(e)?n:n.map(Tie)}function J3t(e){return F7(e=p0(e),"iterate",zRe),e}function Uie(e,n){if(sCe(e))return jqe(e)?WRe(Tie(n)):WRe(n);return Tie(n)}var wFr={__proto__:null,[Symbol.iterator](){return AGn(this,Symbol.iterator,(e)=>Uie(this,e))},concat(...e){return Yqe(this).concat(...e.map((n)=>Hm.isArray(n)?Yqe(n):n))},entries(){return AGn(this,"entries",(e)=>{return e[1]=Uie(this,e[1]),e})},every(e,n){return iCe(this,"every",e,n,void 0,arguments)},filter(e,n){return iCe(this,"filter",e,n,(A)=>A.map((i)=>Uie(this,i)),arguments)},find(e,n){return iCe(this,"find",e,n,(A)=>Uie(this,A),arguments)},findIndex(e,n){return iCe(this,"findIndex",e,n,void 0,arguments)},findLast(e,n){return iCe(this,"findLast",e,n,(A)=>Uie(this,A),arguments)},findLastIndex(e,n){return iCe(this,"findLastIndex",e,n,void 0,arguments)},forEach(e,n){return iCe(this,"forEach",e,n,void 0,arguments)},includes(...e){return aGn(this,"includes",e)},indexOf(...e){return aGn(this,"indexOf",e)},join(e){return Yqe(this).join(e)},lastIndexOf(...e){return aGn(this,"lastIndexOf",e)},map(e,n){return iCe(this,"map",e,n,void 0,arguments)},pop(){return MEt(this,"pop")},push(...e){return MEt(this,"push",e)},reduce(e,...n){return ozA(this,"reduce",e,n)},reduceRight(e,...n){return ozA(this,"reduceRight",e,n)},shift(){return MEt(this,"shift")},some(e,n){return iCe(this,"some",e,n,void 0,arguments)},splice(...e){return MEt(this,"splice",e)},toReversed(){return Yqe(this).toReversed()},toSorted(e){return Yqe(this).toSorted(e)},toSpliced(...e){return Yqe(this).toSpliced(...e)},unshift(...e){return MEt(this,"unshift",e)},values(){return AGn(this,"values",(e)=>Uie(this,e))}};function AGn(e,n,A){let i=J3t(e),s=i[n]();if(i!==e&&!$$(e))s._next=s.next,s.next=()=>{let u=s._next();if(!u.done)u.value=A(u.value);return u};return s}var kFr=Array.prototype;function iCe(e,n,A,i,s,u){let g=J3t(e),d=g!==e&&!$$(e),f=g[n];if(f!==kFr[n]){let Q=f.apply(e,u);return d?Tie(Q):Q}let B=A;if(g!==e){if(d)B=function(Q,w){return A.call(this,Uie(e,Q),w,e)};else if(A.length>2)B=function(Q,w){return A.call(this,Q,w,e)}}let E=f.call(g,B,i);return d&&s?s(E):E}function ozA(e,n,A,i){let s=J3t(e),u=s!==e&&!$$(e),g=A,d=!1;if(s!==e){if(u)d=i.length===0,g=function(B,E,Q){if(d)d=!1,B=Uie(e,B);return A.call(this,B,Uie(e,E),Q,e)};else if(A.length>3)g=function(B,E,Q){return A.call(this,B,E,Q,e)}}let f=s[n](g,...i);return d?Uie(e,f):f}function aGn(e,n,A){let i=p0(e);F7(i,"iterate",zRe);let s=i[n](...A);if((s===-1||s===!1)&&bGn(A[0]))return A[0]=p0(A[0]),i[n](...A);return s}function MEt(e,n,A=[]){gGn(),sGn();let i=p0(e)[n].apply(e,A);return cGn(),pGn(),i}var DFr=Hm.makeMap("__proto__,__v_isRef,__isVue"),fzA=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Hm.isSymbol));function xFr(e){if(!Hm.isSymbol(e))e=String(e);let n=p0(this);return F7(n,"has",e),n.hasOwnProperty(e)}class mGn{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,A){if(n==="__v_skip")return e.__v_skip;let i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;else if(n==="__v_isReadonly")return i;else if(n==="__v_isShallow")return s;else if(n==="__v_raw"){if(A===(i?s?CzA:BzA:s?bzA:hzA).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(A))return e;return}let u=Hm.isArray(e);if(!i){let d;if(u&&(d=wFr[n]))return d;if(n==="hasOwnProperty")return xFr}let g=Reflect.get(e,n,zL(e)?e:A);if(Hm.isSymbol(n)?fzA.has(n):DFr(n))return g;if(!i)F7(e,"get",n);if(s)return g;if(zL(g)){let d=u&&Hm.isIntegerKey(n)?g:g.value;return i&&Hm.isObject(d)?H3t(d):d}if(Hm.isObject(g))return i?H3t(g):hGn(g);return g}}class dGn extends mGn{constructor(e=!1){super(!1,e)}set(e,n,A,i){let s=e[n],u=Hm.isArray(e)&&Hm.isIntegerKey(n);if(!this._isShallow){let f=sCe(s);if(!$$(A)&&!sCe(A))s=p0(s),A=p0(A);if(!u&&zL(s)&&!zL(A))if(f)return!0;else return s.value=A,!0}let g=u?Number(n)<e.length:Hm.hasOwn(e,n),d=Reflect.set(e,n,A,zL(e)?e:i);if(e===p0(i)&&d){if(!g)rCe(e,"add",n,A);else if(Hm.hasChanged(A,s))rCe(e,"set",n,A)}return d}deleteProperty(e,n){let A=Hm.hasOwn(e,n);e[n];let i=Reflect.deleteProperty(e,n);if(i&&A)rCe(e,"delete",n,void 0);return i}has(e,n){let A=Reflect.has(e,n);if(!Hm.isSymbol(n)||!fzA.has(n))F7(e,"has",n);return A}ownKeys(e){return F7(e,"iterate",Hm.isArray(e)?"length":kye),Reflect.ownKeys(e)}}class fGn extends mGn{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}var FFr=new dGn,vFr=new fGn,SFr=new dGn(!0),NFr=new fGn(!0),rGn=(e)=>e,T3t=(e)=>Reflect.getPrototypeOf(e);function GFr(e,n,A){return function(...i){let s=this.__v_raw,u=p0(s),g=Hm.isMap(u),d=e==="entries"||e===Symbol.iterator&&g,f=e==="keys"&&g,B=s[e](...i),E=A?rGn:n?WRe:Tie;return!n&&F7(u,"iterate",f?j3t:kye),Hm.extend(Object.create(B),{next(){let{value:Q,done:w}=B.next();return w?{value:Q,done:w}:{value:d?[E(Q[0]),E(Q[1])]:E(Q),done:w}}})}}function K3t(e){return function(...n){return e==="delete"?!1:e==="clear"?void 0:this}}function MFr(e,n){let A={get(s){let u=this.__v_raw,g=p0(u),d=p0(s);if(!e){if(Hm.hasChanged(s,d))F7(g,"get",s);F7(g,"get",d)}let{has:f}=T3t(g),B=n?rGn:e?WRe:Tie;if(f.call(g,s))return B(u.get(s));else if(f.call(g,d))return B(u.get(d));else if(u!==g)u.get(s)},get size(){let s=this.__v_raw;return!e&&F7(p0(s),"iterate",kye),s.size},has(s){let u=this.__v_raw,g=p0(u),d=p0(s);if(!e){if(Hm.hasChanged(s,d))F7(g,"has",s);F7(g,"has",d)}return s===d?u.has(s):u.has(s)||u.has(d)},forEach(s,u){let g=this,d=g.__v_raw,f=p0(d),B=n?rGn:e?WRe:Tie;return!e&&F7(f,"iterate",kye),d.forEach((E,Q)=>{return s.call(u,B(E),B(Q),g)})}};return Hm.extend(A,e?{add:K3t("add"),set:K3t("set"),delete:K3t("delete"),clear:K3t("clear")}:{add(s){let u=p0(this),g=T3t(u),d=p0(s),f=!n&&!$$(s)&&!sCe(s)?d:s;if(!(g.has.call(u,f)||Hm.hasChanged(s,f)&&g.has.call(u,s)||Hm.hasChanged(d,f)&&g.has.call(u,d)))u.add(f),rCe(u,"add",f,f);return this},set(s,u){if(!n&&!$$(u)&&!sCe(u))u=p0(u);let g=p0(this),{has:d,get:f}=T3t(g),B=d.call(g,s);if(!B)s=p0(s),B=d.call(g,s);let E=f.call(g,s);if(g.set(s,u),!B)rCe(g,"add",s,u);else if(Hm.hasChanged(u,E))rCe(g,"set",s,u);return this},delete(s){let u=p0(this),{has:g,get:d}=T3t(u),f=g.call(u,s);if(!f)s=p0(s),f=g.call(u,s);d&&d.call(u,s);let B=u.delete(s);if(f)rCe(u,"delete",s,void 0);return B},clear(){let s=p0(this),u=s.size!==0,g=s.clear();if(u)rCe(s,"clear",void 0,void 0);return g}}),["keys","values","entries",Symbol.iterator].forEach((s)=>{A[s]=GFr(s,e,n)}),A}function $3t(e,n){let A=MFr(e,n);return(i,s,u)=>{if(s==="__v_isReactive")return!e;else if(s==="__v_isReadonly")return e;else if(s==="__v_raw")return i;return Reflect.get(Hm.hasOwn(A,s)&&s in i?A:i,s,u)}}var LFr={get:$3t(!1,!1)},qFr={get:$3t(!1,!0)},UFr={get:$3t(!0,!1)},TFr={get:$3t(!0,!0)},hzA=new WeakMap,bzA=new WeakMap,BzA=new WeakMap,CzA=new WeakMap;function KFr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function hGn(e){if(sCe(e))return e;return O3t(e,!1,FFr,LFr,hzA)}function RFr(e){return O3t(e,!1,SFr,qFr,bzA)}function H3t(e){return O3t(e,!0,vFr,UFr,BzA)}function YFr(e){return O3t(e,!0,NFr,TFr,CzA)}function O3t(e,n,A,i,s){if(!Hm.isObject(e))return e;if(e.__v_raw&&!(n&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let u=s.get(e);if(u)return u;let g=KFr(Hm.toRawType(e));if(g===0)return e;let d=new Proxy(e,g===2?i:A);return s.set(e,d),d}function jqe(e){if(sCe(e))return jqe(e.__v_raw);return!!(e&&e.__v_isReactive)}function sCe(e){return!!(e&&e.__v_isReadonly)}function $$(e){return!!(e&&e.__v_isShallow)}function bGn(e){return e?!!e.__v_raw:!1}function p0(e){let n=e&&e.__v_raw;return n?p0(n):e}function jFr(e){if(!Hm.hasOwn(e,"__v_skip")&&Object.isExtensible(e))Hm.def(e,"__v_skip",!0);return e}var Tie=(e)=>Hm.isObject(e)?hGn(e):e,WRe=(e)=>Hm.isObject(e)?H3t(e):e;function zL(e){return e?e.__v_isRef===!0:!1}function IzA(e){return EzA(e,!1)}function HFr(e){return EzA(e,!0)}function EzA(e,n){if(zL(e))return e;return new yzA(e,n)}class yzA{constructor(e,n){this.dep=new TEt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:p0(e),this._value=n?e:Tie(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){let n=this._rawValue,A=this.__v_isShallow||$$(e)||sCe(e);if(e=A?e:p0(e),Hm.hasChanged(e,n))this._rawValue=e,this._value=A?e:Tie(e),this.dep.trigger()}}function PFr(e){if(e.dep)e.dep.trigger()}function z3t(e){return zL(e)?e.value:e}function JFr(e){return Hm.isFunction(e)?e():z3t(e)}var $Fr={get:(e,n,A)=>n==="__v_raw"?e:z3t(Reflect.get(e,n,A)),set:(e,n,A,i)=>{let s=e[n];if(zL(s)&&!zL(A))return s.value=A,!0;else return Reflect.set(e,n,A,i)}};function OFr(e){return jqe(e)?e:new Proxy(e,$Fr)}class QzA{constructor(e){this.__v_isRef=!0,this._value=void 0;let n=this.dep=new TEt,{get:A,set:i}=e(n.track.bind(n),n.trigger.bind(n));this._get=A,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function zFr(e){return new QzA(e)}function WFr(e){let n=Hm.isArray(e)?Array(e.length):{};for(let A in e)n[A]=kzA(e,A);return n}class _zA{constructor(e,n,A){this._object=e,this._defaultValue=A,this.__v_isRef=!0,this._value=void 0,this._key=Hm.isSymbol(n)?n:String(n),this._raw=p0(e);let i=!0,s=e;if(!Hm.isArray(e)||Hm.isSymbol(this._key)||!Hm.isIntegerKey(this._key))do i=!bGn(s)||$$(s);while(i&&(s=s.__v_raw));this._shallow=i}get value(){let e=this._object[this._key];if(this._shallow)e=z3t(e);return this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&zL(this._raw[this._key])){let n=this._object[this._key];if(zL(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return _Fr(this._raw,this._key)}}class wzA{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function ZFr(e,n,A){if(zL(e))return e;else if(Hm.isFunction(e))return new wzA(e);else if(Hm.isObject(e)&&arguments.length>1)return kzA(e,n,A);else return IzA(e)}function kzA(e,n,A){return new _zA(e,n,A)}class DzA{constructor(e,n,A){this.fn=e,this.setter=n,this._value=void 0,this.dep=new TEt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=UEt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=A}notify(){if(this.flags|=16,!(this.flags&8)&&G0!==this)return uzA(this,!0),!0}get value(){let e=this.dep.track();if(pzA(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function VFr(e,n,A=!1){let i,s;if(Hm.isFunction(e))i=e;else i=e.get,s=e.set;return new DzA(i,s,A)}var XFr={GET:"get",HAS:"has",ITERATE:"iterate"},evr={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tvr={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw",IS_REF:"__v_isRef"},nvr={WATCH_GETTER:2,"2":"WATCH_GETTER",WATCH_CALLBACK:3,"3":"WATCH_CALLBACK",WATCH_CLEANUP:4,"4":"WATCH_CLEANUP"},R3t={},P3t=new WeakMap,wye=void 0;function Avr(){return wye}function xzA(e,n=!1,A=wye){if(A){let i=P3t.get(A);if(!i)P3t.set(A,i=[]);i.push(e)}}function avr(e,n,A=Hm.EMPTY_OBJ){let{immediate:i,deep:s,once:u,scheduler:g,augmentJob:d,call:f}=A,B=(te)=>{if(s)return te;if($$(te)||s===!1||s===0)return oCe(te,1);return oCe(te)},E,Q,w,S,G=!1,q=!1;if(zL(e))Q=()=>e.value,G=$$(e);else if(jqe(e))Q=()=>B(e),G=!0;else if(Hm.isArray(e))q=!0,G=e.some((te)=>jqe(te)||$$(te)),Q=()=>e.map((te)=>{if(zL(te))return te.value;else if(jqe(te))return B(te);else if(Hm.isFunction(te))return f?f(te,2):te()});else if(Hm.isFunction(e))if(n)Q=f?()=>f(e,2):e;else Q=()=>{if(w){gGn();try{w()}finally{pGn()}}let te=wye;wye=E;try{return f?f(e,3,[S]):e(S)}finally{wye=te}};else Q=Hm.NOOP;if(n&&s){let te=Q,ie=s===!0?1/0:s;Q=()=>oCe(te(),ie)}let P=szA(),V=()=>{if(E.stop(),P&&P.active)Hm.remove(P.effects,E)};if(u&&n){let te=n;n=(...ie)=>{let ae=te(...ie);return V(),ae}}let W=q?Array(e.length).fill(R3t):R3t,z=(te)=>{if(!(E.flags&1)||!E.dirty&&!te)return;if(n){let ie=E.run();if(te||s||G||(q?ie.some((ae,Be)=>Hm.hasChanged(ae,W[Be])):Hm.hasChanged(ie,W))){if(w)w();let ae=wye;wye=E;try{let Be=[ie,W===R3t?void 0:q&&W[0]===R3t?[]:W,S];W=ie,f?f(n,3,Be):n(...Be)}finally{wye=ae}}}else E.run()};if(d)d(z);if(E=new ORe(Q),E.scheduler=g?()=>g(z,!1):z,S=(te)=>xzA(te,!1,E),w=E.onStop=()=>{let te=P3t.get(E);if(te){if(f)f(te,4);else for(let ie of te)ie();P3t.delete(E)}},n)if(i)z(!0);else W=E.run();else if(g)g(z.bind(null,!0),!0);else E.run();return V.pause=E.pause.bind(E),V.resume=E.resume.bind(E),V.stop=V,V}function oCe(e,n=1/0,A){if(n<=0||!Hm.isObject(e)||e.__v_skip)return e;if(A=A||new Map,(A.get(e)||0)>=n)return e;if(A.set(e,n),n--,zL(e))oCe(e.value,n,A);else if(Hm.isArray(e))for(let i=0;i<e.length;i++)oCe(e[i],n,A);else if(Hm.isSet(e)||Hm.isMap(e))e.forEach((i)=>{oCe(i,n,A)});else if(Hm.isPlainObject(e)){for(let i in e)oCe(e[i],n,A);for(let i of Object.getOwnPropertySymbols(e))if(Object.prototype.propertyIsEnumerable.call(e,i))oCe(e[i],n,A)}return e}FzA.ARRAY_ITERATE_KEY=zRe;FzA.EffectFlags=BFr;FzA.EffectScope=oGn;FzA.ITERATE_KEY=kye;FzA.MAP_KEY_ITERATE_KEY=j3t;FzA.ReactiveEffect=ORe;FzA.ReactiveFlags=tvr;FzA.TrackOpTypes=XFr;FzA.TriggerOpTypes=evr;FzA.WatchErrorCodes=nvr;FzA.computed=VFr;FzA.customRef=zFr;FzA.effect=IFr;FzA.effectScope=hFr;FzA.enableTracking=yFr;FzA.getCurrentScope=szA;FzA.getCurrentWatcher=Avr;FzA.isProxy=bGn;FzA.isReactive=jqe;FzA.isReadonly=sCe;FzA.isRef=zL;FzA.isShallow=$$;FzA.markRaw=jFr;FzA.onEffectCleanup=QFr;FzA.onScopeDispose=bFr;FzA.onWatcherCleanup=xzA;FzA.pauseTracking=gGn;FzA.proxyRefs=OFr;FzA.reactive=hGn;FzA.reactiveReadArray=Yqe;FzA.readonly=H3t;FzA.ref=IzA;FzA.resetTracking=pGn;FzA.shallowReactive=RFr;FzA.shallowReadArray=J3t;FzA.shallowReadonly=YFr;FzA.shallowRef=HFr;FzA.stop=EFr;FzA.toRaw=p0;FzA.toReactive=Tie;FzA.toReadonly=WRe;FzA.toRef=ZFr;FzA.toRefs=WFr;FzA.toValue=JFr;FzA.track=F7;FzA.traverse=oCe;FzA.trigger=rCe;FzA.triggerRef=PFr;FzA.unref=z3t;FzA.watch=avr});var eZA=Ar((XWA)=>{Object.defineProperty(XWA,"__esModule",{value:!0});var Zl=vzA(),Bi=Fqe();function tSr(e){}function nSr(){}function ASr(e,n){return}var aSr={SETUP_FUNCTION:0,"0":"SETUP_FUNCTION",RENDER_FUNCTION:1,"1":"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,"5":"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,"6":"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,"7":"VNODE_HOOK",DIRECTIVE_HOOK:8,"8":"DIRECTIVE_HOOK",TRANSITION_HOOK:9,"9":"TRANSITION_HOOK",APP_ERROR_HANDLER:10,"10":"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,"11":"APP_WARN_HANDLER",FUNCTION_REF:12,"12":"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,"13":"ASYNC_COMPONENT_LOADER",SCHEDULER:14,"14":"SCHEDULER",COMPONENT_UPDATE:15,"15":"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,"16":"APP_UNMOUNT_CLEANUP"},iSr={["sp"]:"serverPrefetch hook",["bc"]:"beforeCreate hook",["c"]:"created hook",["bm"]:"beforeMount hook",["m"]:"mounted hook",["bu"]:"beforeUpdate hook",["u"]:"updated",["bum"]:"beforeUnmount hook",["um"]:"unmounted hook",["a"]:"activated hook",["da"]:"deactivated hook",["ec"]:"errorCaptured hook",["rtc"]:"renderTracked hook",["rtg"]:"renderTriggered hook",[0]:"setup function",[1]:"render function",[2]:"watcher getter",[3]:"watcher callback",[4]:"watcher cleanup function",[5]:"native event handler",[6]:"component event handler",[7]:"vnode hook",[8]:"directive hook",[9]:"transition hook",[10]:"app errorHandler",[11]:"app warnHandler",[12]:"ref function",[13]:"async component loader",[14]:"scheduler flush",[15]:"component update",[16]:"app unmount cleanup function"};function iYe(e,n,A,i){try{return i?e(...i):e()}catch(s){Wqe(s,n,A)}}function OAe(e,n,A,i){if(Bi.isFunction(e)){let s=iYe(e,n,A,i);if(s&&Bi.isPromise(s))s.catch((u)=>{Wqe(u,n,A)});return s}if(Bi.isArray(e)){let s=[];for(let u=0;u<e.length;u++)s.push(OAe(e[u],n,A,i));return s}}function Wqe(e,n,A,i=!0){let s=n?n.vnode:null,{errorHandler:u,throwUnhandledErrorInProduction:g}=n&&n.appContext.config||Bi.EMPTY_OBJ;if(n){let{parent:d,proxy:f}=n,B=`https://vuejs.org/error-reference/#runtime-${A}`;while(d){let E=d.ec;if(E){for(let Q=0;Q<E.length;Q++)if(E[Q](e,f,B)===!1)return}d=d.parent}if(u){Zl.pauseTracking(),iYe(u,null,10,[e,f,B]),Zl.resetTracking();return}}rSr(e,A,s,i,g)}function rSr(e,n,A,i=!0,s=!1){if(s)throw e;else console.error(e)}var S7=[],Kie=-1,eYe=[],xye=null,VRe=0,JzA=Promise.resolve(),A9t=null;function $zA(e){let n=A9t||JzA;return e?n.then(this?e.bind(this):e):n}function oSr(e){let n=Kie+1,A=S7.length;while(n<A){let i=n+A>>>1,s=S7[i],u=OEt(s);if(u<e||u===e&&s.flags&2)n=i+1;else A=i}return n}function GGn(e){if(!(e.flags&1)){let n=OEt(e),A=S7[S7.length-1];if(!A||!(e.flags&2)&&n>=OEt(A))S7.push(e);else S7.splice(oSr(n),0,e);e.flags|=1,OzA()}}function OzA(){if(!A9t)A9t=JzA.then(zzA)}function a9t(e){if(!Bi.isArray(e)){if(xye&&e.id===-1)xye.splice(VRe+1,0,e);else if(!(e.flags&1))eYe.push(e),e.flags|=1}else eYe.push(...e);OzA()}function SzA(e,n,A=Kie+1){for(;A<S7.length;A++){let i=S7[A];if(i&&i.flags&2){if(e&&i.id!==e.uid)continue;if(S7.splice(A,1),A--,i.flags&4)i.flags&=-2;if(i(),!(i.flags&4))i.flags&=-2}}}function i9t(e){if(eYe.length){let n=[...new Set(eYe)].sort((A,i)=>OEt(A)-OEt(i));if(eYe.length=0,xye){xye.push(...n);return}xye=n;for(VRe=0;VRe<xye.length;VRe++){let A=xye[VRe];if(A.flags&4)A.flags&=-2;if(!(A.flags&8))A();A.flags&=-2}xye=null,VRe=0}}var OEt=(e)=>e.id==null?e.flags&2?-1:1/0:e.id;function zzA(e){try{for(Kie=0;Kie<S7.length;Kie++){let n=S7[Kie];if(n&&!(n.flags&8)){if(n.flags&4)n.flags&=-2;if(iYe(n,n.i,n.i?15:14),!(n.flags&4))n.flags&=-2}}}finally{for(;Kie<S7.length;Kie++){let n=S7[Kie];if(n)n.flags&=-2}if(Kie=-1,S7.length=0,i9t(),A9t=null,S7.length||eYe.length)zzA()}}var zM=null,f9t=null;function zEt(e){let n=zM;return zM=e,f9t=e&&e.type.__scopeId||null,n}function sSr(e){f9t=e}function cSr(){f9t=null}var uSr=(e)=>MGn;function MGn(e,n=zM,A){if(!n)return e;if(e._n)return e;let i=(...s)=>{if(i._d)XEt(-1);let u=zEt(n),g;try{g=e(...s)}finally{if(zEt(u),i._d)XEt(1)}return g};return i._n=!0,i._c=!0,i._d=!0,i}function lSr(e,n){if(zM===null)return e;let A=Ayt(zM),i=e.dirs||(e.dirs=[]);for(let s=0;s<n.length;s++){let[u,g,d,f=Bi.EMPTY_OBJ]=n[s];if(u){if(Bi.isFunction(u))u={mounted:u,updated:u};if(u.deep)Zl.traverse(g);i.push({dir:u,instance:A,value:g,oldValue:void 0,arg:d,modifiers:f})}}return e}function Rie(e,n,A,i){let s=e.dirs,u=n&&n.dirs;for(let g=0;g<s.length;g++){let d=s[g];if(u)d.oldValue=u[g].value;let f=d.dir[i];if(f)Zl.pauseTracking(),OAe(f,A,8,[e.el,d,e,n]),Zl.resetTracking()}}function WzA(e,n){if(OM){let A=OM.provides,i=OM.parent&&OM.parent.provides;if(i===A)A=OM.provides=Object.create(i);A[e]=n}}function HEt(e,n,A=!1){let i=zAe();if(i||Jqe){let s=Jqe?Jqe._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(s&&e in s)return s[e];else if(arguments.length>1)return A&&Bi.isFunction(n)?n.call(i&&i.proxy):n}}function gSr(){return!!(zAe()||Jqe)}var ZzA=Symbol.for("v-scx"),VzA=()=>{return HEt(ZzA)};function pSr(e,n){return tyt(e,null,n)}function mSr(e,n){return tyt(e,null,{flush:"post"})}function XzA(e,n){return tyt(e,null,{flush:"sync"})}function PEt(e,n,A){return tyt(e,n,A)}function tyt(e,n,A=Bi.EMPTY_OBJ){let{immediate:i,deep:s,flush:u,once:g}=A,d=Bi.extend({},A),f=n&&i||!n&&u!=="post",B;if(zqe){if(u==="sync"){let S=VzA();B=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){let S=()=>{};return S.stop=Bi.NOOP,S.resume=Bi.NOOP,S.pause=Bi.NOOP,S}}let E=OM;d.call=(S,G,q)=>OAe(S,E,G,q);let Q=!1;if(u==="post")d.scheduler=(S)=>{p8(S,E&&E.suspense)};else if(u!=="sync")Q=!0,d.scheduler=(S,G)=>{if(G)S();else GGn(S)};d.augmentJob=(S)=>{if(n)S.flags|=4;if(Q){if(S.flags|=2,E)S.id=E.uid,S.i=E}};let w=Zl.watch(e,n,d);if(zqe){if(B)B.push(w);else if(f)w()}return w}function dSr(e,n,A){let i=this.proxy,s=Bi.isString(e)?e.includes(".")?eWA(i,e):()=>i[e]:e.bind(i,i),u;if(Bi.isFunction(n))u=n;else u=n.handler,A=n;let g=rYe(this),d=tyt(s,u.bind(i),A);return g(),d}function eWA(e,n){let A=n.split(".");return()=>{let i=e;for(let s=0;s<A.length&&i;s++)i=i[A[s]];return i}}var Dye=new WeakMap,tWA=Symbol("_vte"),nWA=(e)=>e.__isTeleport,Pqe=(e)=>e&&(e.disabled||e.disabled===""),fSr=(e)=>e&&(e.defer||e.defer===""),NzA=(e)=>typeof SVGElement<"u"&&e instanceof SVGElement,GzA=(e)=>typeof MathMLElement==="function"&&e instanceof MathMLElement,yGn=(e,n)=>{let A=e&&e.to;if(Bi.isString(A))if(!n)return null;else return n(A);else return A},hSr={name:"Teleport",__isTeleport:!0,process(e,n,A,i,s,u,g,d,f,B){let{mc:E,pc:Q,pbc:w,o:{insert:S,querySelector:G,createText:q,createComment:P,parentNode:V}}=B,W=Pqe(n.props),{dynamicChildren:z}=n,te=(Be,xe,Re)=>{if(Be.shapeFlag&16)E(Be.children,xe,Re,s,u,g,d,f)},ie=(Be=n)=>{let xe=Pqe(Be.props),Re=Be.target=yGn(Be.props,G),Oe=QGn(Re,Be,q,S);if(Re){if(g!=="svg"&&NzA(Re))g="svg";else if(g!=="mathml"&&GzA(Re))g="mathml";if(s&&s.isCE)(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(Re);if(!xe)te(Be,Re,Oe),REt(Be,!1)}},ae=(Be)=>{let xe=()=>{if(Dye.get(Be)!==xe)return;if(Dye.delete(Be),Pqe(Be.props)){let Re=V(Be.el)||A;te(Be,Re,Be.anchor),REt(Be,!0)}ie(Be)};Dye.set(Be,xe),p8(xe,u)};if(e==null){let Be=n.el=q(""),xe=n.anchor=q("");if(S(Be,A,i),S(xe,A,i),fSr(n.props)||u&&u.pendingBranch){ae(n);return}if(W)te(n,A,xe),REt(n,!0);ie()}else{n.el=e.el;let Be=n.anchor=e.anchor,xe=Dye.get(e);if(xe){xe.flags|=8,Dye.delete(e),ae(n);return}n.targetStart=e.targetStart;let Re=n.target=e.target,Oe=n.targetAnchor=e.targetAnchor,Ne=Pqe(e.props),$e=Ne?A:Re,it=Ne?Be:Oe;if(g==="svg"||NzA(Re))g="svg";else if(g==="mathml"||GzA(Re))g="mathml";if(z)w(e.dynamicChildren,z,$e,s,u,g,d),JGn(e,n,!0);else if(!f)Q(e,n,$e,it,s,u,g,d,!1);if(W){if(!Ne)W3t(n,A,Be,B,1);else if(n.props&&e.props&&n.props.to!==e.props.to)n.props.to=e.props.to}else if((n.props&&n.props.to)!==(e.props&&e.props.to)){let Me=yGn(n.props,G);if(Me)n.target=Me,W3t(n,Me,null,B,0)}else if(Ne)W3t(n,Re,Oe,B,1);REt(n,W)}},remove(e,n,A,{um:i,o:{remove:s}},u){let{shapeFlag:g,children:d,anchor:f,targetStart:B,targetAnchor:E,target:Q,props:w}=e,S=Pqe(w),G=u||!S,q=Dye.get(e);if(q)q.flags|=8,Dye.delete(e);if(Q)s(B),s(E);if(u&&s(f),!q&&(S||Q)&&g&16)for(let P=0;P<d.length;P++){let V=d[P];i(V,n,A,G,!!V.dynamicChildren)}},move:W3t,hydrate:bSr};function W3t(e,n,A,{o:{insert:i},m:s},u=2){if(u===0)i(e.targetAnchor,n,A);let{el:g,anchor:d,shapeFlag:f,children:B,props:E}=e,Q=u===2;if(Q)i(g,n,A);if(!Dye.has(e)&&(!Q||Pqe(E))){if(f&16)for(let w=0;w<B.length;w++)s(B[w],n,A,2)}if(Q)i(d,n,A)}function bSr(e,n,A,i,s,u,{o:{nextSibling:g,parentNode:d,querySelector:f,insert:B,createText:E}},Q){function w(P,V){let W=V;while(W){if(W&&W.nodeType===8){if(W.data==="teleport start anchor")n.targetStart=W;else if(W.data==="teleport anchor"){n.targetAnchor=W,P._lpa=n.targetAnchor&&g(n.targetAnchor);break}}W=g(W)}}function S(P,V){V.anchor=Q(g(P),V,d(P),A,i,s,u)}let G=n.target=yGn(n.props,f),q=Pqe(n.props);if(G){let P=G._lpa||G.firstChild;if(n.shapeFlag&16)if(q){if(S(e,n),w(G,P),!n.targetAnchor)QGn(G,n,E,B,d(e)===G?e:null)}else{if(n.anchor=g(e),w(G,P),!n.targetAnchor)QGn(G,n,E,B);Q(P&&g(P),n,G,A,i,s,u)}REt(n,q)}else if(q){if(n.shapeFlag&16)S(e,n),n.targetStart=e,n.targetAnchor=g(e)}return n.anchor&&g(n.anchor)}var BSr=hSr;function REt(e,n){let A=e.ctx;if(A&&A.ut){let i,s;if(n)i=e.el,s=e.anchor;else i=e.targetStart,s=e.targetAnchor;while(i&&i!==s){if(i.nodeType===1)i.setAttribute("data-v-owner",A.uid);i=i.nextSibling}A.ut()}}function QGn(e,n,A,i,s=null){let u=n.targetStart=A(""),g=n.targetAnchor=A("");if(u[tWA]=g,e)i(u,e,s),i(g,e,s);return g}var bz=Symbol("_leaveCb"),KEt=Symbol("_enterCb");function AWA(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return b9t(()=>{e.isMounted=!0}),B9t(()=>{e.isUnmounting=!0}),e}var hz=[Function,Array],aWA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:hz,onEnter:hz,onAfterEnter:hz,onEnterCancelled:hz,onBeforeLeave:hz,onLeave:hz,onAfterLeave:hz,onLeaveCancelled:hz,onBeforeAppear:hz,onAppear:hz,onAfterAppear:hz,onAppearCancelled:hz},iWA=(e)=>{let n=e.subTree;return n.component?iWA(n.component):n},CSr={name:"BaseTransition",props:aWA,setup(e,{slots:n}){let A=zAe(),i=AWA();return()=>{let s=n.default&&LGn(n.default(),!0),u=s&&s.length?rWA(s):A.subTree?jWA():void 0;if(!u)return;let g=Zl.toRaw(e),{mode:d}=g;if(i.isLeaving)return BGn(u);let f=MzA(u);if(!f)return BGn(u);let B=r9t(f,g,i,A,(Q)=>B=Q);if(f.type!==x4)$qe(f,B);let E=A.subTree&&MzA(A.subTree);if(E&&E.type!==x4&&!$Ae(E,f)&&iWA(A).type!==x4){let Q=r9t(E,g,i,A);if($qe(E,Q),d==="out-in"&&f.type!==x4)return i.isLeaving=!0,Q.afterLeave=()=>{if(i.isLeaving=!1,!(A.job.flags&8))A.update();delete Q.afterLeave,E=void 0},BGn(u);else if(d==="in-out"&&f.type!==x4)Q.delayLeave=(w,S,G)=>{let q=oWA(i,E);q[String(E.key)]=E,w[bz]=()=>{S(),w[bz]=void 0,delete B.delayedLeave,E=void 0},B.delayedLeave=()=>{G(),delete B.delayedLeave,E=void 0}};else E=void 0}else if(E)E=void 0;return u}}};function rWA(e){let n=e[0];if(e.length>1){for(let A of e)if(A.type!==x4){n=A;break}}return n}var ISr=CSr;function oWA(e,n){let{leavingVNodes:A}=e,i=A.get(n.type);if(!i)i=Object.create(null),A.set(n.type,i);return i}function r9t(e,n,A,i,s){let{appear:u,mode:g,persisted:d=!1,onBeforeEnter:f,onEnter:B,onAfterEnter:E,onEnterCancelled:Q,onBeforeLeave:w,onLeave:S,onAfterLeave:G,onLeaveCancelled:q,onBeforeAppear:P,onAppear:V,onAfterAppear:W,onAppearCancelled:z}=n,te=String(e.key),ie=oWA(A,e),ae=(Re,Oe)=>{Re&&OAe(Re,i,9,Oe)},Be=(Re,Oe)=>{let Ne=Oe[1];if(ae(Re,Oe),Bi.isArray(Re)){if(Re.every(($e)=>$e.length<=1))Ne()}else if(Re.length<=1)Ne()},xe={mode:g,persisted:d,beforeEnter(Re){let Oe=f;if(!A.isMounted)if(u)Oe=P||f;else return;if(Re[bz])Re[bz](!0);let Ne=ie[te];if(Ne&&$Ae(e,Ne)&&Ne.el[bz])Ne.el[bz]();ae(Oe,[Re])},enter(Re){if(ie[te]===e)return;let Oe=B,Ne=E,$e=Q;if(!A.isMounted)if(u)Oe=V||B,Ne=W||E,$e=z||Q;else return;let it=!1;Re[KEt]=(bt)=>{if(it)return;if(it=!0,bt)ae($e,[Re]);else ae(Ne,[Re]);if(xe.delayedLeave)xe.delayedLeave();Re[KEt]=void 0};let Me=Re[KEt].bind(null,!1);if(Oe)Be(Oe,[Re,Me]);else Me()},leave(Re,Oe){let Ne=String(e.key);if(Re[KEt])Re[KEt](!0);if(A.isUnmounting)return Oe();ae(w,[Re]);let $e=!1;Re[bz]=(Me)=>{if($e)return;if($e=!0,Oe(),Me)ae(q,[Re]);else ae(G,[Re]);if(Re[bz]=void 0,ie[Ne]===e)delete ie[Ne]};let it=Re[bz].bind(null,!1);if(ie[Ne]=e,S)Be(S,[Re,it]);else it()},clone(Re){let Oe=r9t(Re,n,A,i,s);if(s)s(Oe);return Oe}};return xe}function BGn(e){if(nyt(e))return e=Yie(e),e.children=null,e}function MzA(e){if(!nyt(e)){if(nWA(e.type)&&e.children)return rWA(e.children);return e}if(e.component)return e.component.subTree;let{shapeFlag:n,children:A}=e;if(A){if(n&16)return A[0];if(n&32&&Bi.isFunction(A.default))return A.default()}}function $qe(e,n){if(e.shapeFlag&6&&e.component)e.transition=n,$qe(e.component.subTree,n);else if(e.shapeFlag&128)e.ssContent.transition=n.clone(e.ssContent),e.ssFallback.transition=n.clone(e.ssFallback);else e.transition=n}function LGn(e,n=!1,A){let i=[],s=0;for(let u=0;u<e.length;u++){let g=e[u],d=A==null?g.key:String(A)+String(g.key!=null?g.key:u);if(g.type===WL){if(g.patchFlag&128)s++;i=i.concat(LGn(g.children,n,d))}else if(n||g.type!==x4)i.push(d!=null?Yie(g,{key:d}):g)}if(s>1)for(let u=0;u<i.length;u++)i[u].patchFlag=-2;return i}function sWA(e,n){return Bi.isFunction(e)?(()=>Bi.extend({name:e.name},n,{setup:e}))():e}function ESr(){let e=zAe();if(e)return(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++;return""}function qGn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ySr(e){let n=zAe(),A=Zl.shallowRef(null);if(n){let s=n.refs===Bi.EMPTY_OBJ?n.refs={}:n.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>A.value,set:(u)=>A.value=u})}return A}function LzA(e,n){let A;return!!((A=Object.getOwnPropertyDescriptor(e,n))&&!A.configurable)}var o9t=new WeakMap;function tYe(e,n,A,i,s=!1){if(Bi.isArray(e)){e.forEach((q,P)=>tYe(q,n&&(Bi.isArray(n)?n[P]:n),A,i,s));return}if(uCe(i)&&!s){if(i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component)tYe(e,n,A,i.component.subTree);return}let u=i.shapeFlag&4?Ayt(i.component):i.el,g=s?null:u,{i:d,r:f}=e,B=n&&n.r,E=d.refs===Bi.EMPTY_OBJ?d.refs={}:d.refs,Q=d.setupState,w=Zl.toRaw(Q),S=Q===Bi.EMPTY_OBJ?Bi.NO:(q)=>{if(LzA(E,q))return!1;return Bi.hasOwn(w,q)},G=(q,P)=>{if(P&&LzA(E,P))return!1;return!0};if(B!=null&&B!==f){if(qzA(n),Bi.isString(B)){if(E[B]=null,S(B))Q[B]=null}else if(Zl.isRef(B)){let q=n;if(G(B,q.k))B.value=null;if(q.k)E[q.k]=null}}if(Bi.isFunction(f)){Zl.pauseTracking();try{iYe(f,d,12,[g,E])}finally{Zl.resetTracking()}}else{let q=Bi.isString(f),P=Zl.isRef(f);if(q||P){let V=()=>{if(e.f){let W=q?S(f)?Q[f]:E[f]:G()||!e.k?f.value:E[e.k];if(s)Bi.isArray(W)&&Bi.remove(W,u);else if(!Bi.isArray(W))if(q){if(E[f]=[u],S(f))Q[f]=E[f]}else{let z=[u];if(G(f,e.k))f.value=z;if(e.k)E[e.k]=z}else if(!W.includes(u))W.push(u)}else if(q){if(E[f]=g,S(f))Q[f]=g}else if(P){if(G(f,e.k))f.value=g;if(e.k)E[e.k]=g}};if(g){let W=()=>{V(),o9t.delete(e)};W.id=-1,o9t.set(e,W),p8(W,A)}else qzA(e),V()}}}function qzA(e){let n=o9t.get(e);if(n)n.flags|=8,o9t.delete(e)}var UzA=!1,ZRe=()=>{if(UzA)return;console.error("Hydration completed but contains mismatches."),UzA=!0},QSr=(e)=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",_Sr=(e)=>e.namespaceURI.includes("MathML"),Z3t=(e)=>{if(e.nodeType!==1)return;if(QSr(e))return"svg";if(_Sr(e))return"mathml";return},XRe=(e)=>e.nodeType===8;function wSr(e){let{mt:n,p:A,o:{patchProp:i,createText:s,nextSibling:u,parentNode:g,remove:d,insert:f,createComment:B}}=e,E=(z,te)=>{if(!te.hasChildNodes()){A(null,z,te),i9t(),te._vnode=z;return}Q(te.firstChild,z,null,null,null),i9t(),te._vnode=z},Q=(z,te,ie,ae,Be,xe=!1)=>{xe=xe||!!te.dynamicChildren;let Re=XRe(z)&&z.data==="[",Oe=()=>q(z,te,ie,ae,Be,Re),{type:Ne,ref:$e,shapeFlag:it,patchFlag:Me}=te,bt=z.nodeType;if(te.el=z,Me===-2)xe=!1,te.dynamicChildren=null;let Rt=null;switch(Ne){case Fye:if(bt!==3)if(te.children==="")f(te.el=s(""),g(z),z),Rt=z;else Rt=Oe();else{if(z.data!==te.children)ZRe(),z.data=te.children;Rt=u(z)}break;case x4:if(W(z))Rt=u(z),V(te.el=z.content.firstChild,z,ie);else if(bt!==8||Re)Rt=Oe();else Rt=u(z);break;case AYe:if(Re)z=u(z),bt=z.nodeType;if(bt===1||bt===3){Rt=z;let mt=!te.children.length;for(let Xt=0;Xt<te.staticCount;Xt++){if(mt)te.children+=Rt.nodeType===1?Rt.outerHTML:Rt.data;if(Xt===te.staticCount-1)te.anchor=Rt;Rt=u(Rt)}return Re?u(Rt):Rt}else Oe();break;case WL:if(!Re)Rt=Oe();else Rt=G(z,te,ie,ae,Be,xe);break;default:if(it&1)if((bt!==1||te.type.toLowerCase()!==z.tagName.toLowerCase())&&!W(z))Rt=Oe();else Rt=w(z,te,ie,ae,Be,xe);else if(it&6){te.slotScopeIds=Be;let mt=g(z);if(Re)Rt=P(z);else if(XRe(z)&&z.data==="teleport start")Rt=P(z,z.data,"teleport end");else Rt=u(z);if(n(te,mt,null,ie,ae,Z3t(mt),xe),uCe(te)&&!te.type.__asyncResolved){let Xt;if(Re)Xt=pv(WL),Xt.anchor=Rt?Rt.previousSibling:mt.lastChild;else Xt=z.nodeType===3?OGn(""):pv("div");Xt.el=z,te.component.subTree=Xt}}else if(it&64)if(bt!==8)Rt=Oe();else Rt=te.type.hydrate(z,te,ie,ae,Be,xe,e,S);else if(it&128)Rt=te.type.hydrate(z,te,ie,ae,Z3t(g(z)),Be,xe,e,Q)}if($e!=null)tYe($e,null,ae,te);return Rt},w=(z,te,ie,ae,Be,xe)=>{xe=xe||!!te.dynamicChildren;let{type:Re,dynamicProps:Oe,props:Ne,patchFlag:$e,shapeFlag:it,dirs:Me,transition:bt}=te,Rt=Re==="input"||Re==="option",mt=!!Oe;if(Rt||mt||$e!==-1){if(Me)Rie(te,null,ie,"created");let Xt=!1;if(W(z)){Xt=GWA(null,bt)&&ie&&ie.vnode.props&&ie.vnode.props.appear;let Ft=z.content.firstChild;if(Xt){let nn=Ft.getAttribute("class");if(nn)Ft.$cls=nn;bt.beforeEnter(Ft)}V(Ft,z,ie),te.el=z=Ft}if(it&16&&!(Ne&&(Ne.innerHTML||Ne.textContent))){let Ft=S(z.firstChild,te,z,ie,ae,Be,xe);if(Ft&&!e9t(z,1))ZRe();while(Ft){let nn=Ft;Ft=Ft.nextSibling,d(nn)}}else if(it&8){let Ft=te.children;if(Ft[0]===`
2012
2012
  `&&(z.tagName==="PRE"||z.tagName==="TEXTAREA"))Ft=Ft.slice(1);let{textContent:nn}=z;if(nn!==Ft&&nn!==Ft.replace(/\r\n|\r/g,`
2013
- `)){if(!e9t(z,0))ZRe();z.textContent=te.children}}if(Ne){if(Rt||mt||!xe||$e&48){let Ft=z.tagName.includes("-");for(let nn in Ne)if(Rt&&(nn.endsWith("value")||nn==="indeterminate")||Bi.isOn(nn)&&!Bi.isReservedProp(nn)||nn[0]==="."||Ft&&!Bi.isReservedProp(nn)||Oe&&Oe.includes(nn))i(z,nn,null,Ne[nn],void 0,ie)}else if(Ne.onClick)i(z,"onClick",null,Ne.onClick,void 0,ie);else if($e&4&&Zl.isReactive(Ne.style))for(let Ft in Ne.style)Ne.style[Ft]}let Ln;if(Ln=Ne&&Ne.onVnodeBeforeMount)yR(Ln,ie,te);if(Me)Rie(te,null,ie,"beforeMount");if((Ln=Ne&&Ne.onVnodeMounted)||Me||Xt)UWA(()=>{Ln&&yR(Ln,ie,te),Xt&&bt.enter(z),Me&&Rie(te,null,ie,"mounted")},ae)}return z.nextSibling},S=(z,te,ie,ae,Be,xe,Re)=>{Re=Re||!!te.dynamicChildren;let Oe=te.children,Ne=Oe.length,$e=!1;for(let it=0;it<Ne;it++){let Me=Re?Oe[it]:Oe[it]=QR(Oe[it]),bt=Me.type===Fye;if(z){if(bt&&!Re){if(it+1<Ne&&QR(Oe[it+1]).type===Fye)f(s(z.data.slice(Me.children.length)),ie,u(z)),z.data=Me.children}z=Q(z,Me,ae,Be,xe,Re)}else if(bt&&!Me.children)f(Me.el=s(""),ie);else{if(!$e){if($e=!0,!e9t(ie,1))ZRe()}A(null,Me,ie,null,ae,Be,Z3t(ie),xe)}}return z},G=(z,te,ie,ae,Be,xe)=>{let{slotScopeIds:Re}=te;if(Re)Be=Be?Be.concat(Re):Re;let Oe=g(z),Ne=S(u(z),te,Oe,ie,ae,Be,xe);if(Ne&&XRe(Ne)&&Ne.data==="]")return u(te.anchor=Ne);else return ZRe(),f(te.anchor=B("]"),Oe,Ne),Ne},q=(z,te,ie,ae,Be,xe)=>{if(!DSr(z,te))ZRe();if(te.el=null,xe){let Ne=P(z);while(!0){let $e=u(z);if($e&&$e!==Ne)d($e);else break}}let Re=u(z),Oe=g(z);if(d(z),A(null,te,Oe,Re,ie,ae,Z3t(Oe),Be),ie)ie.vnode.el=te.el,E9t(ie,te.el);return Re},P=(z,te="[",ie="]")=>{let ae=0;while(z)if(z=u(z),z&&XRe(z)){if(z.data===te)ae++;if(z.data===ie)if(ae===0)return u(z);else ae--}return z},V=(z,te,ie)=>{let ae=te.parentNode;if(ae)ae.replaceChild(z,te);let Be=ie;while(Be){if(Be.vnode.el===te)Be.vnode.el=Be.subTree.el=z;Be=Be.parent}},W=(z)=>{return z.nodeType===1&&z.tagName==="TEMPLATE"};return[E,Q]}var s9t="data-allow-mismatch",kSr={[0]:"text",[1]:"children",[2]:"class",[3]:"style",[4]:"attribute"};function e9t(e,n){if(n===0||n===1)while(e&&!e.hasAttribute(s9t))e=e.parentElement;return UGn(e&&e.getAttribute(s9t),n)}function UGn(e,n){if(e==null)return!1;else if(e==="")return!0;else{let A=e.split(",");if(n===0&&A.includes("children"))return!0;return A.includes(kSr[n])}}function DSr(e,n){return e9t(e.parentElement,1)||xSr(e)||FSr(n)}function xSr(e){return e.nodeType===1&&UGn(e.getAttribute(s9t),1)}function FSr({props:e}){let n=e&&e[s9t];return typeof n==="string"&&UGn(n,1)}var vSr=Bi.getGlobalThis().requestIdleCallback||((e)=>setTimeout(e,1)),SSr=Bi.getGlobalThis().cancelIdleCallback||((e)=>clearTimeout(e)),NSr=(e=1e4)=>(n)=>{let A=vSr(n,{timeout:e});return()=>SSr(A)};function GSr(e){let{top:n,left:A,bottom:i,right:s}=e.getBoundingClientRect(),{innerHeight:u,innerWidth:g}=window;return(n>0&&n<u||i>0&&i<u)&&(A>0&&A<g||s>0&&s<g)}var MSr=(e)=>(n,A)=>{let i=new IntersectionObserver((s)=>{for(let u of s){if(!u.isIntersecting)continue;i.disconnect(),n();break}},e);return A((s)=>{if(!(s instanceof Element))return;if(GSr(s))return n(),i.disconnect(),!1;i.observe(s)}),()=>i.disconnect()},LSr=(e)=>(n)=>{if(e){let A=matchMedia(e);if(A.matches)n();else return A.addEventListener("change",n,{once:!0}),()=>A.removeEventListener("change",n)}},qSr=(e=[])=>(n,A)=>{if(Bi.isString(e))e=[e];let i=!1,s=(g)=>{if(!i)i=!0,u(),n(),g.target.dispatchEvent(new g.constructor(g.type,g))},u=()=>{A((g)=>{for(let d of e)g.removeEventListener(d,s)})};return A((g)=>{for(let d of e)g.addEventListener(d,s,{once:!0})}),u};function USr(e,n){if(XRe(e)&&e.data==="["){let A=1,i=e.nextSibling;while(i){if(i.nodeType===1){if(n(i)===!1)break}else if(XRe(i)){if(i.data==="]"){if(--A===0)break}else if(i.data==="[")A++}i=i.nextSibling}}else n(e)}var uCe=(e)=>!!e.type.__asyncLoader;function TSr(e){if(Bi.isFunction(e))e={loader:e};let{loader:n,loadingComponent:A,errorComponent:i,delay:s=200,hydrate:u,timeout:g,suspensible:d=!0,onError:f}=e,B=null,E,Q=0,w=()=>{return Q++,B=null,S()},S=()=>{let G;return B||(G=B=n().catch((q)=>{if(q=q instanceof Error?q:Error(String(q)),f)return new Promise((P,V)=>{f(q,()=>P(w()),()=>V(q),Q+1)});else throw q}).then((q)=>{if(G!==B&&B)return B;if(q&&(q.__esModule||q[Symbol.toStringTag]==="Module"))q=q.default;return E=q,q}))};return sWA({name:"AsyncComponentWrapper",__asyncLoader:S,__asyncHydrate(G,q,P){let V=!1;(q.bu||(q.bu=[])).push(()=>V=!0);let W=()=>{if(V)return;P()},z=u?()=>{let te=u(W,(ie)=>USr(G,ie));if(te)(q.bum||(q.bum=[])).push(te)}:W;if(E)z();else S().then(()=>!q.isUnmounted&&z())},get __asyncResolved(){return E},setup(){let G=OM;if(qGn(G),E)return()=>V3t(E,G);let q=(ie)=>{B=null,Wqe(ie,G,13,!i)};if(d&&G.suspense||zqe)return S().then((ie)=>{return()=>V3t(ie,G)}).catch((ie)=>{return q(ie),()=>i?pv(i,{error:ie}):null});let P=Zl.ref(!1),V=Zl.ref(),W=Zl.ref(!!s),z,te;if(C9t(()=>{if(z!=null)clearTimeout(z);if(te!=null)clearTimeout(te)}),s)te=setTimeout(()=>{if(G.isUnmounted)return;W.value=!1},s);if(g!=null)z=setTimeout(()=>{if(G.isUnmounted)return;if(!P.value&&!V.value){let ie=Error(`Async component timed out after ${g}ms.`);q(ie),V.value=ie}},g);return S().then(()=>{if(G.isUnmounted)return;if(P.value=!0,G.parent&&nyt(G.parent.vnode))G.parent.update()}).catch((ie)=>{if(G.isUnmounted){B=null;return}q(ie),V.value=ie}),()=>{if(P.value&&E)return V3t(E,G);else if(V.value&&i)return pv(i,{error:V.value});else if(A&&!W.value)return V3t(A,G)}}})}function V3t(e,n){let{ref:A,props:i,children:s,ce:u}=n.vnode,g=pv(e,i,s);return g.ref=A,g.ce=u,delete n.vnode.ce,g}var nyt=(e)=>e.type.__isKeepAlive,KSr={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:n}){let A=zAe(),i=A.ctx;if(!i.renderer)return()=>{let W=n.default&&n.default();return W&&W.length===1?W[0]:W};let s=new Map,u=new Set,g=null,d=A.suspense,{renderer:{p:f,m:B,um:E,o:{createElement:Q}}}=i,w=Q("div");i.activate=(W,z,te,ie,ae)=>{let Be=W.component;B(W,z,te,0,d),f(Be.vnode,W,z,te,Be,d,ie,W.slotScopeIds,ae),p8(()=>{if(Be.isDeactivated=!1,Be.a)Bi.invokeArrayFns(Be.a);let xe=W.props&&W.props.onVnodeMounted;if(xe)yR(xe,Be.parent,W)},d)},i.deactivate=(W)=>{let z=W.component;u9t(z.m),u9t(z.a),B(W,w,null,1,d),p8(()=>{if(z.da)Bi.invokeArrayFns(z.da);let te=W.props&&W.props.onVnodeUnmounted;if(te)yR(te,z.parent,W);z.isDeactivated=!0},d)};function S(W){CGn(W),E(W,A,d,!0)}function G(W){s.forEach((z,te)=>{let ie=NGn(uCe(z)?z.type.__asyncResolved||{}:z.type);if(ie&&!W(ie))q(te)})}function q(W){let z=s.get(W);if(z&&(!g||!$Ae(z,g)))S(z);else if(g)CGn(g);s.delete(W),u.delete(W)}PEt(()=>[e.include,e.exclude],([W,z])=>{W&&G((te)=>YEt(W,te)),z&&G((te)=>!YEt(z,te))},{flush:"post",deep:!0});let P=null,V=()=>{if(P!=null)if(l9t(A.subTree.type))p8(()=>{s.set(P,X3t(A.subTree))},A.subTree.suspense);else s.set(P,X3t(A.subTree))};return b9t(V),TGn(V),B9t(()=>{s.forEach((W)=>{let{subTree:z,suspense:te}=A,ie=X3t(z);if(W.type===ie.type&&W.key===ie.key){CGn(ie);let ae=ie.component.da;ae&&p8(ae,te);return}S(W)})}),()=>{if(P=null,!n.default)return g=null;let W=n.default(),z=W[0];if(W.length>1)return g=null,W;else if(!lCe(z)||!(z.shapeFlag&4)&&!(z.shapeFlag&128))return g=null,z;let te=X3t(z);if(te.type===x4)return g=null,te;let ie=te.type,ae=NGn(uCe(te)?te.type.__asyncResolved||{}:ie),{include:Be,exclude:xe,max:Re}=e;if(Be&&(!ae||!YEt(Be,ae))||xe&&ae&&YEt(xe,ae))return te.shapeFlag&=-257,g=te,z;let Oe=te.key==null?ie:te.key,Ne=s.get(Oe);if(te.el){if(te=Yie(te),z.shapeFlag&128)z.ssContent=te}if(P=Oe,Ne){if(te.el=Ne.el,te.component=Ne.component,te.transition)$qe(te,te.transition);te.shapeFlag|=512,u.delete(Oe),u.add(Oe)}else if(u.add(Oe),Re&&u.size>parseInt(Re,10))q(u.values().next().value);return te.shapeFlag|=256,g=te,l9t(z.type)?z:te}}},RSr=KSr;function YEt(e,n){if(Bi.isArray(e))return e.some((A)=>YEt(A,n));else if(Bi.isString(e))return e.split(",").includes(n);else if(Bi.isRegExp(e))return e.lastIndex=0,e.test(n);return!1}function cWA(e,n){lWA(e,"a",n)}function uWA(e,n){lWA(e,"da",n)}function lWA(e,n,A=OM){let i=e.__wdc||(e.__wdc=()=>{let s=A;while(s){if(s.isDeactivated)return;s=s.parent}return e()});if(h9t(n,i,A),A){let s=A.parent;while(s&&s.parent){if(nyt(s.parent.vnode))YSr(i,n,A,s);s=s.parent}}}function YSr(e,n,A,i){let s=h9t(n,e,i,!0);C9t(()=>{Bi.remove(i[n],s)},A)}function CGn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function X3t(e){return e.shapeFlag&128?e.ssContent:e}function h9t(e,n,A=OM,i=!1){if(A){let s=A[e]||(A[e]=[]),u=n.__weh||(n.__weh=(...g)=>{Zl.pauseTracking();let d=rYe(A),f=OAe(n,A,e,g);return d(),Zl.resetTracking(),f});if(i)s.unshift(u);else s.push(u);return u}}var gCe=(e)=>(n,A=OM)=>{if(!zqe||e==="sp")h9t(e,(...i)=>n(...i),A)},gWA=gCe("bm"),b9t=gCe("m"),pWA=gCe("bu"),TGn=gCe("u"),B9t=gCe("bum"),C9t=gCe("um"),mWA=gCe("sp"),dWA=gCe("rtg"),fWA=gCe("rtc");function hWA(e,n=OM){h9t("ec",e,n)}var KGn="components",jSr="directives";function HSr(e,n){return RGn(KGn,e,!0,n)||e}var bWA=Symbol.for("v-ndc");function PSr(e){if(Bi.isString(e))return RGn(KGn,e,!1)||e;else return e||bWA}function JSr(e){return RGn(jSr,e)}function RGn(e,n,A=!0,i=!1){let s=zM||OM;if(s){let u=s.type;if(e===KGn){let d=NGn(u,!1);if(d&&(d===n||d===Bi.camelize(n)||d===Bi.capitalize(Bi.camelize(n))))return u}let g=TzA(s[e]||u[e],n)||TzA(s.appContext[e],n);if(!g&&i)return u;return g}}function TzA(e,n){return e&&(e[n]||e[Bi.camelize(n)]||e[Bi.capitalize(Bi.camelize(n))])}function $Sr(e,n,A,i){let s,u=A&&A[i],g=Bi.isArray(e);if(g||Bi.isString(e)){let d=g&&Zl.isReactive(e),f=!1,B=!1;if(d)f=!Zl.isShallow(e),B=Zl.isReadonly(e),e=Zl.shallowReadArray(e);s=Array(e.length);for(let E=0,Q=e.length;E<Q;E++)s[E]=n(f?B?Zl.toReadonly(Zl.toReactive(e[E])):Zl.toReactive(e[E]):e[E],E,void 0,u&&u[E])}else if(typeof e==="number"){s=Array(e);for(let d=0;d<e;d++)s[d]=n(d+1,d,void 0,u&&u[d])}else if(Bi.isObject(e))if(e[Symbol.iterator])s=Array.from(e,(d,f)=>n(d,f,void 0,u&&u[f]));else{let d=Object.keys(e);s=Array(d.length);for(let f=0,B=d.length;f<B;f++){let E=d[f];s[f]=n(e[E],E,f,u&&u[f])}}else s=[];if(A)A[i]=s;return s}function OSr(e,n){for(let A=0;A<n.length;A++){let i=n[A];if(Bi.isArray(i))for(let s=0;s<i.length;s++)e[i[s].name]=i[s].fn;else if(i)e[i.name]=i.key?(...s)=>{let u=i.fn(...s);if(u)u.key=i.key;return u}:i.fn}return e}function zSr(e,n,A={},i,s){if(zM.ce||zM.parent&&uCe(zM.parent)&&zM.parent.ce){let B=Object.keys(A).length>0;if(n!=="default")A.name=n;return VEt(),g9t(WL,null,[pv("slot",A,i&&i())],B?-2:64)}let u=e[n];if(u&&u._c)u._d=!1;VEt();let g=u&&YGn(u(A)),d=A.key||g&&g.key,f=g9t(WL,{key:(d&&!Bi.isSymbol(d)?d:`_${n}`)+(!g&&i?"_fb":"")},g||(i?i():[]),g&&e._===1?64:-2);if(!s&&f.scopeId)f.slotScopeIds=[f.scopeId+"-s"];if(u&&u._c)u._d=!0;return f}function YGn(e){return e.some((n)=>{if(!lCe(n))return!0;if(n.type===x4)return!1;if(n.type===WL&&!YGn(n.children))return!1;return!0})?e:null}function WSr(e,n){let A={};for(let i in e)A[n&&/[A-Z]/.test(i)?`on:${i}`:Bi.toHandlerKey(i)]=e[i];return A}var _Gn=(e)=>{if(!e)return null;if(JWA(e))return Ayt(e);return _Gn(e.parent)},JEt=Bi.extend(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)=>_Gn(e.parent),$root:(e)=>_Gn(e.root),$host:(e)=>e.ce,$emit:(e)=>e.emit,$options:(e)=>jGn(e),$forceUpdate:(e)=>e.f||(e.f=()=>{GGn(e.update)}),$nextTick:(e)=>e.n||(e.n=$zA.bind(e.proxy)),$watch:(e)=>dSr.bind(e)}),IGn=(e,n)=>e!==Bi.EMPTY_OBJ&&!e.__isScriptSetup&&Bi.hasOwn(e,n),wGn={get({_:e},n){if(n==="__v_skip")return!0;let{ctx:A,setupState:i,data:s,props:u,accessCache:g,type:d,appContext:f}=e;if(n[0]!=="$"){let w=g[n];if(w!==void 0)switch(w){case 1:return i[n];case 2:return s[n];case 4:return A[n];case 3:return u[n]}else if(IGn(i,n))return g[n]=1,i[n];else if(s!==Bi.EMPTY_OBJ&&Bi.hasOwn(s,n))return g[n]=2,s[n];else if(Bi.hasOwn(u,n))return g[n]=3,u[n];else if(A!==Bi.EMPTY_OBJ&&Bi.hasOwn(A,n))return g[n]=4,A[n];else if(kGn)g[n]=0}let B=JEt[n],E,Q;if(B){if(n==="$attrs")Zl.track(e.attrs,"get","");return B(e)}else if((E=d.__cssModules)&&(E=E[n]))return E;else if(A!==Bi.EMPTY_OBJ&&Bi.hasOwn(A,n))return g[n]=4,A[n];else if(Q=f.config.globalProperties,Bi.hasOwn(Q,n))return Q[n]},set({_:e},n,A){let{data:i,setupState:s,ctx:u}=e;if(IGn(s,n))return s[n]=A,!0;else if(i!==Bi.EMPTY_OBJ&&Bi.hasOwn(i,n))return i[n]=A,!0;else if(Bi.hasOwn(e.props,n))return!1;if(n[0]==="$"&&n.slice(1)in e)return!1;else u[n]=A;return!0},has({_:{data:e,setupState:n,accessCache:A,ctx:i,appContext:s,props:u,type:g}},d){let f;return!!(A[d]||e!==Bi.EMPTY_OBJ&&d[0]!=="$"&&Bi.hasOwn(e,d)||IGn(n,d)||Bi.hasOwn(u,d)||Bi.hasOwn(i,d)||Bi.hasOwn(JEt,d)||Bi.hasOwn(s.config.globalProperties,d)||(f=g.__cssModules)&&f[d])},defineProperty(e,n,A){if(A.get!=null)e._.accessCache[n]=0;else if(Bi.hasOwn(A,"value"))this.set(e,n,A.value,null);return Reflect.defineProperty(e,n,A)}},ZSr=Bi.extend({},wGn,{get(e,n){if(n===Symbol.unscopables)return;return wGn.get(e,n,e)},has(e,n){return n[0]!=="_"&&!Bi.isGloballyAllowed(n)}});function VSr(){return null}function XSr(){return null}function e4r(e){}function t4r(e){}function n4r(){return null}function A4r(){}function a4r(e,n){return null}function i4r(){return BWA().slots}function r4r(){return BWA().attrs}function BWA(e){let n=zAe();return n.setupContext||(n.setupContext=zWA(n))}function WEt(e){return Bi.isArray(e)?e.reduce((n,A)=>(n[A]=null,n),{}):e}function o4r(e,n){let A=WEt(e);for(let i in n){if(i.startsWith("__skip"))continue;let s=A[i];if(s)if(Bi.isArray(s)||Bi.isFunction(s))s=A[i]={type:s,default:n[i]};else s.default=n[i];else if(s===null)s=A[i]={default:n[i]};if(s&&n[`__skip_${i}`])s.skipFactory=!0}return A}function s4r(e,n){if(!e||!n)return e||n;if(Bi.isArray(e)&&Bi.isArray(n))return e.concat(n);return Bi.extend({},WEt(e),WEt(n))}function c4r(e,n){let A={};for(let i in e)if(!n.includes(i))Object.defineProperty(A,i,{enumerable:!0,get:()=>e[i]});return A}function u4r(e){let n=zAe(),A=zqe,i=e();if(eyt(),A)aYe(!1);let s=()=>{if(rYe(n),A)aYe(!0)},u=()=>{if(zAe()!==n)n.scope.off();if(eyt(),A)aYe(!1)};if(Bi.isPromise(i))i=i.catch((g)=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(u)),g});return[i,()=>{s(),Promise.resolve().then(u)}]}var kGn=!0;function l4r(e){let n=jGn(e),A=e.proxy,i=e.ctx;if(kGn=!1,n.beforeCreate)KzA(n.beforeCreate,e,"bc");let{data:s,computed:u,methods:g,watch:d,provide:f,inject:B,created:E,beforeMount:Q,mounted:w,beforeUpdate:S,updated:G,activated:q,deactivated:P,beforeDestroy:V,beforeUnmount:W,destroyed:z,unmounted:te,render:ie,renderTracked:ae,renderTriggered:Be,errorCaptured:xe,serverPrefetch:Re,expose:Oe,inheritAttrs:Ne,components:$e,directives:it,filters:Me}=n,bt=null;if(B)g4r(B,i,bt);if(g)for(let mt in g){let Xt=g[mt];if(Bi.isFunction(Xt))i[mt]=Xt.bind(A)}if(s){let mt=s.call(A,A);if(!Bi.isObject(mt));else e.data=Zl.reactive(mt)}if(kGn=!0,u)for(let mt in u){let Xt=u[mt],Ln=Bi.isFunction(Xt)?Xt.bind(A,A):Bi.isFunction(Xt.get)?Xt.get.bind(A,A):Bi.NOOP,Ft=!Bi.isFunction(Xt)&&Bi.isFunction(Xt.set)?Xt.set.bind(A):Bi.NOOP,nn=WWA({get:Ln,set:Ft});Object.defineProperty(i,mt,{enumerable:!0,configurable:!0,get:()=>nn.value,set:($n)=>nn.value=$n})}if(d)for(let mt in d)CWA(d[mt],i,A,mt);if(f){let mt=Bi.isFunction(f)?f.call(A):f;Reflect.ownKeys(mt).forEach((Xt)=>{WzA(Xt,mt[Xt])})}if(E)KzA(E,e,"c");function Rt(mt,Xt){if(Bi.isArray(Xt))Xt.forEach((Ln)=>mt(Ln.bind(A)));else if(Xt)mt(Xt.bind(A))}if(Rt(gWA,Q),Rt(b9t,w),Rt(pWA,S),Rt(TGn,G),Rt(cWA,q),Rt(uWA,P),Rt(hWA,xe),Rt(fWA,ae),Rt(dWA,Be),Rt(B9t,W),Rt(C9t,te),Rt(mWA,Re),Bi.isArray(Oe)){if(Oe.length){let mt=e.exposed||(e.exposed={});Oe.forEach((Xt)=>{Object.defineProperty(mt,Xt,{get:()=>A[Xt],set:(Ln)=>A[Xt]=Ln,enumerable:!0})})}else if(!e.exposed)e.exposed={}}if(ie&&e.render===Bi.NOOP)e.render=ie;if(Ne!=null)e.inheritAttrs=Ne;if($e)e.components=$e;if(it)e.directives=it;if(Re)qGn(e)}function g4r(e,n,A=Bi.NOOP){if(Bi.isArray(e))e=DGn(e);for(let i in e){let s=e[i],u;if(Bi.isObject(s))if("default"in s)u=HEt(s.from||i,s.default,!0);else u=HEt(s.from||i);else u=HEt(s);if(Zl.isRef(u))Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>u.value,set:(g)=>u.value=g});else n[i]=u}}function KzA(e,n,A){OAe(Bi.isArray(e)?e.map((i)=>i.bind(n.proxy)):e.bind(n.proxy),n,A)}function CWA(e,n,A,i){let s=i.includes(".")?eWA(A,i):()=>A[i];if(Bi.isString(e)){let u=n[e];if(Bi.isFunction(u))PEt(s,u)}else if(Bi.isFunction(e))PEt(s,e.bind(A));else if(Bi.isObject(e))if(Bi.isArray(e))e.forEach((u)=>CWA(u,n,A,i));else{let u=Bi.isFunction(e.handler)?e.handler.bind(A):n[e.handler];if(Bi.isFunction(u))PEt(s,u,e)}}function jGn(e){let n=e.type,{mixins:A,extends:i}=n,{mixins:s,optionsCache:u,config:{optionMergeStrategies:g}}=e.appContext,d=u.get(n),f;if(d)f=d;else if(!s.length&&!A&&!i)f=n;else{if(f={},s.length)s.forEach((B)=>c9t(f,B,g,!0));c9t(f,n,g)}if(Bi.isObject(n))u.set(n,f);return f}function c9t(e,n,A,i=!1){let{mixins:s,extends:u}=n;if(u)c9t(e,u,A,!0);if(s)s.forEach((g)=>c9t(e,g,A,!0));for(let g in n)if(i&&g==="expose");else{let d=p4r[g]||A&&A[g];e[g]=d?d(e[g],n[g]):n[g]}return e}var p4r={data:RzA,props:YzA,emits:YzA,methods:jEt,computed:jEt,beforeCreate:v7,created:v7,beforeMount:v7,mounted:v7,beforeUpdate:v7,updated:v7,beforeDestroy:v7,beforeUnmount:v7,destroyed:v7,unmounted:v7,activated:v7,deactivated:v7,errorCaptured:v7,serverPrefetch:v7,components:jEt,directives:jEt,watch:d4r,provide:RzA,inject:m4r};function RzA(e,n){if(!n)return e;if(!e)return n;return function(){return Bi.extend(Bi.isFunction(e)?e.call(this,this):e,Bi.isFunction(n)?n.call(this,this):n)}}function m4r(e,n){return jEt(DGn(e),DGn(n))}function DGn(e){if(Bi.isArray(e)){let n={};for(let A=0;A<e.length;A++)n[e[A]]=e[A];return n}return e}function v7(e,n){return e?[...new Set([].concat(e,n))]:n}function jEt(e,n){return e?Bi.extend(Object.create(null),e,n):n}function YzA(e,n){if(e){if(Bi.isArray(e)&&Bi.isArray(n))return[...new Set([...e,...n])];return Bi.extend(Object.create(null),WEt(e),WEt(n!=null?n:{}))}else return n}function d4r(e,n){if(!e)return n;if(!n)return e;let A=Bi.extend(Object.create(null),e);for(let i in n)A[i]=v7(e[i],n[i]);return A}function IWA(){return{app:null,config:{isNativeTag:Bi.NO,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}}var f4r=0;function h4r(e,n){return function(i,s=null){if(!Bi.isFunction(i))i=Bi.extend({},i);if(s!=null&&!Bi.isObject(s))s=null;let u=IWA(),g=new WeakSet,d=[],f=!1,B=u.app={_uid:f4r++,_component:i,_props:s,_container:null,_context:u,_instance:null,version:VWA,get config(){return u.config},set config(E){},use(E,...Q){if(g.has(E));else if(E&&Bi.isFunction(E.install))g.add(E),E.install(B,...Q);else if(Bi.isFunction(E))g.add(E),E(B,...Q);return B},mixin(E){if(!u.mixins.includes(E))u.mixins.push(E);return B},component(E,Q){if(!Q)return u.components[E];return u.components[E]=Q,B},directive(E,Q){if(!Q)return u.directives[E];return u.directives[E]=Q,B},mount(E,Q,w){if(!f){let S=B._ceVNode||pv(i,s);if(S.appContext=u,w===!0)w="svg";else if(w===!1)w=void 0;if(Q&&n)n(S,E);else e(S,E,w);return f=!0,B._container=E,E.__vue_app__=B,Ayt(S.component)}},onUnmount(E){d.push(E)},unmount(){if(f)OAe(d,B._instance,16),e(null,B._container),delete B._container.__vue_app__},provide(E,Q){return u.provides[E]=Q,B},runWithContext(E){let Q=Jqe;Jqe=B;try{return E()}finally{Jqe=Q}}};return B}}var Jqe=null;function b4r(e,n,A=Bi.EMPTY_OBJ){let i=zAe(),s=Bi.camelize(n),u=Bi.hyphenate(n),g=EWA(e,s),d=Zl.customRef((f,B)=>{let E,Q=Bi.EMPTY_OBJ,w;return XzA(()=>{let S=e[s];if(Bi.hasChanged(E,S))E=S,B()}),{get(){return f(),A.get?A.get(E):E},set(S){let G=A.set?A.set(S):S;if(!Bi.hasChanged(G,E)&&!(Q!==Bi.EMPTY_OBJ&&Bi.hasChanged(S,Q)))return;let q=i.vnode.props,P=!!(q&&((n in q)||(s in q)||(u in q))&&((`onUpdate:${n}`in q)||(`onUpdate:${s}`in q)||(`onUpdate:${u}`in q)));if(!P)E=S,B();if(i.emit(`update:${n}`,G),Bi.hasChanged(S,Q)&&(Bi.hasChanged(S,G)&&!Bi.hasChanged(G,w)||P&&Q!==Bi.EMPTY_OBJ&&!Bi.hasChanged(G,E)))B();Q=S,w=G}}});return d[Symbol.iterator]=()=>{let f=0;return{next(){if(f<2)return{value:f++?g||Bi.EMPTY_OBJ:d,done:!1};else return{done:!0}}}},d}var EWA=(e,n)=>{return n==="modelValue"||n==="model-value"?e.modelModifiers:e[`${n}Modifiers`]||e[`${Bi.camelize(n)}Modifiers`]||e[`${Bi.hyphenate(n)}Modifiers`]};function B4r(e,n,...A){if(e.isUnmounted)return;let i=e.vnode.props||Bi.EMPTY_OBJ,s=A,u=n.startsWith("update:"),g=u&&EWA(i,n.slice(7));if(g){if(g.trim)s=A.map((E)=>Bi.isString(E)?E.trim():E);if(g.number)s=A.map(Bi.looseToNumber)}let d,f=i[d=Bi.toHandlerKey(n)]||i[d=Bi.toHandlerKey(Bi.camelize(n))];if(!f&&u)f=i[d=Bi.toHandlerKey(Bi.hyphenate(n))];if(f)OAe(f,e,6,s);let B=i[d+"Once"];if(B){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,OAe(B,e,6,s)}}var C4r=new WeakMap;function yWA(e,n,A=!1){let i=A?C4r:n.emitsCache,s=i.get(e);if(s!==void 0)return s;let u=e.emits,g={},d=!1;if(!Bi.isFunction(e)){let f=(B)=>{let E=yWA(B,n,!0);if(E)d=!0,Bi.extend(g,E)};if(!A&&n.mixins.length)n.mixins.forEach(f);if(e.extends)f(e.extends);if(e.mixins)e.mixins.forEach(f)}if(!u&&!d){if(Bi.isObject(e))i.set(e,null);return null}if(Bi.isArray(u))u.forEach((f)=>g[f]=null);else Bi.extend(g,u);if(Bi.isObject(e))i.set(e,g);return g}function I9t(e,n){if(!e||!Bi.isOn(n))return!1;return n=n.slice(2),n=n==="Once"?n:n.replace(/Once$/,""),Bi.hasOwn(e,n[0].toLowerCase()+n.slice(1))||Bi.hasOwn(e,Bi.hyphenate(n))||Bi.hasOwn(e,n)}function t9t(e){let{type:n,vnode:A,proxy:i,withProxy:s,propsOptions:[u],slots:g,attrs:d,emit:f,render:B,renderCache:E,props:Q,data:w,setupState:S,ctx:G,inheritAttrs:q}=e,P=zEt(e),V,W;try{if(A.shapeFlag&4){let te=s||i,ie=te;V=QR(B.call(ie,te,E,Q,S,w,G)),W=d}else{let te=n;V=QR(te.length>1?te(Q,{attrs:d,slots:g,emit:f}):te(Q,null)),W=n.props?d:E4r(d)}}catch(te){$Et.length=0,Wqe(te,e,1),V=pv(x4)}let z=V;if(W&&q!==!1){let te=Object.keys(W),{shapeFlag:ie}=z;if(te.length){if(ie&7){if(u&&te.some(Bi.isModelListener))W=y4r(W,u);z=Yie(z,W,!1,!0)}}}if(A.dirs)z=Yie(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(A.dirs):A.dirs;if(A.transition)$qe(z,A.transition);return V=z,zEt(P),V}function I4r(e,n=!0){let A;for(let i=0;i<e.length;i++){let s=e[i];if(lCe(s)){if(s.type!==x4||s.children==="v-if")if(A)return;else A=s}else return}return A}var E4r=(e)=>{let n;for(let A in e)if(A==="class"||A==="style"||Bi.isOn(A))(n||(n={}))[A]=e[A];return n},y4r=(e,n)=>{let A={};for(let i in e)if(!Bi.isModelListener(i)||!(i.slice(9)in n))A[i]=e[i];return A};function Q4r(e,n,A){let{props:i,children:s,component:u}=e,{props:g,children:d,patchFlag:f}=n,B=u.emitsOptions;if(n.dirs||n.transition)return!0;if(A&&f>=0){if(f&1024)return!0;if(f&16){if(!i)return!!g;return jzA(i,g,B)}else if(f&8){let E=n.dynamicProps;for(let Q=0;Q<E.length;Q++){let w=E[Q];if(QWA(g,i,w)&&!I9t(B,w))return!0}}}else{if(s||d){if(!d||!d.$stable)return!0}if(i===g)return!1;if(!i)return!!g;if(!g)return!0;return jzA(i,g,B)}return!1}function jzA(e,n,A){let i=Object.keys(n);if(i.length!==Object.keys(e).length)return!0;for(let s=0;s<i.length;s++){let u=i[s];if(QWA(n,e,u)&&!I9t(A,u))return!0}return!1}function QWA(e,n,A){let i=e[A],s=n[A];if(A==="style"&&Bi.isObject(i)&&Bi.isObject(s))return!Bi.looseEqual(i,s);return i!==s}function E9t({vnode:e,parent:n,suspense:A},i){while(n){let s=n.subTree;if(s.suspense&&s.suspense.activeBranch===e)s.suspense.vnode.el=s.el=i,e=s;if(s===e)(e=n.vnode).el=i,n=n.parent;else break}if(A&&A.activeBranch===e)A.vnode.el=i}var _WA={},wWA=()=>Object.create(_WA),kWA=(e)=>Object.getPrototypeOf(e)===_WA;function _4r(e,n,A,i=!1){let s={},u=wWA();e.propsDefaults=Object.create(null),DWA(e,n,s,u);for(let g in e.propsOptions[0])if(!(g in s))s[g]=void 0;if(A)e.props=i?s:Zl.shallowReactive(s);else if(!e.type.props)e.props=u;else e.props=s;e.attrs=u}function w4r(e,n,A,i){let{props:s,attrs:u,vnode:{patchFlag:g}}=e,d=Zl.toRaw(s),[f]=e.propsOptions,B=!1;if((i||g>0)&&!(g&16)){if(g&8){let E=e.vnode.dynamicProps;for(let Q=0;Q<E.length;Q++){let w=E[Q];if(I9t(e.emitsOptions,w))continue;let S=n[w];if(f)if(Bi.hasOwn(u,w)){if(S!==u[w])u[w]=S,B=!0}else{let G=Bi.camelize(w);s[G]=xGn(f,d,G,S,e,!1)}else if(S!==u[w])u[w]=S,B=!0}}}else{if(DWA(e,n,s,u))B=!0;let E;for(let Q in d)if(!n||!Bi.hasOwn(n,Q)&&((E=Bi.hyphenate(Q))===Q||!Bi.hasOwn(n,E)))if(f){if(A&&(A[Q]!==void 0||A[E]!==void 0))s[Q]=xGn(f,d,Q,void 0,e,!0)}else delete s[Q];if(u!==d){for(let Q in u)if(!n||!Bi.hasOwn(n,Q)&&!0)delete u[Q],B=!0}}if(B)Zl.trigger(e.attrs,"set","")}function DWA(e,n,A,i){let[s,u]=e.propsOptions,g=!1,d;if(n)for(let f in n){if(Bi.isReservedProp(f))continue;let B=n[f],E;if(s&&Bi.hasOwn(s,E=Bi.camelize(f)))if(!u||!u.includes(E))A[E]=B;else(d||(d={}))[E]=B;else if(!I9t(e.emitsOptions,f)){if(!(f in i)||B!==i[f])i[f]=B,g=!0}}if(u){let f=Zl.toRaw(A),B=d||Bi.EMPTY_OBJ;for(let E=0;E<u.length;E++){let Q=u[E];A[Q]=xGn(s,f,Q,B[Q],e,!Bi.hasOwn(B,Q))}}return g}function xGn(e,n,A,i,s,u){let g=e[A];if(g!=null){let d=Bi.hasOwn(g,"default");if(d&&i===void 0){let f=g.default;if(g.type!==Function&&!g.skipFactory&&Bi.isFunction(f)){let{propsDefaults:B}=s;if(A in B)i=B[A];else{let E=rYe(s);i=B[A]=f.call(null,n),E()}}else i=f;if(s.ce)s.ce._setProp(A,i)}if(g[0]){if(u&&!d)i=!1;else if(g[1]&&(i===""||i===Bi.hyphenate(A)))i=!0}}return i}var k4r=new WeakMap;function xWA(e,n,A=!1){let i=A?k4r:n.propsCache,s=i.get(e);if(s)return s;let u=e.props,g={},d=[],f=!1;if(!Bi.isFunction(e)){let E=(Q)=>{f=!0;let[w,S]=xWA(Q,n,!0);if(Bi.extend(g,w),S)d.push(...S)};if(!A&&n.mixins.length)n.mixins.forEach(E);if(e.extends)E(e.extends);if(e.mixins)e.mixins.forEach(E)}if(!u&&!f){if(Bi.isObject(e))i.set(e,Bi.EMPTY_ARR);return Bi.EMPTY_ARR}if(Bi.isArray(u))for(let E=0;E<u.length;E++){let Q=Bi.camelize(u[E]);if(HzA(Q))g[Q]=Bi.EMPTY_OBJ}else if(u)for(let E in u){let Q=Bi.camelize(E);if(HzA(Q)){let w=u[E],S=g[Q]=Bi.isArray(w)||Bi.isFunction(w)?{type:w}:Bi.extend({},w),G=S.type,q=!1,P=!0;if(Bi.isArray(G))for(let V=0;V<G.length;++V){let W=G[V],z=Bi.isFunction(W)&&W.name;if(z==="Boolean"){q=!0;break}else if(z==="String")P=!1}else q=Bi.isFunction(G)&&G.name==="Boolean";if(S[0]=q,S[1]=P,q||Bi.hasOwn(S,"default"))d.push(Q)}}let B=[g,d];if(Bi.isObject(e))i.set(e,B);return B}function HzA(e){if(e[0]!=="$"&&!Bi.isReservedProp(e))return!0;return!1}var HGn=(e)=>e==="_"||e==="_ctx"||e==="$stable",PGn=(e)=>Bi.isArray(e)?e.map(QR):[QR(e)],D4r=(e,n,A)=>{if(n._n)return n;let i=MGn((...s)=>{return PGn(n(...s))},A);return i._c=!1,i},FWA=(e,n,A)=>{let i=e._ctx;for(let s in e){if(HGn(s))continue;let u=e[s];if(Bi.isFunction(u))n[s]=D4r(s,u,i);else if(u!=null){let g=PGn(u);n[s]=()=>g}}},vWA=(e,n)=>{let A=PGn(n);e.slots.default=()=>A},SWA=(e,n,A)=>{for(let i in n)if(A||!HGn(i))e[i]=n[i]},x4r=(e,n,A)=>{let i=e.slots=wWA();if(e.vnode.shapeFlag&32){let s=n._;if(s){if(SWA(i,n,A),A)Bi.def(i,"_",s,!0)}else FWA(n,i)}else if(n)vWA(e,n)},F4r=(e,n,A)=>{let{vnode:i,slots:s}=e,u=!0,g=Bi.EMPTY_OBJ;if(i.shapeFlag&32){let d=n._;if(d)if(A&&d===1)u=!1;else SWA(s,n,A);else u=!n.$stable,FWA(n,s);g=n}else if(n)vWA(e,n),g={default:1};if(u){for(let d in s)if(!HGn(d)&&g[d]==null)delete s[d]}},p8=UWA;function v4r(e){return NWA(e)}function S4r(e){return NWA(e,wSr)}function NWA(e,n){let A=Bi.getGlobalThis();A.__VUE__=!0;let{insert:i,remove:s,patchProp:u,createElement:g,createText:d,createComment:f,setText:B,setElementText:E,parentNode:Q,nextSibling:w,setScopeId:S=Bi.NOOP,insertStaticContent:G}=e,q=(Te,Nn,jt,rA=null,fA=null,gn=null,zA=void 0,la=null,$a=!!Nn.dynamicChildren)=>{if(Te===Nn)return;if(Te&&!$Ae(Te,Nn))rA=mA(Te),$n(Te,fA,gn,!0),Te=null;if(Nn.patchFlag===-2)$a=!1,Nn.dynamicChildren=null;let{type:ei,ref:Oi,shapeFlag:zi}=Nn;switch(ei){case Fye:P(Te,Nn,jt,rA);break;case x4:V(Te,Nn,jt,rA);break;case AYe:if(Te==null)W(Nn,jt,rA,zA);break;case WL:$e(Te,Nn,jt,rA,fA,gn,zA,la,$a);break;default:if(zi&1)ie(Te,Nn,jt,rA,fA,gn,zA,la,$a);else if(zi&6)it(Te,Nn,jt,rA,fA,gn,zA,la,$a);else if(zi&64)ei.process(Te,Nn,jt,rA,fA,gn,zA,la,$a,Tn);else if(zi&128)ei.process(Te,Nn,jt,rA,fA,gn,zA,la,$a,Tn)}if(Oi!=null&&fA)tYe(Oi,Te&&Te.ref,gn,Nn||Te,!Nn);else if(Oi==null&&Te&&Te.ref!=null)tYe(Te.ref,null,gn,Te,!0)},P=(Te,Nn,jt,rA)=>{if(Te==null)i(Nn.el=d(Nn.children),jt,rA);else{let fA=Nn.el=Te.el;if(Nn.children!==Te.children)B(fA,Nn.children)}},V=(Te,Nn,jt,rA)=>{if(Te==null)i(Nn.el=f(Nn.children||""),jt,rA);else Nn.el=Te.el},W=(Te,Nn,jt,rA)=>{[Te.el,Te.anchor]=G(Te.children,Nn,jt,rA,Te.el,Te.anchor)},z=({el:Te,anchor:Nn},jt,rA)=>{let fA;while(Te&&Te!==Nn)fA=w(Te),i(Te,jt,rA),Te=fA;i(Nn,jt,rA)},te=({el:Te,anchor:Nn})=>{let jt;while(Te&&Te!==Nn)jt=w(Te),s(Te),Te=jt;s(Nn)},ie=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{if(Nn.type==="svg")zA="svg";else if(Nn.type==="math")zA="mathml";if(Te==null)ae(Nn,jt,rA,fA,gn,zA,la,$a);else{let ei=Te.el&&Te.el._isVueCE?Te.el:null;try{if(ei)ei._beginPatch();Re(Te,Nn,fA,gn,zA,la,$a)}finally{if(ei)ei._endPatch()}}},ae=(Te,Nn,jt,rA,fA,gn,zA,la)=>{let $a,ei,{props:Oi,shapeFlag:zi,transition:Ei,dirs:GA}=Te;if($a=Te.el=g(Te.type,gn,Oi&&Oi.is,Oi),zi&8)E($a,Te.children);else if(zi&16)xe(Te.children,$a,null,rA,fA,EGn(Te,gn),zA,la);if(GA)Rie(Te,null,rA,"created");if(Be($a,Te,Te.scopeId,zA,rA),Oi){for(let tt in Oi)if(tt!=="value"&&!Bi.isReservedProp(tt))u($a,tt,null,Oi[tt],gn,rA);if("value"in Oi)u($a,"value",null,Oi.value,gn);if(ei=Oi.onVnodeBeforeMount)yR(ei,rA,Te)}if(GA)Rie(Te,null,rA,"beforeMount");let _t=GWA(fA,Ei);if(_t)Ei.beforeEnter($a);if(i($a,Nn,jt),(ei=Oi&&Oi.onVnodeMounted)||_t||GA)p8(()=>{try{ei&&yR(ei,rA,Te),_t&&Ei.enter($a),GA&&Rie(Te,null,rA,"mounted")}finally{}},fA)},Be=(Te,Nn,jt,rA,fA)=>{if(jt)S(Te,jt);if(rA)for(let gn=0;gn<rA.length;gn++)S(Te,rA[gn]);if(fA){let gn=fA.subTree;if(Nn===gn||l9t(gn.type)&&(gn.ssContent===Nn||gn.ssFallback===Nn)){let zA=fA.vnode;Be(Te,zA,zA.scopeId,zA.slotScopeIds,fA.parent)}}},xe=(Te,Nn,jt,rA,fA,gn,zA,la,$a=0)=>{for(let ei=$a;ei<Te.length;ei++){let Oi=Te[ei]=la?cCe(Te[ei]):QR(Te[ei]);q(null,Oi,Nn,jt,rA,fA,gn,zA,la)}},Re=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=Nn.el=Te.el,{patchFlag:$a,dynamicChildren:ei,dirs:Oi}=Nn;$a|=Te.patchFlag&16;let zi=Te.props||Bi.EMPTY_OBJ,Ei=Nn.props||Bi.EMPTY_OBJ,GA;if(jt&&Hqe(jt,!1),GA=Ei.onVnodeBeforeUpdate)yR(GA,jt,Nn,Te);if(Oi)Rie(Nn,Te,jt,"beforeUpdate");if(jt&&Hqe(jt,!0),ei&&(!Te.dynamicChildren||Te.dynamicChildren.length!==ei.length))$a=0,zA=!1,ei=null;if(zi.innerHTML&&Ei.innerHTML==null||zi.textContent&&Ei.textContent==null)E(la,"");if(ei)Oe(Te.dynamicChildren,ei,la,jt,rA,EGn(Nn,fA),gn);else if(!zA)Xt(Te,Nn,la,null,jt,rA,EGn(Nn,fA),gn,!1);if($a>0){if($a&16)Ne(la,zi,Ei,jt,fA);else{if($a&2){if(zi.class!==Ei.class)u(la,"class",null,Ei.class,fA)}if($a&4)u(la,"style",zi.style,Ei.style,fA);if($a&8){let _t=Nn.dynamicProps;for(let tt=0;tt<_t.length;tt++){let Ot=_t[tt],Xn=zi[Ot],hn=Ei[Ot];if(hn!==Xn||Ot==="value")u(la,Ot,Xn,hn,fA,jt)}}}if($a&1){if(Te.children!==Nn.children)E(la,Nn.children)}}else if(!zA&&ei==null)Ne(la,zi,Ei,jt,fA);if((GA=Ei.onVnodeUpdated)||Oi)p8(()=>{GA&&yR(GA,jt,Nn,Te),Oi&&Rie(Nn,Te,jt,"updated")},rA)},Oe=(Te,Nn,jt,rA,fA,gn,zA)=>{for(let la=0;la<Nn.length;la++){let $a=Te[la],ei=Nn[la],Oi=$a.el&&($a.type===WL||!$Ae($a,ei)||$a.shapeFlag&198)?Q($a.el):jt;q($a,ei,Oi,null,rA,fA,gn,zA,!0)}},Ne=(Te,Nn,jt,rA,fA)=>{if(Nn!==jt){if(Nn!==Bi.EMPTY_OBJ){for(let gn in Nn)if(!Bi.isReservedProp(gn)&&!(gn in jt))u(Te,gn,Nn[gn],null,fA,rA)}for(let gn in jt){if(Bi.isReservedProp(gn))continue;let zA=jt[gn],la=Nn[gn];if(zA!==la&&gn!=="value")u(Te,gn,la,zA,fA,rA)}if("value"in jt)u(Te,"value",Nn.value,jt.value,fA)}},$e=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{let ei=Nn.el=Te?Te.el:d(""),Oi=Nn.anchor=Te?Te.anchor:d(""),{patchFlag:zi,dynamicChildren:Ei,slotScopeIds:GA}=Nn;if(GA)la=la?la.concat(GA):GA;if(Te==null)i(ei,jt,rA),i(Oi,jt,rA),xe(Nn.children||[],jt,Oi,fA,gn,zA,la,$a);else if(zi>0&&zi&64&&Ei&&Te.dynamicChildren&&Te.dynamicChildren.length===Ei.length){if(Oe(Te.dynamicChildren,Ei,jt,fA,gn,zA,la),Nn.key!=null||fA&&Nn===fA.subTree)JGn(Te,Nn,!0)}else Xt(Te,Nn,jt,Oi,fA,gn,zA,la,$a)},it=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{if(Nn.slotScopeIds=la,Te==null)if(Nn.shapeFlag&512)fA.ctx.activate(Nn,jt,rA,zA,$a);else Me(Nn,jt,rA,fA,gn,zA,$a);else bt(Te,Nn,$a)},Me=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=Te.component=PWA(Te,rA,fA);if(nyt(Te))la.ctx.renderer=Tn;if($WA(la,!1,zA),la.asyncDep){if(fA&&fA.registerDep(la,Rt,zA),!Te.el){let $a=la.subTree=pv(x4);V(null,$a,Nn,jt),Te.placeholder=$a.el}}else Rt(la,Te,Nn,jt,fA,gn,zA)},bt=(Te,Nn,jt)=>{let rA=Nn.component=Te.component;if(Q4r(Te,Nn,jt))if(rA.asyncDep&&!rA.asyncResolved){mt(rA,Nn,jt);return}else rA.next=Nn,rA.update();else Nn.el=Te.el,rA.vnode=Nn},Rt=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=()=>{if(!Te.isMounted){let zi,{el:Ei,props:GA}=Nn,{bm:_t,m:tt,parent:Ot,root:Xn,type:hn}=Te,RA=uCe(Nn);if(Hqe(Te,!1),_t)Bi.invokeArrayFns(_t);if(!RA&&(zi=GA&&GA.onVnodeBeforeMount))yR(zi,Ot,Nn);if(Hqe(Te,!0),Ei&&ja){let ea=()=>{Te.subTree=t9t(Te),ja(Ei,Te.subTree,Te,fA,null)};if(RA&&hn.__asyncHydrate)hn.__asyncHydrate(Ei,Te,ea);else ea()}else{if(Xn.ce&&Xn.ce._hasShadowRoot())Xn.ce._injectChildStyle(hn,Te.parent?Te.parent.type:void 0);let ea=Te.subTree=t9t(Te);q(null,ea,jt,rA,Te,fA,gn),Nn.el=ea.el}if(tt)p8(tt,fA);if(!RA&&(zi=GA&&GA.onVnodeMounted)){let ea=Nn;p8(()=>yR(zi,Ot,ea),fA)}if(Nn.shapeFlag&256||Ot&&uCe(Ot.vnode)&&Ot.vnode.shapeFlag&256)Te.a&&p8(Te.a,fA);Te.isMounted=!0,Nn=jt=rA=null}else{let{next:zi,bu:Ei,u:GA,parent:_t,vnode:tt}=Te;{let ea=MWA(Te);if(ea){if(zi)zi.el=tt.el,mt(Te,zi,zA);ea.asyncDep.then(()=>{p8(()=>{if(!Te.isUnmounted)ei()},fA)});return}}let Ot=zi,Xn;if(Hqe(Te,!1),zi)zi.el=tt.el,mt(Te,zi,zA);else zi=tt;if(Ei)Bi.invokeArrayFns(Ei);if(Xn=zi.props&&zi.props.onVnodeBeforeUpdate)yR(Xn,_t,zi,tt);Hqe(Te,!0);let hn=t9t(Te),RA=Te.subTree;if(Te.subTree=hn,q(RA,hn,Q(RA.el),mA(RA),Te,fA,gn),zi.el=hn.el,Ot===null)E9t(Te,hn.el);if(GA)p8(GA,fA);if(Xn=zi.props&&zi.props.onVnodeUpdated)p8(()=>yR(Xn,_t,zi,tt),fA)}};Te.scope.on();let $a=Te.effect=new Zl.ReactiveEffect(la);Te.scope.off();let ei=Te.update=$a.run.bind($a),Oi=Te.job=$a.runIfDirty.bind($a);Oi.i=Te,Oi.id=Te.uid,$a.scheduler=()=>GGn(Oi),Hqe(Te,!0),ei()},mt=(Te,Nn,jt)=>{Nn.component=Te;let rA=Te.vnode.props;Te.vnode=Nn,Te.next=null,w4r(Te,Nn.props,rA,jt),F4r(Te,Nn.children,jt),Zl.pauseTracking(),SzA(Te),Zl.resetTracking()},Xt=(Te,Nn,jt,rA,fA,gn,zA,la,$a=!1)=>{let ei=Te&&Te.children,Oi=Te?Te.shapeFlag:0,zi=Nn.children,{patchFlag:Ei,shapeFlag:GA}=Nn;if(Ei>0){if(Ei&128){Ft(ei,zi,jt,rA,fA,gn,zA,la,$a);return}else if(Ei&256){Ln(ei,zi,jt,rA,fA,gn,zA,la,$a);return}}if(GA&8){if(Oi&16)un(ei,fA,gn);if(zi!==ei)E(jt,zi)}else if(Oi&16)if(GA&16)Ft(ei,zi,jt,rA,fA,gn,zA,la,$a);else un(ei,fA,gn,!0);else{if(Oi&8)E(jt,"");if(GA&16)xe(zi,jt,rA,fA,gn,zA,la,$a)}},Ln=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{Te=Te||Bi.EMPTY_ARR,Nn=Nn||Bi.EMPTY_ARR;let ei=Te.length,Oi=Nn.length,zi=Math.min(ei,Oi),Ei;for(Ei=0;Ei<zi;Ei++){let GA=Nn[Ei]=$a?cCe(Nn[Ei]):QR(Nn[Ei]);q(Te[Ei],GA,jt,null,fA,gn,zA,la,$a)}if(ei>Oi)un(Te,fA,gn,!0,!1,zi);else xe(Nn,jt,rA,fA,gn,zA,la,$a,zi)},Ft=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{let ei=0,Oi=Nn.length,zi=Te.length-1,Ei=Oi-1;while(ei<=zi&&ei<=Ei){let GA=Te[ei],_t=Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]);if($Ae(GA,_t))q(GA,_t,jt,null,fA,gn,zA,la,$a);else break;ei++}while(ei<=zi&&ei<=Ei){let GA=Te[zi],_t=Nn[Ei]=$a?cCe(Nn[Ei]):QR(Nn[Ei]);if($Ae(GA,_t))q(GA,_t,jt,null,fA,gn,zA,la,$a);else break;zi--,Ei--}if(ei>zi){if(ei<=Ei){let GA=Ei+1,_t=GA<Oi?Nn[GA].el:rA;while(ei<=Ei)q(null,Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]),jt,_t,fA,gn,zA,la,$a),ei++}}else if(ei>Ei)while(ei<=zi)$n(Te[ei],fA,gn,!0),ei++;else{let GA=ei,_t=ei,tt=new Map;for(ei=_t;ei<=Ei;ei++){let Io=Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]);if(Io.key!=null)tt.set(Io.key,ei)}let Ot,Xn=0,hn=Ei-_t+1,RA=!1,ea=0,Wi=Array(hn);for(ei=0;ei<hn;ei++)Wi[ei]=0;for(ei=GA;ei<=zi;ei++){let Io=Te[ei];if(Xn>=hn){$n(Io,fA,gn,!0);continue}let Xo;if(Io.key!=null)Xo=tt.get(Io.key);else for(Ot=_t;Ot<=Ei;Ot++)if(Wi[Ot-_t]===0&&$Ae(Io,Nn[Ot])){Xo=Ot;break}if(Xo===void 0)$n(Io,fA,gn,!0);else{if(Wi[Xo-_t]=ei+1,Xo>=ea)ea=Xo;else RA=!0;q(Io,Nn[Xo],jt,null,fA,gn,zA,la,$a),Xn++}}let Ti=RA?N4r(Wi):Bi.EMPTY_ARR;Ot=Ti.length-1;for(ei=hn-1;ei>=0;ei--){let Io=_t+ei,Xo=Nn[Io],eu=Nn[Io+1],hc=Io+1<Oi?eu.el||LWA(eu):rA;if(Wi[ei]===0)q(null,Xo,jt,hc,fA,gn,zA,la,$a);else if(RA)if(Ot<0||ei!==Ti[Ot])nn(Xo,jt,hc,2);else Ot--}}},nn=(Te,Nn,jt,rA,fA=null)=>{let{el:gn,type:zA,transition:la,children:$a,shapeFlag:ei}=Te;if(ei&6){nn(Te.component.subTree,Nn,jt,rA);return}if(ei&128){Te.suspense.move(Nn,jt,rA);return}if(ei&64){zA.move(Te,Nn,jt,Tn);return}if(zA===WL){i(gn,Nn,jt);for(let zi=0;zi<$a.length;zi++)nn($a[zi],Nn,jt,rA);i(Te.anchor,Nn,jt);return}if(zA===AYe){z(Te,Nn,jt);return}if(rA!==2&&ei&1&&la)if(rA===0)if(la.persisted&&!gn[bz])i(gn,Nn,jt);else la.beforeEnter(gn),i(gn,Nn,jt),p8(()=>la.enter(gn),fA);else{let{leave:zi,delayLeave:Ei,afterLeave:GA}=la,_t=()=>{if(Te.ctx.isUnmounted)s(gn);else i(gn,Nn,jt)},tt=()=>{let Ot=gn._isLeaving||!!gn[bz];if(gn._isLeaving)gn[bz](!0);if(la.persisted&&!Ot)_t();else zi(gn,()=>{_t(),GA&&GA()})};if(Ei)Ei(gn,_t,tt);else tt()}else i(gn,Nn,jt)},$n=(Te,Nn,jt,rA=!1,fA=!1)=>{let{type:gn,props:zA,ref:la,children:$a,dynamicChildren:ei,shapeFlag:Oi,patchFlag:zi,dirs:Ei,cacheIndex:GA,memo:_t}=Te;if(zi===-2)fA=!1;if(la!=null)Zl.pauseTracking(),tYe(la,null,jt,Te,!0),Zl.resetTracking();if(GA!=null)Nn.renderCache[GA]=void 0;if(Oi&256){Nn.ctx.deactivate(Te);return}let tt=Oi&1&&Ei,Ot=!uCe(Te),Xn;if(Ot&&(Xn=zA&&zA.onVnodeBeforeUnmount))yR(Xn,Nn,Te);if(Oi&6)JA(Te.component,jt,rA);else{if(Oi&128){Te.suspense.unmount(jt,rA);return}if(tt)Rie(Te,null,Nn,"beforeUnmount");if(Oi&64)Te.type.remove(Te,Nn,jt,Tn,rA);else if(ei&&!ei.hasOnce&&(gn!==WL||zi>0&&zi&64))un(ei,Nn,jt,!1,!0);else if(gn===WL&&zi&384||!fA&&Oi&16)un($a,Nn,jt);if(rA)Ht(Te)}let hn=_t!=null&&GA==null;if(Ot&&(Xn=zA&&zA.onVnodeUnmounted)||tt||hn)p8(()=>{if(Xn&&yR(Xn,Nn,Te),tt&&Rie(Te,null,Nn,"unmounted"),hn)Te.el=null},jt)},Ht=(Te)=>{let{type:Nn,el:jt,anchor:rA,transition:fA}=Te;if(Nn===WL){tA(jt,rA);return}if(Nn===AYe){te(Te);return}let gn=()=>{if(s(jt),fA&&!fA.persisted&&fA.afterLeave)fA.afterLeave()};if(Te.shapeFlag&1&&fA&&!fA.persisted){let{leave:zA,delayLeave:la}=fA,$a=()=>zA(jt,gn);if(la)la(Te.el,gn,$a);else $a()}else gn()},tA=(Te,Nn)=>{let jt;while(Te!==Nn)jt=w(Te),s(Te),Te=jt;s(Nn)},JA=(Te,Nn,jt)=>{let{bum:rA,scope:fA,job:gn,subTree:zA,um:la,m:$a,a:ei}=Te;if(u9t($a),u9t(ei),rA)Bi.invokeArrayFns(rA);if(fA.stop(),gn)gn.flags|=8,$n(zA,Te,Nn,jt);if(la)p8(la,Nn);p8(()=>{Te.isUnmounted=!0},Nn)},un=(Te,Nn,jt,rA=!1,fA=!1,gn=0)=>{for(let zA=gn;zA<Te.length;zA++)$n(Te[zA],Nn,jt,rA,fA)},mA=(Te)=>{if(Te.shapeFlag&6)return mA(Te.component.subTree);if(Te.shapeFlag&128)return Te.suspense.next();let Nn=w(Te.anchor||Te.el),jt=Nn&&Nn[tWA];return jt?w(jt):Nn},cA=!1,vn=(Te,Nn,jt)=>{let rA;if(Te==null){if(Nn._vnode)$n(Nn._vnode,null,null,!0),rA=Nn._vnode.component}else q(Nn._vnode||null,Te,Nn,null,null,null,jt);if(Nn._vnode=Te,!cA)cA=!0,SzA(rA),i9t(),cA=!1},Tn={p:q,um:$n,m:nn,r:Ht,mt:Me,mc:xe,pc:Xt,pbc:Oe,n:mA,o:e},Cn,ja;if(n)[Cn,ja]=n(Tn);return{render:vn,hydrate:Cn,createApp:h4r(vn,Cn)}}function EGn({type:e,props:n},A){return A==="svg"&&e==="foreignObject"||A==="mathml"&&e==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:A}function Hqe({effect:e,job:n},A){if(A)e.flags|=32,n.flags|=4;else e.flags&=-33,n.flags&=-5}function GWA(e,n){return(!e||e&&!e.pendingBranch)&&n&&!n.persisted}function JGn(e,n,A=!1){let i=e.children,s=n.children;if(Bi.isArray(i)&&Bi.isArray(s))for(let u=0;u<i.length;u++){let g=i[u],d=s[u];if(d.shapeFlag&1&&!d.dynamicChildren){if(d.patchFlag<=0||d.patchFlag===32)d=s[u]=cCe(s[u]),d.el=g.el;if(!A&&d.patchFlag!==-2)JGn(g,d)}if(d.type===Fye){if(d.patchFlag===-1)d=s[u]=cCe(d);d.el=g.el}if(d.type===x4&&!d.el)d.el=g.el}}function N4r(e){let n=e.slice(),A=[0],i,s,u,g,d,f=e.length;for(i=0;i<f;i++){let B=e[i];if(B!==0){if(s=A[A.length-1],e[s]<B){n[i]=s,A.push(i);continue}u=0,g=A.length-1;while(u<g)if(d=u+g>>1,e[A[d]]<B)u=d+1;else g=d;if(B<e[A[u]]){if(u>0)n[i]=A[u-1];A[u]=i}}}u=A.length,g=A[u-1];while(u-- >0)A[u]=g,g=n[g];return A}function MWA(e){let n=e.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return MWA(n)}function u9t(e){if(e)for(let n=0;n<e.length;n++)e[n].flags|=8}function LWA(e){if(e.placeholder)return e.placeholder;let n=e.component;if(n)return LWA(n.subTree);return null}var l9t=(e)=>e.__isSuspense,FGn=0,G4r={name:"Suspense",__isSuspense:!0,process(e,n,A,i,s,u,g,d,f,B){if(e==null)L4r(n,A,i,s,u,g,d,f,B);else{if(u&&u.deps>0&&!e.suspense.isInFallback){n.suspense=e.suspense,n.suspense.vnode=n,n.el=e.el;return}q4r(e,n,A,i,s,g,d,f,B)}},hydrate:U4r,normalize:T4r},M4r=G4r;function ZEt(e,n){let A=e.props&&e.props[n];if(Bi.isFunction(A))A()}function L4r(e,n,A,i,s,u,g,d,f){let{p:B,o:{createElement:E}}=f,Q=E("div"),w=e.suspense=qWA(e,s,i,n,Q,A,u,g,d,f);if(B(null,w.pendingBranch=e.ssContent,Q,null,i,w,u,g),w.deps>0)ZEt(e,"onPending"),ZEt(e,"onFallback"),B(null,e.ssFallback,n,A,i,null,u,g),nYe(w,e.ssFallback);else w.resolve(!1,!0)}function q4r(e,n,A,i,s,u,g,d,{p:f,um:B,o:{createElement:E}}){let Q=n.suspense=e.suspense;Q.vnode=n,n.el=e.el;let{ssContent:w,ssFallback:S}=n,{activeBranch:G,pendingBranch:q,isInFallback:P,isHydrating:V}=Q;if(q)if(Q.pendingBranch=w,$Ae(q,w)){if(f(q,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else if(P){if(!V)f(G,S,A,i,s,null,u,g,d),nYe(Q,S)}}else{if(Q.pendingId=FGn++,V)Q.isHydrating=!1,Q.activeBranch=q;else B(q,s,Q);if(Q.deps=0,Q.effects.length=0,Q.hiddenContainer=E("div"),P)if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else f(G,S,A,i,s,null,u,g,d),nYe(Q,S);else if(G&&$Ae(G,w))f(G,w,A,i,s,Q,u,g,d),Q.resolve(!0);else if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve()}else if(G&&$Ae(G,w))f(G,w,A,i,s,Q,u,g,d),nYe(Q,w);else{if(ZEt(n,"onPending"),Q.pendingBranch=w,w.shapeFlag&512)Q.pendingId=w.component.suspenseId;else Q.pendingId=FGn++;if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else{let{timeout:W,pendingId:z}=Q;if(W>0)setTimeout(()=>{if(Q.pendingId===z)Q.fallback(S)},W);else if(W===0)Q.fallback(S)}}}function qWA(e,n,A,i,s,u,g,d,f,B,E=!1){let{p:Q,m:w,um:S,n:G,o:{parentNode:q,remove:P}}=B,V,W=K4r(e);if(W){if(n&&n.pendingBranch)V=n.pendingId,n.deps++}let z=e.props?Bi.toNumber(e.props.timeout):void 0,te=u,ie={vnode:e,parent:n,parentComponent:A,namespace:g,container:i,hiddenContainer:s,deps:0,pendingId:FGn++,timeout:typeof z==="number"?z:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!E,isHydrating:E,isUnmounted:!1,effects:[],resolve(ae=!1,Be=!1){let{vnode:xe,activeBranch:Re,pendingBranch:Oe,pendingId:Ne,effects:$e,parentComponent:it,container:Me,isInFallback:bt}=ie,Rt=!1;if(ie.isHydrating)ie.isHydrating=!1;else if(!ae){Rt=Re&&Oe.transition&&Oe.transition.mode==="out-in";let Ln=!1;if(Rt)Re.transition.afterLeave=()=>{if(Ne===ie.pendingId){if(w(Oe,Me,u===te&&!Ln?G(Re):u,0),a9t($e),bt&&xe.ssFallback)xe.ssFallback.el=null}};if(Re&&!ie.isFallbackMountPending){if(q(Re.el)===Me)u=G(Re),Ln=!0;if(S(Re,it,ie,!0),!Rt&&bt&&xe.ssFallback)p8(()=>xe.ssFallback.el=null,ie)}if(!Rt)w(Oe,Me,u,0)}ie.isFallbackMountPending=!1,nYe(ie,Oe),ie.pendingBranch=null,ie.isInFallback=!1;let mt=ie.parent,Xt=!1;while(mt){if(mt.pendingBranch){mt.effects.push(...$e),Xt=!0;break}mt=mt.parent}if(!Xt&&!Rt)a9t($e);if(ie.effects=[],W){if(n&&n.pendingBranch&&V===n.pendingId){if(n.deps--,n.deps===0&&!Be)n.resolve()}}ZEt(xe,"onResolve")},fallback(ae){if(!ie.pendingBranch)return;let{vnode:Be,activeBranch:xe,parentComponent:Re,container:Oe,namespace:Ne}=ie;ZEt(Be,"onFallback");let $e=G(xe),it=()=>{if(ie.isFallbackMountPending=!1,!ie.isInFallback)return;Q(null,ae,Oe,$e,Re,null,Ne,d,f),nYe(ie,ae)},Me=ae.transition&&ae.transition.mode==="out-in";if(Me)ie.isFallbackMountPending=!0,xe.transition.afterLeave=it;if(ie.isInFallback=!0,S(xe,Re,null,!0),!Me)it()},move(ae,Be,xe){ie.activeBranch&&w(ie.activeBranch,ae,Be,xe),ie.container=ae},next(){return ie.activeBranch&&G(ie.activeBranch)},registerDep(ae,Be,xe){let Re=!!ie.pendingBranch;if(Re)ie.deps++;let Oe=ae.vnode.el;ae.asyncDep.catch((Ne)=>{Wqe(Ne,ae,0)}).then((Ne)=>{if(ae.isUnmounted||ie.isUnmounted||ie.pendingId!==ae.suspenseId)return;eyt(),ae.asyncResolved=!0;let{vnode:$e}=ae;if(vGn(ae,Ne,!1),Oe)$e.el=Oe;let it=!Oe&&ae.subTree.el;if(Be(ae,$e,q(Oe||ae.subTree.el),Oe?null:G(ae.subTree),ie,g,xe),it)$e.placeholder=null,P(it);if(E9t(ae,$e.el),Re&&--ie.deps===0)ie.resolve()})},unmount(ae,Be){if(ie.isUnmounted=!0,ie.activeBranch)S(ie.activeBranch,A,ae,Be);if(ie.pendingBranch)S(ie.pendingBranch,A,ae,Be)}};return ie}function U4r(e,n,A,i,s,u,g,d,f){let B=n.suspense=qWA(n,i,A,e.parentNode,document.createElement("div"),null,s,u,g,d,!0),E=f(e,B.pendingBranch=n.ssContent,A,B,u,g);if(B.deps===0)B.resolve(!1,!0);return E}function T4r(e){let{shapeFlag:n,children:A}=e,i=n&32;e.ssContent=PzA(i?A.default:A),e.ssFallback=i?PzA(A.fallback):pv(x4)}function PzA(e){let n;if(Bi.isFunction(e)){let A=Oqe&&e._c;if(A)e._d=!1,VEt();if(e=e(),A)e._d=!0,n=ZL,TWA()}if(Bi.isArray(e))e=I4r(e);if(e=QR(e),n&&!e.dynamicChildren)e.dynamicChildren=n.filter((A)=>A!==e);return e}function UWA(e,n){if(n&&n.pendingBranch)if(Bi.isArray(e))n.effects.push(...e);else n.effects.push(e);else a9t(e)}function nYe(e,n){e.activeBranch=n;let{vnode:A,parentComponent:i}=e,s=n.el;while(!s&&n.component)n=n.component.subTree,s=n.el;if(A.el=s,i&&i.subTree===A)i.vnode.el=s,E9t(i,s)}function K4r(e){let n=e.props&&e.props.suspensible;return n!=null&&n!==!1}var WL=Symbol.for("v-fgt"),Fye=Symbol.for("v-txt"),x4=Symbol.for("v-cmt"),AYe=Symbol.for("v-stc"),$Et=[],ZL=null;function VEt(e=!1){$Et.push(ZL=e?null:[])}function TWA(){$Et.pop(),ZL=$Et[$Et.length-1]||null}var Oqe=1;function XEt(e,n=!1){if(Oqe+=e,e<0&&ZL&&n)ZL.hasOnce=!0}function KWA(e){if(e.dynamicChildren=Oqe>0?ZL||Bi.EMPTY_ARR:null,TWA(),Oqe>0&&ZL)ZL.push(e);return e}function R4r(e,n,A,i,s,u){return KWA($Gn(e,n,A,i,s,u,!0))}function g9t(e,n,A,i,s){return KWA(pv(e,n,A,i,s,!0))}function lCe(e){return e?e.__v_isVNode===!0:!1}function $Ae(e,n){return e.type===n.type&&e.key===n.key}function Y4r(e){}var RWA=({key:e})=>e!=null?e:null,n9t=({ref:e,ref_key:n,ref_for:A})=>{if(typeof e==="number")e=""+e;return e!=null?Bi.isString(e)||Zl.isRef(e)||Bi.isFunction(e)?{i:zM,r:e,k:n,f:!!A}:e:null};function $Gn(e,n=null,A=null,i=0,s=null,u=e===WL?0:1,g=!1,d=!1){let f={__v_isVNode:!0,__v_skip:!0,type:e,props:n,key:n&&RWA(n),ref:n&&n9t(n),scopeId:f9t,slotScopeIds:null,children:A,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:u,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:zM};if(d){if(p9t(f,A),u&128)e.normalize(f)}else if(A)f.shapeFlag|=Bi.isString(A)?8:16;if(Oqe>0&&!g&&ZL&&(f.patchFlag>0||u&6)&&f.patchFlag!==32)ZL.push(f);return f}var pv=j4r;function j4r(e,n=null,A=null,i=0,s=null,u=!1){if(!e||e===bWA)e=x4;if(lCe(e)){let d=Yie(e,n,!0);if(A)p9t(d,A);if(Oqe>0&&!u&&ZL)if(d.shapeFlag&6)ZL[ZL.indexOf(e)]=d;else ZL.push(d);return d.patchFlag=-2,d}if(Z4r(e))e=e.__vccOpts;if(n){n=YWA(n);let{class:d,style:f}=n;if(d&&!Bi.isString(d))n.class=Bi.normalizeClass(d);if(Bi.isObject(f)){if(Zl.isProxy(f)&&!Bi.isArray(f))f=Bi.extend({},f);n.style=Bi.normalizeStyle(f)}}let g=Bi.isString(e)?1:l9t(e)?128:nWA(e)?64:Bi.isObject(e)?4:Bi.isFunction(e)?2:0;return $Gn(e,n,A,i,s,g,u,!0)}function YWA(e){if(!e)return null;return Zl.isProxy(e)||kWA(e)?Bi.extend({},e):e}function Yie(e,n,A=!1,i=!1){let{props:s,ref:u,patchFlag:g,children:d,transition:f}=e,B=n?HWA(s||{},n):s,E={__v_isVNode:!0,__v_skip:!0,type:e.type,props:B,key:B&&RWA(B),ref:n&&n.ref?A&&u?Bi.isArray(u)?u.concat(n9t(n)):[u,n9t(n)]:n9t(n):u,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:n&&e.type!==WL?g===-1?16:g|16:g,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yie(e.ssContent),ssFallback:e.ssFallback&&Yie(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};if(f&&i)$qe(E,f.clone(E));return E}function OGn(e=" ",n=0){return pv(Fye,null,e,n)}function H4r(e,n){let A=pv(AYe,null,e);return A.staticCount=n,A}function jWA(e="",n=!1){return n?(VEt(),g9t(x4,null,e)):pv(x4,null,e)}function QR(e){if(e==null||typeof e==="boolean")return pv(x4);else if(Bi.isArray(e))return pv(WL,null,e.slice());else if(lCe(e))return cCe(e);else return pv(Fye,null,String(e))}function cCe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yie(e)}function p9t(e,n){let A=0,{shapeFlag:i}=e;if(n==null)n=null;else if(Bi.isArray(n))A=16;else if(typeof n==="object")if(i&65){let s=n.default;if(s)s._c&&(s._d=!1),p9t(e,s()),s._c&&(s._d=!0);return}else{A=32;let s=n._;if(!s&&!kWA(n))n._ctx=zM;else if(s===3&&zM)if(zM.slots._===1)n._=1;else n._=2,e.patchFlag|=1024}else if(Bi.isFunction(n)){if(i&65){p9t(e,{default:n});return}n={default:n,_ctx:zM},A=32}else if(n=String(n),i&64)A=16,n=[OGn(n)];else A=8;e.children=n,e.shapeFlag|=A}function HWA(...e){let n={};for(let A=0;A<e.length;A++){let i=e[A];for(let s in i)if(s==="class"){if(n.class!==i.class)n.class=Bi.normalizeClass([n.class,i.class])}else if(s==="style")n.style=Bi.normalizeStyle([n.style,i.style]);else if(Bi.isOn(s)){let u=n[s],g=i[s];if(g&&u!==g&&!(Bi.isArray(u)&&u.includes(g)))n[s]=u?[].concat(u,g):g;else if(g==null&&u==null&&!Bi.isModelListener(s))n[s]=g}else if(s!=="")n[s]=i[s]}return n}function yR(e,n,A,i=null){OAe(e,n,7,[A,i])}var P4r=IWA(),J4r=0;function PWA(e,n,A){let i=e.type,s=(n?n.appContext:e.appContext)||P4r,u={uid:J4r++,vnode:e,type:i,parent:n,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Zl.EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(s.provides),ids:n?n.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xWA(i,s),emitsOptions:yWA(i,s),emit:null,emitted:null,propsDefaults:Bi.EMPTY_OBJ,inheritAttrs:i.inheritAttrs,ctx:Bi.EMPTY_OBJ,data:Bi.EMPTY_OBJ,props:Bi.EMPTY_OBJ,attrs:Bi.EMPTY_OBJ,slots:Bi.EMPTY_OBJ,refs:Bi.EMPTY_OBJ,setupState:Bi.EMPTY_OBJ,setupContext:null,suspense:A,suspenseId:A?A.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};if(u.ctx={_:u},u.root=n?n.root:u,u.emit=B4r.bind(null,u),e.ce)e.ce(u);return u}var OM=null,zAe=()=>OM||zM,m9t,aYe;{let e=Bi.getGlobalThis(),n=(A,i)=>{let s;if(!(s=e[A]))s=e[A]=[];return s.push(i),(u)=>{if(s.length>1)s.forEach((g)=>g(u));else s[0](u)}};m9t=n("__VUE_INSTANCE_SETTERS__",(A)=>OM=A),aYe=n("__VUE_SSR_SETTERS__",(A)=>zqe=A)}var rYe=(e)=>{let n=OM;return m9t(e),e.scope.on(),()=>{e.scope.off(),m9t(n)}},eyt=()=>{OM&&OM.scope.off(),m9t(null)};function JWA(e){return e.vnode.shapeFlag&4}var zqe=!1;function $WA(e,n=!1,A=!1){n&&aYe(n);let{props:i,children:s}=e.vnode,u=JWA(e);_4r(e,i,u,n),x4r(e,s,A||n);let g=u?$4r(e,n):void 0;return n&&aYe(!1),g}function $4r(e,n){let A=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wGn);let{setup:i}=A;if(i){Zl.pauseTracking();let s=e.setupContext=i.length>1?zWA(e):null,u=rYe(e),g=iYe(i,e,0,[e.props,s]),d=Bi.isPromise(g);if(Zl.resetTracking(),u(),(d||e.sp)&&!uCe(e))qGn(e);if(d)if(g.then(eyt,eyt),n)return g.then((f)=>{vGn(e,f,n)}).catch((f)=>{Wqe(f,e,0)});else e.asyncDep=g;else vGn(e,g,n)}else OWA(e,n)}function vGn(e,n,A){if(Bi.isFunction(n))if(e.type.__ssrInlineRender)e.ssrRender=n;else e.render=n;else if(Bi.isObject(n))e.setupState=Zl.proxyRefs(n);OWA(e,A)}var d9t,SGn;function O4r(e){d9t=e,SGn=(n)=>{if(n.render._rc)n.withProxy=new Proxy(n.ctx,ZSr)}}var z4r=()=>!d9t;function OWA(e,n,A){let i=e.type;if(!e.render){if(!n&&d9t&&!i.render){let s=i.template||jGn(e).template;if(s){let{isCustomElement:u,compilerOptions:g}=e.appContext.config,{delimiters:d,compilerOptions:f}=i,B=Bi.extend(Bi.extend({isCustomElement:u,delimiters:d},g),f);i.render=d9t(s,B)}}if(e.render=i.render||Bi.NOOP,SGn)SGn(e)}{let s=rYe(e);Zl.pauseTracking();try{l4r(e)}finally{Zl.resetTracking(),s()}}}var W4r={get(e,n){return Zl.track(e,"get",""),e[n]}};function zWA(e){let n=(A)=>{e.exposed=A||{}};return{attrs:new Proxy(e.attrs,W4r),slots:e.slots,emit:e.emit,expose:n}}function Ayt(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Zl.proxyRefs(Zl.markRaw(e.exposed)),{get(n,A){if(A in n)return n[A];else if(A in JEt)return JEt[A](e)},has(n,A){return A in n||A in JEt}}));else return e.proxy}function NGn(e,n=!0){return Bi.isFunction(e)?e.displayName||e.name:e.name||n&&e.__name}function Z4r(e){return Bi.isFunction(e)&&"__vccOpts"in e}var WWA=(e,n)=>{return Zl.computed(e,n,zqe)};function V4r(e,n,A){try{XEt(-1);let i=arguments.length;if(i===2)if(Bi.isObject(n)&&!Bi.isArray(n)){if(lCe(n))return pv(e,null,[n]);return pv(e,n)}else return pv(e,null,n);else{if(i>3)A=Array.prototype.slice.call(arguments,2);else if(i===3&&lCe(A))A=[A];return pv(e,n,A)}}finally{XEt(1)}}function X4r(){return}function e8r(e,n,A,i){let s=A[i];if(s&&ZWA(s,e))return s;let u=n();return u.memo=e.slice(),u.cacheIndex=i,A[i]=u}function ZWA(e,n){let A=e.memo;if(A.length!=n.length)return!1;for(let i=0;i<A.length;i++)if(Bi.hasChanged(A[i],n[i]))return!1;if(Oqe>0&&ZL)ZL.push(e);return!0}var VWA="3.5.39",t8r=Bi.NOOP,n8r=iSr,A8r=void 0,a8r=Bi.NOOP,i8r={createComponentInstance:PWA,setupComponent:$WA,renderComponentRoot:t9t,setCurrentRenderingInstance:zEt,isVNode:lCe,normalizeVNode:QR,getComponentPublicInstance:Ayt,ensureValidVNode:YGn,pushWarningContext:tSr,popWarningContext:nSr},r8r=i8r,o8r=null,s8r=null,c8r=null;XWA.EffectScope=Zl.EffectScope;XWA.ReactiveEffect=Zl.ReactiveEffect;XWA.TrackOpTypes=Zl.TrackOpTypes;XWA.TriggerOpTypes=Zl.TriggerOpTypes;XWA.customRef=Zl.customRef;XWA.effect=Zl.effect;XWA.effectScope=Zl.effectScope;XWA.getCurrentScope=Zl.getCurrentScope;XWA.getCurrentWatcher=Zl.getCurrentWatcher;XWA.isProxy=Zl.isProxy;XWA.isReactive=Zl.isReactive;XWA.isReadonly=Zl.isReadonly;XWA.isRef=Zl.isRef;XWA.isShallow=Zl.isShallow;XWA.markRaw=Zl.markRaw;XWA.onScopeDispose=Zl.onScopeDispose;XWA.onWatcherCleanup=Zl.onWatcherCleanup;XWA.proxyRefs=Zl.proxyRefs;XWA.reactive=Zl.reactive;XWA.readonly=Zl.readonly;XWA.ref=Zl.ref;XWA.shallowReactive=Zl.shallowReactive;XWA.shallowReadonly=Zl.shallowReadonly;XWA.shallowRef=Zl.shallowRef;XWA.stop=Zl.stop;XWA.toRaw=Zl.toRaw;XWA.toRef=Zl.toRef;XWA.toRefs=Zl.toRefs;XWA.toValue=Zl.toValue;XWA.triggerRef=Zl.triggerRef;XWA.unref=Zl.unref;XWA.camelize=Bi.camelize;XWA.capitalize=Bi.capitalize;XWA.normalizeClass=Bi.normalizeClass;XWA.normalizeProps=Bi.normalizeProps;XWA.normalizeStyle=Bi.normalizeStyle;XWA.toDisplayString=Bi.toDisplayString;XWA.toHandlerKey=Bi.toHandlerKey;XWA.BaseTransition=ISr;XWA.BaseTransitionPropsValidators=aWA;XWA.Comment=x4;XWA.DeprecationTypes=c8r;XWA.ErrorCodes=aSr;XWA.ErrorTypeStrings=n8r;XWA.Fragment=WL;XWA.KeepAlive=RSr;XWA.Static=AYe;XWA.Suspense=M4r;XWA.Teleport=BSr;XWA.Text=Fye;XWA.assertNumber=ASr;XWA.callWithAsyncErrorHandling=OAe;XWA.callWithErrorHandling=iYe;XWA.cloneVNode=Yie;XWA.compatUtils=s8r;XWA.computed=WWA;XWA.createBlock=g9t;XWA.createCommentVNode=jWA;XWA.createElementBlock=R4r;XWA.createElementVNode=$Gn;XWA.createHydrationRenderer=S4r;XWA.createPropsRestProxy=c4r;XWA.createRenderer=v4r;XWA.createSlots=OSr;XWA.createStaticVNode=H4r;XWA.createTextVNode=OGn;XWA.createVNode=pv;XWA.defineAsyncComponent=TSr;XWA.defineComponent=sWA;XWA.defineEmits=XSr;XWA.defineExpose=e4r;XWA.defineModel=A4r;XWA.defineOptions=t4r;XWA.defineProps=VSr;XWA.defineSlots=n4r;XWA.devtools=A8r;XWA.getCurrentInstance=zAe;XWA.getTransitionRawChildren=LGn;XWA.guardReactiveProps=YWA;XWA.h=V4r;XWA.handleError=Wqe;XWA.hasInjectionContext=gSr;XWA.hydrateOnIdle=NSr;XWA.hydrateOnInteraction=qSr;XWA.hydrateOnMediaQuery=LSr;XWA.hydrateOnVisible=MSr;XWA.initCustomFormatter=X4r;XWA.inject=HEt;XWA.isMemoSame=ZWA;XWA.isRuntimeOnly=z4r;XWA.isVNode=lCe;XWA.mergeDefaults=o4r;XWA.mergeModels=s4r;XWA.mergeProps=HWA;XWA.nextTick=$zA;XWA.onActivated=cWA;XWA.onBeforeMount=gWA;XWA.onBeforeUnmount=B9t;XWA.onBeforeUpdate=pWA;XWA.onDeactivated=uWA;XWA.onErrorCaptured=hWA;XWA.onMounted=b9t;XWA.onRenderTracked=fWA;XWA.onRenderTriggered=dWA;XWA.onServerPrefetch=mWA;XWA.onUnmounted=C9t;XWA.onUpdated=TGn;XWA.openBlock=VEt;XWA.popScopeId=cSr;XWA.provide=WzA;XWA.pushScopeId=sSr;XWA.queuePostFlushCb=a9t;XWA.registerRuntimeCompiler=O4r;XWA.renderList=$Sr;XWA.renderSlot=zSr;XWA.resolveComponent=HSr;XWA.resolveDirective=JSr;XWA.resolveDynamicComponent=PSr;XWA.resolveFilter=o8r;XWA.resolveTransitionHooks=r9t;XWA.setBlockTracking=XEt;XWA.setDevtoolsHook=a8r;XWA.setTransitionHooks=$qe;XWA.ssrContextKey=ZzA;XWA.ssrUtils=r8r;XWA.toHandlers=WSr;XWA.transformVNodeArgs=Y4r;XWA.useAttrs=r4r;XWA.useId=ESr;XWA.useModel=b4r;XWA.useSSRContext=VzA;XWA.useSlots=i4r;XWA.useTemplateRef=ySr;XWA.useTransitionState=AWA;XWA.version=VWA;XWA.warn=t8r;XWA.watch=PEt;XWA.watchEffect=pSr;XWA.watchPostEffect=mSr;XWA.watchSyncEffect=XzA;XWA.withAsyncContext=u4r;XWA.withCtx=MGn;XWA.withDefaults=a4r;XWA.withDirectives=lSr;XWA.withMemo=e8r;XWA.withScopeId=uSr});import{readFileSync as O3r}from"fs";import{resolve as z3r,dirname as W3r}from"path";import{parse as Z3r,compileScript as V3r,compileTemplate as X3r}from"@vue/compiler-sfc";function rZA(){Q9t.clear()}async function _9t(e,n,A,i={}){let s=n?`${e}::${A9r(A)}`:null;if(s&&Q9t.has(s))return Q9t.get(s);let u=O3r(e,"utf-8"),g=await zGn(u,e,n,A,i);if(s)Q9t.set(s,g);return g}async function zGn(e,n,A,i,s={}){let{descriptor:u,errors:g}=Z3r(e,{filename:n});if(g.length)throw Error(`@axon/vstr: parse errors in ${n}:
2013
+ `)){if(!e9t(z,0))ZRe();z.textContent=te.children}}if(Ne){if(Rt||mt||!xe||$e&48){let Ft=z.tagName.includes("-");for(let nn in Ne)if(Rt&&(nn.endsWith("value")||nn==="indeterminate")||Bi.isOn(nn)&&!Bi.isReservedProp(nn)||nn[0]==="."||Ft&&!Bi.isReservedProp(nn)||Oe&&Oe.includes(nn))i(z,nn,null,Ne[nn],void 0,ie)}else if(Ne.onClick)i(z,"onClick",null,Ne.onClick,void 0,ie);else if($e&4&&Zl.isReactive(Ne.style))for(let Ft in Ne.style)Ne.style[Ft]}let Ln;if(Ln=Ne&&Ne.onVnodeBeforeMount)yR(Ln,ie,te);if(Me)Rie(te,null,ie,"beforeMount");if((Ln=Ne&&Ne.onVnodeMounted)||Me||Xt)UWA(()=>{Ln&&yR(Ln,ie,te),Xt&&bt.enter(z),Me&&Rie(te,null,ie,"mounted")},ae)}return z.nextSibling},S=(z,te,ie,ae,Be,xe,Re)=>{Re=Re||!!te.dynamicChildren;let Oe=te.children,Ne=Oe.length,$e=!1;for(let it=0;it<Ne;it++){let Me=Re?Oe[it]:Oe[it]=QR(Oe[it]),bt=Me.type===Fye;if(z){if(bt&&!Re){if(it+1<Ne&&QR(Oe[it+1]).type===Fye)f(s(z.data.slice(Me.children.length)),ie,u(z)),z.data=Me.children}z=Q(z,Me,ae,Be,xe,Re)}else if(bt&&!Me.children)f(Me.el=s(""),ie);else{if(!$e){if($e=!0,!e9t(ie,1))ZRe()}A(null,Me,ie,null,ae,Be,Z3t(ie),xe)}}return z},G=(z,te,ie,ae,Be,xe)=>{let{slotScopeIds:Re}=te;if(Re)Be=Be?Be.concat(Re):Re;let Oe=g(z),Ne=S(u(z),te,Oe,ie,ae,Be,xe);if(Ne&&XRe(Ne)&&Ne.data==="]")return u(te.anchor=Ne);else return ZRe(),f(te.anchor=B("]"),Oe,Ne),Ne},q=(z,te,ie,ae,Be,xe)=>{if(!DSr(z,te))ZRe();if(te.el=null,xe){let Ne=P(z);while(!0){let $e=u(z);if($e&&$e!==Ne)d($e);else break}}let Re=u(z),Oe=g(z);if(d(z),A(null,te,Oe,Re,ie,ae,Z3t(Oe),Be),ie)ie.vnode.el=te.el,E9t(ie,te.el);return Re},P=(z,te="[",ie="]")=>{let ae=0;while(z)if(z=u(z),z&&XRe(z)){if(z.data===te)ae++;if(z.data===ie)if(ae===0)return u(z);else ae--}return z},V=(z,te,ie)=>{let ae=te.parentNode;if(ae)ae.replaceChild(z,te);let Be=ie;while(Be){if(Be.vnode.el===te)Be.vnode.el=Be.subTree.el=z;Be=Be.parent}},W=(z)=>{return z.nodeType===1&&z.tagName==="TEMPLATE"};return[E,Q]}var s9t="data-allow-mismatch",kSr={[0]:"text",[1]:"children",[2]:"class",[3]:"style",[4]:"attribute"};function e9t(e,n){if(n===0||n===1)while(e&&!e.hasAttribute(s9t))e=e.parentElement;return UGn(e&&e.getAttribute(s9t),n)}function UGn(e,n){if(e==null)return!1;else if(e==="")return!0;else{let A=e.split(",");if(n===0&&A.includes("children"))return!0;return A.includes(kSr[n])}}function DSr(e,n){return e9t(e.parentElement,1)||xSr(e)||FSr(n)}function xSr(e){return e.nodeType===1&&UGn(e.getAttribute(s9t),1)}function FSr({props:e}){let n=e&&e[s9t];return typeof n==="string"&&UGn(n,1)}var vSr=Bi.getGlobalThis().requestIdleCallback||((e)=>setTimeout(e,1)),SSr=Bi.getGlobalThis().cancelIdleCallback||((e)=>clearTimeout(e)),NSr=(e=1e4)=>(n)=>{let A=vSr(n,{timeout:e});return()=>SSr(A)};function GSr(e){let{top:n,left:A,bottom:i,right:s}=e.getBoundingClientRect(),{innerHeight:u,innerWidth:g}=window;return(n>0&&n<u||i>0&&i<u)&&(A>0&&A<g||s>0&&s<g)}var MSr=(e)=>(n,A)=>{let i=new IntersectionObserver((s)=>{for(let u of s){if(!u.isIntersecting)continue;i.disconnect(),n();break}},e);return A((s)=>{if(!(s instanceof Element))return;if(GSr(s))return n(),i.disconnect(),!1;i.observe(s)}),()=>i.disconnect()},LSr=(e)=>(n)=>{if(e){let A=matchMedia(e);if(A.matches)n();else return A.addEventListener("change",n,{once:!0}),()=>A.removeEventListener("change",n)}},qSr=(e=[])=>(n,A)=>{if(Bi.isString(e))e=[e];let i=!1,s=(g)=>{if(!i)i=!0,u(),n(),g.target.dispatchEvent(new g.constructor(g.type,g))},u=()=>{A((g)=>{for(let d of e)g.removeEventListener(d,s)})};return A((g)=>{for(let d of e)g.addEventListener(d,s,{once:!0})}),u};function USr(e,n){if(XRe(e)&&e.data==="["){let A=1,i=e.nextSibling;while(i){if(i.nodeType===1){if(n(i)===!1)break}else if(XRe(i)){if(i.data==="]"){if(--A===0)break}else if(i.data==="[")A++}i=i.nextSibling}}else n(e)}var uCe=(e)=>!!e.type.__asyncLoader;function TSr(e){if(Bi.isFunction(e))e={loader:e};let{loader:n,loadingComponent:A,errorComponent:i,delay:s=200,hydrate:u,timeout:g,suspensible:d=!0,onError:f}=e,B=null,E,Q=0,w=()=>{return Q++,B=null,S()},S=()=>{let G;return B||(G=B=n().catch((q)=>{if(q=q instanceof Error?q:Error(String(q)),f)return new Promise((P,V)=>{f(q,()=>P(w()),()=>V(q),Q+1)});else throw q}).then((q)=>{if(G!==B&&B)return B;if(q&&(q.__esModule||q[Symbol.toStringTag]==="Module"))q=q.default;return E=q,q}))};return sWA({name:"AsyncComponentWrapper",__asyncLoader:S,__asyncHydrate(G,q,P){let V=!1;(q.bu||(q.bu=[])).push(()=>V=!0);let W=()=>{if(V)return;P()},z=u?()=>{let te=u(W,(ie)=>USr(G,ie));if(te)(q.bum||(q.bum=[])).push(te)}:W;if(E)z();else S().then(()=>!q.isUnmounted&&z())},get __asyncResolved(){return E},setup(){let G=OM;if(qGn(G),E)return()=>V3t(E,G);let q=(ie)=>{B=null,Wqe(ie,G,13,!i)};if(d&&G.suspense||zqe)return S().then((ie)=>{return()=>V3t(ie,G)}).catch((ie)=>{return q(ie),()=>i?pv(i,{error:ie}):null});let P=Zl.ref(!1),V=Zl.ref(),W=Zl.ref(!!s),z,te;if(C9t(()=>{if(z!=null)clearTimeout(z);if(te!=null)clearTimeout(te)}),s)te=setTimeout(()=>{if(G.isUnmounted)return;W.value=!1},s);if(g!=null)z=setTimeout(()=>{if(G.isUnmounted)return;if(!P.value&&!V.value){let ie=Error(`Async component timed out after ${g}ms.`);q(ie),V.value=ie}},g);return S().then(()=>{if(G.isUnmounted)return;if(P.value=!0,G.parent&&nyt(G.parent.vnode))G.parent.update()}).catch((ie)=>{if(G.isUnmounted){B=null;return}q(ie),V.value=ie}),()=>{if(P.value&&E)return V3t(E,G);else if(V.value&&i)return pv(i,{error:V.value});else if(A&&!W.value)return V3t(A,G)}}})}function V3t(e,n){let{ref:A,props:i,children:s,ce:u}=n.vnode,g=pv(e,i,s);return g.ref=A,g.ce=u,delete n.vnode.ce,g}var nyt=(e)=>e.type.__isKeepAlive,KSr={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:n}){let A=zAe(),i=A.ctx;if(!i.renderer)return()=>{let W=n.default&&n.default();return W&&W.length===1?W[0]:W};let s=new Map,u=new Set,g=null,d=A.suspense,{renderer:{p:f,m:B,um:E,o:{createElement:Q}}}=i,w=Q("div");i.activate=(W,z,te,ie,ae)=>{let Be=W.component;B(W,z,te,0,d),f(Be.vnode,W,z,te,Be,d,ie,W.slotScopeIds,ae),p8(()=>{if(Be.isDeactivated=!1,Be.a)Bi.invokeArrayFns(Be.a);let xe=W.props&&W.props.onVnodeMounted;if(xe)yR(xe,Be.parent,W)},d)},i.deactivate=(W)=>{let z=W.component;u9t(z.m),u9t(z.a),B(W,w,null,1,d),p8(()=>{if(z.da)Bi.invokeArrayFns(z.da);let te=W.props&&W.props.onVnodeUnmounted;if(te)yR(te,z.parent,W);z.isDeactivated=!0},d)};function S(W){CGn(W),E(W,A,d,!0)}function G(W){s.forEach((z,te)=>{let ie=NGn(uCe(z)?z.type.__asyncResolved||{}:z.type);if(ie&&!W(ie))q(te)})}function q(W){let z=s.get(W);if(z&&(!g||!$Ae(z,g)))S(z);else if(g)CGn(g);s.delete(W),u.delete(W)}PEt(()=>[e.include,e.exclude],([W,z])=>{W&&G((te)=>YEt(W,te)),z&&G((te)=>!YEt(z,te))},{flush:"post",deep:!0});let P=null,V=()=>{if(P!=null)if(l9t(A.subTree.type))p8(()=>{s.set(P,X3t(A.subTree))},A.subTree.suspense);else s.set(P,X3t(A.subTree))};return b9t(V),TGn(V),B9t(()=>{s.forEach((W)=>{let{subTree:z,suspense:te}=A,ie=X3t(z);if(W.type===ie.type&&W.key===ie.key){CGn(ie);let ae=ie.component.da;ae&&p8(ae,te);return}S(W)})}),()=>{if(P=null,!n.default)return g=null;let W=n.default(),z=W[0];if(W.length>1)return g=null,W;else if(!lCe(z)||!(z.shapeFlag&4)&&!(z.shapeFlag&128))return g=null,z;let te=X3t(z);if(te.type===x4)return g=null,te;let ie=te.type,ae=NGn(uCe(te)?te.type.__asyncResolved||{}:ie),{include:Be,exclude:xe,max:Re}=e;if(Be&&(!ae||!YEt(Be,ae))||xe&&ae&&YEt(xe,ae))return te.shapeFlag&=-257,g=te,z;let Oe=te.key==null?ie:te.key,Ne=s.get(Oe);if(te.el){if(te=Yie(te),z.shapeFlag&128)z.ssContent=te}if(P=Oe,Ne){if(te.el=Ne.el,te.component=Ne.component,te.transition)$qe(te,te.transition);te.shapeFlag|=512,u.delete(Oe),u.add(Oe)}else if(u.add(Oe),Re&&u.size>parseInt(Re,10))q(u.values().next().value);return te.shapeFlag|=256,g=te,l9t(z.type)?z:te}}},RSr=KSr;function YEt(e,n){if(Bi.isArray(e))return e.some((A)=>YEt(A,n));else if(Bi.isString(e))return e.split(",").includes(n);else if(Bi.isRegExp(e))return e.lastIndex=0,e.test(n);return!1}function cWA(e,n){lWA(e,"a",n)}function uWA(e,n){lWA(e,"da",n)}function lWA(e,n,A=OM){let i=e.__wdc||(e.__wdc=()=>{let s=A;while(s){if(s.isDeactivated)return;s=s.parent}return e()});if(h9t(n,i,A),A){let s=A.parent;while(s&&s.parent){if(nyt(s.parent.vnode))YSr(i,n,A,s);s=s.parent}}}function YSr(e,n,A,i){let s=h9t(n,e,i,!0);C9t(()=>{Bi.remove(i[n],s)},A)}function CGn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function X3t(e){return e.shapeFlag&128?e.ssContent:e}function h9t(e,n,A=OM,i=!1){if(A){let s=A[e]||(A[e]=[]),u=n.__weh||(n.__weh=(...g)=>{Zl.pauseTracking();let d=rYe(A),f=OAe(n,A,e,g);return d(),Zl.resetTracking(),f});if(i)s.unshift(u);else s.push(u);return u}}var gCe=(e)=>(n,A=OM)=>{if(!zqe||e==="sp")h9t(e,(...i)=>n(...i),A)},gWA=gCe("bm"),b9t=gCe("m"),pWA=gCe("bu"),TGn=gCe("u"),B9t=gCe("bum"),C9t=gCe("um"),mWA=gCe("sp"),dWA=gCe("rtg"),fWA=gCe("rtc");function hWA(e,n=OM){h9t("ec",e,n)}var KGn="components",jSr="directives";function HSr(e,n){return RGn(KGn,e,!0,n)||e}var bWA=Symbol.for("v-ndc");function PSr(e){if(Bi.isString(e))return RGn(KGn,e,!1)||e;else return e||bWA}function JSr(e){return RGn(jSr,e)}function RGn(e,n,A=!0,i=!1){let s=zM||OM;if(s){let u=s.type;if(e===KGn){let d=NGn(u,!1);if(d&&(d===n||d===Bi.camelize(n)||d===Bi.capitalize(Bi.camelize(n))))return u}let g=TzA(s[e]||u[e],n)||TzA(s.appContext[e],n);if(!g&&i)return u;return g}}function TzA(e,n){return e&&(e[n]||e[Bi.camelize(n)]||e[Bi.capitalize(Bi.camelize(n))])}function $Sr(e,n,A,i){let s,u=A&&A[i],g=Bi.isArray(e);if(g||Bi.isString(e)){let d=g&&Zl.isReactive(e),f=!1,B=!1;if(d)f=!Zl.isShallow(e),B=Zl.isReadonly(e),e=Zl.shallowReadArray(e);s=Array(e.length);for(let E=0,Q=e.length;E<Q;E++)s[E]=n(f?B?Zl.toReadonly(Zl.toReactive(e[E])):Zl.toReactive(e[E]):e[E],E,void 0,u&&u[E])}else if(typeof e==="number"){s=Array(e);for(let d=0;d<e;d++)s[d]=n(d+1,d,void 0,u&&u[d])}else if(Bi.isObject(e))if(e[Symbol.iterator])s=Array.from(e,(d,f)=>n(d,f,void 0,u&&u[f]));else{let d=Object.keys(e);s=Array(d.length);for(let f=0,B=d.length;f<B;f++){let E=d[f];s[f]=n(e[E],E,f,u&&u[f])}}else s=[];if(A)A[i]=s;return s}function OSr(e,n){for(let A=0;A<n.length;A++){let i=n[A];if(Bi.isArray(i))for(let s=0;s<i.length;s++)e[i[s].name]=i[s].fn;else if(i)e[i.name]=i.key?(...s)=>{let u=i.fn(...s);if(u)u.key=i.key;return u}:i.fn}return e}function zSr(e,n,A={},i,s){if(zM.ce||zM.parent&&uCe(zM.parent)&&zM.parent.ce){let B=Object.keys(A).length>0;if(n!=="default")A.name=n;return VEt(),g9t(WL,null,[pv("slot",A,i&&i())],B?-2:64)}let u=e[n];if(u&&u._c)u._d=!1;VEt();let g=u&&YGn(u(A)),d=A.key||g&&g.key,f=g9t(WL,{key:(d&&!Bi.isSymbol(d)?d:`_${n}`)+(!g&&i?"_fb":"")},g||(i?i():[]),g&&e._===1?64:-2);if(!s&&f.scopeId)f.slotScopeIds=[f.scopeId+"-s"];if(u&&u._c)u._d=!0;return f}function YGn(e){return e.some((n)=>{if(!lCe(n))return!0;if(n.type===x4)return!1;if(n.type===WL&&!YGn(n.children))return!1;return!0})?e:null}function WSr(e,n){let A={};for(let i in e)A[n&&/[A-Z]/.test(i)?`on:${i}`:Bi.toHandlerKey(i)]=e[i];return A}var _Gn=(e)=>{if(!e)return null;if(JWA(e))return Ayt(e);return _Gn(e.parent)},JEt=Bi.extend(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)=>_Gn(e.parent),$root:(e)=>_Gn(e.root),$host:(e)=>e.ce,$emit:(e)=>e.emit,$options:(e)=>jGn(e),$forceUpdate:(e)=>e.f||(e.f=()=>{GGn(e.update)}),$nextTick:(e)=>e.n||(e.n=$zA.bind(e.proxy)),$watch:(e)=>dSr.bind(e)}),IGn=(e,n)=>e!==Bi.EMPTY_OBJ&&!e.__isScriptSetup&&Bi.hasOwn(e,n),wGn={get({_:e},n){if(n==="__v_skip")return!0;let{ctx:A,setupState:i,data:s,props:u,accessCache:g,type:d,appContext:f}=e;if(n[0]!=="$"){let w=g[n];if(w!==void 0)switch(w){case 1:return i[n];case 2:return s[n];case 4:return A[n];case 3:return u[n]}else if(IGn(i,n))return g[n]=1,i[n];else if(s!==Bi.EMPTY_OBJ&&Bi.hasOwn(s,n))return g[n]=2,s[n];else if(Bi.hasOwn(u,n))return g[n]=3,u[n];else if(A!==Bi.EMPTY_OBJ&&Bi.hasOwn(A,n))return g[n]=4,A[n];else if(kGn)g[n]=0}let B=JEt[n],E,Q;if(B){if(n==="$attrs")Zl.track(e.attrs,"get","");return B(e)}else if((E=d.__cssModules)&&(E=E[n]))return E;else if(A!==Bi.EMPTY_OBJ&&Bi.hasOwn(A,n))return g[n]=4,A[n];else if(Q=f.config.globalProperties,Bi.hasOwn(Q,n))return Q[n]},set({_:e},n,A){let{data:i,setupState:s,ctx:u}=e;if(IGn(s,n))return s[n]=A,!0;else if(i!==Bi.EMPTY_OBJ&&Bi.hasOwn(i,n))return i[n]=A,!0;else if(Bi.hasOwn(e.props,n))return!1;if(n[0]==="$"&&n.slice(1)in e)return!1;else u[n]=A;return!0},has({_:{data:e,setupState:n,accessCache:A,ctx:i,appContext:s,props:u,type:g}},d){let f;return!!(A[d]||e!==Bi.EMPTY_OBJ&&d[0]!=="$"&&Bi.hasOwn(e,d)||IGn(n,d)||Bi.hasOwn(u,d)||Bi.hasOwn(i,d)||Bi.hasOwn(JEt,d)||Bi.hasOwn(s.config.globalProperties,d)||(f=g.__cssModules)&&f[d])},defineProperty(e,n,A){if(A.get!=null)e._.accessCache[n]=0;else if(Bi.hasOwn(A,"value"))this.set(e,n,A.value,null);return Reflect.defineProperty(e,n,A)}},ZSr=Bi.extend({},wGn,{get(e,n){if(n===Symbol.unscopables)return;return wGn.get(e,n,e)},has(e,n){return n[0]!=="_"&&!Bi.isGloballyAllowed(n)}});function VSr(){return null}function XSr(){return null}function e4r(e){}function t4r(e){}function n4r(){return null}function A4r(){}function a4r(e,n){return null}function i4r(){return BWA().slots}function r4r(){return BWA().attrs}function BWA(e){let n=zAe();return n.setupContext||(n.setupContext=zWA(n))}function WEt(e){return Bi.isArray(e)?e.reduce((n,A)=>(n[A]=null,n),{}):e}function o4r(e,n){let A=WEt(e);for(let i in n){if(i.startsWith("__skip"))continue;let s=A[i];if(s)if(Bi.isArray(s)||Bi.isFunction(s))s=A[i]={type:s,default:n[i]};else s.default=n[i];else if(s===null)s=A[i]={default:n[i]};if(s&&n[`__skip_${i}`])s.skipFactory=!0}return A}function s4r(e,n){if(!e||!n)return e||n;if(Bi.isArray(e)&&Bi.isArray(n))return e.concat(n);return Bi.extend({},WEt(e),WEt(n))}function c4r(e,n){let A={};for(let i in e)if(!n.includes(i))Object.defineProperty(A,i,{enumerable:!0,get:()=>e[i]});return A}function u4r(e){let n=zAe(),A=zqe,i=e();if(eyt(),A)aYe(!1);let s=()=>{if(rYe(n),A)aYe(!0)},u=()=>{if(zAe()!==n)n.scope.off();if(eyt(),A)aYe(!1)};if(Bi.isPromise(i))i=i.catch((g)=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(u)),g});return[i,()=>{s(),Promise.resolve().then(u)}]}var kGn=!0;function l4r(e){let n=jGn(e),A=e.proxy,i=e.ctx;if(kGn=!1,n.beforeCreate)KzA(n.beforeCreate,e,"bc");let{data:s,computed:u,methods:g,watch:d,provide:f,inject:B,created:E,beforeMount:Q,mounted:w,beforeUpdate:S,updated:G,activated:q,deactivated:P,beforeDestroy:V,beforeUnmount:W,destroyed:z,unmounted:te,render:ie,renderTracked:ae,renderTriggered:Be,errorCaptured:xe,serverPrefetch:Re,expose:Oe,inheritAttrs:Ne,components:$e,directives:it,filters:Me}=n,bt=null;if(B)g4r(B,i,bt);if(g)for(let mt in g){let Xt=g[mt];if(Bi.isFunction(Xt))i[mt]=Xt.bind(A)}if(s){let mt=s.call(A,A);if(!Bi.isObject(mt));else e.data=Zl.reactive(mt)}if(kGn=!0,u)for(let mt in u){let Xt=u[mt],Ln=Bi.isFunction(Xt)?Xt.bind(A,A):Bi.isFunction(Xt.get)?Xt.get.bind(A,A):Bi.NOOP,Ft=!Bi.isFunction(Xt)&&Bi.isFunction(Xt.set)?Xt.set.bind(A):Bi.NOOP,nn=WWA({get:Ln,set:Ft});Object.defineProperty(i,mt,{enumerable:!0,configurable:!0,get:()=>nn.value,set:($n)=>nn.value=$n})}if(d)for(let mt in d)CWA(d[mt],i,A,mt);if(f){let mt=Bi.isFunction(f)?f.call(A):f;Reflect.ownKeys(mt).forEach((Xt)=>{WzA(Xt,mt[Xt])})}if(E)KzA(E,e,"c");function Rt(mt,Xt){if(Bi.isArray(Xt))Xt.forEach((Ln)=>mt(Ln.bind(A)));else if(Xt)mt(Xt.bind(A))}if(Rt(gWA,Q),Rt(b9t,w),Rt(pWA,S),Rt(TGn,G),Rt(cWA,q),Rt(uWA,P),Rt(hWA,xe),Rt(fWA,ae),Rt(dWA,Be),Rt(B9t,W),Rt(C9t,te),Rt(mWA,Re),Bi.isArray(Oe)){if(Oe.length){let mt=e.exposed||(e.exposed={});Oe.forEach((Xt)=>{Object.defineProperty(mt,Xt,{get:()=>A[Xt],set:(Ln)=>A[Xt]=Ln,enumerable:!0})})}else if(!e.exposed)e.exposed={}}if(ie&&e.render===Bi.NOOP)e.render=ie;if(Ne!=null)e.inheritAttrs=Ne;if($e)e.components=$e;if(it)e.directives=it;if(Re)qGn(e)}function g4r(e,n,A=Bi.NOOP){if(Bi.isArray(e))e=DGn(e);for(let i in e){let s=e[i],u;if(Bi.isObject(s))if("default"in s)u=HEt(s.from||i,s.default,!0);else u=HEt(s.from||i);else u=HEt(s);if(Zl.isRef(u))Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>u.value,set:(g)=>u.value=g});else n[i]=u}}function KzA(e,n,A){OAe(Bi.isArray(e)?e.map((i)=>i.bind(n.proxy)):e.bind(n.proxy),n,A)}function CWA(e,n,A,i){let s=i.includes(".")?eWA(A,i):()=>A[i];if(Bi.isString(e)){let u=n[e];if(Bi.isFunction(u))PEt(s,u)}else if(Bi.isFunction(e))PEt(s,e.bind(A));else if(Bi.isObject(e))if(Bi.isArray(e))e.forEach((u)=>CWA(u,n,A,i));else{let u=Bi.isFunction(e.handler)?e.handler.bind(A):n[e.handler];if(Bi.isFunction(u))PEt(s,u,e)}}function jGn(e){let n=e.type,{mixins:A,extends:i}=n,{mixins:s,optionsCache:u,config:{optionMergeStrategies:g}}=e.appContext,d=u.get(n),f;if(d)f=d;else if(!s.length&&!A&&!i)f=n;else{if(f={},s.length)s.forEach((B)=>c9t(f,B,g,!0));c9t(f,n,g)}if(Bi.isObject(n))u.set(n,f);return f}function c9t(e,n,A,i=!1){let{mixins:s,extends:u}=n;if(u)c9t(e,u,A,!0);if(s)s.forEach((g)=>c9t(e,g,A,!0));for(let g in n)if(i&&g==="expose");else{let d=p4r[g]||A&&A[g];e[g]=d?d(e[g],n[g]):n[g]}return e}var p4r={data:RzA,props:YzA,emits:YzA,methods:jEt,computed:jEt,beforeCreate:v7,created:v7,beforeMount:v7,mounted:v7,beforeUpdate:v7,updated:v7,beforeDestroy:v7,beforeUnmount:v7,destroyed:v7,unmounted:v7,activated:v7,deactivated:v7,errorCaptured:v7,serverPrefetch:v7,components:jEt,directives:jEt,watch:d4r,provide:RzA,inject:m4r};function RzA(e,n){if(!n)return e;if(!e)return n;return function(){return Bi.extend(Bi.isFunction(e)?e.call(this,this):e,Bi.isFunction(n)?n.call(this,this):n)}}function m4r(e,n){return jEt(DGn(e),DGn(n))}function DGn(e){if(Bi.isArray(e)){let n={};for(let A=0;A<e.length;A++)n[e[A]]=e[A];return n}return e}function v7(e,n){return e?[...new Set([].concat(e,n))]:n}function jEt(e,n){return e?Bi.extend(Object.create(null),e,n):n}function YzA(e,n){if(e){if(Bi.isArray(e)&&Bi.isArray(n))return[...new Set([...e,...n])];return Bi.extend(Object.create(null),WEt(e),WEt(n!=null?n:{}))}else return n}function d4r(e,n){if(!e)return n;if(!n)return e;let A=Bi.extend(Object.create(null),e);for(let i in n)A[i]=v7(e[i],n[i]);return A}function IWA(){return{app:null,config:{isNativeTag:Bi.NO,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}}var f4r=0;function h4r(e,n){return function(i,s=null){if(!Bi.isFunction(i))i=Bi.extend({},i);if(s!=null&&!Bi.isObject(s))s=null;let u=IWA(),g=new WeakSet,d=[],f=!1,B=u.app={_uid:f4r++,_component:i,_props:s,_container:null,_context:u,_instance:null,version:VWA,get config(){return u.config},set config(E){},use(E,...Q){if(g.has(E));else if(E&&Bi.isFunction(E.install))g.add(E),E.install(B,...Q);else if(Bi.isFunction(E))g.add(E),E(B,...Q);return B},mixin(E){if(!u.mixins.includes(E))u.mixins.push(E);return B},component(E,Q){if(!Q)return u.components[E];return u.components[E]=Q,B},directive(E,Q){if(!Q)return u.directives[E];return u.directives[E]=Q,B},mount(E,Q,w){if(!f){let S=B._ceVNode||pv(i,s);if(S.appContext=u,w===!0)w="svg";else if(w===!1)w=void 0;if(Q&&n)n(S,E);else e(S,E,w);return f=!0,B._container=E,E.__vue_app__=B,Ayt(S.component)}},onUnmount(E){d.push(E)},unmount(){if(f)OAe(d,B._instance,16),e(null,B._container),delete B._container.__vue_app__},provide(E,Q){return u.provides[E]=Q,B},runWithContext(E){let Q=Jqe;Jqe=B;try{return E()}finally{Jqe=Q}}};return B}}var Jqe=null;function b4r(e,n,A=Bi.EMPTY_OBJ){let i=zAe(),s=Bi.camelize(n),u=Bi.hyphenate(n),g=EWA(e,s),d=Zl.customRef((f,B)=>{let E,Q=Bi.EMPTY_OBJ,w;return XzA(()=>{let S=e[s];if(Bi.hasChanged(E,S))E=S,B()}),{get(){return f(),A.get?A.get(E):E},set(S){let G=A.set?A.set(S):S;if(!Bi.hasChanged(G,E)&&!(Q!==Bi.EMPTY_OBJ&&Bi.hasChanged(S,Q)))return;let q=i.vnode.props,P=!!(q&&((n in q)||(s in q)||(u in q))&&((`onUpdate:${n}`in q)||(`onUpdate:${s}`in q)||(`onUpdate:${u}`in q)));if(!P)E=S,B();if(i.emit(`update:${n}`,G),Bi.hasChanged(S,Q)&&(Bi.hasChanged(S,G)&&!Bi.hasChanged(G,w)||P&&Q!==Bi.EMPTY_OBJ&&!Bi.hasChanged(G,E)))B();Q=S,w=G}}});return d[Symbol.iterator]=()=>{let f=0;return{next(){if(f<2)return{value:f++?g||Bi.EMPTY_OBJ:d,done:!1};else return{done:!0}}}},d}var EWA=(e,n)=>{return n==="modelValue"||n==="model-value"?e.modelModifiers:e[`${n}Modifiers`]||e[`${Bi.camelize(n)}Modifiers`]||e[`${Bi.hyphenate(n)}Modifiers`]};function B4r(e,n,...A){if(e.isUnmounted)return;let i=e.vnode.props||Bi.EMPTY_OBJ,s=A,u=n.startsWith("update:"),g=u&&EWA(i,n.slice(7));if(g){if(g.trim)s=A.map((E)=>Bi.isString(E)?E.trim():E);if(g.number)s=A.map(Bi.looseToNumber)}let d,f=i[d=Bi.toHandlerKey(n)]||i[d=Bi.toHandlerKey(Bi.camelize(n))];if(!f&&u)f=i[d=Bi.toHandlerKey(Bi.hyphenate(n))];if(f)OAe(f,e,6,s);let B=i[d+"Once"];if(B){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,OAe(B,e,6,s)}}var C4r=new WeakMap;function yWA(e,n,A=!1){let i=A?C4r:n.emitsCache,s=i.get(e);if(s!==void 0)return s;let u=e.emits,g={},d=!1;if(!Bi.isFunction(e)){let f=(B)=>{let E=yWA(B,n,!0);if(E)d=!0,Bi.extend(g,E)};if(!A&&n.mixins.length)n.mixins.forEach(f);if(e.extends)f(e.extends);if(e.mixins)e.mixins.forEach(f)}if(!u&&!d){if(Bi.isObject(e))i.set(e,null);return null}if(Bi.isArray(u))u.forEach((f)=>g[f]=null);else Bi.extend(g,u);if(Bi.isObject(e))i.set(e,g);return g}function I9t(e,n){if(!e||!Bi.isOn(n))return!1;return n=n.slice(2),n=n==="Once"?n:n.replace(/Once$/,""),Bi.hasOwn(e,n[0].toLowerCase()+n.slice(1))||Bi.hasOwn(e,Bi.hyphenate(n))||Bi.hasOwn(e,n)}function t9t(e){let{type:n,vnode:A,proxy:i,withProxy:s,propsOptions:[u],slots:g,attrs:d,emit:f,render:B,renderCache:E,props:Q,data:w,setupState:S,ctx:G,inheritAttrs:q}=e,P=zEt(e),V,W;try{if(A.shapeFlag&4){let te=s||i,ie=te;V=QR(B.call(ie,te,E,Q,S,w,G)),W=d}else{let te=n;V=QR(te.length>1?te(Q,{attrs:d,slots:g,emit:f}):te(Q,null)),W=n.props?d:E4r(d)}}catch(te){$Et.length=0,Wqe(te,e,1),V=pv(x4)}let z=V;if(W&&q!==!1){let te=Object.keys(W),{shapeFlag:ie}=z;if(te.length){if(ie&7){if(u&&te.some(Bi.isModelListener))W=y4r(W,u);z=Yie(z,W,!1,!0)}}}if(A.dirs)z=Yie(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(A.dirs):A.dirs;if(A.transition)$qe(z,A.transition);return V=z,zEt(P),V}function I4r(e,n=!0){let A;for(let i=0;i<e.length;i++){let s=e[i];if(lCe(s)){if(s.type!==x4||s.children==="v-if")if(A)return;else A=s}else return}return A}var E4r=(e)=>{let n;for(let A in e)if(A==="class"||A==="style"||Bi.isOn(A))(n||(n={}))[A]=e[A];return n},y4r=(e,n)=>{let A={};for(let i in e)if(!Bi.isModelListener(i)||!(i.slice(9)in n))A[i]=e[i];return A};function Q4r(e,n,A){let{props:i,children:s,component:u}=e,{props:g,children:d,patchFlag:f}=n,B=u.emitsOptions;if(n.dirs||n.transition)return!0;if(A&&f>=0){if(f&1024)return!0;if(f&16){if(!i)return!!g;return jzA(i,g,B)}else if(f&8){let E=n.dynamicProps;for(let Q=0;Q<E.length;Q++){let w=E[Q];if(QWA(g,i,w)&&!I9t(B,w))return!0}}}else{if(s||d){if(!d||!d.$stable)return!0}if(i===g)return!1;if(!i)return!!g;if(!g)return!0;return jzA(i,g,B)}return!1}function jzA(e,n,A){let i=Object.keys(n);if(i.length!==Object.keys(e).length)return!0;for(let s=0;s<i.length;s++){let u=i[s];if(QWA(n,e,u)&&!I9t(A,u))return!0}return!1}function QWA(e,n,A){let i=e[A],s=n[A];if(A==="style"&&Bi.isObject(i)&&Bi.isObject(s))return!Bi.looseEqual(i,s);return i!==s}function E9t({vnode:e,parent:n,suspense:A},i){while(n){let s=n.subTree;if(s.suspense&&s.suspense.activeBranch===e)s.suspense.vnode.el=s.el=i,e=s;if(s===e)(e=n.vnode).el=i,n=n.parent;else break}if(A&&A.activeBranch===e)A.vnode.el=i}var _WA={},wWA=()=>Object.create(_WA),kWA=(e)=>Object.getPrototypeOf(e)===_WA;function _4r(e,n,A,i=!1){let s={},u=wWA();e.propsDefaults=Object.create(null),DWA(e,n,s,u);for(let g in e.propsOptions[0])if(!(g in s))s[g]=void 0;if(A)e.props=i?s:Zl.shallowReactive(s);else if(!e.type.props)e.props=u;else e.props=s;e.attrs=u}function w4r(e,n,A,i){let{props:s,attrs:u,vnode:{patchFlag:g}}=e,d=Zl.toRaw(s),[f]=e.propsOptions,B=!1;if((i||g>0)&&!(g&16)){if(g&8){let E=e.vnode.dynamicProps;for(let Q=0;Q<E.length;Q++){let w=E[Q];if(I9t(e.emitsOptions,w))continue;let S=n[w];if(f)if(Bi.hasOwn(u,w)){if(S!==u[w])u[w]=S,B=!0}else{let G=Bi.camelize(w);s[G]=xGn(f,d,G,S,e,!1)}else if(S!==u[w])u[w]=S,B=!0}}}else{if(DWA(e,n,s,u))B=!0;let E;for(let Q in d)if(!n||!Bi.hasOwn(n,Q)&&((E=Bi.hyphenate(Q))===Q||!Bi.hasOwn(n,E)))if(f){if(A&&(A[Q]!==void 0||A[E]!==void 0))s[Q]=xGn(f,d,Q,void 0,e,!0)}else delete s[Q];if(u!==d){for(let Q in u)if(!n||!Bi.hasOwn(n,Q)&&!0)delete u[Q],B=!0}}if(B)Zl.trigger(e.attrs,"set","")}function DWA(e,n,A,i){let[s,u]=e.propsOptions,g=!1,d;if(n)for(let f in n){if(Bi.isReservedProp(f))continue;let B=n[f],E;if(s&&Bi.hasOwn(s,E=Bi.camelize(f)))if(!u||!u.includes(E))A[E]=B;else(d||(d={}))[E]=B;else if(!I9t(e.emitsOptions,f)){if(!(f in i)||B!==i[f])i[f]=B,g=!0}}if(u){let f=Zl.toRaw(A),B=d||Bi.EMPTY_OBJ;for(let E=0;E<u.length;E++){let Q=u[E];A[Q]=xGn(s,f,Q,B[Q],e,!Bi.hasOwn(B,Q))}}return g}function xGn(e,n,A,i,s,u){let g=e[A];if(g!=null){let d=Bi.hasOwn(g,"default");if(d&&i===void 0){let f=g.default;if(g.type!==Function&&!g.skipFactory&&Bi.isFunction(f)){let{propsDefaults:B}=s;if(A in B)i=B[A];else{let E=rYe(s);i=B[A]=f.call(null,n),E()}}else i=f;if(s.ce)s.ce._setProp(A,i)}if(g[0]){if(u&&!d)i=!1;else if(g[1]&&(i===""||i===Bi.hyphenate(A)))i=!0}}return i}var k4r=new WeakMap;function xWA(e,n,A=!1){let i=A?k4r:n.propsCache,s=i.get(e);if(s)return s;let u=e.props,g={},d=[],f=!1;if(!Bi.isFunction(e)){let E=(Q)=>{f=!0;let[w,S]=xWA(Q,n,!0);if(Bi.extend(g,w),S)d.push(...S)};if(!A&&n.mixins.length)n.mixins.forEach(E);if(e.extends)E(e.extends);if(e.mixins)e.mixins.forEach(E)}if(!u&&!f){if(Bi.isObject(e))i.set(e,Bi.EMPTY_ARR);return Bi.EMPTY_ARR}if(Bi.isArray(u))for(let E=0;E<u.length;E++){let Q=Bi.camelize(u[E]);if(HzA(Q))g[Q]=Bi.EMPTY_OBJ}else if(u)for(let E in u){let Q=Bi.camelize(E);if(HzA(Q)){let w=u[E],S=g[Q]=Bi.isArray(w)||Bi.isFunction(w)?{type:w}:Bi.extend({},w),G=S.type,q=!1,P=!0;if(Bi.isArray(G))for(let V=0;V<G.length;++V){let W=G[V],z=Bi.isFunction(W)&&W.name;if(z==="Boolean"){q=!0;break}else if(z==="String")P=!1}else q=Bi.isFunction(G)&&G.name==="Boolean";if(S[0]=q,S[1]=P,q||Bi.hasOwn(S,"default"))d.push(Q)}}let B=[g,d];if(Bi.isObject(e))i.set(e,B);return B}function HzA(e){if(e[0]!=="$"&&!Bi.isReservedProp(e))return!0;return!1}var HGn=(e)=>e==="_"||e==="_ctx"||e==="$stable",PGn=(e)=>Bi.isArray(e)?e.map(QR):[QR(e)],D4r=(e,n,A)=>{if(n._n)return n;let i=MGn((...s)=>{return PGn(n(...s))},A);return i._c=!1,i},FWA=(e,n,A)=>{let i=e._ctx;for(let s in e){if(HGn(s))continue;let u=e[s];if(Bi.isFunction(u))n[s]=D4r(s,u,i);else if(u!=null){let g=PGn(u);n[s]=()=>g}}},vWA=(e,n)=>{let A=PGn(n);e.slots.default=()=>A},SWA=(e,n,A)=>{for(let i in n)if(A||!HGn(i))e[i]=n[i]},x4r=(e,n,A)=>{let i=e.slots=wWA();if(e.vnode.shapeFlag&32){let s=n._;if(s){if(SWA(i,n,A),A)Bi.def(i,"_",s,!0)}else FWA(n,i)}else if(n)vWA(e,n)},F4r=(e,n,A)=>{let{vnode:i,slots:s}=e,u=!0,g=Bi.EMPTY_OBJ;if(i.shapeFlag&32){let d=n._;if(d)if(A&&d===1)u=!1;else SWA(s,n,A);else u=!n.$stable,FWA(n,s);g=n}else if(n)vWA(e,n),g={default:1};if(u){for(let d in s)if(!HGn(d)&&g[d]==null)delete s[d]}},p8=UWA;function v4r(e){return NWA(e)}function S4r(e){return NWA(e,wSr)}function NWA(e,n){let A=Bi.getGlobalThis();A.__VUE__=!0;let{insert:i,remove:s,patchProp:u,createElement:g,createText:d,createComment:f,setText:B,setElementText:E,parentNode:Q,nextSibling:w,setScopeId:S=Bi.NOOP,insertStaticContent:G}=e,q=(Te,Nn,jt,rA=null,fA=null,gn=null,zA=void 0,la=null,$a=!!Nn.dynamicChildren)=>{if(Te===Nn)return;if(Te&&!$Ae(Te,Nn))rA=mA(Te),$n(Te,fA,gn,!0),Te=null;if(Nn.patchFlag===-2)$a=!1,Nn.dynamicChildren=null;let{type:ei,ref:Oi,shapeFlag:zi}=Nn;switch(ei){case Fye:P(Te,Nn,jt,rA);break;case x4:V(Te,Nn,jt,rA);break;case AYe:if(Te==null)W(Nn,jt,rA,zA);break;case WL:$e(Te,Nn,jt,rA,fA,gn,zA,la,$a);break;default:if(zi&1)ie(Te,Nn,jt,rA,fA,gn,zA,la,$a);else if(zi&6)it(Te,Nn,jt,rA,fA,gn,zA,la,$a);else if(zi&64)ei.process(Te,Nn,jt,rA,fA,gn,zA,la,$a,Tn);else if(zi&128)ei.process(Te,Nn,jt,rA,fA,gn,zA,la,$a,Tn)}if(Oi!=null&&fA)tYe(Oi,Te&&Te.ref,gn,Nn||Te,!Nn);else if(Oi==null&&Te&&Te.ref!=null)tYe(Te.ref,null,gn,Te,!0)},P=(Te,Nn,jt,rA)=>{if(Te==null)i(Nn.el=d(Nn.children),jt,rA);else{let fA=Nn.el=Te.el;if(Nn.children!==Te.children)B(fA,Nn.children)}},V=(Te,Nn,jt,rA)=>{if(Te==null)i(Nn.el=f(Nn.children||""),jt,rA);else Nn.el=Te.el},W=(Te,Nn,jt,rA)=>{[Te.el,Te.anchor]=G(Te.children,Nn,jt,rA,Te.el,Te.anchor)},z=({el:Te,anchor:Nn},jt,rA)=>{let fA;while(Te&&Te!==Nn)fA=w(Te),i(Te,jt,rA),Te=fA;i(Nn,jt,rA)},te=({el:Te,anchor:Nn})=>{let jt;while(Te&&Te!==Nn)jt=w(Te),s(Te),Te=jt;s(Nn)},ie=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{if(Nn.type==="svg")zA="svg";else if(Nn.type==="math")zA="mathml";if(Te==null)ae(Nn,jt,rA,fA,gn,zA,la,$a);else{let ei=Te.el&&Te.el._isVueCE?Te.el:null;try{if(ei)ei._beginPatch();Re(Te,Nn,fA,gn,zA,la,$a)}finally{if(ei)ei._endPatch()}}},ae=(Te,Nn,jt,rA,fA,gn,zA,la)=>{let $a,ei,{props:Oi,shapeFlag:zi,transition:Ei,dirs:GA}=Te;if($a=Te.el=g(Te.type,gn,Oi&&Oi.is,Oi),zi&8)E($a,Te.children);else if(zi&16)xe(Te.children,$a,null,rA,fA,EGn(Te,gn),zA,la);if(GA)Rie(Te,null,rA,"created");if(Be($a,Te,Te.scopeId,zA,rA),Oi){for(let tt in Oi)if(tt!=="value"&&!Bi.isReservedProp(tt))u($a,tt,null,Oi[tt],gn,rA);if("value"in Oi)u($a,"value",null,Oi.value,gn);if(ei=Oi.onVnodeBeforeMount)yR(ei,rA,Te)}if(GA)Rie(Te,null,rA,"beforeMount");let _t=GWA(fA,Ei);if(_t)Ei.beforeEnter($a);if(i($a,Nn,jt),(ei=Oi&&Oi.onVnodeMounted)||_t||GA)p8(()=>{try{ei&&yR(ei,rA,Te),_t&&Ei.enter($a),GA&&Rie(Te,null,rA,"mounted")}finally{}},fA)},Be=(Te,Nn,jt,rA,fA)=>{if(jt)S(Te,jt);if(rA)for(let gn=0;gn<rA.length;gn++)S(Te,rA[gn]);if(fA){let gn=fA.subTree;if(Nn===gn||l9t(gn.type)&&(gn.ssContent===Nn||gn.ssFallback===Nn)){let zA=fA.vnode;Be(Te,zA,zA.scopeId,zA.slotScopeIds,fA.parent)}}},xe=(Te,Nn,jt,rA,fA,gn,zA,la,$a=0)=>{for(let ei=$a;ei<Te.length;ei++){let Oi=Te[ei]=la?cCe(Te[ei]):QR(Te[ei]);q(null,Oi,Nn,jt,rA,fA,gn,zA,la)}},Re=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=Nn.el=Te.el,{patchFlag:$a,dynamicChildren:ei,dirs:Oi}=Nn;$a|=Te.patchFlag&16;let zi=Te.props||Bi.EMPTY_OBJ,Ei=Nn.props||Bi.EMPTY_OBJ,GA;if(jt&&Hqe(jt,!1),GA=Ei.onVnodeBeforeUpdate)yR(GA,jt,Nn,Te);if(Oi)Rie(Nn,Te,jt,"beforeUpdate");if(jt&&Hqe(jt,!0),ei&&(!Te.dynamicChildren||Te.dynamicChildren.length!==ei.length))$a=0,zA=!1,ei=null;if(zi.innerHTML&&Ei.innerHTML==null||zi.textContent&&Ei.textContent==null)E(la,"");if(ei)Oe(Te.dynamicChildren,ei,la,jt,rA,EGn(Nn,fA),gn);else if(!zA)Xt(Te,Nn,la,null,jt,rA,EGn(Nn,fA),gn,!1);if($a>0){if($a&16)Ne(la,zi,Ei,jt,fA);else{if($a&2){if(zi.class!==Ei.class)u(la,"class",null,Ei.class,fA)}if($a&4)u(la,"style",zi.style,Ei.style,fA);if($a&8){let _t=Nn.dynamicProps;for(let tt=0;tt<_t.length;tt++){let Ot=_t[tt],Xn=zi[Ot],hn=Ei[Ot];if(hn!==Xn||Ot==="value")u(la,Ot,Xn,hn,fA,jt)}}}if($a&1){if(Te.children!==Nn.children)E(la,Nn.children)}}else if(!zA&&ei==null)Ne(la,zi,Ei,jt,fA);if((GA=Ei.onVnodeUpdated)||Oi)p8(()=>{GA&&yR(GA,jt,Nn,Te),Oi&&Rie(Nn,Te,jt,"updated")},rA)},Oe=(Te,Nn,jt,rA,fA,gn,zA)=>{for(let la=0;la<Nn.length;la++){let $a=Te[la],ei=Nn[la],Oi=$a.el&&($a.type===WL||!$Ae($a,ei)||$a.shapeFlag&198)?Q($a.el):jt;q($a,ei,Oi,null,rA,fA,gn,zA,!0)}},Ne=(Te,Nn,jt,rA,fA)=>{if(Nn!==jt){if(Nn!==Bi.EMPTY_OBJ){for(let gn in Nn)if(!Bi.isReservedProp(gn)&&!(gn in jt))u(Te,gn,Nn[gn],null,fA,rA)}for(let gn in jt){if(Bi.isReservedProp(gn))continue;let zA=jt[gn],la=Nn[gn];if(zA!==la&&gn!=="value")u(Te,gn,la,zA,fA,rA)}if("value"in jt)u(Te,"value",Nn.value,jt.value,fA)}},$e=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{let ei=Nn.el=Te?Te.el:d(""),Oi=Nn.anchor=Te?Te.anchor:d(""),{patchFlag:zi,dynamicChildren:Ei,slotScopeIds:GA}=Nn;if(GA)la=la?la.concat(GA):GA;if(Te==null)i(ei,jt,rA),i(Oi,jt,rA),xe(Nn.children||[],jt,Oi,fA,gn,zA,la,$a);else if(zi>0&&zi&64&&Ei&&Te.dynamicChildren&&Te.dynamicChildren.length===Ei.length){if(Oe(Te.dynamicChildren,Ei,jt,fA,gn,zA,la),Nn.key!=null||fA&&Nn===fA.subTree)JGn(Te,Nn,!0)}else Xt(Te,Nn,jt,Oi,fA,gn,zA,la,$a)},it=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{if(Nn.slotScopeIds=la,Te==null)if(Nn.shapeFlag&512)fA.ctx.activate(Nn,jt,rA,zA,$a);else Me(Nn,jt,rA,fA,gn,zA,$a);else bt(Te,Nn,$a)},Me=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=Te.component=PWA(Te,rA,fA);if(nyt(Te))la.ctx.renderer=Tn;if($WA(la,!1,zA),la.asyncDep){if(fA&&fA.registerDep(la,Rt,zA),!Te.el){let $a=la.subTree=pv(x4);V(null,$a,Nn,jt),Te.placeholder=$a.el}}else Rt(la,Te,Nn,jt,fA,gn,zA)},bt=(Te,Nn,jt)=>{let rA=Nn.component=Te.component;if(Q4r(Te,Nn,jt))if(rA.asyncDep&&!rA.asyncResolved){mt(rA,Nn,jt);return}else rA.next=Nn,rA.update();else Nn.el=Te.el,rA.vnode=Nn},Rt=(Te,Nn,jt,rA,fA,gn,zA)=>{let la=()=>{if(!Te.isMounted){let zi,{el:Ei,props:GA}=Nn,{bm:_t,m:tt,parent:Ot,root:Xn,type:hn}=Te,RA=uCe(Nn);if(Hqe(Te,!1),_t)Bi.invokeArrayFns(_t);if(!RA&&(zi=GA&&GA.onVnodeBeforeMount))yR(zi,Ot,Nn);if(Hqe(Te,!0),Ei&&ja){let ea=()=>{Te.subTree=t9t(Te),ja(Ei,Te.subTree,Te,fA,null)};if(RA&&hn.__asyncHydrate)hn.__asyncHydrate(Ei,Te,ea);else ea()}else{if(Xn.ce&&Xn.ce._hasShadowRoot())Xn.ce._injectChildStyle(hn,Te.parent?Te.parent.type:void 0);let ea=Te.subTree=t9t(Te);q(null,ea,jt,rA,Te,fA,gn),Nn.el=ea.el}if(tt)p8(tt,fA);if(!RA&&(zi=GA&&GA.onVnodeMounted)){let ea=Nn;p8(()=>yR(zi,Ot,ea),fA)}if(Nn.shapeFlag&256||Ot&&uCe(Ot.vnode)&&Ot.vnode.shapeFlag&256)Te.a&&p8(Te.a,fA);Te.isMounted=!0,Nn=jt=rA=null}else{let{next:zi,bu:Ei,u:GA,parent:_t,vnode:tt}=Te;{let ea=MWA(Te);if(ea){if(zi)zi.el=tt.el,mt(Te,zi,zA);ea.asyncDep.then(()=>{p8(()=>{if(!Te.isUnmounted)ei()},fA)});return}}let Ot=zi,Xn;if(Hqe(Te,!1),zi)zi.el=tt.el,mt(Te,zi,zA);else zi=tt;if(Ei)Bi.invokeArrayFns(Ei);if(Xn=zi.props&&zi.props.onVnodeBeforeUpdate)yR(Xn,_t,zi,tt);Hqe(Te,!0);let hn=t9t(Te),RA=Te.subTree;if(Te.subTree=hn,q(RA,hn,Q(RA.el),mA(RA),Te,fA,gn),zi.el=hn.el,Ot===null)E9t(Te,hn.el);if(GA)p8(GA,fA);if(Xn=zi.props&&zi.props.onVnodeUpdated)p8(()=>yR(Xn,_t,zi,tt),fA)}};Te.scope.on();let $a=Te.effect=new Zl.ReactiveEffect(la);Te.scope.off();let ei=Te.update=$a.run.bind($a),Oi=Te.job=$a.runIfDirty.bind($a);Oi.i=Te,Oi.id=Te.uid,$a.scheduler=()=>GGn(Oi),Hqe(Te,!0),ei()},mt=(Te,Nn,jt)=>{Nn.component=Te;let rA=Te.vnode.props;Te.vnode=Nn,Te.next=null,w4r(Te,Nn.props,rA,jt),F4r(Te,Nn.children,jt),Zl.pauseTracking(),SzA(Te),Zl.resetTracking()},Xt=(Te,Nn,jt,rA,fA,gn,zA,la,$a=!1)=>{let ei=Te&&Te.children,Oi=Te?Te.shapeFlag:0,zi=Nn.children,{patchFlag:Ei,shapeFlag:GA}=Nn;if(Ei>0){if(Ei&128){Ft(ei,zi,jt,rA,fA,gn,zA,la,$a);return}else if(Ei&256){Ln(ei,zi,jt,rA,fA,gn,zA,la,$a);return}}if(GA&8){if(Oi&16)un(ei,fA,gn);if(zi!==ei)E(jt,zi)}else if(Oi&16)if(GA&16)Ft(ei,zi,jt,rA,fA,gn,zA,la,$a);else un(ei,fA,gn,!0);else{if(Oi&8)E(jt,"");if(GA&16)xe(zi,jt,rA,fA,gn,zA,la,$a)}},Ln=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{Te=Te||Bi.EMPTY_ARR,Nn=Nn||Bi.EMPTY_ARR;let ei=Te.length,Oi=Nn.length,zi=Math.min(ei,Oi),Ei;for(Ei=0;Ei<zi;Ei++){let GA=Nn[Ei]=$a?cCe(Nn[Ei]):QR(Nn[Ei]);q(Te[Ei],GA,jt,null,fA,gn,zA,la,$a)}if(ei>Oi)un(Te,fA,gn,!0,!1,zi);else xe(Nn,jt,rA,fA,gn,zA,la,$a,zi)},Ft=(Te,Nn,jt,rA,fA,gn,zA,la,$a)=>{let ei=0,Oi=Nn.length,zi=Te.length-1,Ei=Oi-1;while(ei<=zi&&ei<=Ei){let GA=Te[ei],_t=Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]);if($Ae(GA,_t))q(GA,_t,jt,null,fA,gn,zA,la,$a);else break;ei++}while(ei<=zi&&ei<=Ei){let GA=Te[zi],_t=Nn[Ei]=$a?cCe(Nn[Ei]):QR(Nn[Ei]);if($Ae(GA,_t))q(GA,_t,jt,null,fA,gn,zA,la,$a);else break;zi--,Ei--}if(ei>zi){if(ei<=Ei){let GA=Ei+1,_t=GA<Oi?Nn[GA].el:rA;while(ei<=Ei)q(null,Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]),jt,_t,fA,gn,zA,la,$a),ei++}}else if(ei>Ei)while(ei<=zi)$n(Te[ei],fA,gn,!0),ei++;else{let GA=ei,_t=ei,tt=new Map;for(ei=_t;ei<=Ei;ei++){let Io=Nn[ei]=$a?cCe(Nn[ei]):QR(Nn[ei]);if(Io.key!=null)tt.set(Io.key,ei)}let Ot,Xn=0,hn=Ei-_t+1,RA=!1,ea=0,Wi=Array(hn);for(ei=0;ei<hn;ei++)Wi[ei]=0;for(ei=GA;ei<=zi;ei++){let Io=Te[ei];if(Xn>=hn){$n(Io,fA,gn,!0);continue}let Xo;if(Io.key!=null)Xo=tt.get(Io.key);else for(Ot=_t;Ot<=Ei;Ot++)if(Wi[Ot-_t]===0&&$Ae(Io,Nn[Ot])){Xo=Ot;break}if(Xo===void 0)$n(Io,fA,gn,!0);else{if(Wi[Xo-_t]=ei+1,Xo>=ea)ea=Xo;else RA=!0;q(Io,Nn[Xo],jt,null,fA,gn,zA,la,$a),Xn++}}let Ti=RA?N4r(Wi):Bi.EMPTY_ARR;Ot=Ti.length-1;for(ei=hn-1;ei>=0;ei--){let Io=_t+ei,Xo=Nn[Io],eu=Nn[Io+1],hc=Io+1<Oi?eu.el||LWA(eu):rA;if(Wi[ei]===0)q(null,Xo,jt,hc,fA,gn,zA,la,$a);else if(RA)if(Ot<0||ei!==Ti[Ot])nn(Xo,jt,hc,2);else Ot--}}},nn=(Te,Nn,jt,rA,fA=null)=>{let{el:gn,type:zA,transition:la,children:$a,shapeFlag:ei}=Te;if(ei&6){nn(Te.component.subTree,Nn,jt,rA);return}if(ei&128){Te.suspense.move(Nn,jt,rA);return}if(ei&64){zA.move(Te,Nn,jt,Tn);return}if(zA===WL){i(gn,Nn,jt);for(let zi=0;zi<$a.length;zi++)nn($a[zi],Nn,jt,rA);i(Te.anchor,Nn,jt);return}if(zA===AYe){z(Te,Nn,jt);return}if(rA!==2&&ei&1&&la)if(rA===0)if(la.persisted&&!gn[bz])i(gn,Nn,jt);else la.beforeEnter(gn),i(gn,Nn,jt),p8(()=>la.enter(gn),fA);else{let{leave:zi,delayLeave:Ei,afterLeave:GA}=la,_t=()=>{if(Te.ctx.isUnmounted)s(gn);else i(gn,Nn,jt)},tt=()=>{let Ot=gn._isLeaving||!!gn[bz];if(gn._isLeaving)gn[bz](!0);if(la.persisted&&!Ot)_t();else zi(gn,()=>{_t(),GA&&GA()})};if(Ei)Ei(gn,_t,tt);else tt()}else i(gn,Nn,jt)},$n=(Te,Nn,jt,rA=!1,fA=!1)=>{let{type:gn,props:zA,ref:la,children:$a,dynamicChildren:ei,shapeFlag:Oi,patchFlag:zi,dirs:Ei,cacheIndex:GA,memo:_t}=Te;if(zi===-2)fA=!1;if(la!=null)Zl.pauseTracking(),tYe(la,null,jt,Te,!0),Zl.resetTracking();if(GA!=null)Nn.renderCache[GA]=void 0;if(Oi&256){Nn.ctx.deactivate(Te);return}let tt=Oi&1&&Ei,Ot=!uCe(Te),Xn;if(Ot&&(Xn=zA&&zA.onVnodeBeforeUnmount))yR(Xn,Nn,Te);if(Oi&6)JA(Te.component,jt,rA);else{if(Oi&128){Te.suspense.unmount(jt,rA);return}if(tt)Rie(Te,null,Nn,"beforeUnmount");if(Oi&64)Te.type.remove(Te,Nn,jt,Tn,rA);else if(ei&&!ei.hasOnce&&(gn!==WL||zi>0&&zi&64))un(ei,Nn,jt,!1,!0);else if(gn===WL&&zi&384||!fA&&Oi&16)un($a,Nn,jt);if(rA)Ht(Te)}let hn=_t!=null&&GA==null;if(Ot&&(Xn=zA&&zA.onVnodeUnmounted)||tt||hn)p8(()=>{if(Xn&&yR(Xn,Nn,Te),tt&&Rie(Te,null,Nn,"unmounted"),hn)Te.el=null},jt)},Ht=(Te)=>{let{type:Nn,el:jt,anchor:rA,transition:fA}=Te;if(Nn===WL){tA(jt,rA);return}if(Nn===AYe){te(Te);return}let gn=()=>{if(s(jt),fA&&!fA.persisted&&fA.afterLeave)fA.afterLeave()};if(Te.shapeFlag&1&&fA&&!fA.persisted){let{leave:zA,delayLeave:la}=fA,$a=()=>zA(jt,gn);if(la)la(Te.el,gn,$a);else $a()}else gn()},tA=(Te,Nn)=>{let jt;while(Te!==Nn)jt=w(Te),s(Te),Te=jt;s(Nn)},JA=(Te,Nn,jt)=>{let{bum:rA,scope:fA,job:gn,subTree:zA,um:la,m:$a,a:ei}=Te;if(u9t($a),u9t(ei),rA)Bi.invokeArrayFns(rA);if(fA.stop(),gn)gn.flags|=8,$n(zA,Te,Nn,jt);if(la)p8(la,Nn);p8(()=>{Te.isUnmounted=!0},Nn)},un=(Te,Nn,jt,rA=!1,fA=!1,gn=0)=>{for(let zA=gn;zA<Te.length;zA++)$n(Te[zA],Nn,jt,rA,fA)},mA=(Te)=>{if(Te.shapeFlag&6)return mA(Te.component.subTree);if(Te.shapeFlag&128)return Te.suspense.next();let Nn=w(Te.anchor||Te.el),jt=Nn&&Nn[tWA];return jt?w(jt):Nn},cA=!1,vn=(Te,Nn,jt)=>{let rA;if(Te==null){if(Nn._vnode)$n(Nn._vnode,null,null,!0),rA=Nn._vnode.component}else q(Nn._vnode||null,Te,Nn,null,null,null,jt);if(Nn._vnode=Te,!cA)cA=!0,SzA(rA),i9t(),cA=!1},Tn={p:q,um:$n,m:nn,r:Ht,mt:Me,mc:xe,pc:Xt,pbc:Oe,n:mA,o:e},Cn,ja;if(n)[Cn,ja]=n(Tn);return{render:vn,hydrate:Cn,createApp:h4r(vn,Cn)}}function EGn({type:e,props:n},A){return A==="svg"&&e==="foreignObject"||A==="mathml"&&e==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:A}function Hqe({effect:e,job:n},A){if(A)e.flags|=32,n.flags|=4;else e.flags&=-33,n.flags&=-5}function GWA(e,n){return(!e||e&&!e.pendingBranch)&&n&&!n.persisted}function JGn(e,n,A=!1){let i=e.children,s=n.children;if(Bi.isArray(i)&&Bi.isArray(s))for(let u=0;u<i.length;u++){let g=i[u],d=s[u];if(d.shapeFlag&1&&!d.dynamicChildren){if(d.patchFlag<=0||d.patchFlag===32)d=s[u]=cCe(s[u]),d.el=g.el;if(!A&&d.patchFlag!==-2)JGn(g,d)}if(d.type===Fye){if(d.patchFlag===-1)d=s[u]=cCe(d);d.el=g.el}if(d.type===x4&&!d.el)d.el=g.el}}function N4r(e){let n=e.slice(),A=[0],i,s,u,g,d,f=e.length;for(i=0;i<f;i++){let B=e[i];if(B!==0){if(s=A[A.length-1],e[s]<B){n[i]=s,A.push(i);continue}u=0,g=A.length-1;while(u<g)if(d=u+g>>1,e[A[d]]<B)u=d+1;else g=d;if(B<e[A[u]]){if(u>0)n[i]=A[u-1];A[u]=i}}}u=A.length,g=A[u-1];while(u-- >0)A[u]=g,g=n[g];return A}function MWA(e){let n=e.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return MWA(n)}function u9t(e){if(e)for(let n=0;n<e.length;n++)e[n].flags|=8}function LWA(e){if(e.placeholder)return e.placeholder;let n=e.component;if(n)return LWA(n.subTree);return null}var l9t=(e)=>e.__isSuspense,FGn=0,G4r={name:"Suspense",__isSuspense:!0,process(e,n,A,i,s,u,g,d,f,B){if(e==null)L4r(n,A,i,s,u,g,d,f,B);else{if(u&&u.deps>0&&!e.suspense.isInFallback){n.suspense=e.suspense,n.suspense.vnode=n,n.el=e.el;return}q4r(e,n,A,i,s,g,d,f,B)}},hydrate:U4r,normalize:T4r},M4r=G4r;function ZEt(e,n){let A=e.props&&e.props[n];if(Bi.isFunction(A))A()}function L4r(e,n,A,i,s,u,g,d,f){let{p:B,o:{createElement:E}}=f,Q=E("div"),w=e.suspense=qWA(e,s,i,n,Q,A,u,g,d,f);if(B(null,w.pendingBranch=e.ssContent,Q,null,i,w,u,g),w.deps>0)ZEt(e,"onPending"),ZEt(e,"onFallback"),B(null,e.ssFallback,n,A,i,null,u,g),nYe(w,e.ssFallback);else w.resolve(!1,!0)}function q4r(e,n,A,i,s,u,g,d,{p:f,um:B,o:{createElement:E}}){let Q=n.suspense=e.suspense;Q.vnode=n,n.el=e.el;let{ssContent:w,ssFallback:S}=n,{activeBranch:G,pendingBranch:q,isInFallback:P,isHydrating:V}=Q;if(q)if(Q.pendingBranch=w,$Ae(q,w)){if(f(q,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else if(P){if(!V)f(G,S,A,i,s,null,u,g,d),nYe(Q,S)}}else{if(Q.pendingId=FGn++,V)Q.isHydrating=!1,Q.activeBranch=q;else B(q,s,Q);if(Q.deps=0,Q.effects.length=0,Q.hiddenContainer=E("div"),P)if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else f(G,S,A,i,s,null,u,g,d),nYe(Q,S);else if(G&&$Ae(G,w))f(G,w,A,i,s,Q,u,g,d),Q.resolve(!0);else if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve()}else if(G&&$Ae(G,w))f(G,w,A,i,s,Q,u,g,d),nYe(Q,w);else{if(ZEt(n,"onPending"),Q.pendingBranch=w,w.shapeFlag&512)Q.pendingId=w.component.suspenseId;else Q.pendingId=FGn++;if(f(null,w,Q.hiddenContainer,null,s,Q,u,g,d),Q.deps<=0)Q.resolve();else{let{timeout:W,pendingId:z}=Q;if(W>0)setTimeout(()=>{if(Q.pendingId===z)Q.fallback(S)},W);else if(W===0)Q.fallback(S)}}}function qWA(e,n,A,i,s,u,g,d,f,B,E=!1){let{p:Q,m:w,um:S,n:G,o:{parentNode:q,remove:P}}=B,V,W=K4r(e);if(W){if(n&&n.pendingBranch)V=n.pendingId,n.deps++}let z=e.props?Bi.toNumber(e.props.timeout):void 0,te=u,ie={vnode:e,parent:n,parentComponent:A,namespace:g,container:i,hiddenContainer:s,deps:0,pendingId:FGn++,timeout:typeof z==="number"?z:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!E,isHydrating:E,isUnmounted:!1,effects:[],resolve(ae=!1,Be=!1){let{vnode:xe,activeBranch:Re,pendingBranch:Oe,pendingId:Ne,effects:$e,parentComponent:it,container:Me,isInFallback:bt}=ie,Rt=!1;if(ie.isHydrating)ie.isHydrating=!1;else if(!ae){Rt=Re&&Oe.transition&&Oe.transition.mode==="out-in";let Ln=!1;if(Rt)Re.transition.afterLeave=()=>{if(Ne===ie.pendingId){if(w(Oe,Me,u===te&&!Ln?G(Re):u,0),a9t($e),bt&&xe.ssFallback)xe.ssFallback.el=null}};if(Re&&!ie.isFallbackMountPending){if(q(Re.el)===Me)u=G(Re),Ln=!0;if(S(Re,it,ie,!0),!Rt&&bt&&xe.ssFallback)p8(()=>xe.ssFallback.el=null,ie)}if(!Rt)w(Oe,Me,u,0)}ie.isFallbackMountPending=!1,nYe(ie,Oe),ie.pendingBranch=null,ie.isInFallback=!1;let mt=ie.parent,Xt=!1;while(mt){if(mt.pendingBranch){mt.effects.push(...$e),Xt=!0;break}mt=mt.parent}if(!Xt&&!Rt)a9t($e);if(ie.effects=[],W){if(n&&n.pendingBranch&&V===n.pendingId){if(n.deps--,n.deps===0&&!Be)n.resolve()}}ZEt(xe,"onResolve")},fallback(ae){if(!ie.pendingBranch)return;let{vnode:Be,activeBranch:xe,parentComponent:Re,container:Oe,namespace:Ne}=ie;ZEt(Be,"onFallback");let $e=G(xe),it=()=>{if(ie.isFallbackMountPending=!1,!ie.isInFallback)return;Q(null,ae,Oe,$e,Re,null,Ne,d,f),nYe(ie,ae)},Me=ae.transition&&ae.transition.mode==="out-in";if(Me)ie.isFallbackMountPending=!0,xe.transition.afterLeave=it;if(ie.isInFallback=!0,S(xe,Re,null,!0),!Me)it()},move(ae,Be,xe){ie.activeBranch&&w(ie.activeBranch,ae,Be,xe),ie.container=ae},next(){return ie.activeBranch&&G(ie.activeBranch)},registerDep(ae,Be,xe){let Re=!!ie.pendingBranch;if(Re)ie.deps++;let Oe=ae.vnode.el;ae.asyncDep.catch((Ne)=>{Wqe(Ne,ae,0)}).then((Ne)=>{if(ae.isUnmounted||ie.isUnmounted||ie.pendingId!==ae.suspenseId)return;eyt(),ae.asyncResolved=!0;let{vnode:$e}=ae;if(vGn(ae,Ne,!1),Oe)$e.el=Oe;let it=!Oe&&ae.subTree.el;if(Be(ae,$e,q(Oe||ae.subTree.el),Oe?null:G(ae.subTree),ie,g,xe),it)$e.placeholder=null,P(it);if(E9t(ae,$e.el),Re&&--ie.deps===0)ie.resolve()})},unmount(ae,Be){if(ie.isUnmounted=!0,ie.activeBranch)S(ie.activeBranch,A,ae,Be);if(ie.pendingBranch)S(ie.pendingBranch,A,ae,Be)}};return ie}function U4r(e,n,A,i,s,u,g,d,f){let B=n.suspense=qWA(n,i,A,e.parentNode,document.createElement("div"),null,s,u,g,d,!0),E=f(e,B.pendingBranch=n.ssContent,A,B,u,g);if(B.deps===0)B.resolve(!1,!0);return E}function T4r(e){let{shapeFlag:n,children:A}=e,i=n&32;e.ssContent=PzA(i?A.default:A),e.ssFallback=i?PzA(A.fallback):pv(x4)}function PzA(e){let n;if(Bi.isFunction(e)){let A=Oqe&&e._c;if(A)e._d=!1,VEt();if(e=e(),A)e._d=!0,n=ZL,TWA()}if(Bi.isArray(e))e=I4r(e);if(e=QR(e),n&&!e.dynamicChildren)e.dynamicChildren=n.filter((A)=>A!==e);return e}function UWA(e,n){if(n&&n.pendingBranch)if(Bi.isArray(e))n.effects.push(...e);else n.effects.push(e);else a9t(e)}function nYe(e,n){e.activeBranch=n;let{vnode:A,parentComponent:i}=e,s=n.el;while(!s&&n.component)n=n.component.subTree,s=n.el;if(A.el=s,i&&i.subTree===A)i.vnode.el=s,E9t(i,s)}function K4r(e){let n=e.props&&e.props.suspensible;return n!=null&&n!==!1}var WL=Symbol.for("v-fgt"),Fye=Symbol.for("v-txt"),x4=Symbol.for("v-cmt"),AYe=Symbol.for("v-stc"),$Et=[],ZL=null;function VEt(e=!1){$Et.push(ZL=e?null:[])}function TWA(){$Et.pop(),ZL=$Et[$Et.length-1]||null}var Oqe=1;function XEt(e,n=!1){if(Oqe+=e,e<0&&ZL&&n)ZL.hasOnce=!0}function KWA(e){if(e.dynamicChildren=Oqe>0?ZL||Bi.EMPTY_ARR:null,TWA(),Oqe>0&&ZL)ZL.push(e);return e}function R4r(e,n,A,i,s,u){return KWA($Gn(e,n,A,i,s,u,!0))}function g9t(e,n,A,i,s){return KWA(pv(e,n,A,i,s,!0))}function lCe(e){return e?e.__v_isVNode===!0:!1}function $Ae(e,n){return e.type===n.type&&e.key===n.key}function Y4r(e){}var RWA=({key:e})=>e!=null?e:null,n9t=({ref:e,ref_key:n,ref_for:A})=>{if(typeof e==="number")e=""+e;return e!=null?Bi.isString(e)||Zl.isRef(e)||Bi.isFunction(e)?{i:zM,r:e,k:n,f:!!A}:e:null};function $Gn(e,n=null,A=null,i=0,s=null,u=e===WL?0:1,g=!1,d=!1){let f={__v_isVNode:!0,__v_skip:!0,type:e,props:n,key:n&&RWA(n),ref:n&&n9t(n),scopeId:f9t,slotScopeIds:null,children:A,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:u,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:zM};if(d){if(p9t(f,A),u&128)e.normalize(f)}else if(A)f.shapeFlag|=Bi.isString(A)?8:16;if(Oqe>0&&!g&&ZL&&(f.patchFlag>0||u&6)&&f.patchFlag!==32)ZL.push(f);return f}var pv=j4r;function j4r(e,n=null,A=null,i=0,s=null,u=!1){if(!e||e===bWA)e=x4;if(lCe(e)){let d=Yie(e,n,!0);if(A)p9t(d,A);if(Oqe>0&&!u&&ZL)if(d.shapeFlag&6)ZL[ZL.indexOf(e)]=d;else ZL.push(d);return d.patchFlag=-2,d}if(Z4r(e))e=e.__vccOpts;if(n){n=YWA(n);let{class:d,style:f}=n;if(d&&!Bi.isString(d))n.class=Bi.normalizeClass(d);if(Bi.isObject(f)){if(Zl.isProxy(f)&&!Bi.isArray(f))f=Bi.extend({},f);n.style=Bi.normalizeStyle(f)}}let g=Bi.isString(e)?1:l9t(e)?128:nWA(e)?64:Bi.isObject(e)?4:Bi.isFunction(e)?2:0;return $Gn(e,n,A,i,s,g,u,!0)}function YWA(e){if(!e)return null;return Zl.isProxy(e)||kWA(e)?Bi.extend({},e):e}function Yie(e,n,A=!1,i=!1){let{props:s,ref:u,patchFlag:g,children:d,transition:f}=e,B=n?HWA(s||{},n):s,E={__v_isVNode:!0,__v_skip:!0,type:e.type,props:B,key:B&&RWA(B),ref:n&&n.ref?A&&u?Bi.isArray(u)?u.concat(n9t(n)):[u,n9t(n)]:n9t(n):u,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:n&&e.type!==WL?g===-1?16:g|16:g,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yie(e.ssContent),ssFallback:e.ssFallback&&Yie(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};if(f&&i)$qe(E,f.clone(E));return E}function OGn(e=" ",n=0){return pv(Fye,null,e,n)}function H4r(e,n){let A=pv(AYe,null,e);return A.staticCount=n,A}function jWA(e="",n=!1){return n?(VEt(),g9t(x4,null,e)):pv(x4,null,e)}function QR(e){if(e==null||typeof e==="boolean")return pv(x4);else if(Bi.isArray(e))return pv(WL,null,e.slice());else if(lCe(e))return cCe(e);else return pv(Fye,null,String(e))}function cCe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yie(e)}function p9t(e,n){let A=0,{shapeFlag:i}=e;if(n==null)n=null;else if(Bi.isArray(n))A=16;else if(typeof n==="object")if(i&65){let s=n.default;if(s)s._c&&(s._d=!1),p9t(e,s()),s._c&&(s._d=!0);return}else{A=32;let s=n._;if(!s&&!kWA(n))n._ctx=zM;else if(s===3&&zM)if(zM.slots._===1)n._=1;else n._=2,e.patchFlag|=1024}else if(Bi.isFunction(n)){if(i&65){p9t(e,{default:n});return}n={default:n,_ctx:zM},A=32}else if(n=String(n),i&64)A=16,n=[OGn(n)];else A=8;e.children=n,e.shapeFlag|=A}function HWA(...e){let n={};for(let A=0;A<e.length;A++){let i=e[A];for(let s in i)if(s==="class"){if(n.class!==i.class)n.class=Bi.normalizeClass([n.class,i.class])}else if(s==="style")n.style=Bi.normalizeStyle([n.style,i.style]);else if(Bi.isOn(s)){let u=n[s],g=i[s];if(g&&u!==g&&!(Bi.isArray(u)&&u.includes(g)))n[s]=u?[].concat(u,g):g;else if(g==null&&u==null&&!Bi.isModelListener(s))n[s]=g}else if(s!=="")n[s]=i[s]}return n}function yR(e,n,A,i=null){OAe(e,n,7,[A,i])}var P4r=IWA(),J4r=0;function PWA(e,n,A){let i=e.type,s=(n?n.appContext:e.appContext)||P4r,u={uid:J4r++,vnode:e,type:i,parent:n,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Zl.EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(s.provides),ids:n?n.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xWA(i,s),emitsOptions:yWA(i,s),emit:null,emitted:null,propsDefaults:Bi.EMPTY_OBJ,inheritAttrs:i.inheritAttrs,ctx:Bi.EMPTY_OBJ,data:Bi.EMPTY_OBJ,props:Bi.EMPTY_OBJ,attrs:Bi.EMPTY_OBJ,slots:Bi.EMPTY_OBJ,refs:Bi.EMPTY_OBJ,setupState:Bi.EMPTY_OBJ,setupContext:null,suspense:A,suspenseId:A?A.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};if(u.ctx={_:u},u.root=n?n.root:u,u.emit=B4r.bind(null,u),e.ce)e.ce(u);return u}var OM=null,zAe=()=>OM||zM,m9t,aYe;{let e=Bi.getGlobalThis(),n=(A,i)=>{let s;if(!(s=e[A]))s=e[A]=[];return s.push(i),(u)=>{if(s.length>1)s.forEach((g)=>g(u));else s[0](u)}};m9t=n("__VUE_INSTANCE_SETTERS__",(A)=>OM=A),aYe=n("__VUE_SSR_SETTERS__",(A)=>zqe=A)}var rYe=(e)=>{let n=OM;return m9t(e),e.scope.on(),()=>{e.scope.off(),m9t(n)}},eyt=()=>{OM&&OM.scope.off(),m9t(null)};function JWA(e){return e.vnode.shapeFlag&4}var zqe=!1;function $WA(e,n=!1,A=!1){n&&aYe(n);let{props:i,children:s}=e.vnode,u=JWA(e);_4r(e,i,u,n),x4r(e,s,A||n);let g=u?$4r(e,n):void 0;return n&&aYe(!1),g}function $4r(e,n){let A=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wGn);let{setup:i}=A;if(i){Zl.pauseTracking();let s=e.setupContext=i.length>1?zWA(e):null,u=rYe(e),g=iYe(i,e,0,[e.props,s]),d=Bi.isPromise(g);if(Zl.resetTracking(),u(),(d||e.sp)&&!uCe(e))qGn(e);if(d)if(g.then(eyt,eyt),n)return g.then((f)=>{vGn(e,f,n)}).catch((f)=>{Wqe(f,e,0)});else e.asyncDep=g;else vGn(e,g,n)}else OWA(e,n)}function vGn(e,n,A){if(Bi.isFunction(n))if(e.type.__ssrInlineRender)e.ssrRender=n;else e.render=n;else if(Bi.isObject(n))e.setupState=Zl.proxyRefs(n);OWA(e,A)}var d9t,SGn;function O4r(e){d9t=e,SGn=(n)=>{if(n.render._rc)n.withProxy=new Proxy(n.ctx,ZSr)}}var z4r=()=>!d9t;function OWA(e,n,A){let i=e.type;if(!e.render){if(!n&&d9t&&!i.render){let s=i.template||jGn(e).template;if(s){let{isCustomElement:u,compilerOptions:g}=e.appContext.config,{delimiters:d,compilerOptions:f}=i,B=Bi.extend(Bi.extend({isCustomElement:u,delimiters:d},g),f);i.render=d9t(s,B)}}if(e.render=i.render||Bi.NOOP,SGn)SGn(e)}{let s=rYe(e);Zl.pauseTracking();try{l4r(e)}finally{Zl.resetTracking(),s()}}}var W4r={get(e,n){return Zl.track(e,"get",""),e[n]}};function zWA(e){let n=(A)=>{e.exposed=A||{}};return{attrs:new Proxy(e.attrs,W4r),slots:e.slots,emit:e.emit,expose:n}}function Ayt(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Zl.proxyRefs(Zl.markRaw(e.exposed)),{get(n,A){if(A in n)return n[A];else if(A in JEt)return JEt[A](e)},has(n,A){return A in n||A in JEt}}));else return e.proxy}function NGn(e,n=!0){return Bi.isFunction(e)?e.displayName||e.name:e.name||n&&e.__name}function Z4r(e){return Bi.isFunction(e)&&"__vccOpts"in e}var WWA=(e,n)=>{return Zl.computed(e,n,zqe)};function V4r(e,n,A){try{XEt(-1);let i=arguments.length;if(i===2)if(Bi.isObject(n)&&!Bi.isArray(n)){if(lCe(n))return pv(e,null,[n]);return pv(e,n)}else return pv(e,null,n);else{if(i>3)A=Array.prototype.slice.call(arguments,2);else if(i===3&&lCe(A))A=[A];return pv(e,n,A)}}finally{XEt(1)}}function X4r(){return}function e8r(e,n,A,i){let s=A[i];if(s&&ZWA(s,e))return s;let u=n();return u.memo=e.slice(),u.cacheIndex=i,A[i]=u}function ZWA(e,n){let A=e.memo;if(A.length!=n.length)return!1;for(let i=0;i<A.length;i++)if(Bi.hasChanged(A[i],n[i]))return!1;if(Oqe>0&&ZL)ZL.push(e);return!0}var VWA="3.5.39",t8r=Bi.NOOP,n8r=iSr,A8r=void 0,a8r=Bi.NOOP,i8r={createComponentInstance:PWA,setupComponent:$WA,renderComponentRoot:t9t,setCurrentRenderingInstance:zEt,isVNode:lCe,normalizeVNode:QR,getComponentPublicInstance:Ayt,ensureValidVNode:YGn,pushWarningContext:tSr,popWarningContext:nSr},r8r=i8r,o8r=null,s8r=null,c8r=null;XWA.EffectScope=Zl.EffectScope;XWA.ReactiveEffect=Zl.ReactiveEffect;XWA.TrackOpTypes=Zl.TrackOpTypes;XWA.TriggerOpTypes=Zl.TriggerOpTypes;XWA.customRef=Zl.customRef;XWA.effect=Zl.effect;XWA.effectScope=Zl.effectScope;XWA.getCurrentScope=Zl.getCurrentScope;XWA.getCurrentWatcher=Zl.getCurrentWatcher;XWA.isProxy=Zl.isProxy;XWA.isReactive=Zl.isReactive;XWA.isReadonly=Zl.isReadonly;XWA.isRef=Zl.isRef;XWA.isShallow=Zl.isShallow;XWA.markRaw=Zl.markRaw;XWA.onScopeDispose=Zl.onScopeDispose;XWA.onWatcherCleanup=Zl.onWatcherCleanup;XWA.proxyRefs=Zl.proxyRefs;XWA.reactive=Zl.reactive;XWA.readonly=Zl.readonly;XWA.ref=Zl.ref;XWA.shallowReactive=Zl.shallowReactive;XWA.shallowReadonly=Zl.shallowReadonly;XWA.shallowRef=Zl.shallowRef;XWA.stop=Zl.stop;XWA.toRaw=Zl.toRaw;XWA.toRef=Zl.toRef;XWA.toRefs=Zl.toRefs;XWA.toValue=Zl.toValue;XWA.triggerRef=Zl.triggerRef;XWA.unref=Zl.unref;XWA.camelize=Bi.camelize;XWA.capitalize=Bi.capitalize;XWA.normalizeClass=Bi.normalizeClass;XWA.normalizeProps=Bi.normalizeProps;XWA.normalizeStyle=Bi.normalizeStyle;XWA.toDisplayString=Bi.toDisplayString;XWA.toHandlerKey=Bi.toHandlerKey;XWA.BaseTransition=ISr;XWA.BaseTransitionPropsValidators=aWA;XWA.Comment=x4;XWA.DeprecationTypes=c8r;XWA.ErrorCodes=aSr;XWA.ErrorTypeStrings=n8r;XWA.Fragment=WL;XWA.KeepAlive=RSr;XWA.Static=AYe;XWA.Suspense=M4r;XWA.Teleport=BSr;XWA.Text=Fye;XWA.assertNumber=ASr;XWA.callWithAsyncErrorHandling=OAe;XWA.callWithErrorHandling=iYe;XWA.cloneVNode=Yie;XWA.compatUtils=s8r;XWA.computed=WWA;XWA.createBlock=g9t;XWA.createCommentVNode=jWA;XWA.createElementBlock=R4r;XWA.createElementVNode=$Gn;XWA.createHydrationRenderer=S4r;XWA.createPropsRestProxy=c4r;XWA.createRenderer=v4r;XWA.createSlots=OSr;XWA.createStaticVNode=H4r;XWA.createTextVNode=OGn;XWA.createVNode=pv;XWA.defineAsyncComponent=TSr;XWA.defineComponent=sWA;XWA.defineEmits=XSr;XWA.defineExpose=e4r;XWA.defineModel=A4r;XWA.defineOptions=t4r;XWA.defineProps=VSr;XWA.defineSlots=n4r;XWA.devtools=A8r;XWA.getCurrentInstance=zAe;XWA.getTransitionRawChildren=LGn;XWA.guardReactiveProps=YWA;XWA.h=V4r;XWA.handleError=Wqe;XWA.hasInjectionContext=gSr;XWA.hydrateOnIdle=NSr;XWA.hydrateOnInteraction=qSr;XWA.hydrateOnMediaQuery=LSr;XWA.hydrateOnVisible=MSr;XWA.initCustomFormatter=X4r;XWA.inject=HEt;XWA.isMemoSame=ZWA;XWA.isRuntimeOnly=z4r;XWA.isVNode=lCe;XWA.mergeDefaults=o4r;XWA.mergeModels=s4r;XWA.mergeProps=HWA;XWA.nextTick=$zA;XWA.onActivated=cWA;XWA.onBeforeMount=gWA;XWA.onBeforeUnmount=B9t;XWA.onBeforeUpdate=pWA;XWA.onDeactivated=uWA;XWA.onErrorCaptured=hWA;XWA.onMounted=b9t;XWA.onRenderTracked=fWA;XWA.onRenderTriggered=dWA;XWA.onServerPrefetch=mWA;XWA.onUnmounted=C9t;XWA.onUpdated=TGn;XWA.openBlock=VEt;XWA.popScopeId=cSr;XWA.provide=WzA;XWA.pushScopeId=sSr;XWA.queuePostFlushCb=a9t;XWA.registerRuntimeCompiler=O4r;XWA.renderList=$Sr;XWA.renderSlot=zSr;XWA.resolveComponent=HSr;XWA.resolveDirective=JSr;XWA.resolveDynamicComponent=PSr;XWA.resolveFilter=o8r;XWA.resolveTransitionHooks=r9t;XWA.setBlockTracking=XEt;XWA.setDevtoolsHook=a8r;XWA.setTransitionHooks=$qe;XWA.ssrContextKey=ZzA;XWA.ssrUtils=r8r;XWA.toHandlers=WSr;XWA.transformVNodeArgs=Y4r;XWA.useAttrs=r4r;XWA.useId=ESr;XWA.useModel=b4r;XWA.useSSRContext=VzA;XWA.useSlots=i4r;XWA.useTemplateRef=ySr;XWA.useTransitionState=AWA;XWA.version=VWA;XWA.warn=t8r;XWA.watch=PEt;XWA.watchEffect=pSr;XWA.watchPostEffect=mSr;XWA.watchSyncEffect=XzA;XWA.withAsyncContext=u4r;XWA.withCtx=MGn;XWA.withDefaults=a4r;XWA.withDirectives=lSr;XWA.withMemo=e8r;XWA.withScopeId=uSr});import{readFileSync as O3r}from"fs";import{resolve as z3r,dirname as W3r}from"path";import{parse as Z3r,compileScript as V3r,compileTemplate as X3r}from"@vue/compiler-sfc";function rZA(){Q9t.clear()}async function _9t(e,n,A,i={}){let s=n?`${e}::${A9r(A)}`:null;if(s&&Q9t.has(s))return Q9t.get(s);let u=O3r(e,"utf-8"),g=await zGn(u,e,n,A,i);if(s)Q9t.set(s,g);return g}async function zGn(e,n,A,i,s={}){let{descriptor:u,errors:g}=Z3r(e,{filename:n});if(g.length)throw Error(`@arcforge/vstr: parse errors in ${n}:
2014
2014
  ${g.map((Ne)=>Ne.message).join(`
2015
- `)}`);if(!u.template)throw Error(`@axon/vstr: ${n} has no <template> block`);e9r(e,u,n);let d=n.replace(/[^a-zA-Z0-9]/g,"_"),f=u.scriptSetup?.content??u.script?.content??"",B=await t9r(f,n,A,i,s),E=Object.keys(B),Q=Object.values(B),w;if(u.scriptSetup||u.script)w=V3r(u,{id:d,inlineTemplate:!0,templateOptions:{ssr:!0,compilerOptions:{runtimeModuleName:"@vue/runtime-core"}}}).content;else{let Ne=X3r({source:u.template.content,filename:n,id:d,scoped:!1,ssr:!0,ssrCssVars:[],compilerOptions:{runtimeModuleName:"@vue/runtime-core"}});if(Ne.errors.length)throw Error(`@axon/vstr: template compile errors in ${n}:
2015
+ `)}`);if(!u.template)throw Error(`@arcforge/vstr: ${n} has no <template> block`);e9r(e,u,n);let d=n.replace(/[^a-zA-Z0-9]/g,"_"),f=u.scriptSetup?.content??u.script?.content??"",B=await t9r(f,n,A,i,s),E=Object.keys(B),Q=Object.values(B),w;if(u.scriptSetup||u.script)w=V3r(u,{id:d,inlineTemplate:!0,templateOptions:{ssr:!0,compilerOptions:{runtimeModuleName:"@vue/runtime-core"}}}).content;else{let Ne=X3r({source:u.template.content,filename:n,id:d,scoped:!1,ssr:!0,ssrCssVars:[],compilerOptions:{runtimeModuleName:"@vue/runtime-core"}});if(Ne.errors.length)throw Error(`@arcforge/vstr: template compile errors in ${n}:
2016
2016
  ${Ne.errors.map((it)=>typeof it==="string"?it:it.message).join(`
2017
2017
  `)}`);w=`export default { ssrRender }
2018
2018
  ${aZA(await iZA(Ne.code)).replace(/^export\s+function\s+ssrRender/,"function ssrRender").replace(/^export\s+/gm,"")}`}let S=await iZA(w),G=new Set(["default","__esModule"]),q=Object.keys(tZA).filter((Ne)=>!G.has(Ne)),P=Object.keys(nZA).filter((Ne)=>!G.has(Ne)&&Ne!=="render"&&Ne!=="ssrRender"&&!q.includes(Ne)),V=Object.keys(AZA).filter((Ne)=>!G.has(Ne)),W=Object.keys(i),z=Object.values(i),te=Object.keys(s),ie=Object.values(s),ae=new Set;for(let Ne of te)ae.add(Ne.toLowerCase()),ae.add(Ne.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase());let Be=aZA(n9r(S)).replace(/const\s+(_component_\w+)\s*=\s*_resolveComponent\([^)]+\);?/g,(Ne,$e)=>{let it=$e.replace(/^_component_/,"").toLowerCase();return ae.has(it)?"":`const ${$e} = _resolveComponent;`}).replace(/export\s+default\s+/,"const __scriptDef = ").replace(/export\s*\{([^}]+)\}/g,""),xe=`
@@ -2068,7 +2068,7 @@ const __component = {
2068
2068
  }
2069
2069
 
2070
2070
  return __component;
2071
- `,Oe=Function("__vueRuntimeCore","__vue","__serverRenderer","__subComponents","__globals","__context",xe)(tZA,nZA,AZA,Q,ie,z);if(!Oe)throw Error(`@axon/vstr: compiled component is null for ${n}`);return Oe}function e9r(e,n,A){let i=[n.template,n.script,n.scriptSetup,...n.styles,...n.customBlocks].filter((u)=>u!==null),s=e;for(let u of i){let g=e.lastIndexOf(`<${u.type}`,u.loc.start.offset),d=`</${u.type}>`,f=e.indexOf(d,u.loc.end.offset)+d.length;if(g===-1||f===d.length-1)continue;s=s.slice(0,g)+" ".repeat(f-g)+s.slice(f)}if(s=s.replace(/<(template|script|style)(\s[^>]*)?>\s*<\/\1>/g,""),s.trim().length>0)throw Error(`@axon/vstr: ${A} has content outside its <template>/<script>/<style> blocks \u2014 this is likely a typo`)}async function t9r(e,n,A,i,s){let u=W3r(n),g={},d=/import\s+(\w+)\s+from\s+["'](\.{1,2}\/[^"']+\.(vd|vue|prompt))["']/g,f;while((f=d.exec(e))!==null){let[,B,E]=f;if(B===void 0||E===void 0)continue;g[B]=await _9t(z3r(u,E),A,i,s)}return g}function aZA(e){return e.replace(/^import\s[\s\S]*?from\s+["'][^"']+["'];?/gm,(n)=>{let A=n.replace(/\s+/g," ").trim();if(/^import\s+\*\s+as\s+/.test(A))return"";let i=A.match(/^import\s*\{([^}]+)\}\s*from/);if(i?.[1]!==void 0)return i[1].split(",").map((s)=>{let[u,g]=s.split(" as ").map((d)=>d.trim());if(!u)return"";if(g&&g!==u)return`const ${g} = ${u};`;return""}).filter(Boolean).join(`
2071
+ `,Oe=Function("__vueRuntimeCore","__vue","__serverRenderer","__subComponents","__globals","__context",xe)(tZA,nZA,AZA,Q,ie,z);if(!Oe)throw Error(`@arcforge/vstr: compiled component is null for ${n}`);return Oe}function e9r(e,n,A){let i=[n.template,n.script,n.scriptSetup,...n.styles,...n.customBlocks].filter((u)=>u!==null),s=e;for(let u of i){let g=e.lastIndexOf(`<${u.type}`,u.loc.start.offset),d=`</${u.type}>`,f=e.indexOf(d,u.loc.end.offset)+d.length;if(g===-1||f===d.length-1)continue;s=s.slice(0,g)+" ".repeat(f-g)+s.slice(f)}if(s=s.replace(/<(template|script|style)(\s[^>]*)?>\s*<\/\1>/g,""),s.trim().length>0)throw Error(`@arcforge/vstr: ${A} has content outside its <template>/<script>/<style> blocks \u2014 this is likely a typo`)}async function t9r(e,n,A,i,s){let u=W3r(n),g={},d=/import\s+(\w+)\s+from\s+["'](\.{1,2}\/[^"']+\.(vd|vue|prompt))["']/g,f;while((f=d.exec(e))!==null){let[,B,E]=f;if(B===void 0||E===void 0)continue;g[B]=await _9t(z3r(u,E),A,i,s)}return g}function aZA(e){return e.replace(/^import\s[\s\S]*?from\s+["'][^"']+["'];?/gm,(n)=>{let A=n.replace(/\s+/g," ").trim();if(/^import\s+\*\s+as\s+/.test(A))return"";let i=A.match(/^import\s*\{([^}]+)\}\s*from/);if(i?.[1]!==void 0)return i[1].split(",").map((s)=>{let[u,g]=s.split(" as ").map((d)=>d.trim());if(!u)return"";if(g&&g!==u)return`const ${g} = ${u};`;return""}).filter(Boolean).join(`
2072
2072
  `);return""})}function n9r(e){return e.replace(/^import\s+\w+\s+from\s+["']\.{1,2}\/[^"']+\.(vd|vue|prompt)["'];?\n?/gm,"")}async function iZA(e){if(typeof Bun<"u")return new Bun.Transpiler({loader:"ts"}).transformSync(e);return y9t.default.transpileModule(e,{compilerOptions:{module:y9t.default.ModuleKind.ESNext,target:y9t.default.ScriptTarget.ESNext}}).outputText}function A9r(e){return Object.keys(e).sort().map((n)=>`${n}:${typeof e[n]}`).join(",")}var tZA,nZA,AZA,y9t,Q9t;var oZA=dt(()=>{tZA=mp(eZA(),1),nZA=mp(nh(),1),AZA=mp(tGn(),1),y9t=mp(ANt(),1),Q9t=new Map});import{readFileSync as a9r}from"fs";import{resolve as i9r}from"path";import{parse as r9r}from"@vue/compiler-sfc";function sZA(e){let n=i9r(e),A=a9r(n,"utf-8");return WGn(A,n)}function WGn(e,n="<source>"){let{descriptor:A,errors:i}=r9r(e,{filename:n});if(i.length||!A.scriptSetup)return[];let s=A.scriptSetup.content,u=s9r(s),g=o9r(s);for(let d of g)if(d.name in u)d.default=u[d.name];else if(!d.required)d.default=null;return g}function o9r(e){let n=WAe.default.createSourceFile("props.ts",e,WAe.default.ScriptTarget.Latest,!0,WAe.default.ScriptKind.TS),A=[];function i(s){if(WAe.default.isCallExpression(s)&&WAe.default.isIdentifier(s.expression)&&s.expression.text==="defineProps"&&s.typeArguments&&s.typeArguments.length>0){let u=s.typeArguments[0];if(WAe.default.isTypeLiteralNode(u)){for(let g of u.members)if(WAe.default.isPropertySignature(g)&&WAe.default.isIdentifier(g.name))A.push({name:g.name.text,type:g.type?g.type.getText(n):"unknown",required:!g.questionToken,default:void 0})}}WAe.default.forEachChild(s,i)}return WAe.default.forEachChild(n,i),A}function s9r(e){let n={},A=e.match(/const\s*\{([^}]+)\}\s*=\s*defineProps/);if(A?.[1]===void 0)return n;for(let i of A[1].split(",")){let s=i.indexOf("=");if(s===-1)continue;let u=i.slice(0,s).trim(),g=i.slice(s+1).trim();try{n[u]=JSON.parse(g)}catch{n[u]=g}}return n}var WAe;var cZA=dt(()=>{WAe=mp(ANt(),1)});var oYe=Ar(($$o,uZA)=>{uZA.exports=Zqe;Zqe.CAPTURING_PHASE=1;Zqe.AT_TARGET=2;Zqe.BUBBLING_PHASE=3;function Zqe(e,n){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=Zqe.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,e)this.type=e;if(n)for(var A in n)this[A]=n[A]}Zqe.prototype=Object.create(Object.prototype,{constructor:{value:Zqe},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){if(this.cancelable)this.defaultPrevented=!0}},initEvent:{value:function(n,A,i){if(this._initialized=!0,this._dispatching)return;this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=n,this.bubbles=A,this.cancelable=i}}})});var VGn=Ar((O$o,gZA)=>{var lZA=oYe();gZA.exports=ZGn;function ZGn(){lZA.call(this),this.view=null,this.detail=0}ZGn.prototype=Object.create(lZA.prototype,{constructor:{value:ZGn},initUIEvent:{value:function(e,n,A,i,s){this.initEvent(e,n,A),this.view=i,this.detail=s}}})});var eMn=Ar((z$o,mZA)=>{var pZA=VGn();mZA.exports=XGn;function XGn(){pZA.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}XGn.prototype=Object.create(pZA.prototype,{constructor:{value:XGn},initMouseEvent:{value:function(e,n,A,i,s,u,g,d,f,B,E,Q,w,S,G){switch(this.initEvent(e,n,A,i,s),this.screenX=u,this.screenY=g,this.clientX=d,this.clientY=f,this.ctrlKey=B,this.altKey=E,this.shiftKey=Q,this.metaKey=w,this.button=S,S){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=G}},getModifierState:{value:function(e){switch(e){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}}}})});var D9t=Ar((W$o,fZA)=>{fZA.exports=k9t;var c9r=1,u9r=3,l9r=4,g9r=5,p9r=7,m9r=8,d9r=9,f9r=11,h9r=12,b9r=13,B9r=14,C9r=15,I9r=17,E9r=18,y9r=19,Q9r=20,_9r=21,w9r=22,k9r=23,D9r=24,x9r=25,F9r=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],v9r=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],dZA={INDEX_SIZE_ERR:c9r,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:u9r,WRONG_DOCUMENT_ERR:l9r,INVALID_CHARACTER_ERR:g9r,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:p9r,NOT_FOUND_ERR:m9r,NOT_SUPPORTED_ERR:d9r,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:f9r,SYNTAX_ERR:h9r,INVALID_MODIFICATION_ERR:b9r,NAMESPACE_ERR:B9r,INVALID_ACCESS_ERR:C9r,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:I9r,SECURITY_ERR:E9r,NETWORK_ERR:y9r,ABORT_ERR:Q9r,URL_MISMATCH_ERR:_9r,QUOTA_EXCEEDED_ERR:w9r,TIMEOUT_ERR:k9r,INVALID_NODE_TYPE_ERR:D9r,DATA_CLONE_ERR:x9r};function k9t(e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=e,this.message=v9r[e],this.name=F9r[e]}k9t.prototype.__proto__=Error.prototype;for(ayt in dZA)w9t={value:dZA[ayt]},Object.defineProperty(k9t,ayt,w9t),Object.defineProperty(k9t.prototype,ayt,w9t);var w9t,ayt});var x9t=Ar((S9r)=>{S9r.isApiWritable=!globalThis.__domino_frozen__});var dv=Ar((M9r)=>{var mv=D9t(),F4=mv,G9r=x9t().isApiWritable;M9r.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};M9r.IndexSizeError=function(){throw new mv(F4.INDEX_SIZE_ERR)};M9r.HierarchyRequestError=function(){throw new mv(F4.HIERARCHY_REQUEST_ERR)};M9r.WrongDocumentError=function(){throw new mv(F4.WRONG_DOCUMENT_ERR)};M9r.InvalidCharacterError=function(){throw new mv(F4.INVALID_CHARACTER_ERR)};M9r.NoModificationAllowedError=function(){throw new mv(F4.NO_MODIFICATION_ALLOWED_ERR)};M9r.NotFoundError=function(){throw new mv(F4.NOT_FOUND_ERR)};M9r.NotSupportedError=function(){throw new mv(F4.NOT_SUPPORTED_ERR)};M9r.InvalidStateError=function(){throw new mv(F4.INVALID_STATE_ERR)};M9r.SyntaxError=function(){throw new mv(F4.SYNTAX_ERR)};M9r.InvalidModificationError=function(){throw new mv(F4.INVALID_MODIFICATION_ERR)};M9r.NamespaceError=function(){throw new mv(F4.NAMESPACE_ERR)};M9r.InvalidAccessError=function(){throw new mv(F4.INVALID_ACCESS_ERR)};M9r.TypeMismatchError=function(){throw new mv(F4.TYPE_MISMATCH_ERR)};M9r.SecurityError=function(){throw new mv(F4.SECURITY_ERR)};M9r.NetworkError=function(){throw new mv(F4.NETWORK_ERR)};M9r.AbortError=function(){throw new mv(F4.ABORT_ERR)};M9r.UrlMismatchError=function(){throw new mv(F4.URL_MISMATCH_ERR)};M9r.QuotaExceededError=function(){throw new mv(F4.QUOTA_EXCEEDED_ERR)};M9r.TimeoutError=function(){throw new mv(F4.TIMEOUT_ERR)};M9r.InvalidNodeTypeError=function(){throw new mv(F4.INVALID_NODE_TYPE_ERR)};M9r.DataCloneError=function(){throw new mv(F4.DATA_CLONE_ERR)};M9r.nyi=function(){throw Error("NotYetImplemented")};M9r.shouldOverride=function(){throw Error("Abstract function; should be overriding in subclass.")};M9r.assert=function(e,n){if(!e)throw Error("Assertion failed: "+(n||"")+`
2073
2073
  `+Error().stack)};M9r.expose=function(e,n){for(var A in e)Object.defineProperty(n.prototype,A,{value:e[A],writable:G9r})};M9r.merge=function(e,n){for(var A in n)e[A]=n[A]};M9r.documentOrder=function(e,n){return 3-(e.compareDocumentPosition(n)&6)};M9r.toASCIILowerCase=function(e){return e.replace(/[A-Z]+/g,function(n){return n.toLowerCase()})};M9r.toASCIIUpperCase=function(e){return e.replace(/[a-z]+/g,function(n){return n.toUpperCase()})}});var tMn=Ar((X$o,bZA)=>{var Vqe=oYe(),g6r=eMn(),p6r=dv();bZA.exports=hZA;function hZA(){}hZA.prototype={addEventListener:function(n,A,i){if(!A)return;if(i===void 0)i=!1;if(!this._listeners)this._listeners=Object.create(null);if(!this._listeners[n])this._listeners[n]=[];var s=this._listeners[n];for(var u=0,g=s.length;u<g;u++){var d=s[u];if(d.listener===A&&d.capture===i)return}var f={listener:A,capture:i};if(typeof A==="function")f.f=A;s.push(f)},removeEventListener:function(n,A,i){if(i===void 0)i=!1;if(this._listeners){var s=this._listeners[n];if(s)for(var u=0,g=s.length;u<g;u++){var d=s[u];if(d.listener===A&&d.capture===i){if(s.length===1)this._listeners[n]=void 0;else s.splice(u,1);return}}}},dispatchEvent:function(n){return this._dispatchEvent(n,!1)},_dispatchEvent:function(n,A){if(typeof A!=="boolean")A=!1;function i(B,E){var{type:Q,eventPhase:w}=E;if(E.currentTarget=B,w!==Vqe.CAPTURING_PHASE&&B._handlers&&B._handlers[Q]){var S=B._handlers[Q],G;if(typeof S==="function")G=S.call(E.currentTarget,E);else{var q=S.handleEvent;if(typeof q!=="function")throw TypeError("handleEvent property of event handler object isnot a function.");G=q.call(S,E)}switch(E.type){case"mouseover":if(G===!0)E.preventDefault();break;case"beforeunload":default:if(G===!1)E.preventDefault();break}}var P=B._listeners&&B._listeners[Q];if(!P)return;P=P.slice();for(var V=0,W=P.length;V<W;V++){if(E._immediatePropagationStopped)return;var z=P[V];if(w===Vqe.CAPTURING_PHASE&&!z.capture||w===Vqe.BUBBLING_PHASE&&z.capture)continue;if(z.f)z.f.call(E.currentTarget,E);else{var te=z.listener.handleEvent;if(typeof te!=="function")throw TypeError("handleEvent property of event listener object is not a function.");te.call(z.listener,E)}}}if(!n._initialized||n._dispatching)p6r.InvalidStateError();n.isTrusted=A,n._dispatching=!0,n.target=this;var s=[];for(var u=this.parentNode;u;u=u.parentNode)s.push(u);n.eventPhase=Vqe.CAPTURING_PHASE;for(var g=s.length-1;g>=0;g--)if(i(s[g],n),n._propagationStopped)break;if(!n._propagationStopped)n.eventPhase=Vqe.AT_TARGET,i(this,n);if(n.bubbles&&!n._propagationStopped){n.eventPhase=Vqe.BUBBLING_PHASE;for(var d=0,f=s.length;d<f;d++)if(i(s[d],n),n._propagationStopped)break}if(n._dispatching=!1,n.eventPhase=Vqe.AT_TARGET,n.currentTarget=null,A&&!n.defaultPrevented&&n instanceof g6r)switch(n.type){case"mousedown":this._armed={x:n.clientX,y:n.clientY,t:n.timeStamp};break;case"mouseout":case"mouseover":this._armed=null;break;case"mouseup":if(this._isClick(n))this._doClick(n);this._armed=null;break}return!n.defaultPrevented},_isClick:function(e){return this._armed!==null&&e.type==="mouseup"&&e.isTrusted&&e.button===0&&e.timeStamp-this._armed.t<1000&&Math.abs(e.clientX-this._armed.x)<10&&Math.abs(e.clientY-this._armed.Y)<10},_doClick:function(e){if(this._click_in_progress)return;this._click_in_progress=!0;var n=this;while(n&&!n._post_click_activation_steps)n=n.parentNode;if(n&&n._pre_click_activation_steps)n._pre_click_activation_steps();var A=this.ownerDocument.createEvent("MouseEvent");A.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,null);var i=this._dispatchEvent(A,!0);if(n){if(i){if(n._post_click_activation_steps)n._post_click_activation_steps(A)}else if(n._cancelled_activation_steps)n._cancelled_activation_steps()}},_setEventHandler:function(n,A){if(!this._handlers)this._handlers=Object.create(null);this._handlers[n]=A},_getEventHandler:function(n){return this._handlers&&this._handlers[n]||null}}});var nMn=Ar((eOo,BZA)=>{var pCe=dv(),Bz=BZA.exports={valid:function(e){return pCe.assert(e,"list falsy"),pCe.assert(e._previousSibling,"previous falsy"),pCe.assert(e._nextSibling,"next falsy"),!0},insertBefore:function(e,n){pCe.assert(Bz.valid(e)&&Bz.valid(n));var A=e,i=e._previousSibling,s=n,u=n._previousSibling;A._previousSibling=u,i._nextSibling=s,u._nextSibling=A,s._previousSibling=i,pCe.assert(Bz.valid(e)&&Bz.valid(n))},replace:function(e,n){if(pCe.assert(Bz.valid(e)&&(n===null||Bz.valid(n))),n!==null)Bz.insertBefore(n,e);Bz.remove(e),pCe.assert(Bz.valid(e)&&(n===null||Bz.valid(n)))},remove:function(e){pCe.assert(Bz.valid(e));var n=e._previousSibling;if(n===e)return;var A=e._nextSibling;n._nextSibling=A,A._previousSibling=n,e._previousSibling=e._nextSibling=e,pCe.assert(Bz.valid(e))}}});var AMn=Ar((tOo,kZA)=>{kZA.exports={serializeOne:C6r,\u{275}escapeMatchingClosingTag:QZA,\u{275}escapeClosingCommentTag:_ZA,\u{275}escapeProcessingInstructionContent:wZA};var yZA=dv(),Xqe=yZA.NAMESPACE,CZA={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},m6r={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},d6r={},IZA=/[&<>\u00A0]/g,EZA=/[&"<>\u00A0]/g;function f6r(e){if(!IZA.test(e))return e;return e.replace(IZA,(n)=>{switch(n){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case"\xA0":return"&nbsp;"}})}function h6r(e){if(!EZA.test(e))return e;return e.replace(EZA,(n)=>{switch(n){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;";case"\xA0":return"&nbsp;"}})}function b6r(e){var n=e.namespaceURI;if(!n)return e.localName;if(n===Xqe.XML)return"xml:"+e.localName;if(n===Xqe.XLINK)return"xlink:"+e.localName;if(n===Xqe.XMLNS)if(e.localName==="xmlns")return"xmlns";else return"xmlns:"+e.localName;return e.name}function QZA(e,n){let A="</"+n;if(!e.toLowerCase().includes(A))return e;let i=[...e],s=e.matchAll(new RegExp(A,"ig"));for(let u of s)i[u.index]="&lt;";return i.join("")}var B6r=/--!?>/;function _ZA(e){if(!B6r.test(e))return e;return e.replace(/(--\!?)>/g,"$1&gt;")}function wZA(e){return e.includes(">")?e.replaceAll(">","&gt;"):e}function C6r(e,n){var A="";switch(e.nodeType){case 1:var i=e.namespaceURI,s=i===Xqe.HTML,u=s||i===Xqe.SVG||i===Xqe.MATHML?e.localName:e.tagName;A+="<"+u;for(var g=0,d=e._numattrs;g<d;g++){var f=e._attr(g);if(A+=" "+b6r(f),f.value!==void 0)A+='="'+h6r(f.value)+'"'}if(A+=">",!(s&&m6r[u])){var B=e.serialize();if(CZA[u.toUpperCase()])B=QZA(B,u);if(s&&d6r[u]&&B.charAt(0)===`
2074
2074
  `)A+=`
@@ -4885,7 +4885,7 @@ declare module "bun:test" {
4885
4885
  declare global {
4886
4886
  const bench: GeneratedBenchHandle
4887
4887
  const observe: GeneratedBenchHandle["observe"]
4888
- const Axon: () => Promise<Awaited<ReturnType<typeof import("@axon/core").Axon>> & { stop(): Promise<void> }>
4888
+ const Axon: () => Promise<Awaited<ReturnType<typeof import("@arcforge/core").Axon>> & { stop(): Promise<void> }>
4889
4889
  const defineBench: typeof import("@arcforge/types").defineBench
4890
4890
  }
4891
4891
 
@@ -4932,11 +4932,11 @@ held by:
4932
4932
  ${B}`:""),context:{model:u.model,needs:u.bytes,available:g.available}})}let d=A.take(u),f=!1;return()=>{if(f)return;f=!0,A.release(d)}},releaseAll(){A.releaseAll()}}}var Qsa=dt(()=>{ps();cTn();pTn()});var _sa=dt(()=>{Qsa();pTn();cTn()});import{execFile as gHr}from"child_process";import{createHash as pHr}from"crypto";import{existsSync as fTn}from"fs";import{mkdir as mHr,readFile as dHr,readdir as IQt,rm as wsa,writeFile as xsa}from"fs/promises";import{basename as fHr,join as hUe,resolve as ksa}from"path";function Fsa(e){function n(A,i){return hUe(e.root,"cache","prompts",...A.split("/"),i)}return{async ensure(A){if(!A)throw oA("CLONE_REF_REQUIRED");let{name:i,version:s}=qye(A),u=await e.cloud.registry.resolve(i,s),g=n(u.name,u.version);if(!fTn(g)||(await IQt(g)).length===0)await bTn(await hTn(u.downloadUrl),g);return{name:u.name,version:u.version,root:g}},async cached(){let A=hUe(e.root,"cache","prompts");if(!fTn(A))return[];let i=[];for(let s of await IQt(A))for(let u of await IQt(hUe(A,s)).catch(()=>[]))for(let g of await IQt(hUe(A,s,u)).catch(()=>[]))i.push({name:`${s}/${u}`,version:g,root:hUe(A,s,u,g)});return i}}}function vsa(e){async function n(i,s,u={}){if(!i)throw oA("CLONE_REF_REQUIRED");let{name:g,version:d}=qye(i),f=await e.cloud.registry.resolve(g,d),B=ksa(s,u.dir??Dsa(f.name));return await bTn(await hTn(f.downloadUrl),B),await e.prepare(B),{...f,root:B}}async function A(i,s,u={}){if(!u.as)throw oA("FORK_NAME_REQUIRED");if(!i)throw oA("FORK_REF_REQUIRED");let{name:g,version:d}=qye(i),f=await e.cloud.registry.resolve(g,d),B=ksa(s,u.dir??Dsa(u.as));await bTn(await hTn(f.downloadUrl),B);let E={...f,root:B},Q=hUe(E.root,"package.json"),w=JSON.parse(await dHr(Q,"utf-8")),S=w.axon&&typeof w.axon==="object"&&!Array.isArray(w.axon)?w.axon:{};return w.name=u.as,w.version="0.1.0",w.axon={...S,forkedFrom:{name:E.name,version:E.version}},await xsa(Q,JSON.stringify(w,null,2)+`
4933
4933
  `),await e.prepare(B),{...E,name:u.as,version:"0.1.0"}}return{clone:n,fork:A}}function Dsa(e){return fHr(e)}function dTn(e){return new Promise((n)=>{gHr("tar",e,{maxBuffer:67108864},(A,i,s)=>{n({exitCode:A?typeof A.code==="number"?A.code:1:0,stdout:i,stderr:s||(A?A.message:"")})})})}async function hTn(e){let n=await fetch(e);if(!n.ok)throw oA("ARTIFACT_DOWNLOAD_FAILED",{detail:`${n.status} ${n.statusText}`,context:{status:n.status}});return n.arrayBuffer()}async function bTn(e,n){let A=!1;if(fTn(n)){if((await IQt(n)).length>0)throw oA("CLONE_TARGET_EXISTS",{detail:`${n} is not empty`,context:{target:n}})}else await mHr(n,{recursive:!0}),A=!0;let i=hUe(n,`.axon-clone-${pHr("sha256").update(new Uint8Array(e)).digest("hex")}.tar.gz`);try{await xsa(i,new Uint8Array(e));let u=(await dTn(["-tzf",i])).stdout.split(`
4934
4934
  `).filter(Boolean),d=u.length>0&&u.every((f)=>f==="package/"||f.startsWith("package/"))?await dTn(["-xzf",i,"-C",n,"--strip-components=1"]):await dTn(["-xzf",i,"-C",n]);if(d.exitCode!==0)throw oA("ARTIFACT_EXTRACT_FAILED",{detail:d.stderr.trim(),context:{exitCode:d.exitCode}})}catch(s){if(A)await wsa(n,{recursive:!0,force:!0});throw s}finally{await wsa(i,{force:!0})}}var Ssa=dt(()=>{ps();y6t()});import{join as hHr}from"path";async function Nsa(e,n){let A=$r.exists(hHr(e,"src","prompts")),i=await EYe(e,{prefix:n,...A?{}:{dir:"."}}),s=i.entries.filter((d)=>d.name!==`${n}:README`),u=n.split("/").at(-1),g=s.find((d)=>d.name===`${n}:${u}`);if(g&&s.length===1)s.push({...g,name:n});return{entries:s,warnings:i.warnings}}var Gsa=dt(()=>{Nh();c6t()});function Msa(e){async function n(A){let{name:i,root:s}=await e.cache.ensure(A),u=await Nsa(s,i);if(u.entries.length===0)throw oA("PROMPT_NOT_FOUND",{detail:`${i} is published but ships no prompt files`,context:{name:i}});return u.entries}return{entries:n,async entry(A){let i=await n(A),s=i.find((u)=>u.name===A);if(s)return s;if(i.length>1)throw oA("PROMPT_NOT_FOUND",{detail:`${A} ships ${i.length} prompts \u2014 name one of: ${i.map((u)=>u.name).join(", ")}`,context:{name:A}});return i[0]}}}var Lsa=dt(()=>{ps();Gsa()});var EQt=75,BTn="AXON_UPDATE_REQUEST";var CTn=dt(()=>{ps()});import{existsSync as bHr,realpathSync as BHr}from"fs";import{mkdir as CHr,rename as IHr,writeFile as EHr}from"fs/promises";import{dirname as qsa,join as yHr}from"path";function ITn(e){let n=e.currentVersion,A=process.argv[1]??import.meta.path,i=e.helperPath??Usa(A),s=e.bunPath??process.execPath,u=e.axonPath??(typeof Bun>"u"?"axon":Bun.which("axon")??"axon"),g=e.requestPath??process.env[BTn];function d(){return bHr(i)&&Boolean(g)}async function f(E,Q={}){if(!yQt.valid(n))throw oA("UPDATE_CURRENT_VERSION_INVALID",{context:{version:n}});let w=await e.cloud.cloud.releases.axon(E,Q);if(w.package!=="@arcforge/axon"||w.channel!=="latest"||!yQt.valid(w.version))throw oA("UPDATE_RELEASE_INVALID",{context:{package:w.package,channel:w.channel,version:w.version}});return{status:yQt.gt(w.version,n)?"available":"current",current:n,latest:w.version}}async function B(E){let Q=await f(E,{fresh:!0});if(Q.status==="current")return Q;if(!d())throw oA("UPDATE_UNAVAILABLE_IN_DEVELOPMENT");e.store.update.state.set({status:"pending",from:Q.current,to:Q.latest,updatedAt:new Date().toISOString()});try{let w={from:Q.current,to:Q.latest,bun:s,axon:u,state:e.store.update.statePath};if(!g)throw oA("UPDATE_SUPERVISOR_UNAVAILABLE");await CHr(qsa(g),{recursive:!0});let S=`${g}.${process.pid}.tmp`;await EHr(S,JSON.stringify(w,null,2)+`
4935
- `,"utf-8"),await IHr(S,g)}catch(w){throw e.store.update.state.set({status:"failed",from:Q.current,to:Q.latest,updatedAt:new Date().toISOString(),error:w instanceof Error?w.message:String(w)}),w}return Q}return{currentVersion:n,supported:d,check:f,handoff:B}}function Usa(e){let n=e;try{n=BHr(e)}catch{}return yHr(qsa(n),"update-helper.js")}var yQt;var Tsa=dt(()=>{CTn();ps();yQt=mp(Ryt(),1)});var Ksa=()=>{};var _Gt=dt(()=>{Tsa();Ksa();CTn()});import{join as QHr,resolve as _Hr}from"path";function QQt(e){let n=_Hr(e.cwd??process.cwd()),A=e.distribution??wHr,i={},s=yUn({root:e.store??QUn(A),settings:()=>i,setSetting:async(ie,ae)=>{let Be=await te.setSetting(ie,ae);return await z(),Be}}),u=$oa({store:s,distribution:A}),g=wUn(),d=Roa(),f=joa({root:n}),B=Wqn();async function E(){let ie=s.profiles.active()?.root;if(!ie)return;let{providers:ae}=await fUe(ie);return ae}let Q=mTn({budget:()=>{return}}),w=Xqn({cloud:u.client,profileProviders:()=>E(),frameworkVersion:e.version,...e.frameworkSource?{frameworkSource:e.frameworkSource}:{},...e.repoRoot?{repoRoot:e.repoRoot}:{},bench:{tests:B,clone:(ie,ae,Be)=>G.clone(ie,ae,Be),prepare:async(ie)=>{await(await w.open(ie)).prepare()}}}),S=iTn({...e.daemon?{daemon:e.daemon}:{},store:s,projects:w,cloud:u.client,cwd:n,clone:(ie,ae,Be)=>G.clone(ie,ae,Be),...e.control?{control:e.control}:{}}),G=vsa({cloud:u.client,async prepare(ie){await(await w.open(ie)).prepare()}}),q=Msa({cache:Fsa({cloud:u.client,root:s.root})}),P=ITn({cloud:u.client,store:s,currentVersion:e.version}),V=zoa({cloud:u.client}),W=rTn({store:s,projects:w,frameworkVersion:e.version});async function z(){if(!s.profiles.active()){i={};return}i=await te.settings()}let te=PUn({root:()=>W.root,install:async(ie,ae)=>{return{version:(await G.clone(ie,QHr(ae,".."),{dir:ae.split("/").at(-1)})).version}},latest:async(ie)=>(await u.client.registry.artifacts.resolve(ie)).version});return{cloud:u,store:s,deployments:V,projects:w,profile:W,extensions:te,refreshSettings:z,agents:S,registry:G,prompts:q,tests:B,mic:d,files:f,ollama:g,resources:Q,updates:P}}var wHr="production";var Rsa=dt(()=>{Eoa();voa();DUn();Hoa();Ooa();AQt();oTn();dGt();_sa();Zqn();Ssa();Lsa();_Gt()});function _Qt(e,n){let A=new Map;for(let s of e)switch(s.type){case"process:proc:start":{let u=s.data;A.set(u.procId,{procId:u.procId,kind:u.kind,command:u.command,pid:u.pid,cwd:u.cwd,status:"running",startedAt:typeof s.at==="number"?s.at:Date.now(),output:[]});break}case"process:proc:complete":{let u=s.data,g=A.get(u.procId);if(!g)break;if(g.status="exited",g.exitCode=u.code,typeof s.at==="number")g.endedAt=s.at;break}case"process:proc:failed":{let u=s.data,g=A.get(u.procId);if(!g)break;if(g.status="exited",typeof s.at==="number")g.endedAt=s.at;break}case"process:proc:denied":{let u=s.data,g=A.get(u.procId);if(g){g.status="exited",g.exitCode=-1;break}A.set(u.procId,{procId:u.procId,kind:"managed",command:u.command,status:"exited",exitCode:-1,startedAt:typeof s.at==="number"?s.at:Date.now(),output:[]});break}}let i=[...A.values()].sort((s,u)=>s.startedAt-u.startedAt);if(!n?.main)return i;return[{procId:"main",kind:"main",command:"agent \xB7 ts runtime",...n.main.pid!==void 0?{pid:n.main.pid}:{},status:n.main.status,startedAt:n.main.startedAt??i[0]?.startedAt??Date.now(),main:!0,output:[]},...i]}var Ysa=()=>{};var wGt=dt(()=>{Rsa();Ysa();J3n()});var bUe;var kGt=dt(()=>{bUe={name:"@arcforge/axon",version:"2.0.164",description:"The platform to build agents \u2014 a terminal, a runtime, and a toolkit for building, running, and deploying reliable AI agents.",module:"index.ts",type:"module",scripts:{build:"vterm build",deploy:"bun run scripts/release.ts patch","deploy:major":"bun run scripts/release.ts major","deploy:minor":"bun run scripts/release.ts minor","deploy:patch":"bun run scripts/release.ts patch",dev:"vterm dev","dev:local":"vterm dev --dotenv .env.local",prepare:"vterm prepare",tail:"vterm tail",test:"bun test --parallel=4 --path-ignore-patterns='**/tests/perf/**'","test:perf":"bun test tests/perf","test:serial":"bun test --path-ignore-patterns='**/tests/perf/**'","test:watch":"bun test --watch",typecheck:"bun run scripts/typecheck.ts"},dependencies:{"@arcforge/cognet":"workspace:*","@arcforge/engines":"workspace:*","@arcforge/err":"workspace:*","@arcforge/platform":"workspace:*","@arcforge/types":"workspace:*","@arcforge/vterm":"workspace:*","@arclabs/cloud":"workspace:*","@arclabs/repo":"workspace:*","@arclabs/tools":"workspace:*","@axon/capsule":"workspace:*","@axon/core":"workspace:*","@axon/theme":"workspace:*","@axon/vstr":"workspace:*","@vue/compiler-sfc":"3.5.39",arcline:"workspace:*",chalk:"^5.6.2","fft.js":"^4.0.4",h3:"^1.15.11","markdown-it":"^14.3.0",open:"^11.0.0",semver:"^7.7.4",sharp:"^0.35.3","@arcforge/axond":"workspace:*"},devDependencies:{"@types/bun":"latest","@types/markdown-it":"^14.1.2","@types/semver":"^7.7.1","@vue/typescript-plugin":"^3.2.5",postgres:"^3.4.5"},peerDependencies:{typescript:"^5"},bin:{axon:"./bin/axon"},homepage:"https://axon.arclabs.it",repository:{type:"git",url:"git+https://github.com/artificial-cognition-laboratories/axon.git",directory:"apps/tui"},bugs:{url:"https://github.com/artificial-cognition-laboratories/axon/issues"},keywords:["axon","ai","agent","agents","llm","ai-agent","agent-runtime","typescript"]}});function DGt(e,n){let A=e;for(let i of n){if(A===null||typeof A!=="object"||!(i in A))throw oA("CONTROL_PATH_NOT_FOUND",{detail:`no such method on the peer: ${n.join(".")}`,context:{path:n.join(".")}});A=A[i]}return A}function xGt(e){let n=new Map,A=new Map,i=new Map,s=!1,u=0,g=()=>`${++u}`;async function d(Q){try{let w=DGt(e.handle,Q.path.slice(0,-1)),S=DGt(e.handle,Q.path);if(typeof S!=="function")throw oA("CONTROL_PATH_NOT_CALLABLE",{detail:`not callable on the peer: ${Q.path.join(".")}`,context:{path:Q.path.join(".")}});let G=await S.apply(w,Q.args);e.send({type:"rpc.result",id:Q.id,ok:!0,value:G})}catch(w){e.send({type:"rpc.result",id:Q.id,ok:!1,error:w instanceof Error?w.message:String(w)})}}function f(Q){try{let w=DGt(e.handle,Q.path.slice(0,-1)),S=DGt(e.handle,Q.path);if(typeof S!=="function")throw oA("CONTROL_PATH_NOT_CALLABLE",{detail:`not callable on the peer: ${Q.path.join(".")}`,context:{path:Q.path.join(".")}});let G=(P)=>e.send({type:"rpc.event",id:Q.id,value:P}),q=S.apply(w,[...Q.args,G]);A.set(Q.id,q)}catch(w){e.send({type:"rpc.result",id:Q.id,ok:!1,error:w instanceof Error?w.message:String(w)})}}function B(Q){A.get(Q.id)?.(),A.delete(Q.id)}function E(Q){let w=n.get(Q.id);if(!w)return;if(n.delete(Q.id),Q.ok)w.resolve(Q.value);else w.reject(oA("CONTROL_CALL_FAILED",{detail:Q.error,context:{error:Q.error}}))}return{accept(Q){if(Q.type==="rpc.call")return void d(Q);if(Q.type==="rpc.subscribe")return f(Q);if(Q.type==="rpc.unsubscribe")return B(Q);if(Q.type==="rpc.result")return E(Q);i.get(Q.id)?.(Q.value)},call(Q,w=[]){if(s)return Promise.reject(oA("CONTROL_CLOSED",{detail:`channel closed before ${Q.join(".")} could be sent`,context:{path:Q.join(".")}}));let S=g();return new Promise((G,q)=>{n.set(S,{resolve:G,reject:q}),e.send({type:"rpc.call",id:S,path:Q,args:w})})},subscribe(Q,w,S){if(s)throw oA("CONTROL_CLOSED",{detail:`channel closed before ${Q.join(".")} could be sent`,context:{path:Q.join(".")}});let G=g();return i.set(G,S),e.send({type:"rpc.subscribe",id:G,path:Q,args:w}),()=>{if(!i.delete(G))return;if(!s)e.send({type:"rpc.unsubscribe",id:G})}},close(Q){if(s)return;s=!0;for(let w of A.values())w();A.clear(),i.clear();for(let w of n.values())w.reject(oA("CONTROL_CLOSED",{detail:Q,context:{error:Q}}));n.clear()}}}var FGt=dt(()=>{ps()});function ETn(e){if(typeof e!=="object"||e===null)return!1;let n=e.type;return n==="rpc.call"||n==="rpc.result"||n==="rpc.subscribe"||n==="rpc.unsubscribe"||n==="rpc.event"}import{randomBytes as xHr}from"crypto";function wQt(e){let n=xHr(32).toString("hex"),A=null,i=new Set;function s(){for(let f of i)f(u.size)}let u=new Map;function g(f,B){let E=u.get(f);if(!E)return;E.dispatch.close(B),u.delete(f),s()}async function d(f){let B=[...u.values()];if(B.length===0)throw oA("CONTROL_CLOSED",{detail:"no editor attached"});if(B.length===1)return B[0].dispatch;let E=await Promise.all(B.map(async(Q)=>{try{let w=await Q.dispatch.call(["editor","claim"],[f??null]);return{dispatch:Q.dispatch,contains:w?.contains===!0,focusedAt:w?.focusedAt??0}}catch{return{dispatch:Q.dispatch,contains:!1,focusedAt:0}}}));return E.sort((Q,w)=>Q.contains!==w.contains?Q.contains?-1:1:w.focusedAt-Q.focusedAt),E[0].dispatch}return{token:n,get port(){return A?.port??null},get attached(){return u.size>0},get peerCount(){return u.size},watch(f){return i.add(f),()=>{i.delete(f)}},listen(){if(A)return A.port;return A=Bun.serve({port:e.port??0,hostname:"127.0.0.1",fetch(f,B){if(B.upgrade(f,{data:null}))return;return new Response("axon control channel",{status:426})},websocket:{message(f,B){let E;try{E=JSON.parse(String(B))}catch{f.close(1003,"malformed frame");return}let Q=u.get(f);if(!Q){let w=E;if(w?.type!=="control.hello"||w.token!==n){f.close(1008,"unauthorized");return}let S={send:(G)=>f.send(G),close:()=>f.close()};u.set(f,{socket:S,dispatch:xGt({handle:e.handle,send:(G)=>S.send(JSON.stringify(G))})}),f.send(JSON.stringify({type:"control.welcome",peer:"tui"})),s();return}if(!ETn(E))return;Q.dispatch.accept(E)},close(f){g(f,"editor disconnected")}}}),A.port},editor:{async call(f,...B){return await(await d()).call(["editor",String(f)],B)},async about(f,B,...E){return await(await d(f)).call(["editor",String(B)],E)}},close(){for(let[f,B]of u)g(f,"tui shutting down"),B.socket.close();A?.stop(!0),A=null}}}var jsa=dt(()=>{ps();FGt()});var Hsa=dt(()=>{ps();FGt()});var yTn=dt(()=>{jsa();Hsa();FGt()});function vGt(){let e=(n)=>{let A=Psa[n];if(!A)throw Error(`TUI_NOT_READY: this TUI cannot ${n} yet \u2014 it is still starting up`);return A};return{send:(n)=>e("send")(n),interrupt:()=>e("interrupt")(),focus:(n)=>e("focus")(n),capsule:(n,A)=>e("capsule")(n,A),lastActiveAt:async()=>Jsa}}function $sa(e){Psa=e}function QTn(){Jsa=Date.now()}var Psa,Jsa;var kQt=dt(()=>{Psa={},Jsa=Date.now()});function Xie(){if(!_Tn)_Tn=FHr();return _Tn}function FHr(){let e=null,n=ha.ref(0);function A(){if(e)return;let f=wQt({handle:{tui:vGt()}});f.watch(()=>{n.value++}),f.listen(),e=f}function i(){let f=e?.port;if(!e||f===null||f===void 0)return null;return{port:f,token:e.token}}let s=ha.computed(()=>{return n.value,(e?.peerCount??0)>0});async function u(f,...B){if(!e)throw Error("CONTROL_NOT_LISTENING: this TUI is not serving a control channel");return e.editor.call(f,...B)}async function g(f,B,...E){if(!e)throw Error("CONTROL_NOT_LISTENING: this TUI is not serving a control channel");return e.editor.about(f,B,...E)}function d(){e?.close(),e=null,n.value++}return{listen:A,control:i,available:s,editor:u,editorAbout:g,close:d}}var _Tn;var SGt=dt(()=>{Ks();yTn();kQt()});function PB(){if(!wTn){let e=NYe({cloud:()=>PB().cloud.client});wTn=QQt({daemon:e.agents,version:bUe.version,cwd:process.env.PWD??process.cwd(),control:()=>Xie().control()})}return wTn}var wTn=null;var n9=dt(()=>{rGt();wGt();kGt();SGt()});function vHr(e,n){let A=ha.ref("idle"),i=ha.ref(null),s=ha.ref(null),u=ha.ref(0);function g(){u.value++}function d(te,ie,ae){let Be=ha.ref(!1),xe=ha.ref(null),Re=ha.ref(!1);async function Oe(){if(!e.authenticated){Re.value=!1;return}let it=await te.status();Re.value=it.connected&&it.status==="active"}Oe().catch((it)=>{xe.value=it instanceof Error?it:Error(String(it))});async function Ne(...it){Be.value=!0,xe.value=null;try{if(await ie(...it),ae)await PB().extensions.addProvider(ae);Re.value=!0}catch(Me){throw xe.value=Me instanceof Error?Me:Error(String(Me)),Me}finally{Be.value=!1,g()}}async function $e(){if(await te.disconnect(),ae)await PB().extensions.removeProvider(ae);Re.value=!1,g()}return{connected:Re,connecting:Be,error:xe,connect:Ne,disconnect:$e,refreshStatus:Oe}}let f=d(e.connections.openai,()=>e.connections.openai.connect({open:(te)=>{CBe(te)}}),"Codex"),B=d(e.connections.openrouter,(te)=>e.connections.openrouter.connect({key:te}),"OpenRouter");function E(te){let ie=ha.ref(!1),ae=ha.ref(!1),Be=ha.ref(null);async function xe(){let Ne=await PB().extensions.readProviders();ie.value=Ne.includes(te)}xe().catch((Ne)=>{Be.value=Ne instanceof Error?Ne:Error(String(Ne))});async function Re(){ae.value=!0,Be.value=null;try{await PB().extensions.addProvider(te),ie.value=!0}catch(Ne){throw Be.value=Ne instanceof Error?Ne:Error(String(Ne)),Ne}finally{ae.value=!1,g()}}async function Oe(){await PB().extensions.removeProvider(te),ie.value=!1,g()}return{connected:ie,connecting:ae,error:Be,connect:Re,disconnect:Oe,refreshStatus:xe}}let Q=E("Ollama"),w=ha.ref(e.authenticated?"checking":"signed-out"),S=ha.computed(()=>{return u.value,w.value==="verified"});async function G(){if(!e.authenticated)return w.value="signed-out",g(),w.value;w.value="checking",g();try{let te=await e.validate();w.value=te==="valid"?"verified":te==="rejected"?"signed-out":"unreachable"}catch{w.value="unreachable"}return g(),w.value}if(w.value==="checking")G();e.onSessionExpired(()=>{w.value="signed-out",g()});let q=ha.computed(()=>{return u.value,e.client.user.auth.user}),P=ha.computed(()=>{return u.value,n.profiles.list().flatMap((te)=>{let ie=n.profiles.get(te).record.get();if(!ie)return[];let ae=!!(ie.auth.accessToken||ie.auth.apiKey);return[{id:te,email:ie.user.email,authenticated:ae}]})});async function V(te){A.value="authorizing",i.value=null;try{await e.login({...te!==void 0?{hint:te}:{},onCode:(ie)=>{i.value=ie,A.value="polling",CBe(ie.verificationUriComplete)}}),w.value="verified"}finally{A.value="idle",i.value=null,g()}}async function W(te){s.value=te;try{return await e.switch(te),w.value="verified","verified"}catch(ie){let ae=w5e(ie)&&ie.code==="AX-TUI-044";return w.value=ae?"unreachable":"signed-out",ae?"unreachable":"rejected"}finally{s.value=null,g()}}async function z(){await e.logout(),w.value="signed-out",g()}return{isAuthenticated:S,gate:ha.computed(()=>w.value),verify:G,identity:q,profiles:P,loginStatus:A,deviceAuthorization:i,switchingProfileId:s,startLogin:V,switchProfile:W,logout:z,connections:{openai:f,openrouter:B,ollama:Q}}}function m8(){if(!kTn){let e=PB();kTn=vHr(e.cloud,e.store)}return kTn}var kTn;var Hye=dt(()=>{Ks();YBt();ps();n9()});var vTn={};Ta(vTn,{useSettings:()=>FQt});function YHr(){let e=PB();async function n(){try{xQt.value=await e.extensions.settings()}catch{xQt.value={}}xTn.value++}return{settings:ha.computed(()=>{return xTn.value,xQt.value}),refresh:n,async set(A,i){xQt.value={...xQt.value,[A]:i},xTn.value++,await e.extensions.setSetting(A,i)}}}function FQt(){if(!FTn)FTn=YHr();return FTn}var xQt,xTn,FTn;var vQt=dt(()=>{Ks();n9();xQt=ha.ref({}),xTn=ha.ref(0)});var GTn={};Ta(GTn,{useTheme:()=>SE,DEFAULT_THEME_NAME:()=>GGt});async function HHr(e){try{let{useSettings:n}=await Promise.resolve().then(() => (vQt(),vTn));await n().set("theme",e)}catch{}}function Jye(e){return Aae.value.find((n)=>n.name===e)??null}function Zsa(e){let n=Jye(e);if(!n)throw Error(`no theme named "${e}"`);W$.value=e,STn.value=e,Pye.value=null,CUe(n),HHr(e)}function CUe(e){vTe.register(jHr,{":root":{cssVariables:Dbn(e)}}),Cdt({theme:e.syntax==="arcnight"?Ikt:e.syntax}),BUe.value++,NTn?.()}function SE(){if(!NTn)try{NTn=bC()}catch{}return{themes:ha.computed(()=>{return BUe.value,Aae.value}),active:ha.computed(()=>{return BUe.value,Jye(W$.value)??Aae.value[0]}),committedName:ha.computed(()=>Pye.value??W$.value),themeClass:ha.computed(()=>{return BUe.value,`theme-${W$.value}`}),create(e){if(Jye(e.name))throw Error(`theme "${e.name}" is already registered`);if(Aae.value=[...Aae.value,e],BUe.value++,STn.value===e.name)W$.value=e.name,CUe(e);return()=>{if(Aae.value=Aae.value.filter((n)=>n.name!==e.name),W$.value===e.name)W$.value=Aae.value[0].name,CUe(Aae.value[0]);BUe.value++}},set:Zsa,reset(){Zsa(GGt)},preview(e){let n=Jye(e);if(!n)return;if(Pye.value===null)Pye.value=W$.value;W$.value=e,CUe(n)},cancelPreview(){if(Pye.value===null)return;let e=Jye(Pye.value);if(W$.value=Pye.value,Pye.value=null,e)CUe(e)},mount(){let e=Jye(W$.value)??Aae.value[0];CUe(e)},adopt(e){if(!e)return;STn.value=e;let n=Jye(e);if(!n)return;W$.value=e,CUe(n)},colors:ha.computed(()=>{BUe.value;let e=Jye(W$.value)??Aae.value[0];return{primary:String(e.primary),background:String(e.background),text:String(e.text),dim:String(e.dim),warn:String(e.warn),error:String(e.error)}})}}var jHr="axon:theme:tokens",GGt,Aae,W$,Pye,STn,BUe,NTn=null;var A9=dt(()=>{Ks();Ks();Ekt();GGt=Bdt[0].name,Aae=ha.ref([...Bdt]),W$=ha.ref(Bdt[0].name),Pye=ha.ref(null),STn=ha.ref(null),BUe=ha.ref(0)});function Vsa(){let e=0;return{claim(){let n=++e;return{get latest(){return e===n}}}}}function Xsa(e){for(let n=e.length-1;n>=0;n--){let A=e[n];if(A.type!=="kernel:engine:complete")continue;let i=A.data?.meta?.model;if(typeof i==="string")return i}return null}function eca(e){let n=NAe(e??void 0);if(!n)return null;if(n.provider!==void 0&&n.provider!=="axon")return null;if(n.model!=="auto")return null;return{model:"auto"}}function MGt(e){let{provider:n,declared:A,resolved:i}=e;if(!A)return n;let s=`${n}/${A}`;if(A!=="auto")return s;if(!i||i==="auto")return s;return`${i} (${A})`}var tca=dt(()=>{cRe()});function PHr(e,n,A){if(A<=0||n<=0)return;let i=n/A,s=MTn.get(e);MTn.set(e,s===void 0?i:s*0.7+i*0.3)}function JHr(e){return(e?MTn.get(e):void 0)??4.5}function nca(e,n=[]){let A=null,i=null,s=null,u=-1;for(let d=e.length-1;d>=0;d--){let f=e[d];if(f.type==="kernel:engine:complete"){let B=f.data?.meta;if(A??=B.model,B.tokens){i=B.tokens.in+B.tokens.out,u=f.time.seq;break}continue}if(f.type==="kernel:engine:input"){s=f.data?.bytes??s,u=f.time.seq,A??=$Hr(e,d);break}}if(i===null&&s===null)return null;if(i!==null){let d=OHr(e,u);if(A&&d!==null)PHr(A,d,i);return{tokens:i,model:A}}let g=zHr(n,u);return{tokens:Math.round(s/JHr(A))+Math.round(g/3.3),model:A}}function $Hr(e,n){for(let A=n;A>=0;A--){let i=e[A];if(i.type==="kernel:engine:start"){let s=i.data.model;if(s)return s}if(i.type==="kernel:engine:complete")return i.data?.meta?.model??null}return null}function OHr(e,n){for(let A=e.length-1;A>=0;A--){let i=e[A];if(i.time.seq>=n)continue;if(i.type==="kernel:engine:input")return i.data?.bytes??null;if(i.type==="kernel:engine:complete")return null}return null}function zHr(e,n){let A=0;for(let i=e.length-1;i>=0;i--){let s=e[i];if(s.time.seq<=n)break;if(s.type!=="cognet:output:text")continue;let u=s.data.content;if(u)A+=u.length}return A}function Aca(){let A=0,i=null;return{step(s){if(!s)return null;if(s.model!==i)return i=s.model,A=s.tokens,A;if(s.tokens>=A)return A=s.tokens,A;let u=A-s.tokens;if(u<=200)return A;if(A=Math.round(A-u*0.25),A-s.tokens<=200)A=s.tokens;return A},reset(){A=0,i=null}}}function WHr(e){if(e>=1e6){let n=e/1e6;return`${n.toFixed(n>=10?0:1)}m`}if(e===0)return"0k";return`${(e/1000).toFixed(1)}k`}function ZHr(e){if(e>=1e6){let n=Number((e/1e6).toFixed(1));return`${n%1===0?n.toFixed(0):n.toFixed(1)}m`}return`${Math.round(e/1000)}k`}function aca(e,n){let A=e.find((s)=>s.id===n);if(A)return A.context;return e.find((s)=>s.id.slice(s.id.indexOf("/")+1)===n)?.context??0}function ica(e,n){if(e===null||n<=0)return null;return`${WHr(e)}/${ZHr(n)}`}var MTn;var LTn=dt(()=>{MTn=new Map});import{homedir as VHr}from"os";import{basename as XHr,relative as ePr,sep as rca}from"path";function oca(e,n){if(!e)return null;if(/^https?:\/\//i.test(e))return e;if(n&&tPr(e,n))return`axon:${XHr(e)}`;return nPr(e)}function tPr(e,n){let A=ePr(n,e);return A.length>0&&!A.startsWith("..")&&!A.includes(rca)}function nPr(e){let n=VHr();if(e===n)return"~";return e.startsWith(n+rca)?"~"+e.slice(n.length):e}var sca=()=>{};function RYe(){yUe.value++}function cca(e){return e.join(" ")}function APr(){let e=[];for(let n of w2.commands){let A=e;for(let s of n.path.slice(0,-1)){let u=A.find((d)=>d.kind==="group"&&d.label===s);if(u){A=Array.isArray(u.children)?u.children:[];continue}let g={kind:"group",label:s,description:"",children:[]};A.push(g),A=g.children}let i=n.path.at(-1);A.push({kind:"action",label:i,description:n.description??"",action:n.action,...n.workingMessage?{workingMessage:n.workingMessage}:{}})}return e}var EUe,SQt,IUe,NQt,yUe,w2,LGt;var QUe=dt(()=>{Ks();ps();EUe=ha.ref([]),SQt=ha.ref(new Map),IUe=ha.ref(new Map),NQt=ha.ref(new Map),yUe=ha.ref(0);w2={command(e){let n=cca(e.path);if(EUe.value.some((i)=>cca(i.path)===n))throw oA("COMMAND_PATH_TAKEN",{detail:n,context:{path:e.path}});let A=crypto.randomUUID();return EUe.value=[...EUe.value,{...e,id:A}],RYe(),()=>{EUe.value=EUe.value.filter((i)=>i.id!==A),RYe()}},get commands(){return EUe.value},key(e,n){if(SQt.value.has(e))throw oA("KEY_CHORD_TAKEN",{detail:e,context:{chord:e}});SQt.value.set(e,n),RYe();let A=!1;return()=>{if(A)return;A=!0,SQt.value.delete(e),RYe()}},keyHandler(e){return SQt.value.get(e)??null},chords:ha.computed(()=>{return yUe.value,[...SQt.value.keys()]}),palette(e,n){if(IUe.value.has(e))throw oA("PALETTE_NAME_TAKEN",{detail:e,context:{name:e}});let A={name:e,definition:n,cache:null};IUe.value.set(e,A);let i=null;if(n.key){let s=NQt.value.get(n.key);if(s)throw IUe.value.delete(e),oA("MODE_KEY_TAKEN",{detail:`${n.key} is bound to "${s}"`,context:{key:n.key,name:e,taken:s}});NQt.value.set(n.key,e),i=()=>{NQt.value.delete(n.key)}}return RYe(),()=>{IUe.value.delete(e),i?.(),RYe()}},paletteFor(e){return yUe.value,IUe.value.get(e)??null},paletteForKey(e){yUe.value;let n=NQt.value.get(e);return n?IUe.value.get(n)??null:null},names:ha.computed(()=>{return yUe.value,[...IUe.value.keys()]}),modeKeys:ha.computed(()=>{return yUe.value,[...NQt.value.entries()].map(([e,n])=>({key:e,name:n}))})};LGt=ha.computed(()=>{return yUe.value,EUe.value,APr()})});function uca(e,n){if(n.prefix===void 0)return!1;if(!e.endsWith(n.prefix))return!1;let A=e[e.length-n.prefix.length-1];return A===void 0||A===" "}function lca(e,n){if(n.resolve!=="splice")return null;let A=aPr(e,n);if(A===-1)return null;let i=e.slice(A+n.key.length);if(/\s/.test(i))return null;return{start:A,query:i}}function gca(e,n){let A=(n.prefix??"")+n.key;if(!e.endsWith(A))return-1;let i=e.length-A.length,s=e[i-1];return s===void 0||s===" "?i:-1}function aPr(e,n){for(let A=e.length-1;A>=0;A--){if(e[A]!==n.key)continue;let i=e[A-1];if(i===void 0||i===" ")return A}return-1}var _Ue;var qTn=dt(()=>{_Ue=[{mode:"voice",key:"#",prefix:">",resolve:"append"},{mode:"file",key:"@",resolve:"splice"}]});function GQt(e){return!iPr.has(e)}function mca(e,n=()=>!0){let A=ha.ref("normal"),i=ha.ref(!1),s=ha.ref(null),u=ha.ref(0),g=null;ha.watch([A,i],([E,Q])=>{if((E==="loading"||Q)&&!g)g=setInterval(()=>{u.value++},80);else if(E!=="loading"&&!Q&&g)clearInterval(g),g=null}),ha.onUnmounted(()=>{if(g)clearInterval(g)});let d=ha.computed(()=>{if(i.value||A.value==="loading")return pca[u.value%pca.length];let E=MQt[A.value];if(E)return E;let Q=w2.paletteFor(A.value);return Q?.definition.symbol??Q?.definition.key??rPr});function f(E){A.value=E}function B(){for(let[E,Q]of Object.entries(aae))Lh(E,(w)=>{if(!n())return;if(A.value==="loading")return;if(A.value==="voice"&&Q==="voice"){s.value="confirm",A.value="normal",w.consumed=!0;return}if(e().length>0)return;A.value=A.value===Q?"normal":Q,w.consumed=!0});Lh("up",(E)=>{if(!n())return;if(A.value!=="normal")return;if(e().length>0)return;A.value="history",E.consumed=!0})}return{mode:A,symbol:d,processing:i,setMode:f,voiceExitReason:s,bindKeys:B}}var aae,Nls,iPr,qGt,MQt,rPr="\xB7",pca;var wUe=dt(()=>{Ks();QUe();qTn();aae={":":"command","/":"instance","*":"model","^":"session","~":"agent","#":"voice","?":"help",">":"prompt","%":"module",'"':"theme"},Nls=new Set(_Ue.map((e)=>e.mode)),iPr=new Set(["normal","loading","voice"]);qGt={command:"run app commands",instance:"switch to a running conversation",session:"reopen a past session",agent:"start an agent",model:"set the agent's model",voice:"voice input via microphone",help:"show this help",prompt:"insert a prompt into your message",module:"manage agent modules",theme:"switch colour theme",file:"reference a file in your message"},MQt={normal:"\xBB",command:":",instance:"/",model:"*",session:"^",agent:"~",voice:"#",help:"?",history:"\u2191",loading:"\u280B",escalation:"\u203C",prompt:">",module:"%",theme:'"',file:"@",question:"\xB7"},pca=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]});var dca={};Ta(dca,{useQuestions:()=>tL});function tL(){if(!UTn)UTn=oPr();return UTn}function oPr(){function e(n){if(kUe.value)throw oA("PALETTE_ALREADY_OPEN",{detail:"a question is already open"});return new Promise((A)=>{let i=(s)=>{if(!kUe.value)return;kUe.value=null,A(s)};kUe.value={...n(i),settle:i}})}return{pending:ha.computed(()=>kUe.value),cancel(){let n=kUe.value;if(!n)return;n.settle(n.kind==="confirm"?!1:void 0)},submitText(n){let A=kUe.value;if(A?.kind!=="prompt")return;A.settle(n.length>0?n:void 0)},async pick(n,A){return e((i)=>({kind:"pick",message:A?.placeholder??"",items:n.map((s,u)=>{let g=typeof s==="string",d=g?s:s.label,f=g?s:s.value;return{id:`pick-${u}`,label:d,...g?{}:s.description?{description:s.description}:{},action:()=>{i(f)}}})}))},async confirm(n,A){return e((i)=>({kind:"confirm",message:n,...A?.header?{header:A.header}:{},items:[{id:"yes",label:A?.choices?.yes??"yes",action:()=>{i(!0)}},{id:"no",label:A?.choices?.no??"no",action:()=>{i(!1)}}]}))},async prompt(n,A){return e(()=>({kind:"prompt",message:n,items:[],...A?.prompt?{prompt:A.prompt}:{},...A?.header?{header:A.header}:{},...A?.placeholder?{placeholder:A.placeholder}:{},...A?.secret?{secret:!0}:{}}))}}}var kUe,UTn;var DUe=dt(()=>{Ks();ps();kUe=ha.ref(null)});function $ye(){if(!TTn)TTn=sPr();return TTn}function sPr(){function e(n,A){let i=tre.value.find((s)=>s.id===n);if(!i)return;tre.value=tre.value.filter((s)=>s.id!==n),i.settle(A)}return{current:ha.computed(()=>tre.value[0]??null),waiting:ha.computed(()=>Math.max(0,tre.value.length-1)),ask(n){return new Promise((A)=>{tre.value=[...tre.value,{...n,settle:A}]})},answer(n,A=!1){let i=tre.value[0];if(i)e(i.id,{allow:n,always:A})},denyAll(){let n=tre.value;tre.value=[];for(let A of n)A.settle({allow:!1,always:!1})}}}var tre,TTn;var UGt=dt(()=>{Ks();tre=ha.ref([])});function cPr(e,n,A){return`${e}\x00${n}\x00${A??""}`}function YTn(e){return{id:e.id,label:e.label,...e.description!==void 0?{description:e.description}:{},...e.chunks!==void 0?{chunks:e.chunks}:{},...e.descendQuery!==void 0?{descendQuery:e.descendQuery}:{},...e.workingMessage!==void 0?{workingMessage:e.workingMessage}:{},...e.detach!==void 0?{detach:e.detach}:{},...e.header!==void 0?{header:e.header}:{},...e.separator!==void 0?{separator:e.separator}:{},...e.preview!==void 0?{preview:e.preview}:{},...e.choices!==void 0?{choices:()=>e.choices().map(YTn)}:{},action:e.action??(()=>{})}}function uPr(e){if(Array.isArray(e))return{items:e.map(YTn)};return{items:e.items.map(YTn),...e.breadcrumb!==void 0?{breadcrumb:e.breadcrumb}:{},...e.status!==void 0?{status:e.status}:{},...e.invalid!==void 0?{invalid:e.invalid}:{}}}function lPr(e,n,A){let i=cPr(e.name,n,A);fca.value;let s=KTn.value.get(i);if(s)return{items:s.items,...s.breadcrumb!==void 0?{breadcrumb:s.breadcrumb}:{},...s.status!==void 0?{status:s.status}:{},...s.invalid!==void 0?{invalid:s.invalid}:{}};if(!RTn.has(i))RTn.add(i),(async()=>{try{let u=await e.definition.list(n,A);KTn.value.set(i,{key:i,...uPr(u)})}catch(u){KTn.value.set(i,{key:i,items:[],status:{kind:"error",message:u instanceof Error?u.message:String(u)}})}finally{RTn.delete(i),fca.value++}})();return{items:[],status:{kind:"loading",message:"loading..."}}}function hca(e){return{id:e,resolve:ha.computed(()=>(n,A)=>{let i=tL().pending.value;if(i)return{items:i.items,...i.message?{breadcrumb:i.message}:{}};let s=w2.paletteFor(e);if(!s)return{items:[]};return lPr(s,n,A)}),get skipDefaultFilter(){return w2.paletteFor(e)?.definition.filter===!1},get tabs(){return w2.paletteFor(e)?.definition.tabs},get anchor(){return w2.paletteFor(e)?.definition.anchor},get maxHeight(){return w2.paletteFor(e)?.definition.maxHeight}}}var KTn,RTn,fca,YYe="escalation",bca,jYe="question",Bca;var jTn=dt(()=>{Ks();QUe();DUe();UGt();KTn=ha.ref(new Map),RTn=new Set,fca=ha.ref(0);bca={id:YYe,skipDefaultFilter:!0,resolve:ha.computed(()=>()=>{let e=$ye(),n=e.current.value;if(!n)return{items:[]};let A=e.waiting.value;return{items:[{id:"allow",label:"allow once",description:"just this call",action:()=>{e.answer(!0)}},{id:"always",label:"allow always",description:"remember this \u2014 revoke with :policy grants",action:()=>{e.answer(!0,!0)}},{id:"deny",label:"deny",description:"refuse this call",action:()=>{e.answer(!1)}}],header:{label:n.fn,detail:`"${n.subject}"`+(A>0?` (${A} more waiting)`:"")}}})},Bca={id:jYe,skipDefaultFilter:!0,resolve:ha.computed(()=>(e)=>{let n=tL().pending.value;if(!n)return{items:[]};if(n.kind==="prompt"){let A=e.length>0;return{items:[{id:"prompt",label:n.prompt??"waiting for input",placeholder:!n.prompt,description:A?"enter to confirm":"esc to cancel",action:()=>{}}],...n.header?{header:n.header}:{breadcrumb:n.message}}}return{items:n.items,...n.header?{header:n.header}:n.message?{breadcrumb:n.message}:{}}})}});function Ica(e){Cca.set(e.id,e)}function TGt(e){let n=Cca.get(e);if(n)return n;if(e===jYe)return Bca;if(e===YYe)return bca;return w2.paletteFor(e)?hca(e):void 0}var Cca;var Eca=dt(()=>{QUe();jTn();Cca=new Map});function gPr(e,n){if(e.length===0)return!0;if(e.length>n.length)return!1;let A=0;for(let i of n)if(i===e[A]){if(A++,A===e.length)return!0}return!1}function pPr(e,n){if(n===e)return 100;if(n.startsWith(e))return 75;if(n.includes(e))return 50;if(e.length>=mPr&&n.length<=e.length*dPr){if(gPr(e,n))return 25}return null}function xUe(e,n){let A=e.toLowerCase().split(/[\s:]+/).filter(Boolean);if(A.length===0)return 0;let i=n.map((u)=>u.toLowerCase()),s=0;for(let u of A){let g=null;for(let d of i){let f=pPr(u,d);if(f!==null&&(g===null||f>g))g=f}if(g===null)return null;s+=g}return s}var mPr=3,dPr=4;function Z$(e,n){let A=e[n];return!!A&&!A.header&&!A.separator&&!A.invalid}function yca(e){let{items:n,previous:A,selectedIndex:i,homeIndex:s}=e,u=A?.[i],g=u!==void 0&&n[i]?.id!==u.id;if(!(i>=n.length||!Z$(n,i))&&!g)return i;let f=u?n.findIndex((B)=>B.id===u.id):-1;return f>=0&&Z$(n,f)?f:s}function Qca(e){return typeof e.children==="function"?e.children():e.children}function fPr(e,n){let A=e.label.toLowerCase(),i=e.description.toLowerCase();if(A===n)return 5;if(A.split("/").at(-1)===n)return 4;if(A.startsWith(n))return 3;if(A.includes(n))return 2;if(i.includes(n))return 1;return 0}function hPr(e,n){let A=n.toLowerCase();return e.map((i,s)=>({node:i,index:s,score:fPr(i,A)})).filter((i)=>i.score>0).sort((i,s)=>s.score-i.score||i.index-s.index).map((i)=>i.node)}function _ca(e,n){let A=e.endsWith(" "),i=e.split(" "),s=i.map((Q)=>Q.toLowerCase()),u=n,g=[],d=A?s.length:s.length-1;for(let Q=0;Q<d;Q++){let w=s[Q];if(!w)continue;let S=u.find((G)=>G.label.toLowerCase()===w);if(!S)return{nodes:[],breadcrumb:g,partial:w,exactMatch:null,noMatch:!0,input:null};if(S.kind==="action")return{nodes:[],breadcrumb:g,partial:"",exactMatch:S,noMatch:!1,input:null};if(S.kind==="input")return{nodes:[],breadcrumb:[...g,S.label],partial:"",exactMatch:null,noMatch:!1,input:{node:S,value:i.slice(Q+1).join(" ").trim()}};g.push(S.label),u=Qca(S)}let f=A?"":s[s.length-1]??"",B=f?hPr(u,f):u;if(f&&B.length===0)return{nodes:B,breadcrumb:g,partial:f,exactMatch:null,noMatch:!0,input:null};let E=f?B.find((Q)=>Q.label.toLowerCase()===f.toLowerCase())??null:null;if(E&&E.kind==="group")return{nodes:Qca(E),breadcrumb:[...g,E.label],partial:"",exactMatch:null,noMatch:!1,input:null};return{nodes:B,breadcrumb:g,partial:f,exactMatch:E,noMatch:!1,input:null}}function wca(e,n){return[...e,n].join(" ")+" "}function KGt(e){if(e.length===0)return null;let n=3,A=e.length>n?e.slice(-n):e;return(e.length>n?"\u2026 \u203A ":"")+A.join(" \u203A ")+" \u203A"}import{existsSync as bPr}from"fs";import{join as kca,resolve as BPr}from"path";import{homedir as Dca}from"os";function CPr(){let e=PB();function n(){let f=e.store.profiles.active();if(!f)throw oA("NOT_AUTHENTICATED");return f}function A(f){let B=Dca();return f===B||f.startsWith(B+"/")?"~"+f.slice(B.length):f}function i(){let f=n(),B={dir:kca(e.store.root,"profiles",f.id,"agents"),label:"~/.axon (default)"},E=f.agents.extraRoots().map((Q)=>({dir:Q,label:A(Q)}));return[B,...E]}function s(){let f=e.store.profiles.active();if(!f)return[];return f.agents.extraRoots().map((B)=>({dir:B,label:A(B)}))}async function u(f,B){await e.projects.create("agent",{name:f,dir:B})}async function g(f){let B=BPr(f.startsWith("~")?kca(Dca(),f.slice(1)):f);if(!bPr(B))throw oA("WATCH_PATH_NOT_FOUND",{context:{path:B}});return await n().agents.watch(B),$c().refreshAvailable(),B}async function d(f){await n().agents.unwatch(f),$c().refreshAvailable()}return{locations:i,watched:s,create:u,watch:g,unwatch:d}}function HYe(){if(!HTn)HTn=CPr();return HTn}var HTn;var xca=dt(()=>{n9();iD();ps()});function Oye(){if(!PTn)PTn=EPr();return PTn}function EPr(){let e=ha.ref(null),n=0,A=null,i=!1,s=null,u=!1,g=null;function d(Q){s=Q}function f(Q){g=Q}function B(){if(i)return!0;if(g?.(),n++,A)clearTimeout(A);if(n===1)return e.value="press ctrl+c again to quit",A=setTimeout(()=>{n=0,e.value=null},IPr),!1;if(n===2)return E(),!1;return process.exit(130),!1}async function E(Q=0){if(u)return;if(u=!0,n=Math.max(n,2),A)clearTimeout(A);e.value="shutting down \xB7 ctrl+c to force quit";let w=process.env.AXON_SHUTDOWN_TRACE==="1",S=Date.now(),G=(V)=>{if(w)process.stderr.write(`[exit] ${V} +${Date.now()-S}ms
4935
+ `,"utf-8"),await IHr(S,g)}catch(w){throw e.store.update.state.set({status:"failed",from:Q.current,to:Q.latest,updatedAt:new Date().toISOString(),error:w instanceof Error?w.message:String(w)}),w}return Q}return{currentVersion:n,supported:d,check:f,handoff:B}}function Usa(e){let n=e;try{n=BHr(e)}catch{}return yHr(qsa(n),"update-helper.js")}var yQt;var Tsa=dt(()=>{CTn();ps();yQt=mp(Ryt(),1)});var Ksa=()=>{};var _Gt=dt(()=>{Tsa();Ksa();CTn()});import{join as QHr,resolve as _Hr}from"path";function QQt(e){let n=_Hr(e.cwd??process.cwd()),A=e.distribution??wHr,i={},s=yUn({root:e.store??QUn(A),settings:()=>i,setSetting:async(ie,ae)=>{let Be=await te.setSetting(ie,ae);return await z(),Be}}),u=$oa({store:s,distribution:A}),g=wUn(),d=Roa(),f=joa({root:n}),B=Wqn();async function E(){let ie=s.profiles.active()?.root;if(!ie)return;let{providers:ae}=await fUe(ie);return ae}let Q=mTn({budget:()=>{return}}),w=Xqn({cloud:u.client,profileProviders:()=>E(),frameworkVersion:e.version,...e.frameworkSource?{frameworkSource:e.frameworkSource}:{},...e.repoRoot?{repoRoot:e.repoRoot}:{},bench:{tests:B,clone:(ie,ae,Be)=>G.clone(ie,ae,Be),prepare:async(ie)=>{await(await w.open(ie)).prepare()}}}),S=iTn({...e.daemon?{daemon:e.daemon}:{},store:s,projects:w,cloud:u.client,cwd:n,clone:(ie,ae,Be)=>G.clone(ie,ae,Be),...e.control?{control:e.control}:{}}),G=vsa({cloud:u.client,async prepare(ie){await(await w.open(ie)).prepare()}}),q=Msa({cache:Fsa({cloud:u.client,root:s.root})}),P=ITn({cloud:u.client,store:s,currentVersion:e.version}),V=zoa({cloud:u.client}),W=rTn({store:s,projects:w,frameworkVersion:e.version});async function z(){if(!s.profiles.active()){i={};return}i=await te.settings()}let te=PUn({root:()=>W.root,install:async(ie,ae)=>{return{version:(await G.clone(ie,QHr(ae,".."),{dir:ae.split("/").at(-1)})).version}},latest:async(ie)=>(await u.client.registry.artifacts.resolve(ie)).version});return{cloud:u,store:s,deployments:V,projects:w,profile:W,extensions:te,refreshSettings:z,agents:S,registry:G,prompts:q,tests:B,mic:d,files:f,ollama:g,resources:Q,updates:P}}var wHr="production";var Rsa=dt(()=>{Eoa();voa();DUn();Hoa();Ooa();AQt();oTn();dGt();_sa();Zqn();Ssa();Lsa();_Gt()});function _Qt(e,n){let A=new Map;for(let s of e)switch(s.type){case"process:proc:start":{let u=s.data;A.set(u.procId,{procId:u.procId,kind:u.kind,command:u.command,pid:u.pid,cwd:u.cwd,status:"running",startedAt:typeof s.at==="number"?s.at:Date.now(),output:[]});break}case"process:proc:complete":{let u=s.data,g=A.get(u.procId);if(!g)break;if(g.status="exited",g.exitCode=u.code,typeof s.at==="number")g.endedAt=s.at;break}case"process:proc:failed":{let u=s.data,g=A.get(u.procId);if(!g)break;if(g.status="exited",typeof s.at==="number")g.endedAt=s.at;break}case"process:proc:denied":{let u=s.data,g=A.get(u.procId);if(g){g.status="exited",g.exitCode=-1;break}A.set(u.procId,{procId:u.procId,kind:"managed",command:u.command,status:"exited",exitCode:-1,startedAt:typeof s.at==="number"?s.at:Date.now(),output:[]});break}}let i=[...A.values()].sort((s,u)=>s.startedAt-u.startedAt);if(!n?.main)return i;return[{procId:"main",kind:"main",command:"agent \xB7 ts runtime",...n.main.pid!==void 0?{pid:n.main.pid}:{},status:n.main.status,startedAt:n.main.startedAt??i[0]?.startedAt??Date.now(),main:!0,output:[]},...i]}var Ysa=()=>{};var wGt=dt(()=>{Rsa();Ysa();J3n()});var bUe;var kGt=dt(()=>{bUe={name:"@arcforge/axon",version:"2.0.166",description:"The platform to build agents \u2014 a terminal, a runtime, and a toolkit for building, running, and deploying reliable AI agents.",module:"index.ts",type:"module",scripts:{build:"vterm build","daemon:check":"bun run scripts/daemon-check.ts",deploy:"bun run scripts/release.ts patch","deploy:major":"bun run scripts/release.ts major","deploy:minor":"bun run scripts/release.ts minor","deploy:patch":"bun run scripts/release.ts patch",dev:"vterm dev","dev:local":"vterm dev --dotenv .env.local",prepare:"vterm prepare",tail:"vterm tail",test:"bun test --parallel=4 --path-ignore-patterns='**/tests/perf/**'","test:perf":"bun test tests/perf","test:serial":"bun test --path-ignore-patterns='**/tests/perf/**'","test:watch":"bun test --watch",typecheck:"bun run scripts/typecheck.ts"},dependencies:{"@arcforge/cognet":"workspace:*","@arcforge/engines":"workspace:*","@arcforge/err":"workspace:*","@arcforge/platform":"workspace:*","@arcforge/types":"workspace:*","@arcforge/vterm":"workspace:*","@arcforge/cloud":"workspace:*","@arcforge/capsule":"workspace:*","@arcforge/core":"workspace:*","@arcforge/theme":"workspace:*","@arcforge/vstr":"workspace:*","@vue/compiler-sfc":"3.5.39","@arcforge/arcline":"workspace:*",chalk:"^5.6.2","fft.js":"^4.0.4",h3:"^1.15.11","markdown-it":"^14.3.0",open:"^11.0.0",semver:"^7.7.4",sharp:"^0.35.3","@arcforge/axond":"workspace:*"},devDependencies:{"@types/bun":"latest","@types/markdown-it":"^14.1.2","@types/semver":"^7.7.1","@vue/typescript-plugin":"^3.2.5",postgres:"^3.4.5"},peerDependencies:{typescript:"^5"},bin:{axon:"./bin/axon"},homepage:"https://axon.arclabs.it",repository:{type:"git",url:"git+https://github.com/artificial-cognition-laboratories/axon.git",directory:"apps/tui"},bugs:{url:"https://github.com/artificial-cognition-laboratories/axon/issues"},keywords:["axon","ai","agent","agents","llm","ai-agent","agent-runtime","typescript"]}});function DGt(e,n){let A=e;for(let i of n){if(A===null||typeof A!=="object"||!(i in A))throw oA("CONTROL_PATH_NOT_FOUND",{detail:`no such method on the peer: ${n.join(".")}`,context:{path:n.join(".")}});A=A[i]}return A}function xGt(e){let n=new Map,A=new Map,i=new Map,s=!1,u=0,g=()=>`${++u}`;async function d(Q){try{let w=DGt(e.handle,Q.path.slice(0,-1)),S=DGt(e.handle,Q.path);if(typeof S!=="function")throw oA("CONTROL_PATH_NOT_CALLABLE",{detail:`not callable on the peer: ${Q.path.join(".")}`,context:{path:Q.path.join(".")}});let G=await S.apply(w,Q.args);e.send({type:"rpc.result",id:Q.id,ok:!0,value:G})}catch(w){e.send({type:"rpc.result",id:Q.id,ok:!1,error:w instanceof Error?w.message:String(w)})}}function f(Q){try{let w=DGt(e.handle,Q.path.slice(0,-1)),S=DGt(e.handle,Q.path);if(typeof S!=="function")throw oA("CONTROL_PATH_NOT_CALLABLE",{detail:`not callable on the peer: ${Q.path.join(".")}`,context:{path:Q.path.join(".")}});let G=(P)=>e.send({type:"rpc.event",id:Q.id,value:P}),q=S.apply(w,[...Q.args,G]);A.set(Q.id,q)}catch(w){e.send({type:"rpc.result",id:Q.id,ok:!1,error:w instanceof Error?w.message:String(w)})}}function B(Q){A.get(Q.id)?.(),A.delete(Q.id)}function E(Q){let w=n.get(Q.id);if(!w)return;if(n.delete(Q.id),Q.ok)w.resolve(Q.value);else w.reject(oA("CONTROL_CALL_FAILED",{detail:Q.error,context:{error:Q.error}}))}return{accept(Q){if(Q.type==="rpc.call")return void d(Q);if(Q.type==="rpc.subscribe")return f(Q);if(Q.type==="rpc.unsubscribe")return B(Q);if(Q.type==="rpc.result")return E(Q);i.get(Q.id)?.(Q.value)},call(Q,w=[]){if(s)return Promise.reject(oA("CONTROL_CLOSED",{detail:`channel closed before ${Q.join(".")} could be sent`,context:{path:Q.join(".")}}));let S=g();return new Promise((G,q)=>{n.set(S,{resolve:G,reject:q}),e.send({type:"rpc.call",id:S,path:Q,args:w})})},subscribe(Q,w,S){if(s)throw oA("CONTROL_CLOSED",{detail:`channel closed before ${Q.join(".")} could be sent`,context:{path:Q.join(".")}});let G=g();return i.set(G,S),e.send({type:"rpc.subscribe",id:G,path:Q,args:w}),()=>{if(!i.delete(G))return;if(!s)e.send({type:"rpc.unsubscribe",id:G})}},close(Q){if(s)return;s=!0;for(let w of A.values())w();A.clear(),i.clear();for(let w of n.values())w.reject(oA("CONTROL_CLOSED",{detail:Q,context:{error:Q}}));n.clear()}}}var FGt=dt(()=>{ps()});function ETn(e){if(typeof e!=="object"||e===null)return!1;let n=e.type;return n==="rpc.call"||n==="rpc.result"||n==="rpc.subscribe"||n==="rpc.unsubscribe"||n==="rpc.event"}import{randomBytes as xHr}from"crypto";function wQt(e){let n=xHr(32).toString("hex"),A=null,i=new Set;function s(){for(let f of i)f(u.size)}let u=new Map;function g(f,B){let E=u.get(f);if(!E)return;E.dispatch.close(B),u.delete(f),s()}async function d(f){let B=[...u.values()];if(B.length===0)throw oA("CONTROL_CLOSED",{detail:"no editor attached"});if(B.length===1)return B[0].dispatch;let E=await Promise.all(B.map(async(Q)=>{try{let w=await Q.dispatch.call(["editor","claim"],[f??null]);return{dispatch:Q.dispatch,contains:w?.contains===!0,focusedAt:w?.focusedAt??0}}catch{return{dispatch:Q.dispatch,contains:!1,focusedAt:0}}}));return E.sort((Q,w)=>Q.contains!==w.contains?Q.contains?-1:1:w.focusedAt-Q.focusedAt),E[0].dispatch}return{token:n,get port(){return A?.port??null},get attached(){return u.size>0},get peerCount(){return u.size},watch(f){return i.add(f),()=>{i.delete(f)}},listen(){if(A)return A.port;return A=Bun.serve({port:e.port??0,hostname:"127.0.0.1",fetch(f,B){if(B.upgrade(f,{data:null}))return;return new Response("axon control channel",{status:426})},websocket:{message(f,B){let E;try{E=JSON.parse(String(B))}catch{f.close(1003,"malformed frame");return}let Q=u.get(f);if(!Q){let w=E;if(w?.type!=="control.hello"||w.token!==n){f.close(1008,"unauthorized");return}let S={send:(G)=>f.send(G),close:()=>f.close()};u.set(f,{socket:S,dispatch:xGt({handle:e.handle,send:(G)=>S.send(JSON.stringify(G))})}),f.send(JSON.stringify({type:"control.welcome",peer:"tui"})),s();return}if(!ETn(E))return;Q.dispatch.accept(E)},close(f){g(f,"editor disconnected")}}}),A.port},editor:{async call(f,...B){return await(await d()).call(["editor",String(f)],B)},async about(f,B,...E){return await(await d(f)).call(["editor",String(B)],E)}},close(){for(let[f,B]of u)g(f,"tui shutting down"),B.socket.close();A?.stop(!0),A=null}}}var jsa=dt(()=>{ps();FGt()});var Hsa=dt(()=>{ps();FGt()});var yTn=dt(()=>{jsa();Hsa();FGt()});function vGt(){let e=(n)=>{let A=Psa[n];if(!A)throw Error(`TUI_NOT_READY: this TUI cannot ${n} yet \u2014 it is still starting up`);return A};return{send:(n)=>e("send")(n),interrupt:()=>e("interrupt")(),focus:(n)=>e("focus")(n),capsule:(n,A)=>e("capsule")(n,A),lastActiveAt:async()=>Jsa}}function $sa(e){Psa=e}function QTn(){Jsa=Date.now()}var Psa,Jsa;var kQt=dt(()=>{Psa={},Jsa=Date.now()});function Xie(){if(!_Tn)_Tn=FHr();return _Tn}function FHr(){let e=null,n=ha.ref(0);function A(){if(e)return;let f=wQt({handle:{tui:vGt()}});f.watch(()=>{n.value++}),f.listen(),e=f}function i(){let f=e?.port;if(!e||f===null||f===void 0)return null;return{port:f,token:e.token}}let s=ha.computed(()=>{return n.value,(e?.peerCount??0)>0});async function u(f,...B){if(!e)throw Error("CONTROL_NOT_LISTENING: this TUI is not serving a control channel");return e.editor.call(f,...B)}async function g(f,B,...E){if(!e)throw Error("CONTROL_NOT_LISTENING: this TUI is not serving a control channel");return e.editor.about(f,B,...E)}function d(){e?.close(),e=null,n.value++}return{listen:A,control:i,available:s,editor:u,editorAbout:g,close:d}}var _Tn;var SGt=dt(()=>{Ks();yTn();kQt()});function PB(){if(!wTn){let e=NYe({cloud:()=>PB().cloud.client});wTn=QQt({daemon:e.agents,version:bUe.version,cwd:process.env.PWD??process.cwd(),control:()=>Xie().control()})}return wTn}var wTn=null;var n9=dt(()=>{rGt();wGt();kGt();SGt()});function vHr(e,n){let A=ha.ref("idle"),i=ha.ref(null),s=ha.ref(null),u=ha.ref(0);function g(){u.value++}function d(te,ie,ae){let Be=ha.ref(!1),xe=ha.ref(null),Re=ha.ref(!1);async function Oe(){if(!e.authenticated){Re.value=!1;return}let it=await te.status();Re.value=it.connected&&it.status==="active"}Oe().catch((it)=>{xe.value=it instanceof Error?it:Error(String(it))});async function Ne(...it){Be.value=!0,xe.value=null;try{if(await ie(...it),ae)await PB().extensions.addProvider(ae);Re.value=!0}catch(Me){throw xe.value=Me instanceof Error?Me:Error(String(Me)),Me}finally{Be.value=!1,g()}}async function $e(){if(await te.disconnect(),ae)await PB().extensions.removeProvider(ae);Re.value=!1,g()}return{connected:Re,connecting:Be,error:xe,connect:Ne,disconnect:$e,refreshStatus:Oe}}let f=d(e.connections.openai,()=>e.connections.openai.connect({open:(te)=>{CBe(te)}}),"Codex"),B=d(e.connections.openrouter,(te)=>e.connections.openrouter.connect({key:te}),"OpenRouter");function E(te){let ie=ha.ref(!1),ae=ha.ref(!1),Be=ha.ref(null);async function xe(){let Ne=await PB().extensions.readProviders();ie.value=Ne.includes(te)}xe().catch((Ne)=>{Be.value=Ne instanceof Error?Ne:Error(String(Ne))});async function Re(){ae.value=!0,Be.value=null;try{await PB().extensions.addProvider(te),ie.value=!0}catch(Ne){throw Be.value=Ne instanceof Error?Ne:Error(String(Ne)),Ne}finally{ae.value=!1,g()}}async function Oe(){await PB().extensions.removeProvider(te),ie.value=!1,g()}return{connected:ie,connecting:ae,error:Be,connect:Re,disconnect:Oe,refreshStatus:xe}}let Q=E("Ollama"),w=ha.ref(e.authenticated?"checking":"signed-out"),S=ha.computed(()=>{return u.value,w.value==="verified"});async function G(){if(!e.authenticated)return w.value="signed-out",g(),w.value;w.value="checking",g();try{let te=await e.validate();w.value=te==="valid"?"verified":te==="rejected"?"signed-out":"unreachable"}catch{w.value="unreachable"}return g(),w.value}if(w.value==="checking")G();e.onSessionExpired(()=>{w.value="signed-out",g()});let q=ha.computed(()=>{return u.value,e.client.user.auth.user}),P=ha.computed(()=>{return u.value,n.profiles.list().flatMap((te)=>{let ie=n.profiles.get(te).record.get();if(!ie)return[];let ae=!!(ie.auth.accessToken||ie.auth.apiKey);return[{id:te,email:ie.user.email,authenticated:ae}]})});async function V(te){A.value="authorizing",i.value=null;try{await e.login({...te!==void 0?{hint:te}:{},onCode:(ie)=>{i.value=ie,A.value="polling",CBe(ie.verificationUriComplete)}}),w.value="verified"}finally{A.value="idle",i.value=null,g()}}async function W(te){s.value=te;try{return await e.switch(te),w.value="verified","verified"}catch(ie){let ae=w5e(ie)&&ie.code==="AX-TUI-044";return w.value=ae?"unreachable":"signed-out",ae?"unreachable":"rejected"}finally{s.value=null,g()}}async function z(){await e.logout(),w.value="signed-out",g()}return{isAuthenticated:S,gate:ha.computed(()=>w.value),verify:G,identity:q,profiles:P,loginStatus:A,deviceAuthorization:i,switchingProfileId:s,startLogin:V,switchProfile:W,logout:z,connections:{openai:f,openrouter:B,ollama:Q}}}function m8(){if(!kTn){let e=PB();kTn=vHr(e.cloud,e.store)}return kTn}var kTn;var Hye=dt(()=>{Ks();YBt();ps();n9()});var vTn={};Ta(vTn,{useSettings:()=>FQt});function YHr(){let e=PB();async function n(){try{xQt.value=await e.extensions.settings()}catch{xQt.value={}}xTn.value++}return{settings:ha.computed(()=>{return xTn.value,xQt.value}),refresh:n,async set(A,i){xQt.value={...xQt.value,[A]:i},xTn.value++,await e.extensions.setSetting(A,i)}}}function FQt(){if(!FTn)FTn=YHr();return FTn}var xQt,xTn,FTn;var vQt=dt(()=>{Ks();n9();xQt=ha.ref({}),xTn=ha.ref(0)});var GTn={};Ta(GTn,{useTheme:()=>SE,DEFAULT_THEME_NAME:()=>GGt});async function HHr(e){try{let{useSettings:n}=await Promise.resolve().then(() => (vQt(),vTn));await n().set("theme",e)}catch{}}function Jye(e){return Aae.value.find((n)=>n.name===e)??null}function Zsa(e){let n=Jye(e);if(!n)throw Error(`no theme named "${e}"`);W$.value=e,STn.value=e,Pye.value=null,CUe(n),HHr(e)}function CUe(e){vTe.register(jHr,{":root":{cssVariables:Dbn(e)}}),Cdt({theme:e.syntax==="arcnight"?Ikt:e.syntax}),BUe.value++,NTn?.()}function SE(){if(!NTn)try{NTn=bC()}catch{}return{themes:ha.computed(()=>{return BUe.value,Aae.value}),active:ha.computed(()=>{return BUe.value,Jye(W$.value)??Aae.value[0]}),committedName:ha.computed(()=>Pye.value??W$.value),themeClass:ha.computed(()=>{return BUe.value,`theme-${W$.value}`}),create(e){if(Jye(e.name))throw Error(`theme "${e.name}" is already registered`);if(Aae.value=[...Aae.value,e],BUe.value++,STn.value===e.name)W$.value=e.name,CUe(e);return()=>{if(Aae.value=Aae.value.filter((n)=>n.name!==e.name),W$.value===e.name)W$.value=Aae.value[0].name,CUe(Aae.value[0]);BUe.value++}},set:Zsa,reset(){Zsa(GGt)},preview(e){let n=Jye(e);if(!n)return;if(Pye.value===null)Pye.value=W$.value;W$.value=e,CUe(n)},cancelPreview(){if(Pye.value===null)return;let e=Jye(Pye.value);if(W$.value=Pye.value,Pye.value=null,e)CUe(e)},mount(){let e=Jye(W$.value)??Aae.value[0];CUe(e)},adopt(e){if(!e)return;STn.value=e;let n=Jye(e);if(!n)return;W$.value=e,CUe(n)},colors:ha.computed(()=>{BUe.value;let e=Jye(W$.value)??Aae.value[0];return{primary:String(e.primary),background:String(e.background),text:String(e.text),dim:String(e.dim),warn:String(e.warn),error:String(e.error)}})}}var jHr="axon:theme:tokens",GGt,Aae,W$,Pye,STn,BUe,NTn=null;var A9=dt(()=>{Ks();Ks();Ekt();GGt=Bdt[0].name,Aae=ha.ref([...Bdt]),W$=ha.ref(Bdt[0].name),Pye=ha.ref(null),STn=ha.ref(null),BUe=ha.ref(0)});function Vsa(){let e=0;return{claim(){let n=++e;return{get latest(){return e===n}}}}}function Xsa(e){for(let n=e.length-1;n>=0;n--){let A=e[n];if(A.type!=="kernel:engine:complete")continue;let i=A.data?.meta?.model;if(typeof i==="string")return i}return null}function eca(e){let n=NAe(e??void 0);if(!n)return null;if(n.provider!==void 0&&n.provider!=="axon")return null;if(n.model!=="auto")return null;return{model:"auto"}}function MGt(e){let{provider:n,declared:A,resolved:i}=e;if(!A)return n;let s=`${n}/${A}`;if(A!=="auto")return s;if(!i||i==="auto")return s;return`${i} (${A})`}var tca=dt(()=>{cRe()});function PHr(e,n,A){if(A<=0||n<=0)return;let i=n/A,s=MTn.get(e);MTn.set(e,s===void 0?i:s*0.7+i*0.3)}function JHr(e){return(e?MTn.get(e):void 0)??4.5}function nca(e,n=[]){let A=null,i=null,s=null,u=-1;for(let d=e.length-1;d>=0;d--){let f=e[d];if(f.type==="kernel:engine:complete"){let B=f.data?.meta;if(A??=B.model,B.tokens){i=B.tokens.in+B.tokens.out,u=f.time.seq;break}continue}if(f.type==="kernel:engine:input"){s=f.data?.bytes??s,u=f.time.seq,A??=$Hr(e,d);break}}if(i===null&&s===null)return null;if(i!==null){let d=OHr(e,u);if(A&&d!==null)PHr(A,d,i);return{tokens:i,model:A}}let g=zHr(n,u);return{tokens:Math.round(s/JHr(A))+Math.round(g/3.3),model:A}}function $Hr(e,n){for(let A=n;A>=0;A--){let i=e[A];if(i.type==="kernel:engine:start"){let s=i.data.model;if(s)return s}if(i.type==="kernel:engine:complete")return i.data?.meta?.model??null}return null}function OHr(e,n){for(let A=e.length-1;A>=0;A--){let i=e[A];if(i.time.seq>=n)continue;if(i.type==="kernel:engine:input")return i.data?.bytes??null;if(i.type==="kernel:engine:complete")return null}return null}function zHr(e,n){let A=0;for(let i=e.length-1;i>=0;i--){let s=e[i];if(s.time.seq<=n)break;if(s.type!=="cognet:output:text")continue;let u=s.data.content;if(u)A+=u.length}return A}function Aca(){let A=0,i=null;return{step(s){if(!s)return null;if(s.model!==i)return i=s.model,A=s.tokens,A;if(s.tokens>=A)return A=s.tokens,A;let u=A-s.tokens;if(u<=200)return A;if(A=Math.round(A-u*0.25),A-s.tokens<=200)A=s.tokens;return A},reset(){A=0,i=null}}}function WHr(e){if(e>=1e6){let n=e/1e6;return`${n.toFixed(n>=10?0:1)}m`}if(e===0)return"0k";return`${(e/1000).toFixed(1)}k`}function ZHr(e){if(e>=1e6){let n=Number((e/1e6).toFixed(1));return`${n%1===0?n.toFixed(0):n.toFixed(1)}m`}return`${Math.round(e/1000)}k`}function aca(e,n){let A=e.find((s)=>s.id===n);if(A)return A.context;return e.find((s)=>s.id.slice(s.id.indexOf("/")+1)===n)?.context??0}function ica(e,n){if(e===null||n<=0)return null;return`${WHr(e)}/${ZHr(n)}`}var MTn;var LTn=dt(()=>{MTn=new Map});import{homedir as VHr}from"os";import{basename as XHr,relative as ePr,sep as rca}from"path";function oca(e,n){if(!e)return null;if(/^https?:\/\//i.test(e))return e;if(n&&tPr(e,n))return`axon:${XHr(e)}`;return nPr(e)}function tPr(e,n){let A=ePr(n,e);return A.length>0&&!A.startsWith("..")&&!A.includes(rca)}function nPr(e){let n=VHr();if(e===n)return"~";return e.startsWith(n+rca)?"~"+e.slice(n.length):e}var sca=()=>{};function RYe(){yUe.value++}function cca(e){return e.join(" ")}function APr(){let e=[];for(let n of w2.commands){let A=e;for(let s of n.path.slice(0,-1)){let u=A.find((d)=>d.kind==="group"&&d.label===s);if(u){A=Array.isArray(u.children)?u.children:[];continue}let g={kind:"group",label:s,description:"",children:[]};A.push(g),A=g.children}let i=n.path.at(-1);A.push({kind:"action",label:i,description:n.description??"",action:n.action,...n.workingMessage?{workingMessage:n.workingMessage}:{}})}return e}var EUe,SQt,IUe,NQt,yUe,w2,LGt;var QUe=dt(()=>{Ks();ps();EUe=ha.ref([]),SQt=ha.ref(new Map),IUe=ha.ref(new Map),NQt=ha.ref(new Map),yUe=ha.ref(0);w2={command(e){let n=cca(e.path);if(EUe.value.some((i)=>cca(i.path)===n))throw oA("COMMAND_PATH_TAKEN",{detail:n,context:{path:e.path}});let A=crypto.randomUUID();return EUe.value=[...EUe.value,{...e,id:A}],RYe(),()=>{EUe.value=EUe.value.filter((i)=>i.id!==A),RYe()}},get commands(){return EUe.value},key(e,n){if(SQt.value.has(e))throw oA("KEY_CHORD_TAKEN",{detail:e,context:{chord:e}});SQt.value.set(e,n),RYe();let A=!1;return()=>{if(A)return;A=!0,SQt.value.delete(e),RYe()}},keyHandler(e){return SQt.value.get(e)??null},chords:ha.computed(()=>{return yUe.value,[...SQt.value.keys()]}),palette(e,n){if(IUe.value.has(e))throw oA("PALETTE_NAME_TAKEN",{detail:e,context:{name:e}});let A={name:e,definition:n,cache:null};IUe.value.set(e,A);let i=null;if(n.key){let s=NQt.value.get(n.key);if(s)throw IUe.value.delete(e),oA("MODE_KEY_TAKEN",{detail:`${n.key} is bound to "${s}"`,context:{key:n.key,name:e,taken:s}});NQt.value.set(n.key,e),i=()=>{NQt.value.delete(n.key)}}return RYe(),()=>{IUe.value.delete(e),i?.(),RYe()}},paletteFor(e){return yUe.value,IUe.value.get(e)??null},paletteForKey(e){yUe.value;let n=NQt.value.get(e);return n?IUe.value.get(n)??null:null},names:ha.computed(()=>{return yUe.value,[...IUe.value.keys()]}),modeKeys:ha.computed(()=>{return yUe.value,[...NQt.value.entries()].map(([e,n])=>({key:e,name:n}))})};LGt=ha.computed(()=>{return yUe.value,EUe.value,APr()})});function uca(e,n){if(n.prefix===void 0)return!1;if(!e.endsWith(n.prefix))return!1;let A=e[e.length-n.prefix.length-1];return A===void 0||A===" "}function lca(e,n){if(n.resolve!=="splice")return null;let A=aPr(e,n);if(A===-1)return null;let i=e.slice(A+n.key.length);if(/\s/.test(i))return null;return{start:A,query:i}}function gca(e,n){let A=(n.prefix??"")+n.key;if(!e.endsWith(A))return-1;let i=e.length-A.length,s=e[i-1];return s===void 0||s===" "?i:-1}function aPr(e,n){for(let A=e.length-1;A>=0;A--){if(e[A]!==n.key)continue;let i=e[A-1];if(i===void 0||i===" ")return A}return-1}var _Ue;var qTn=dt(()=>{_Ue=[{mode:"voice",key:"#",prefix:">",resolve:"append"},{mode:"file",key:"@",resolve:"splice"}]});function GQt(e){return!iPr.has(e)}function mca(e,n=()=>!0){let A=ha.ref("normal"),i=ha.ref(!1),s=ha.ref(null),u=ha.ref(0),g=null;ha.watch([A,i],([E,Q])=>{if((E==="loading"||Q)&&!g)g=setInterval(()=>{u.value++},80);else if(E!=="loading"&&!Q&&g)clearInterval(g),g=null}),ha.onUnmounted(()=>{if(g)clearInterval(g)});let d=ha.computed(()=>{if(i.value||A.value==="loading")return pca[u.value%pca.length];let E=MQt[A.value];if(E)return E;let Q=w2.paletteFor(A.value);return Q?.definition.symbol??Q?.definition.key??rPr});function f(E){A.value=E}function B(){for(let[E,Q]of Object.entries(aae))Lh(E,(w)=>{if(!n())return;if(A.value==="loading")return;if(A.value==="voice"&&Q==="voice"){s.value="confirm",A.value="normal",w.consumed=!0;return}if(e().length>0)return;A.value=A.value===Q?"normal":Q,w.consumed=!0});Lh("up",(E)=>{if(!n())return;if(A.value!=="normal")return;if(e().length>0)return;A.value="history",E.consumed=!0})}return{mode:A,symbol:d,processing:i,setMode:f,voiceExitReason:s,bindKeys:B}}var aae,Nls,iPr,qGt,MQt,rPr="\xB7",pca;var wUe=dt(()=>{Ks();QUe();qTn();aae={":":"command","/":"instance","*":"model","^":"session","~":"agent","#":"voice","?":"help",">":"prompt","%":"module",'"':"theme"},Nls=new Set(_Ue.map((e)=>e.mode)),iPr=new Set(["normal","loading","voice"]);qGt={command:"run app commands",instance:"switch to a running conversation",session:"reopen a past session",agent:"start an agent",model:"set the agent's model",voice:"voice input via microphone",help:"show this help",prompt:"insert a prompt into your message",module:"manage agent modules",theme:"switch colour theme",file:"reference a file in your message"},MQt={normal:"\xBB",command:":",instance:"/",model:"*",session:"^",agent:"~",voice:"#",help:"?",history:"\u2191",loading:"\u280B",escalation:"\u203C",prompt:">",module:"%",theme:'"',file:"@",question:"\xB7"},pca=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]});var dca={};Ta(dca,{useQuestions:()=>tL});function tL(){if(!UTn)UTn=oPr();return UTn}function oPr(){function e(n){if(kUe.value)throw oA("PALETTE_ALREADY_OPEN",{detail:"a question is already open"});return new Promise((A)=>{let i=(s)=>{if(!kUe.value)return;kUe.value=null,A(s)};kUe.value={...n(i),settle:i}})}return{pending:ha.computed(()=>kUe.value),cancel(){let n=kUe.value;if(!n)return;n.settle(n.kind==="confirm"?!1:void 0)},submitText(n){let A=kUe.value;if(A?.kind!=="prompt")return;A.settle(n.length>0?n:void 0)},async pick(n,A){return e((i)=>({kind:"pick",message:A?.placeholder??"",items:n.map((s,u)=>{let g=typeof s==="string",d=g?s:s.label,f=g?s:s.value;return{id:`pick-${u}`,label:d,...g?{}:s.description?{description:s.description}:{},action:()=>{i(f)}}})}))},async confirm(n,A){return e((i)=>({kind:"confirm",message:n,...A?.header?{header:A.header}:{},items:[{id:"yes",label:A?.choices?.yes??"yes",action:()=>{i(!0)}},{id:"no",label:A?.choices?.no??"no",action:()=>{i(!1)}}]}))},async prompt(n,A){return e(()=>({kind:"prompt",message:n,items:[],...A?.prompt?{prompt:A.prompt}:{},...A?.header?{header:A.header}:{},...A?.placeholder?{placeholder:A.placeholder}:{},...A?.secret?{secret:!0}:{}}))}}}var kUe,UTn;var DUe=dt(()=>{Ks();ps();kUe=ha.ref(null)});function $ye(){if(!TTn)TTn=sPr();return TTn}function sPr(){function e(n,A){let i=tre.value.find((s)=>s.id===n);if(!i)return;tre.value=tre.value.filter((s)=>s.id!==n),i.settle(A)}return{current:ha.computed(()=>tre.value[0]??null),waiting:ha.computed(()=>Math.max(0,tre.value.length-1)),ask(n){return new Promise((A)=>{tre.value=[...tre.value,{...n,settle:A}]})},answer(n,A=!1){let i=tre.value[0];if(i)e(i.id,{allow:n,always:A})},denyAll(){let n=tre.value;tre.value=[];for(let A of n)A.settle({allow:!1,always:!1})}}}var tre,TTn;var UGt=dt(()=>{Ks();tre=ha.ref([])});function cPr(e,n,A){return`${e}\x00${n}\x00${A??""}`}function YTn(e){return{id:e.id,label:e.label,...e.description!==void 0?{description:e.description}:{},...e.chunks!==void 0?{chunks:e.chunks}:{},...e.descendQuery!==void 0?{descendQuery:e.descendQuery}:{},...e.workingMessage!==void 0?{workingMessage:e.workingMessage}:{},...e.detach!==void 0?{detach:e.detach}:{},...e.header!==void 0?{header:e.header}:{},...e.separator!==void 0?{separator:e.separator}:{},...e.preview!==void 0?{preview:e.preview}:{},...e.choices!==void 0?{choices:()=>e.choices().map(YTn)}:{},action:e.action??(()=>{})}}function uPr(e){if(Array.isArray(e))return{items:e.map(YTn)};return{items:e.items.map(YTn),...e.breadcrumb!==void 0?{breadcrumb:e.breadcrumb}:{},...e.status!==void 0?{status:e.status}:{},...e.invalid!==void 0?{invalid:e.invalid}:{}}}function lPr(e,n,A){let i=cPr(e.name,n,A);fca.value;let s=KTn.value.get(i);if(s)return{items:s.items,...s.breadcrumb!==void 0?{breadcrumb:s.breadcrumb}:{},...s.status!==void 0?{status:s.status}:{},...s.invalid!==void 0?{invalid:s.invalid}:{}};if(!RTn.has(i))RTn.add(i),(async()=>{try{let u=await e.definition.list(n,A);KTn.value.set(i,{key:i,...uPr(u)})}catch(u){KTn.value.set(i,{key:i,items:[],status:{kind:"error",message:u instanceof Error?u.message:String(u)}})}finally{RTn.delete(i),fca.value++}})();return{items:[],status:{kind:"loading",message:"loading..."}}}function hca(e){return{id:e,resolve:ha.computed(()=>(n,A)=>{let i=tL().pending.value;if(i)return{items:i.items,...i.message?{breadcrumb:i.message}:{}};let s=w2.paletteFor(e);if(!s)return{items:[]};return lPr(s,n,A)}),get skipDefaultFilter(){return w2.paletteFor(e)?.definition.filter===!1},get tabs(){return w2.paletteFor(e)?.definition.tabs},get anchor(){return w2.paletteFor(e)?.definition.anchor},get maxHeight(){return w2.paletteFor(e)?.definition.maxHeight}}}var KTn,RTn,fca,YYe="escalation",bca,jYe="question",Bca;var jTn=dt(()=>{Ks();QUe();DUe();UGt();KTn=ha.ref(new Map),RTn=new Set,fca=ha.ref(0);bca={id:YYe,skipDefaultFilter:!0,resolve:ha.computed(()=>()=>{let e=$ye(),n=e.current.value;if(!n)return{items:[]};let A=e.waiting.value;return{items:[{id:"allow",label:"allow once",description:"just this call",action:()=>{e.answer(!0)}},{id:"always",label:"allow always",description:"remember this \u2014 revoke with :policy grants",action:()=>{e.answer(!0,!0)}},{id:"deny",label:"deny",description:"refuse this call",action:()=>{e.answer(!1)}}],header:{label:n.fn,detail:`"${n.subject}"`+(A>0?` (${A} more waiting)`:"")}}})},Bca={id:jYe,skipDefaultFilter:!0,resolve:ha.computed(()=>(e)=>{let n=tL().pending.value;if(!n)return{items:[]};if(n.kind==="prompt"){let A=e.length>0;return{items:[{id:"prompt",label:n.prompt??"waiting for input",placeholder:!n.prompt,description:A?"enter to confirm":"esc to cancel",action:()=>{}}],...n.header?{header:n.header}:{breadcrumb:n.message}}}return{items:n.items,...n.header?{header:n.header}:n.message?{breadcrumb:n.message}:{}}})}});function Ica(e){Cca.set(e.id,e)}function TGt(e){let n=Cca.get(e);if(n)return n;if(e===jYe)return Bca;if(e===YYe)return bca;return w2.paletteFor(e)?hca(e):void 0}var Cca;var Eca=dt(()=>{QUe();jTn();Cca=new Map});function gPr(e,n){if(e.length===0)return!0;if(e.length>n.length)return!1;let A=0;for(let i of n)if(i===e[A]){if(A++,A===e.length)return!0}return!1}function pPr(e,n){if(n===e)return 100;if(n.startsWith(e))return 75;if(n.includes(e))return 50;if(e.length>=mPr&&n.length<=e.length*dPr){if(gPr(e,n))return 25}return null}function xUe(e,n){let A=e.toLowerCase().split(/[\s:]+/).filter(Boolean);if(A.length===0)return 0;let i=n.map((u)=>u.toLowerCase()),s=0;for(let u of A){let g=null;for(let d of i){let f=pPr(u,d);if(f!==null&&(g===null||f>g))g=f}if(g===null)return null;s+=g}return s}var mPr=3,dPr=4;function Z$(e,n){let A=e[n];return!!A&&!A.header&&!A.separator&&!A.invalid}function yca(e){let{items:n,previous:A,selectedIndex:i,homeIndex:s}=e,u=A?.[i],g=u!==void 0&&n[i]?.id!==u.id;if(!(i>=n.length||!Z$(n,i))&&!g)return i;let f=u?n.findIndex((B)=>B.id===u.id):-1;return f>=0&&Z$(n,f)?f:s}function Qca(e){return typeof e.children==="function"?e.children():e.children}function fPr(e,n){let A=e.label.toLowerCase(),i=e.description.toLowerCase();if(A===n)return 5;if(A.split("/").at(-1)===n)return 4;if(A.startsWith(n))return 3;if(A.includes(n))return 2;if(i.includes(n))return 1;return 0}function hPr(e,n){let A=n.toLowerCase();return e.map((i,s)=>({node:i,index:s,score:fPr(i,A)})).filter((i)=>i.score>0).sort((i,s)=>s.score-i.score||i.index-s.index).map((i)=>i.node)}function _ca(e,n){let A=e.endsWith(" "),i=e.split(" "),s=i.map((Q)=>Q.toLowerCase()),u=n,g=[],d=A?s.length:s.length-1;for(let Q=0;Q<d;Q++){let w=s[Q];if(!w)continue;let S=u.find((G)=>G.label.toLowerCase()===w);if(!S)return{nodes:[],breadcrumb:g,partial:w,exactMatch:null,noMatch:!0,input:null};if(S.kind==="action")return{nodes:[],breadcrumb:g,partial:"",exactMatch:S,noMatch:!1,input:null};if(S.kind==="input")return{nodes:[],breadcrumb:[...g,S.label],partial:"",exactMatch:null,noMatch:!1,input:{node:S,value:i.slice(Q+1).join(" ").trim()}};g.push(S.label),u=Qca(S)}let f=A?"":s[s.length-1]??"",B=f?hPr(u,f):u;if(f&&B.length===0)return{nodes:B,breadcrumb:g,partial:f,exactMatch:null,noMatch:!0,input:null};let E=f?B.find((Q)=>Q.label.toLowerCase()===f.toLowerCase())??null:null;if(E&&E.kind==="group")return{nodes:Qca(E),breadcrumb:[...g,E.label],partial:"",exactMatch:null,noMatch:!1,input:null};return{nodes:B,breadcrumb:g,partial:f,exactMatch:E,noMatch:!1,input:null}}function wca(e,n){return[...e,n].join(" ")+" "}function KGt(e){if(e.length===0)return null;let n=3,A=e.length>n?e.slice(-n):e;return(e.length>n?"\u2026 \u203A ":"")+A.join(" \u203A ")+" \u203A"}import{existsSync as bPr}from"fs";import{join as kca,resolve as BPr}from"path";import{homedir as Dca}from"os";function CPr(){let e=PB();function n(){let f=e.store.profiles.active();if(!f)throw oA("NOT_AUTHENTICATED");return f}function A(f){let B=Dca();return f===B||f.startsWith(B+"/")?"~"+f.slice(B.length):f}function i(){let f=n(),B={dir:kca(e.store.root,"profiles",f.id,"agents"),label:"~/.axon (default)"},E=f.agents.extraRoots().map((Q)=>({dir:Q,label:A(Q)}));return[B,...E]}function s(){let f=e.store.profiles.active();if(!f)return[];return f.agents.extraRoots().map((B)=>({dir:B,label:A(B)}))}async function u(f,B){await e.projects.create("agent",{name:f,dir:B})}async function g(f){let B=BPr(f.startsWith("~")?kca(Dca(),f.slice(1)):f);if(!bPr(B))throw oA("WATCH_PATH_NOT_FOUND",{context:{path:B}});return await n().agents.watch(B),$c().refreshAvailable(),B}async function d(f){await n().agents.unwatch(f),$c().refreshAvailable()}return{locations:i,watched:s,create:u,watch:g,unwatch:d}}function HYe(){if(!HTn)HTn=CPr();return HTn}var HTn;var xca=dt(()=>{n9();iD();ps()});function Oye(){if(!PTn)PTn=EPr();return PTn}function EPr(){let e=ha.ref(null),n=0,A=null,i=!1,s=null,u=!1,g=null;function d(Q){s=Q}function f(Q){g=Q}function B(){if(i)return!0;if(g?.(),n++,A)clearTimeout(A);if(n===1)return e.value="press ctrl+c again to quit",A=setTimeout(()=>{n=0,e.value=null},IPr),!1;if(n===2)return E(),!1;return process.exit(130),!1}async function E(Q=0){if(u)return;if(u=!0,n=Math.max(n,2),A)clearTimeout(A);e.value="shutting down \xB7 ctrl+c to force quit";let w=process.env.AXON_SHUTDOWN_TRACE==="1",S=Date.now(),G=(V)=>{if(w)process.stderr.write(`[exit] ${V} +${Date.now()-S}ms
4936
4936
  `)};G("gracefulExit:start");let q=new Promise((V)=>{setTimeout(()=>{console.error(`shutdown exceeded ${Fca}ms \u2014 exiting without waiting further`),V()},Fca)});await Promise.race([$c().shutdown().catch((V)=>{console.error("shutdown failed during exit:",V)}),q]),G("agents.shutdown settled"),i=!0,setTimeout(()=>{console.error(`exit exceeded ${vca}ms \u2014 forcing`),process.exit(Q)},vca).unref?.(),G("calling vterm exit"),s?.(Q),G("vterm exit returned")}return{hint:e,bind:d,bindDraft:f,onQuit:B,gracefulExit:E}}var IPr=500,Fca=2000,vca=1500,PTn;var LQt=dt(()=>{Ks();iD()});function PYe(){if(!JTn)JTn=QPr();return JTn}function QPr(){let e=PB().updates,n=ha.ref(null),A=ha.ref(!1),i=ha.computed(()=>n.value!==null),s=null;async function u(B){if(!e.supported()||A.value)return;A.value=!0;try{let E=await e.check(B);n.value=E.status==="available"?E.latest:null}finally{A.value=!1}}function g(){if(!e.supported())return()=>{};if(u().catch(()=>{}),!s)s=setInterval(()=>{u().catch(()=>{})},yPr);return d}function d(){if(s)clearInterval(s);s=null}async function f(B){if((await e.handoff(B)).status==="current"){n.value=null;return}await Oye().gracefulExit(EQt)}return{current:e.currentVersion,latest:n,available:i,checking:A,check:u,start:g,stop:d,update:f}}var yPr=21600000,JTn;var RGt=dt(()=>{Ks();n9();LQt();_Gt()});function _Pr(){let e=process.env.TERM_FONT??process.env.FONT??"";if(/nerd|\bnf\b/i.test(e))return"nerd";let n=process.env.TERM_PROGRAM??"";if(/ghostty|wezterm/i.test(n))return"nerd";return"unicode"}function Nca(e,n){if(!e)return"";if(n==="none")return"";let A=Sca[e];if(!A)return e;return(n==="auto"?_Pr():n)==="nerd"?A.nerd:A.unicode}var Sca,lgs;var Gca=dt(()=>{Sca={agent:{nerd:"\uE26E",unicode:"\u25C6"},model:{nerd:"\uF085",unicode:"\u25C7"},modules:{nerd:"\uF487",unicode:"\u25A3"},session:{nerd:"\uF075",unicode:"\u25B8"},tokens:{nerd:"\uF080",unicode:"\u25AA"},messages:{nerd:"\uF086",unicode:"\u25AB"},branch:{nerd:"\uE725",unicode:"\u2442"},changes:{nerd:"\uF448",unicode:"\xB1"},ahead:{nerd:"\uF55C",unicode:"\u2191"},behind:{nerd:"\uF544",unicode:"\u2193"},folder:{nerd:"\uF07B",unicode:"\u25A4"},clock:{nerd:"\uF017",unicode:"\u25F7"},user:{nerd:"\uF007",unicode:"\u25C9"},warning:{nerd:"\uF071",unicode:"\u25B2"},error:{nerd:"\uF057",unicode:"\u2715"}};lgs=Object.keys(Sca)});function q7(){if(!OTn)OTn=wPr();return OTn}function wPr(){let e=new Set;function n(A){return[...e].filter((i)=>i.name===A)}return{register(A,i){let s={name:A,handler:i};return e.add(s),()=>{e.delete(s)}},notify(A,...i){let s=[];for(let u of n(A))try{u.handler(...i)}catch(g){s.push(oA("HOOK_FAILED",{detail:`${A} \u2014 ${g instanceof Error?g.message:String(g)}`,context:{hook:A},cause:g}))}return s},async gate(A,...i){let s=n(A);if(s.length===0)return[];let u=[],g,d=Promise.all(s.map(async(B)=>{try{await B.handler(...i)}catch(E){u.push(oA("HOOK_FAILED",{detail:`${A} \u2014 ${E instanceof Error?E.message:String(E)}`,context:{hook:A},cause:E}))}})),f=new Promise((B)=>{g=setTimeout(()=>B("timeout"),$Tn)});try{if(await Promise.race([d.then(()=>"done"),f])==="timeout")u.push(oA("HOOK_TIMED_OUT",{detail:`${A} did not finish within ${$Tn}ms`,context:{hook:A,budgetMs:$Tn}}))}finally{if(g)clearTimeout(g)}return u},count(A){return n(A).length}}}var $Tn=5000,OTn;var zye=dt(()=>{ps()});function Dz(){if(!WTn)WTn=kPr();return WTn}function kPr(){let e=q7();function n(f){try{let B=f.component.render(),E=B===null||B===void 0?"":String(B),Q=Nca(f.component.icon,zTn.value);QCe.value.set(f.name,E&&Q?`${Q} ${E}`:E)}catch(B){QCe.value.set(f.name,""),console.error(`line component "${f.name}" failed to render:`,B)}QCe.value=new Map(QCe.value)}function A(f){return Array.isArray(f)?{left:[...f]}:{...f}}function i(f){if(!f||f.length===0)return[];return Array.isArray(f[0])?f.map((B)=>[...B]):[[...f]]}function s(f){return[f.left,f.middle,f.right].flatMap((B)=>i(B).flat())}function u(f,B){return f.style??B.content.style??YGt.value}function g(f){let B=Aq.value.get(f);if(!B)throw oA("LINE_UNKNOWN",{detail:`no line named "${f}"`,context:{name:f}});return B}function d(f){let B=(w,S)=>w.length===0||S.length>0,E=(w)=>i(w).map((S)=>[S,S.filter((G)=>QCe.value.get(G))]).filter(([S,G])=>B(S,G)).map(([,S])=>S),Q=(w)=>i(w).map((S)=>[S,S.map((G)=>QCe.value.get(G)??"").filter(Boolean)]).filter(([S,G])=>B(S,G)).map(([,S])=>S);return f.map(({placed:w,line:S})=>({id:w.id,name:S.name,style:u(w,S),left:Q(S.content.left),middle:Q(S.content.middle),right:Q(S.content.right),names:{left:E(S.content.left),middle:E(S.content.middle),right:E(S.content.right)}})).filter((w)=>{if(s(Aq.value.get(w.name)?.content??{}).length===0)return!0;return w.left.length>0||w.middle.length>0||w.right.length>0})}return{createComponent(f,B){if(_z.value.has(f))throw oA("COMPONENT_NAME_TAKEN",{detail:`a component named "${f}" is already registered`,context:{name:f}});let E={name:f,component:B,teardown:[]};for(let Q of B.on??[])E.teardown.push(e.register(Q,()=>n(E)));if(B.every!==void 0){let Q=setInterval(()=>n(E),B.every);E.teardown.push(()=>clearInterval(Q))}return _z.value.set(f,E),_z.value=new Map(_z.value),n(E),()=>{for(let Q of E.teardown)Q();_z.value.delete(f),QCe.value.delete(f),_z.value=new Map(_z.value),QCe.value=new Map(QCe.value)}},listComponents(){return[..._z.value.keys()].sort()},createLine(f,B,E){if(Aq.value.has(f))throw oA("LINE_NAME_TAKEN",{detail:`a line named "${f}" is already registered`,context:{name:f}});let Q=A(B);Aq.value.set(f,{name:f,content:Q}),Aq.value=new Map(Aq.value);let w=()=>{Aq.value.delete(f),Aq.value=new Map(Aq.value),U7.value=U7.value.filter((G)=>G.name!==f),wz.value.delete(f)};E?.(w);let S=s(Q).filter((G)=>!_z.value.has(G));if(S.length>0)kz.value=[...kz.value,oA("COMPONENT_UNKNOWN",{detail:`line "${f}" names ${S.map((G)=>`"${G}"`).join(", ")}, which ${S.length>1?"are":"is"} not registered`,context:{line:f,components:S.join(", ")}})];return w},setStack(f){let B=[],E=[],Q=new Set;for(let w of f){let S=typeof w==="string"?{line:w}:w;if(!Aq.value.has(S.line)){E.push(S.line);continue}if(B.push({id:`${S.line}#${B.length}`,name:S.line,...S.style?{style:S.style}:{}}),S.hidden)Q.add(S.line)}if(U7.value=B,wz.value=Q,E.length>0)kz.value=[...kz.value,oA("LINE_UNKNOWN",{detail:`no line named ${E.map((w)=>`"${w}"`).join(", ")}`,context:{names:E.join(", ")}})]},move(f,B){g(f);let E=U7.value.findIndex((q)=>q.name===f);if(E<0)throw oA("LINE_UNKNOWN",{detail:`line "${f}" is not in the stack`,context:{name:f}});let Q=B==="up"?E-1:B==="down"?E+1:B,w=Math.max(0,Math.min(U7.value.length-1,Q)),S=[...U7.value],[G]=S.splice(E,1);S.splice(w,0,G),U7.value=S},hide(f){g(f),wz.value=new Set(wz.value).add(f)},show(f){g(f);let B=new Set(wz.value);if(B.delete(f),wz.value=B,!U7.value.some((E)=>E.name===f))U7.value=[...U7.value,{id:`${f}#${U7.value.length}`,name:f}]},toggle(f){g(f);let B=new Set(wz.value);if(B.has(f))B.delete(f);else B.add(f);wz.value=B},setTop(f,B){if(f===null){qQt.value=null;return}let E=typeof f==="string"?{line:f,...B}:f;if(!Aq.value.has(E.line)){kz.value=[...kz.value,oA("LINE_UNKNOWN",{detail:`no line named "${E.line}"`,context:{name:E.line}})];return}qQt.value={id:`top:${E.line}`,name:E.line,...E.style?{style:E.style}:{}}},top(){let f=qQt.value;if(!f)return null;let B=Aq.value.get(f.name);if(!B)return null;return{id:f.id,name:B.name,content:B.content,style:u(f,B),visible:!0}},press(f){let E=_z.value.get(f)?.component.click;if(!E)return;try{let Q=E();if(Q instanceof Promise)Q.catch((w)=>{kz.value=[...kz.value,w]})}catch(Q){kz.value=[...kz.value,Q]}},pressable(f){return Boolean(_z.value.get(f)?.component.click)},icons(f){if(f!==void 0){zTn.value=f;for(let B of _z.value.values())n(B)}return zTn.value},style(f){if(f!==void 0)YGt.value=f;return YGt.value},renderedTop:ha.computed(()=>{let f=qQt.value;if(!f)return[];let B=Aq.value.get(f.name);if(!B)return[];return d([{placed:f,line:B}])}),faults:ha.computed(()=>kz.value),reset(){kz.value=[],U7.value=[],wz.value=new Set,YGt.value="powerline",qQt.value=null},listRegistered(){return[...Aq.value.keys()].sort()},isVisible(f){return U7.value.some((B)=>B.name===f)&&!wz.value.has(f)},list(){let f=[];for(let B of U7.value){let E=Aq.value.get(B.name);if(!E)continue;f.push({id:B.id,name:E.name,content:E.content,style:u(B,E),visible:!wz.value.has(E.name)})}return f},rendered:ha.computed(()=>d(U7.value.filter((f)=>!wz.value.has(f.name)).map((f)=>({placed:f,line:Aq.value.get(f.name)})).filter((f)=>f.line!==void 0)))}}var _z,Aq,U7,wz,QCe,kz,YGt,qQt,zTn,WTn;var JYe=dt(()=>{Ks();ps();Gca();zye();_z=ha.ref(new Map),Aq=ha.ref(new Map),U7=ha.ref([]),wz=ha.ref(new Set),QCe=ha.ref(new Map),kz=ha.ref([]),YGt=ha.ref("powerline"),qQt=ha.ref(null),zTn=ha.ref("auto")});function Mca(){return{entries:ha.computed(()=>UQt.value),checking:ha.computed(()=>ZTn.value),outdated:ha.computed(()=>UQt.value.filter((e)=>e.outdated)),refresh(){if(TQt)return TQt;if(VTn!==null)return Promise.resolve();if(Date.now()<XTn)return Promise.resolve();return ZTn.value=!0,TQt=(async()=>{let e=!1;try{let n=await aq().updates();UQt.value=n,e=n.every((A)=>A.latest!==null)}catch{UQt.value=[]}finally{if(e)VTn=Date.now();else XTn=Date.now()+DPr;ZTn.value=!1,TQt=null}})(),TQt},invalidate(){VTn=null,XTn=0,UQt.value=[]}}}var UQt,ZTn,VTn=null,XTn=0,DPr=1e4,TQt=null;var Lca=dt(()=>{Ks();Wye();UQt=ha.ref([]),ZTn=ha.ref(!1)});function jGt({entries:e,checking:n,noun:A}){let i=(f)=>`${A}${f===1?"":"s"}`;if(n&&e.length===0)return[{kind:"message",label:"checking\u2026",description:"Asking the registry what is published"}];if(e.length===0)return[{kind:"message",label:"none installed",description:`Nothing declares a registry ${A}`}];let s=e.filter((f)=>f.outdated),u=e.filter((f)=>f.latest===null),g=e.filter((f)=>f.current===null&&f.latest!==null);if(s.length===0){if(u.length>0)return[{kind:"message",label:"could not reach the registry",description:`${u.length} ${i(u.length)} could not be checked`}];if(g.length>0)return[{kind:"message",label:"not installed",description:`${g.length} declared ${i(g.length)} ${g.length===1?"is":"are"} not installed \u2014 run prepare`}];return[{kind:"message",label:"up to date",description:`All ${e.length} ${i(e.length)} are current`}]}let d=[];if(s.length>1)d.push({kind:"all",count:s.length,entries:s});for(let f of s)d.push({kind:"entry",entry:f});return d}function FPr(e){let n=OYe.get(e);if(!n)n={modules:[],checkedAt:null,retryAfter:0,inFlight:null},OYe.set(e,n);return n}function qca(){let e=$c(),n=ha.computed(()=>e.projectRoot.value);return{entries:ha.computed(()=>{$Ye.value;let A=n.value;if(!A)return[];return OYe.get(A)?.modules??[]}),checking:ha.computed(()=>{$Ye.value;let A=n.value;if(!A)return!1;return OYe.get(A)?.inFlight!=null}),outdated:ha.computed(()=>{$Ye.value;let A=n.value;if(!A)return[];return(OYe.get(A)?.modules??[]).filter((i)=>i.outdated)}),refresh(){let A=n.value;if(!A)return Promise.resolve();let i=FPr(A);if(i.inFlight)return i.inFlight;if(i.checkedAt!==null)return Promise.resolve();if(Date.now()<i.retryAfter)return Promise.resolve();return i.inFlight=(async()=>{let s=!1;try{let u=await e.moduleUpdates();i.modules=u,s=u.every((g)=>g.latest!==null)}catch{i.modules=[]}finally{if(s)i.checkedAt=Date.now();else i.retryAfter=Date.now()+xPr;i.inFlight=null,$Ye.value++}})(),$Ye.value++,i.inFlight},invalidate(){let A=n.value;if(!A)return;OYe.delete(A),$Ye.value++}}}var OYe,$Ye,xPr=1e4;var Uca=dt(()=>{Ks();iD();OYe=new Map,$Ye=ha.ref(0)});function SPr(e){let n=RQt.get(e);if(!n)n={cognet:null,checkedAt:null,retryAfter:0,inFlight:null},RQt.set(e,n);return n}function Tca(){let e=$c(),n=ha.computed(()=>e.projectRoot.value);return{entry:ha.computed(()=>{KQt.value;let A=n.value;if(!A)return null;return RQt.get(A)?.cognet??null}),checking:ha.computed(()=>{KQt.value;let A=n.value;if(!A)return!1;return RQt.get(A)?.inFlight!=null}),refresh(){let A=n.value;if(!A)return Promise.resolve();let i=SPr(A);if(i.inFlight)return i.inFlight;if(i.checkedAt!==null)return Promise.resolve();if(Date.now()<i.retryAfter)return Promise.resolve();return i.inFlight=(async()=>{let s=!1;try{let u=await e.cognetUpdate();i.cognet=u,s=u===null||u.latest!==null}catch{i.cognet=null}finally{if(s)i.checkedAt=Date.now();else i.retryAfter=Date.now()+vPr;i.inFlight=null,KQt.value++}})(),KQt.value++,i.inFlight},invalidate(){let A=n.value;if(!A)return;RQt.delete(A),KQt.value++}}}var RQt,KQt,vPr=1e4;var Kca=dt(()=>{Ks();iD();RQt=new Map,KQt=ha.ref(0)});function NPr(){let e=process.env.AXON_API_BASE??(process.env.AXON_STAGING_MODE==="true"?"http://localhost:3099":"production"),n=0;for(let A=0;A<e.length;A++)n=Math.imul(31,n)+e.charCodeAt(A)|0;return(n>>>0).toString(36)}function GPr(e){let n=PB(),A=n.cloud.client.registry.artifacts,i=n.store.cache.file(`registry-${e}-${NPr()}`),s=ha.ref([]),u=ha.ref(!1),g=ha.ref(null),d=!1;function f(){if(d)return;d=!0;try{let E=i.get();if(E?.entries?.length)s.value=E.entries}catch{}B()}function B(){if(u.value)return;u.value=!0,g.value=null,A.of(e).search().then((E)=>{s.value=E;try{i.set({fetchedAt:Date.now(),entries:E})}catch{}}).catch((E)=>{g.value=E instanceof Error?E:Error(String(E))}).finally(()=>{u.value=!1})}return{entries:s,loading:u,error:g,ensure:f,reset(){if(g.value)g.value=null,B()}}}function zYe(e){let n=Rca.get(e);if(!n)n=GPr(e),Rca.set(e,n);return n}var Rca;var HGt=dt(()=>{Ks();n9();Rca=new Map});function ED(){return{current:PGt,show(e,n="info",A){let i=e.trim();if(i.length===0)return;PGt.value={message:i.length>Yca?`${i.slice(0,Yca-1)}\u2026`:i,level:n};let s=A!==void 0&&Number.isFinite(A)&&A>0?Math.min(A,LPr):MPr;if(FUe)clearTimeout(FUe);FUe=setTimeout(()=>{PGt.value=null,FUe=null},s)},clear(){if(FUe)clearTimeout(FUe);FUe=null,PGt.value=null}}}var Yca=50,MPr=300,LPr=5000,PGt,FUe=null;var vUe=dt(()=>{Ks();PGt=ha.ref(null)});function WYe(){let e=$c(),n=ha.computed(()=>e.prompts.list());function A(s){return e.prompts.render(s)}function i(s){return e.prompts.fetch(s)}return{entries:n,render:A,fetch:i}}var jca=dt(()=>{Ks();iD()});function qPr(){let e=PB().cloud.client.registry.artifacts,n=ha.ref([]),A=ha.ref(!1),i=ha.ref(null),s=!1;function u(){if(s||A.value||i.value)return;A.value=!0,e.of("prompt").search().then((d)=>{n.value=d,s=!0}).catch((d)=>{i.value=d instanceof Error?d:Error(String(d))}).finally(()=>{A.value=!1})}function g(){if(i.value)i.value=null}return{entries:n,loading:A,error:i,ensure:u,reset:g}}function Hca(){if(!eKn)eKn=qPr();return eKn}var eKn;var Pca=dt(()=>{Ks();n9()});function UPr(e,n){let A=e.trim().toLowerCase();return{items:WYe().entries.value.filter((s)=>ZYe(A,s.name,s.description)).map((s)=>({id:`prompt:${s.name}`,label:s.name,...s.description?{description:s.description}:{},completeQuery:s.name,inlineResult:!0,workingMessage:`rendering ${s.name}...`,action:async()=>{try{n(await WYe().render(s.name))}catch(u){oB().sendError.value=Oca(u)}}}))}}function Jca(e,n,A){let i=Hca();if(i.ensure(),i.error.value)return{items:[],status:{kind:"error",message:`registry unavailable \u2014 ${i.error.value.message}`}};let s=e.trim().toLowerCase(),u=new Set(WYe().entries.value.map((d)=>d.name)),g=i.entries.value.filter((d)=>ZYe(s,d.name,d.description)).filter((d)=>!(A?.excludeDeclared&&u.has(d.name))).map((d)=>({id:`registry-prompt:${d.name}`,label:d.name,description:d.description??"no description",completeQuery:d.name,inlineResult:!0,workingMessage:`rendering ${d.name}...`,action:async()=>{try{n(await WYe().fetch(d.name))}catch(f){oB().sendError.value=Oca(f)}}}));if(i.loading.value){let d={kind:"loading",message:"loading registry prompts..."};return g.length===0?{items:[],status:d}:{items:g,status:d}}return{items:g}}function tKn(e,n=[]){if(!e.startsWith("@"))return!1;let A=e.trim().toLowerCase();return!n.some((i)=>i.toLowerCase()===A)}function ZYe(e,n,A){if(!e)return!0;let i=e.toLowerCase();return n.toLowerCase().includes(i)||(A?.toLowerCase().includes(i)??!1)}function Oca(e){return e instanceof Error?e:Error(String(e))}var $ca;var JGt=dt(()=>{Ks();jca();Pca();iq();$ca={id:"prompt",maxHeight:8,skipDefaultFilter:!0,resolve:ha.computed(()=>(e,n,A)=>{let i=WYe().entries.value.map((g)=>g.name);if(tKn(e,i))return Jca(e,A);let s=UPr(e,A),u=Jca(e,A,{excludeDeclared:!0});if(u.items.length===0)return s;return{items:[{id:"hdr:registry",label:"registry",header:!0,action:()=>{}},...u.items,...s.items.length>0?[{id:"sep:declared",separator:!0,label:"",action:()=>{}},{id:"hdr:declared",label:"this agent",header:!0,action:()=>{}},...s.items]:[]],...u.status?{status:u.status}:{}}})}});function $Gt(e,n){return zYe(e).entries.value.filter((i)=>ZYe(n.term,i.name,i.description)).filter((i)=>!(n.mode==="install"&&n.installed.has(i.name))).map((i)=>{let s=n.installed.has(i.name);return{id:`registry-${e}:${i.name}`,label:i.name,description:s?`installed \xB7 ${i.description??""}`.trimEnd():`install \xB7 ${i.description??"no description"}`,completeQuery:i.name,action:()=>{if(s)return;TPr(e,i.name)}}})}async function TPr(e,n){try{if(e==="extension"){await $c().installExtension(n),ED().show(`installed ${n}`);return}if((await $c().installModule(n)).status==="not-found")throw Error(`${n} could not be resolved for install`)}catch(A){oB().sendError.value=A instanceof Error?A:Error(String(A))}}var nKn=dt(()=>{HGt();iD();vUe();iq();JGt()});function Vca(){return $c().modules.value.map((e)=>e.packageName).filter((e)=>e!==void 0)}function AKn(e){return e.packageName!==void 0&&e.root.includes("node_modules")}function KPr(e,n){let A=e.trim().toLowerCase();return{items:$c().modules.value.filter((s)=>ZYe(A,s.packageName??s.name,Wca(s))).map((s)=>{let u=s.packageName??s.name;return{id:`module:${u}`,label:u,description:Wca(s),completeQuery:u,choices:()=>RPr(s,n),action:()=>{}}})}}function RPr(e,n){let A=e.packageName??e.name,i=[];if(AKn(e))i.push({id:`module:uninstall:${A}`,label:"\u2715 uninstall",description:`remove ${A} from this agent`,workingMessage:`uninstalling ${A}...`,action:async()=>{try{if((await $c().uninstallModule(A)).status==="not-installed")oB().palette.signalNoMatch();else n("")}catch(s){oB().sendError.value=YPr(s)}}});else i.push({id:`module:local:${A}`,label:"local module",description:"declared in axon.config.ts \u2014 remove the import to uninstall",placeholder:!0,action:()=>{}});return i}function zca(e,n){let A=zYe("module");A.ensure();let i=e.trim().toLowerCase(),s=new Set(Vca()),u=$Gt("module",{term:i,installed:s,mode:n?.excludeInstalled?"install":"browse"});if(A.error.value){let g={kind:"error",message:`registry unavailable \u2014 ${A.error.value.message}`};return u.length===0?{items:[],status:g}:{items:u,status:g}}if(A.loading.value){let g={kind:"loading",message:"loading registry modules..."};return u.length===0?{items:[],status:g}:{items:u,status:g}}return{items:u}}function Wca(e){if(e.version)return`v${e.version}`;return e.root.includes("node_modules")?"installed module":"local module"}function YPr(e){return e instanceof Error?e:Error(String(e))}var Zca;var aKn=dt(()=>{Ks();iD();HGt();nKn();iq();JGt();Zca={id:"module",maxHeight:8,skipDefaultFilter:!0,resolve:ha.computed(()=>(e,n,A)=>{let i=Vca();if(tKn(e,i))return zca(e);let s=KPr(e,A),u=zca(e,{excludeInstalled:!0});if(u.items.length===0)return s;return{items:[{id:"hdr:registry",label:"registry",header:!0,action:()=>{}},...u.items,...s.items.length>0?[{id:"sep:installed",separator:!0,label:"",action:()=>{}},{id:"hdr:installed",label:"installed",header:!0,action:()=>{}},...s.items]:[]],...u.status?{status:u.status}:{}}})}});function jPr(e){let n=jQt.get(e);if(!n)n={names:[],loaded:!1,inFlight:null},jQt.set(e,n);return n}function Zye(){let e=$c(),n=ha.computed(()=>e.projectRoot.value);return{names:ha.computed(()=>{YQt.value;let A=n.value;if(!A)return[];return jQt.get(A)?.names??[]}),checking:ha.computed(()=>{YQt.value;let A=n.value;if(!A)return!1;return jQt.get(A)?.inFlight!=null}),refresh(){let A=n.value;if(!A)return Promise.resolve();let i=jPr(A);if(i.inFlight)return i.inFlight;if(i.loaded)return Promise.resolve();return i.inFlight=(async()=>{try{i.names=await e.envKeys(),i.loaded=!0}catch{i.names=[]}finally{i.inFlight=null,YQt.value++}})(),YQt.value++,i.inFlight},invalidate(){let A=n.value;if(!A)return;jQt.delete(A),YQt.value++}}}var jQt,YQt;var iKn=dt(()=>{Ks();iD();jQt=new Map,YQt=ha.ref(0)});async function PPr(e){try{let n=await fetch("https://discord.com/api/v10/users/@me/guilds",{headers:{Authorization:`Bot ${e}`}});if(!n.ok)return!1;let A=await n.json();return Array.isArray(A)&&A.length>0}catch{return!1}}async function JPr(e){let n=await fetch("https://discord.com/api/v10/users/@me",{headers:{Authorization:`Bot ${e}`}});if(!n.ok){if(n.status===401)throw Error("token rejected \u2014 copy from Bot \u2192 Reset Token, not the OAuth2 Client Secret");throw Error(`Discord returned ${n.status}`)}let A=await n.json(),i=A.discriminator&&A.discriminator!=="0"?`${A.username}#${A.discriminator}`:A.username;return{id:A.id,tag:i}}async function OPr(e){let n=await fetch(`https://api.telegram.org/bot${e}/getMe`);if(!n.ok){if(n.status===401)throw Error("token rejected \u2014 check you copied the whole line from @BotFather");throw Error(`Telegram returned ${n.status}`)}let A=await n.json();if(!A.ok||!A.result?.username)throw Error("Telegram accepted the token but returned no bot \u2014 try /newbot again");return{username:A.result.username}}async function zPr(e){try{let n=await fetch(`https://api.telegram.org/bot${e}/getUpdates?limit=1`);if(!n.ok)return!1;let A=await n.json();return A.ok===!0&&Array.isArray(A.result)&&A.result.length>0}catch{return!1}}function OGt(e){return rKn.find((n)=>n.id===e)}var HPr,$Pr,WPr,rKn;var Xca=dt(()=>{HPr=[1n<<10n,1n<<11n,1n<<16n,1n<<38n].reduce((e,n)=>e|n,0n).toString();$Pr={id:"discord",title:"Discord agent setup",description:"chat with your agent from a Discord server",envKey:"DISCORD_BOT_TOKEN",module:"@axon/discord",steps:[{kind:"input",title:"get token",placeholder:"paste token",prompt:"Enter your Discord bot token below",secret:!0,validate:async(e,n)=>{try{let A=await JPr(e);if(n.set("botId",A.id),n.set("botTag",A.tag),await PPr(e))n.set("inGuild","yes");return null}catch(A){return A instanceof Error?A.message:String(A)}},body:["1. Open the Discord developer portal:"," https://discord.com/developers/applications","","2. New Application \u2014 name it, then Create","","3. Open the Bot tab in the left sidebar","","4. Reset Token, confirm, then Copy"," Discord shows it once \u2014 copy before leaving the page","","5. Paste the token below. Nothing is written to your"," agent until it checks out."]},{kind:"work",title:"connecting",run:async(e)=>{await e.setEnv("DISCORD_BOT_TOKEN",e.input.trim()),await e.install("@axon/discord")}},{kind:"instruct",title:"invite",confirmLabel:"open the invite in my browser",skip:(e)=>e.get("inGuild")==="yes",url:(e)=>{return`https://discord.com/oauth2/authorize?${new URLSearchParams({client_id:e.get("botId")??"",scope:"bot",permissions:HPr})}`},body:[{text:"\u2713 Token accepted \u2014 the module is installed and running.",tone:"success"},"","1. Open the invite below","","2. Pick the server your agent should join"," Permissions are already set: read messages, send"," replies, read history. Nothing to tick."]}]};WPr={id:"telegram",title:"Telegram agent setup",description:"your agent on your phone \u2014 no app to build",envKey:"TELEGRAM_BOT_TOKEN",module:"@axon/telegram",steps:[{kind:"input",title:"get token",placeholder:"paste token",prompt:"Enter your Telegram bot token below",secret:!0,body:["1. Open @BotFather in Telegram:"," https://t.me/BotFather","","2. Send /newbot","",'3. Pick a display name, then a username ending in "bot"',"","4. BotFather replies with a token:"," 123456789:ABC-DEF...","","5. Paste it below. Nothing is written until it checks out."],validate:async(e,n)=>{try{let A=await OPr(e);return n.set("username",A.username),null}catch(A){return A instanceof Error?A.message:String(A)}}},{kind:"work",title:"connecting",run:async(e)=>{await e.setEnv("TELEGRAM_BOT_TOKEN",e.input.trim()),await e.install("@axon/telegram")}},{kind:"await",title:"say hello",waitingLabel:"waiting for your message...",url:(e)=>`https://t.me/${e.get("username")??""}`,body:[{text:"\u2713 Token accepted \u2014 the module is installed and running.",tone:"success"},"","Telegram will not let a bot message you first, so it cannot","reach you until you message it.","","1. Open your bot:","",'2. Send it anything \u2014 "hi" will do'],poll:async(e)=>zPr(e.input.trim()),done:(e)=>`connected telegram \xB7 @${e.get("username")??""}`}]},rKn=[$Pr,WPr]});function HQt(){let e=$c(),n=tL();async function A(f){await e.commit("axon:connect:step",{connector:"connect",note:f})}async function i(f){let B=OGt(f);if(!B)throw oA("NOT_WIRED",{detail:`no connector named "${f}"`});let E=new Map,Q="",w={get input(){return Q},set:(S,G)=>{E.set(S,G)},get:(S)=>E.get(S),setEnv:async(S,G)=>{await e.setKey(S,G)},install:async(S)=>{await e.installModule(S)},note:async()=>{}};for(let[S,G]of B.steps.entries()){let q=B.steps.filter((W)=>W.kind!=="work"&&!(W.kind==="instruct"&&W.skip?.(w))),P=G.kind==="work"?0:q.indexOf(G)+1,V=`${G.title} \xB7 ${P}/${q.length}`;if(G.kind==="instruct"){if(G.skip?.(w))continue;let W=eua(G,w);if(!await n.confirm(G.title,{header:{label:B.title,detail:V,body:[...G.body,...W?["",` ${W}`]:[]]},choices:{yes:G.confirmLabel,no:"cancel"}}))return await s(B.id);if(W)try{await CBe(W)}catch{}continue}if(G.kind==="input"){let W=null;for(;;){let z=await n.prompt(G.title,{placeholder:G.placeholder,...G.prompt?{prompt:G.prompt}:{},...G.secret?{secret:!0}:{},header:{label:B.title,detail:V,body:W?[...G.body??[],"",{text:`\u2717 ${W}`,tone:"error"}]:G.body??[]}});if(z===void 0||z.trim()==="")return await s(B.id);let te=z.trim();if(W=G.validate?await G.validate(te,w):null,!W){Q=te;break}}continue}if(G.kind==="await"){let W=eua(G,w),z=!1,te=(async()=>{while(!z){if(await G.poll(w))return!0;await new Promise((Be)=>setTimeout(Be,1000))}return!1})(),ie=n.confirm(G.title,{header:{label:B.title,detail:V,body:[...G.body,...W?["",` ${W}`]:[]]},choices:{yes:G.waitingLabel,no:"cancel"}});if(await Promise.race([te,ie.then((Be)=>Be?"again":"abort")])==="abort")return z=!0,await s(B.id);z=!0,n.cancel(),await A(G.done(w));continue}try{await G.run(w)}catch(W){let z=W instanceof Error?W.message:String(W);await A(`connect ${B.id} \u2014 ${z}`);return}}Zye().invalidate(),await A(`connected ${B.id}${E.get("botTag")?` \xB7 ${E.get("botTag")}`:""}`)}async function s(f){await A(`connect ${f} \u2014 aborted`)}function u(f){let B=OGt(f);if(!B)return!1;return Zye().names.value.includes(B.envKey)}async function g(f){let B=OGt(f);if(!B)throw oA("NOT_WIRED",{detail:`no connector named "${f}"`});if(!await n.confirm(`disconnect ${B.id}?`,{header:{label:`disconnect ${B.id}`,detail:"this cannot be undone",body:[`Removes ${B.module} and deletes ${B.envKey}`,"from your agent's .env.","",{text:"The token cannot be recovered \u2014 Discord shows it once.",tone:"warn"},"You would need a new one to reconnect."]},choices:{yes:`disconnect ${B.id}`,no:"keep it"}}))return;await e.uninstallModule(B.module),await e.unsetKey(B.envKey),Zye().invalidate(),await A(`disconnected ${B.id}`)}function d(){return Zye().refresh(),rKn.map((f)=>({id:f.id,description:f.description,connected:u(f.id)}))}return{begin:i,disconnect:g,isConnected:u,list:d}}function eua(e,n){if(!e.url)return;return typeof e.url==="string"?e.url:e.url(n)}var tua=dt(()=>{YBt();ps();iD();DUe();Xca();iKn()});import{join as oKn}from"path";function nua(){return ZPr.map(({id:e,hint:n})=>({kind:"action",label:e,description:n,workingMessage:"setting thinking effort...",action:async()=>{await $c().setThinking(e)}}))}function VPr(e){let n=e.lastIndexOf("@");return n>0?e.slice(0,n):e}function xz(e,n=""){return{kind:"action",label:`(${e})`,description:n,invalid:!0,action:()=>{}}}function Aua(e){let n=zYe(e);n.ensure();let A=e==="module"?new Set($c().modules.value.map((s)=>s.packageName).filter((s)=>Boolean(s))):new Set(aq().declared.value.map(VPr)),i=$Gt(e,{term:"",installed:A,mode:"install"});if(i.length===0){let s=n.error.value?`registry unavailable \u2014 ${n.error.value.message}`:n.loading.value?"loading catalogue...":`no ${e}s available to install`;return[xz(s)]}return i.map((s)=>({kind:"action",label:s.label,description:s.description??"",action:(u)=>{s.action(u)}}))}var ZPr,aua,iua="detail",Kps,PQt;var sKn=dt(()=>{YBt();Hye();iD();xca();ps();RGt();LQt();SGt();iq();JYe();Wye();Lca();Uca();Kca();aKn();iKn();HGt();nKn();n9();vUe();tua();A9();ZPr=[{id:"low",hint:"fastest, cheapest \u2014 routine edits and lookups"},{id:"medium",hint:"balanced"},{id:"high",hint:"slower, more deliberate \u2014 debugging and design"},{id:"xhigh",hint:"maximum, where the provider offers it"}];aua=[{label:"log",kind:"events",description:"This session's full event log, as an editor buffer"},{label:"flame",kind:"trace",description:"This session's trace \u2014 the flame graph"},{label:"engine",kind:"engine",description:"Engine calls and responses for this session"}],Kps=[...aua.map((e)=>e.label),iua],PQt=[{kind:"group",label:"connections",description:"Discord, Telegram, Slack \u2014 connect or disconnect",children:()=>HQt().list().map(({id:e,description:n,connected:A})=>({kind:"group",label:e,description:A?"connected":n,children:()=>A?[{kind:"action",label:"reconnect",description:"replace the credential \u2014 the flow runs again",action:()=>{HQt().begin(e)}},{kind:"action",label:"disconnect",description:"remove the module and delete the credential",action:()=>{HQt().disconnect(e)}}]:[{kind:"action",label:"connect",description:n,action:()=>{HQt().begin(e)}}]}))},{kind:"group",label:"open",description:"Open this session in the editor \u2014 a pane, or the console panel",children:()=>{let e=$c(),n=Xie();if(!n.available.value)return[{kind:"action",label:"(no editor attached)",description:"Open this project in an editor running Axon Fleet",action:()=>{throw oA("NO_EDITOR_ATTACHED")}}];if(e.sessionId.value===null)return[{kind:"action",label:"(no session)",description:"Start or focus an agent first",action:()=>{throw oA("NO_SESSION_TO_OPEN")}}];let A=async(s,...u)=>{let g=e.home.value;if(g)await n.editorAbout(g,s,...u);else await n.editor(s,...u)};return[...aua.map((s)=>({kind:"action",label:s.label,description:s.description,workingMessage:`opening ${s.label}...`,action:async()=>{let u=e.sessionId.value;if(!u)throw oA("NO_SESSION_TO_OPEN");await A("buffer",s.kind,u)}})),{kind:"action",label:iua,description:"Bring the console panel forward on this instance",workingMessage:"opening console...",action:async()=>{let s=e.sessionId.value;if(!s)throw oA("NO_SESSION_TO_OPEN");await A("focus",{sessionId:s})}}]}},{kind:"group",label:"agent",description:"The running agent \u2014 spawn, close, reboot, clear",children:()=>[{kind:"group",label:"spawn",description:"Start an agent instance and focus it \u2014 the ~ key is faster",children:()=>{let e=$c(),n=e.available.value;if(n.length===0)return[xz("no agents","Nothing to spawn \u2014 create one with :agent init")];return n.map((A)=>{if(A.kind==="deployed")return{kind:"action",label:A.name,description:`deployed \xB7 ${A.tier} \u2014 attach`,workingMessage:`connecting to ${A.name}...`,action:()=>{e.attachDeployment(A.deploymentId)}};let i=e.instancesByAgent.value.get(A.name)??[];return{kind:"action",label:A.name,description:i.length>0?`${i.length} running`:"",workingMessage:`starting ${A.name}...`,action:()=>{e.spawnSibling(A.dir)}}})}},{kind:"group",label:"switch",description:"Go to another running conversation \u2014 the / key is faster",children:()=>{let e=$c(),n=e.instances.value.filter((A)=>A.exitedAt===null);if(n.length===0)return[xz("nothing running","Start one with :agent spawn")];return n.map((A)=>({kind:"action",label:A.name,description:A.focused?"focused":`${A.sessionId.slice(0,8)}${A.activity?` \xB7 ${A.activity}`:""}`,...A.focused?{invalid:!0}:{},action:()=>{if(A.focused)return;e.focus(A.sessionId)}}))}},{kind:"action",label:"close",description:"Shut down the focused agent instance",workingMessage:"closing instance...",action:()=>$c().close()},{kind:"action",label:"reboot",description:"Reload the running agent (blueprint rescan + hot-swap)",workingMessage:"rebooting...",action:()=>$c().reboot()},{kind:"action",label:"clear",description:"Clear the current conversation and start a fresh session",workingMessage:"clearing conversation...",action:()=>$c().clear()},{kind:"action",label:"model",description:"Set the focused agent's model",action:()=>{let e=oB();e.text.value="",e.mode.setMode("model")}},{kind:"action",label:"config",description:"Open the agent's axon.config.ts \u2014 modules, engine, policy",workingMessage:"opening agent config...",action:async()=>{let e=Xie();if(!e.available.value)throw oA("NO_EDITOR_ATTACHED");let n=$c().projectRoot.value;if(!n)throw oA("NO_LOCAL_PROJECT");await e.editor("open",oKn(n,"axon.config.ts"))}},{kind:"group",label:"thinking",description:"Set the focused agent's thinking effort",children:nua}]},{kind:"action",label:"reload",description:"Reload your config \u2014 main.ts, plugins and extensions",workingMessage:"reloading config...",action:async()=>{let e=aq();await e.reload();let n=e.problems.value.length,A=ED();if(n>0)A.show(`config reloaded \u2014 ${n} problem${n===1?"":"s"}`,"error");else A.show("config reloaded")}},{kind:"input",label:"init",description:"Scaffold a new agent",placeholder:"agent name",token:"name",workingMessage:"creating agent...",confirm:{choices:()=>[...HYe().locations().map((e)=>({label:e.label})),{label:"watch a new directory..."}]},action:async(e,n)=>{let A=HYe();if(!n)throw oA("PALETTE_CHOICE_REQUIRED");if(n==="watch a new directory...")throw oA("NOT_WIRED",{detail:"typing a path for a new watch target isn't wired into this choice step yet \u2014 run `axon watch <dir>` first, then `init` again"});let i=A.locations().find((s)=>s.label===n)?.dir;if(!i)throw oA("PROJECT_NOT_FOUND",{context:{location:n}});await A.create(e,i),await $c().select(e)}},{kind:"action",label:"exit",description:"Exit the application",action:()=>Oye().gracefulExit()},{kind:"action",label:"update",description:"Install the latest Axon release and exit",workingMessage:"preparing update...",action:(e)=>PYe().update(e)},{kind:"action",label:"logout",description:"Sign out of your Axon account",workingMessage:"logging out...",action:()=>m8().logout()},{kind:"action",label:"docs",description:"Open Axon documentation",action:()=>{CBe("https://axon.arclabs.it/docs")}},{kind:"group",label:"module",description:"Agent modules \u2014 install into the focused agent, or remove one",children:()=>[{kind:"group",label:"install",description:"Install a registry module into the running agent",children:()=>Aua("module")},{kind:"group",label:"update",description:"Update this agent's modules",children:()=>{let e=qca();return e.refresh(),jGt({entries:e.entries.value,checking:e.checking.value,noun:"module"}).map((n)=>{if(n.kind==="message")return xz(n.label,n.description);if(n.kind==="all")return{kind:"action",label:"all",description:`Update ${n.count} modules`,workingMessage:`updating ${n.count} modules...`,action:async()=>{await $c().updateModules(n.entries.map((i)=>({name:i.name,version:i.latest}))),e.invalidate(),ED().show(`updated ${n.count} modules`)}};let A=n.entry;return{kind:"action",label:A.name,description:`${A.current} \u2192 ${A.latest}`,workingMessage:`updating ${A.name}...`,keepOpen:!0,action:async()=>{await $c().updateModules([{name:A.name,version:A.latest}]),e.invalidate(),ED().show(`updated ${A.name} to ${A.latest}`)}}})}},{kind:"group",label:"uninstall",description:"Remove a module from the running agent",children:()=>{let e=$c().modules.value;if(e.length===0)return[xz("none installed","This agent has no installed modules")];let n=e.filter(AKn);if(n.length===0)return[xz("none removable","This agent's modules are declared as imports \u2014 remove them from axon.config.ts")];return n.map((A)=>({kind:"action",label:A.packageName,description:A.version?`v${A.version}`:"",workingMessage:`removing ${A.packageName}...`,action:()=>{$c().uninstallModule(A.packageName)}}))}}]},{kind:"input",label:"attach",description:"Bind to an agent already running at a URL",placeholder:"http://localhost:3010",token:"url",workingMessage:"attaching...",action:async(e)=>{await $c().attachUrl(e)}},{kind:"group",label:"key",description:"The focused agent's own environment variables",children:()=>[{kind:"input",label:"set",description:"Set a variable in this agent's .env, then reload",placeholder:"NAME value",token:"NAME value",workingMessage:"setting key...",secret:!0,action:async(e)=>{let n=e.trim(),A=n.search(/\s/);if(A<1){ED().show("usage: :key set NAME value");return}let i=n.slice(0,A),s=n.slice(A+1).trim();if(s===""){ED().show("usage: :key set NAME value");return}await $c().setKey(i,s),Zye().invalidate(),ED().show(`set ${i} \xB7 reloaded`)}},{kind:"group",label:"list",description:"What this agent's .env defines",children:()=>{let e=Zye();if(e.refresh(),e.checking.value&&e.names.value.length===0)return[xz("reading\u2026","Reading this agent's .env")];if(e.names.value.length===0)return[xz("none set","This agent's .env defines nothing yet")];return e.names.value.map((n)=>({kind:"action",label:n,description:"set",invalid:!0,action:()=>{}}))}}]},{kind:"group",label:"cognet",description:"The agent's brain \u2014 move it to a newer version",children:()=>[{kind:"group",label:"update",description:"Update this agent's cognet",children:()=>{let e=Tca();e.refresh();let n=e.entry.value;return jGt({entries:n?[n]:[],checking:e.checking.value,noun:"cognet"}).map((A)=>{if(A.kind==="message")return xz(A.label,A.description);if(A.kind==="all")return{kind:"action",label:"all",description:`Update ${A.count} cognets`,workingMessage:"updating cognet...",action:async()=>{for(let s of A.entries)await $c().updateCognet(s.name,s.latest);e.invalidate(),ED().show("updated cognet")}};let i=A.entry;return{kind:"action",label:i.name,description:`${i.current} \u2192 ${i.latest}`,workingMessage:`updating ${i.name}...`,action:async()=>{await $c().updateCognet(i.name,i.latest),e.invalidate(),ED().show(`updated ${i.name} to ${i.latest}`)}}})}}]},{kind:"group",label:"ext",description:"Terminal extensions \u2014 commands, keys, palettes, themes",children:()=>[{kind:"group",label:"install",description:"Install a registry extension into your terminal",children:()=>Aua("extension")},{kind:"group",label:"update",description:"Update installed extensions",children:()=>{let e=Mca();return e.refresh(),jGt({entries:e.entries.value,checking:e.checking.value,noun:"extension"}).map((n)=>{if(n.kind==="message")return xz(n.label,n.description);if(n.kind==="all")return{kind:"action",label:"all",description:`Update ${n.count} extensions`,workingMessage:`updating ${n.count} extensions...`,action:async()=>{for(let i of n.entries)await aq().update(i.name,i.latest);e.invalidate(),ED().show(`updated ${n.count} extensions`)}};let A=n.entry;return{kind:"action",label:A.name,description:`${A.current} \u2192 ${A.latest}`,workingMessage:`updating ${A.name}...`,keepOpen:!0,action:async()=>{await aq().update(A.name,A.latest),e.invalidate(),ED().show(`updated ${A.name} to ${A.latest}`)}}})}},{kind:"group",label:"uninstall",description:"Remove an extension from your terminal",children:()=>{let e=aq().declared.value;if(e.length===0)return[xz("none installed","Your profile declares no extensions")];return e.map((n)=>({kind:"action",label:n,description:"",workingMessage:`removing ${n}...`,action:async()=>{await $c().uninstallExtension(n),ED().show(`removed ${n}`)}}))}}]},{kind:"group",label:"session",description:"This conversation \u2014 fork it, name it, open its log",children:()=>[{kind:"action",label:"pick",description:"Reopen a past conversation \u2014 the ^ key does this",action:()=>{let e=oB();e.text.value="",e.mode.setMode("session")}},{kind:"action",label:"fork",description:"Copy this conversation \u2014 the copy diverges, this one is untouched",workingMessage:"forking session...",action:async()=>{let e=await $c().forkSession();ED().show(`forked \u2192 ${e.sessionId.slice(0,8)} \xB7 open it with ^`)}},{kind:"input",label:"rename",description:"Give this conversation a name",placeholder:"a short name",token:"title",workingMessage:"renaming session...",action:async(e)=>{await $c().renameSession(e),ED().show(`renamed \u2192 ${e}`)}},{kind:"action",label:"open",description:"Open this session's .jsonl in the editor",workingMessage:"opening session log...",action:async()=>{let e=$c(),n=Xie(),A=e.sessionFile.value;if(!A)throw oA("NO_SESSION_TO_OPEN");if(!n.available.value)throw oA("NO_EDITOR_ATTACHED");let i=e.home.value;if(i)await n.editorAbout(i,"open",A);else await n.editor("open",A)}}]},{kind:"action",label:"clear",description:"Clear the current conversation and start a fresh session",workingMessage:"clearing conversation...",action:()=>$c().clear()},{kind:"action",label:"model",description:"Set the focused agent's model",action:()=>{let e=oB();e.text.value="",e.mode.setMode("model")}},{kind:"group",label:"thinking",description:"Set the focused agent's thinking effort",children:nua},{kind:"action",label:"config",description:"Open your main.ts in the editor \u2014 your own commands, keys and plugins",workingMessage:"opening config...",action:async()=>{let e=Xie();if(!e.available.value)throw oA("NO_EDITOR_ATTACHED");await e.editor("open",oKn(PB().profile.root,"main.ts"))}},{kind:"action",label:"profile",description:"Open your profile.config.ts in the editor \u2014 extensions, theme, paths",workingMessage:"opening profile...",action:async()=>{let e=Xie();if(!e.available.value)throw oA("NO_EDITOR_ATTACHED");await e.editor("open",oKn(PB().profile.root,"profile.config.ts"))}},{kind:"input",label:"watch",description:"Register a directory as an agent location \u2014 scanned by init and the agent list",placeholder:"~/path/to/directory",token:"dir",workingMessage:"watching directory...",action:async(e)=>{await HYe().watch(e)}},{kind:"group",label:"unwatch",description:"Stop scanning a directory for agents",children:()=>{let e=HYe().watched();if(e.length===0)return[xz("no watched directories")];return e.map((n)=>({kind:"action",label:n.label,description:n.dir,workingMessage:"unwatching directory...",action:async()=>{await HYe().unwatch(n.dir)}}))}},{kind:"group",label:"provider",description:"Manage the inference sources your agents can use",children:[{kind:"group",label:"codex",description:"OpenAI Codex subscription (BYOK)",children:()=>{let e=m8().connections.openai;if(!e.connected.value)return[{kind:"action",label:"connect",description:"Sign in with your OpenAI account",workingMessage:"waiting for browser sign-in...",action:()=>e.connect()}];return[{kind:"action",label:"disconnect",description:"Remove the OpenAI connection from your account",workingMessage:"disconnecting...",action:()=>e.disconnect()}]}},{kind:"group",label:"openrouter",description:"OpenRouter API key (BYOK)",children:()=>{let e=m8().connections.openrouter;if(!e.connected.value)return[{kind:"input",label:"connect",description:"Store this OpenRouter API key in your account vault",placeholder:"paste your OpenRouter API key (openrouter.ai/keys)",token:"key",workingMessage:"verifying and storing key...",action:(n)=>e.connect(n)}];return[{kind:"action",label:"disconnect",description:"Remove the OpenRouter key from your account",workingMessage:"disconnecting...",action:()=>e.disconnect()}]}},{kind:"group",label:"ollama",description:"Local models through an Ollama daemon",children:()=>{let e=m8().connections.ollama;if(!e.connected.value)return[{kind:"action",label:"enable",description:"Use local Ollama models in your agents",workingMessage:"enabling...",action:()=>e.connect()}];return[{kind:"action",label:"disable",description:"Stop using local Ollama models",workingMessage:"disabling...",action:()=>e.disconnect()}]}}]},{kind:"group",label:"theme",description:"How the terminal looks \u2014 pick a theme, or go back to the default",children:()=>[{kind:"group",label:"set",description:"Choose a theme \u2014 previews as you move",children:()=>{let e=SE(),n=e.committedName.value;return e.themes.value.map((A)=>({kind:"action",label:A.name,description:A.name===n?"current":"",preview:()=>{e.preview(A.name)},action:()=>{e.set(A.name)}}))}},{kind:"action",label:"reset",description:`Go back to ${GGt}, the theme Axon ships with`,action:()=>SE().reset()}]},{kind:"group",label:"lines",description:"Turn status lines on and off",children:()=>[{kind:"group",label:"toggle",description:"Flip a line on or off \u2014 the list stays up",children:()=>{let e=Dz();return e.listRegistered().map((n)=>{let A=e.isVisible(n);return{kind:"action",label:n,description:A?"on \u2014 press to hide":"off \u2014 press to show",keepOpen:!0,action:()=>A?e.hide(n):e.show(n)}})}},{kind:"group",label:"on",description:"Show a line",children:()=>{let e=Dz();return e.listRegistered().filter((n)=>!e.isVisible(n)).map((n)=>({kind:"action",label:n,description:"Show this line",keepOpen:!0,action:()=>e.show(n)}))}},{kind:"group",label:"off",description:"Hide a line",children:()=>{let e=Dz();return e.list().filter((n)=>n.visible).map((n)=>({kind:"action",label:n.name,description:"Hide this line",keepOpen:!0,action:()=>e.hide(n.name)}))}}]}]});function VYe(e,n,A,i){return(s)=>{let u=q7(),g={path:e,source:n,...i!==void 0?{arg:i}:{}},d;try{d=A(s)}catch(f){throw u.notify("command:failed",{...g,error:f}),f}if(!(d instanceof Promise)){u.notify("command:ran",g);return}return d.then(()=>{u.notify("command:ran",g)},(f)=>{throw u.notify("command:failed",{...g,error:f}),f})}}var cKn=dt(()=>{zye()});function eJr(e){if(e==="")return"";let n=e.search(/\s/);if(n<0)return e;if(e.slice(n+1).trim()==="")return e;return`${e.slice(0,n)} ${XPr}`}var XPr="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",rua;var oua=dt(()=>{Ks();sKn();QUe();cKn();A9();rua={id:"command",skipDefaultFilter:!0,onCancel:()=>{SE().cancelPreview()},resolve:ha.computed(()=>(e)=>{let n=_ca(e,[...PQt,...LGt.value]);if(n.breadcrumb[0]!=="theme")SE().cancelPreview();function A(s){if(s.kind==="group"||s.kind==="input"){let g=wca(n.breadcrumb,s.label);return{id:s.label,label:s.label,description:s.description,descendQuery:g,completeQuery:g,action:()=>{}}}let u=[...n.breadcrumb,s.label];return{...s.invalid?{invalid:!0}:{},...s.keepOpen?{keepOpen:!0}:{},...s.choices?{choices:s.choices}:{},...s.preview?{preview:s.preview}:{},id:s.label,label:s.label,description:s.description,workingMessage:s.workingMessage,completeQuery:u.join(" "),action:VYe(u,"palette",s.action)}}if(n.nodes.length===0&&n.exactMatch?.kind==="action"&&!n.input){let s=n.exactMatch;return{items:[A(s)],breadcrumb:KGt(n.breadcrumb),invalid:!1}}if(n.input){let{node:s,value:u}=n.input,g=n.breadcrumb,d=s.secret?eJr(u):u,f=s.secret?void 0:u;return{items:[{id:s.label,label:d||`<${s.token}>`,placeholder:!u,...u?{}:{invalid:!0},description:u?s.description:s.placeholder,workingMessage:s.workingMessage,...s.confirm?{choices:()=>{return s.confirm.choices(u).map((B)=>({id:B.label,label:B.label,description:B.description,workingMessage:s.workingMessage,action:VYe(g,"palette",(E)=>Promise.resolve(s.action(u,B.label,E)),f)}))},action:()=>{}}:{action:VYe(g,"palette",(B)=>Promise.resolve(s.action(u,void 0,B)),f)}}],breadcrumb:KGt(n.breadcrumb),invalid:!1}}let i=n.exactMatch!==null&&n.exactMatch.kind==="action";return{items:n.nodes.map(A),breadcrumb:KGt(n.breadcrumb),invalid:!i}})}});function AJr(){let e=PB(),n=e.cloud.client.registry.models,A=e.store.cache.file(tJr),i=ha.ref([]),s=ha.ref([]),u=ha.ref(!1),g=ha.ref(null),d=0,f=!1;function B(){if(d>0)return;let S=null;try{S=A.get()}catch{S=null}if(!S?.models?.length)return;i.value=S.models,s.value=S.failures??[],d=S.at??1}function E(){if(f)return;if(f=!0,i.value.length===0)u.value=!0;n.all().then((S)=>{i.value=S.models,s.value=S.failures,d=Date.now();try{A.set({...S,at:d})}catch{}g.value=null}).catch((S)=>{if(i.value.length===0)g.value=S instanceof Error?S:Error(String(S))}).finally(()=>{f=!1,u.value=!1})}function Q(){if(B(),d===0||Date.now()-d>nJr)E()}function w(){if(!g.value)return;g.value=null,E()}return{models:i,failures:s,loading:u,error:g,ensure:Q,reset:w}}function SUe(){if(!uKn)uKn=AJr();return uKn}function sua(){SUe().ensure()}var tJr="models",nJr=1800000,uKn;var zGt=dt(()=>{Ks();n9()});function iJr(){let e=PB().store,n=ha.ref(e.state.get()?.recentModels??[]),A=ha.computed(()=>n.value);function i(s){let u=[s,...n.value.filter((g)=>g!==s)].slice(0,aJr);n.value=u;try{e.state.update((g)=>({...g,recentModels:u}))}catch{}}return{order:A,record:i}}function XYe(){if(!lKn)lKn=iJr();return lKn}var aJr=25,lKn;var cua=dt(()=>{Ks();n9()});function sJr(){let e=PB(),n=e.ollama,A=e.store.cache.file(rJr),i=ha.ref(null),s=ha.ref([]),u=ha.ref({}),g=ha.ref(null),d=ha.ref(null),f=0,B=!1;function E(){let q=new Set(s.value.map((P)=>P.name));return n.registry.browse().map((P)=>({...P,installed:q.has(P.name),...u.value[P.name]===void 0?{}:{size:u.value[P.name]}}))}function Q(){if(f>0)return;try{let q=A.get();if(!q?.sizes)return;u.value=q.sizes,f=q.at??1}catch{}}async function w(){if(B)return;B=!0;try{let q=await n.status();if(i.value=q.running,!q.running){s.value=[];return}s.value=await n.models.list(),d.value=null;let P=n.registry.browse(),V=await Promise.all(P.map(async(z)=>{try{let te=await n.registry.resolve(z.name);return te?[z.name,te.size]:null}catch{return null}})),W={};for(let z of V)if(z)W[z[0]]=z[1];if(Object.keys(W).length>0){u.value=W,f=Date.now();try{A.set({sizes:W,at:f})}catch{}}}catch(q){d.value=q instanceof Error?q:Error(String(q)),i.value=!1}finally{B=!1}}function S(){if(Q(),i.value===null||f===0||Date.now()-f>oJr)w()}async function G(q){if(g.value)throw Error(`already downloading ${g.value.name}`);g.value={name:q,percent:null,status:"starting",bytes:null};try{for await(let P of n.models.pull(q))if(g.value=cJr(q,P),P.done)break;s.value=await n.models.list()}catch(P){throw d.value=P instanceof Error?P:Error(String(P)),P}finally{g.value=null}}return{running:i,installed:s,catalog:E,sizes:u,pulling:g,error:d,ensure:S,refresh:w,pull:G}}function cJr(e,n){return{name:e,percent:n.percent,status:n.status,bytes:n.total!==void 0&&n.completed!==void 0?{completed:n.completed,total:n.total}:null}}function eje(){if(!gKn)gKn=sJr();return gKn}var rJr="ollama-sizes",oJr=86400000,gKn;var pKn=dt(()=>{Ks();n9()});function lJr(e){let n=new Set;for(let A of e)for(let i of A.routes)n.add(i.via);if(n.add("axon"),eje().running.value)n.add("ollama");return uJr.filter((A)=>n.has(A))}function gJr(e,n){let A=0;for(let i of n)if(i.routes.some((s)=>s.via===e))A++;return A}function pJr(e){let n=SUe().models.value,A=gJr(e,n),i=dua(e);if(i&&!i.connected.value)return{id:`route:${e}`,label:e,description:`${lua[e]??`${A} models`} \xB7 ${i.hint}`,...i.workingMessage?{workingMessage:i.workingMessage}:{},action:i.connect};return{id:`route:${e}`,label:e,description:lua[e]??`${A} models`,descendQuery:`${e}:`,completeQuery:`${e}:`,action:()=>{}}}function dua(e){let n=m8();switch(e){case"codex":return{connected:n.connections.openai.connected,hint:"not connected \xB7 enter to sign in",workingMessage:"waiting for browser sign-in...",connect:()=>n.connections.openai.connect()};case"ollama":return{connected:n.connections.ollama.connected,hint:"not enabled \xB7 enter to enable",workingMessage:"enabling local models...",connect:()=>n.connections.ollama.connect()};case"openrouter":return{connected:n.connections.openrouter.connected,hint:"no key \xB7 run :provider openrouter connect",connect:()=>{}};default:return null}}function mJr(e){let n=XYe().order.value;if(n.length===0)return[{...mKn(),label:"axon:auto"}];let A=[];for(let i of n.slice(0,dJr)){if(i==="axon:auto"){A.push({...mKn(),label:"axon:auto"});continue}let s=i.indexOf(":");if(s===-1)continue;let u=i.slice(0,s),g=i.slice(s+1),d=dua(u);if(d&&!d.connected.value)continue;let f=e.find((E)=>E.routes.some((Q)=>Q.via===u&&Q.model===g)),B=f?.routes.find((E)=>E.via===u&&E.model===g);if(!f||!B)continue;A.push({...fua(f,B),label:i})}return A}function uua(e){return{id:`header:${e}`,label:e,action:()=>{},header:!0}}function fJr(e){return{id:`sep:${e}`,label:"",action:()=>{},separator:!0}}function mKn(){let e=$c().model.value==="axon:auto";return{id:"axon:auto",label:"auto",chunks:["axon","auto"],completeQuery:"axon:auto",description:e?"(current) axon picks per request":"axon picks per request",action:()=>{return XYe().record("axon:auto"),dKn("axon:auto")},workingMessage:"switching to auto..."}}function fua(e,n){let A=$c().model.value===`${n.via}:${n.model}`;return{id:`${n.via}:${n.model}`,label:e.id,chunks:[n.via,e.id],completeQuery:`${n.via}:${n.model}`,description:`${A?"(current) ":""}${CJr(e,n)}`,action:()=>{if(n.via==="openrouter"&&!m8().connections.openrouter.connected.value)return Promise.reject(oA("PROVIDER_NOT_CONNECTED",{detail:"OpenRouter key not connected \u2014 run :provider openrouter connect first",context:{provider:"openrouter"}}));if(n.via==="codex"&&!m8().connections.openai.connected.value)return Promise.reject(oA("PROVIDER_NOT_CONNECTED",{detail:"OpenAI account not connected \u2014 run :provider codex connect first",context:{provider:"codex"}}));return XYe().record(`${n.via}:${n.model}`),dKn(bJr(n))},workingMessage:`switching to ${BJr(e)} via ${n.via}...`}}function hJr(){let e=eje(),n=$c().model.value,A=(s)=>n===`ollama:${s}`;return e.catalog().map((s)=>{let u=s.size===void 0?null:`${(s.size/1e9).toFixed(1)}GB`,g=s.capabilities.filter((d)=>d!=="chat").join(" ");return{installed:s.installed===!0,id:`ollama:${s.name}`,label:s.name,chunks:["ollama",s.name],completeQuery:`ollama:${s.name}`,description:[A(s.name)?"(current)":null,s.installed?"installed":u?`download ${u}`:"download",s.parameters,g||null,s.description].filter(Boolean).join(" \xB7 "),action:async()=>{if(XYe().record(`ollama:${s.name}`),await dKn(`ollama:${s.name}`),!s.installed)e.pull(s.name).catch(()=>{})},workingMessage:s.installed?`switching to ${s.name}...`:`downloading ${s.name}...`}}).sort((s,u)=>Number(u.installed)-Number(s.installed)).map(({installed:s,...u})=>u)}async function dKn(e){await $c().setModel(e)}function bJr(e){return`${e.via}:${e.model}`}function BJr(e){let n=e.name.indexOf(": ");return n===-1?e.name:e.name.slice(n+2)}function CJr(e,n){let A=m8().connections,i=[];if(n.via==="openrouter"&&!A.openrouter.connected.value)i.push("no key");if(n.via==="codex"&&!A.openai.connected.value)i.push("not connected");if(e.context>0)i.push(IJr(e.context));if(n.via==="axon")i.push(`${pua(n.pricing.inPerMTok)}/${pua(n.pricing.outPerMTok)}`);if(n.via==="openrouter"&&n.pricing)i.push(`${gua(n.pricing.prompt)}/${gua(n.pricing.completion)}`);if(n.via==="codex")i.push("sub");return i.join(" \xB7 ")}function IJr(e){if(e>=1e6)return`${(e/1e6).toFixed(e%1e6===0?0:1)}m`;return`${Math.round(e/1000)}k`}function gua(e){return`$${e.toFixed(e>0&&e<0.01?4:2)}`}function pua(e){let n=e/100;return`\xA3${n.toFixed(n>0&&n<0.01?4:2)}`}var mua,uJr,dJr=5,lua;var hua=dt(()=>{Ks();ps();iD();Hye();zGt();cua();pKn();mua={id:"model",maxHeight:8,onEnter:()=>{let e=SUe();e.ensure(),e.reset(),eje().ensure()},skipDefaultFilter:!0,resolve:ha.computed(()=>(e)=>{let n=$c(),A=SUe();if(!n.displayName.value)return{items:[{id:"model:no-agent",label:"no agent running",description:"press | to start one first",action:()=>{},invalid:!0}]};let s=[],u=A.models.value.length===0;if(u&&A.error.value)return s.push({id:"models:error",label:"error",description:A.error.value.message,action:()=>{},invalid:!0}),{items:s};if(u&&A.loading.value)return s.push({id:"models:loading",label:"\u2026",description:"loading models...",action:()=>{},invalid:!0}),{items:s};for(let V of A.failures.value)s.push({id:`failure:${V.source}`,label:V.source,description:V.message,action:()=>{},invalid:!0});let g=e.indexOf(":"),d=(g===-1?e:e.slice(0,g)).trim().toLowerCase(),f=g===-1?null:e.slice(g+1).trim().toLowerCase(),B=lJr(A.models.value);if(f===null){let V=mJr(A.models.value),W=B.filter((te)=>te.includes(d)),z=d.length===0?V:V.filter((te)=>{let ie=te.chunks?.[0];return ie!==void 0&&ie.includes(d)});if(W.length===0&&z.length===0)return s.push({id:"route:none",label:"no such provider",description:B.join(" \xB7 "),action:()=>{},invalid:!0}),{items:s,invalid:!0};if(z.length>0){if(s.push(uua("recent"),...z),W.length>0)s.push(fJr("providers"),uua("providers"))}return s.push(...W.map(pJr)),{items:s}}let E=B.filter((V)=>V.includes(d));if(E.length!==1)return s.push({id:"route:ambiguous",label:E.length===0?"no such provider":"which provider?",description:(E.length===0?B:E).join(" \xB7 "),action:()=>{},invalid:!0}),{items:s,invalid:!0};let Q=E[0],w=[];if(Q==="axon")w.push(mKn());if(Q==="ollama")w.push(...hJr());for(let V of A.models.value)for(let W of V.routes)if(W.via===Q)w.push(fua(V,W));let S=XYe().order.value,G=(V)=>{let W=S.indexOf(V.id);return W===-1?Number.MAX_SAFE_INTEGER:W},q=w.sort((V,W)=>G(V)-G(W)),P=f.length===0?q:q.filter((V)=>xUe(f,[V.label])!==null);if(P.length===0)return s.push({id:"model:none",label:"no match",description:`${Q} has no model matching "${f}"`,action:()=>{},invalid:!0}),{items:s,breadcrumb:`${Q} \u203A`,invalid:!0};return s.push(...P),{items:s,breadcrumb:`${Q} \u203A`}})},uJr=["axon","codex","openrouter","ollama"];lua={axon:"managed inference \xB7 billed to your Axon ledger",codex:"your ChatGPT subscription",openrouter:"your own OpenRouter key",ollama:"models on this machine \xB7 free"}});var bua;var Bua=dt(()=>{Ks();wUe();iq();bua={id:"help",resolve:ha.computed(()=>()=>{return{items:Object.entries(aae).map(([n,A])=>({id:A,label:`${MQt[A]} ${A}`,description:qGt[A]??n,action:()=>{oB().mode.setMode(A)}}))}})}});function EJr(e){let n=ha.ref(0);function A(){n.value++}let i=ha.computed(()=>{return n.value,e.history.recent()});function s(u,g){e.history.append(u,g),A()}return{entries:i,append:s}}function JQt(){if(!fKn)fKn=EJr(PB().store);return fKn}var fKn;var hKn=dt(()=>{Ks();n9()});var Cua;var Iua=dt(()=>{Ks();hKn();iq();Cua={id:"history",anchor:"bottom",skipDefaultFilter:!0,resolve:ha.computed(()=>()=>{return{items:JQt().entries.value.slice().reverse().map((n)=>({id:n.id,label:n.content,description:n.agentName??void 0,preview:()=>{oB().previewHistory(n.content)},action:()=>{}}))}})}});function yJr(){return{ordered:[],originSessionId:null,originRoute:null,committed:!1}}function QJr(e,n){let A=new Map(e.map((E)=>[E.sessionId,E])),i=new Map,s=[];for(let E of e){let Q=E.parentSessionId,w=Q?A.get(Q):void 0;if(!w){s.push(E);continue}let S=i.get(w.sessionId);if(S)S.push(E);else i.set(w.sessionId,[E])}let u=new Map(n.map((E,Q)=>[E,Q])),g=(E)=>u.get(E.sessionId)??Number.MAX_SAFE_INTEGER;s.sort((E,Q)=>g(E)-g(Q));let d=[],f=new Set,B=(E,Q,w)=>{if(f.has(E.sessionId))return;f.add(E.sessionId),d.push({...E,indent:Q,last:w});let S=i.get(E.sessionId)??[];S.forEach((G,q)=>B(G,Q+1,q===S.length-1))};s.forEach((E,Q)=>B(E,0,Q===s.length-1));for(let E of e){if(f.has(E.sessionId))continue;f.add(E.sessionId),d.push({...E,indent:0,last:!0})}return d}function _Jr(){let e=$Qt.value;if(e.committed)return;let n=$c();if(e.originSessionId&&n.instances.value.some((A)=>A.sessionId===e.originSessionId))n.focus(e.originSessionId);if(e.originRoute)CI().push(e.originRoute)}function wJr(e){let n=()=>{$c().focus(e.sessionId),CI().push("/")},A=e.exitedAt!==null;return{id:`instance:${e.sessionId}`,label:`${kJr(e)}${e.name}`,completeQuery:e.name,description:DJr(e),...A?{invalid:!0,action:()=>{}}:{preview:n,action:()=>{$Qt.value={...$Qt.value,committed:!0},n()}}}}function kJr(e){if(e.indent===0)return"";return`${" ".repeat(e.indent-1)}${e.last?"\u2514\u2500 ":"\u251C\u2500 "}`}function DJr(e){let n=[];if(e.exitedAt!==null)n.push(`exited ${xJr(e.exitedAt)}`);else{if(e.focused)n.push("active");if(e.activity)n.push(e.activity)}return n.push(e.sessionId.slice(0,8)),n.join(" \xB7 ")}function xJr(e){let n=Math.floor((Date.now()-e)/60000);return n<1?"just now":`${n}m ago`}var $Qt,Eua;var yua=dt(()=>{Ks();iD();$Qt=ha.ref(yJr()),Eua={id:"instance",maxHeight:8,onEnter:()=>{let n=$c().instances.value,A=n.find((i)=>i.focused)?.sessionId??null;$Qt.value={originSessionId:A,originRoute:CI().currentRoute.value.path,committed:!1,ordered:[...A?[A]:[],...n.filter((i)=>i.sessionId!==A).map((i)=>i.sessionId)]}},onCancel:_Jr,resolve:ha.computed(()=>(e)=>{let n=$c().instances.value;if(n.length===0)return{items:[{id:"instance:none",label:"nothing running",description:"press ~ to start an agent",action:()=>{},invalid:!0}]};return{items:QJr(n,$Qt.value.ordered).map(wJr)}})}});function FJr(e,n){return{id:`agent:${e.name}`,label:e.name,description:n.length>0?`${n.length} running`:void 0,action:()=>$c().spawnSibling(e.dir),detach:!0,workingMessage:`starting ${e.name}...`}}function vJr(e){return{id:`deployment:${e.deploymentId}`,label:e.name,description:`running \xB7 ${e.tier}`,action:()=>$c().attachDeployment(e.deploymentId),detach:!0,workingMessage:`connecting to ${e.name}...`}}function bKn(e){return{id:`header:${e}`,label:e,action:()=>{},header:!0}}function Qua(e){return{id:`sep:${e}`,label:"",action:()=>{},separator:!0}}var _ua;var wua=dt(()=>{Ks();iD();_ua={id:"agent",maxHeight:8,resolve:ha.computed(()=>(e)=>{let n=$c(),A=[],i=n.available.value,s=i.filter((g)=>g.kind==="local");if(s.length>0){A.push(bKn("agents"));for(let g of s){let d=n.instancesByAgent.value.get(g.name)??[];A.push(FJr(g,d))}}let u=i.filter((g)=>g.kind==="deployed");if(u.length>0){A.push(Qua("cloud"),bKn("deployed"));for(let g of u)A.push(vJr(g))}if(n.deploymentsError.value)A.push(Qua("cloud"),bKn("deployed")),A.push({id:"deployments:error",label:"unavailable",description:n.deploymentsError.value.message,action:()=>{},invalid:!0});return{items:A}})}});function SJr(e){let n=new Map(e.map((E)=>[E.sessionId,E])),A=new Map,i=[];for(let E of e){let Q=E.forkedFrom,w=Q?n.get(Q):void 0;if(!w){i.push(E);continue}let S=A.get(w.sessionId);if(S)S.push(E);else A.set(w.sessionId,[E])}let s=new Map,u=(E)=>{let Q=s.get(E.sessionId);if(Q!==void 0)return Q;s.set(E.sessionId,E.modifiedAt);let w=E.modifiedAt;for(let S of A.get(E.sessionId)??[])w=Math.max(w,u(S));return s.set(E.sessionId,w),w},g=(E,Q)=>u(E)-u(Q);i.sort(g);for(let E of A.values())E.sort(g);let d=[],f=new Set,B=(E,Q,w)=>{if(f.has(E.sessionId))return;f.add(E.sessionId),d.push({...E,indent:Q,last:w});let S=A.get(E.sessionId)??[];S.forEach((G,q)=>B(G,Q+1,q===S.length-1))};i.forEach((E,Q)=>B(E,0,Q===i.length-1));for(let E of e){if(f.has(E.sessionId))continue;f.add(E.sessionId),d.push({...E,indent:0,last:!0})}return d}function NJr(e){if(e.indent===0)return"";return`${" ".repeat(e.indent-1)}${e.last?"\u2514\u2500 ":"\u251C\u2500 "}`}function GJr(e){let n=[LJr(e.modifiedAt)];if(e.running)n.push("running");if(e.title)n.push(e.sessionId.slice(0,8));return n.push(MJr(e.sizeBytes)),n.join(" \xB7 ")}function MJr(e){if(e<1024)return`${e}b`;if(e<1048576)return`${Math.round(e/1024)}k`;return`${(e/1048576).toFixed(1)}M`}function LJr(e){let n=Math.max(0,Math.round((Date.now()-e)/1000));if(n<60)return"just now";if(n<3600)return`${Math.round(n/60)}m ago`;if(n<86400)return`${Math.round(n/3600)}h ago`;return`${Math.round(n/86400)}d ago`}var kua;var Dua=dt(()=>{Ks();iD();oTn();kua={id:"session",maxHeight:8,anchor:"bottom",resolve:ha.computed(()=>(e)=>{let n=$c(),A=n.home.value,i=A?A.split("/").filter(Boolean).at(-1)??null:null,s=n.displayName.value;if(!s)return{items:[{id:"session:no-agent",label:"no agent running",description:"press ~ to start one first",action:()=>{},invalid:!0}]};let u=n.sessions.value.filter((d)=>d.agent===i&&BGt(d)).slice().reverse();if(u.length===0)return{items:[{id:"session:none",label:"no past sessions",description:`${s} has no history yet`,action:()=>{},invalid:!0}]};return{items:SJr(u).map((d)=>({id:`session:${d.sessionId}`,label:`${NJr(d)}${d.title??d.sessionId.slice(0,8)}`,completeQuery:d.title??d.sessionId.slice(0,8),description:GJr(d),preview:()=>{n.preview.show(d)},action:()=>n.resume(d.agent,d.sessionId),detach:!0}))}})}});var xua;var Fua=dt(()=>{Ks();A9();xua={id:"theme",resolve:ha.computed(()=>()=>{let e=SE(),n=e.committedName.value;return{items:e.themes.value.map((i)=>({id:i.name,label:i.name,description:i.name===n?"current":"",current:i.name===n,preview:()=>{e.preview(i.name)},action:()=>{e.set(i.name)}}))}}),onCancel:()=>{SE().cancelPreview()}}});function qJr(){let e=PB().files,n=ha.ref([]),A=ha.ref(!1),i=ha.ref(null),s=ha.ref(!1),u=!1;function g(){if(u||A.value)return;A.value=!0,e.list().then((f)=>{n.value=f,s.value=e.truncated,i.value=null}).catch((f)=>{i.value=f instanceof Error?f:Error(String(f))}).finally(()=>{u=!0,A.value=!1})}function d(){e.invalidate(),u=!1,i.value=null}return{entries:n,loading:A,error:i,truncated:s,root:e.root,ensure:g,invalidate:d}}function CKn(){if(!BKn)BKn=qJr();return BKn}function vua(){CKn().ensure()}var BKn;var IKn=dt(()=>{Ks();n9()});function UJr(e){let n=e.split("/").filter(Boolean),A=3,i=n.length>3?n.slice(-3):n;return`${n.length>3?"\u2026 \u203A ":""}${i.join(" \u203A ")} \u203A`}function Sua(e){return e.startsWith(".")||e.includes("/.")}function TJr(e,n){let A=n===""?"":n;return[...e.filter((u)=>{if(!u.path.startsWith(A))return!1;let g=u.path.slice(A.length);return g.length>0&&!g.includes("/")})].sort((u,g)=>{if(u.directory!==g.directory)return u.directory?-1:1;let d=u.name.startsWith(".");if(d!==g.name.startsWith("."))return d?1:-1;return u.name.localeCompare(g.name)}).slice(0,Gua).map((u)=>Mua(u,u.name))}function KJr(e,n){let A=[];for(let i of e){let s=xUe(n,[i.name,i.path]);if(s===null)continue;A.push({entry:i,score:s})}return A.sort((i,s)=>s.score-i.score||Number(i.entry.directory)-Number(s.entry.directory)||Number(Sua(i.entry.path))-Number(Sua(s.entry.path))||i.entry.path.length-s.entry.path.length),A.slice(0,Gua).map((i)=>Mua(i.entry,i.entry.path))}function Mua(e,n){let A=e.directory?"/":"";return{id:`file:${e.path}`,label:n+A,chunks:[e.name,e.path],completeQuery:e.path+A,...e.directory?{descendQuery:`${e.path}/`}:{},action:e.directory?()=>{}:()=>{oB().resolveInline(e.path)}}}var Nua,Gua=200;var Lua=dt(()=>{Ks();IKn();iq();Nua={id:"file",maxHeight:10,skipDefaultFilter:!0,resolve:ha.computed(()=>(e)=>{let n=CKn();if(n.ensure(),n.error.value)return{items:[],status:{kind:"error",message:`cannot read ${n.root} \u2014 ${n.error.value.message}`}};let A=n.entries.value,i=e.trim(),s=i===""||i.endsWith("/"),u=s?TJr(A,i):KJr(A,i);if(n.loading.value&&u.length===0)return{items:[],status:{kind:"loading",message:"reading working tree..."}};return{items:u,...s&&i!==""?{breadcrumb:UJr(i)}:{},...n.truncated.value?{status:{kind:"error",message:"tree too large \u2014 results are partial"}}:{}}})}});function RJr(){if(qua)return;qua=!0;for(let e of[rua,mua,bua,Cua,Eua,_ua,kua,$ca,Zca,xua,Nua])Ica(e)}function Uua(e){RJr();let{mode:n,query:A,setQuery:i}=e,s=e.hint??(()=>null),u=ha.ref(0),g=ha.ref(0),d=ha.ref(!1),f=ha.ref(null),B=ha.computed(()=>TGt(n.value)),E=ha.ref(null),Q=3,w=ha.ref(null),S=ha.ref(0),G=ha.computed(()=>B.value?.tabs??null),q=ha.computed(()=>{let Tn=G.value;if(!Tn)return null;return Tn.slice(S.value,S.value+Q)});function P(Tn){let Cn=G.value;if(!Cn)return;let ja=Cn.findIndex((Te)=>Te.id===Tn);if(ja===-1)return;if(w.value=Tn,ja<S.value)S.value=ja;else if(ja>=S.value+Q)S.value=ja-Q+1;Ne()}let V=bC();ha.watch(n,(Tn,Cn)=>{if(Cn!==void 0&&Cn!==Tn)TGt(Cn)?.onCancel?.(E.value);let ja=TGt(Tn);if(E.value=ja?.createState?ja.createState():null,ja?.onEnter?.(E.value),w.value=ja?.tabs?.[0]?.id??null,S.value=0,u.value=0,g.value=0,d.value=!1,f.value=null,Cn!==void 0&&Cn!=="normal"&&Tn==="normal")setTimeout(()=>V(),0)},{immediate:!0});let W=ha.computed(()=>B.value?.resolve.value(A(),w.value,i)??{items:[]}),z=ha.computed(()=>W.value.items),te=ha.computed(()=>{let Tn=s();if(Tn!==null)return Tn;if(f.value!==null)return f.value;let Cn=z.value;if(B.value?.skipDefaultFilter)return Cn;let ja=A().toLowerCase().trim();if(!ja)return Cn;let Te=(fA)=>fA.chunks?xUe(A(),fA.chunks)!==null:fA.label.toLowerCase().includes(ja)||(fA.description?.toLowerCase().includes(ja)??!1),Nn=[],jt=[],rA=!1;for(let fA of Cn){if(fA.separator){jt=[fA],rA=!1;continue}if(fA.header){jt=[...jt,fA],rA=Te(fA);continue}if(rA||Te(fA)){if(jt.length>0){if(Nn.length===0&&jt[0]?.separator)jt.shift();Nn.push(...jt),jt=[]}Nn.push(fA)}}if(ja.length>0&&Nn.length>1&&Nn.every((fA)=>fA.chunks)){let fA=Nn.map((gn,zA)=>({item:gn,index:zA,score:xUe(A(),gn.chunks)??0}));return fA.sort((gn,zA)=>zA.score-gn.score||gn.index-zA.index),fA.map((gn)=>gn.item)}return Nn}),ie=ha.computed(()=>{if(it.value!==null)return 1;if(cA.value!==null)return 1;if(te.value.length===0)return 1;let Tn=B.value?.maxHeight??5;return Math.min(te.value.length,Tn)});ha.watch(te,(Tn,Cn)=>{if(!d.value&&Tn.length>0){u.value=xe.value,d.value=!0,Oe(),$e();return}let ja=yca({items:Tn,previous:Cn,selectedIndex:u.value,homeIndex:xe.value});if(ja!==u.value)u.value=ja,Oe()});let ae=ha.computed(()=>{let Tn=te.value;for(let Cn=0;Cn<Tn.length;Cn++)if(Z$(Tn,Cn))return Cn;return 0}),Be=ha.computed(()=>{let Tn=te.value;for(let Cn=Tn.length-1;Cn>=0;Cn--)if(Z$(Tn,Cn))return Cn;return 0}),xe=ha.computed(()=>{let Tn=te.value;for(let Cn=0;Cn<Tn.length;Cn++)if(Tn[Cn].current&&Z$(Tn,Cn))return Cn;return B.value?.anchor==="bottom"?Be.value:ae.value});function Re(Tn){let Cn=te.value;if(Cn[Tn]?.header)return!1;for(let ja=0;ja<=Tn&&ja<Cn.length;ja++)if(Cn[ja].header)return!0;return!1}function Oe(){let Tn=ie.value,Cn=u.value;if(Cn<=g.value)g.value=Re(Cn)?Math.max(0,Cn-1):Cn;else if(Cn>=g.value+Tn)g.value=Cn-Tn+1}function Ne(){g.value=0,d.value=!1,u.value=xe.value,Oe()}function $e(){te.value[u.value]?.preview?.()}let it=ha.ref(null),Me=null,bt=ha.ref(0);function Rt(){bt.value++}function mt(){Me?.abort(),Me=null,it.value=null}function Xt(Tn){return Tn instanceof Error?Tn.message:"failed"}async function Ln(Tn){Me=new AbortController;let Cn=Me.signal,ja;try{ja=Tn.action(Cn)}catch(Nn){Me=null,it.value={kind:"error",label:Tn.label,message:Xt(Nn)};return}if(!(ja instanceof Promise)){Me=null;return}if(Tn.detach){if(Me=null,!Tn.inlineResult)i("");n.value="normal",ja.catch(()=>{});return}let Te=Tn.label;it.value={kind:"working",label:Te,message:Tn.workingMessage??Tn.description??"working...",startedAt:Date.now()};try{if(await ja,!Cn.aborted){if(it.value=null,Tn.keepOpen)return;if(!Tn.inlineResult)i("");n.value="normal"}}catch(Nn){if(!Cn.aborted)it.value={kind:"error",label:Te,message:Xt(Nn)}}finally{Me=null}}function Ft(Tn){if(Tn.choices)try{f.value=Tn.choices(),u.value=0,g.value=0}catch(Cn){it.value={kind:"error",label:Tn.label,message:Xt(Cn)}}else if(Tn.descendQuery!==void 0)i(Tn.descendQuery);else Ln(Tn)}function nn(){if(it.value!==null)return null;let Tn=te.value[u.value]??null;if(Tn&&Z$(te.value,u.value))Ft(Tn);return Tn}function $n(Tn){if(it.value!==null)return null;let Cn=te.value[Tn]??null;if(Cn&&Z$(te.value,Tn))u.value=Tn,Ft(Cn);return Cn}function Ht(Tn){if(!Z$(te.value,Tn))return;u.value=Tn,Oe(),$e()}Lh("tab",(Tn)=>{if(it.value===null){let Cn=te.value[u.value]??null;if(Cn&&Z$(te.value,u.value)){let ja=Cn.completeQuery??Cn.label;if(ja.length>0)i(ja)}}if(Tn)Tn.consumed=!0}),Lh("up",(Tn)=>{let Cn=te.value,ja=Cn.length;if(ja===0)return;for(let Te=1;Te<=ja;Te++){let Nn=(u.value-Te+ja)%ja;if(Z$(Cn,Nn)){u.value=Nn,Oe(),$e();break}}if(Tn)Tn.consumed=!0}),Lh("down",(Tn)=>{let Cn=te.value,ja=Cn.length;if(ja===0)return;for(let Te=1;Te<=ja;Te++){let Nn=(u.value+Te)%ja;if(Z$(Cn,Nn)){u.value=Nn,Oe(),$e();break}}if(Tn)Tn.consumed=!0}),Lh("escape",(Tn)=>{if(it.value?.kind==="working"){if(mt(),Tn)Tn.consumed=!0;return}if(it.value!==null){if(mt(),Tn)Tn.consumed=!0;return}if(f.value!==null){if(f.value=null,u.value=ae.value,g.value=0,Tn)Tn.consumed=!0;return}if(te.value.length===0)return;if(E.value=B.value?.createState?B.value.createState():null,Tn)Tn.consumed=!0});function tA(){let Tn=te.value;return Z$(Tn,u.value)?Tn[u.value]:null}Lh("left",(Tn)=>{let Cn=G.value;if(Cn&&w.value){let Nn=Cn.findIndex((jt)=>jt.id===w.value);if(P(Cn[(Nn-1+Cn.length)%Cn.length].id),Tn)Tn.consumed=!0;return}let ja=B.value?.onLeft,Te=tA();if(ja&&Te){if(ja(Te),Tn)Tn.consumed=!0}}),Lh("right",(Tn)=>{let Cn=G.value;if(Cn&&w.value){let Nn=Cn.findIndex((jt)=>jt.id===w.value);if(P(Cn[(Nn+1)%Cn.length].id),Tn)Tn.consumed=!0;return}let ja=B.value?.onRight,Te=tA();if(ja&&Te){if(ja(Te),Tn)Tn.consumed=!0}});let JA=ha.computed(()=>{let Tn=te.value,Cn=g.value,ja=null;for(let Te=0;Te<=Cn&&Te<Tn.length;Te++)if(Tn[Te].header)ja=Tn[Te].label;if(Tn[Cn]?.header)return null;return ja}),un=ha.computed(()=>W.value.breadcrumb??null),mA=ha.computed(()=>W.value.header??null),cA=ha.computed(()=>W.value.status??null),vn=ha.computed(()=>W.value.invalid??!1);return{filtered:te,height:ie,isRegisteredMode:ha.computed(()=>B.value!==void 0),selectedIndex:ha.computed(()=>u.value),scrollY:ha.computed(()=>g.value),tabs:q,activeTabId:ha.computed(()=>w.value),stickyHeader:JA,breadcrumb:un,header:mA,status:cA,isInvalidCommand:vn,hasNothingToRun:ha.computed(()=>te.value.length>0&&tA()===null),working:ha.computed(()=>it.value),noMatchSignal:ha.computed(()=>bt.value),signalNoMatch:Rt,hasChoiceList:ha.computed(()=>f.value!==null),keepsOpen:ha.computed(()=>tA()?.keepOpen??!1),hasHint:ha.computed(()=>s()!==null),selectTab:P,reset:Ne,selectCurrent:nn,selectAt:$n,hoverAt:Ht,abortWorking:mt}}var qua=!1;var Tua=dt(()=>{Ks();Eca();oua();hua();Bua();Iua();yua();wua();Dua();JGt();aKn();Fua();Lua()});function WGt(){if(!EKn)EKn=YJr();return EKn}function YJr(){let n=PB().mic,A=ha.ref(n.waveform()),i=ha.ref(n.isActive()),s=ha.ref(0),u=null,g=0;function d(){A.value=n.waveform(),i.value=n.isActive(),s.value=i.value?Math.floor((Date.now()-g)/1000):0}function f(){if(u)return;u=setInterval(d,pQt.tickMs)}function B(){if(!u)return;clearInterval(u),u=null}return{waveform:ha.computed(()=>A.value),isActive:ha.computed(()=>i.value),elapsedSeconds:ha.computed(()=>s.value),async start(){g=Date.now(),await n.start(),d(),f()},async stop(){let E=await n.stop();return d(),B(),E}}}var EKn;var yKn=dt(()=>{Ks();n9();DUn()});function ZGt(){if(!QKn)QKn=jJr();return QKn}function jJr(){let e=ha.ref(!0);function n(){e.value=!0}function A(i){return i.onScroll(({scrollY:s,maxScroll:u})=>{e.value=s>=u})}return{following:e,attach:n,observe:A}}var QKn;var _Kn=dt(()=>{Ks()});function Kua(e){if(e.working==="working")return{kind:"abort-working"};if(e.working!==null)return{kind:"dismiss-error"};if(e.mode==="normal")return{kind:"try-interrupt"};return{kind:"exit-mode"}}function VGt(e){return{id:e.sessionId,name:e.name,focused:e.focused,activity:e.activity}}function Rua(){let e=$c(),n=oB(),A=q7(),i=new Set;ha.watch(()=>e.instances.value,(g)=>{let d=new Set(g.map((f)=>f.sessionId));for(let f of g)if(!i.has(f.sessionId))A.notify("agent:ready",{instance:VGt(f)});for(let f of i)if(!d.has(f))A.notify("agent:stopped",{instance:{id:f,name:"",focused:!1,activity:null}});i=d},{immediate:!0}),ha.watch(()=>e.sessionId.value,(g)=>{if(!g)return;let d=e.instances.value.find((f)=>f.sessionId===g);if(d)A.notify("agent:focused",{instance:VGt(d)})});let s=lI();ha.watch(()=>[s.width.value,s.height.value],([g,d])=>{A.notify("tui:resize",{width:g,height:d})}),s.selection.onCopy((g)=>{A.notify("tui:copy",{text:g})});let u=!1;ha.watch(()=>e.activity.value,(g)=>{let d=g==="working";if(u&&!d){let f=e.instances.value.find((B)=>B.focused);if(f)A.notify("message:received",{instance:VGt(f)})}u=d}),ha.watch(()=>n.mode.mode.value,(g,d)=>{if(d===void 0||d===g)return;if(A.notify("mode:changed",{from:d,to:g}),GQt(d))A.notify("palette:closed",{name:d});if(GQt(g))A.notify("palette:opened",{name:g})})}function Yua(e){let A=$c().instances.value.find((i)=>i.focused);if(!A)return;q7().notify("message:sent",{content:e,instance:VGt(A)})}var wKn=dt(()=>{Ks();iD();iq();wUe();zye()});var Hua={};Ta(Hua,{useInput:()=>oB,DRAFT_MODES:()=>OQt});function oB(){if(!kKn)kKn=HJr();return kKn}function HJr(){let e=Cy(),n=bC(),A=ha.ref(""),i=null,s=null,u=mca(()=>A.value,()=>e.value.path!=="/auth"),g=Uua({mode:u.mode,query:()=>V()??A.value,setQuery:(bt)=>{W(bt)},hint:()=>z()}),d=WGt(),f=PB(),B=ha.ref(!1),E=ha.ref(null),Q=null;function w(){if(B.value=!0,Q)clearTimeout(Q);Q=setTimeout(()=>{B.value=!1,Q=null},600)}ha.watch(()=>g.noMatchSignal.value,()=>{w()}),ha.watch(()=>tL().pending.value!==null,(bt)=>{if(bt)A.value="",u.setMode(jYe);else if(A.value="",u.mode.value===jYe)u.setMode("normal")}),ha.watch(()=>$ye().current.value!==null,(bt)=>{if(bt)A.value="",u.setMode(YYe);else if(u.mode.value===YYe)A.value="",u.setMode("normal")});let S=null,G=null;function q(bt){G=bt,A.value=bt}ha.watch(A,(bt)=>{if(u.mode.value!=="history")return;if(bt===G)return;S=null,G=null,u.setMode("normal")});function P(){if(!(u.mode.value==="normal"||_Ue.some((Rt)=>Rt.mode===u.mode.value)))return null;for(let Rt of _Ue){let mt=lca(A.value,Rt);if(mt)return{trigger:Rt,start:mt.start,query:mt.query}}return null}function V(){return P()?.query??null}function W(bt){let Rt=P();if(Rt){A.value=A.value.slice(0,Rt.start)+Rt.trigger.key+bt;return}A.value=bt}function z(){if(u.mode.value!=="normal")return null;let bt=_Ue.filter((Rt)=>uca(A.value,Rt));if(bt.length===0)return null;return bt.map((Rt)=>({id:Rt.mode,label:`${MQt[Rt.mode]} ${Rt.mode}`,description:qGt[Rt.mode]??Rt.key,action:()=>{A.value=A.value+Rt.key}}))}ha.watch(A,(bt)=>{if(u.mode.value!=="normal")return;for(let Rt of _Ue){if(Rt.resolve!=="append")continue;let mt=gca(bt,Rt);if(mt===-1)continue;s=Rt,i=bt.slice(0,mt).replace(/ $/,""),u.setMode(Rt.mode);return}}),ha.watch(A,()=>{let bt=P();if(bt&&u.mode.value==="normal"){s=bt.trigger,i=null,u.setMode(bt.trigger.mode);return}if(!bt&&s?.resolve==="splice"&&u.mode.value===s.mode)s=null,u.setMode("normal")});function te(bt){let Rt=P();if(!Rt){s=null,u.setMode("normal");return}A.value=`${A.value.slice(0,Rt.start)}${bt} `,s=null,u.setMode("normal")}function ie(){let bt=P();if(s=null,!bt)return;A.value=A.value.slice(0,bt.start).replace(/ $/,"")}ha.watch(u.mode,(bt,Rt)=>{if(Rt==="session"&&bt==="normal")$c().preview.clear();if(bt==="history")S=A.value;if(Rt==="history"&&bt==="normal"){if(G=null,S!==null)A.value=S,S=null}if(bt==="voice"&&Rt!=="voice")d.start().catch((mt)=>{E.value=mt instanceof Error?mt:Error(String(mt)),u.setMode("normal")});if(Rt==="voice"&&bt!=="voice"){let mt=u.voiceExitReason.value;u.voiceExitReason.value=null,ae(mt)}},{flush:"sync"});async function ae(bt){let Rt=await d.stop();if(bt!=="confirm"){if(i!==null)A.value=i,i=null;return}u.processing.value=!0;try{let{text:mt}=await f.cloud.client.cloud.stt.transcribe(Rt),Xt=mt.trim();if(i!==null)if(Xt){let Ln=i.endsWith(" ")||i===""?"":" ";A.value=i+Ln+Xt}else A.value=i;else if(Xt)A.value=Xt;i=null}catch(mt){E.value=mt instanceof Error?mt:Error(String(mt))}finally{u.processing.value=!1}}let Be=0,xe=ha.ref(null),Re=null;function Oe(){if(xe.value="press esc again to clear",Re)clearTimeout(Re);Re=setTimeout(()=>{xe.value=null,Re=null},jua)}function Ne(){if(Re)clearTimeout(Re);Re=null,xe.value=null}ha.watch(A,()=>{if(xe.value!==null)Ne()});function $e(){if(QTn(),$ye().current.value){$ye().denyAll(),A.value="",u.setMode("normal");return}if(tL().pending.value){tL().cancel(),A.value="",u.setMode("normal");return}let bt=Kua({mode:u.mode.value,working:g.working.value?.kind??null});if(bt.kind==="abort-working"){g.abortWorking();return}if(bt.kind==="dismiss-error"){g.abortWorking(),A.value="",u.setMode("normal");return}if(bt.kind==="try-interrupt"){if($c().interrupt()){setTimeout(()=>n(),0);return}}let Rt=Date.now(),mt=Rt-Be<jua;if(Be=Rt,mt){if(Ne(),A.value.trim())try{JQt().append(A.value,$c().selected.value)}catch{}A.value=""}else{let Xt=OQt.has(u.mode.value);if(!Xt)A.value="";if(u.mode.value==="voice")u.voiceExitReason.value="cancel";if(ie(),u.setMode("normal"),Xt&&A.value.length>0)Oe();else Ne()}}function it(){if(QTn(),g.working.value!==null)return;if(tL().pending.value?.kind==="prompt"){tL().submitText(A.value),A.value="",u.setMode("normal");return}if(g.isInvalidCommand.value||g.hasNothingToRun.value){w();return}if(g.hasHint.value&&g.filtered.value.length>0){g.selectCurrent();return}if(u.mode.value!=="normal"&&g.filtered.value.length>0){S=null;let mt=u.mode.value,Xt=g.hasChoiceList.value,Ln=g.keepsOpen.value;if(g.selectCurrent(),Ln)return;if(g.hasChoiceList.value||Xt)return;if(g.reset(),u.mode.value===mt&&g.working.value===null){if(mt!=="history"&&!OQt.has(mt))A.value="";u.setMode("normal")}return}if(e.value.path==="/auth"){A.value="";return}if(u.mode.value==="normal"&&A.value.trim()){let mt=A.value;A.value="",g.reset(),E.value=null,ZGt().attach();try{JQt().append(mt,$c().selected.value)}catch{}$c().send(mt).catch((Xt)=>{E.value=Xt instanceof Error?Xt:Error(String(Xt))}),Yua(mt)}}function Me(bt){A.value+=bt}return{text:A,inputError:B,sendError:E,escHint:xe,mode:u,palette:g,onEnter:it,onEscape:$e,onPrintable:Me,previewHistory:q,resolveInline:te}}var jua=400,OQt,kKn;var iq=dt(()=>{Ks();wUe();Tua();iD();yKn();n9();hKn();_Kn();qTn();DUe();wKn();jTn();UGt();kQt();OQt=new Set(["normal","voice","file"])});function XGt(e){let n=e.toLowerCase().split("+").map((u)=>u.trim()).filter(Boolean),A=n.pop();if(!A)return e;let i=n.includes("ctrl")||n.includes("control"),s=n.includes("shift");if(i&&s)return`C-S-${A}`;if(i)return`C-${A}`;if(s)return`S-${A}`;return A}function JJr(e){let n=/^(C-)?(S-)?(.+)$/.exec(e);if(!n)return e;let[,A,i,s]=n,u=[];if(A)u.push("ctrl");if(i)u.push("shift");return u.push(s),u.join("+")}function DKn(e){let n=XGt(e);return PJr.has(n)||n in aae}function $Jr(e){if(!e.name)return null;if(e.ctrl&&e.shift)return`C-S-${e.name}`;if(e.ctrl)return`C-${e.name}`;if(e.shift)return`S-${e.name}`;return e.name}function Pua(){let e=oB();Lh("**",(n)=>{if(n?.consumed)return;let A=$Jr(n??{});if(!A)return;let i=w2.paletteForKey(A);if(i){if(e.text.value.length>0)return;let u=e.mode.mode.value;e.mode.setMode(u===i.name?"normal":i.name),n.consumed=!0;return}let s=w2.keyHandler(A);if(!s){q7().notify("key:pressed",{key:JJr(A),mode:e.mode.mode.value});return}n.consumed=!0,(async()=>{try{await s()}catch(u){ED().show(`${A} failed`,"error")}})()})}var PJr;var xKn=dt(()=>{Ks();QUe();vUe();zye();iq();wUe();PJr=new Set(["C-c","C-d","escape","return","enter","tab","up","down","left","right","backspace","delete"])});function tje(){if(!vKn)vKn=zJr();return vKn}function OJr(){return process.env.PWD??process.cwd()}async function SKn(e){try{let n=Bun.spawn(["git",...e],{cwd:OJr(),stdout:"pipe",stderr:"ignore"}),A=await new Response(n.stdout).text();return await n.exited===0?A.trim():null}catch{return null}}function zJr(){return{state:eMt,async refresh(){if(FKn)return;FKn=!0;try{let e=await SKn(["rev-parse","--abbrev-ref","HEAD"]);if(e===null){eMt.value=NKn;return}let[n,A]=await Promise.all([SKn(["status","--porcelain"]),SKn(["rev-list","--left-right","--count","HEAD...@{upstream}"])]),i=e==="HEAD"?null:e,s=n?n.split(`
4937
4937
  `).filter(Boolean).length:0,[u,g]=A?A.split(/\s+/).map((d)=>Number(d)||0):[0,0];eMt.value={branch:i,dirty:s,ahead:u??0,behind:g??0}}catch{eMt.value=NKn}finally{FKn=!1}}}}var NKn,eMt,FKn=!1,vKn;var Jua=dt(()=>{Ks();NKn={branch:null,dirty:0,ahead:0,behind:0},eMt=ha.ref(NKn)});function XJr(e){return VJr[e.toLowerCase()]??e}function e$r(){if($ua)return;$ua=!0,q7().register("key:pressed",({key:e})=>{zQt=[...zQt,{key:e,at:Date.now()}].slice(-ZJr)})}function Oua(){e$r();let e=Date.now()-WJr;return zQt=zQt.filter((n)=>n.at>e),zQt.map((n)=>XJr(n.key))}var WJr=1500,ZJr=10,zQt,$ua=!1,VJr;var zua=dt(()=>{zye();zQt=[],VJr={enter:"\u23CE",return:"\u23CE",tab:"\u21E5",backspace:"\u232B",delete:"\u2326",escape:"esc",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u21F1",end:"\u21F2"}});var GKn;var Wua=dt(()=>{iD();Hye();Wye();Jua();iq();zua();GKn={"axon:agent/name":{icon:"agent",on:["agent:focused","agent:ready","agent:stopped"],render:()=>$c().displayName.value},"axon:agent/model":{icon:"model",on:["agent:focused","agent:ready","message:received"],render:()=>{let e=$c();return e.contextModel.value??e.manifest.value?.model??null}},"axon:agent/modules":{icon:"modules",on:["agent:ready","agent:focused"],render:()=>{let e=$c(),n=e.manifest.value;return n?n.modules??null:e.modules.value.length}},"axon:agents/active":{on:["agent:ready","agent:stopped"],render:()=>$c().instances.value.length},"axon:agents/total":{on:["agent:ready","agent:stopped"],render:()=>$c().available.value.length},"axon:session/name":{icon:"session",on:["agent:focused","agent:ready","message:received"],render:()=>{let e=$c(),n=e.sessionId.value??e.manifest.value?.sessionId;if(!n)return null;return e.sessions.value.find((A)=>A.sessionId===n)?.title??n}},"axon:session/id":{on:["agent:focused","agent:ready"],render:()=>{let e=$c();return e.sessionId.value??e.manifest.value?.sessionId??null}},"axon:session/tokens":{icon:"tokens",on:["message:sent","message:received","agent:focused"],render:()=>{let e=$c(),n=e.context.value??e.manifest.value?.context??null;return n===null?null:`${Math.round(n/1000)}k`}},"axon:session/messages":{icon:"messages",on:["message:sent","message:received","agent:focused"],render:()=>$c().session.value.entries.length},"axon:profile/email":{icon:"user",on:["tui:reloaded"],render:()=>m8().identity.value?.email??null},"axon:ext/loaded":{on:["tui:reloaded"],render:()=>aq().sources.value.length},"axon:ext/degraded":{icon:"warning",on:["tui:reloaded"],render:()=>{let e=aq().problems.value.length;return e>0?`${e} config errors`:null}},"axon:process/cwd":{icon:"folder",render:()=>process.env.PWD??process.cwd()},"axon:process/pid":{render:()=>process.pid},"axon:git/branch":{icon:"branch",every:5000,on:["agent:focused"],render:()=>{return tje().refresh(),tje().state.value.branch}},"axon:git/dirty":{icon:"changes",every:5000,render:()=>{let{dirty:e}=tje().state.value;return e>0?`${e}`:null}},"axon:git/ahead":{icon:"ahead",every:5000,render:()=>{let{ahead:e}=tje().state.value;return e>0?`${e}`:null}},"axon:git/behind":{icon:"behind",every:5000,render:()=>{let{behind:e}=tje().state.value;return e>0?`${e}`:null}},"axon:agent/status":{on:["agent:ready","agent:focused","message:sent","message:received"],render:()=>$c().activity.value},"axon:agent/error":{icon:"error",on:["agent:ready","agent:stopped","message:received"],render:()=>{let e=$c().error.value;if(!e)return null;return(e instanceof Error?e.message:String(e)).split(`
4938
4938
  `)[0].slice(0,40)}},"axon:mode":{on:["mode:changed"],render:()=>{try{return oB().mode.symbol.value}catch{return null}}},"axon:keys":{on:["key:pressed"],every:250,render:()=>{let e=Oua();return e.length>0?e.join(""):null}},"axon:clock":{icon:"clock",every:1000,render:()=>{let e=new Date,n=(A)=>String(A).padStart(2,"0");return`${n(e.getHours())}:${n(e.getMinutes())}:${n(e.getSeconds())}`}}}});var MKn;var Zua=dt(()=>{MKn={"axon:space":{left:[]},"axon:status":{left:[["axon:agent/name"],["axon:agent/model"]],right:[["axon:agent/status"],["axon:session/tokens"]]},"axon:git":{left:[["axon:git/branch"]],right:[["axon:git/dirty"],["axon:git/ahead","axon:git/behind"]]},"axon:context":{left:[["axon:process/cwd"]],right:[["axon:agents/active"],["axon:clock"]]},"axon:dev":{left:[["axon:mode"],["axon:agent/name"],["axon:agent/status"]],right:[["axon:git/branch","axon:git/dirty"],["axon:session/tokens"],["axon:clock"]]}}});function Xua(){if(Vua)return;Vua=!0;let e=Dz();for(let[n,A]of Object.entries(GKn))e.createComponent(n,A);for(let[n,A]of Object.entries(MKn))e.createLine(n,A)}function ela(){return{components:Object.keys(GKn),lines:Object.keys(MKn)}}var Vua=!1;var LKn=dt(()=>{JYe();Wua();Zua()});function tla(e){return typeof e==="string"?e.split(" ").filter(Boolean):[...e]}function Ala(e,n){if(Array.isArray(e.children))return e.children;return n?e.children():[]}function nla(e,n){let A=n,i=null;for(let s of e){let u=A.find((g)=>g.label.toLowerCase()===s.toLowerCase());if(!u)return null;i=u,A=u.kind==="group"?Ala(u,!0):[]}return i}function WQt(e){return{id:e.sessionId,name:e.name,focused:e.focused,activity:e.activity}}function ala(e){let{track:n}=e,A=q7(),i=tL(),s=SE();function u(te){let ie=te[te.length-1],ae=typeof ie==="object"&&ie!==null&&!Array.isArray(ie)&&"ms"in ie&&typeof ie.ms==="number",xe=(ae?te.slice(0,-1):te).map((Re)=>{if(typeof Re==="string")return Re;if(Re===null||Re===void 0)return String(Re);if(typeof Re==="object")try{return JSON.stringify(Re)}catch{return String(Re)}return String(Re)}).join(" ");return ae?{message:xe,ms:ie.ms}:{message:xe}}function g(te){return n(te),te}let d={register(te,ie){let ae=tla(te);if(ae.length===0)throw oA("COMMAND_INVALID",{detail:"a command needs a path"});if(nla(ae,PQt))throw oA("COMMAND_PATH_TAKEN",{detail:`${ae.join(" ")} is a built-in command`,context:{path:ae}});let Be=typeof ie==="function"?{run:ie}:ie;if(typeof Be?.run!=="function")throw oA("COMMAND_INVALID",{detail:`${ae.join(" ")} needs a run() \u2014 commands.register(path, fn) or commands.register(path, { run })`,context:{path:ae}});return g(w2.command({path:ae,action:Be.run,...Be.description?{description:Be.description}:{},...Be.workingMessage?{workingMessage:Be.workingMessage}:{}}))},async run(te){let ie=tla(te),ae=nla(ie,f());if(!ae||ae.kind!=="action")throw oA("COMMAND_NOT_FOUND",{detail:ie.join(" "),context:{path:ie}});await VYe(ie,"api",ae.action)(new AbortController().signal)},list(){let te=[],ie=(ae,Be)=>{for(let xe of ae){let Re=[...Be,xe.label];if(xe.kind!=="group"){te.push(Re);continue}let Oe=Ala(xe,!1);if(Oe.length===0)te.push(Re);else ie(Oe,Re)}};return ie(f(),[]),te}};function f(){return[...PQt,...LGt.value]}let B={register(te,ie){if(DKn(te))throw oA("KEY_CHORD_TAKEN",{detail:`${te} belongs to the terminal`,context:{chord:te}});return g(w2.key(XGt(te),ie))},send(te){let ie=XGt(te),ae=w2.keyHandler(ie);if(ae){ae();return}let Be=w2.paletteForKey(ie);if(Be){oB().mode.setMode(Be.name);return}let xe=aae[te]??aae[ie];if(xe){oB().mode.setMode(xe);return}throw oA("KEY_CHORD_UNBOUND",{detail:te,context:{chord:te}})}},E={async set(te){let ie=Object.values(aae).includes(te)||te==="normal",ae=w2.paletteFor(te)!==null;if(!ie&&!ae)throw oA("MODE_UNKNOWN",{detail:te,context:{mode:te}});oB().mode.setMode(te)},get(){return oB().mode.mode.value},symbol(){return oB().mode.symbol.value}},Q={get:()=>oB().text.value,set:(te)=>{oB().text.value=te},append:(te)=>{oB().text.value+=te},clear:()=>{oB().text.value=""},async submit(){oB().onEnter()}};function w(){let te=$c().sessionId.value;if(!te)throw oA("NO_FOCUSED_AGENT");return te}let S={async targets(){let te=$c();return te.available.value.map((ie)=>({name:ie.name,kind:ie.kind,instances:te.instances.value.filter((ae)=>ae.name===ie.name).map(WQt)}))},list:()=>$c().instances.value.map(WQt),get(te){let ie=$c().instances.value.find((ae)=>ae.sessionId===te);return ie?WQt(ie):null},focused(){let te=$c().instances.value.find((ie)=>ie.focused);return te?WQt(te):null},async spawn(te){let ie=$c(),ae=await ie.spawn(te,{focus:!1});if(!ae)throw oA("AGENT_SPAWN_NO_INSTANCE",{detail:te,context:{name:te}});let Be=ie.instances.value.find((xe)=>xe.sessionId===ae);if(!Be)throw oA("AGENT_SPAWN_NO_INSTANCE",{detail:te,context:{name:te}});return WQt(Be)},focus(te){if(!S.get(te))throw oA("INSTANCE_NOT_RUNNING",{detail:te,context:{id:te}});$c().focus(te)},async stop(te){let ie=te??w();if(!S.get(ie))throw oA("INSTANCE_NOT_RUNNING",{detail:ie,context:{id:ie}});await $c().stop(ie)},async reboot(te){let ie=$c(),ae=te??w();if(!S.get(ae))throw oA("INSTANCE_NOT_RUNNING",{detail:ae,context:{id:ae}});if(ae!==ie.sessionId.value)ie.focus(ae);await ie.reboot()},async send(te){w(),await $c().send(te)},interrupt:()=>$c().interrupt()},G={create(te,ie){if(ie.key&&DKn(ie.key))throw oA("MODE_KEY_TAKEN",{detail:`${ie.key} belongs to the terminal`,context:{key:ie.key,name:te}});let ae=g(w2.palette(te,ie));return{get name(){return te},open:()=>G.open(te),refresh(){let Be=w2.paletteFor(te);if(Be)Be.cache=null},dispose:ae}},get(te){let ie=w2.paletteFor(te);if(!ie)return null;return{get name(){return te},open:()=>G.open(te),refresh(){ie.cache=null},dispose:()=>{}}},async open(te){if(!w2.paletteFor(te))throw oA("PALETTE_NOT_FOUND",{detail:te,context:{name:te}});if(G.isOpen)throw oA("PALETTE_ALREADY_OPEN",{detail:te,context:{name:te}});oB().mode.setMode(te)},close(){oB().mode.setMode("normal")},get isOpen(){return GQt(oB().mode.mode.value)},pick:(te,ie)=>i.pick(te,ie),confirm:(te)=>i.confirm(te),prompt:(te,ie)=>i.prompt(te,ie)},q={async nav(te){await $c().select(te)},hook(te,ie){return g(A.register(te,ie))},info(...te){let{message:ie,ms:ae}=u(te);ED().show(ie,"info",ae)},warn(...te){let{message:ie,ms:ae}=u(te);ED().show(ie,"warn",ae)},error(...te){let{message:ie,ms:ae}=u(te);ED().show(ie,"error",ae)},get size(){let te=lI();return{width:te.width.value,height:te.height.value}},get cwd(){return process.env.PWD??process.cwd()},get version(){return bUe.version},async exit(){await A.gate("tui:shutdown",{}),process.exit(0)}},P=Dz();return Xua(),{tui:q,palette:G,commands:d,keys:B,mode:E,input:Q,agents:S,theme:{create(te,ie){return g(s.create({name:te,...ie}))},set(te){s.set(te)},list:()=>s.themes.value,get active(){return s.active.value}},lines:{create(te,ie){return P.createLine(te,ie,n)},set:(te)=>P.setStack(te),top:(te,ie)=>te===void 0?P.top():P.setTop(te,ie),style:(te)=>P.style(te),move:(te,ie)=>P.move(te,ie),hide:(te)=>P.hide(te),show:(te)=>P.show(te),toggle:(te)=>P.toggle(te),list:()=>P.list()},components:{create(te,ie){return g(P.createComponent(te,ie))},list:()=>P.listComponents()}}}var ila=dt(()=>{Ks();ps();kGt();iD();iq();wUe();sKn();QUe();xKn();zye();cKn();DUe();vUe();A9();JYe();LKn()});var UKn={};Ta(UKn,{useExtensions:()=>aq});function aq(){if(!qKn)qKn=n$r();return qKn}async function t$r(){let{useQuestions:e}=await Promise.resolve().then(() => (DUe(),dca)),{useInput:n}=await Promise.resolve().then(() => (iq(),Hua));e().cancel();let A=n();if(A.mode.mode.value!=="normal")A.text.value="",A.mode.setMode("normal")}function n$r(){let e=PB(),n=q7(),A=Dz(),i=ala({track:(g)=>e.extensions.disposers.track(g)});async function s(){try{let g=e.store.profiles.active();if(!g)return;let d=await e.projects.open(g.root),f=e.extensions.sources.map((B)=>B.root);d.generate.registry(f,ela())}catch{}}function u(){let g=globalThis;g.tui=i.tui,g.palette=i.palette,g.commands=i.commands,g.keys=i.keys,g.mode=i.mode,g.input=i.input,g.agents=i.agents,g.theme=i.theme,g.lines=i.lines,g.components=i.components}return{errors:ha.computed(()=>nje.value),fileErrors:ha.computed(()=>e.extensions.sources.flatMap((g)=>g.files.filter((d)=>d.error!==null).map((d)=>({source:g.label,path:d.path,error:d.error})))),problems:ha.computed(()=>{_Ce.value;let g=e.extensions.sources.flatMap((f)=>f.files.filter((B)=>B.error!==null).map((B)=>({label:B.path.split("/").slice(-2).join("/"),error:B.error}))),d=A.faults.value.map((f)=>({label:"lines",error:f}));return[...nje.value.map((f)=>({label:"profile.config.ts",error:f})),...g,...d]}),loaded:ha.computed(()=>_Ce.value),sources:ha.computed(()=>e.extensions.sources),list(){return e.extensions.list()},declared:ha.computed(()=>{return _Ce.value,tMt.value,[...e.extensions.declared]}),async install(g){try{return await e.extensions.install(g)}finally{tMt.value++}},async uninstall(g){try{return await e.extensions.uninstall(g)}finally{tMt.value++}},updates(){return e.extensions.updates()},async update(g,d){try{return await e.extensions.update(g,d)}finally{tMt.value++}},async load(g){let d=_Ce.value;if(u(),_Ce.value)await t$r();if(_Ce.value)A.reset();let f=[];if(g?.prepare!==!1)try{await e.profile.ensure()}catch(G){f.push(G)}let B=_Ce.value?await e.extensions.reload():await e.extensions.load();f.push(...B.errors),nje.value=f,_Ce.value=!0,s(),await e.refreshSettings();let{useSettings:E}=await Promise.resolve().then(() => (vQt(),vTn)),Q=E();await Q.refresh();let{useTheme:w}=await Promise.resolve().then(() => (A9(),GTn));w().adopt(Q.settings.value.theme),A.icons(Q.settings.value.icons??"auto");let S=await n.gate("tui:boot",{});if(S.length>0)nje.value=[...nje.value,...S];if(d)n.notify("tui:reloaded",{})},async reload(g){await this.load({prepare:g?.prepare??!1})},watch(){if(Aje)return;Aje=e.extensions.watch(async()=>{await this.reload();let g=this.problems.value.length;if(g>0)ED().show(`config reloaded \u2014 ${g} problem${g===1?"":"s"}`,"error")})},unwatch(){Aje?.(),Aje=null},async logout(){Aje?.(),Aje=null,e.extensions.unload(),_Ce.value=!1,nje.value=[],A.reset();let{useTheme:g}=await Promise.resolve().then(() => (A9(),GTn));g().reset()},hooks:n}}var nje,_Ce,tMt,Aje=null,qKn;var Wye=dt(()=>{Ks();n9();ila();zye();JYe();LKn();vUe();nje=ha.ref([]),_Ce=ha.ref(!1),tMt=ha.ref(0)});import{readFileSync as A$r,existsSync as a$r}from"fs";import{basename as nMt,join as i$r,resolve as r$r}from"path";function VQt(){return{events:[],kernelEvents:[],entries:[],processes:[]}}function u$r(e){let n=e?.context;return typeof n?.sessionFile==="string"?n.sessionFile:null}function TKn(e){if(!a$r(e))return[];let n=A$r(e,"utf-8").trim();if(n.length===0)return[];return n.split(`
4939
- `).map((A)=>JSON.parse(A))}function l$r(e){if(e==="process:attach"||e==="process:detach")return!1;return e.startsWith("kernel:")||e.startsWith("cognet:")||e.startsWith("process:")||e.startsWith("capsule:")}function g$r(e){let n=[],A=[],i=[];for(let s of TKn(e))if(WEe.some((u)=>s.type.startsWith(u)))A.push(s);else if(l$r(s.type))i.push(s);else n.push(s);return{events:n,entries:A,kernelEvents:i,processes:[]}}function rla(e){let n=e.lastIndexOf("@");return n>0?{name:e.slice(0,n),version:e.slice(n+1)}:{name:e,version:""}}function p$r(e){return r$r(e.paths.root,e.paths.data)}async function m$r(e){let n=u$r(e);if(!n)return[];for(let A=0;A<10;A++){let i=TKn(n);if(i.some((s)=>s.type.endsWith(":error")||s.type.endsWith(":failed")))return i;await new Promise((s)=>setTimeout(s,30))}return TKn(n)}function aje(e){return e.source.kind==="remote"?e.source.target.name:e.source.project.name}function ola(e){if(!e||e.source.kind==="remote")return;return e.source.agent.engines}function d$r(e){return e.source.kind==="remote"?{kind:"remote",instance:e,axon:e.source.agent}:{kind:"local",instance:e}}function f$r(e){let n=e.instance,A=ha.shallowRef(VQt()),i=ha.ref("live"),s=ha.ref([]),u=ha.ref(0),g=ha.ref([]),d=ha.ref(!1),f=null,B=0,E=0,Q=0;function w(){if(e.kind==="local"){let ae=e.instance.source.kind!=="remote"?e.instance.source.agent:null;if(!ae)throw Error("local cell without an agent");let Be=ae;return{log:Be.session.log,kernelLog:Be.session.kernelLog,entries:Be.session.entries,processes:_Qt(Be.session.kernelLog)}}let ie=e.axon.session;return{log:ie.log,kernelLog:ie.kernelLog,entries:ie.entries,processes:_Qt(ie.kernelLog)}}function S(){let ie=w();B=ie.log.length,E=ie.kernelLog.length,Q=ie.entries.length,A.value={events:[...ie.log],kernelEvents:[...ie.kernelLog],entries:[...ie.entries],processes:ie.processes}}S();function G(ie){let ae=w();if(ie.startsWith("process:")||ie.startsWith("capsule:"))A.value={...A.value,processes:ae.processes};let Be=ae.entries.slice(Q);if(Q=ae.entries.length,Be.length>0)A.value.entries.push(...Be);let xe=ae.kernelLog.slice(E);if(E=ae.kernelLog.length,xe.length>0)A.value.kernelEvents.push(...xe);let Re=ae.log.slice(B);if(B=ae.log.length,Re.length>0)A.value.events.push(...Re);if(Be.length>0||xe.length>0||Re.length>0)A.value={...A.value}}let q=e.kind==="local"?(()=>{let ie=n.source.kind!=="remote"?n.source.agent:null;if(!ie)throw Error("local cell without an agent");return ie.bus.onAny((ae)=>G(ae))})():(()=>{let ie=0,ae=!1,Be=null,xe=null,Re=()=>{if(ae)return;Be=e.axon.session.subscribe({onEvent:(Ne)=>{if(ie!==0)ie=0,i.value="live";G(Ne.type)},onLive:()=>{ie=0,i.value="live"},onReset:()=>{S()},onClose:()=>{i.value="closed"},onError:()=>{if(ae)return;i.value="reconnecting",Oe()}})},Oe=()=>{if(ae)return;if(ie+=1,ie>c$r){i.value="lost";return}let Ne=Math.min(o$r*2**(ie-1),s$r);xe=setTimeout(Re,Ne)};return Re(),()=>{if(ae=!0,xe)clearTimeout(xe);Be?.()}})();async function P(ie){if(e.kind==="local"&&n.source.kind==="linked"){let Re=n.source.agent;d.value=!1;let Oe={interrupt:()=>Re.link.interrupt("user")};f=Oe;try{if((await Re.link.request({type:"cognet:stimulus:text",data:{content:ie,channel:"terminal"}})).interrupted)d.value=!0}finally{if(f===Oe)f=null}return}let ae=e.kind==="local"?null:e.axon;if(!ae)throw Error("cell has no invocation target");let Be=ae.stream({prompt:ie,channel:"terminal"}),{stream:xe}=Be;f=Be,d.value=!1;try{for await(let Re of xe);}finally{if(f===Be)f=null}}async function V(){while(s.value.length>0){let ie=s.value;s.value=[];try{await P(ie)}catch{}}}async function W(ie){if(u.value>0){s.value=[...s.value,ie];return}u.value++;let ae=Date.now();try{try{await P(ie)}finally{await V()}if(!d.value){let Be=w().entries.at(-1)?.time.seq;if(Be!==void 0)g.value=[...g.value.filter((xe)=>xe.afterSeq!==Be),{afterSeq:Be,durationMs:Date.now()-ae}]}}finally{u.value--}}function z(){let ie=f;if(!ie)return!1;return s.value=[],d.value=!0,ie.interrupt(),!0}let te=ha.computed(()=>{if(i.value==="reconnecting")return"reconnecting";if(i.value==="closed"||i.value==="lost")return"disconnected";if(A.value.events.findLast((ae)=>ae.type.startsWith("axon:reload:"))?.type==="axon:reload:start")return"rebooting";if(u.value===0||d.value)return null;return"working"});return{instance:n,session:A,activity:te,queued:ha.computed(()=>s.value),busy:ha.computed(()=>u.value>0),turnTimings:ha.computed(()=>g.value),send:W,interrupt:z,snapshot:S,promptNames(){if(e.kind!=="local"||n.source.kind==="remote")return[];let ie=n.source.agent;return[]},async renderPrompt(ie){if(e.kind!=="local"||n.source.kind==="remote")throw oA("NOT_WIRED",{detail:"prompt rendering is not available on a deployed agent"});return await n.source.agent.link.prompts({action:"get",name:ie})},async renderPromptEntry(ie){if(e.kind!=="local"||n.source.kind==="remote")throw oA("NOT_WIRED",{detail:"prompt rendering is not available on a deployed agent"});return await n.source.agent.link.prompts({action:"render",entry:ie})},get connection(){return i.value},dispose(){q()}}}function h$r(e,n,A){let i=ha.ref("idle"),s=ha.ref(null),u=!1,g=ha.ref(0);function d(){g.value++}let f=new Map;function B(Ri){return f.get(Ri)??null}function E(Ri){let Ra=f.get(Ri.sessionId);if(Ra)return Ra;let va=f$r(d$r(Ri));return f.set(Ri.sessionId,va),d(),va}function Q(Ri){let Ra=f.get(Ri);if(!Ra)return;Ra.dispose(),f.delete(Ri),d()}let w=300000,S=new Map,G=new Map,q=ha.ref(0),P=new Set;function V(){let Ri=Date.now()-w;for(let[Ra,va]of S)if(va.at<=Ri)S.delete(Ra)}e.onSpawn((Ri)=>{if(G.set(Ri.sessionId,{sessionId:Ri.sessionId,parentSessionId:Ri.parentSessionId,rootSessionId:Ri.rootSessionId,depth:Ri.depth,name:aje(Ri)}),S.delete(Ri.sessionId))q.value++;E(Ri)}),e.onStop((Ri)=>{if(u)return;let Ra=G.get(Ri);if(Ra){let va=Date.now();S.set(Ri,{view:{...Ra,focused:!1,activity:null,exitedAt:va},at:va}),q.value++,P.add(setTimeout(()=>{q.value++},w+1000))}Q(Ri)});function W(){g.value;let Ri=e.focused;return Ri?f.get(Ri.sessionId)??null:null}let z=ha.ref([]),te=ha.computed(()=>{return g.value,e.active}),ie=ha.computed(()=>{g.value;let Ri=n.profiles.active(),Ra=Ri?Ri.agents.list().map((cn)=>({kind:"local",dir:nMt(cn.root),name:cn.name})):[],va=A.deployments.list().map((cn)=>({kind:"deployed",name:cn.name,deploymentId:cn.deploymentId,tier:cn.tier,warmth:cn.warmth}));return[...Ra,...va]});async function ae(){await A.deployments.refresh(),d()}let Be=ha.computed(()=>{return g.value,A.deployments.error});async function xe(Ri){let Ra=A.deployments.list().find((va)=>va.deploymentId===Ri);if(!Ra)throw oA("DEPLOYMENT_NOT_CONNECTABLE",{context:{deploymentId:Ri}});i.value="booting",$e.value=Ra.name,it.value=null,s.value=null,z.value=[];try{let va=await e.attach({url:Ra.url,name:Ra.name,agentId:Ra.agentId,deploymentId:Ra.deploymentId,tier:Ra.tier});E(va),i.value="idle",z.value=[],$e.value=null,zA()}catch(va){throw i.value="error",s.value=va instanceof Error?va:Error(String(va)),va}finally{d()}}async function Re(Ri){let Ra=Ri.trim();if(Ra==="")throw oA("ATTACH_URL_REQUIRED");i.value="booting",$e.value=Ra,it.value=null,s.value=null,z.value=[];try{let va=await e.attach({url:Ra,name:""});E(va),i.value="idle",z.value=[],$e.value=null,zA()}catch(va){throw i.value="error",s.value=va instanceof Error?va:Error(String(va)),va}finally{d()}}function Oe(){d()}let Ne=ha.computed(()=>{g.value;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote")return Ri.source.target.name;return e.project?.name??null}),$e=ha.ref(null),it=ha.ref(null),Me=ha.ref(null),bt=ha.ref(null),Rt=Vsa(),mt=ha.computed(()=>Ne.value??$e.value),Xt=ha.computed(()=>$e.value!==null),Ln=ha.computed(()=>{if(g.value,Xt.value)return null;return e.focused?.sessionId??null}),Ft=ha.computed(()=>{g.value;let Ri=e.blueprint,Ra=Ln.value;if(!Ri||!Ra)return null;return i$r(p$r(Ri),"sessions",`${Ra}.jsonl`)}),nn=ha.computed(()=>{if(g.value,Xt.value)return it.value;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote")return Ri.source.target.url;return e.project?.root??null}),$n=ha.computed(()=>{return g.value,oca(nn.value,n.profiles.active()?.agents.root??null)}),Ht=ha.computed(()=>{if(g.value,!Xt.value&&!it.value)return null;let Ri=it.value;if(!Ri)return null;return n.state.get()?.agentManifests?.[nMt(Ri)]??null}),tA=ha.computed(()=>{if(g.value,Xt.value){let us=it.value;if(!us)return null;return n.state.get()?.agentModels?.[nMt(us)]??null}let Ri=e.focused;if(Ri&&Ri.source.kind==="remote"){let us=Ri.source.target.engine;if(!us)return null;return MGt({provider:us.provider,declared:us.model,resolved:null})}let Ra=ola(e.focused),va=Ra?.primary;if(Ra&&va&&Ra.has(va)){let us=Ra.get(va).binding.capability;return MGt({provider:us.provider,declared:us.id,resolved:null})}let cn=NAe(e.blueprint?.config.model);if(cn)return MGt({provider:cn.provider??"axon",declared:cn.model,resolved:jt.value});return null}),JA=Aca(),un=ha.computed(()=>{if(g.value,Xt.value)return null;return JA.step(nca(Te.value.kernelEvents,Te.value.entries))}),mA=ha.computed(()=>{g.value,q.value,V();let Ri=e.focused?.sessionId??null,Ra=e.list().map((us)=>({sessionId:us.sessionId,parentSessionId:us.parentSessionId,rootSessionId:us.rootSessionId,depth:us.depth,name:aje(us),focused:us.sessionId===Ri,activity:B(us.sessionId)?.activity.value??null,exitedAt:null}));if(S.size===0)return Ra;let va=new Map;for(let us of Ra)va.set(us.sessionId,us);for(let[us,pc]of S)va.set(us,pc.view);let cn=[];for(let us of G.keys()){let pc=va.get(us);if(pc)cn.push(pc),va.delete(us)}return[...cn,...va.values()]}),cA=ha.computed(()=>{g.value;let Ri=e.focused?.sessionId??null,Ra=new Map;for(let va of e.recent()){let cn=aje(va),us={sessionId:va.sessionId,parentSessionId:va.parentSessionId,rootSessionId:va.rootSessionId,depth:va.depth,name:cn,focused:va.sessionId===Ri,activity:B(va.sessionId)?.activity.value??null,exitedAt:null},pc=Ra.get(cn);if(pc)pc.push(us);else Ra.set(cn,[us])}return Ra}),vn=ha.computed(()=>{return g.value,e.sessions()}),Tn=ha.ref(null),Cn=new Map,ja={id:ha.computed(()=>Tn.value),show(Ri){if(!Cn.has(Ri.sessionId))Cn.set(Ri.sessionId,g$r(Ri.filePath));Tn.value=Ri.sessionId},clear(){Tn.value=null,Cn.clear()}},Te=ha.computed(()=>{if(Tn.value!==null)return Cn.get(Tn.value)??VQt();if(z.value.length>0)return{...VQt(),events:z.value};if(Xt.value)return VQt();return W()?.session.value??VQt()}),Nn=ha.ref(null),jt=ha.computed(()=>{if(g.value,Xt.value)return null;return Xsa(Te.value.kernelEvents)??Nn.value}),rA=ha.computed(()=>{if(g.value,Xt.value)return null;let Ri=jt.value;if(Ri)return Ri;let Ra=NAe(e.blueprint?.config.model)?.model??null;return Ra==="auto"?null:Ra});async function fA(){let Ri=eca(e.blueprint?.config.model);if(!Ri){Nn.value=null;return}try{let Ra=await A.cloud.cloud.engine.resolve(Ri);Nn.value=Ra.model}catch{Nn.value=null}}let gn=ha.ref([]);async function zA(){let Ri=W();if(!Ri)return;while(gn.value.length>0&&W()===Ri){let[Ra,...va]=gn.value;gn.value=va;try{await Ri.send(Ra)}catch{}}}async function la(Ri,Ra){let va=n.profiles.active(),cn=typeof Ri==="string"&&va?va.agents.find(Ri):[],us=typeof Ri==="string"?cn.length===1?cn[0]:null:Ri,pc=typeof Ri==="string"?us?.name??Ri:Ri.name,Pr=us?.root??null,Xl=Rt.claim();i.value="booting",$e.value=pc,it.value=Pr,Me.value=null,bt.value=null,s.value=null,z.value=[];try{let im=await e.spawn(Ri,{...Ra,focus:Ra?.focus===!1?!1:Xl.latest,onProgress:(Bp)=>{if(Xl.latest)Me.value=Bp},onTiming:(Bp)=>{if(Xl.latest&&Bp.unit==="modules")bt.value=Bp.durationMs}});if(E(im),!Xl.latest)return d(),im.sessionId;i.value="idle",z.value=[];try{if(im.source.kind==="local"){let Bp=nMt(im.source.project.root),Rd=tA.value,yC={...Rd?{model:Rd}:{},modules:Ti.value.length,tools:Io.value?.tools??0,...Ln.value?{sessionId:Ln.value}:{},...un.value!==null?{context:un.value}:{}};n.state.update((gB)=>({...gB,lastAgent:Bp,...Rd?{agentModels:{...gB.agentModels,[Bp]:Rd}}:{},agentManifests:{...gB.agentManifests,[Bp]:yC}}))}}catch{}return $e.value=null,it.value=null,Me.value=null,fA(),zA(),im.sessionId}catch(im){if(!Xl.latest)throw im;throw i.value="error",s.value=im instanceof Error?im:Error(String(im)),z.value=await m$r(im),im}finally{d()}}async function $a(Ri){i.value="booting";let Ra=e.focused;if(Ra)await _t(Ra.sessionId);await la(Ri)}async function ei(Ri,Ra){if(e.get(Ra)){GA(Ra);return}await la(Ri,{session:Ra})}async function Oi(){let Ri=e.focused;if(!Ri)throw oA("NO_ACTIVE_AGENT");if(Ri.source.kind==="remote")throw oA("CLEAR_IMMUTABLE_DEPLOYED",{detail:`${aje(Ri)} is a deployment \u2014 it owns its session in the cloud, so there is no fresh one to start from the TUI`,context:{name:aje(Ri)}});let Ra=Ri.source.project;await _t(Ri.sessionId),await la(Ra)}async function zi(Ri){await la(Ri)}async function Ei(){let Ri=e.focused;if(!Ri)return;await _t(Ri.sessionId)}function GA(Ri){e.focus(Ri),JA.reset(),d(),zA()}async function _t(Ri){try{await e.stop(Ri)}finally{Q(Ri),d()}}async function tt(Ri){let Ra=e.focused;if(!Ra)throw oA("NO_ACTIVE_AGENT");if(Ra.source.kind==="remote")throw oA("MODEL_IMMUTABLE_DEPLOYED",{detail:`${aje(Ra)} is a deployment \u2014 its model is set at deploy time, not from the TUI`,context:{sessionId:Ra.sessionId}});let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE");let us=Date.now(),pc=Ri;await cn?.commit("axon:model:start",{name:pc});try{let Pr=await va.model.set(Ri);await cn?.commit("axon:model:complete",{name:pc,durationMs:Date.now()-us,changed:Pr.changed,dropped:[]});{let Xl=ola(e.focused);if(Xl){if(!Xl.select(Ri))throw oA("MODEL_UNAVAILABLE",{detail:`no declared provider supplies "${Ri}" \u2014 the choice was saved but the running agent still uses its previous model`,context:{model:Ri}})}}return d(),fA(),Pr}catch(Pr){let Xl=oA(Pr);throw await cn?.commit("axon:model:failed",{name:pc,error:Xl,durationMs:Date.now()-us}),Xl}}async function Ot(Ri){let Ra=e.focused;if(!Ra)throw oA("NO_ACTIVE_AGENT");if(Ra.source.kind==="remote")return{changed:!1};let va=e.project;if(!va)throw oA("NO_FOCUSED_INSTANCE");return{changed:!1}}let Xn=ha.computed(()=>{return g.value,e.blueprint?.config.model??null});async function hn(){u=!0,i.value="shutting-down";for(let Ri of f.values())Ri.dispose();for(let Ri of P)clearTimeout(Ri);P.clear();try{await e.shutdown()}catch(Ri){throw Ri}}async function RA(){let Ri=Ft.value;if(!Ri)throw oA("NO_SESSION_TO_OPEN");let Ra=await e.history.fork(Ri);return d(),Ra}async function ea(Ri){let Ra=Ft.value;if(!Ra)throw oA("NO_SESSION_TO_OPEN");await e.history.rename(Ra,Ri),d()}async function Wi(){await e.current?.reload(),d(),W()?.snapshot(),fA()}let Ti=ha.computed(()=>{return g.value,e.blueprint?.modules??[]}),Io=ha.computed(()=>{if(g.value,Xt.value)return null;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote"){let va=Ri.source.target.loaded;return va?{...va,durationMs:null}:null}let Ra=e.blueprint;if(!Ra)return null;return{modules:Ra.modules?.length??0,tools:Ra.tools?.length??0,durationMs:bt.value}});async function Xo(Ri){let Ra=e.session,va=Date.now();await Ra?.commit("axon:install:start",{name:Ri,artifact:"extension"});try{let{useExtensions:cn}=await Promise.resolve().then(() => (Wye(),UKn)),us=await cn().install(Ri),{name:pc,version:Pr}=rla(us.ref);return await Ra?.commit("axon:install:complete",{name:pc,version:Pr,durationMs:Date.now()-va,alreadyInstalled:!us.declared,artifact:"extension"}),d(),{root:us.root,ref:us.ref}}catch(cn){let us=cn instanceof Error&&"isAxonError"in cn?cn:oA("EXTENSION_INSTALL_FAILED",{detail:String(cn),context:{source:Ri}});throw await Ra?.commit("axon:install:failed",{name:Ri,error:us,durationMs:Date.now()-va,artifact:"extension"}),us}}async function eu(Ri){let Ra=e.session,va=Date.now(),{name:cn}=rla(Ri);await Ra?.commit("axon:uninstall:start",{name:cn,artifact:"extension"});try{let{useExtensions:us}=await Promise.resolve().then(() => (Wye(),UKn)),pc=await us().uninstall(Ri);return await Ra?.commit("axon:uninstall:complete",{name:cn,durationMs:Date.now()-va,artifact:"extension"}),d(),pc}catch(us){let pc=us instanceof Error&&"isAxonError"in us?us:oA("EXTENSION_UNINSTALL_FAILED",{detail:String(us),context:{source:Ri}});throw await Ra?.commit("axon:uninstall:failed",{name:cn,error:pc,durationMs:Date.now()-va,artifact:"extension"}),pc}}async function hc(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{specifier:Ri}});let cn=Date.now();await va?.commit("axon:install:start",{name:Ri});try{let[us]=await Ra.modules.install([Ri]);if(!us)throw oA("MODULE_INSTALL_FAILED",{detail:"installer returned no result",context:{specifier:Ri}});if(us.status==="error")throw oA("MODULE_INSTALL_FAILED",{detail:us.error,context:{name:us.name}});if(us.status==="not-found")return await va?.commit("axon:install:not-found",{name:Ri,durationMs:Date.now()-cn}),us;let pc=us.status==="already-installed";if(await va?.commit("axon:install:complete",{name:us.name,version:us.version,durationMs:Date.now()-cn,alreadyInstalled:pc}),!pc)await Wi();return us}catch(us){let pc=oA(us);throw await va?.commit("axon:install:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),pc}}let Al=ha.computed(()=>{return g.value,e.project?.root??null});async function So(){let Ri=e.project;if(!Ri)return[];return Ri.modules.updates()}async function Th(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{names:Ri.map((pc)=>pc.name)}});if(Ri.length===0)return[];let cn=Date.now(),us=Ri.map((pc)=>pc.name);await va?.commit("axon:update:start",{names:us,artifact:"module"});try{let pc=await Ra.modules.update(Ri),Pr=pc.filter((im)=>im.status==="installed"),Xl=pc.filter((im)=>im.status==="error"||im.status==="not-found");if(await va?.commit("axon:update:complete",{names:us,artifact:"module",updated:Pr.map((im)=>({name:im.name,version:im.version})),failed:Xl.map((im)=>({name:im.name,error:im.status==="error"?im.error:"not in the registry"})),durationMs:Date.now()-cn}),Pr.length>0)await Wi();return pc}catch(pc){let Pr=oA(pc);throw await va?.commit("axon:update:failed",{names:us,artifact:"module",error:Pr,durationMs:Date.now()-cn}),Pr}}async function gi(){let Ri=e.project;if(!Ri)return[];return Ri.env.keys()}async function ui(Ri,Ra){let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE",{context:{key:Ri}});let us=Date.now();await cn?.commit("axon:env:set:start",{key:Ri});try{await va.env.set(Ri,Ra),await cn?.commit("axon:env:set:complete",{key:Ri,durationMs:Date.now()-us}),await Wi()}catch(pc){let Pr=oA(pc);throw await cn?.commit("axon:env:set:failed",{key:Ri,error:Pr,durationMs:Date.now()-us}),Pr}}async function Ro(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{key:Ri}});let cn=Date.now();await va?.commit("axon:env:set:start",{key:Ri});try{await Ra.env.unset(Ri),await va?.commit("axon:env:set:complete",{key:Ri,durationMs:Date.now()-cn}),await Wi()}catch(us){let pc=oA(us);throw await va?.commit("axon:env:set:failed",{key:Ri,error:pc,durationMs:Date.now()-cn}),pc}}async function $u(){let Ri=e.project;if(!Ri)return null;return Ri.cognet.updates()}async function $A(Ri,Ra){let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE",{context:{name:Ri}});let us=Date.now();await cn?.commit("axon:update:start",{names:[Ri],artifact:"cognet"});try{await va.cognet.update(Ra),await cn?.commit("axon:update:complete",{names:[Ri],artifact:"cognet",updated:[{name:Ri,version:Ra}],failed:[],durationMs:Date.now()-us}),await Wi()}catch(pc){let Pr=oA(pc);throw await cn?.commit("axon:update:failed",{names:[Ri],artifact:"cognet",error:Pr,durationMs:Date.now()-us}),Pr}}async function nr(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{name:Ri}});let cn=Date.now();await va?.commit("axon:uninstall:start",{name:Ri});try{let us=await Ra.modules.uninstall(Ri);if(us.status==="source-declared"){let pc=oA("MODULE_SOURCE_DECLARED",{detail:`"${Ri}" is declared as an import in ${us.path}, not as a registry name \u2014 `+"remove the import and its entry in modules: [...] to uninstall it.",context:{name:Ri,path:us.path}});return await va?.commit("axon:uninstall:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),us}if(await va?.commit("axon:uninstall:complete",{name:Ri,durationMs:Date.now()-cn}),us.status==="removed")await Wi();return us}catch(us){let pc=oA(us);throw await va?.commit("axon:uninstall:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),pc}}async function Mo(Ri){let Ra=Xt.value?null:W();if(!Ra){gn.value=[...gn.value,Ri];return}await Ra.send(Ri)}let xu={list(){return W()?.promptNames()??[]},render(Ri){let Ra=W();if(!Ra)throw oA("NOT_BOOTED",{detail:"no running agent to render a prompt against"});return Ra.renderPrompt(Ri)},async fetch(Ri){let Ra=W();if(!Ra)throw oA("NOT_BOOTED",{detail:"no running agent to render a prompt against"});return Ra.renderPromptEntry(await A.prompts.entry(Ri))}};function zc(){return W()?.interrupt()??!1}async function Ll(Ri,Ra){let va=e.get(Ri);if(!va)throw oA("SESSION_NOT_RUNNING",{context:{sessionId:Ri}});if(va.source.kind==="remote")throw oA("CAPSULE_NOT_LOCAL",{detail:`${Ri} is an attached deployment \u2014 its capsule runs in the cloud, not on this machine`,context:{sessionId:Ri}});let cn=await va.source.agent.link.run(Ra);return{ok:cn.ok,...cn.value!==void 0?{value:cn.value}:{},stdout:cn.stdout,...cn.error?{error:cn.error}:{}}}let Or=ha.computed(()=>Xt.value?[...gn.value]:[...W()?.queued.value??[],...gn.value]),Ou=ha.computed(()=>{if(i.value==="booting")return"booting";if(i.value==="shutting-down")return"shutting-down";return W()?.activity.value??null}),Rc=ha.computed(()=>{return g.value,W()?.connection??"live"}),EE=ha.computed(()=>{return g.value,W()?.turnTimings.value??[]});return{active:te,connection:Rc,turnTimings:EE,available:ie,refreshAvailable:Oe,selected:Ne,displayName:mt,switching:Xt,model:Xn,sessionId:Ln,sessionFile:Ft,forkSession:RA,renameSession:ea,home:nn,homeLabelled:$n,loaded:Io,engineDescriptor:tA,manifest:Ht,context:un,contextModel:rA,resolvedModel:jt,bootStage:ha.computed(()=>Me.value),status:i,activity:Ou,queued:Or,error:s,session:Te,instances:mA,instancesByAgent:cA,sessions:vn,modules:Ti,select:$a,spawn:la,attachDeployment:xe,attachUrl:Re,refreshDeployments:ae,deploymentsError:Be,resume:ei,clear:Oi,spawnSibling:zi,close:Ei,focus:GA,stop:_t,setModel:tt,setThinking:Ot,shutdown:hn,reboot:Wi,send:Mo,interrupt:zc,capsule:Ll,prompts:xu,preview:ja,installModule:hc,installExtension:Xo,uninstallExtension:eu,uninstallModule:nr,projectRoot:Al,moduleUpdates:So,updateModules:Th,cognetUpdate:$u,updateCognet:$A,envKeys:gi,setKey:ui,unsetKey:Ro,async commit(Ri,Ra){let va=e.session;if(!va)return;if(typeof va.commit!=="function")throw oA("NOT_WIRED",{detail:`the focused agent's session has no commit path, so "${Ri}" cannot be recorded`});await va.commit(Ri,Ra)}}}function $c(){if(!ZQt){let e=PB();ZQt=h$r(e.agents,e.store,{deployments:e.deployments,prompts:e.prompts,cloud:e.cloud.client});let n=ZQt;$sa({async focus(A){n.focus(A)},async send(A){await n.send(A)},async interrupt(){n.interrupt()},async capsule(A,i){return n.capsule(A,i)}}),Xie().listen(),ZQt.refreshDeployments()}return ZQt}var o$r=500,s$r=1e4,c$r=10,ZQt;var iD=dt(()=>{cRe();Ks();vE();n9();wGt();ps();kQt();SGt();tca();LTn();sca()});function Qma(e){return{session:e?.session??"normal",kernel:e?.kernel??!1,cognet:e?.cognet??!1}}function cZr(e){if(e.endsWith(":error")||e.endsWith(":failed"))return"error";if(sZr.has(e))return"info";return"debug"}function uZr(e){if(e.type!=="axon:error")return!1;let n=e.data.error;if(!n||typeof n!=="object")return!1;let A=n.context;if(!A||typeof A!=="object")return!1;return typeof A.commandId==="string"}function _ma(e,n){if(uZr(e)&&n.session!=="verbose")return!1;return lZr[n.session].has(cZr(e.type))}function wma(e,n){return n.kernel}function kma(e,n){if(e.type==="axon:system:message"&&e.data.type==="hot-reload")return!1;if(e.type==="axon:system:message"&&e.data.type==="format-violation")return!1;if(e.type==="axon:system:malformed")return!1;if(e.type==="axon:agent:done")return!1;return gZr.has(e.type)}function Dma(e,n){if(!n)return!1;let A=n;return e.some((i)=>{if(i.type!=="axon:error")return!1;let s=i.data.error;if(s===n)return!0;if(!s||typeof s!=="object")return!1;let u=s;if(u.message!==A.message)return!1;return u.code===void 0||A.code===void 0||u.code===A.code})}var sZr,lZr,gZr;var g5n=dt(()=>{sZr=new Set(["axon:reload:start","axon:reload:complete","axon:install:start","axon:install:complete","axon:uninstall:start","axon:uninstall:complete","axon:update:start","axon:update:complete","axon:model:complete","axon:session:restored","compress","build:warning","axon:connect:start","axon:connect:step","axon:connect:complete","axon:connect:interrupted"]);lZr={quiet:new Set(["error"]),normal:new Set(["error","info"]),verbose:new Set(["error","info","debug"])};gZr=new Set(["cognet:stimulus:text","cognet:stimulus:audio","cognet:stimulus:visual","cognet:stimulus:vector","cognet:output:text","cognet:output:audio","cognet:output:visual","cognet:output:vector","cognet:action:typescript","cognet:action:result","axon:interrupt","axon:system:message","subagent:start","subagent:end"])});import{readdir as bZr}from"fs/promises";import{join as BZr}from"path";function h_t(e,n){let A=e.map((s)=>({label:s,state:"waiting"})),i=new Map;return{get current(){return A},move(s,u){let g=performance.now();A=A.map((d)=>{if(d.state==="active"&&d.label!==s){let f=i.get(d.label)??g;return{...d,state:"done",ms:g-f,since:void 0}}if(d.label===s){if(d.state!=="active")i.set(d.label,g);return{...d,state:"active",since:i.get(d.label)??g,...u?{detail:u}:{}}}return d}),n(A)},halt(){let s=performance.now();A=A.map((u)=>u.state==="active"?{...u,state:"failed",ms:s-(i.get(u.label)??s),since:void 0}:u),n(A)},advance(s,u){let g=A.findIndex((d)=>d.label===s);if(g===-1)return;A=A.map((d,f)=>f<g&&d.state==="waiting"?{...d,state:"done"}:d),this.move(s,u)}}}function d8(){return Gma??=OLe({}),Gma}function TMt(){return Mma??=OLe({stream:process.stderr}),Mma}function qma(){return{advance:()=>{},finish:()=>{}}}function KMt(e,n="agent"){if(EC.machine)return{...qma(),fail:()=>{},abandon:()=>{}};let A=d8(),i=h_t(["Scaffolding","Installing"],(u)=>s.set({steps:u})),s=sv({renderer:A,view:(u,g,d)=>XBt(u,{kind:n,name:e,steps:g.steps,frame:d,...g.result?{result:g.result}:{},...g.failure?{failure:g.failure}:{}}),initial:{steps:i.current}});return{advance(u){if(u.step==="scaffolding")i.move("Scaffolding");else if(u.step==="preparing")i.move("Installing");else if(u.step==="created")i.move()},finish(u){i.move(),s.stop({steps:i.current,result:u})},fail(u){i.halt(),s.stop({steps:i.current,failure:u})},abandon(){s.abandon()}}}function Uma(e){if(EC.machine)return;let n=d8();n.line(pSt(n,e))}function Tma(e){if(EC.machine)return;let n=d8();n.line(OEe(n,e))}function Kma(e,n={}){let A=TMt();A.line("");for(let i of C7(A,e,{...n.hint?{hint:n.hint}:{}}))A.line(i);A.line("")}function b_t(e){let n=e.includes("Username");return{error:n?oA("PUBLISH_USERNAME_REQUIRED",{detail:e}):oA("PUBLISH_NAMESPACE_DENIED",{detail:e}),hint:n?"set one at https://axon.arclabs.it/settings, then re-run":"rename the package in package.json, or `axon login` as the owning account"}}function Rma(e){if(EC.machine)return;d8().line(hSt(d8(),e))}function Yma(e,n={}){if(EC.machine)return;let A=d8();if(A.line(""),e.length===0)A.line(A.c.dim("no extensions installed"));else for(let i of e)A.line(`${A.c.dim(yb.pending)} ${A.c.text(i)}`);if(n.hint)A.line(""),A.line(KM(A,n.hint));A.line("")}function jma(e,n={}){if(EC.machine)return;let A=d8();if(e.length===0){if(A.line(""),A.line(A.c.dim("no extensions installed")),n.hint)A.line(""),A.line(KM(A,n.hint));A.line("");return}let i=e.map((s)=>{if(s.latest===null)return{name:s.name,outcome:"fail",note:"could not reach the registry"};if(s.outdated)return{name:s.name,outcome:"ok",detail:`${s.current??"?"} \u2192 ${s.latest}`,note:"update available"};return{name:s.name,outcome:"noop",detail:s.latest,note:"current"}});A.line("");for(let s of EBe(A,i))A.line(s);if(n.hint)A.line(""),A.line(KM(A,n.hint));A.line("")}async function zUe(e,n=2){if(n<=0)return[];let A=await bZr(e,{withFileTypes:!0}),i=[];for(let s of A){if(s.name.startsWith(".")||CZr.has(s.name))continue;if(s.isDirectory()){let u=await zUe(BZr(e,s.name),n-1);if(u.length>0)i.push({label:s.name,children:u})}else i.push({label:s.name})}return i}function Hma(e){if(EC.machine)return;let n=d8();n.line(N5e(n,{project:e.project,...e.frozen?{frozen:!0}:{},modules:e.modules,result:{unchanged:e.unchanged,warnings:e.warnings,ms:e.ms}}))}function Pma(e,n){if(EC.machine)return{report:()=>{},finish:()=>{},abandon:()=>{}};let A=d8(),i=h_t(Object.values(Lma),(u)=>s.set({steps:u})),s=sv({renderer:A,view:(u,g,d)=>N5e(u,{project:e,...n?{frozen:!0}:{},steps:g.steps,frame:d,modules:[],...g.result?{result:{unchanged:g.result.unchanged,warnings:g.result.warnings,ms:g.result.ms}}:{}}),initial:{steps:i.current}});return{report(u,g){if(u==="build:warning"){let B=g;if(B?.domain==="install"&&B.error)i.move(B.error);return}let d=u.lastIndexOf(":");if(u.slice(d+1)!=="start")return;let f=Lma[u.slice(0,d)];if(f)i.move(f)},finish(u){i.move(),s.stop({steps:i.current,result:u})},abandon(){s.abandon()}}}function Jma(e){if(!EC.progress)return{progress:()=>{},thinking:()=>{},done:()=>{}};let n=TMt(),A=null,i=null,s=null,u=!1,g=setTimeout(()=>{if(i=h_t(Object.values(f_t),(d)=>A?.set({steps:d})),A=sv({renderer:n,view:(d,f,B)=>["",dD(d,{title:"Running",subtitle:e}),"",...B7(d,f.steps.filter((E)=>E.label!==""),{frame:B}),""].join(`
4939
+ `).map((A)=>JSON.parse(A))}function l$r(e){if(e==="process:attach"||e==="process:detach")return!1;return e.startsWith("kernel:")||e.startsWith("cognet:")||e.startsWith("process:")||e.startsWith("capsule:")}function g$r(e){let n=[],A=[],i=[];for(let s of TKn(e))if(WEe.some((u)=>s.type.startsWith(u)))A.push(s);else if(l$r(s.type))i.push(s);else n.push(s);return{events:n,entries:A,kernelEvents:i,processes:[]}}function rla(e){let n=e.lastIndexOf("@");return n>0?{name:e.slice(0,n),version:e.slice(n+1)}:{name:e,version:""}}function p$r(e){return r$r(e.paths.root,e.paths.data)}async function m$r(e){let n=u$r(e);if(!n)return[];for(let A=0;A<10;A++){let i=TKn(n);if(i.some((s)=>s.type.endsWith(":error")||s.type.endsWith(":failed")))return i;await new Promise((s)=>setTimeout(s,30))}return TKn(n)}function aje(e){return e.source.kind==="remote"?e.source.target.name:e.source.project.name}function ola(e){if(!e||e.source.kind==="remote")return;return e.source.agent.engines}function d$r(e){return e.source.kind==="remote"?{kind:"remote",instance:e,axon:e.source.agent}:{kind:"local",instance:e}}function f$r(e){let n=e.instance,A=ha.shallowRef(VQt()),i=ha.ref("live"),s=ha.ref([]),u=ha.ref(0),g=ha.ref([]),d=ha.ref(!1),f=null,B=0,E=0,Q=0;function w(){if(e.kind==="local"){let ae=e.instance.source.kind!=="remote"?e.instance.source.agent:null;if(!ae)throw Error("local cell without an agent");let Be=ae;return{log:Be.session.log,kernelLog:Be.session.kernelLog,entries:Be.session.entries,processes:_Qt(Be.session.kernelLog)}}let ie=e.axon.session;return{log:ie.log,kernelLog:ie.kernelLog,entries:ie.entries,processes:_Qt(ie.kernelLog)}}function S(){let ie=w();B=ie.log.length,E=ie.kernelLog.length,Q=ie.entries.length,A.value={events:[...ie.log],kernelEvents:[...ie.kernelLog],entries:[...ie.entries],processes:ie.processes}}S();function G(ie){let ae=w();if(ie.startsWith("process:")||ie.startsWith("capsule:"))A.value={...A.value,processes:ae.processes};let Be=ae.entries.slice(Q);if(Q=ae.entries.length,Be.length>0)A.value.entries.push(...Be);let xe=ae.kernelLog.slice(E);if(E=ae.kernelLog.length,xe.length>0)A.value.kernelEvents.push(...xe);let Re=ae.log.slice(B);if(B=ae.log.length,Re.length>0)A.value.events.push(...Re);if(Be.length>0||xe.length>0||Re.length>0)A.value={...A.value}}let q=e.kind==="local"?(()=>{let ie=n.source.kind!=="remote"?n.source.agent:null;if(!ie)throw Error("local cell without an agent");return ie.bus.onAny((ae)=>G(ae))})():(()=>{let ie=0,ae=!1,Be=null,xe=null,Re=()=>{if(ae)return;Be=e.axon.session.subscribe({onEvent:(Ne)=>{if(ie!==0)ie=0,i.value="live";G(Ne.type)},onLive:()=>{ie=0,i.value="live"},onReset:()=>{S()},onClose:()=>{i.value="closed"},onError:()=>{if(ae)return;i.value="reconnecting",Oe()}})},Oe=()=>{if(ae)return;if(ie+=1,ie>c$r){i.value="lost";return}let Ne=Math.min(o$r*2**(ie-1),s$r);xe=setTimeout(Re,Ne)};return Re(),()=>{if(ae=!0,xe)clearTimeout(xe);Be?.()}})();async function P(ie){if(e.kind==="local"&&n.source.kind==="linked"){let Re=n.source.agent;d.value=!1;let Oe={interrupt:()=>Re.link.interrupt("user")};f=Oe;try{if((await Re.link.request({type:"cognet:stimulus:text",data:{content:ie,channel:"terminal"}})).interrupted)d.value=!0}finally{if(f===Oe)f=null}return}let ae=e.kind==="local"?null:e.axon;if(!ae)throw Error("cell has no invocation target");let Be=ae.stream({type:"cognet:stimulus:text",data:{content:ie,channel:"terminal"}}),{stream:xe}=Be;f=Be,d.value=!1;try{for await(let Re of xe);}finally{if(f===Be)f=null}}async function V(){while(s.value.length>0){let ie=s.value;s.value=[];try{await P(ie)}catch{}}}async function W(ie){if(u.value>0){s.value=[...s.value,ie];return}u.value++;let ae=Date.now();try{try{await P(ie)}finally{await V()}if(!d.value){let Be=w().entries.at(-1)?.time.seq;if(Be!==void 0)g.value=[...g.value.filter((xe)=>xe.afterSeq!==Be),{afterSeq:Be,durationMs:Date.now()-ae}]}}finally{u.value--}}function z(){let ie=f;if(!ie)return!1;return s.value=[],d.value=!0,ie.interrupt(),!0}let te=ha.computed(()=>{if(i.value==="reconnecting")return"reconnecting";if(i.value==="closed"||i.value==="lost")return"disconnected";if(A.value.events.findLast((ae)=>ae.type.startsWith("axon:reload:"))?.type==="axon:reload:start")return"rebooting";if(u.value===0||d.value)return null;return"working"});return{instance:n,session:A,activity:te,queued:ha.computed(()=>s.value),busy:ha.computed(()=>u.value>0),turnTimings:ha.computed(()=>g.value),send:W,interrupt:z,snapshot:S,promptNames(){if(e.kind!=="local"||n.source.kind==="remote")return[];let ie=n.source.agent;return[]},async renderPrompt(ie){if(e.kind!=="local"||n.source.kind==="remote")throw oA("NOT_WIRED",{detail:"prompt rendering is not available on a deployed agent"});return await n.source.agent.link.prompts({action:"get",name:ie})},async renderPromptEntry(ie){if(e.kind!=="local"||n.source.kind==="remote")throw oA("NOT_WIRED",{detail:"prompt rendering is not available on a deployed agent"});return await n.source.agent.link.prompts({action:"render",entry:ie})},get connection(){return i.value},dispose(){q()}}}function h$r(e,n,A){let i=ha.ref("idle"),s=ha.ref(null),u=!1,g=ha.ref(0);function d(){g.value++}let f=new Map;function B(Ri){return f.get(Ri)??null}function E(Ri){let Ra=f.get(Ri.sessionId);if(Ra)return Ra;let va=f$r(d$r(Ri));return f.set(Ri.sessionId,va),d(),va}function Q(Ri){let Ra=f.get(Ri);if(!Ra)return;Ra.dispose(),f.delete(Ri),d()}let w=300000,S=new Map,G=new Map,q=ha.ref(0),P=new Set;function V(){let Ri=Date.now()-w;for(let[Ra,va]of S)if(va.at<=Ri)S.delete(Ra)}e.onSpawn((Ri)=>{if(G.set(Ri.sessionId,{sessionId:Ri.sessionId,parentSessionId:Ri.parentSessionId,rootSessionId:Ri.rootSessionId,depth:Ri.depth,name:aje(Ri)}),S.delete(Ri.sessionId))q.value++;E(Ri)}),e.onStop((Ri)=>{if(u)return;let Ra=G.get(Ri);if(Ra){let va=Date.now();S.set(Ri,{view:{...Ra,focused:!1,activity:null,exitedAt:va},at:va}),q.value++,P.add(setTimeout(()=>{q.value++},w+1000))}Q(Ri)});function W(){g.value;let Ri=e.focused;return Ri?f.get(Ri.sessionId)??null:null}let z=ha.ref([]),te=ha.computed(()=>{return g.value,e.active}),ie=ha.computed(()=>{g.value;let Ri=n.profiles.active(),Ra=Ri?Ri.agents.list().map((cn)=>({kind:"local",dir:nMt(cn.root),name:cn.name})):[],va=A.deployments.list().map((cn)=>({kind:"deployed",name:cn.name,deploymentId:cn.deploymentId,tier:cn.tier,warmth:cn.warmth}));return[...Ra,...va]});async function ae(){await A.deployments.refresh(),d()}let Be=ha.computed(()=>{return g.value,A.deployments.error});async function xe(Ri){let Ra=A.deployments.list().find((va)=>va.deploymentId===Ri);if(!Ra)throw oA("DEPLOYMENT_NOT_CONNECTABLE",{context:{deploymentId:Ri}});i.value="booting",$e.value=Ra.name,it.value=null,s.value=null,z.value=[];try{let va=await e.attach({url:Ra.url,name:Ra.name,agentId:Ra.agentId,deploymentId:Ra.deploymentId,tier:Ra.tier});E(va),i.value="idle",z.value=[],$e.value=null,zA()}catch(va){throw i.value="error",s.value=va instanceof Error?va:Error(String(va)),va}finally{d()}}async function Re(Ri){let Ra=Ri.trim();if(Ra==="")throw oA("ATTACH_URL_REQUIRED");i.value="booting",$e.value=Ra,it.value=null,s.value=null,z.value=[];try{let va=await e.attach({url:Ra,name:""});E(va),i.value="idle",z.value=[],$e.value=null,zA()}catch(va){throw i.value="error",s.value=va instanceof Error?va:Error(String(va)),va}finally{d()}}function Oe(){d()}let Ne=ha.computed(()=>{g.value;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote")return Ri.source.target.name;return e.project?.name??null}),$e=ha.ref(null),it=ha.ref(null),Me=ha.ref(null),bt=ha.ref(null),Rt=Vsa(),mt=ha.computed(()=>Ne.value??$e.value),Xt=ha.computed(()=>$e.value!==null),Ln=ha.computed(()=>{if(g.value,Xt.value)return null;return e.focused?.sessionId??null}),Ft=ha.computed(()=>{g.value;let Ri=e.blueprint,Ra=Ln.value;if(!Ri||!Ra)return null;return i$r(p$r(Ri),"sessions",`${Ra}.jsonl`)}),nn=ha.computed(()=>{if(g.value,Xt.value)return it.value;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote")return Ri.source.target.url;return e.project?.root??null}),$n=ha.computed(()=>{return g.value,oca(nn.value,n.profiles.active()?.agents.root??null)}),Ht=ha.computed(()=>{if(g.value,!Xt.value&&!it.value)return null;let Ri=it.value;if(!Ri)return null;return n.state.get()?.agentManifests?.[nMt(Ri)]??null}),tA=ha.computed(()=>{if(g.value,Xt.value){let us=it.value;if(!us)return null;return n.state.get()?.agentModels?.[nMt(us)]??null}let Ri=e.focused;if(Ri&&Ri.source.kind==="remote"){let us=Ri.source.target.engine;if(!us)return null;return MGt({provider:us.provider,declared:us.model,resolved:null})}let Ra=ola(e.focused),va=Ra?.primary;if(Ra&&va&&Ra.has(va)){let us=Ra.get(va).binding.capability;return MGt({provider:us.provider,declared:us.id,resolved:null})}let cn=NAe(e.blueprint?.config.model);if(cn)return MGt({provider:cn.provider??"axon",declared:cn.model,resolved:jt.value});return null}),JA=Aca(),un=ha.computed(()=>{if(g.value,Xt.value)return null;return JA.step(nca(Te.value.kernelEvents,Te.value.entries))}),mA=ha.computed(()=>{g.value,q.value,V();let Ri=e.focused?.sessionId??null,Ra=e.list().map((us)=>({sessionId:us.sessionId,parentSessionId:us.parentSessionId,rootSessionId:us.rootSessionId,depth:us.depth,name:aje(us),focused:us.sessionId===Ri,activity:B(us.sessionId)?.activity.value??null,exitedAt:null}));if(S.size===0)return Ra;let va=new Map;for(let us of Ra)va.set(us.sessionId,us);for(let[us,pc]of S)va.set(us,pc.view);let cn=[];for(let us of G.keys()){let pc=va.get(us);if(pc)cn.push(pc),va.delete(us)}return[...cn,...va.values()]}),cA=ha.computed(()=>{g.value;let Ri=e.focused?.sessionId??null,Ra=new Map;for(let va of e.recent()){let cn=aje(va),us={sessionId:va.sessionId,parentSessionId:va.parentSessionId,rootSessionId:va.rootSessionId,depth:va.depth,name:cn,focused:va.sessionId===Ri,activity:B(va.sessionId)?.activity.value??null,exitedAt:null},pc=Ra.get(cn);if(pc)pc.push(us);else Ra.set(cn,[us])}return Ra}),vn=ha.computed(()=>{return g.value,e.sessions()}),Tn=ha.ref(null),Cn=new Map,ja={id:ha.computed(()=>Tn.value),show(Ri){if(!Cn.has(Ri.sessionId))Cn.set(Ri.sessionId,g$r(Ri.filePath));Tn.value=Ri.sessionId},clear(){Tn.value=null,Cn.clear()}},Te=ha.computed(()=>{if(Tn.value!==null)return Cn.get(Tn.value)??VQt();if(z.value.length>0)return{...VQt(),events:z.value};if(Xt.value)return VQt();return W()?.session.value??VQt()}),Nn=ha.ref(null),jt=ha.computed(()=>{if(g.value,Xt.value)return null;return Xsa(Te.value.kernelEvents)??Nn.value}),rA=ha.computed(()=>{if(g.value,Xt.value)return null;let Ri=jt.value;if(Ri)return Ri;let Ra=NAe(e.blueprint?.config.model)?.model??null;return Ra==="auto"?null:Ra});async function fA(){let Ri=eca(e.blueprint?.config.model);if(!Ri){Nn.value=null;return}try{let Ra=await A.cloud.cloud.engine.resolve(Ri);Nn.value=Ra.model}catch{Nn.value=null}}let gn=ha.ref([]);async function zA(){let Ri=W();if(!Ri)return;while(gn.value.length>0&&W()===Ri){let[Ra,...va]=gn.value;gn.value=va;try{await Ri.send(Ra)}catch{}}}async function la(Ri,Ra){let va=n.profiles.active(),cn=typeof Ri==="string"&&va?va.agents.find(Ri):[],us=typeof Ri==="string"?cn.length===1?cn[0]:null:Ri,pc=typeof Ri==="string"?us?.name??Ri:Ri.name,Pr=us?.root??null,Xl=Rt.claim();i.value="booting",$e.value=pc,it.value=Pr,Me.value=null,bt.value=null,s.value=null,z.value=[];try{let im=await e.spawn(Ri,{...Ra,focus:Ra?.focus===!1?!1:Xl.latest,onProgress:(Bp)=>{if(Xl.latest)Me.value=Bp},onTiming:(Bp)=>{if(Xl.latest&&Bp.unit==="modules")bt.value=Bp.durationMs}});if(E(im),!Xl.latest)return d(),im.sessionId;i.value="idle",z.value=[];try{if(im.source.kind==="linked"){let Bp=nMt(im.source.project.root),Rd=tA.value,yC={...Rd?{model:Rd}:{},modules:Ti.value.length,tools:Io.value?.tools??0,...Ln.value?{sessionId:Ln.value}:{},...un.value!==null?{context:un.value}:{}};n.state.update((gB)=>({...gB,lastAgent:Bp,...Rd?{agentModels:{...gB.agentModels,[Bp]:Rd}}:{},agentManifests:{...gB.agentManifests,[Bp]:yC}}))}}catch{}return $e.value=null,it.value=null,Me.value=null,fA(),zA(),im.sessionId}catch(im){if(!Xl.latest)throw im;throw i.value="error",s.value=im instanceof Error?im:Error(String(im)),z.value=await m$r(im),im}finally{d()}}async function $a(Ri){i.value="booting";let Ra=e.focused;if(Ra)await _t(Ra.sessionId);await la(Ri)}async function ei(Ri,Ra){if(e.get(Ra)){GA(Ra);return}await la(Ri,{session:Ra})}async function Oi(){let Ri=e.focused;if(!Ri)throw oA("NO_ACTIVE_AGENT");if(Ri.source.kind==="remote")throw oA("CLEAR_IMMUTABLE_DEPLOYED",{detail:`${aje(Ri)} is a deployment \u2014 it owns its session in the cloud, so there is no fresh one to start from the TUI`,context:{name:aje(Ri)}});let Ra=Ri.source.project;await _t(Ri.sessionId),await la(Ra)}async function zi(Ri){await la(Ri)}async function Ei(){let Ri=e.focused;if(!Ri)return;await _t(Ri.sessionId)}function GA(Ri){e.focus(Ri),JA.reset(),d(),zA()}async function _t(Ri){try{await e.stop(Ri)}finally{Q(Ri),d()}}async function tt(Ri){let Ra=e.focused;if(!Ra)throw oA("NO_ACTIVE_AGENT");if(Ra.source.kind==="remote")throw oA("MODEL_IMMUTABLE_DEPLOYED",{detail:`${aje(Ra)} is a deployment \u2014 its model is set at deploy time, not from the TUI`,context:{sessionId:Ra.sessionId}});let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE");let us=Date.now(),pc=Ri;await cn?.commit("axon:model:start",{name:pc});try{let Pr=await va.model.set(Ri);await cn?.commit("axon:model:complete",{name:pc,durationMs:Date.now()-us,changed:Pr.changed,dropped:[]});{let Xl=ola(e.focused);if(Xl){if(!Xl.select(Ri))throw oA("MODEL_UNAVAILABLE",{detail:`no declared provider supplies "${Ri}" \u2014 the choice was saved but the running agent still uses its previous model`,context:{model:Ri}})}}return d(),fA(),Pr}catch(Pr){let Xl=oA(Pr);throw await cn?.commit("axon:model:failed",{name:pc,error:Xl,durationMs:Date.now()-us}),Xl}}async function Ot(Ri){let Ra=e.focused;if(!Ra)throw oA("NO_ACTIVE_AGENT");if(Ra.source.kind==="remote")return{changed:!1};let va=e.project;if(!va)throw oA("NO_FOCUSED_INSTANCE");return{changed:!1}}let Xn=ha.computed(()=>{return g.value,e.blueprint?.config.model??null});async function hn(){u=!0,i.value="shutting-down";for(let Ri of f.values())Ri.dispose();for(let Ri of P)clearTimeout(Ri);P.clear();try{await e.shutdown()}catch(Ri){throw Ri}}async function RA(){let Ri=Ft.value;if(!Ri)throw oA("NO_SESSION_TO_OPEN");let Ra=await e.history.fork(Ri);return d(),Ra}async function ea(Ri){let Ra=Ft.value;if(!Ra)throw oA("NO_SESSION_TO_OPEN");await e.history.rename(Ra,Ri),d()}async function Wi(){await e.current?.reload(),d(),W()?.snapshot(),fA()}let Ti=ha.computed(()=>{return g.value,e.blueprint?.modules??[]}),Io=ha.computed(()=>{if(g.value,Xt.value)return null;let Ri=e.focused;if(Ri&&Ri.source.kind==="remote"){let va=Ri.source.target.loaded;return va?{...va,durationMs:null}:null}let Ra=e.blueprint;if(!Ra)return null;return{modules:Ra.modules?.length??0,tools:Ra.tools?.length??0,durationMs:bt.value}});async function Xo(Ri){let Ra=e.session,va=Date.now();await Ra?.commit("axon:install:start",{name:Ri,artifact:"extension"});try{let{useExtensions:cn}=await Promise.resolve().then(() => (Wye(),UKn)),us=await cn().install(Ri),{name:pc,version:Pr}=rla(us.ref);return await Ra?.commit("axon:install:complete",{name:pc,version:Pr,durationMs:Date.now()-va,alreadyInstalled:!us.declared,artifact:"extension"}),d(),{root:us.root,ref:us.ref}}catch(cn){let us=cn instanceof Error&&"isAxonError"in cn?cn:oA("EXTENSION_INSTALL_FAILED",{detail:String(cn),context:{source:Ri}});throw await Ra?.commit("axon:install:failed",{name:Ri,error:us,durationMs:Date.now()-va,artifact:"extension"}),us}}async function eu(Ri){let Ra=e.session,va=Date.now(),{name:cn}=rla(Ri);await Ra?.commit("axon:uninstall:start",{name:cn,artifact:"extension"});try{let{useExtensions:us}=await Promise.resolve().then(() => (Wye(),UKn)),pc=await us().uninstall(Ri);return await Ra?.commit("axon:uninstall:complete",{name:cn,durationMs:Date.now()-va,artifact:"extension"}),d(),pc}catch(us){let pc=us instanceof Error&&"isAxonError"in us?us:oA("EXTENSION_UNINSTALL_FAILED",{detail:String(us),context:{source:Ri}});throw await Ra?.commit("axon:uninstall:failed",{name:cn,error:pc,durationMs:Date.now()-va,artifact:"extension"}),pc}}async function hc(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{specifier:Ri}});let cn=Date.now();await va?.commit("axon:install:start",{name:Ri});try{let[us]=await Ra.modules.install([Ri]);if(!us)throw oA("MODULE_INSTALL_FAILED",{detail:"installer returned no result",context:{specifier:Ri}});if(us.status==="error")throw oA("MODULE_INSTALL_FAILED",{detail:us.error,context:{name:us.name}});if(us.status==="not-found")return await va?.commit("axon:install:not-found",{name:Ri,durationMs:Date.now()-cn}),us;let pc=us.status==="already-installed";if(await va?.commit("axon:install:complete",{name:us.name,version:us.version,durationMs:Date.now()-cn,alreadyInstalled:pc}),!pc)await Wi();return us}catch(us){let pc=oA(us);throw await va?.commit("axon:install:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),pc}}let Al=ha.computed(()=>{return g.value,e.project?.root??null});async function So(){let Ri=e.project;if(!Ri)return[];return Ri.modules.updates()}async function Th(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{names:Ri.map((pc)=>pc.name)}});if(Ri.length===0)return[];let cn=Date.now(),us=Ri.map((pc)=>pc.name);await va?.commit("axon:update:start",{names:us,artifact:"module"});try{let pc=await Ra.modules.update(Ri),Pr=pc.filter((im)=>im.status==="installed"),Xl=pc.filter((im)=>im.status==="error"||im.status==="not-found");if(await va?.commit("axon:update:complete",{names:us,artifact:"module",updated:Pr.map((im)=>({name:im.name,version:im.version})),failed:Xl.map((im)=>({name:im.name,error:im.status==="error"?im.error:"not in the registry"})),durationMs:Date.now()-cn}),Pr.length>0)await Wi();return pc}catch(pc){let Pr=oA(pc);throw await va?.commit("axon:update:failed",{names:us,artifact:"module",error:Pr,durationMs:Date.now()-cn}),Pr}}async function gi(){let Ri=e.project;if(!Ri)return[];return Ri.env.keys()}async function ui(Ri,Ra){let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE",{context:{key:Ri}});let us=Date.now();await cn?.commit("axon:env:set:start",{key:Ri});try{await va.env.set(Ri,Ra),await cn?.commit("axon:env:set:complete",{key:Ri,durationMs:Date.now()-us}),await Wi()}catch(pc){let Pr=oA(pc);throw await cn?.commit("axon:env:set:failed",{key:Ri,error:Pr,durationMs:Date.now()-us}),Pr}}async function Ro(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{key:Ri}});let cn=Date.now();await va?.commit("axon:env:set:start",{key:Ri});try{await Ra.env.unset(Ri),await va?.commit("axon:env:set:complete",{key:Ri,durationMs:Date.now()-cn}),await Wi()}catch(us){let pc=oA(us);throw await va?.commit("axon:env:set:failed",{key:Ri,error:pc,durationMs:Date.now()-cn}),pc}}async function $u(){let Ri=e.project;if(!Ri)return null;return Ri.cognet.updates()}async function $A(Ri,Ra){let{project:va,session:cn}=e;if(!va)throw oA("NO_FOCUSED_INSTANCE",{context:{name:Ri}});let us=Date.now();await cn?.commit("axon:update:start",{names:[Ri],artifact:"cognet"});try{await va.cognet.update(Ra),await cn?.commit("axon:update:complete",{names:[Ri],artifact:"cognet",updated:[{name:Ri,version:Ra}],failed:[],durationMs:Date.now()-us}),await Wi()}catch(pc){let Pr=oA(pc);throw await cn?.commit("axon:update:failed",{names:[Ri],artifact:"cognet",error:Pr,durationMs:Date.now()-us}),Pr}}async function nr(Ri){let{project:Ra,session:va}=e;if(!Ra)throw oA("NO_FOCUSED_INSTANCE",{context:{name:Ri}});let cn=Date.now();await va?.commit("axon:uninstall:start",{name:Ri});try{let us=await Ra.modules.uninstall(Ri);if(us.status==="source-declared"){let pc=oA("MODULE_SOURCE_DECLARED",{detail:`"${Ri}" is declared as an import in ${us.path}, not as a registry name \u2014 `+"remove the import and its entry in modules: [...] to uninstall it.",context:{name:Ri,path:us.path}});return await va?.commit("axon:uninstall:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),us}if(await va?.commit("axon:uninstall:complete",{name:Ri,durationMs:Date.now()-cn}),us.status==="removed")await Wi();return us}catch(us){let pc=oA(us);throw await va?.commit("axon:uninstall:failed",{name:Ri,error:pc,durationMs:Date.now()-cn}),pc}}async function Mo(Ri){let Ra=Xt.value?null:W();if(!Ra){gn.value=[...gn.value,Ri];return}await Ra.send(Ri)}let xu={list(){return W()?.promptNames()??[]},render(Ri){let Ra=W();if(!Ra)throw oA("NOT_BOOTED",{detail:"no running agent to render a prompt against"});return Ra.renderPrompt(Ri)},async fetch(Ri){let Ra=W();if(!Ra)throw oA("NOT_BOOTED",{detail:"no running agent to render a prompt against"});return Ra.renderPromptEntry(await A.prompts.entry(Ri))}};function zc(){return W()?.interrupt()??!1}async function Ll(Ri,Ra){let va=e.get(Ri);if(!va)throw oA("SESSION_NOT_RUNNING",{context:{sessionId:Ri}});if(va.source.kind==="remote")throw oA("CAPSULE_NOT_LOCAL",{detail:`${Ri} is an attached deployment \u2014 its capsule runs in the cloud, not on this machine`,context:{sessionId:Ri}});let cn=await va.source.agent.link.run(Ra);return{ok:cn.ok,...cn.value!==void 0?{value:cn.value}:{},stdout:cn.stdout,...cn.error?{error:cn.error}:{}}}let Or=ha.computed(()=>Xt.value?[...gn.value]:[...W()?.queued.value??[],...gn.value]),Ou=ha.computed(()=>{if(i.value==="booting")return"booting";if(i.value==="shutting-down")return"shutting-down";return W()?.activity.value??null}),Rc=ha.computed(()=>{return g.value,W()?.connection??"live"}),EE=ha.computed(()=>{return g.value,W()?.turnTimings.value??[]});return{active:te,connection:Rc,turnTimings:EE,available:ie,refreshAvailable:Oe,selected:Ne,displayName:mt,switching:Xt,model:Xn,sessionId:Ln,sessionFile:Ft,forkSession:RA,renameSession:ea,home:nn,homeLabelled:$n,loaded:Io,engineDescriptor:tA,manifest:Ht,context:un,contextModel:rA,resolvedModel:jt,bootStage:ha.computed(()=>Me.value),status:i,activity:Ou,queued:Or,error:s,session:Te,instances:mA,instancesByAgent:cA,sessions:vn,modules:Ti,select:$a,spawn:la,attachDeployment:xe,attachUrl:Re,refreshDeployments:ae,deploymentsError:Be,resume:ei,clear:Oi,spawnSibling:zi,close:Ei,focus:GA,stop:_t,setModel:tt,setThinking:Ot,shutdown:hn,reboot:Wi,send:Mo,interrupt:zc,capsule:Ll,prompts:xu,preview:ja,installModule:hc,installExtension:Xo,uninstallExtension:eu,uninstallModule:nr,projectRoot:Al,moduleUpdates:So,updateModules:Th,cognetUpdate:$u,updateCognet:$A,envKeys:gi,setKey:ui,unsetKey:Ro,async commit(Ri,Ra){let va=e.session;if(!va)return;if(typeof va.commit!=="function")throw oA("NOT_WIRED",{detail:`the focused agent's session has no commit path, so "${Ri}" cannot be recorded`});await va.commit(Ri,Ra)}}}function $c(){if(!ZQt){let e=PB();ZQt=h$r(e.agents,e.store,{deployments:e.deployments,prompts:e.prompts,cloud:e.cloud.client});let n=ZQt;$sa({async focus(A){n.focus(A)},async send(A){await n.send(A)},async interrupt(){n.interrupt()},async capsule(A,i){return n.capsule(A,i)}}),Xie().listen(),ZQt.refreshDeployments()}return ZQt}var o$r=500,s$r=1e4,c$r=10,ZQt;var iD=dt(()=>{cRe();Ks();vE();n9();wGt();ps();kQt();SGt();tca();LTn();sca()});function Qma(e){return{session:e?.session??"normal",kernel:e?.kernel??!1,cognet:e?.cognet??!1}}function cZr(e){if(e.endsWith(":error")||e.endsWith(":failed"))return"error";if(sZr.has(e))return"info";return"debug"}function uZr(e){if(e.type!=="axon:error")return!1;let n=e.data.error;if(!n||typeof n!=="object")return!1;let A=n.context;if(!A||typeof A!=="object")return!1;return typeof A.commandId==="string"}function _ma(e,n){if(uZr(e)&&n.session!=="verbose")return!1;return lZr[n.session].has(cZr(e.type))}function wma(e,n){return n.kernel}function kma(e,n){if(e.type==="axon:system:message"&&e.data.type==="hot-reload")return!1;if(e.type==="axon:system:message"&&e.data.type==="format-violation")return!1;if(e.type==="axon:system:malformed")return!1;if(e.type==="axon:agent:done")return!1;return gZr.has(e.type)}function Dma(e,n){if(!n)return!1;let A=n;return e.some((i)=>{if(i.type!=="axon:error")return!1;let s=i.data.error;if(s===n)return!0;if(!s||typeof s!=="object")return!1;let u=s;if(u.message!==A.message)return!1;return u.code===void 0||A.code===void 0||u.code===A.code})}var sZr,lZr,gZr;var g5n=dt(()=>{sZr=new Set(["axon:reload:start","axon:reload:complete","axon:install:start","axon:install:complete","axon:uninstall:start","axon:uninstall:complete","axon:update:start","axon:update:complete","axon:model:complete","axon:session:restored","compress","build:warning","axon:connect:start","axon:connect:step","axon:connect:complete","axon:connect:interrupted"]);lZr={quiet:new Set(["error"]),normal:new Set(["error","info"]),verbose:new Set(["error","info","debug"])};gZr=new Set(["cognet:stimulus:text","cognet:stimulus:audio","cognet:stimulus:visual","cognet:stimulus:vector","cognet:output:text","cognet:output:audio","cognet:output:visual","cognet:output:vector","cognet:action:typescript","cognet:action:result","axon:interrupt","axon:system:message","subagent:start","subagent:end"])});import{readdir as bZr}from"fs/promises";import{join as BZr}from"path";function h_t(e,n){let A=e.map((s)=>({label:s,state:"waiting"})),i=new Map;return{get current(){return A},move(s,u){let g=performance.now();A=A.map((d)=>{if(d.state==="active"&&d.label!==s){let f=i.get(d.label)??g;return{...d,state:"done",ms:g-f,since:void 0}}if(d.label===s){if(d.state!=="active")i.set(d.label,g);return{...d,state:"active",since:i.get(d.label)??g,...u?{detail:u}:{}}}return d}),n(A)},halt(){let s=performance.now();A=A.map((u)=>u.state==="active"?{...u,state:"failed",ms:s-(i.get(u.label)??s),since:void 0}:u),n(A)},advance(s,u){let g=A.findIndex((d)=>d.label===s);if(g===-1)return;A=A.map((d,f)=>f<g&&d.state==="waiting"?{...d,state:"done"}:d),this.move(s,u)}}}function d8(){return Gma??=OLe({}),Gma}function TMt(){return Mma??=OLe({stream:process.stderr}),Mma}function qma(){return{advance:()=>{},finish:()=>{}}}function KMt(e,n="agent"){if(EC.machine)return{...qma(),fail:()=>{},abandon:()=>{}};let A=d8(),i=h_t(["Scaffolding","Installing"],(u)=>s.set({steps:u})),s=sv({renderer:A,view:(u,g,d)=>XBt(u,{kind:n,name:e,steps:g.steps,frame:d,...g.result?{result:g.result}:{},...g.failure?{failure:g.failure}:{}}),initial:{steps:i.current}});return{advance(u){if(u.step==="scaffolding")i.move("Scaffolding");else if(u.step==="preparing")i.move("Installing");else if(u.step==="created")i.move()},finish(u){i.move(),s.stop({steps:i.current,result:u})},fail(u){i.halt(),s.stop({steps:i.current,failure:u})},abandon(){s.abandon()}}}function Uma(e){if(EC.machine)return;let n=d8();n.line(pSt(n,e))}function Tma(e){if(EC.machine)return;let n=d8();n.line(OEe(n,e))}function Kma(e,n={}){let A=TMt();A.line("");for(let i of C7(A,e,{...n.hint?{hint:n.hint}:{}}))A.line(i);A.line("")}function b_t(e){let n=e.includes("Username");return{error:n?oA("PUBLISH_USERNAME_REQUIRED",{detail:e}):oA("PUBLISH_NAMESPACE_DENIED",{detail:e}),hint:n?"set one at https://axon.arclabs.it/settings, then re-run":"rename the package in package.json, or `axon login` as the owning account"}}function Rma(e){if(EC.machine)return;d8().line(hSt(d8(),e))}function Yma(e,n={}){if(EC.machine)return;let A=d8();if(A.line(""),e.length===0)A.line(A.c.dim("no extensions installed"));else for(let i of e)A.line(`${A.c.dim(yb.pending)} ${A.c.text(i)}`);if(n.hint)A.line(""),A.line(KM(A,n.hint));A.line("")}function jma(e,n={}){if(EC.machine)return;let A=d8();if(e.length===0){if(A.line(""),A.line(A.c.dim("no extensions installed")),n.hint)A.line(""),A.line(KM(A,n.hint));A.line("");return}let i=e.map((s)=>{if(s.latest===null)return{name:s.name,outcome:"fail",note:"could not reach the registry"};if(s.outdated)return{name:s.name,outcome:"ok",detail:`${s.current??"?"} \u2192 ${s.latest}`,note:"update available"};return{name:s.name,outcome:"noop",detail:s.latest,note:"current"}});A.line("");for(let s of EBe(A,i))A.line(s);if(n.hint)A.line(""),A.line(KM(A,n.hint));A.line("")}async function zUe(e,n=2){if(n<=0)return[];let A=await bZr(e,{withFileTypes:!0}),i=[];for(let s of A){if(s.name.startsWith(".")||CZr.has(s.name))continue;if(s.isDirectory()){let u=await zUe(BZr(e,s.name),n-1);if(u.length>0)i.push({label:s.name,children:u})}else i.push({label:s.name})}return i}function Hma(e){if(EC.machine)return;let n=d8();n.line(N5e(n,{project:e.project,...e.frozen?{frozen:!0}:{},modules:e.modules,result:{unchanged:e.unchanged,warnings:e.warnings,ms:e.ms}}))}function Pma(e,n){if(EC.machine)return{report:()=>{},finish:()=>{},abandon:()=>{}};let A=d8(),i=h_t(Object.values(Lma),(u)=>s.set({steps:u})),s=sv({renderer:A,view:(u,g,d)=>N5e(u,{project:e,...n?{frozen:!0}:{},steps:g.steps,frame:d,modules:[],...g.result?{result:{unchanged:g.result.unchanged,warnings:g.result.warnings,ms:g.result.ms}}:{}}),initial:{steps:i.current}});return{report(u,g){if(u==="build:warning"){let B=g;if(B?.domain==="install"&&B.error)i.move(B.error);return}let d=u.lastIndexOf(":");if(u.slice(d+1)!=="start")return;let f=Lma[u.slice(0,d)];if(f)i.move(f)},finish(u){i.move(),s.stop({steps:i.current,result:u})},abandon(){s.abandon()}}}function Jma(e){if(!EC.progress)return{progress:()=>{},thinking:()=>{},done:()=>{}};let n=TMt(),A=null,i=null,s=null,u=!1,g=setTimeout(()=>{if(i=h_t(Object.values(f_t),(d)=>A?.set({steps:d})),A=sv({renderer:n,view:(d,f,B)=>["",dD(d,{title:"Running",subtitle:e}),"",...B7(d,f.steps.filter((E)=>E.label!==""),{frame:B}),""].join(`
4940
4940
  `),initial:{steps:i.current}}),s)i.move(f_t[s.stage],s.detail)},IZr);return g.unref?.(),{thinking(){if(!i){s={stage:"thinking"};return}i.advance(f_t.thinking)},progress(d,f){let B=f_t[d];if(!B)return;if(!i){s={stage:d,...f?{detail:f}:{}};return}i.advance(B,f)},done(){if(u)return;if(u=!0,clearTimeout(g),i?.advance(f_t.done),A&&i)A.stop({steps:i.current.filter((d)=>d.label!=="")})}}}function RMt(e){if(EC.machine)return{...qma(),fail:()=>{},abandon:()=>{}};let n=d8(),A=h_t(OBt,(s)=>i.set({steps:s})),i=sv({renderer:n,view:(s,u,g)=>zBt(s,{name:e,steps:u.steps,frame:g,...u.result?{result:u.result}:{},...u.failure?{failure:u.failure}:{}}),initial:{steps:A.current}});return{advance(s){if(s.step==="bundling")A.move("Bundling");else if(s.step==="verifying")A.move("Verifying");else if(s.step==="registering")A.move("Registering",s.name);else if(s.step==="uploading")A.move("Uploading",`v${s.version}`);else if(s.step==="bumped")A.move("Uploading",`v${s.from} exists \u2014 bumped to v${s.to}`);else if(s.step==="published")A.move()},finish(s){A.move(),i.stop({steps:A.current,result:s})},fail(s){A.halt(),i.stop({steps:A.current,failure:s})},abandon(){i.abandon()}}}function $ma(e){if(EC.machine)return;let n=d8();n.line(eCt(n,{agent:e.agent,modules:e.modules,...e.prepare?{prepare:e.prepare}:{},result:{...e.ms!==void 0?{ms:e.ms}:{},...e.next?{next:e.next}:{}}}))}function Oma(e){if(EC.machine)return;let n=d8();n.line(aCt(n,{source:e.source,...e.as?{as:e.as}:{},steps:ACt.map((A)=>({label:A,state:"done"})),result:{version:e.version,root:e.root,files:e.files,...e.next?{next:e.next}:{},...e.ms!==void 0?{ms:e.ms}:{}}}))}function zma(){if(EC.machine)return{code:()=>{},finish:()=>{},fail:()=>{},abandon:()=>{}};let e=d8(),n=sv({renderer:e,view:(i,s,u)=>nCt(i,{frame:u,...s.authorization?{authorization:s.authorization}:{},...s.result?{result:s.result}:{},...s.failure?{failure:s.failure}:{}}),initial:{}}),A;return{code(i){let s=Date.now()+i.expiresIn*1000,u={verificationUri:i.verificationUri,...i.verificationUriComplete?{verificationUriComplete:i.verificationUriComplete}:{},userCode:i.userCode},g=()=>n.set({authorization:{...u,secondsLeft:Math.max(0,Math.round((s-Date.now())/1000))}});g(),A=setInterval(g,1000)},finish(i){if(A)clearInterval(A);n.stop({result:i})},fail(i){if(A)clearInterval(A);n.stop({failure:i})},abandon(){if(A)clearInterval(A);n.abandon()}}}function Wma(e,n){if(EC.machine)return{advance:()=>{},finish:()=>{},fail:()=>{},abandon:()=>{}};let A=d8(),i=h_t($Ee,(u)=>s.set({steps:u})),s=sv({renderer:A,view:(u,g,d)=>VBt(u,{name:e,...n?{plan:n}:{},steps:g.steps,frame:d,...g.result?{result:g.result}:{},...g.failure?{failure:g.failure}:{}}),initial:{steps:i.current}});return{advance(u){if(u.step==="bundling")i.move("Bundling");else if(u.step==="bumped")i.move("Bundling");else if(u.step==="registering")i.move("Registering");else if(u.step==="publishing")i.move("Publishing");else if(u.step==="provisioning")i.move("Provisioning");else if(u.step==="starting")i.move("Starting");else if(u.step==="ready")i.move()},finish(u){i.move(),s.stop({steps:i.current,result:u})},fail(u){i.halt(),s.stop({steps:i.current,failure:u})},abandon(){s.abandon()}}}var Gma,Mma=null,CZr,Wh,Lma,f_t,IZr=500;var dae=dt(()=>{G5e();ps();AQe();CZr=new Set(["node_modules",".git",".agent",".module",".cognet",".axon","bun.lock","bun.lockb","package-lock.json","tsconfig.json"]);Wh={ok(e,n){d8().line(yy(d8(),"ok",e,n))},fail(e,n){let A=TMt();if(A.line(yy(A,"fail",e)),n)A.line(A.c.dim(` ${n}`))},info(e){d8().line(yy(d8(),"info",e))},warn(e){let n=TMt();n.line(yy(n,"warn",e))},detail(e){let n=d8();n.line(n.c.dim(` ${e}`))},blank(){d8().line()}};Lma={"build:framework":"Framework","build:modules":"Modules","build:cognet":"Cognet","build:tree":"Tree","build:typegen":"Types"};f_t={preparing:"Preparing",dependencies:"Dependencies",compiling:"Compiling",booting:"Booting",thinking:"Thinking",done:""}});var B_t=!1,Zma=!1,EC;var AQe=dt(()=>{dae();EC={configure(e){B_t=e.json==="true",Zma=e.quiet==="true"||e.q==="true"},get machine(){return B_t},get progress(){return!B_t&&!Zma&&Boolean(process.stderr.isTTY)},ok(e,n){if(!B_t){n();return}console.log(JSON.stringify({ok:!0,...e}))},fail(e){if(B_t){console.log(JSON.stringify({ok:!1,...e.code?{code:e.code}:{},message:e.message}));return}Wh.fail(e.message,e.hint)}}});function YMt(e){if(e.startsWith("--")&&e.length>2)return e.slice(2);if(e.startsWith("-")&&e.length>1)return e.slice(1);return null}function Vma(e){return EZr[e]}function Xma(e,n){if(n===void 0||YMt(n)!==null){let A=e.length===1?`-${e}`:`--${e}`;throw oA("FLAG_VALUE_REQUIRED",{detail:n===void 0?`${A} needs a value, but the command ended`:`${A} needs a value, but was followed by ${n}`,context:{flag:e}})}return n}var EZr;var eda=dt(()=>{S$();ps();EZr={p:{arity:"value",repeatable:!0},prompt:{arity:"value",repeatable:!0},P:{arity:"value"},s:{arity:"value"},script:{arity:"value"},context:{arity:"value"},job:{arity:"value"},a:{arity:"none"},attach:{arity:"none"},image:{arity:"none"},follow:{arity:"none"},yes:{arity:"none"},frozen:{arity:"none"},json:{arity:"none"},quiet:{arity:"none"},q:{arity:"none"},all:{arity:"none"},kind:{arity:"value"},limit:{arity:"value"},sort:{arity:"value"},scope:{arity:"value"},dir:{arity:"value"},port:{arity:"value"},...Object.fromEntries(wBe.map((e)=>[`${e}s`,{arity:"none"}]))}});import{relative as yZr}from"path";function tda(e){if(e.source.kind!=="linked")throw oA("CLI_AGENT_NOT_LOCAL",{detail:"this command needs an agent running on this machine, and the registry returned a remote one",context:{sessionId:e.sessionId,kind:e.source.kind}});return e.source.agent}function nda(e){if(!e)return null;let n=e.indexOf(":");if(n===-1)return e;return`${e.slice(0,n)} \xB7 ${e.slice(n+1)}`}function Ada(e){let n=e.platform;async function A(g){let d=await n.projects.open(n.projects.find(g)??g);if(d.kind!=="agent")throw Error(`NOT_AN_AGENT: ${d.root} is a ${d.kind} project \u2014 use \`axon ${d.kind} <command>\``);return d}async function i(g,d,f,B){let E=g.blueprint.prompts;if(!E.find((w)=>w.name===f)){let w=E.map((S)=>S.name);throw Error(`PROMPT_NOT_FOUND: no prompt "${f}" in ${d}`+(w.length?`
4941
4941
  available: ${w.join(", ")}`:`
4942
4942
  this agent declares no prompts \u2014 use -p "<instruction>" to ask it something`)+(f.startsWith("@")?`
@@ -5011,7 +5011,7 @@ EXAMPLES
5011
5011
  axon search --scope @axon --sort installs --limit 5
5012
5012
  `.trim())}function uda(e){let n=e.platform.cloud;async function A(){if(!n.authenticated)return Wh.info("Not logged in \u2014 run `axon login`."),process.exitCode=1,!1;let i=await n.validate();if(i==="valid")return!0;if(i==="unreachable")Wh.info("Can't reach Axon to verify your session \u2014 check your connection and try again.");else Wh.info("Your session is no longer valid \u2014 run `axon login`.");return process.exitCode=1,!1}return{async login(){let i=zma();try{let s=await n.login({onCode:(g)=>i.code(g)}),u=s.name&&s.name!==s.email?s.name:void 0;i.finish({email:s.email,...u?{scope:u}:{},memberSince:s.memberSince}),EC.ok({command:"login",email:s.email,...u?{scope:u}:{}},()=>{})}catch(s){i.fail({error:oA(s)}),process.exitCode=1}},async logout(){if(!n.authenticated){Wh.info("Not logged in.");return}let i=n.client.user.auth.user?.email;await n.logout(),Wh.ok(i?`Logged out ${i}`:"Logged out")},async whoami(){if(!await A())return;let i=n.client.user.auth.user;if(!i)throw oA("PROFILE_INCOMPLETE",{detail:"log out and back in to rewrite it"});let s=i.name&&i.name!==i.email?i.name:void 0;EC.ok({command:"whoami",email:i.email,...s?{scope:s}:{}},()=>Rma({email:i.email,...s?{scope:s}:{},...i.memberSince!==void 0?{memberSince:i.memberSince}:{}}))},requireAuth:A}}var lda=dt(()=>{ps();dae();AQe()});function gda(e){let n=e.platform.cloud;return{async credit(A,i,s){if(!n.authenticated){Wh.fail("Not logged in \u2014 run `axon login` first."),process.exitCode=1;return}if(!A){Wh.fail("Usage: axon staff credit <@handle> <amountMinor> [reason]"),process.exitCode=1;return}let u=Number.parseInt(i??"",10);if(!Number.isInteger(u)||u<=0){Wh.fail("amount must be a positive integer in minor units (e.g. 5000 = \xA350.00)"),process.exitCode=1;return}try{let d=((await n.client.staff.credit({handle:A,amountMinor:u,...s?{reason:s}:{}})).balanceMinor/100).toFixed(2);Wh.ok(`Credited ${A} ${u} minor units. New balance: \xA3${d}`)}catch(g){let d=g instanceof Error?g.message:String(g);Wh.fail(`Credit failed: ${d}`),process.exitCode=1}}}}var pda=dt(()=>{dae()});function mda(e){async function n(A){let i=await e.platform.projects.openAs("bench",A),s=i.bench;if(!s)throw Error(`BENCH_UNAVAILABLE: ${i.root} has no benchmark runtime`);return{project:i,bench:s}}return{async run(A){let{project:i,bench:s}=await n(A);await i.prepare();let u=await s.run(),g=u.trials.filter((f)=>f.status==="passed").length,d=u.trials.filter((f)=>f.status==="failed").length;Wh.ok(`Benchmark run ${u.manifest.runId}`),Wh.detail(`${g} passed, ${d} failed, ${u.observations.length} observations`)},async result(A,i){if(!i)throw oA("BENCH_RUN_ID_REQUIRED",{detail:"axon bench result <run-id>"});let{bench:s}=await n(A);console.log(JSON.stringify(await s.result(i),null,2))}}}var dda=dt(()=>{ps();dae()});function fda(e){let{platform:n}=e;return{async isExtension(A){if(A.startsWith(".")||A.startsWith("/")||A.startsWith("~"))return n.extensions.isLocalExtension(A);try{return(await n.cloud.client.registry.resolve(A)).kind==="extension"}catch{return!1}},async isPrompt(A){if(A.startsWith(".")||A.startsWith("/")||A.startsWith("~"))return!1;try{return(await n.cloud.client.registry.resolve(A)).kind==="prompt"}catch{return!1}},async isDeclared(A){try{let i=await n.extensions.list(),s=nq(A).name;return i.some((u)=>nq(u).name===s)}catch{return!1}},async install(A){if(!A){Wh.fail("Usage: axon install <@scope/name | ./path>"),process.exitCode=1;return}let i=await n.extensions.install(A);if(Wh.ok(`Installed ${i.ref}`),Wh.detail(`${i.root}`),!i.declared)Wh.detail("already in profile.config.ts \u2014 refetched")},async uninstall(A){if(!A){Wh.fail("Usage: axon ext uninstall <@scope/name | ./path>"),process.exitCode=1;return}let{changed:i,removed:s}=await n.extensions.uninstall(A);if(!i&&!s){Wh.detail(`${A} is not installed`);return}Wh.ok(`Removed ${A}`),Wh.detail("the downloaded copy is shared and was left in place")},async update(A,i={}){let s=await n.extensions.updates();if(s.length===0){Wh.detail("No registry extensions installed.");return}if(A){let g=nq(A).name,d=s.find((B)=>B.name===g);if(!d){Wh.fail(`${A} is not an installed registry extension`),process.exitCode=1;return}if(d.latest===null){Wh.fail(`Could not reach the registry for ${d.name}`),process.exitCode=1;return}if(!d.outdated){Wh.detail(`${d.name} is already at ${d.latest}`);return}let{ref:f}=await n.extensions.update(d.name,d.latest);Wh.ok(`Updated ${d.name} \u2192 ${f.split("@").pop()}`);return}let u=s.filter((g)=>g.outdated);if(!i.all){jma(s,{...u.length>0?{hint:"axon update --all"}:{}});return}if(u.length===0){Wh.detail("Everything is up to date.");return}for(let g of u){let{ref:d}=await n.extensions.update(g.name,g.latest);Wh.ok(`Updated ${g.name} \u2192 ${d.split("@").pop()}`)}},async list(){let A=await n.extensions.list();Yma(A,{hint:"axon ext install <@scope/name>"})}}}var hda=dt(()=>{dGt();dae()});function bda(e){let n=e.exit??((A)=>process.exit(A));return{async update(){let A=await e.platform.updates.handoff();if(A.status==="current"){console.log(`Axon ${A.current} is already up to date.`);return}n(EQt)}}}var Bda=dt(()=>{_Gt()});var Cda={};Ta(Cda,{Cli:()=>FZr});function FZr(e={}){let n=e.platform??QQt({version:bUe.version,daemon:NYe({cloud:()=>n.cloud.client}).agents}),A=Ada({platform:n}),i=Bje({kind:"module",platform:n}),s=Bje({kind:"cognet",platform:n}),u={...Bje({kind:"prompt",platform:n}),async fetch(V){let W=await n.prompts.entries(V);EC.ok({command:"prompt fetch",name:V,prompts:W.map((z)=>z.name)},()=>{Wh.ok(`Cached ${V}`);for(let z of W)Wh.detail(z.name)})}},g={...Bje({kind:"extension",platform:n}),...fda({platform:n})},d=oda({platform:n}),f=uda({platform:n}),B=gda({platform:n}),E=Bje({kind:"bench",platform:n}),Q={...mda({platform:n}),...E},w=bda({platform:n});async function S(V){let W=n.projects.find(V);if(!W)return A;let z=(await n.projects.open(W)).kind;if(z==="agent")return A;if(z==="profile")return A;return{module:i,cognet:s,prompt:u,bench:Q,extension:g}[z]}async function G(V){await(await S(V)).publish(V)}async function q(V,W={}){await(await S(V)).prepare(V,W)}let P={agent:A,module:i,cognet:s,prompt:u,extension:g,registry:d,auth:f,staff:B,bench:Q,update:w,publish:G,prepare:q,version(){return bUe.version},help:cda};return{...P,async ready(){await n.refreshSettings()},commands:m5n({cli:P})}}var Ida=dt(()=>{rGt();wGt();AQe();dae();ada();rda();sda();lda();pda();dda();hda();f0();Bda();kGt()});var M0={};Ta(M0,{parseArgs:()=>tO,isAgentRef:()=>yda,dispatchCommand:()=>NZr,Commands:()=>m5n});function m5n(e){let n=e.cli,A={"--version":({version:i})=>{console.log(i||n.version())},"--help":()=>{n.help()},help:()=>{n.help()},init:({args:i,cwd:s})=>aL(async()=>{let{positional:u}=tO(i);await n.agent.init(u[0],s)}),prepare:({args:i,cwd:s})=>aL(async()=>{let{flags:u}=tO(i);await n.prepare(s,{frozen:u.frozen==="true"})}),dev:({args:i,cwd:s})=>aL(async()=>{let{flags:u}=tO(i),g=u.port?parseInt(u.port,10):void 0;await n.agent.dev(s,{...g!==void 0?{port:g}:{}})}),"*":async({args:i,cwd:s})=>{let u=!1;return await aL(async()=>{let{positional:d,flags:f,repeated:B}=tO(i),E=d[0];if(!E||!yda(E)){EC.fail({message:`Unknown command: ${E??""}`,hint:'Run `axon --help` for the full list, or point at an agent \u2014 `axon ./my-agent -p "\u2026"`'}),process.exitCode=1;return}let{prompt:Q,p:w,P:S,script:G,s:q,context:P,job:V,a:W,attach:z,...te}=f,ie=W==="true"||z==="true",ae=[...B.p??[],...B.prompt??[]],Be=ae.length>0?ae.join(`
5013
5013
 
5014
- `):void 0;if(!(G??q)&&ie){await n.agent.attach(E,[...ae,...S?[S]:[]]),u=!0;return}if(!Be&&!S&&!(G??q)){await n.agent.attach(E),u=!0;return}await n.agent.run(s,{agent:E,...Be?{text:Be}:{},...S?{prompt:S}:{},...G??q?{script:G??q}:{},...P?{context:P}:{},...V?{job:V}:{},args:te})})&&u?"boot":void 0},bundle:({args:i,cwd:s})=>aL(async()=>{let{flags:u}=tO(i);await n.agent.bundle(s,{image:u.image==="true"})}),deploy:({cwd:i})=>aL(async()=>{await n.agent.deploy(i)}),publish:({cwd:i})=>aL(async()=>{await n.publish(i)}),staff:({args:i})=>aL(async()=>{let{positional:s}=tO(i),[u,g,d,...f]=s;if(u==="credit")await n.staff.credit(g,d,f.length>0?f.join(" "):void 0);else console.log("Usage: axon staff credit <@handle> <amountMinor> [reason]")}),install:({args:i,cwd:s})=>Eda(n,i,s),i:({args:i,cwd:s})=>Eda(n,i,s),uninstall:({args:i,cwd:s})=>aL(async()=>{let{positional:u}=tO(i),g=u[0];if(g&&await n.extension.isDeclared(g)){await n.extension.uninstall(g);return}await n.agent.uninstall(s,g)}),search:({args:i})=>aL(async()=>{let{positional:s,flags:u}=tO(i);await n.registry.search({...s[0]?{query:s.join(" ")}:{},...MZr(u)})}),clone:({args:i,cwd:s})=>aL(async()=>{let{positional:u,flags:g}=tO(i),d=u[1]??g.dir;await n.registry.clone(u[0],s,{...d?{dir:d}:{}})}),login:()=>aL(async()=>{await n.auth.login()}),logout:()=>aL(async()=>{await n.auth.logout()}),update:()=>aL(async()=>{await n.update.update()}),whoami:()=>aL(async()=>{await n.auth.whoami()}),daemon:Cje("daemon",(i)=>({up:()=>jMt().then((s)=>s.up(i.json!==void 0)).then((s)=>{console.log(s)}),down:()=>jMt().then((s)=>{console.log(s.down())}),status:()=>jMt().then((s)=>{console.log(s.status())})})),cognet:Cje("cognet",()=>({init:(i,s)=>n.cognet.init(i[0],s),prepare:(i,s)=>n.cognet.prepare(s),publish:(i,s)=>n.cognet.publish(s)})),prompt:Cje("prompt",()=>({init:(i,s)=>n.prompt.init(i[0],s),publish:(i,s)=>n.prompt.publish(s)})),ext:Cje("ext",(i)=>({init:(s,u)=>n.extension.init(s[0],u),prepare:(s,u)=>n.extension.prepare(u),publish:(s,u)=>n.extension.publish(u),install:(s)=>n.extension.install(s[0]),i:(s)=>n.extension.install(s[0]),uninstall:(s)=>n.extension.uninstall(s[0]),remove:(s)=>n.extension.uninstall(s[0]),update:(s)=>n.extension.update(s[0],{all:Boolean(i.all)}),list:()=>n.extension.list(),ls:()=>n.extension.list()})),module:Cje("module",()=>({init:(i,s)=>n.module.init(i[0],s),prepare:(i,s)=>n.module.prepare(s),publish:(i,s)=>n.module.publish(s)})),bench:Cje("bench",()=>({init:(i,s)=>n.bench.init(i[0],s),prepare:(i,s)=>n.bench.prepare(s),run:(i,s)=>n.bench.run(s),result:(i,s)=>n.bench.result(s,i[0])})),extension:(i)=>A.ext(i)};return A}async function SZr(){try{await(await jMt()).up(!0)}catch{}}async function jMt(){let{Axond:e,Cli:n}=await Promise.resolve().then(() => (rGt(),doa)),A=Bun.resolveSync("@arcforge/axond/bin/axond.ts",import.meta.dir);return n({axond:e({entrypoint:A})})}async function NZr(e){let n=e.command;if(!n)return;EC.configure(tO(e.args).flags);let{Cli:A}=await Promise.resolve().then(() => (Ida(),Cda)),i=A();if(await i.ready(),vZr.has(n))await SZr();let s=i.commands,u=s[n];if(!u)return await s["*"]({args:e.args,cwd:e.cwd,version:e.version})==="boot"?"boot":void 0;return await u({args:e.args,cwd:e.cwd,version:e.version})==="boot"?"boot":void 0}function yda(e){if(e==="."||e.startsWith("./")||e.startsWith("../"))return!0;if(e.startsWith("~/")||e.startsWith("/"))return!0;if(e.startsWith("@"))return!0;return/^https?:\/\//.test(e)}function tO(e){let n=[],A={},i={};for(let s=0;s<e.length;s++){let u=e[s],g=YMt(u);if(g===null){n.push(u);continue}let d=Vma(g),f=e[s+1];if(d?.arity==="none"){A[g]="true",(i[g]??=[]).push("true");continue}if(d?.arity==="value"){let B=Xma(g,f);A[g]=B,(i[g]??=[]).push(B),s++;continue}if(f!==void 0&&YMt(f)===null)A[g]=f,(i[g]??=[]).push(f),s++;else A[g]="true",(i[g]??=[]).push("true")}return{positional:n,flags:A,repeated:i}}function MZr(e){let n=new Set;if(e.kind)for(let A of ZSt(e.kind))n.add(A);for(let[A,i]of GZr)if(e[A]==="true")n.add(i);return{...n.size>0?{kind:[...n]}:{},...e.scope?{scope:e.scope}:{},...e.limit?{limit:XSt(e.limit)}:{},...e.sort?{sort:VSt(e.sort)}:{}}}async function Eda(e,n,A){await aL(async()=>{let{positional:i}=tO(n);if(i.length===0)throw oA("MODULE_SPECIFIER_REQUIRED",{detail:"axon install <@scope/name> [@scope/name...]"});let s=[];for(let u of i)if(await e.extension.isExtension(u))await e.extension.install(u);else if(await e.extension.isPrompt(u))await e.prompt.fetch(u);else s.push(u);if(s.length>0)await e.agent.install(A,s)})}function Cje(e,n){return({args:A,cwd:i})=>aL(async()=>{let[s,...u]=A,{positional:g,flags:d}=tO(u),f=s===void 0?void 0:n(d)[s];if(!f){LZr(e,s);return}await f(g,i)})}function LZr(e,n){EC.fail({message:`Unknown ${e} subcommand: ${n??""}`,hint:`try \`axon ${e} --help\``}),process.exitCode=1}async function aL(e){try{return await e(),!0}catch(n){let A=n instanceof Error&&"isAxonError"in n&&n.isAxonError===!0?n:null;if(EC.machine)EC.fail({...A?.code?{code:A.code}:{},message:n instanceof Error?n.message:String(n)});else Kma(oA(n));return process.exitCode=1,!1}}var vZr,GZr;var f0=dt(()=>{ps();AQe();dae();S$();eda();vZr=new Set(["*","dev","run","exec"]);GZr=new Map(wBe.map((e)=>[`${e}s`,e]))});Ks();Ks();Hye();var Osa=Vfn((e)=>{let A=m8().isAuthenticated.value;if(!A&&e.path!=="/auth")return N0t("/auth");if(A&&e.path==="/auth")return N0t("/")});Ks();Ks();Ks();var Um=mp(nh(),1);Ks();Ks();Ks();var Gh=mp(nh(),1);Ks();var zsa=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],SHr=80,DTn=ha.ref(0),DQt=null,NGt=0;function NHr(){if(DQt!==null)return;DQt=setInterval(()=>{DTn.value++},SHr)}function GHr(){if(DQt===null)return;clearInterval(DQt),DQt=null,DTn.value=0}function ere(){return{frame:ha.computed(()=>zsa[DTn.value%zsa.length])}}function Qz(e){let n=!1,A=()=>{if(n)return;n=!0,NGt++,NHr()},i=()=>{if(!n)return;if(n=!1,NGt--,NGt<=0)NGt=0,GHr()};ha.watch(e,(s)=>s?A():i(),{immediate:!0}),ha.onUnmounted(i)}var MHr=Gh.defineComponent,LHr=Gh.toDisplayString;var qHr=Gh.openBlock,UHr=Gh.createElementBlock;var THr=Gh.normalizeStyle;var KHr=Gh.unref;var Wsa={},RHr=MHr({__name:"spinner-glyph",props:{color:{type:String,required:!1,default:"grey"}},setup(e){let n=ere();return Qz(()=>!0),(A,i)=>{return qHr(),UHr("span",{style:THr({color:e.color})},LHr(KHr(n).frame.value),5)}}}),KYe=RHr;A9();YBt();Hye();iD();var b$r=Um.defineComponent,NUe=Um.toDisplayString,JF=Um.createElementVNode;var B$r=Um.createCommentVNode,nre=Um.openBlock,GUe=Um.createElementBlock,KKn=Um.createBlock;var wCe=Um.normalizeClass,RKn=Um.normalizeStyle;var k2=Um.unref;var sla={"data-v-1029c5bb\x00.axon-header":{display:"flex",width:"100%",gap:4,marginBottom:1},"data-v-1029c5bb\x00.logo-section":{width:29,display:"flex",alignItems:"flex-start"},"data-v-1029c5bb\x00.logo":{width:29},"data-v-1029c5bb\x00.stats-section":{flexGrow:1,flexShrink:1,flexBasis:0,display:"flex",flexDirection:"column"},"data-v-1029c5bb\x00.title-line":{display:"flex",height:1,gap:1},"data-v-1029c5bb\x00.title-name":{visualStyles:{bold:!0}},"data-v-1029c5bb\x00.session-id":{pendingVarDecls:[["color","var(--dim)"]],hover:{visualStyles:{underline:!0}}},"data-v-1029c5bb\x00.stat-label":{pendingVarDecls:[["color","var(--dim)"]],width:8},"data-v-1029c5bb\x00.stat-line":{display:"flex",gap:2,height:1},"data-v-1029c5bb\x00.stat-value":{pendingVarDecls:[["color","var(--dim)"]],flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1},"data-v-1029c5bb\x00.divider":{height:1},"data-v-1029c5bb\x00.info-line":{display:"flex",height:1},"data-v-1029c5bb\x00.info-text":{width:"100%"},"data-v-1029c5bb\x00.tagline":{pendingVarDecls:[["color","var(--dim)"]],visualStyles:{italic:!0}}},C$r=`\u2800 \u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2800\u2880\u28C0\u28C0\u28C0\u28C0\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
5014
+ `):void 0;if(!(G??q)&&ie){await n.agent.attach(E,[...ae,...S?[S]:[]]),u=!0;return}if(!Be&&!S&&!(G??q)){await n.agent.attach(E),u=!0;return}await n.agent.run(s,{agent:E,...Be?{text:Be}:{},...S?{prompt:S}:{},...G??q?{script:G??q}:{},...P?{context:P}:{},...V?{job:V}:{},args:te})})&&u?"boot":void 0},bundle:({args:i,cwd:s})=>aL(async()=>{let{flags:u}=tO(i);await n.agent.bundle(s,{image:u.image==="true"})}),deploy:({cwd:i})=>aL(async()=>{await n.agent.deploy(i)}),publish:({cwd:i})=>aL(async()=>{await n.publish(i)}),staff:({args:i})=>aL(async()=>{let{positional:s}=tO(i),[u,g,d,...f]=s;if(u==="credit")await n.staff.credit(g,d,f.length>0?f.join(" "):void 0);else console.log("Usage: axon staff credit <@handle> <amountMinor> [reason]")}),install:({args:i,cwd:s})=>Eda(n,i,s),i:({args:i,cwd:s})=>Eda(n,i,s),uninstall:({args:i,cwd:s})=>aL(async()=>{let{positional:u}=tO(i),g=u[0];if(g&&await n.extension.isDeclared(g)){await n.extension.uninstall(g);return}await n.agent.uninstall(s,g)}),search:({args:i})=>aL(async()=>{let{positional:s,flags:u}=tO(i);await n.registry.search({...s[0]?{query:s.join(" ")}:{},...MZr(u)})}),clone:({args:i,cwd:s})=>aL(async()=>{let{positional:u,flags:g}=tO(i),d=u[1]??g.dir;await n.registry.clone(u[0],s,{...d?{dir:d}:{}})}),login:()=>aL(async()=>{await n.auth.login()}),logout:()=>aL(async()=>{await n.auth.logout()}),update:()=>aL(async()=>{await n.update.update()}),whoami:()=>aL(async()=>{await n.auth.whoami()}),daemon:Cje("daemon",(i)=>({up:()=>jMt().then((s)=>s.up(i.json!==void 0)).then((s)=>{console.log(s)}),down:()=>jMt().then((s)=>{console.log(s.down())}),status:()=>jMt().then((s)=>{console.log(s.status())})})),cognet:Cje("cognet",()=>({init:(i,s)=>n.cognet.init(i[0],s),prepare:(i,s)=>n.cognet.prepare(s),publish:(i,s)=>n.cognet.publish(s)})),prompt:Cje("prompt",()=>({init:(i,s)=>n.prompt.init(i[0],s),publish:(i,s)=>n.prompt.publish(s)})),ext:Cje("ext",(i)=>({init:(s,u)=>n.extension.init(s[0],u),prepare:(s,u)=>n.extension.prepare(u),publish:(s,u)=>n.extension.publish(u),install:(s)=>n.extension.install(s[0]),i:(s)=>n.extension.install(s[0]),uninstall:(s)=>n.extension.uninstall(s[0]),remove:(s)=>n.extension.uninstall(s[0]),update:(s)=>n.extension.update(s[0],{all:Boolean(i.all)}),list:()=>n.extension.list(),ls:()=>n.extension.list()})),module:Cje("module",()=>({init:(i,s)=>n.module.init(i[0],s),prepare:(i,s)=>n.module.prepare(s),publish:(i,s)=>n.module.publish(s)})),bench:Cje("bench",()=>({init:(i,s)=>n.bench.init(i[0],s),prepare:(i,s)=>n.bench.prepare(s),run:(i,s)=>n.bench.run(s),result:(i,s)=>n.bench.result(s,i[0])})),extension:(i)=>A.ext(i)};return A}async function SZr(){try{await(await jMt()).up(!0)}catch(e){throw oA("DAEMON_START_FAILED",{detail:e instanceof Error?e.message:String(e),cause:e})}}async function jMt(){let{Axond:e,Cli:n}=await Promise.resolve().then(() => (rGt(),doa)),A=Bun.resolveSync("@arcforge/axond/bin/axond.ts",import.meta.dir);return n({axond:e({entrypoint:A})})}async function NZr(e){let n=e.command;if(!n)return;EC.configure(tO(e.args).flags);let{Cli:A}=await Promise.resolve().then(() => (Ida(),Cda)),i=A();if(await i.ready(),vZr.has(n))await SZr();let s=i.commands,u=s[n];if(!u)return await s["*"]({args:e.args,cwd:e.cwd,version:e.version})==="boot"?"boot":void 0;return await u({args:e.args,cwd:e.cwd,version:e.version})==="boot"?"boot":void 0}function yda(e){if(e==="."||e.startsWith("./")||e.startsWith("../"))return!0;if(e.startsWith("~/")||e.startsWith("/"))return!0;if(e.startsWith("@"))return!0;return/^https?:\/\//.test(e)}function tO(e){let n=[],A={},i={};for(let s=0;s<e.length;s++){let u=e[s],g=YMt(u);if(g===null){n.push(u);continue}let d=Vma(g),f=e[s+1];if(d?.arity==="none"){A[g]="true",(i[g]??=[]).push("true");continue}if(d?.arity==="value"){let B=Xma(g,f);A[g]=B,(i[g]??=[]).push(B),s++;continue}if(f!==void 0&&YMt(f)===null)A[g]=f,(i[g]??=[]).push(f),s++;else A[g]="true",(i[g]??=[]).push("true")}return{positional:n,flags:A,repeated:i}}function MZr(e){let n=new Set;if(e.kind)for(let A of ZSt(e.kind))n.add(A);for(let[A,i]of GZr)if(e[A]==="true")n.add(i);return{...n.size>0?{kind:[...n]}:{},...e.scope?{scope:e.scope}:{},...e.limit?{limit:XSt(e.limit)}:{},...e.sort?{sort:VSt(e.sort)}:{}}}async function Eda(e,n,A){await aL(async()=>{let{positional:i}=tO(n);if(i.length===0)throw oA("MODULE_SPECIFIER_REQUIRED",{detail:"axon install <@scope/name> [@scope/name...]"});let s=[];for(let u of i)if(await e.extension.isExtension(u))await e.extension.install(u);else if(await e.extension.isPrompt(u))await e.prompt.fetch(u);else s.push(u);if(s.length>0)await e.agent.install(A,s)})}function Cje(e,n){return({args:A,cwd:i})=>aL(async()=>{let[s,...u]=A,{positional:g,flags:d}=tO(u),f=s===void 0?void 0:n(d)[s];if(!f){LZr(e,s);return}await f(g,i)})}function LZr(e,n){EC.fail({message:`Unknown ${e} subcommand: ${n??""}`,hint:`try \`axon ${e} --help\``}),process.exitCode=1}async function aL(e){try{return await e(),!0}catch(n){let A=n instanceof Error&&"isAxonError"in n&&n.isAxonError===!0?n:null;if(EC.machine)EC.fail({...A?.code?{code:A.code}:{},message:n instanceof Error?n.message:String(n)});else Kma(oA(n));return process.exitCode=1,!1}}var vZr,GZr;var f0=dt(()=>{ps();AQe();dae();S$();eda();vZr=new Set(["*","dev","run","exec"]);GZr=new Map(wBe.map((e)=>[`${e}s`,e]))});Ks();Ks();Hye();var Osa=Vfn((e)=>{let A=m8().isAuthenticated.value;if(!A&&e.path!=="/auth")return N0t("/auth");if(A&&e.path==="/auth")return N0t("/")});Ks();Ks();Ks();var Um=mp(nh(),1);Ks();Ks();Ks();var Gh=mp(nh(),1);Ks();var zsa=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],SHr=80,DTn=ha.ref(0),DQt=null,NGt=0;function NHr(){if(DQt!==null)return;DQt=setInterval(()=>{DTn.value++},SHr)}function GHr(){if(DQt===null)return;clearInterval(DQt),DQt=null,DTn.value=0}function ere(){return{frame:ha.computed(()=>zsa[DTn.value%zsa.length])}}function Qz(e){let n=!1,A=()=>{if(n)return;n=!0,NGt++,NHr()},i=()=>{if(!n)return;if(n=!1,NGt--,NGt<=0)NGt=0,GHr()};ha.watch(e,(s)=>s?A():i(),{immediate:!0}),ha.onUnmounted(i)}var MHr=Gh.defineComponent,LHr=Gh.toDisplayString;var qHr=Gh.openBlock,UHr=Gh.createElementBlock;var THr=Gh.normalizeStyle;var KHr=Gh.unref;var Wsa={},RHr=MHr({__name:"spinner-glyph",props:{color:{type:String,required:!1,default:"grey"}},setup(e){let n=ere();return Qz(()=>!0),(A,i)=>{return qHr(),UHr("span",{style:THr({color:e.color})},LHr(KHr(n).frame.value),5)}}}),KYe=RHr;A9();YBt();Hye();iD();var b$r=Um.defineComponent,NUe=Um.toDisplayString,JF=Um.createElementVNode;var B$r=Um.createCommentVNode,nre=Um.openBlock,GUe=Um.createElementBlock,KKn=Um.createBlock;var wCe=Um.normalizeClass,RKn=Um.normalizeStyle;var k2=Um.unref;var sla={"data-v-1029c5bb\x00.axon-header":{display:"flex",width:"100%",gap:4,marginBottom:1},"data-v-1029c5bb\x00.logo-section":{width:29,display:"flex",alignItems:"flex-start"},"data-v-1029c5bb\x00.logo":{width:29},"data-v-1029c5bb\x00.stats-section":{flexGrow:1,flexShrink:1,flexBasis:0,display:"flex",flexDirection:"column"},"data-v-1029c5bb\x00.title-line":{display:"flex",height:1,gap:1},"data-v-1029c5bb\x00.title-name":{visualStyles:{bold:!0}},"data-v-1029c5bb\x00.session-id":{pendingVarDecls:[["color","var(--dim)"]],hover:{visualStyles:{underline:!0}}},"data-v-1029c5bb\x00.stat-label":{pendingVarDecls:[["color","var(--dim)"]],width:8},"data-v-1029c5bb\x00.stat-line":{display:"flex",gap:2,height:1},"data-v-1029c5bb\x00.stat-value":{pendingVarDecls:[["color","var(--dim)"]],flexGrow:1,flexShrink:1,flexBasis:0,scrollable:!1},"data-v-1029c5bb\x00.divider":{height:1},"data-v-1029c5bb\x00.info-line":{display:"flex",height:1},"data-v-1029c5bb\x00.info-text":{width:"100%"},"data-v-1029c5bb\x00.tagline":{pendingVarDecls:[["color","var(--dim)"]],visualStyles:{italic:!0}}},C$r=`\u2800 \u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2800\u2880\u28C0\u28C0\u28C0\u28C0\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
5015
5015
  \u2800\u2800\u2800\u2800\u2880\u28E4\u28F6\u28FF\u28FF\u28FF\u28C6\u2818\u283F\u281F\u28BB\u28FF\u28FF\u2847\u2890\u28F7\u28E6\u28C4\u2840\u2800\u2800\u2800\u2800\u2800\u2800
5016
5016
  \u2800\u2800\u2800\u28B8\u28FF\u28FF\u28FF\u28E7\u2844\u2819\u28FF\u28F7\u28F6\u28F6\u287F\u283F\u283F\u2883\u28FC\u285F\u283B\u28FF\u28FF\u28F6\u2844\u2800\u2800\u2800\u2800
5017
5017
  \u2800\u28B0\u28F7\u28CC\u2819\u2809\u28FF\u28FF\u285F\u2880\u28FF\u28FF\u285F\u2881\u28E4\u28E4\u28F6\u28FE\u28FF\u2847\u2838\u28BF\u28FF\u283F\u2883\u28F4\u2844\u2800\u2800
@@ -5223,4 +5223,4 @@ EXAMPLES
5223
5223
  page, rather than tucked behind a command: a file that runs at boot
5224
5224
  is code someone is actively editing, and a config that silently
5225
5225
  did nothing is indistinguishable from one that never loaded. This
5226
- is the whole feedback loop for writing an extension. `),(a9(!0),m_t(p5n,null,Fma(NR(S),(te,ie)=>{return a9(),m_t(p5n,{key:`config-${ie}`},[te.axon?(a9(),SR(vz,{key:0,error:te.axon},null,8,["error"])):(a9(),SR(ure,{key:1,message:`${te.label}: ${te.message}`},null,8,["message"]))],64)}),128))],8,["scroll-bottom"])}}});Sma.__scopeId="data-v-1ab3a5bb";var Nma=Sma;var C_t=!1;{let e=process.argv.slice(2),n={version:"2.0.164",cwd:process.cwd()},A={"*":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},"--version":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},"--help":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},help:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},init:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},prepare:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},dev:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},bundle:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},deploy:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},publish:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},install:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},i:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},uninstall:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},search:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},clone:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},login:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},logout:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},update:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},whoami:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},cognet:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},prompt:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},ext:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},extension:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},module:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},bench:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},daemon:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},staff:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)}};for(let[i,s]of Object.entries(A))if(i.startsWith("-")&&e.includes(i)){let u=e.indexOf(i);C_t=await s({...n,args:e.slice(u+1),command:i})!=="boot";break}if(!C_t){let i=e.findIndex((u)=>!u.startsWith("-")),s=i===-1?void 0:e[i];if(s&&!(s in A)&&"*"in A)C_t=await A["*"]({...n,args:e.slice(i),command:s})!=="boot";else if(s&&s in A)C_t=await A[s]({...n,args:e.slice(i+1),command:s})!=="boot"}}if(!C_t)t1n({routes:[{path:"/logs/kernel",component:tma,name:"logs-kernel"},{path:"/logs/session",component:ima,name:"logs-session"},{path:"/capsule/:id",component:cma,name:"capsule-id"},{path:"/account",component:gma,name:"account",meta:{layout:"default"}},{path:"/auth",component:fma,name:"auth",meta:{layout:"default"}},{path:"/",component:Nma,name:"home",meta:{layout:"default"}}],styles:[sla,Wsa,mla,Cla,Yla,yla,$ga,Xga,opa,Bpa,Cpa,_pa,wpa,Spa,qpa,Kpa,mpa,hpa,lpa,jpa,Nla,Tla,Dla,zpa,Xpa,Ama,oma,uma,mma,vma],layouts:new Map([["default",Zpa]]),middleware:[Osa],screen:{title:"VTerm"},quitKeys:["C-c"],highlight:{theme:{name:"arcnight",type:"dark",colors:{"editor.background":"#070b10","editor.foreground":"#c7eaff"},tokenColors:[{scope:["variable","variable.other","variable.other.property","variable.other.object.property","variable.other.readwrite","meta.object-literal.key","support.variable.property"],settings:{foreground:"#7cceff"}},{scope:["keyword","keyword.control","keyword.other","storage","storage.type","storage.modifier"],settings:{foreground:"#345a94"}},{scope:["constant.numeric","number"],settings:{foreground:"#326396"}},{scope:["entity.name.type","entity.name.class","constant","support.type"],settings:{foreground:"#3caed5"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"#3caed5"}},{scope:["string","string.quoted","string.template"],settings:{foreground:"#4c6696"}},{scope:["keyword.operator","punctuation.accessor"],settings:{foreground:"#7cceff"}},{scope:["comment","comment.line","comment.block"],settings:{foreground:"#585858",fontStyle:"italic"}},{scope:["punctuation.definition.tag.air"],settings:{foreground:"#2a4a6a"}},{scope:["entity.name.tag.section.air"],settings:{foreground:"#345a94"}},{scope:["entity.name.tag.turn.air"],settings:{foreground:"#3caed5"}},{scope:["entity.name.tag.execute.air"],settings:{foreground:"#00B4D8"}},{scope:["entity.name.tag.stdout.air"],settings:{foreground:"#4c6696"}},{scope:["entity.name.tag.prose.air"],settings:{foreground:"#7cceff"}},{scope:["entity.name.tag.signal.air"],settings:{foreground:"#3caed5"}},{scope:["entity.name.tag.env.air"],settings:{foreground:"#345a94"}},{scope:["entity.name.tag.system.air"],settings:{foreground:"#b43c3c"}},{scope:["entity.name.tag.state.air"],settings:{foreground:"#585858"}},{scope:["entity.other.attribute-name.air"],settings:{foreground:"#4c6696"}},{scope:["string.quoted.double.air"],settings:{foreground:"#326396"}},{scope:["constant.character.entity.air"],settings:{foreground:"#4c6696"}}]}},ui:{cursor:{shape:"line",blink:!0},scrollbar:{thumb:"\u2502",track:"\u2502"}}});
5226
+ is the whole feedback loop for writing an extension. `),(a9(!0),m_t(p5n,null,Fma(NR(S),(te,ie)=>{return a9(),m_t(p5n,{key:`config-${ie}`},[te.axon?(a9(),SR(vz,{key:0,error:te.axon},null,8,["error"])):(a9(),SR(ure,{key:1,message:`${te.label}: ${te.message}`},null,8,["message"]))],64)}),128))],8,["scroll-bottom"])}}});Sma.__scopeId="data-v-1ab3a5bb";var Nma=Sma;var C_t=!1;{let e=process.argv.slice(2),n={version:"2.0.166",cwd:process.cwd()},A={"*":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},"--version":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},"--help":async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},help:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},init:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},prepare:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},dev:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},bundle:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},deploy:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},publish:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},install:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},i:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},uninstall:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},search:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},clone:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},login:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},logout:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},update:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},whoami:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},cognet:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},prompt:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},ext:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},extension:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},module:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},bench:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},daemon:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)},staff:async function(s){let{dispatchCommand:u}=await Promise.resolve().then(() => (f0(),M0));return await u(s)}};for(let[i,s]of Object.entries(A))if(i.startsWith("-")&&e.includes(i)){let u=e.indexOf(i);C_t=await s({...n,args:e.slice(u+1),command:i})!=="boot";break}if(!C_t){let i=e.findIndex((u)=>!u.startsWith("-")),s=i===-1?void 0:e[i];if(s&&!(s in A)&&"*"in A)C_t=await A["*"]({...n,args:e.slice(i),command:s})!=="boot";else if(s&&s in A)C_t=await A[s]({...n,args:e.slice(i+1),command:s})!=="boot"}}if(!C_t)t1n({routes:[{path:"/logs/kernel",component:tma,name:"logs-kernel"},{path:"/logs/session",component:ima,name:"logs-session"},{path:"/capsule/:id",component:cma,name:"capsule-id"},{path:"/account",component:gma,name:"account",meta:{layout:"default"}},{path:"/auth",component:fma,name:"auth",meta:{layout:"default"}},{path:"/",component:Nma,name:"home",meta:{layout:"default"}}],styles:[sla,Wsa,mla,Cla,Yla,yla,$ga,Xga,opa,Bpa,Cpa,_pa,wpa,Spa,qpa,Kpa,mpa,hpa,lpa,jpa,Nla,Tla,Dla,zpa,Xpa,Ama,oma,uma,mma,vma],layouts:new Map([["default",Zpa]]),middleware:[Osa],screen:{title:"VTerm"},quitKeys:["C-c"],highlight:{theme:{name:"arcnight",type:"dark",colors:{"editor.background":"#070b10","editor.foreground":"#c7eaff"},tokenColors:[{scope:["variable","variable.other","variable.other.property","variable.other.object.property","variable.other.readwrite","meta.object-literal.key","support.variable.property"],settings:{foreground:"#7cceff"}},{scope:["keyword","keyword.control","keyword.other","storage","storage.type","storage.modifier"],settings:{foreground:"#345a94"}},{scope:["constant.numeric","number"],settings:{foreground:"#326396"}},{scope:["entity.name.type","entity.name.class","constant","support.type"],settings:{foreground:"#3caed5"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"#3caed5"}},{scope:["string","string.quoted","string.template"],settings:{foreground:"#4c6696"}},{scope:["keyword.operator","punctuation.accessor"],settings:{foreground:"#7cceff"}},{scope:["comment","comment.line","comment.block"],settings:{foreground:"#585858",fontStyle:"italic"}},{scope:["punctuation.definition.tag.air"],settings:{foreground:"#2a4a6a"}},{scope:["entity.name.tag.section.air"],settings:{foreground:"#345a94"}},{scope:["entity.name.tag.turn.air"],settings:{foreground:"#3caed5"}},{scope:["entity.name.tag.execute.air"],settings:{foreground:"#00B4D8"}},{scope:["entity.name.tag.stdout.air"],settings:{foreground:"#4c6696"}},{scope:["entity.name.tag.prose.air"],settings:{foreground:"#7cceff"}},{scope:["entity.name.tag.signal.air"],settings:{foreground:"#3caed5"}},{scope:["entity.name.tag.env.air"],settings:{foreground:"#345a94"}},{scope:["entity.name.tag.system.air"],settings:{foreground:"#b43c3c"}},{scope:["entity.name.tag.state.air"],settings:{foreground:"#585858"}},{scope:["entity.other.attribute-name.air"],settings:{foreground:"#4c6696"}},{scope:["string.quoted.double.air"],settings:{foreground:"#326396"}},{scope:["constant.character.entity.air"],settings:{foreground:"#4c6696"}}]}},ui:{cursor:{shape:"line",blink:!0},scrollbar:{thumb:"\u2502",track:"\u2502"}}});