codexapp 0.1.18 → 0.1.20

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.
@@ -0,0 +1,48 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/**
2
+ * @vue/shared v3.5.28
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function Yo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const at={},ws=[],fn=()=>{},ll=()=>!1,Er=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Jo=e=>e.startsWith("onUpdate:"),_t=Object.assign,Qo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lu=Object.prototype.hasOwnProperty,et=(e,t)=>lu.call(e,t),Me=Array.isArray,bs=e=>er(e)==="[object Map]",cl=e=>er(e)==="[object Set]",Ri=e=>er(e)==="[object Date]",De=e=>typeof e=="function",gt=e=>typeof e=="string",Xt=e=>typeof e=="symbol",tt=e=>e!==null&&typeof e=="object",ul=e=>(tt(e)||De(e))&&De(e.then)&&De(e.catch),dl=Object.prototype.toString,er=e=>dl.call(e),cu=e=>er(e).slice(8,-1),fl=e=>er(e)==="[object Object]",Xo=e=>gt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ls=Yo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ar=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},uu=/-\w/g,Yt=Ar(e=>e.replace(uu,t=>t.slice(1).toUpperCase())),du=/\B([A-Z])/g,Fn=Ar(e=>e.replace(du,"-$1").toLowerCase()),Ir=Ar(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xr=Ar(e=>e?`on${Ir(e)}`:""),jn=(e,t)=>!Object.is(e,t),hr=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},hl=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Zo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fu=e=>{const t=gt(e)?Number(e):NaN;return isNaN(t)?e:t};let $i;const Rr=()=>$i||($i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rs(e){if(Me(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=gt(s)?gu(s):rs(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(gt(e)||tt(e))return e}const hu=/;(?![^(]*\))/g,pu=/:([^]+)/,mu=/\/\*[^]*?\*\//g;function gu(e){const t={};return e.replace(mu,"").split(hu).forEach(n=>{if(n){const s=n.split(pu);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function lt(e){let t="";if(gt(e))t=e;else if(Me(e))for(let n=0;n<e.length;n++){const s=lt(e[n]);s&&(t+=s+" ")}else if(tt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const vu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",yu=Yo(vu);function pl(e){return!!e||e===""}function wu(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=ei(e[s],t[s]);return n}function ei(e,t){if(e===t)return!0;let n=Ri(e),s=Ri(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Xt(e),s=Xt(t),n||s)return e===t;if(n=Me(e),s=Me(t),n||s)return n&&s?wu(e,t):!1;if(n=tt(e),s=tt(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,o=Object.keys(t).length;if(r!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!ei(e[i],t[i]))return!1}}return String(e)===String(t)}const ml=e=>!!(e&&e.__v_isRef===!0),be=e=>gt(e)?e:e==null?"":Me(e)||tt(e)&&(e.toString===dl||!De(e.toString))?ml(e)?be(e.value):JSON.stringify(e,gl,2):String(e),gl=(e,t)=>ml(t)?gl(e,t.value):bs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Zr(s,o)+" =>"]=r,n),{})}:cl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Zr(n))}:Xt(t)?Zr(t):tt(t)&&!Me(t)&&!fl(t)?String(t):t,Zr=(e,t="")=>{var n;return Xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.28
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let Dt;class bu{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Dt,!t&&Dt&&(this.index=(Dt.scopes||(Dt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Dt;try{return Dt=this,t()}finally{Dt=n}}}on(){++this._on===1&&(this.prevScope=Dt,Dt=this)}off(){this._on>0&&--this._on===0&&(Dt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function _u(){return Dt}let ut;const eo=new WeakSet;class vl{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Dt&&Dt.active&&Dt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,eo.has(this)&&(eo.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||wl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mi(this),bl(this);const t=ut,n=Jt;ut=this,Jt=!0;try{return this.fn()}finally{_l(this),ut=t,Jt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)si(t);this.deps=this.depsTail=void 0,Mi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?eo.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Co(this)&&this.run()}get dirty(){return Co(this)}}let yl=0,Ds,Bs;function wl(e,t=!1){if(e.flags|=8,t){e.next=Bs,Bs=e;return}e.next=Ds,Ds=e}function ti(){yl++}function ni(){if(--yl>0)return;if(Bs){let t=Bs;for(Bs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ds;){let t=Ds;for(Ds=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function bl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _l(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),si(s),ku(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Co(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(kl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function kl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ws)||(e.globalVersion=Ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Co(e))))return;e.flags|=2;const t=e.dep,n=ut,s=Jt;ut=e,Jt=!0;try{bl(e);const r=e.fn(e._value);(t.version===0||jn(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{ut=n,Jt=s,_l(e),e.flags&=-3}}function si(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)si(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ku(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Jt=!0;const Tl=[];function kn(){Tl.push(Jt),Jt=!1}function Tn(){const e=Tl.pop();Jt=e===void 0?!0:e}function Mi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ut;ut=void 0;try{t()}finally{ut=n}}}let Ws=0;class Tu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ri{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ut||!Jt||ut===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ut)n=this.activeLink=new Tu(ut,this),ut.deps?(n.prevDep=ut.depsTail,ut.depsTail.nextDep=n,ut.depsTail=n):ut.deps=ut.depsTail=n,Sl(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ut.depsTail,n.nextDep=void 0,ut.depsTail.nextDep=n,ut.depsTail=n,ut.deps===n&&(ut.deps=s)}return n}trigger(t){this.version++,Ws++,this.notify(t)}notify(t){ti();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ni()}}}function Sl(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Sl(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Eo=new WeakMap,ns=Symbol(""),Ao=Symbol(""),Ks=Symbol("");function It(e,t,n){if(Jt&&ut){let s=Eo.get(e);s||Eo.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new ri),r.map=s,r.key=n),r.track()}}function wn(e,t,n,s,r,o){const i=Eo.get(e);if(!i){Ws++;return}const a=l=>{l&&l.trigger()};if(ti(),t==="clear")i.forEach(a);else{const l=Me(e),d=l&&Xo(n);if(l&&n==="length"){const u=Number(s);i.forEach((f,g)=>{(g==="length"||g===Ks||!Xt(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(Ks)),t){case"add":l?d&&a(i.get("length")):(a(i.get(ns)),bs(e)&&a(i.get(Ao)));break;case"delete":l||(a(i.get(ns)),bs(e)&&a(i.get(Ao)));break;case"set":bs(e)&&a(i.get(ns));break}}ni()}function ps(e){const t=Ye(e);return t===e?t:(It(t,"iterate",Ks),zt(e)?t:t.map(Zt))}function $r(e){return It(e=Ye(e),"iterate",Ks),e}function Mn(e,t){return Sn(e)?Ss(ss(e)?Zt(t):t):Zt(t)}const Su={__proto__:null,[Symbol.iterator](){return to(this,Symbol.iterator,e=>Mn(this,e))},concat(...e){return ps(this).concat(...e.map(t=>Me(t)?ps(t):t))},entries(){return to(this,"entries",e=>(e[1]=Mn(this,e[1]),e))},every(e,t){return pn(this,"every",e,t,void 0,arguments)},filter(e,t){return pn(this,"filter",e,t,n=>n.map(s=>Mn(this,s)),arguments)},find(e,t){return pn(this,"find",e,t,n=>Mn(this,n),arguments)},findIndex(e,t){return pn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return pn(this,"findLast",e,t,n=>Mn(this,n),arguments)},findLastIndex(e,t){return pn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return pn(this,"forEach",e,t,void 0,arguments)},includes(...e){return no(this,"includes",e)},indexOf(...e){return no(this,"indexOf",e)},join(e){return ps(this).join(e)},lastIndexOf(...e){return no(this,"lastIndexOf",e)},map(e,t){return pn(this,"map",e,t,void 0,arguments)},pop(){return Rs(this,"pop")},push(...e){return Rs(this,"push",e)},reduce(e,...t){return Pi(this,"reduce",e,t)},reduceRight(e,...t){return Pi(this,"reduceRight",e,t)},shift(){return Rs(this,"shift")},some(e,t){return pn(this,"some",e,t,void 0,arguments)},splice(...e){return Rs(this,"splice",e)},toReversed(){return ps(this).toReversed()},toSorted(e){return ps(this).toSorted(e)},toSpliced(...e){return ps(this).toSpliced(...e)},unshift(...e){return Rs(this,"unshift",e)},values(){return to(this,"values",e=>Mn(this,e))}};function to(e,t,n){const s=$r(e),r=s[t]();return s!==e&&!zt(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const xu=Array.prototype;function pn(e,t,n,s,r,o){const i=$r(e),a=i!==e&&!zt(e),l=i[t];if(l!==xu[t]){const f=l.apply(e,o);return a?Zt(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,Mn(e,f),g,e)}:n.length>2&&(d=function(f,g){return n.call(this,f,g,e)}));const u=l.call(i,d,s);return a&&r?r(u):u}function Pi(e,t,n,s){const r=$r(e);let o=n;return r!==e&&(zt(e)?n.length>3&&(o=function(i,a,l){return n.call(this,i,a,l,e)}):o=function(i,a,l){return n.call(this,i,Mn(e,a),l,e)}),r[t](o,...s)}function no(e,t,n){const s=Ye(e);It(s,"iterate",Ks);const r=s[t](...n);return(r===-1||r===!1)&&ai(n[0])?(n[0]=Ye(n[0]),s[t](...n)):r}function Rs(e,t,n=[]){kn(),ti();const s=Ye(e)[t].apply(e,n);return ni(),Tn(),s}const Cu=Yo("__proto__,__v_isRef,__isVue"),xl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Xt));function Eu(e){Xt(e)||(e=String(e));const t=Ye(this);return It(t,"has",e),t.hasOwnProperty(e)}class Cl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Lu:Rl:o?Il:Al).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=Me(t);if(!r){let l;if(i&&(l=Su[n]))return l;if(n==="hasOwnProperty")return Eu}const a=Reflect.get(t,n,Mt(t)?t:s);if((Xt(n)?xl.has(n):Cu(n))||(r||It(t,"get",n),o))return a;if(Mt(a)){const l=i&&Xo(n)?a:a.value;return r&&tt(l)?Ro(l):l}return tt(a)?r?Ro(a):Mr(a):a}}class El extends Cl{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];const i=Me(t)&&Xo(n);if(!this._isShallow){const d=Sn(o);if(!zt(s)&&!Sn(s)&&(o=Ye(o),s=Ye(s)),!i&&Mt(o)&&!Mt(s))return d||(o.value=s),!0}const a=i?Number(n)<t.length:et(t,n),l=Reflect.set(t,n,s,Mt(t)?t:r);return t===Ye(r)&&(a?jn(s,o)&&wn(t,"set",n,s):wn(t,"add",n,s)),l}deleteProperty(t,n){const s=et(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&wn(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!Xt(n)||!xl.has(n))&&It(t,"has",n),s}ownKeys(t){return It(t,"iterate",Me(t)?"length":ns),Reflect.ownKeys(t)}}class Au extends Cl{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Iu=new El,Ru=new Au,$u=new El(!0);const Io=e=>e,or=e=>Reflect.getPrototypeOf(e);function Mu(e,t,n){return function(...s){const r=this.__v_raw,o=Ye(r),i=bs(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=r[e](...s),u=n?Io:t?Ss:Zt;return!t&&It(o,"iterate",l?Ao:ns),_t(Object.create(d),{next(){const{value:f,done:g}=d.next();return g?{value:f,done:g}:{value:a?[u(f[0]),u(f[1])]:u(f),done:g}}})}}function ir(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Pu(e,t){const n={get(r){const o=this.__v_raw,i=Ye(o),a=Ye(r);e||(jn(r,a)&&It(i,"get",r),It(i,"get",a));const{has:l}=or(i),d=t?Io:e?Ss:Zt;if(l.call(i,r))return d(o.get(r));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!e&&It(Ye(r),"iterate",ns),r.size},has(r){const o=this.__v_raw,i=Ye(o),a=Ye(r);return e||(jn(r,a)&&It(i,"has",r),It(i,"has",a)),r===a?o.has(r):o.has(r)||o.has(a)},forEach(r,o){const i=this,a=i.__v_raw,l=Ye(a),d=t?Io:e?Ss:Zt;return!e&&It(l,"iterate",ns),a.forEach((u,f)=>r.call(o,d(u),d(f),i))}};return _t(n,e?{add:ir("add"),set:ir("set"),delete:ir("delete"),clear:ir("clear")}:{add(r){!t&&!zt(r)&&!Sn(r)&&(r=Ye(r));const o=Ye(this);return or(o).has.call(o,r)||(o.add(r),wn(o,"add",r,r)),this},set(r,o){!t&&!zt(o)&&!Sn(o)&&(o=Ye(o));const i=Ye(this),{has:a,get:l}=or(i);let d=a.call(i,r);d||(r=Ye(r),d=a.call(i,r));const u=l.call(i,r);return i.set(r,o),d?jn(o,u)&&wn(i,"set",r,o):wn(i,"add",r,o),this},delete(r){const o=Ye(this),{has:i,get:a}=or(o);let l=i.call(o,r);l||(r=Ye(r),l=i.call(o,r)),a&&a.call(o,r);const d=o.delete(r);return l&&wn(o,"delete",r,void 0),d},clear(){const r=Ye(this),o=r.size!==0,i=r.clear();return o&&wn(r,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Mu(r,e,t)}),n}function oi(e,t){const n=Pu(e,t);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(et(n,r)&&r in s?n:s,r,o)}const Nu={get:oi(!1,!1)},Ou={get:oi(!1,!0)},ju={get:oi(!0,!1)};const Al=new WeakMap,Il=new WeakMap,Rl=new WeakMap,Lu=new WeakMap;function Du(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bu(e){return e.__v_skip||!Object.isExtensible(e)?0:Du(cu(e))}function Mr(e){return Sn(e)?e:ii(e,!1,Iu,Nu,Al)}function $l(e){return ii(e,!1,$u,Ou,Il)}function Ro(e){return ii(e,!0,Ru,ju,Rl)}function ii(e,t,n,s,r){if(!tt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Bu(e);if(o===0)return e;const i=r.get(e);if(i)return i;const a=new Proxy(e,o===2?s:n);return r.set(e,a),a}function ss(e){return Sn(e)?ss(e.__v_raw):!!(e&&e.__v_isReactive)}function Sn(e){return!!(e&&e.__v_isReadonly)}function zt(e){return!!(e&&e.__v_isShallow)}function ai(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function Fu(e){return!et(e,"__v_skip")&&Object.isExtensible(e)&&hl(e,"__v_skip",!0),e}const Zt=e=>tt(e)?Mr(e):e,Ss=e=>tt(e)?Ro(e):e;function Mt(e){return e?e.__v_isRef===!0:!1}function O(e){return Ml(e,!1)}function Hu(e){return Ml(e,!0)}function Ml(e,t){return Mt(e)?e:new Uu(e,t)}class Uu{constructor(t,n){this.dep=new ri,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ye(t),this._value=n?t:Zt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||zt(t)||Sn(t);t=s?t:Ye(t),jn(t,n)&&(this._rawValue=t,this._value=s?t:Zt(t),this.dep.trigger())}}function $e(e){return Mt(e)?e.value:e}const Vu={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Mt(r)&&!Mt(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Pl(e){return ss(e)?e:new Proxy(e,Vu)}class qu{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ri(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ut!==this)return wl(this,!0),!0}get value(){const t=this.dep.track();return kl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Wu(e,t,n=!1){let s,r;return De(e)?s=e:(s=e.get,r=e.set),new qu(s,r,n)}const ar={},yr=new WeakMap;let Xn;function Ku(e,t=!1,n=Xn){if(n){let s=yr.get(n);s||yr.set(n,s=[]),s.push(e)}}function Gu(e,t,n=at){const{immediate:s,deep:r,once:o,scheduler:i,augmentJob:a,call:l}=n,d=B=>r?B:zt(B)||r===!1||r===0?bn(B,1):bn(B);let u,f,g,_,M=!1,I=!1;if(Mt(e)?(f=()=>e.value,M=zt(e)):ss(e)?(f=()=>d(e),M=!0):Me(e)?(I=!0,M=e.some(B=>ss(B)||zt(B)),f=()=>e.map(B=>{if(Mt(B))return B.value;if(ss(B))return d(B);if(De(B))return l?l(B,2):B()})):De(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){kn();try{g()}finally{Tn()}}const B=Xn;Xn=u;try{return l?l(e,3,[_]):e(_)}finally{Xn=B}}:f=fn,t&&r){const B=f,le=r===!0?1/0:r;f=()=>bn(B(),le)}const D=_u(),G=()=>{u.stop(),D&&D.active&&Qo(D.effects,u)};if(o&&t){const B=t;t=(...le)=>{B(...le),G()}}let P=I?new Array(e.length).fill(ar):ar;const U=B=>{if(!(!(u.flags&1)||!u.dirty&&!B))if(t){const le=u.run();if(r||M||(I?le.some((ie,ce)=>jn(ie,P[ce])):jn(le,P))){g&&g();const ie=Xn;Xn=u;try{const ce=[le,P===ar?void 0:I&&P[0]===ar?[]:P,_];P=le,l?l(t,3,ce):t(...ce)}finally{Xn=ie}}}else u.run()};return a&&a(U),u=new vl(f),u.scheduler=i?()=>i(U,!1):U,_=B=>Ku(B,!1,u),g=u.onStop=()=>{const B=yr.get(u);if(B){if(l)l(B,4);else for(const le of B)le();yr.delete(u)}},t?s?U(!0):P=u.run():i?i(U.bind(null,!0),!0):u.run(),G.pause=u.pause.bind(u),G.resume=u.resume.bind(u),G.stop=G,G}function bn(e,t=1/0,n){if(t<=0||!tt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Mt(e))bn(e.value,t,n);else if(Me(e))for(let s=0;s<e.length;s++)bn(e[s],t,n);else if(cl(e)||bs(e))e.forEach(s=>{bn(s,t,n)});else if(fl(e)){for(const s in e)bn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&bn(e[s],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.28
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function tr(e,t,n,s){try{return s?e(...s):e()}catch(r){Pr(r,t,n)}}function en(e,t,n,s){if(De(e)){const r=tr(e,t,n,s);return r&&ul(r)&&r.catch(o=>{Pr(o,t,n)}),r}if(Me(e)){const r=[];for(let o=0;o<e.length;o++)r.push(en(e[o],t,n,s));return r}}function Pr(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||at;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,l,d)===!1)return}a=a.parent}if(o){kn(),tr(o,null,10,[e,l,d]),Tn();return}}zu(e,n,r,s,i)}function zu(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const jt=[];let ln=-1;const _s=[];let Pn=null,gs=0;const Nl=Promise.resolve();let wr=null;function tn(e){const t=wr||Nl;return e?t.then(this?e.bind(this):e):t}function Yu(e){let t=ln+1,n=jt.length;for(;t<n;){const s=t+n>>>1,r=jt[s],o=Gs(r);o<e||o===e&&r.flags&2?t=s+1:n=s}return t}function li(e){if(!(e.flags&1)){const t=Gs(e),n=jt[jt.length-1];!n||!(e.flags&2)&&t>=Gs(n)?jt.push(e):jt.splice(Yu(t),0,e),e.flags|=1,Ol()}}function Ol(){wr||(wr=Nl.then(Ll))}function Ju(e){Me(e)?_s.push(...e):Pn&&e.id===-1?Pn.splice(gs+1,0,e):e.flags&1||(_s.push(e),e.flags|=1),Ol()}function Ni(e,t,n=ln+1){for(;n<jt.length;n++){const s=jt[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;jt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function jl(e){if(_s.length){const t=[...new Set(_s)].sort((n,s)=>Gs(n)-Gs(s));if(_s.length=0,Pn){Pn.push(...t);return}for(Pn=t,gs=0;gs<Pn.length;gs++){const n=Pn[gs];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pn=null,gs=0}}const Gs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ll(e){try{for(ln=0;ln<jt.length;ln++){const t=jt[ln];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),tr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ln<jt.length;ln++){const t=jt[ln];t&&(t.flags&=-2)}ln=-1,jt.length=0,jl(),wr=null,(jt.length||_s.length)&&Ll()}}let xt=null,Dl=null;function br(e){const t=xt;return xt=e,Dl=e&&e.type.__scopeId||null,t}function st(e,t=xt,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Tr(-1);const o=br(t);let i;try{i=e(...r)}finally{br(o),s._d&&Tr(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function Ln(e,t){if(xt===null)return e;const n=Br(xt),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[o,i,a,l=at]=t[r];o&&(De(o)&&(o={mounted:o,updated:o}),o.deep&&bn(i),s.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Gn(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;i<r.length;i++){const a=r[i];o&&(a.oldValue=o[i].value);let l=a.dir[s];l&&(kn(),en(l,n,8,[e.el,a,e,t]),Tn())}}function pr(e,t){if($t){let n=$t.provides;const s=$t.parent&&$t.parent.provides;s===n&&(n=$t.provides=Object.create(s)),n[e]=t}}function Qt(e,t,n=!1){const s=hi();if(s||Ts){let r=Ts?Ts._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&De(t)?t.call(s&&s.proxy):t}}const Qu=Symbol.for("v-scx"),Xu=()=>Qt(Qu);function pt(e,t,n){return Bl(e,t,n)}function Bl(e,t,n=at){const{immediate:s,deep:r,flush:o,once:i}=n,a=_t({},n),l=t&&s||!t&&o!=="post";let d;if(Qs){if(o==="sync"){const _=Xu();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=fn,_.resume=fn,_.pause=fn,_}}const u=$t;a.call=(_,M,I)=>en(_,u,M,I);let f=!1;o==="post"?a.scheduler=_=>{At(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,M)=>{M?_():li(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const g=Gu(e,t,a);return Qs&&(d?d.push(g):l&&g()),g}function Zu(e,t,n){const s=this.proxy,r=gt(e)?e.includes(".")?Fl(s,e):()=>s[e]:e.bind(s,s);let o;De(t)?o=t:(o=t.handler,n=t);const i=nr(this),a=Bl(r,o.bind(s),n);return i(),a}function Fl(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const Hl=Symbol("_vte"),Ul=e=>e.__isTeleport,Fs=e=>e&&(e.disabled||e.disabled===""),Oi=e=>e&&(e.defer||e.defer===""),ji=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Li=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,$o=(e,t)=>{const n=e&&e.to;return gt(n)?t?t(n):null:n},Vl={name:"Teleport",__isTeleport:!0,process(e,t,n,s,r,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:_,querySelector:M,createText:I,createComment:D}}=d,G=Fs(t.props);let{shapeFlag:P,children:U,dynamicChildren:B}=t;if(e==null){const le=t.el=I(""),ie=t.anchor=I("");_(le,n,s),_(ie,n,s);const ce=(oe,Z)=>{P&16&&u(U,oe,Z,r,o,i,a,l)},me=()=>{const oe=t.target=$o(t.props,M),Z=Mo(oe,t,I,_);oe&&(i!=="svg"&&ji(oe)?i="svg":i!=="mathml"&&Li(oe)&&(i="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(oe),G||(ce(oe,Z),mr(t,!1)))};G&&(ce(n,ie),mr(t,!0)),Oi(t.props)?(t.el.__isMounted=!1,At(()=>{me(),delete t.el.__isMounted},o)):me()}else{if(Oi(t.props)&&e.el.__isMounted===!1){At(()=>{Vl.process(e,t,n,s,r,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const le=t.anchor=e.anchor,ie=t.target=e.target,ce=t.targetAnchor=e.targetAnchor,me=Fs(e.props),oe=me?n:ie,Z=me?le:ce;if(i==="svg"||ji(ie)?i="svg":(i==="mathml"||Li(ie))&&(i="mathml"),B?(g(e.dynamicChildren,B,oe,r,o,i,a),di(e,t,!0)):l||f(e,t,oe,Z,r,o,i,a,!1),G)me?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):lr(t,n,le,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ge=t.target=$o(t.props,M);ge&&lr(t,ge,null,d,0)}else me&&lr(t,ie,ce,d,1);mr(t,G)}},remove(e,t,n,{um:s,o:{remove:r}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:g}=e;if(f&&(r(d),r(u)),o&&r(l),i&16){const _=o||!Fs(g);for(let M=0;M<a.length;M++){const I=a[M];s(I,t,n,_,!!I.dynamicChildren)}}},move:lr,hydrate:ed};function lr(e,t,n,{o:{insert:s},m:r},o=2){o===0&&s(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,f=o===2;if(f&&s(i,t,n),(!f||Fs(u))&&l&16)for(let g=0;g<d.length;g++)r(d[g],t,n,2);f&&s(a,t,n)}function ed(e,t,n,s,r,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(D,G){let P=G;for(;P;){if(P&&P.nodeType===8){if(P.data==="teleport start anchor")t.targetStart=P;else if(P.data==="teleport anchor"){t.targetAnchor=P,D._lpa=t.targetAnchor&&i(t.targetAnchor);break}}P=i(P)}}function _(D,G){G.anchor=f(i(D),G,a(D),n,s,r,o)}const M=t.target=$o(t.props,l),I=Fs(t.props);if(M){const D=M._lpa||M.firstChild;t.shapeFlag&16&&(I?(_(e,t),g(M,D),t.targetAnchor||Mo(M,t,u,d,a(e)===M?e:null)):(t.anchor=i(e),g(M,D),t.targetAnchor||Mo(M,t,u,d),f(D&&i(D),t,M,n,s,r,o))),mr(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const ql=Vl;function mr(e,t){const n=e.ctx;if(n&&n.ut){let s,r;for(t?(s=e.el,r=e.anchor):(s=e.targetStart,r=e.targetAnchor);s&&s!==r;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Mo(e,t,n,s,r=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Hl]=i,e&&(s(o,e,r),s(i,e,r)),i}const cn=Symbol("_leaveCb"),$s=Symbol("_enterCb");function td(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hn(()=>{e.isMounted=!0}),Un(()=>{e.isUnmounting=!0}),e}const Kt=[Function,Array],Wl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Kt,onEnter:Kt,onAfterEnter:Kt,onEnterCancelled:Kt,onBeforeLeave:Kt,onLeave:Kt,onAfterLeave:Kt,onLeaveCancelled:Kt,onBeforeAppear:Kt,onAppear:Kt,onAfterAppear:Kt,onAppearCancelled:Kt},Kl=e=>{const t=e.subTree;return t.component?Kl(t.component):t},nd={name:"BaseTransition",props:Wl,setup(e,{slots:t}){const n=hi(),s=td();return()=>{const r=t.default&&Yl(t.default(),!0);if(!r||!r.length)return;const o=Gl(r),i=Ye(e),{mode:a}=i;if(s.isLeaving)return so(o);const l=Di(o);if(!l)return so(o);let d=Po(l,i,s,n,f=>d=f);l.type!==Rt&&zs(l,d);let u=n.subTree&&Di(n.subTree);if(u&&u.type!==Rt&&!Zn(u,l)&&Kl(n).type!==Rt){let f=Po(u,i,s,n);if(zs(u,f),a==="out-in"&&l.type!==Rt)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},so(o);a==="in-out"&&l.type!==Rt?f.delayLeave=(g,_,M)=>{const I=zl(s,u);I[String(u.key)]=u,g[cn]=()=>{_(),g[cn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{M(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Gl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Rt){t=n;break}}return t}const sd=nd;function zl(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Po(e,t,n,s,r){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:_,onAfterLeave:M,onLeaveCancelled:I,onBeforeAppear:D,onAppear:G,onAfterAppear:P,onAppearCancelled:U}=t,B=String(e.key),le=zl(n,e),ie=(oe,Z)=>{oe&&en(oe,s,9,Z)},ce=(oe,Z)=>{const ge=Z[1];ie(oe,Z),Me(oe)?oe.every(Q=>Q.length<=1)&&ge():oe.length<=1&&ge()},me={mode:i,persisted:a,beforeEnter(oe){let Z=l;if(!n.isMounted)if(o)Z=D||l;else return;oe[cn]&&oe[cn](!0);const ge=le[B];ge&&Zn(e,ge)&&ge.el[cn]&&ge.el[cn](),ie(Z,[oe])},enter(oe){let Z=d,ge=u,Q=f;if(!n.isMounted)if(o)Z=G||d,ge=P||u,Q=U||f;else return;let Ne=!1;oe[$s]=rt=>{Ne||(Ne=!0,rt?ie(Q,[oe]):ie(ge,[oe]),me.delayedLeave&&me.delayedLeave(),oe[$s]=void 0)};const Ve=oe[$s].bind(null,!1);Z?ce(Z,[oe,Ve]):Ve()},leave(oe,Z){const ge=String(e.key);if(oe[$s]&&oe[$s](!0),n.isUnmounting)return Z();ie(g,[oe]);let Q=!1;oe[cn]=Ve=>{Q||(Q=!0,Z(),Ve?ie(I,[oe]):ie(M,[oe]),oe[cn]=void 0,le[ge]===e&&delete le[ge])};const Ne=oe[cn].bind(null,!1);le[ge]=e,_?ce(_,[oe,Ne]):Ne()},clone(oe){const Z=Po(oe,t,n,s,r);return r&&r(Z),Z}};return me}function so(e){if(Nr(e))return e=Dn(e),e.children=null,e}function Di(e){if(!Nr(e))return Ul(e.type)&&e.children?Gl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&De(n.default))return n.default()}}function zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,zs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Yl(e,t=!1,n){let s=[],r=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Le?(i.patchFlag&128&&r++,s=s.concat(Yl(i.children,t,a))):(t||i.type!==Rt)&&s.push(a!=null?Dn(i,{key:a}):i)}if(r>1)for(let o=0;o<s.length;o++)s[o].patchFlag=-2;return s}function Ct(e,t){return De(e)?_t({name:e.name},t,{setup:e}):e}function Jl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Bi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const _r=new WeakMap;function Hs(e,t,n,s,r=!1){if(Me(e)){e.forEach((I,D)=>Hs(I,t&&(Me(t)?t[D]:t),n,s,r));return}if(ks(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Hs(e,t,n,s.component.subTree);return}const o=s.shapeFlag&4?Br(s.component):s.el,i=r?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===at?a.refs={}:a.refs,f=a.setupState,g=Ye(f),_=f===at?ll:I=>Bi(u,I)?!1:et(g,I),M=(I,D)=>!(D&&Bi(u,D));if(d!=null&&d!==l){if(Fi(t),gt(d))u[d]=null,_(d)&&(f[d]=null);else if(Mt(d)){const I=t;M(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(De(l))tr(l,a,12,[i,u]);else{const I=gt(l),D=Mt(l);if(I||D){const G=()=>{if(e.f){const P=I?_(l)?f[l]:u[l]:M()||!e.k?l.value:u[e.k];if(r)Me(P)&&Qo(P,o);else if(Me(P))P.includes(o)||P.push(o);else if(I)u[l]=[o],_(l)&&(f[l]=u[l]);else{const U=[o];M(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else I?(u[l]=i,_(l)&&(f[l]=i)):D&&(M(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const P=()=>{G(),_r.delete(e)};P.id=-1,_r.set(e,P),At(P,n)}else Fi(e),G()}}}function Fi(e){const t=_r.get(e);t&&(t.flags|=8,_r.delete(e))}Rr().requestIdleCallback;Rr().cancelIdleCallback;const ks=e=>!!e.type.__asyncLoader,Nr=e=>e.type.__isKeepAlive;function rd(e,t){Ql(e,"a",t)}function od(e,t){Ql(e,"da",t)}function Ql(e,t,n=$t){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Or(t,s,n),n){let r=n.parent;for(;r&&r.parent;)Nr(r.parent.vnode)&&id(s,t,n,r),r=r.parent}}function id(e,t,n,s){const r=Or(t,e,s,!0);jr(()=>{Qo(s[t],r)},n)}function Or(e,t,n=$t,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{kn();const a=nr(n),l=en(t,n,e,i);return a(),Tn(),l});return s?r.unshift(o):r.push(o),o}}const xn=e=>(t,n=$t)=>{(!Qs||e==="sp")&&Or(e,(...s)=>t(...s),n)},ad=xn("bm"),Hn=xn("m"),ld=xn("bu"),cd=xn("u"),Un=xn("bum"),jr=xn("um"),ud=xn("sp"),dd=xn("rtg"),fd=xn("rtc");function hd(e,t=$t){Or("ec",e,t)}const pd="components",Xl=Symbol.for("v-ndc");function md(e){return gt(e)?gd(pd,e,!1)||e:e||Xl}function gd(e,t,n=!0,s=!1){const r=xt||$t;if(r){const o=r.type;{const a=tf(o,!1);if(a&&(a===t||a===Yt(t)||a===Ir(Yt(t))))return o}const i=Hi(r[e]||o[e],t)||Hi(r.appContext[e],t);return!i&&s?o:i}}function Hi(e,t){return e&&(e[t]||e[Yt(t)]||e[Ir(Yt(t))])}function mt(e,t,n,s){let r;const o=n,i=Me(e);if(i||gt(e)){const a=i&&ss(e);let l=!1,d=!1;a&&(l=!zt(e),d=Sn(e),e=$r(e)),r=new Array(e.length);for(let u=0,f=e.length;u<f;u++)r[u]=t(l?d?Ss(Zt(e[u])):Zt(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){r=new Array(e);for(let a=0;a<e;a++)r[a]=t(a+1,a,void 0,o)}else if(tt(e))if(e[Symbol.iterator])r=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];r[l]=t(e[u],u,l,o)}}else r=[];return r}function dn(e,t,n={},s,r){if(xt.ce||xt.parent&&ks(xt.parent)&&xt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),k(),it(Le,null,[Ce("slot",n,s)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),k();const i=o&&Zl(o(n)),a=n.key||i&&i.key,l=it(Le,{key:(a&&!Xt(a)?a:`_${t}`)+(!i&&s?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Zl(e){return e.some(t=>Js(t)?!(t.type===Rt||t.type===Le&&!Zl(t.children)):!0)?e:null}const No=e=>e?wc(e)?Br(e):No(e.parent):null,Us=_t(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=>No(e.parent),$root:e=>No(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>tc(e),$forceUpdate:e=>e.f||(e.f=()=>{li(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Zu.bind(e)}),ro=(e,t)=>e!==at&&!e.__isScriptSetup&&et(e,t),vd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(ro(s,t))return i[t]=1,s[t];if(r!==at&&et(r,t))return i[t]=2,r[t];if(et(o,t))return i[t]=3,o[t];if(n!==at&&et(n,t))return i[t]=4,n[t];Oo&&(i[t]=0)}}const d=Us[t];let u,f;if(d)return t==="$attrs"&&It(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==at&&et(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,et(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return ro(r,t)?(r[t]=n,!0):s!==at&&et(s,t)?(s[t]=n,!0):et(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:o,type:i}},a){let l;return!!(n[a]||e!==at&&a[0]!=="$"&&et(e,a)||ro(t,a)||et(o,a)||et(s,a)||et(Us,a)||et(r.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:et(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function yd(){return wd().slots}function wd(e){const t=hi();return t.setupContext||(t.setupContext=_c(t))}function Ui(e){return Me(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Oo=!0;function bd(e){const t=tc(e),n=e.proxy,s=e.ctx;Oo=!1,t.beforeCreate&&Vi(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:_,updated:M,activated:I,deactivated:D,beforeDestroy:G,beforeUnmount:P,destroyed:U,unmounted:B,render:le,renderTracked:ie,renderTriggered:ce,errorCaptured:me,serverPrefetch:oe,expose:Z,inheritAttrs:ge,components:Q,directives:Ne,filters:Ve}=t;if(d&&_d(d,s,null),i)for(const _e in i){const Ae=i[_e];De(Ae)&&(s[_e]=Ae.bind(n))}if(r){const _e=r.call(n,n);tt(_e)&&(e.data=Mr(_e))}if(Oo=!0,o)for(const _e in o){const Ae=o[_e],ct=De(Ae)?Ae.bind(n,n):De(Ae.get)?Ae.get.bind(n,n):fn,ot=!De(Ae)&&De(Ae.set)?Ae.set.bind(n):fn,Je=ae({get:ct,set:ot});Object.defineProperty(s,_e,{enumerable:!0,configurable:!0,get:()=>Je.value,set:ze=>Je.value=ze})}if(a)for(const _e in a)ec(a[_e],s,n,_e);if(l){const _e=De(l)?l.call(n):l;Reflect.ownKeys(_e).forEach(Ae=>{pr(Ae,_e[Ae])})}u&&Vi(u,e,"c");function Pe(_e,Ae){Me(Ae)?Ae.forEach(ct=>_e(ct.bind(n))):Ae&&_e(Ae.bind(n))}if(Pe(ad,f),Pe(Hn,g),Pe(ld,_),Pe(cd,M),Pe(rd,I),Pe(od,D),Pe(hd,me),Pe(fd,ie),Pe(dd,ce),Pe(Un,P),Pe(jr,B),Pe(ud,oe),Me(Z))if(Z.length){const _e=e.exposed||(e.exposed={});Z.forEach(Ae=>{Object.defineProperty(_e,Ae,{get:()=>n[Ae],set:ct=>n[Ae]=ct,enumerable:!0})})}else e.exposed||(e.exposed={});le&&e.render===fn&&(e.render=le),ge!=null&&(e.inheritAttrs=ge),Q&&(e.components=Q),Ne&&(e.directives=Ne),oe&&Jl(e)}function _d(e,t,n=fn){Me(e)&&(e=jo(e));for(const s in e){const r=e[s];let o;tt(r)?"default"in r?o=Qt(r.from||s,r.default,!0):o=Qt(r.from||s):o=Qt(r),Mt(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[s]=o}}function Vi(e,t,n){en(Me(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function ec(e,t,n,s){let r=s.includes(".")?Fl(n,s):()=>n[s];if(gt(e)){const o=t[e];De(o)&&pt(r,o)}else if(De(e))pt(r,e.bind(n));else if(tt(e))if(Me(e))e.forEach(o=>ec(o,t,n,s));else{const o=De(e.handler)?e.handler.bind(n):t[e.handler];De(o)&&pt(r,o,e)}}function tc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!r.length&&!n&&!s?l=t:(l={},r.length&&r.forEach(d=>kr(l,d,i,!0)),kr(l,t,i)),tt(t)&&o.set(t,l),l}function kr(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&kr(e,o,n,!0),r&&r.forEach(i=>kr(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const a=kd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const kd={data:qi,props:Wi,emits:Wi,methods:js,computed:js,beforeCreate:Nt,created:Nt,beforeMount:Nt,mounted:Nt,beforeUpdate:Nt,updated:Nt,beforeDestroy:Nt,beforeUnmount:Nt,destroyed:Nt,unmounted:Nt,activated:Nt,deactivated:Nt,errorCaptured:Nt,serverPrefetch:Nt,components:js,directives:js,watch:Sd,provide:qi,inject:Td};function qi(e,t){return t?e?function(){return _t(De(e)?e.call(this,this):e,De(t)?t.call(this,this):t)}:t:e}function Td(e,t){return js(jo(e),jo(t))}function jo(e){if(Me(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Nt(e,t){return e?[...new Set([].concat(e,t))]:t}function js(e,t){return e?_t(Object.create(null),e,t):t}function Wi(e,t){return e?Me(e)&&Me(t)?[...new Set([...e,...t])]:_t(Object.create(null),Ui(e),Ui(t??{})):t}function Sd(e,t){if(!e)return t;if(!t)return e;const n=_t(Object.create(null),e);for(const s in t)n[s]=Nt(e[s],t[s]);return n}function nc(){return{app:null,config:{isNativeTag:ll,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let xd=0;function Cd(e,t){return function(s,r=null){De(s)||(s=_t({},s)),r!=null&&!tt(r)&&(r=null);const o=nc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:xd++,_component:s,_props:r,_container:null,_context:o,_instance:null,version:sf,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&De(u.install)?(i.add(u),u.install(d,...f)):De(u)&&(i.add(u),u(d,...f))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,f){return f?(o.components[u]=f,d):o.components[u]},directive(u,f){return f?(o.directives[u]=f,d):o.directives[u]},mount(u,f,g){if(!l){const _=d._ceVNode||Ce(s,r);return _.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(_,u,g),l=!0,d._container=u,u.__vue_app__=d,Br(_.component)}},onUnmount(u){a.push(u)},unmount(){l&&(en(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,f){return o.provides[u]=f,d},runWithContext(u){const f=Ts;Ts=d;try{return u()}finally{Ts=f}}};return d}}let Ts=null;const Ed=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Yt(t)}Modifiers`]||e[`${Fn(t)}Modifiers`];function Ad(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||at;let r=n;const o=t.startsWith("update:"),i=o&&Ed(s,t.slice(7));i&&(i.trim&&(r=n.map(u=>gt(u)?u.trim():u)),i.number&&(r=n.map(Zo)));let a,l=s[a=Xr(t)]||s[a=Xr(Yt(t))];!l&&o&&(l=s[a=Xr(Fn(t))]),l&&en(l,e,6,r);const d=s[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,en(d,e,6,r)}}const Id=new WeakMap;function sc(e,t,n=!1){const s=n?Id:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},a=!1;if(!De(e)){const l=d=>{const u=sc(d,t,!0);u&&(a=!0,_t(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(tt(e)&&s.set(e,null),null):(Me(o)?o.forEach(l=>i[l]=null):_t(i,o),tt(e)&&s.set(e,i),i)}function Lr(e,t){return!e||!Er(t)?!1:(t=t.slice(2).replace(/Once$/,""),et(e,t[0].toLowerCase()+t.slice(1))||et(e,Fn(t))||et(e,t))}function Ki(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:_,ctx:M,inheritAttrs:I}=e,D=br(e);let G,P;try{if(n.shapeFlag&4){const B=r||s,le=B;G=un(d.call(le,B,u,f,_,g,M)),P=a}else{const B=t;G=un(B.length>1?B(f,{attrs:a,slots:i,emit:l}):B(f,null)),P=t.props?a:Rd(a)}}catch(B){Vs.length=0,Pr(B,e,1),G=Ce(Rt)}let U=G;if(P&&I!==!1){const B=Object.keys(P),{shapeFlag:le}=U;B.length&&le&7&&(o&&B.some(Jo)&&(P=$d(P,o)),U=Dn(U,P,!1,!0))}return n.dirs&&(U=Dn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&zs(U,n.transition),G=U,br(D),G}const Rd=e=>{let t;for(const n in e)(n==="class"||n==="style"||Er(n))&&((t||(t={}))[n]=e[n]);return t},$d=(e,t)=>{const n={};for(const s in e)(!Jo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Md(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?Gi(s,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(rc(i,s,g)&&!Lr(d,g))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:s===i?!1:s?i?Gi(s,i,d):!0:!!i;return!1}function Gi(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const o=s[r];if(rc(t,e,o)&&!Lr(n,o))return!0}return!1}function rc(e,t,n){const s=e[n],r=t[n];return n==="style"&&tt(s)&&tt(r)?!ei(s,r):s!==r}function Pd({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const oc={},ic=()=>Object.create(oc),ac=e=>Object.getPrototypeOf(e)===oc;function Nd(e,t,n,s=!1){const r={},o=ic();e.propsDefaults=Object.create(null),lc(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:$l(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function Od(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,a=Ye(r),[l]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let g=u[f];if(Lr(e.emitsOptions,g))continue;const _=t[g];if(l)if(et(o,g))_!==o[g]&&(o[g]=_,d=!0);else{const M=Yt(g);r[M]=Lo(l,a,M,_,e,!1)}else _!==o[g]&&(o[g]=_,d=!0)}}}else{lc(e,t,r,o)&&(d=!0);let u;for(const f in a)(!t||!et(t,f)&&((u=Fn(f))===f||!et(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(r[f]=Lo(l,a,f,void 0,e,!0)):delete r[f]);if(o!==a)for(const f in o)(!t||!et(t,f))&&(delete o[f],d=!0)}d&&wn(e.attrs,"set","")}function lc(e,t,n,s){const[r,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ls(l))continue;const d=t[l];let u;r&&et(r,u=Yt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:Lr(e.emitsOptions,l)||(!(l in s)||d!==s[l])&&(s[l]=d,i=!0)}if(o){const l=Ye(n),d=a||at;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Lo(r,l,f,d[f],e,!et(d,f))}}return i}function Lo(e,t,n,s,r,o){const i=e[n];if(i!=null){const a=et(i,"default");if(a&&s===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&De(l)){const{propsDefaults:d}=r;if(n in d)s=d[n];else{const u=nr(r);s=d[n]=l.call(null,t),u()}}else s=l;r.ce&&r.ce._setProp(n,s)}i[0]&&(o&&!a?s=!1:i[1]&&(s===""||s===Fn(n))&&(s=!0))}return s}const jd=new WeakMap;function cc(e,t,n=!1){const s=n?jd:t.propsCache,r=s.get(e);if(r)return r;const o=e.props,i={},a=[];let l=!1;if(!De(e)){const u=f=>{l=!0;const[g,_]=cc(f,t,!0);_t(i,g),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return tt(e)&&s.set(e,ws),ws;if(Me(o))for(let u=0;u<o.length;u++){const f=Yt(o[u]);zi(f)&&(i[f]=at)}else if(o)for(const u in o){const f=Yt(u);if(zi(f)){const g=o[u],_=i[f]=Me(g)||De(g)?{type:g}:_t({},g),M=_.type;let I=!1,D=!0;if(Me(M))for(let G=0;G<M.length;++G){const P=M[G],U=De(P)&&P.name;if(U==="Boolean"){I=!0;break}else U==="String"&&(D=!1)}else I=De(M)&&M.name==="Boolean";_[0]=I,_[1]=D,(I||et(_,"default"))&&a.push(f)}}const d=[i,a];return tt(e)&&s.set(e,d),d}function zi(e){return e[0]!=="$"&&!Ls(e)}const ci=e=>e==="_"||e==="_ctx"||e==="$stable",ui=e=>Me(e)?e.map(un):[un(e)],Ld=(e,t,n)=>{if(t._n)return t;const s=st((...r)=>ui(t(...r)),n);return s._c=!1,s},uc=(e,t,n)=>{const s=e._ctx;for(const r in e){if(ci(r))continue;const o=e[r];if(De(o))t[r]=Ld(r,o,s);else if(o!=null){const i=ui(o);t[r]=()=>i}}},dc=(e,t)=>{const n=ui(t);e.slots.default=()=>n},fc=(e,t,n)=>{for(const s in t)(n||!ci(s))&&(e[s]=t[s])},Dd=(e,t,n)=>{const s=e.slots=ic();if(e.vnode.shapeFlag&32){const r=t._;r?(fc(s,t,n),n&&hl(s,"_",r,!0)):uc(t,s)}else t&&dc(e,t)},Bd=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=at;if(s.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:fc(r,t,n):(o=!t.$stable,uc(t,r)),i=t}else t&&(dc(e,t),i={default:1});if(o)for(const a in r)!ci(a)&&i[a]==null&&delete r[a]},At=qd;function Fd(e){return Hd(e)}function Hd(e,t){const n=Rr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:_=fn,insertStaticContent:M}=e,I=(m,y,C,L=null,V=null,j=null,ee=void 0,te=null,z=!!y.dynamicChildren)=>{if(m===y)return;m&&!Zn(m,y)&&(L=A(m),ze(m,V,j,!0),m=null),y.patchFlag===-2&&(z=!1,y.dynamicChildren=null);const{type:H,ref:de,shapeFlag:se}=y;switch(H){case Dr:D(m,y,C,L);break;case Rt:G(m,y,C,L);break;case io:m==null&&P(y,C,L,ee);break;case Le:Q(m,y,C,L,V,j,ee,te,z);break;default:se&1?le(m,y,C,L,V,j,ee,te,z):se&6?Ne(m,y,C,L,V,j,ee,te,z):(se&64||se&128)&&H.process(m,y,C,L,V,j,ee,te,z,ye)}de!=null&&V?Hs(de,m&&m.ref,j,y||m,!y):de==null&&m&&m.ref!=null&&Hs(m.ref,null,j,m,!0)},D=(m,y,C,L)=>{if(m==null)s(y.el=a(y.children),C,L);else{const V=y.el=m.el;y.children!==m.children&&d(V,y.children)}},G=(m,y,C,L)=>{m==null?s(y.el=l(y.children||""),C,L):y.el=m.el},P=(m,y,C,L)=>{[m.el,m.anchor]=M(m.children,y,C,L,m.el,m.anchor)},U=({el:m,anchor:y},C,L)=>{let V;for(;m&&m!==y;)V=g(m),s(m,C,L),m=V;s(y,C,L)},B=({el:m,anchor:y})=>{let C;for(;m&&m!==y;)C=g(m),r(m),m=C;r(y)},le=(m,y,C,L,V,j,ee,te,z)=>{if(y.type==="svg"?ee="svg":y.type==="math"&&(ee="mathml"),m==null)ie(y,C,L,V,j,ee,te,z);else{const H=m.el&&m.el._isVueCE?m.el:null;try{H&&H._beginPatch(),oe(m,y,V,j,ee,te,z)}finally{H&&H._endPatch()}}},ie=(m,y,C,L,V,j,ee,te)=>{let z,H;const{props:de,shapeFlag:se,transition:fe,dirs:ke}=m;if(z=m.el=i(m.type,j,de&&de.is,de),se&8?u(z,m.children):se&16&&me(m.children,z,null,L,V,oo(m,j),ee,te),ke&&Gn(m,null,L,"created"),ce(z,m,m.scopeId,ee,L),de){for(const He in de)He!=="value"&&!Ls(He)&&o(z,He,null,de[He],j,L);"value"in de&&o(z,"value",null,de.value,j),(H=de.onVnodeBeforeMount)&&an(H,L,m)}ke&&Gn(m,null,L,"beforeMount");const je=Ud(V,fe);je&&fe.beforeEnter(z),s(z,y,C),((H=de&&de.onVnodeMounted)||je||ke)&&At(()=>{H&&an(H,L,m),je&&fe.enter(z),ke&&Gn(m,null,L,"mounted")},V)},ce=(m,y,C,L,V)=>{if(C&&_(m,C),L)for(let j=0;j<L.length;j++)_(m,L[j]);if(V){let j=V.subTree;if(y===j||mc(j.type)&&(j.ssContent===y||j.ssFallback===y)){const ee=V.vnode;ce(m,ee,ee.scopeId,ee.slotScopeIds,V.parent)}}},me=(m,y,C,L,V,j,ee,te,z=0)=>{for(let H=z;H<m.length;H++){const de=m[H]=te?yn(m[H]):un(m[H]);I(null,de,y,C,L,V,j,ee,te)}},oe=(m,y,C,L,V,j,ee)=>{const te=y.el=m.el;let{patchFlag:z,dynamicChildren:H,dirs:de}=y;z|=m.patchFlag&16;const se=m.props||at,fe=y.props||at;let ke;if(C&&zn(C,!1),(ke=fe.onVnodeBeforeUpdate)&&an(ke,C,y,m),de&&Gn(y,m,C,"beforeUpdate"),C&&zn(C,!0),(se.innerHTML&&fe.innerHTML==null||se.textContent&&fe.textContent==null)&&u(te,""),H?Z(m.dynamicChildren,H,te,C,L,oo(y,V),j):ee||Ae(m,y,te,null,C,L,oo(y,V),j,!1),z>0){if(z&16)ge(te,se,fe,C,V);else if(z&2&&se.class!==fe.class&&o(te,"class",null,fe.class,V),z&4&&o(te,"style",se.style,fe.style,V),z&8){const je=y.dynamicProps;for(let He=0;He<je.length;He++){const Re=je[He],ft=se[Re],nt=fe[Re];(nt!==ft||Re==="value")&&o(te,Re,ft,nt,V,C)}}z&1&&m.children!==y.children&&u(te,y.children)}else!ee&&H==null&&ge(te,se,fe,C,V);((ke=fe.onVnodeUpdated)||de)&&At(()=>{ke&&an(ke,C,y,m),de&&Gn(y,m,C,"updated")},L)},Z=(m,y,C,L,V,j,ee)=>{for(let te=0;te<y.length;te++){const z=m[te],H=y[te],de=z.el&&(z.type===Le||!Zn(z,H)||z.shapeFlag&198)?f(z.el):C;I(z,H,de,null,L,V,j,ee,!0)}},ge=(m,y,C,L,V)=>{if(y!==C){if(y!==at)for(const j in y)!Ls(j)&&!(j in C)&&o(m,j,y[j],null,V,L);for(const j in C){if(Ls(j))continue;const ee=C[j],te=y[j];ee!==te&&j!=="value"&&o(m,j,te,ee,V,L)}"value"in C&&o(m,"value",y.value,C.value,V)}},Q=(m,y,C,L,V,j,ee,te,z)=>{const H=y.el=m?m.el:a(""),de=y.anchor=m?m.anchor:a("");let{patchFlag:se,dynamicChildren:fe,slotScopeIds:ke}=y;ke&&(te=te?te.concat(ke):ke),m==null?(s(H,C,L),s(de,C,L),me(y.children||[],C,de,V,j,ee,te,z)):se>0&&se&64&&fe&&m.dynamicChildren&&m.dynamicChildren.length===fe.length?(Z(m.dynamicChildren,fe,C,V,j,ee,te),(y.key!=null||V&&y===V.subTree)&&di(m,y,!0)):Ae(m,y,C,de,V,j,ee,te,z)},Ne=(m,y,C,L,V,j,ee,te,z)=>{y.slotScopeIds=te,m==null?y.shapeFlag&512?V.ctx.activate(y,C,L,ee,z):Ve(y,C,L,V,j,ee,z):rt(m,y,z)},Ve=(m,y,C,L,V,j,ee)=>{const te=m.component=Qd(m,L,V);if(Nr(m)&&(te.ctx.renderer=ye),Xd(te,!1,ee),te.asyncDep){if(V&&V.registerDep(te,Pe,ee),!m.el){const z=te.subTree=Ce(Rt);G(null,z,y,C),m.placeholder=z.el}}else Pe(te,m,y,C,V,j,ee)},rt=(m,y,C)=>{const L=y.component=m.component;if(Md(m,y,C))if(L.asyncDep&&!L.asyncResolved){_e(L,y,C);return}else L.next=y,L.update();else y.el=m.el,L.vnode=y},Pe=(m,y,C,L,V,j,ee)=>{const te=()=>{if(m.isMounted){let{next:se,bu:fe,u:ke,parent:je,vnode:He}=m;{const p=hc(m);if(p){se&&(se.el=He.el,_e(m,se,ee)),p.asyncDep.then(()=>{At(()=>{m.isUnmounted||H()},V)});return}}let Re=se,ft;zn(m,!1),se?(se.el=He.el,_e(m,se,ee)):se=He,fe&&hr(fe),(ft=se.props&&se.props.onVnodeBeforeUpdate)&&an(ft,je,se,He),zn(m,!0);const nt=Ki(m),F=m.subTree;m.subTree=nt,I(F,nt,f(F.el),A(F),m,V,j),se.el=nt.el,Re===null&&Pd(m,nt.el),ke&&At(ke,V),(ft=se.props&&se.props.onVnodeUpdated)&&At(()=>an(ft,je,se,He),V)}else{let se;const{el:fe,props:ke}=y,{bm:je,m:He,parent:Re,root:ft,type:nt}=m,F=ks(y);zn(m,!1),je&&hr(je),!F&&(se=ke&&ke.onVnodeBeforeMount)&&an(se,Re,y),zn(m,!0);{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(nt);const p=m.subTree=Ki(m);I(null,p,C,L,m,V,j),y.el=p.el}if(He&&At(He,V),!F&&(se=ke&&ke.onVnodeMounted)){const p=y;At(()=>an(se,Re,p),V)}(y.shapeFlag&256||Re&&ks(Re.vnode)&&Re.vnode.shapeFlag&256)&&m.a&&At(m.a,V),m.isMounted=!0,y=C=L=null}};m.scope.on();const z=m.effect=new vl(te);m.scope.off();const H=m.update=z.run.bind(z),de=m.job=z.runIfDirty.bind(z);de.i=m,de.id=m.uid,z.scheduler=()=>li(de),zn(m,!0),H()},_e=(m,y,C)=>{y.component=m;const L=m.vnode.props;m.vnode=y,m.next=null,Od(m,y.props,L,C),Bd(m,y.children,C),kn(),Ni(m),Tn()},Ae=(m,y,C,L,V,j,ee,te,z=!1)=>{const H=m&&m.children,de=m?m.shapeFlag:0,se=y.children,{patchFlag:fe,shapeFlag:ke}=y;if(fe>0){if(fe&128){ot(H,se,C,L,V,j,ee,te,z);return}else if(fe&256){ct(H,se,C,L,V,j,ee,te,z);return}}ke&8?(de&16&&he(H,V,j),se!==H&&u(C,se)):de&16?ke&16?ot(H,se,C,L,V,j,ee,te,z):he(H,V,j,!0):(de&8&&u(C,""),ke&16&&me(se,C,L,V,j,ee,te,z))},ct=(m,y,C,L,V,j,ee,te,z)=>{m=m||ws,y=y||ws;const H=m.length,de=y.length,se=Math.min(H,de);let fe;for(fe=0;fe<se;fe++){const ke=y[fe]=z?yn(y[fe]):un(y[fe]);I(m[fe],ke,C,null,V,j,ee,te,z)}H>de?he(m,V,j,!0,!1,se):me(y,C,L,V,j,ee,te,z,se)},ot=(m,y,C,L,V,j,ee,te,z)=>{let H=0;const de=y.length;let se=m.length-1,fe=de-1;for(;H<=se&&H<=fe;){const ke=m[H],je=y[H]=z?yn(y[H]):un(y[H]);if(Zn(ke,je))I(ke,je,C,null,V,j,ee,te,z);else break;H++}for(;H<=se&&H<=fe;){const ke=m[se],je=y[fe]=z?yn(y[fe]):un(y[fe]);if(Zn(ke,je))I(ke,je,C,null,V,j,ee,te,z);else break;se--,fe--}if(H>se){if(H<=fe){const ke=fe+1,je=ke<de?y[ke].el:L;for(;H<=fe;)I(null,y[H]=z?yn(y[H]):un(y[H]),C,je,V,j,ee,te,z),H++}}else if(H>fe)for(;H<=se;)ze(m[H],V,j,!0),H++;else{const ke=H,je=H,He=new Map;for(H=je;H<=fe;H++){const q=y[H]=z?yn(y[H]):un(y[H]);q.key!=null&&He.set(q.key,H)}let Re,ft=0;const nt=fe-je+1;let F=!1,p=0;const b=new Array(nt);for(H=0;H<nt;H++)b[H]=0;for(H=ke;H<=se;H++){const q=m[H];if(ft>=nt){ze(q,V,j,!0);continue}let re;if(q.key!=null)re=He.get(q.key);else for(Re=je;Re<=fe;Re++)if(b[Re-je]===0&&Zn(q,y[Re])){re=Re;break}re===void 0?ze(q,V,j,!0):(b[re-je]=H+1,re>=p?p=re:F=!0,I(q,y[re],C,null,V,j,ee,te,z),ft++)}const E=F?Vd(b):ws;for(Re=E.length-1,H=nt-1;H>=0;H--){const q=je+H,re=y[q],xe=y[q+1],Qe=q+1<de?xe.el||pc(xe):L;b[H]===0?I(null,re,C,Qe,V,j,ee,te,z):F&&(Re<0||H!==E[Re]?Je(re,C,Qe,2):Re--)}}},Je=(m,y,C,L,V=null)=>{const{el:j,type:ee,transition:te,children:z,shapeFlag:H}=m;if(H&6){Je(m.component.subTree,y,C,L);return}if(H&128){m.suspense.move(y,C,L);return}if(H&64){ee.move(m,y,C,ye);return}if(ee===Le){s(j,y,C);for(let se=0;se<z.length;se++)Je(z[se],y,C,L);s(m.anchor,y,C);return}if(ee===io){U(m,y,C);return}if(L!==2&&H&1&&te)if(L===0)te.beforeEnter(j),s(j,y,C),At(()=>te.enter(j),V);else{const{leave:se,delayLeave:fe,afterLeave:ke}=te,je=()=>{m.ctx.isUnmounted?r(j):s(j,y,C)},He=()=>{j._isLeaving&&j[cn](!0),se(j,()=>{je(),ke&&ke()})};fe?fe(j,je,He):He()}else s(j,y,C)},ze=(m,y,C,L=!1,V=!1)=>{const{type:j,props:ee,ref:te,children:z,dynamicChildren:H,shapeFlag:de,patchFlag:se,dirs:fe,cacheIndex:ke}=m;if(se===-2&&(V=!1),te!=null&&(kn(),Hs(te,null,C,m,!0),Tn()),ke!=null&&(y.renderCache[ke]=void 0),de&256){y.ctx.deactivate(m);return}const je=de&1&&fe,He=!ks(m);let Re;if(He&&(Re=ee&&ee.onVnodeBeforeUnmount)&&an(Re,y,m),de&6)Se(m.component,C,L);else{if(de&128){m.suspense.unmount(C,L);return}je&&Gn(m,null,y,"beforeUnmount"),de&64?m.type.remove(m,y,C,ye,L):H&&!H.hasOnce&&(j!==Le||se>0&&se&64)?he(H,y,C,!1,!0):(j===Le&&se&384||!V&&de&16)&&he(z,y,C),L&&Ke(m)}(He&&(Re=ee&&ee.onVnodeUnmounted)||je)&&At(()=>{Re&&an(Re,y,m),je&&Gn(m,null,y,"unmounted")},C)},Ke=m=>{const{type:y,el:C,anchor:L,transition:V}=m;if(y===Le){ue(C,L);return}if(y===io){B(m);return}const j=()=>{r(C),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(m.shapeFlag&1&&V&&!V.persisted){const{leave:ee,delayLeave:te}=V,z=()=>ee(C,j);te?te(m.el,j,z):z()}else j()},ue=(m,y)=>{let C;for(;m!==y;)C=g(m),r(m),m=C;r(y)},Se=(m,y,C)=>{const{bum:L,scope:V,job:j,subTree:ee,um:te,m:z,a:H}=m;Yi(z),Yi(H),L&&hr(L),V.stop(),j&&(j.flags|=8,ze(ee,m,y,C)),te&&At(te,y),At(()=>{m.isUnmounted=!0},y)},he=(m,y,C,L=!1,V=!1,j=0)=>{for(let ee=j;ee<m.length;ee++)ze(m[ee],y,C,L,V)},A=m=>{if(m.shapeFlag&6)return A(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const y=g(m.anchor||m.el),C=y&&y[Hl];return C?g(C):y};let X=!1;const J=(m,y,C)=>{let L;m==null?y._vnode&&(ze(y._vnode,null,null,!0),L=y._vnode.component):I(y._vnode||null,m,y,null,null,null,C),y._vnode=m,X||(X=!0,Ni(L),jl(),X=!1)},ye={p:I,um:ze,m:Je,r:Ke,mt:Ve,mc:me,pc:Ae,pbc:Z,n:A,o:e};return{render:J,hydrate:void 0,createApp:Cd(J)}}function oo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function zn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ud(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function di(e,t,n=!1){const s=e.children,r=t.children;if(Me(s)&&Me(r))for(let o=0;o<s.length;o++){const i=s[o];let a=r[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[o]=yn(r[o]),a.el=i.el),!n&&a.patchFlag!==-2&&di(i,a)),a.type===Dr&&(a.patchFlag===-1&&(a=r[o]=yn(a)),a.el=i.el),a.type===Rt&&!a.el&&(a.el=i.el)}}function Vd(e){const t=e.slice(),n=[0];let s,r,o,i,a;const l=e.length;for(s=0;s<l;s++){const d=e[s];if(d!==0){if(r=n[n.length-1],e[r]<d){t[s]=r,n.push(s);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hc(t)}function Yi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function pc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?pc(t.subTree):null}const mc=e=>e.__isSuspense;function qd(e,t){t&&t.pendingBranch?Me(e)?t.effects.push(...e):t.effects.push(e):Ju(e)}const Le=Symbol.for("v-fgt"),Dr=Symbol.for("v-txt"),Rt=Symbol.for("v-cmt"),io=Symbol.for("v-stc"),Vs=[];let Ut=null;function k(e=!1){Vs.push(Ut=e?null:[])}function Wd(){Vs.pop(),Ut=Vs[Vs.length-1]||null}let Ys=1;function Tr(e,t=!1){Ys+=e,e<0&&Ut&&t&&(Ut.hasOnce=!0)}function gc(e){return e.dynamicChildren=Ys>0?Ut||ws:null,Wd(),Ys>0&&Ut&&Ut.push(e),e}function x(e,t,n,s,r,o){return gc(w(e,t,n,s,r,o,!0))}function it(e,t,n,s,r){return gc(Ce(e,t,n,s,r,!0))}function Js(e){return e?e.__v_isVNode===!0:!1}function Zn(e,t){return e.type===t.type&&e.key===t.key}const vc=({key:e})=>e??null,gr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?gt(e)||Mt(e)||De(e)?{i:xt,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,r=null,o=e===Le?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vc(t),ref:t&&gr(t),scopeId:Dl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:xt};return a?(fi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=gt(n)?8:16),Ys>0&&!i&&Ut&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Ut.push(l),l}const Ce=Kd;function Kd(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===Xl)&&(e=Rt),Js(e)){const a=Dn(e,t,!0);return n&&fi(a,n),Ys>0&&!o&&Ut&&(a.shapeFlag&6?Ut[Ut.indexOf(e)]=a:Ut.push(a)),a.patchFlag=-2,a}if(nf(e)&&(e=e.__vccOpts),t){t=Gd(t);let{class:a,style:l}=t;a&&!gt(a)&&(t.class=lt(a)),tt(l)&&(ai(l)&&!Me(l)&&(l=_t({},l)),t.style=rs(l))}const i=gt(e)?1:mc(e)?128:Ul(e)?64:tt(e)?4:De(e)?2:0;return w(e,t,n,s,r,i,o,!0)}function Gd(e){return e?ai(e)||ac(e)?_t({},e):e:null}function Dn(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?yc(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&vc(d),ref:t&&t.ref?n&&o?Me(o)?o.concat(gr(t)):[o,gr(t)]:gr(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Le?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dn(e.ssContent),ssFallback:e.ssFallback&&Dn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&zs(u,l.clone(u)),u}function zd(e=" ",t=0){return Ce(Dr,null,e,t)}function pe(e="",t=!1){return t?(k(),it(Rt,null,e)):Ce(Rt,null,e)}function un(e){return e==null||typeof e=="boolean"?Ce(Rt):Me(e)?Ce(Le,null,e.slice()):Js(e)?yn(e):Ce(Dr,null,String(e))}function yn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Dn(e)}function fi(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Me(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),fi(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!ac(t)?t._ctx=xt:r===3&&xt&&(xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else De(t)?(t={default:t,_ctx:xt},n=32):(t=String(t),s&64?(n=16,t=[zd(t)]):n=8);e.children=t,e.shapeFlag|=n}function yc(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=lt([t.class,s.class]));else if(r==="style")t.style=rs([t.style,s.style]);else if(Er(r)){const o=t[r],i=s[r];i&&o!==i&&!(Me(o)&&o.includes(i))&&(t[r]=o?[].concat(o,i):i)}else r!==""&&(t[r]=s[r])}return t}function an(e,t,n,s=null){en(e,t,7,[n,s])}const Yd=nc();let Jd=0;function Qd(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||Yd,o={uid:Jd++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new bu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:cc(s,r),emitsOptions:sc(s,r),emit:null,emitted:null,propsDefaults:at,inheritAttrs:s.inheritAttrs,ctx:at,data:at,props:at,attrs:at,slots:at,refs:at,setupState:at,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Ad.bind(null,o),e.ce&&e.ce(o),o}let $t=null;const hi=()=>$t||xt;let Sr,Do;{const e=Rr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};Sr=t("__VUE_INSTANCE_SETTERS__",n=>$t=n),Do=t("__VUE_SSR_SETTERS__",n=>Qs=n)}const nr=e=>{const t=$t;return Sr(e),e.scope.on(),()=>{e.scope.off(),Sr(t)}},Ji=()=>{$t&&$t.scope.off(),Sr(null)};function wc(e){return e.vnode.shapeFlag&4}let Qs=!1;function Xd(e,t=!1,n=!1){t&&Do(t);const{props:s,children:r}=e.vnode,o=wc(e);Nd(e,s,o,t),Dd(e,r,n||t);const i=o?Zd(e,t):void 0;return t&&Do(!1),i}function Zd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vd);const{setup:s}=n;if(s){kn();const r=e.setupContext=s.length>1?_c(e):null,o=nr(e),i=tr(s,e,0,[e.props,r]),a=ul(i);if(Tn(),o(),(a||e.sp)&&!ks(e)&&Jl(e),a){if(i.then(Ji,Ji),t)return i.then(l=>{Qi(e,l)}).catch(l=>{Pr(l,e,0)});e.asyncDep=i}else Qi(e,i)}else bc(e)}function Qi(e,t,n){De(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:tt(t)&&(e.setupState=Pl(t)),bc(e)}function bc(e,t,n){const s=e.type;e.render||(e.render=s.render||fn);{const r=nr(e);kn();try{bd(e)}finally{Tn(),r()}}}const ef={get(e,t){return It(e,"get",""),e[t]}};function _c(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ef),slots:e.slots,emit:e.emit,expose:t}}function Br(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pl(Fu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Us)return Us[n](e)},has(t,n){return n in t||n in Us}})):e.proxy}function tf(e,t=!0){return De(e)?e.displayName||e.name:e.name||t&&e.__name}function nf(e){return De(e)&&"__vccOpts"in e}const ae=(e,t)=>Wu(e,t,Qs);function pi(e,t,n){try{Tr(-1);const s=arguments.length;return s===2?tt(t)&&!Me(t)?Js(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Js(n)&&(n=[n]),Ce(e,t,n))}finally{Tr(1)}}const sf="3.5.28";/**
14
+ * @vue/runtime-dom v3.5.28
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Bo;const Xi=typeof window<"u"&&window.trustedTypes;if(Xi)try{Bo=Xi.createPolicy("vue",{createHTML:e=>e})}catch{}const kc=Bo?e=>Bo.createHTML(e):e=>e,rf="http://www.w3.org/2000/svg",of="http://www.w3.org/1998/Math/MathML",vn=typeof document<"u"?document:null,Zi=vn&&vn.createElement("template"),af={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?vn.createElementNS(rf,e):t==="mathml"?vn.createElementNS(of,e):n?vn.createElement(e,{is:n}):vn.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>vn.createTextNode(e),createComment:e=>vn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{Zi.innerHTML=kc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const a=Zi.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},In="transition",Ms="animation",Xs=Symbol("_vtc"),Tc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},lf=_t({},Wl,Tc),cf=e=>(e.displayName="Transition",e.props=lf,e),Sc=cf((e,{slots:t})=>pi(sd,uf(e),t)),Yn=(e,t=[])=>{Me(e)?e.forEach(n=>n(...t)):e&&e(...t)},ea=e=>e?Me(e)?e.some(t=>t.length>1):e.length>1:!1;function uf(e){const t={};for(const Q in e)Q in Tc||(t[Q]=e[Q]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,M=df(r),I=M&&M[0],D=M&&M[1],{onBeforeEnter:G,onEnter:P,onEnterCancelled:U,onLeave:B,onLeaveCancelled:le,onBeforeAppear:ie=G,onAppear:ce=P,onAppearCancelled:me=U}=t,oe=(Q,Ne,Ve,rt)=>{Q._enterCancelled=rt,Jn(Q,Ne?u:a),Jn(Q,Ne?d:i),Ve&&Ve()},Z=(Q,Ne)=>{Q._isLeaving=!1,Jn(Q,f),Jn(Q,_),Jn(Q,g),Ne&&Ne()},ge=Q=>(Ne,Ve)=>{const rt=Q?ce:P,Pe=()=>oe(Ne,Q,Ve);Yn(rt,[Ne,Pe]),ta(()=>{Jn(Ne,Q?l:o),mn(Ne,Q?u:a),ea(rt)||na(Ne,s,I,Pe)})};return _t(t,{onBeforeEnter(Q){Yn(G,[Q]),mn(Q,o),mn(Q,i)},onBeforeAppear(Q){Yn(ie,[Q]),mn(Q,l),mn(Q,d)},onEnter:ge(!1),onAppear:ge(!0),onLeave(Q,Ne){Q._isLeaving=!0;const Ve=()=>Z(Q,Ne);mn(Q,f),Q._enterCancelled?(mn(Q,g),oa(Q)):(oa(Q),mn(Q,g)),ta(()=>{Q._isLeaving&&(Jn(Q,f),mn(Q,_),ea(B)||na(Q,s,D,Ve))}),Yn(B,[Q,Ve])},onEnterCancelled(Q){oe(Q,!1,void 0,!0),Yn(U,[Q])},onAppearCancelled(Q){oe(Q,!0,void 0,!0),Yn(me,[Q])},onLeaveCancelled(Q){Z(Q),Yn(le,[Q])}})}function df(e){if(e==null)return null;if(tt(e))return[ao(e.enter),ao(e.leave)];{const t=ao(e);return[t,t]}}function ao(e){return fu(e)}function mn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Xs]||(e[Xs]=new Set)).add(t)}function Jn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Xs];n&&(n.delete(t),n.size||(e[Xs]=void 0))}function ta(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ff=0;function na(e,t,n,s){const r=e._endId=++ff,o=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=hf(e,t);if(!i)return s();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=_=>{_.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function hf(e,t){const n=window.getComputedStyle(e),s=M=>(n[M]||"").split(", "),r=s(`${In}Delay`),o=s(`${In}Duration`),i=sa(r,o),a=s(`${Ms}Delay`),l=s(`${Ms}Duration`),d=sa(a,l);let u=null,f=0,g=0;t===In?i>0&&(u=In,f=i,g=o.length):t===Ms?d>0&&(u=Ms,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?In:Ms:null,g=u?u===In?o.length:l.length:0);const _=u===In&&/\b(?:transform|all)(?:,|$)/.test(s(`${In}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:_}}function sa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>ra(n)+ra(e[s])))}function ra(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oa(e){return(e?e.ownerDocument:document).body.offsetHeight}function pf(e,t,n){const s=e[Xs];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ia=Symbol("_vod"),mf=Symbol("_vsh"),gf=Symbol(""),vf=/(?:^|;)\s*display\s*:/;function yf(e,t,n){const s=e.style,r=gt(n);let o=!1;if(n&&!r){if(t)if(gt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&vr(s,a,"")}else for(const i in t)n[i]==null&&vr(s,i,"");for(const i in n)i==="display"&&(o=!0),vr(s,i,n[i])}else if(r){if(t!==n){const i=s[gf];i&&(n+=";"+i),s.cssText=n,o=vf.test(n)}}else t&&e.removeAttribute("style");ia in e&&(e[ia]=o?s.display:"",e[mf]&&(s.display="none"))}const aa=/\s*!important$/;function vr(e,t,n){if(Me(n))n.forEach(s=>vr(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=wf(e,t);aa.test(n)?e.setProperty(Fn(s),n.replace(aa,""),"important"):e[s]=n}}const la=["Webkit","Moz","ms"],lo={};function wf(e,t){const n=lo[t];if(n)return n;let s=Yt(t);if(s!=="filter"&&s in e)return lo[t]=s;s=Ir(s);for(let r=0;r<la.length;r++){const o=la[r]+s;if(o in e)return lo[t]=o}return t}const ca="http://www.w3.org/1999/xlink";function ua(e,t,n,s,r,o=yu(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ca,t.slice(6,t.length)):e.setAttributeNS(ca,t,n):n==null||o&&!pl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Xt(n)?String(n):n)}function da(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?kc(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=pl(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(r||t)}function vs(e,t,n,s){e.addEventListener(t,n,s)}function bf(e,t,n,s){e.removeEventListener(t,n,s)}const fa=Symbol("_vei");function _f(e,t,n,s,r=null){const o=e[fa]||(e[fa]={}),i=o[t];if(s&&i)i.value=s;else{const[a,l]=kf(t);if(s){const d=o[t]=xf(s,r);vs(e,a,d,l)}else i&&(bf(e,a,i,l),o[t]=void 0)}}const ha=/(?:Once|Passive|Capture)$/;function kf(e){let t;if(ha.test(e)){t={};let s;for(;s=e.match(ha);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fn(e.slice(2)),t]}let co=0;const Tf=Promise.resolve(),Sf=()=>co||(Tf.then(()=>co=0),co=Date.now());function xf(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;en(Cf(s,n.value),t,5,[s])};return n.value=e,n.attached=Sf(),n}function Cf(e,t){if(Me(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const pa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ef=(e,t,n,s,r,o)=>{const i=r==="svg";t==="class"?pf(e,s,i):t==="style"?yf(e,n,s):Er(t)?Jo(t)||_f(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Af(e,t,s,i))?(da(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ua(e,t,s,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!gt(s))?da(e,Yt(t),s,o,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ua(e,t,s,i))};function Af(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&pa(t)&&De(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return pa(t)&&gt(n)?!1:t in e}const ma=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Me(t)?n=>hr(t,n):t};function If(e){e.target.composing=!0}function ga(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const uo=Symbol("_assign");function va(e,t,n){return t&&(e=e.trim()),n&&(e=Zo(e)),e}const Bn={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[uo]=ma(r);const o=s||r.props&&r.props.type==="number";vs(e,t?"change":"input",i=>{i.target.composing||e[uo](va(e.value,n,o))}),(n||o)&&vs(e,"change",()=>{e.value=va(e.value,n,o)}),t||(vs(e,"compositionstart",If),vs(e,"compositionend",ga),vs(e,"change",ga))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:o}},i){if(e[uo]=ma(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Zo(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===l)||(e.value=l))}},Rf=["ctrl","shift","alt","meta"],$f={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Rf.some(n=>e[`${n}Key`]&&!t.includes(n))},dt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...o)=>{for(let i=0;i<t.length;i++){const a=$f[t[i]];if(a&&a(r,t))return}return e(r,...o)}))},Mf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Vt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(r=>{if(!("key"in r))return;const o=Fn(r.key);if(t.some(i=>i===o||Mf[i]===o))return e(r)}))},Pf=_t({patchProp:Ef},af);let ya;function Nf(){return ya||(ya=Fd(Pf))}const Of=((...e)=>{const t=Nf().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Lf(s);if(!r)return;const o=t._component;!De(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const i=n(r,!1,jf(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t});function jf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Lf(e){return gt(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const ys=typeof document<"u";function xc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Df(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&xc(e.default)}const Ze=Object.assign;function fo(e,t){const n={};for(const s in t){const r=t[s];n[s]=nn(r)?r.map(e):e(r)}return n}const qs=()=>{},nn=Array.isArray;function wa(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Cc=/#/g,Bf=/&/g,Ff=/\//g,Hf=/=/g,Uf=/\?/g,Ec=/\+/g,Vf=/%5B/g,qf=/%5D/g,Ac=/%5E/g,Wf=/%60/g,Ic=/%7B/g,Kf=/%7C/g,Rc=/%7D/g,Gf=/%20/g;function mi(e){return e==null?"":encodeURI(""+e).replace(Kf,"|").replace(Vf,"[").replace(qf,"]")}function zf(e){return mi(e).replace(Ic,"{").replace(Rc,"}").replace(Ac,"^")}function Fo(e){return mi(e).replace(Ec,"%2B").replace(Gf,"+").replace(Cc,"%23").replace(Bf,"%26").replace(Wf,"`").replace(Ic,"{").replace(Rc,"}").replace(Ac,"^")}function Yf(e){return Fo(e).replace(Hf,"%3D")}function Jf(e){return mi(e).replace(Cc,"%23").replace(Uf,"%3F")}function Qf(e){return Jf(e).replace(Ff,"%2F")}function Zs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Xf=/\/$/,Zf=e=>e.replace(Xf,"");function ho(e,t,n="/"){let s,r={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(s=t.slice(0,l),o=t.slice(l,a>0?a:t.length),r=e(o.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=sh(s??t,n),{fullPath:s+o+i,path:s,query:r,hash:Zs(i)}}function eh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function ba(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function th(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&xs(t.matched[s],n.matched[r])&&$c(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function xs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function $c(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!nh(e[n],t[n]))return!1;return!0}function nh(e,t){return nn(e)?_a(e,t):nn(t)?_a(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function _a(e,t){return nn(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function sh(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,a;for(i=0;i<s.length;i++)if(a=s[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(i).join("/")}const Rn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ho=(function(e){return e.pop="pop",e.push="push",e})({}),po=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function rh(e){if(!e)if(ys){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Zf(e)}const oh=/^[^#]+#/;function ih(e,t){return e.replace(oh,"#")+t}function ah(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Fr=()=>({left:window.scrollX,top:window.scrollY});function lh(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ah(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function ka(e,t){return(history.state?history.state.position-t:-1)+e}const Uo=new Map;function ch(e,t){Uo.set(e,t)}function uh(e){const t=Uo.get(e);return Uo.delete(e),t}function dh(e){return typeof e=="string"||e&&typeof e=="object"}function Mc(e){return typeof e=="string"||typeof e=="symbol"}let wt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Pc=Symbol("");wt.MATCHER_NOT_FOUND+"",wt.NAVIGATION_GUARD_REDIRECT+"",wt.NAVIGATION_ABORTED+"",wt.NAVIGATION_CANCELLED+"",wt.NAVIGATION_DUPLICATED+"";function Cs(e,t){return Ze(new Error,{type:e,[Pc]:!0},t)}function gn(e,t){return e instanceof Error&&Pc in e&&(t==null||!!(e.type&t))}const fh=["params","query","hash"];function hh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of fh)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ph(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const r=n[s].replace(Ec," "),o=r.indexOf("="),i=Zs(o<0?r:r.slice(0,o)),a=o<0?null:Zs(r.slice(o+1));if(i in t){let l=t[i];nn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Ta(e){let t="";for(let n in e){const s=e[n];if(n=Yf(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(nn(s)?s.map(r=>r&&Fo(r)):[s&&Fo(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function mh(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=nn(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const gh=Symbol(""),Sa=Symbol(""),Hr=Symbol(""),gi=Symbol(""),Vo=Symbol("");function Ps(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Nn(e,t,n,s,r,o=i=>i()){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const d=g=>{g===!1?l(Cs(wt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):dh(g)?l(Cs(wt.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&s.enterCallbacks[r]===i&&typeof g=="function"&&i.push(g),a())},u=o(()=>e.call(s&&s.instances[r],t,n,d));let f=Promise.resolve(u);e.length<3&&(f=f.then(d)),f.catch(g=>l(g))})}function mo(e,t,n,s,r=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(xc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Nn(d,n,s,i,a,r))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Df(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Nn(g,n,s,i,a,r)()}))}}return o}function vh(e,t){const n=[],s=[],r=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>xs(d,a))?s.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>xs(d,l))||r.push(l))}return[n,s,r]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let yh=()=>location.protocol+"//"+location.host;function Nc(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,a=r.slice(i);return a[0]!=="/"&&(a="/"+a),ba(a,"")}return ba(n,e)+s+r}function wh(e,t,n,s){let r=[],o=[],i=null;const a=({state:g})=>{const _=Nc(e,location),M=n.value,I=t.value;let D=0;if(g){if(n.value=_,t.value=g,i&&i===M){i=null;return}D=I?g.position-I.position:0}else s(_);r.forEach(G=>{G(n.value,M,{delta:D,type:Ho.pop,direction:D?D>0?po.forward:po.back:po.unknown})})};function l(){i=n.value}function d(g){r.push(g);const _=()=>{const M=r.indexOf(g);M>-1&&r.splice(M,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(Ze({},g.state,{scroll:Fr()}),"")}}function f(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:f}}function xa(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Fr():null}}function bh(e){const{history:t,location:n}=window,s={value:Nc(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:yh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),r.value=d}catch(_){console.error(_),n[u?"replace":"assign"](g)}}function i(l,d){o(l,Ze({},t.state,xa(r.value.back,l,r.value.forward,!0),d,{position:r.value.position}),!0),s.value=l}function a(l,d){const u=Ze({},r.value,t.state,{forward:l,scroll:Fr()});o(u.current,u,!0),o(l,Ze({},xa(s.value,l,null),{position:u.position+1},d),!1),s.value=l}return{location:s,state:r,push:a,replace:i}}function _h(e){e=rh(e);const t=bh(e),n=wh(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=Ze({location:"",base:e,go:s,createHref:ih.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function kh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),_h(e)}let ts=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var bt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(bt||{});const Th={type:ts.Static,value:""},Sh=/[a-zA-Z0-9_]/;function xh(e){if(!e)return[[]];if(e==="/")return[[Th]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=bt.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===bt.Static?o.push({type:ts.Static,value:d}):n===bt.Param||n===bt.ParamRegExp||n===bt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:ts.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==bt.ParamRegExp){s=n,n=bt.EscapeNext;continue}switch(n){case bt.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=bt.Param):g();break;case bt.EscapeNext:g(),n=s;break;case bt.Param:l==="("?n=bt.ParamRegExp:Sh.test(l)?g():(f(),n=bt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case bt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=bt.ParamRegExpEnd:u+=l;break;case bt.ParamRegExpEnd:f(),n=bt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===bt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),r}const Ca="[^/]+?",Ch={sensitive:!1,strict:!1,start:!0,end:!0};var Ot=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Ot||{});const Eh=/[.+*?^${}()[\]/\\]/g;function Ah(e,t){const n=Ze({},Ch,t),s=[];let r=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Ot.Root];n.strict&&!d.length&&(r+="/");for(let f=0;f<d.length;f++){const g=d[f];let _=Ot.Segment+(n.sensitive?Ot.BonusCaseSensitive:0);if(g.type===ts.Static)f||(r+="/"),r+=g.value.replace(Eh,"\\$&"),_+=Ot.Static;else if(g.type===ts.Param){const{value:M,repeatable:I,optional:D,regexp:G}=g;o.push({name:M,repeatable:I,optional:D});const P=G||Ca;if(P!==Ca){_+=Ot.BonusCustomRegExp;try{`${P}`}catch(B){throw new Error(`Invalid custom RegExp for param "${M}" (${P}): `+B.message)}}let U=I?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;f||(U=D&&d.length<2?`(?:/${U})`:"/"+U),D&&(U+="?"),r+=U,_+=Ot.Dynamic,D&&(_+=Ot.BonusOptional),I&&(_+=Ot.BonusRepeatable),P===".*"&&(_+=Ot.BonusWildcard)}u.push(_)}s.push(u)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=Ot.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const i=new RegExp(r,n.sensitive?"":"i");function a(d){const u=d.match(i),f={};if(!u)return null;for(let g=1;g<u.length;g++){const _=u[g]||"",M=o[g-1];f[M.name]=_&&M.repeatable?_.split("/"):_}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of g)if(_.type===ts.Static)u+=_.value;else if(_.type===ts.Param){const{value:M,repeatable:I,optional:D}=_,G=M in d?d[M]:"";if(nn(G)&&!I)throw new Error(`Provided param "${M}" is an array but it is not repeatable (* or + modifiers)`);const P=nn(G)?G.join("/"):G;if(!P)if(D)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${M}"`);u+=P}}return u||"/"}return{re:i,score:s,keys:o,parse:a,stringify:l}}function Ih(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Ot.Static+Ot.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ot.Static+Ot.Segment?1:-1:0}function Oc(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const o=Ih(s[n],r[n]);if(o)return o;n++}if(Math.abs(r.length-s.length)===1){if(Ea(s))return 1;if(Ea(r))return-1}return r.length-s.length}function Ea(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Rh={strict:!1,end:!0,sensitive:!1};function $h(e,t,n){const s=Ah(xh(e.path),n),r=Ze(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Mh(e,t){const n=[],s=new Map;t=wa(Rh,t);function r(f){return s.get(f)}function o(f,g,_){const M=!_,I=Ia(f);I.aliasOf=_&&_.record;const D=wa(t,f),G=[I];if("alias"in f){const B=typeof f.alias=="string"?[f.alias]:f.alias;for(const le of B)G.push(Ia(Ze({},I,{components:_?_.record.components:I.components,path:le,aliasOf:_?_.record:I})))}let P,U;for(const B of G){const{path:le}=B;if(g&&le[0]!=="/"){const ie=g.record.path,ce=ie[ie.length-1]==="/"?"":"/";B.path=g.record.path+(le&&ce+le)}if(P=$h(B,g,D),_?_.alias.push(P):(U=U||P,U!==P&&U.alias.push(P),M&&f.name&&!Ra(P)&&i(f.name)),jc(P)&&l(P),I.children){const ie=I.children;for(let ce=0;ce<ie.length;ce++)o(ie[ce],P,_&&_.children[ce])}_=_||P}return U?()=>{i(U)}:qs}function i(f){if(Mc(f)){const g=s.get(f);g&&(s.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&s.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Oh(f,n);n.splice(g,0,f),f.record.name&&!Ra(f)&&s.set(f.record.name,f)}function d(f,g){let _,M={},I,D;if("name"in f&&f.name){if(_=s.get(f.name),!_)throw Cs(wt.MATCHER_NOT_FOUND,{location:f});D=_.record.name,M=Ze(Aa(g.params,_.keys.filter(U=>!U.optional).concat(_.parent?_.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&Aa(f.params,_.keys.map(U=>U.name))),I=_.stringify(M)}else if(f.path!=null)I=f.path,_=n.find(U=>U.re.test(I)),_&&(M=_.parse(I),D=_.record.name);else{if(_=g.name?s.get(g.name):n.find(U=>U.re.test(g.path)),!_)throw Cs(wt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});D=_.record.name,M=Ze({},g.params,f.params),I=_.stringify(M)}const G=[];let P=_;for(;P;)G.unshift(P.record),P=P.parent;return{name:D,path:I,params:M,matched:G,meta:Nh(G)}}e.forEach(f=>o(f));function u(){n.length=0,s.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function Aa(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Ia(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ph(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ph(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Ra(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Nh(e){return e.reduce((t,n)=>Ze(t,n.meta),{})}function Oh(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;Oc(e,t[o])<0?s=o:n=o+1}const r=jh(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function jh(e){let t=e;for(;t=t.parent;)if(jc(t)&&Oc(e,t)===0)return t}function jc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function $a(e){const t=Qt(Hr),n=Qt(gi),s=ae(()=>{const l=$e(e.to);return t.resolve(l)}),r=ae(()=>{const{matched:l}=s.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(xs.bind(null,u));if(g>-1)return g;const _=Ma(l[d-2]);return d>1&&Ma(u)===_&&f[f.length-1].path!==_?f.findIndex(xs.bind(null,l[d-2])):g}),o=ae(()=>r.value>-1&&Hh(n.params,s.value.params)),i=ae(()=>r.value>-1&&r.value===n.matched.length-1&&$c(n.params,s.value.params));function a(l={}){if(Fh(l)){const d=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(qs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:ae(()=>s.value.href),isActive:o,isExactActive:i,navigate:a}}function Lh(e){return e.length===1?e[0]:e}const Dh=Ct({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:$a,setup(e,{slots:t}){const n=Mr($a(e)),{options:s}=Qt(Hr),r=ae(()=>({[Pa(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Pa(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Lh(t.default(n));return e.custom?o:pi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),Bh=Dh;function Fh(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Hh(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!nn(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function Ma(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Pa=(e,t,n)=>e??t??n,Uh=Ct({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Qt(Vo),r=ae(()=>e.route||s.value),o=Qt(Sa,0),i=ae(()=>{let d=$e(o);const{matched:u}=r.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ae(()=>r.value.matched[i.value]);pr(Sa,ae(()=>i.value+1)),pr(gh,a),pr(Vo,r);const l=O();return pt(()=>[l.value,a.value,e.name],([d,u,f],[g,_,M])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!xs(u,_)||!g)&&(u.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=r.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return Na(n.default,{Component:g,route:d});const _=f.props[u],M=_?_===!0?d.params:typeof _=="function"?_(d):_:null,D=pi(g,Ze({},M,t,{onVnodeUnmounted:G=>{G.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Na(n.default,{Component:D,route:d})||D}}});function Na(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Vh=Uh;function qh(e){const t=Mh(e.routes,e),n=e.parseQuery||ph,s=e.stringifyQuery||Ta,r=e.history,o=Ps(),i=Ps(),a=Ps(),l=Hu(Rn);let d=Rn;ys&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=fo.bind(null,A=>""+A),f=fo.bind(null,Qf),g=fo.bind(null,Zs);function _(A,X){let J,ye;return Mc(A)?(J=t.getRecordMatcher(A),ye=X):ye=A,t.addRoute(ye,J)}function M(A){const X=t.getRecordMatcher(A);X&&t.removeRoute(X)}function I(){return t.getRoutes().map(A=>A.record)}function D(A){return!!t.getRecordMatcher(A)}function G(A,X){if(X=Ze({},X||l.value),typeof A=="string"){const C=ho(n,A,X.path),L=t.resolve({path:C.path},X),V=r.createHref(C.fullPath);return Ze(C,L,{params:g(L.params),hash:Zs(C.hash),redirectedFrom:void 0,href:V})}let J;if(A.path!=null)J=Ze({},A,{path:ho(n,A.path,X.path).path});else{const C=Ze({},A.params);for(const L in C)C[L]==null&&delete C[L];J=Ze({},A,{params:f(C)}),X.params=f(X.params)}const ye=t.resolve(J,X),Te=A.hash||"";ye.params=u(g(ye.params));const m=eh(s,Ze({},A,{hash:zf(Te),path:ye.path})),y=r.createHref(m);return Ze({fullPath:m,hash:Te,query:s===Ta?mh(A.query):A.query||{}},ye,{redirectedFrom:void 0,href:y})}function P(A){return typeof A=="string"?ho(n,A,l.value.path):Ze({},A)}function U(A,X){if(d!==A)return Cs(wt.NAVIGATION_CANCELLED,{from:X,to:A})}function B(A){return ce(A)}function le(A){return B(Ze(P(A),{replace:!0}))}function ie(A,X){const J=A.matched[A.matched.length-1];if(J&&J.redirect){const{redirect:ye}=J;let Te=typeof ye=="function"?ye(A,X):ye;return typeof Te=="string"&&(Te=Te.includes("?")||Te.includes("#")?Te=P(Te):{path:Te},Te.params={}),Ze({query:A.query,hash:A.hash,params:Te.path!=null?{}:A.params},Te)}}function ce(A,X){const J=d=G(A),ye=l.value,Te=A.state,m=A.force,y=A.replace===!0,C=ie(J,ye);if(C)return ce(Ze(P(C),{state:typeof C=="object"?Ze({},Te,C.state):Te,force:m,replace:y}),X||J);const L=J;L.redirectedFrom=X;let V;return!m&&th(s,ye,J)&&(V=Cs(wt.NAVIGATION_DUPLICATED,{to:L,from:ye}),Je(ye,ye,!0,!1)),(V?Promise.resolve(V):Z(L,ye)).catch(j=>gn(j)?gn(j,wt.NAVIGATION_GUARD_REDIRECT)?j:ot(j):Ae(j,L,ye)).then(j=>{if(j){if(gn(j,wt.NAVIGATION_GUARD_REDIRECT))return ce(Ze({replace:y},P(j.to),{state:typeof j.to=="object"?Ze({},Te,j.to.state):Te,force:m}),X||L)}else j=Q(L,ye,!0,y,Te);return ge(L,ye,j),j})}function me(A,X){const J=U(A,X);return J?Promise.reject(J):Promise.resolve()}function oe(A){const X=ue.values().next().value;return X&&typeof X.runWithContext=="function"?X.runWithContext(A):A()}function Z(A,X){let J;const[ye,Te,m]=vh(A,X);J=mo(ye.reverse(),"beforeRouteLeave",A,X);for(const C of ye)C.leaveGuards.forEach(L=>{J.push(Nn(L,A,X))});const y=me.bind(null,A,X);return J.push(y),he(J).then(()=>{J=[];for(const C of o.list())J.push(Nn(C,A,X));return J.push(y),he(J)}).then(()=>{J=mo(Te,"beforeRouteUpdate",A,X);for(const C of Te)C.updateGuards.forEach(L=>{J.push(Nn(L,A,X))});return J.push(y),he(J)}).then(()=>{J=[];for(const C of m)if(C.beforeEnter)if(nn(C.beforeEnter))for(const L of C.beforeEnter)J.push(Nn(L,A,X));else J.push(Nn(C.beforeEnter,A,X));return J.push(y),he(J)}).then(()=>(A.matched.forEach(C=>C.enterCallbacks={}),J=mo(m,"beforeRouteEnter",A,X,oe),J.push(y),he(J))).then(()=>{J=[];for(const C of i.list())J.push(Nn(C,A,X));return J.push(y),he(J)}).catch(C=>gn(C,wt.NAVIGATION_CANCELLED)?C:Promise.reject(C))}function ge(A,X,J){a.list().forEach(ye=>oe(()=>ye(A,X,J)))}function Q(A,X,J,ye,Te){const m=U(A,X);if(m)return m;const y=X===Rn,C=ys?history.state:{};J&&(ye||y?r.replace(A.fullPath,Ze({scroll:y&&C&&C.scroll},Te)):r.push(A.fullPath,Te)),l.value=A,Je(A,X,J,y),ot()}let Ne;function Ve(){Ne||(Ne=r.listen((A,X,J)=>{if(!Se.listening)return;const ye=G(A),Te=ie(ye,Se.currentRoute.value);if(Te){ce(Ze(Te,{replace:!0,force:!0}),ye).catch(qs);return}d=ye;const m=l.value;ys&&ch(ka(m.fullPath,J.delta),Fr()),Z(ye,m).catch(y=>gn(y,wt.NAVIGATION_ABORTED|wt.NAVIGATION_CANCELLED)?y:gn(y,wt.NAVIGATION_GUARD_REDIRECT)?(ce(Ze(P(y.to),{force:!0}),ye).then(C=>{gn(C,wt.NAVIGATION_ABORTED|wt.NAVIGATION_DUPLICATED)&&!J.delta&&J.type===Ho.pop&&r.go(-1,!1)}).catch(qs),Promise.reject()):(J.delta&&r.go(-J.delta,!1),Ae(y,ye,m))).then(y=>{y=y||Q(ye,m,!1),y&&(J.delta&&!gn(y,wt.NAVIGATION_CANCELLED)?r.go(-J.delta,!1):J.type===Ho.pop&&gn(y,wt.NAVIGATION_ABORTED|wt.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),ge(ye,m,y)}).catch(qs)}))}let rt=Ps(),Pe=Ps(),_e;function Ae(A,X,J){ot(A);const ye=Pe.list();return ye.length?ye.forEach(Te=>Te(A,X,J)):console.error(A),Promise.reject(A)}function ct(){return _e&&l.value!==Rn?Promise.resolve():new Promise((A,X)=>{rt.add([A,X])})}function ot(A){return _e||(_e=!A,Ve(),rt.list().forEach(([X,J])=>A?J(A):X()),rt.reset()),A}function Je(A,X,J,ye){const{scrollBehavior:Te}=e;if(!ys||!Te)return Promise.resolve();const m=!J&&uh(ka(A.fullPath,0))||(ye||!J)&&history.state&&history.state.scroll||null;return tn().then(()=>Te(A,X,m)).then(y=>y&&lh(y)).catch(y=>Ae(y,A,X))}const ze=A=>r.go(A);let Ke;const ue=new Set,Se={currentRoute:l,listening:!0,addRoute:_,removeRoute:M,clearRoutes:t.clearRoutes,hasRoute:D,getRoutes:I,resolve:G,options:e,push:B,replace:le,go:ze,back:()=>ze(-1),forward:()=>ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Pe.add,isReady:ct,install(A){A.component("RouterLink",Bh),A.component("RouterView",Vh),A.config.globalProperties.$router=Se,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(l)}),ys&&!Ke&&l.value===Rn&&(Ke=!0,B(r.location).catch(ye=>{}));const X={};for(const ye in Rn)Object.defineProperty(X,ye,{get:()=>l.value[ye],enumerable:!0});A.provide(Hr,Se),A.provide(gi,$l(X)),A.provide(Vo,l);const J=A.unmount;ue.add(A),A.unmount=function(){ue.delete(A),ue.size<1&&(d=Rn,Ne&&Ne(),Ne=null,l.value=Rn,Ke=!1,_e=!1),J()}}};function he(A){return A.reduce((X,J)=>X.then(()=>oe(J)),Promise.resolve())}return Se}function Wh(){return Qt(Hr)}function Kh(e){return Qt(gi)}const Oa=768;function Lc(){const e=O(typeof window<"u"?window.innerWidth<Oa:!1);let t=null;function n(s){e.value=s.matches}return Hn(()=>{t=window.matchMedia(`(max-width: ${Oa-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),jr(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Gh={key:0,class:"desktop-sidebar"},zh={class:"desktop-main"},ja="codex-web-local.sidebar-width.v1",Yh=260,Jh=620,La=320,Qh=Ct({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Lc();function s(d){return Math.min(Jh,Math.max(Yh,d))}function r(){if(typeof window>"u")return La;const d=window.localStorage.getItem(ja),u=Number(d);return Number.isFinite(u)?s(u):La}const o=O(r()),i=ae(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(ja,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=M=>{const I=M.clientX-u;o.value=s(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)}return(d,u)=>(k(),x("div",{class:lt(["desktop-layout",{"is-mobile":$e(n)}]),style:rs(i.value)},[$e(n)?(k(),it(ql,{key:0,to:"body"},[Ce(Sc,{name:"drawer"},{default:st(()=>[e.isSidebarCollapsed?pe("",!0):(k(),x("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[w("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=dt(()=>{},["stop"]))},[dn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):pe("",!0),$e(n)?pe("",!0):(k(),x(Le,{key:1},[e.isSidebarCollapsed?pe("",!0):(k(),x("aside",Gh,[dn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?pe("",!0):(k(),x("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),w("section",zh,[dn(d.$slots,"content",{},void 0)])],6))}}),We=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Xh=We(Qh,[["__scopeId","data-v-df29c633"]]),Zh={},ep={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function tp(e,t){return k(),x("svg",ep,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2m2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8m-9 4h4"},null,-1)])])}const go=We(Zh,[["render",tp]]),np={},sp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rp(e,t){return k(),x("svg",sp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const vi=We(np,[["render",rp]]),op={},ip={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ap(e,t){return k(),x("svg",ip,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Dc=We(op,[["render",ap]]),lp={},cp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function up(e,t){return k(),x("svg",cp,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Da=We(lp,[["render",up]]),dp={},fp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hp(e,t){return k(),x("svg",fp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const xr=We(dp,[["render",hp]]),pp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gp(e,t){return k(),x("svg",mp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const vp=We(pp,[["render",gp]]),yp={},wp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function bp(e,t){return k(),x("svg",wp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const _p=We(yp,[["render",bp]]),kp={},Tp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sp(e,t){return k(),x("svg",Tp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const vo=We(kp,[["render",Sp]]),xp={},Cp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ep(e,t){return k(),x("svg",Cp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const yo=We(xp,[["render",Ep]]),Ap={key:0,class:"sidebar-menu-row-left"},Ip={class:"sidebar-menu-row-main"},Rp={key:1,class:"sidebar-menu-row-right"},$p={key:0,class:"sidebar-menu-row-right-default"},Mp={key:1,class:"sidebar-menu-row-right-hover"},Pp=Ct({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=yd(),s=ae(()=>!!n.left),r=ae(()=>!!n.right),o=ae(()=>!!n["right-hover"]),i=ae(()=>r.value||o.value);return(a,l)=>(k(),it(md(t.as),yc({class:"sidebar-menu-row","data-has-left":s.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:st(()=>[s.value?(k(),x("span",Ap,[dn(a.$slots,"left",{},void 0,!0)])):pe("",!0),w("span",Ip,[dn(a.$slots,"default",{},void 0,!0)]),i.value?(k(),x("span",Rp,[r.value?(k(),x("span",$p,[dn(a.$slots,"right",{},void 0,!0)])):pe("",!0),o.value?(k(),x("span",Mp,[dn(a.$slots,"right-hover",{},void 0,!0)])):pe("",!0)])):pe("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Qn=We(Pp,[["__scopeId","data-v-daeca4df"]]),Np={class:"thread-tree-root"},Op={key:0,class:"pinned-section"},jp={class:"thread-list"},Lp={class:"thread-left-stack"},Dp=["data-state"],Bp=["onClick"],Fp=["onClick"],Hp={class:"thread-row-title-wrap"},Up={class:"thread-row-title"},Vp={class:"thread-row-time"},qp=["data-confirm","onClick"],Wp={key:0},Kp=["aria-expanded"],Gp=["data-active"],zp={key:0},Yp=["data-active"],Jp={key:0},Qp={key:1,class:"thread-tree-no-results"},Xp={key:2,class:"thread-tree-loading"},Zp={key:3,class:"thread-list thread-list-global"},em={class:"thread-left-stack"},tm=["data-state"],nm=["onClick"],sm=["onClick"],rm={class:"thread-row-title-wrap"},om={class:"thread-row-title"},im={class:"thread-row-time"},am=["data-confirm","onClick"],lm={key:0},cm=["data-project-name","data-expanded","data-dragging"],um={class:"project-icon-stack"},dm={class:"project-icon-folder"},fm={class:"project-icon-chevron"},hm=["data-dragging-handle","onMousedown"],pm={class:"project-title"},mm={class:"project-hover-controls"},gm=["onClick"],vm=["onClick"],ym=["onClick"],wm=["onInput"],bm=["aria-label","title","onClick"],_m={key:0,class:"thread-list"},km={class:"thread-left-stack"},Tm=["data-state"],Sm=["onClick"],xm=["onClick"],Cm={class:"thread-row-title-wrap"},Em={class:"thread-row-title"},Am={class:"thread-row-time"},Im=["data-confirm","onClick"],Rm={key:0},$m=["onClick"],Mm=4,Ba=6,Fa="codex-web-local.thread-view-mode.v1",Ha="codex-web-local.collapsed-projects.v1",Pm=Ct({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,s=t,r=O({}),o=O({}),i=O([]),a=O(""),l=O(""),d=O("actions"),u=O(""),f=O(null),g=O(null),_=O(null);let M=null,I=null;const D=O(""),G=O({}),P=new Map,U=new Map,B=new WeakMap,le=O(null),ie=O(!1),ce=O(Z()),me=typeof window<"u"?new ResizeObserver(S=>{for(const $ of S){const N=$.target,Y=B.get(N);Y&&b(Y,N)}}):null;function oe(){if(typeof window>"u")return{};try{const S=window.localStorage.getItem(Ha);if(!S)return{};const $=JSON.parse(S);return!$||typeof $!="object"||Array.isArray($)?{}:$}catch{return{}}}function Z(){return typeof window>"u"?"project":window.localStorage.getItem(Fa)==="chronological"?"chronological":"project"}o.value=oe(),pt(o,S=>{typeof window>"u"||window.localStorage.setItem(Ha,JSON.stringify(S))},{deep:!0}),pt(ce,S=>{typeof window>"u"||window.localStorage.setItem(Fa,S)});const ge=ae(()=>n.searchQuery.trim().toLowerCase()),Q=ae(()=>ge.value.length>0);function Ne(S){if(!Q.value)return!0;const $=ge.value;return S.title.toLowerCase().includes($)||S.preview.toLowerCase().includes($)}const Ve=ae(()=>Q.value?n.groups.map(S=>({...S,threads:S.threads.filter(Ne)})).filter(S=>S.threads.length>0):n.groups),rt=ae(()=>ce.value==="chronological"),Pe=ae(()=>{const S=Ve.value,$=[];for(const N of S)for(const Y of N.threads)ue(Y.id)||$.push(Y);return $.sort((N,Y)=>{const Ue=new Date(N.updatedAtIso||N.createdAtIso).getTime();return new Date(Y.updatedAtIso||Y.createdAtIso).getTime()-Ue})}),_e=ae(()=>{const S=new Map;for(const $ of n.groups)for(const N of $.threads)S.set(N.id,N);return S}),Ae=ae(()=>i.value.map(S=>_e.value.get(S)??null).filter(S=>S!==null).filter(Ne)),ct=ae(()=>{const S=_.value;if(!S||S.dropTargetIndexFull===null||n.groups.length===0)return null;const $=Math.max(0,Math.min(S.dropTargetIndexFull,n.groups.length)),N=$>S.fromIndex?$-1:$,Y=Math.max(0,Math.min(N,n.groups.length-1));return Y===S.fromIndex?null:Y}),ot=ae(()=>{const $=(Q.value?Ve.value:n.groups).map(Lt=>Lt.projectName),N=_.value,Y=ct.value;if(!N||Y===null)return $;const Ue=[...$],[vt]=Ue.splice(N.fromIndex,1);return vt?(Ue.splice(Y,0,vt),Ue):$}),Je=ae(()=>{const S={};let $=0;for(const N of ot.value)S[N]=$,$+=ke(N);return S}),ze=ae(()=>{let S=0;for(const $ of ot.value)S+=ke($);return{height:`${Math.max(0,S)}px`}});function Ke(S){const $=new Date(S).getTime();if(Number.isNaN($))return"n/a";const N=Math.abs(Date.now()-$);if(N<6e4)return"now";const Y=Math.floor(N/6e4);if(Y<60)return`${Y}m`;const Ue=Math.floor(Y/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function ue(S){return i.value.includes(S)}function Se(S){if(ue(S)){i.value=i.value.filter($=>$!==S);return}i.value=[S,...i.value]}function he(S){s("select",S)}function A(S){if(a.value!==S){a.value=S;return}a.value="",i.value=i.value.filter($=>$!==S),s("archive",S)}function X(S){return`start new thread ${Te(S)}`}function J(S){s("start-new-thread",S)}function ye(S){a.value===S&&(a.value="")}function Te(S){return n.projectDisplayNameById[S]??S}function m(S){return l.value===S}function y(){l.value="",d.value="actions",u.value=""}function C(){ie.value=!ie.value}function L(S){ce.value=S,ie.value=!1}function V(S){if(l.value===S){y();return}l.value=S,d.value="actions",u.value=Te(S)}function j(S){l.value=S,d.value="rename",u.value=Te(S)}function ee(S){s("rename-project",{projectName:S,displayName:u.value})}function te(S){s("remove-project",S),y()}function z(S,$){if(!S.altKey||S.key!=="ArrowUp"&&S.key!=="ArrowDown")return;const N=n.groups.findIndex(vt=>vt.projectName===$);if(N<0)return;const Y=S.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(N+Y,n.groups.length-1));Ue!==N&&(S.preventDefault(),s("reorder-project",{projectName:$,toIndex:Ue}))}function H(S){return r.value[S]===!0}function de(S){return o.value[S]===!0}function se(S){r.value={...r.value,[S]:!H(S)}}function fe(S){if(D.value===S){D.value="";return}o.value={...o.value,[S]:!de(S)}}function ke(S){const $=G.value[S]??0,N=_.value,Ue=((N==null?void 0:N.projectName)===S?N.groupHeight:null)??$,vt=de(S)?0:Ba;return Math.max(0,Ue+vt)}function je(S,$){const N=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(N){U.set(S,N);return}U.delete(S)}function He(S){const $=l.value;if(!$)return!1;const N=U.get($);if(!N)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(N))return!0;const Ue=S.target;return Ue instanceof Node?N.contains(Ue):!1}function Re(S){if(ie.value){const $=le.value,N=typeof S.composedPath=="function"?S.composedPath():[];!!$&&(N.includes($)||S.target instanceof Node&&$.contains(S.target))||(ie.value=!1)}l.value&&(He(S)||y())}function ft(S){l.value&&(He(S)||y())}function nt(){ie.value&&(ie.value=!1),l.value&&y()}function F(){window.addEventListener("pointerdown",Re,{capture:!0}),window.addEventListener("focusin",ft,{capture:!0}),window.addEventListener("blur",nt)}function p(){window.removeEventListener("pointerdown",Re,{capture:!0}),window.removeEventListener("focusin",ft,{capture:!0}),window.removeEventListener("blur",nt)}function b(S,$){const N=$.getBoundingClientRect().height;if(!Number.isFinite(N)||N<=0)return;const Y=G.value[S];Y!==void 0&&Math.abs(Y-N)<.5||(G.value={...G.value,[S]:N})}function E(S,$){const N=P.get(S);N&&N!==$&&me&&me.unobserve(N);const Y=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(Y){P.set(S,Y),B.set(Y,S),b(S,Y),me==null||me.observe(Y);return}N&&(me==null||me.unobserve(N)),P.delete(S)}function q(S,$){if(S.button!==0||g.value||_.value)return;const N=n.groups.findIndex(Lt=>Lt.projectName===$),Y=P.get($);if(N<0||!Y)return;const Ue=Y.getBoundingClientRect(),vt=de($)?0:Ba;g.value={projectName:$,fromIndex:N,startClientX:S.clientX,startClientY:S.clientY,pointerOffsetY:S.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+vt},S.preventDefault(),re()}function re(){window.addEventListener("mousemove",Qe),window.addEventListener("mouseup",Ge),window.addEventListener("keydown",Xe)}function xe(){window.removeEventListener("mousemove",Qe),window.removeEventListener("mouseup",Ge),window.removeEventListener("keydown",Xe)}function Qe(S){M={clientX:S.clientX,clientY:S.clientY},Pt()}function Ge(S){sn({clientX:S.clientX,clientY:S.clientY});const $=_.value;if($&&ct.value!==null){const N=n.groups.findIndex(Y=>Y.projectName===$.projectName);if(N>=0){const Y=ct.value;Y!==N&&s("reorder-project",{projectName:$.projectName,toIndex:Y})}}ht()}function Xe(S){S.key==="Escape"&&(!g.value&&!_.value||(S.preventDefault(),ht()))}function ht(){I!==null&&(window.cancelAnimationFrame(I),I=null),M=null,g.value=null,_.value=null,D.value="",xe()}function Pt(){I===null&&(I=window.requestAnimationFrame(()=>{if(I=null,!M)return;const S=M;M=null,sn(S)}))}function sn(S){const $=g.value;if(!_.value&&$){const N=S.clientX-$.startClientX,Y=S.clientY-$.startClientY;if(Math.hypot(N,Y)<Mm)return;y(),D.value=$.projectName,_.value={projectName:$.projectName,fromIndex:$.fromIndex,pointerOffsetY:$.pointerOffsetY,groupLeft:$.groupLeft,groupWidth:$.groupWidth,groupHeight:$.groupHeight,groupOuterHeight:$.groupOuterHeight,ghostTop:S.clientY-$.pointerOffsetY,dropTargetIndexFull:null}}_.value&&rn(S)}function rn(S){const $=_.value;if(!$)return;if($.ghostTop=S.clientY-$.pointerOffsetY,!Be(S)){$.dropTargetIndexFull=null;return}const N=S.clientY,Y=f.value;if(!Y){$.dropTargetIndexFull=null;return}const Ue=Y.getBoundingClientRect(),vt=new Map(n.groups.map((Ft,En)=>[Ft.projectName,En])),Lt=n.groups.map(Ft=>Ft.projectName).filter(Ft=>Ft!==$.projectName);let ls=0,qn=n.groups.length;for(const Ft of Lt){const En=vt.get(Ft);if(En===void 0)continue;const cs=ke(Ft),As=Ue.top+ls+cs/2;if(N<As){qn=En;break}ls+=cs}$.dropTargetIndexFull=qn}function Be(S){const $=f.value;if(!$)return!1;const N=$.getBoundingClientRect(),Y=S.clientX>=N.left&&S.clientX<=N.right,Ue=S.clientY>=N.top-32&&S.clientY<=N.bottom+32;return Y&&Ue}function Ie(S){var $;return(($=_.value)==null?void 0:$.projectName)===S}function os(S){const $=_.value,N=Je.value[S]??0,Y=l.value===S;return!$||$.projectName!==S?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Y?"40":"1",transform:`translate3d(0, ${N}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${$.groupLeft}px`,width:`${$.groupWidth}px`,height:`${$.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${$.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function kt(S){return S.threads.filter($=>!ue($.id))}function Bt(S){if(Q.value)return kt(S);if(de(S.projectName))return[];const $=kt(S);return H(S.projectName)?$:$.slice(0,10)}function is(S){return Q.value?!1:!de(S.projectName)&&kt(S).length>10}function Vn(S){return kt(S).length>0}function Cn(S){return S.inProgress?"working":S.unread?"unread":"idle"}pt(()=>n.groups.map(S=>S.projectName),S=>{var Ue,vt;const $=((Ue=_.value)==null?void 0:Ue.projectName)??((vt=g.value)==null?void 0:vt.projectName)??"";$&&!n.groups.some(Lt=>Lt.projectName===$)&&ht();const N=new Set(S),Y=Object.fromEntries(Object.entries(G.value).filter(([Lt])=>N.has(Lt)));Object.keys(Y).length!==Object.keys(G.value).length&&(G.value=Y)});const as=ae(()=>ie.value||l.value!=="");return pt(as,S=>{if(S){F();return}p()}),Un(()=>{for(const S of P.values())me==null||me.unobserve(S);P.clear(),U.clear(),p(),ht()}),(S,$)=>(k(),x("section",Np,[Ae.value.length>0?(k(),x("section",Op,[w("ul",jp,[(k(!0),x(Le,null,mt(Ae.value,N=>(k(),x("li",{key:N.id,class:"thread-row-item"},[Ce(Qn,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":ue(N.id),onMouseleave:Y=>ye(N.id)},{left:st(()=>[w("span",Lp,[N.inProgress||N.unread?(k(),x("span",{key:0,class:"thread-status-indicator","data-state":Cn(N)},null,8,Dp)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>Se(N.id)},[Ce(yo,{class:"thread-icon"})],8,Bp)])]),right:st(()=>[w("span",Vp,be(Ke(N.createdAtIso||N.updatedAtIso)),1)]),"right-hover":st(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===N.id,type:"button",title:"archive_thread",onClick:Y=>A(N.id)},[a.value===N.id?(k(),x("span",Wp,"confirm")):(k(),it(go,{key:1,class:"thread-icon"}))],8,qp)]),default:st(()=>[w("button",{class:"thread-main-button",type:"button",onClick:Y=>he(N.id)},[w("span",Hp,[w("span",Up,be(N.title),1),N.hasWorktree?(k(),it(vo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,Fp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):pe("",!0),Ce(Qn,{as:"header",class:"thread-tree-header-row"},{right:st(()=>[w("div",{ref_key:"organizeMenuWrapRef",ref:le,class:"organize-menu-wrap"},[w("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ie.value,"aria-label":"Organize threads",title:"Organize threads",onClick:C},[Ce(Da,{class:"thread-icon"})],8,Kp),ie.value?(k(),x("div",{key:0,class:"organize-menu-panel",onClick:$[2]||($[2]=dt(()=>{},["stop"]))},[$[7]||($[7]=w("p",{class:"organize-menu-title"},"Organize",-1)),w("button",{class:"organize-menu-item","data-active":ce.value==="project",type:"button",onClick:$[0]||($[0]=N=>L("project"))},[$[5]||($[5]=w("span",null,"By project",-1)),ce.value==="project"?(k(),x("span",zp,"✓")):pe("",!0)],8,Gp),w("button",{class:"organize-menu-item","data-active":ce.value==="chronological",type:"button",onClick:$[1]||($[1]=N=>L("chronological"))},[$[6]||($[6]=w("span",null,"Chronological list",-1)),ce.value==="chronological"?(k(),x("span",Jp,"✓")):pe("",!0)],8,Yp)])):pe("",!0)],512)]),default:st(()=>[$[8]||($[8]=w("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Q.value&&Ve.value.length===0?(k(),x("p",Qp,"No matching threads")):e.isLoading&&e.groups.length===0?(k(),x("p",Xp,"Loading threads...")):rt.value?(k(),x("ul",Zp,[(k(!0),x(Le,null,mt(Pe.value,N=>(k(),x("li",{key:N.id,class:"thread-row-item"},[Ce(Qn,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":ue(N.id),onMouseleave:Y=>ye(N.id)},{left:st(()=>[w("span",em,[N.inProgress||N.unread?(k(),x("span",{key:0,class:"thread-status-indicator","data-state":Cn(N)},null,8,tm)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>Se(N.id)},[Ce(yo,{class:"thread-icon"})],8,nm)])]),right:st(()=>[w("span",im,be(Ke(N.createdAtIso||N.updatedAtIso)),1)]),"right-hover":st(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===N.id,type:"button",title:"archive_thread",onClick:Y=>A(N.id)},[a.value===N.id?(k(),x("span",lm,"confirm")):(k(),it(go,{key:1,class:"thread-icon"}))],8,am)]),default:st(()=>[w("button",{class:"thread-main-button",type:"button",onClick:Y=>he(N.id)},[w("span",rm,[w("span",om,be(N.title),1),N.hasWorktree?(k(),it(vo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,sm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(k(),x("div",{key:4,ref_key:"groupsContainerRef",ref:f,class:"thread-tree-groups",style:rs(ze.value)},[(k(!0),x(Le,null,mt(Ve.value,N=>(k(),x("article",{key:N.projectName,ref_for:!0,ref:Y=>E(N.projectName,Y),class:"project-group","data-project-name":N.projectName,"data-expanded":!de(N.projectName),"data-dragging":Ie(N.projectName),style:rs(os(N.projectName))},[Ce(Qn,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Y=>fe(N.projectName),onKeydown:[Y=>z(Y,N.projectName),Vt(dt(Y=>fe(N.projectName),["prevent"]),["enter"]),Vt(dt(Y=>fe(N.projectName),["prevent"]),["space"])]},{left:st(()=>[w("span",um,[w("span",dm,[de(N.projectName)?(k(),it(vp,{key:0,class:"thread-icon"})):(k(),it(_p,{key:1,class:"thread-icon"}))]),w("span",fm,[de(N.projectName)?(k(),it(Dc,{key:0,class:"thread-icon"})):(k(),it(vi,{key:1,class:"thread-icon"}))])])]),right:st(()=>[w("div",mm,[w("div",{ref_for:!0,ref:Y=>je(N.projectName,Y),class:"project-menu-wrap"},[w("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:dt(Y=>V(N.projectName),["stop"])},[Ce(Da,{class:"thread-icon"})],8,gm),m(N.projectName)?(k(),x("div",{key:0,class:"project-menu-panel",onClick:$[4]||($[4]=dt(()=>{},["stop"]))},[d.value==="actions"?(k(),x(Le,{key:0},[w("button",{class:"project-menu-item",type:"button",onClick:Y=>j(N.projectName)}," Edit name ",8,vm),w("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Y=>te(N.projectName)}," Remove ",8,ym)],64)):(k(),x(Le,{key:1},[$[9]||($[9]=w("label",{class:"project-menu-label"},"Project name",-1)),Ln(w("input",{"onUpdate:modelValue":$[3]||($[3]=Y=>u.value=Y),class:"project-menu-input",type:"text",onInput:Y=>ee(N.projectName)},null,40,wm),[[Bn,u.value]])],64))])):pe("",!0)],512),w("button",{class:"thread-start-button",type:"button","aria-label":X(N.projectName),title:X(N.projectName),onClick:dt(Y=>J(N.projectName),["stop"])},[Ce(xr,{class:"thread-icon"})],8,bm)])]),default:st(()=>[w("span",{class:"project-main-button","data-dragging-handle":Ie(N.projectName),onMousedown:dt(Y=>q(Y,N.projectName),["left"])},[w("span",pm,be(Te(N.projectName)),1)],40,hm)]),_:2},1032,["onClick","onKeydown"]),Vn(N)?(k(),x("ul",_m,[(k(!0),x(Le,null,mt(Bt(N),Y=>(k(),x("li",{key:Y.id,class:"thread-row-item"},[Ce(Qn,{class:"thread-row","data-active":Y.id===e.selectedThreadId,"data-pinned":ue(Y.id),onMouseleave:Ue=>ye(Y.id)},{left:st(()=>[w("span",km,[Y.inProgress||Y.unread?(k(),x("span",{key:0,class:"thread-status-indicator","data-state":Cn(Y)},null,8,Tm)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>Se(Y.id)},[Ce(yo,{class:"thread-icon"})],8,Sm)])]),right:st(()=>[w("span",Am,be(Ke(Y.createdAtIso||Y.updatedAtIso)),1)]),"right-hover":st(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===Y.id,type:"button",title:"archive_thread",onClick:Ue=>A(Y.id)},[a.value===Y.id?(k(),x("span",Rm,"confirm")):(k(),it(go,{key:1,class:"thread-icon"}))],8,Im)]),default:st(()=>[w("button",{class:"thread-main-button",type:"button",onClick:Ue=>he(Y.id)},[w("span",Cm,[w("span",Em,be(Y.title),1),Y.hasWorktree?(k(),it(vo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,xm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(k(),it(Qn,{key:1,as:"p",class:"project-empty-row"},{left:st(()=>[...$[10]||($[10]=[w("span",{class:"project-empty-spacer"},null,-1)])]),default:st(()=>[$[11]||($[11]=w("span",{class:"project-empty"},"No threads",-1))]),_:1})),is(N)?(k(),it(Qn,{key:2,class:"thread-show-more-row"},{left:st(()=>[...$[12]||($[12]=[w("span",{class:"thread-show-more-spacer"},null,-1)])]),default:st(()=>[w("button",{class:"thread-show-more-button",type:"button",onClick:Y=>se(N.projectName)},be(H(N.projectName)?"Show less":"Show more"),9,$m)]),_:2},1024)):pe("",!0)],12,cm))),128))],4))]))}}),Nm=We(Pm,[["__scopeId","data-v-5bbc0cb5"]]),Om={class:"content-header"},jm={class:"content-leading"},Lm={class:"content-title"},Dm={class:"content-actions"},Bm=Ct({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(k(),x("header",Om,[w("div",jm,[dn(t.$slots,"leading",{},void 0)]),w("h1",Lm,be(e.title),1),w("div",Dm,[dn(t.$slots,"actions",{},void 0)])]))}}),Fm=We(Bm,[["__scopeId","data-v-66ee223c"]]),Hm={},Um={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Vm(e,t){return k(),x("svg",Um,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const yi=We(Hm,[["render",Vm]]),qm={},Wm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Km(e,t){return k(),x("svg",Wm,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Gm=We(qm,[["render",Km]]),zm={class:"conversation-root"},Ym={key:0,class:"conversation-loading"},Jm={key:1,class:"conversation-empty"},Qm={class:"message-row"},Xm={class:"message-stack"},Zm={class:"request-card"},eg={class:"request-title"},tg={class:"request-meta"},ng={key:0,class:"request-reason"},sg={key:1,class:"request-actions"},rg=["onClick"],og=["onClick"],ig=["onClick"],ag=["onClick"],lg={key:2,class:"request-actions"},cg=["onClick"],ug=["onClick"],dg=["onClick"],fg=["onClick"],hg={key:3,class:"request-user-input"},pg={class:"request-question-title"},mg={key:0,class:"request-question-text"},gg=["value","onChange"],vg=["value"],yg=["value","onInput"],wg=["onClick"],bg={key:4,class:"request-actions"},_g=["onClick"],kg=["onClick"],Tg={key:5,class:"request-actions"},Sg=["onClick"],xg=["onClick"],Cg=["data-role","data-message-type"],Eg={key:0,class:"message-row","data-role":"system"},Ag={class:"message-stack","data-role":"system"},Ig=["onClick"],Rg={class:"cmd-label"},$g={class:"cmd-status"},Mg={class:"cmd-output-inner"},Pg={class:"cmd-output"},Ng=["data-role","data-message-type"],Og=["data-role"],jg=["data-role"],Lg=["data-role"],Dg=["onClick"],Bg=["src"],Fg={key:1,class:"message-file-attachments"},Hg=["title"],Ug=["data-role"],Vg={key:0,class:"worked-separator-wrap","aria-live":"polite"},qg=["onClick"],Wg={class:"worked-separator-text"},Kg={key:0,class:"worked-details"},Gg=["onClick"],zg={class:"cmd-label"},Yg={class:"cmd-status"},Jg={class:"cmd-output-inner"},Qg={class:"cmd-output"},Xg={key:1,class:"message-text-flow"},Zg={key:0,class:"message-text"},ev={key:0},tv={key:2,class:"message-inline-code"},nv={key:1,class:"message-text"},sv=["onClick"],rv=["src","alt","onError"],ov=["onClick"],iv={key:0,class:"conversation-item conversation-item-overlay"},av={class:"message-row"},lv={class:"message-stack"},cv={class:"live-overlay-inline","aria-live":"polite"},uv={class:"live-overlay-label"},dv={key:0,class:"live-overlay-reasoning"},fv={key:1,class:"live-overlay-error"},hv=["src"],pv=16,mv=Ct({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=O(new Set),s=O(new Set),r=O(new Set),o=O({});function i(p){return p.messageType==="commandExecution"&&!!p.commandExecution}function a(p){var b;return((b=p.commandExecution)==null?void 0:b.status)==="inProgress"||s.value.has(p.id)?!0:n.value.has(p.id)}function l(p){return s.value.has(p.id)}function d(p){var E;if(((E=p.commandExecution)==null?void 0:E.status)==="inProgress")return;const b=new Set(n.value);b.has(p.id)?b.delete(p.id):b.add(p.id),n.value=b}function u(p){const b=new Set(r.value);b.has(p.id)?b.delete(p.id):b.add(p.id),r.value=b}function f(p){return r.value.has(p.id)}function g(p){const b=p.commandExecution;if(!b)return"";switch(b.status){case"inProgress":return"⟳ Running";case"completed":return b.exitCode===0?"✓ Completed":`✗ Exit ${b.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(p){var E,q;const b=(E=p.commandExecution)==null?void 0:E.status;return b==="inProgress"?"cmd-status-running":b==="completed"&&((q=p.commandExecution)==null?void 0:q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function M(p){const b=new Set(s.value);b.add(p),s.value=b,setTimeout(()=>{const E=new Set(s.value);E.delete(p),s.value=E},1e3)}function I(p,b){const E=[];for(let q=b-1;q>=0;q--){const re=p[q];if(re.messageType==="commandExecution")E.unshift(re);else if(re.role==="user"||re.messageType==="worked")break}return E}const D=e,G=t,P=O(null),U=O(null),B=O(""),le=O({}),ie=O({});let ce=0,me=0,oe=0;const Z=new WeakSet,ge=O(new Set);function Q(p){if(!p||/\s/u.test(p)||p.endsWith("/")||p.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(p))return!1;const b=p.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(p),q=p.startsWith("./")||p.startsWith("../")||p.startsWith("~/"),re=p.includes("/")||p.includes("\\");return b||E||q||re}function Ne(p){return p.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||p}function Ve(p){if(!p)return null;let b=p,E=null;const q=b.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(q)b=q[1],E=Number(q[2]);else{const re=b.match(/^(.*):(\d+)(?::\d+)?$/u);re&&(b=re[1],E=Number(re[2]))}return Q(b)?{path:b,line:E}:null}function rt(p){if(!p.includes("`"))return[{kind:"text",value:p}];const b=[];let E=0,q=0;for(;E<p.length;){if(p[E]!=="`"){E+=1;continue}let re=1;for(;E+re<p.length&&p[E+re]==="`";)re+=1;const xe="`".repeat(re);let Qe=E+re,Ge=-1;for(;Qe<p.length;){const ht=p.indexOf(xe,Qe);if(ht<0)break;const Pt=ht>0&&p[ht-1]==="`",sn=ht+re<p.length&&p[ht+re]==="`",rn=p.slice(E+re,ht).includes(`
26
+ `);if(!Pt&&!sn&&!rn){Ge=ht;break}Qe=ht+1}if(Ge<0){E+=re;continue}E>q&&b.push({kind:"text",value:p.slice(q,E)});const Xe=p.slice(E+re,Ge);if(Xe.length>0){const ht=Ve(Xe);if(ht){const Pt=Ne(ht.path),sn=ht.line?`${Pt} (line ${String(ht.line)})`:Pt;b.push({kind:"file",value:Xe,displayName:sn})}else b.push({kind:"code",value:Xe})}else b.push({kind:"text",value:`${xe}${xe}`});E=Ge+re,q=E}return q<p.length&&b.push({kind:"text",value:p.slice(q)}),b}function Pe(p){const b=p.trim();if(!b)return"";if(b.startsWith("data:")||b.startsWith("blob:")||b.startsWith("http://")||b.startsWith("https://")||b.startsWith("/codex-local-image?"))return b;if(b.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(b)}`;const E=b.startsWith("/"),q=/^[A-Za-z]:[\\/]/u.test(b);return E||q?`/codex-local-image?path=${encodeURIComponent(b)}`:b}function _e(p){if(!p.includes("![")||!p.includes("]("))return[{kind:"text",value:p}];const b=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let q=0;for(const re of p.matchAll(E)){const[xe,Qe,Ge]=re;if(typeof re.index!="number")continue;const Xe=re.index,ht=Xe+xe.length,Pt=Pe(Ge.trim());Pt&&(Xe>q&&b.push({kind:"text",value:p.slice(q,Xe)}),b.push({kind:"image",url:Pt,alt:Qe.trim(),markdown:xe}),q=ht)}return q<p.length&&b.push({kind:"text",value:p.slice(q)}),b.length>0?b:[{kind:"text",value:p}]}function Ae(p){return p!==null&&typeof p=="object"&&!Array.isArray(p)?p:null}function ct(p){const b=new Date(p);return Number.isNaN(b.getTime())?p:b.toLocaleTimeString()}function ot(p){const b=Ae(p.params),E=b==null?void 0:b.reason;return typeof E=="string"?E.trim():""}function Je(p,b){return`${String(p)}:${b}`}function ze(p){const b=Ae(p.params),E=Array.isArray(b==null?void 0:b.questions)?b.questions:[],q=[];for(const re of E){const xe=Ae(re);if(!xe)continue;const Qe=typeof xe.id=="string"?xe.id:"";if(!Qe)continue;const Ge=Array.isArray(xe.options)?xe.options.map(Xe=>Ae(Xe)).map(Xe=>Xe==null?void 0:Xe.label).filter(Xe=>typeof Xe=="string"&&Xe.length>0):[];q.push({id:Qe,header:typeof xe.header=="string"?xe.header:"",question:typeof xe.question=="string"?xe.question:"",isOther:xe.isOther===!0,options:Ge})}return q}function Ke(p,b,E){const q=Je(p,b),re=le.value[q];return typeof re=="string"&&re.length>0?re:E}function ue(p,b){const E=Je(p,b);return ie.value[E]??""}function Se(p,b,E){const q=E.target;if(!(q instanceof HTMLSelectElement))return;const re=Je(p,b);le.value={...le.value,[re]:q.value}}function he(p,b,E){const q=E.target;if(!(q instanceof HTMLInputElement))return;const re=Je(p,b);ie.value={...ie.value,[re]:q.value}}function A(p,b){G("respondServerRequest",{id:p,result:{decision:b}})}function X(p){const b=ze(p),E={};for(const q of b){const re=Ke(p.id,q.id,q.options[0]||""),xe=ue(p.id,q.id).trim(),Qe=[re,xe].map(Ge=>Ge.trim()).filter(Ge=>Ge.length>0);E[q.id]={answers:Qe}}G("respondServerRequest",{id:p.id,result:{answers:E}})}function J(p){G("respondServerRequest",{id:p,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function ye(p){G("respondServerRequest",{id:p,result:{success:!0,contentItems:[]}})}function Te(p){G("respondServerRequest",{id:p,result:{}})}function m(p){G("respondServerRequest",{id:p,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function y(p){return!(p.role!=="user"&&p.role!=="assistant"||typeof p.turnIndex!="number"||D.isTurnInProgress||D.isRollingBack)}function C(p){y(p)&&G("rollback",{turnIndex:p.turnIndex})}function L(){const p=P.value,b=U.value;!p||!b||(p.scrollTop=p.scrollHeight,b.scrollIntoView({block:"end"}))}function V(p){return p.scrollHeight-(p.scrollTop+p.clientHeight)<=pv}function j(p){if(!D.activeThreadId)return;const b=Math.max(p.scrollHeight-p.clientHeight,0),E=b>0?Math.min(Math.max(p.scrollTop/b,0),1):1;G("updateScrollState",{threadId:D.activeThreadId,state:{scrollTop:p.scrollTop,isAtBottom:V(p),scrollRatio:E}})}function ee(){const p=P.value;if(!p)return;const b=D.scrollState;if(!b||b.isAtBottom){te();return}const E=Math.max(p.scrollHeight-p.clientHeight,0),q=typeof b.scrollRatio=="number"?b.scrollRatio*E:b.scrollTop;p.scrollTop=Math.min(Math.max(q,0),E),j(p)}function te(){const p=P.value;p&&(L(),j(p))}function z(){const p=D.scrollState;return!p||p.isAtBottom===!0}function H(){if(!z()){oe=0,me=0;return}if(te(),oe-=1,oe<=0){me=0;return}me=requestAnimationFrame(H)}function de(p=6){z()&&(me&&(cancelAnimationFrame(me),me=0),oe=Math.max(p,1),me=requestAnimationFrame(H))}function se(){de(3)}function fe(){if(!z())return;const p=P.value;if(!p)return;const b=p.querySelectorAll("img.message-image-preview");for(const E of b)E.complete||Z.has(E)||(Z.add(E),E.addEventListener("load",se,{once:!0}),E.addEventListener("error",se,{once:!0}))}async function ke(){await tn(),ce&&cancelAnimationFrame(ce),ce=requestAnimationFrame(()=>{ce=0,ee(),fe(),de()})}pt(()=>D.messages,async p=>{if(!D.isLoading){for(const b of p){if(b.messageType!=="commandExecution"||!b.commandExecution)continue;const E=o.value[b.id],q=b.commandExecution.status;E==="inProgress"&&q!=="inProgress"&&M(b.id),o.value[b.id]=q}await ke()}}),pt(()=>D.liveOverlay,async p=>{p&&(await tn(),te(),de(8))},{deep:!0}),pt(()=>D.isLoading,async p=>{p||await ke()}),pt(()=>D.activeThreadId,()=>{B.value="",ge.value=new Set},{flush:"post"});function je(){const p=P.value;!p||D.isLoading||j(p)}function He(p){B.value=Pe(p)}function Re(p,b){return`${p}:${String(b)}`}function ft(p,b){const E=new Set(ge.value);E.add(Re(p,b)),ge.value=E}function nt(p,b){return ge.value.has(Re(p,b))}function F(){B.value=""}return Un(()=>{ce&&cancelAnimationFrame(ce),me&&cancelAnimationFrame(me)}),(p,b)=>(k(),x("section",zm,[e.isLoading?(k(),x("p",Ym,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(k(),x("p",Jm," No messages in this thread yet. ")):(k(),x("ul",{key:2,ref_key:"conversationListRef",ref:P,class:"conversation-list",onScroll:je},[(k(!0),x(Le,null,mt(e.pendingRequests,E=>(k(),x("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[w("div",Qm,[w("div",Xm,[w("article",Zm,[w("p",eg,be(E.method),1),w("p",tg,"Request #"+be(E.id)+" · "+be(ct(E.receivedAtIso)),1),ot(E)?(k(),x("p",ng,be(ot(E)),1)):pe("",!0),E.method==="item/commandExecution/requestApproval"?(k(),x("section",sg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:q=>A(E.id,"accept")},"Accept",8,rg),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"acceptForSession")},"Accept for Session",8,og),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"decline")},"Decline",8,ig),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"cancel")},"Cancel",8,ag)])):E.method==="item/fileChange/requestApproval"?(k(),x("section",lg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:q=>A(E.id,"accept")},"Accept",8,cg),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"acceptForSession")},"Accept for Session",8,ug),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"decline")},"Decline",8,dg),w("button",{type:"button",class:"request-button",onClick:q=>A(E.id,"cancel")},"Cancel",8,fg)])):E.method==="item/tool/requestUserInput"?(k(),x("section",hg,[(k(!0),x(Le,null,mt(ze(E),q=>(k(),x("div",{key:`${E.id}:${q.id}`,class:"request-question"},[w("p",pg,be(q.header||q.question),1),q.header&&q.question?(k(),x("p",mg,be(q.question),1)):pe("",!0),w("select",{class:"request-select",value:Ke(E.id,q.id,q.options[0]||""),onChange:re=>Se(E.id,q.id,re)},[(k(!0),x(Le,null,mt(q.options,re=>(k(),x("option",{key:`${E.id}:${q.id}:${re}`,value:re},be(re),9,vg))),128))],40,gg),q.isOther?(k(),x("input",{key:1,class:"request-input",type:"text",value:ue(E.id,q.id),placeholder:"Other answer",onInput:re=>he(E.id,q.id,re)},null,40,yg)):pe("",!0)]))),128)),w("button",{type:"button",class:"request-button request-button-primary",onClick:q=>X(E)}," Submit Answers ",8,wg)])):E.method==="item/tool/call"?(k(),x("section",bg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:q=>J(E.id)},"Fail Tool Call",8,_g),w("button",{type:"button",class:"request-button",onClick:q=>ye(E.id)},"Success (Empty)",8,kg)])):(k(),x("section",Tg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:q=>Te(E.id)},"Return Empty Result",8,Sg),w("button",{type:"button",class:"request-button",onClick:q=>m(E.id)},"Reject Request",8,xg)]))])])])]))),128)),(k(!0),x(Le,null,mt(e.messages,E=>{var q,re;return k(),x("li",{key:E.id,class:lt(["conversation-item",{"conversation-item-rollbackable":y(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(k(),x("div",Eg,[w("div",Ag,[w("button",{type:"button",class:lt(["cmd-row",[_(E),{"cmd-expanded":a(E)}]]),onClick:xe=>d(E)},[w("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),w("code",Rg,be(((q=E.commandExecution)==null?void 0:q.command)||"(command)"),1),w("span",$g,be(g(E)),1)],10,Ig),w("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[w("div",Mg,[w("pre",Pg,be(((re=E.commandExecution)==null?void 0:re.aggregatedOutput)||"(no output)"),1)])],2)])])):(k(),x("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[w("div",{class:"message-stack","data-role":E.role},[w("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(k(),x("ul",{key:0,class:"message-image-list","data-role":E.role},[(k(!0),x(Le,null,mt(E.images,xe=>(k(),x("li",{key:xe,class:"message-image-item"},[w("button",{class:"message-image-button",type:"button",onClick:Qe=>He(xe)},[w("img",{class:"message-image-preview",src:Pe(xe),alt:"Message image preview",loading:"lazy"},null,8,Bg)],8,Dg)]))),128))],8,Lg)):pe("",!0),E.fileAttachments&&E.fileAttachments.length>0?(k(),x("div",Fg,[(k(!0),x(Le,null,mt(E.fileAttachments,xe=>(k(),x("span",{key:xe.path,class:"message-file-chip"},[b[2]||(b[2]=w("span",{class:"message-file-chip-icon"},"📄",-1)),w("span",{class:"message-file-chip-name",title:xe.path},be(xe.label),9,Hg)]))),128))])):pe("",!0),E.text.length>0?(k(),x("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(k(),x("div",Vg,[w("button",{type:"button",class:"worked-separator",onClick:xe=>u(E)},[b[3]||(b[3]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),w("span",{class:lt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),w("p",Wg,be(E.text),1),b[4]||(b[4]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,qg),f(E)?(k(),x("div",Kg,[(k(!0),x(Le,null,mt(I(e.messages,e.messages.indexOf(E)),xe=>{var Qe,Ge;return k(),x("div",{key:`worked-cmd-${xe.id}`,class:"worked-cmd-item"},[w("button",{type:"button",class:lt(["cmd-row",[_(xe),{"cmd-expanded":a(xe)}]]),onClick:Xe=>d(xe)},[w("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(xe)}])},"▶",2),w("code",zg,be(((Qe=xe.commandExecution)==null?void 0:Qe.command)||"(command)"),1),w("span",Yg,be(g(xe)),1)],10,Gg),w("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(xe),"cmd-output-collapsing":l(xe)}])},[w("div",Jg,[w("pre",Qg,be(((Ge=xe.commandExecution)==null?void 0:Ge.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):pe("",!0)])):(k(),x("div",Xg,[(k(!0),x(Le,null,mt(_e(E.text),(xe,Qe)=>(k(),x(Le,{key:`block-${Qe}`},[xe.kind==="text"?(k(),x("p",Zg,[(k(!0),x(Le,null,mt(rt(xe.value),(Ge,Xe)=>(k(),x(Le,{key:`seg-${Qe}-${Xe}`},[Ge.kind==="text"?(k(),x("span",ev,be(Ge.value),1)):Ge.kind==="file"?(k(),x("a",{key:1,class:"message-file-link",href:"#",onClick:b[0]||(b[0]=dt(()=>{},["prevent"]))},be(Ge.displayName),1)):(k(),x("code",tv,be(Ge.value),1))],64))),128))])):nt(E.id,Qe)?(k(),x("p",nv,be(xe.markdown),1)):(k(),x("button",{key:2,class:"message-image-button",type:"button",onClick:Ge=>He(xe.url)},[w("img",{class:"message-image-preview message-markdown-image",src:xe.url,alt:xe.alt||"Embedded message image",loading:"lazy",onError:Ge=>ft(E.id,Qe)},null,40,rv)],8,sv))],64))),128))]))],8,Ug)):pe("",!0)],8,jg),y(E)?(k(),x("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:xe=>C(E)},[Ce(Gm,{class:"rollback-icon"}),b[5]||(b[5]=w("span",{class:"rollback-label"},"Rollback",-1))],8,ov)):pe("",!0)],8,Og)],8,Ng))],10,Cg)}),128)),e.liveOverlay?(k(),x("li",iv,[w("div",av,[w("div",lv,[w("article",cv,[w("p",uv,be(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(k(),x("p",dv,be(e.liveOverlay.reasoningText),1)):pe("",!0),e.liveOverlay.errorText?(k(),x("p",fv,be(e.liveOverlay.errorText),1)):pe("",!0)])])])])):pe("",!0),w("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),B.value.length>0?(k(),x("div",{key:3,class:"image-modal-backdrop",onClick:F},[w("div",{class:"image-modal-content",onClick:b[1]||(b[1]=dt(()=>{},["stop"]))},[w("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:F},[Ce(yi,{class:"icon-svg"})]),w("img",{class:"image-modal-image",src:B.value,alt:"Expanded message image"},null,8,hv)])])):pe("",!0)]))}}),gv=We(mv,[["__scopeId","data-v-d55e2ae4"]]);function vv(e){var u;const t=O("idle"),n=O(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let s=null,r=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{r=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],s=new MediaRecorder(r),s.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},s.onstop=()=>{var M;const g=o,_=(s==null?void 0:s.mimeType)||((M=g[0])==null?void 0:M.type)||"audio/webm";d(),t.value="idle",l(g,_)},s.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!s||s.state!=="inactive"&&s.stop()}async function l(f,g){var M;if(f.length===0)return;const _=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",D=`----codex-transcribe-${crypto.randomUUID()}`,G=new Uint8Array(await _.arrayBuffer()),P=new TextEncoder,U=[];U.push(P.encode(`--${D}\r
27
+ `)),U.push(P.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
+ `)),U.push(P.encode(`Content-Type: ${g}\r
29
+ \r
30
+ `)),U.push(G),U.push(P.encode(`\r
31
+ --${D}--\r
32
+ `));let B=0;for(const Z of U)B+=Z.byteLength;const le=new Uint8Array(B);let ie=0;for(const Z of U)le.set(Z,ie),ie+=Z.byteLength;const ce=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${D}`},body:le});if(!ce.ok)throw new Error(`Transcription failed: ${ce.status}`);const oe=((await ce.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(I){(M=e.onError)==null||M.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){s&&(s.ondataavailable=null,s.onstop=null,s=null),r&&(r.getTracks().forEach(f=>f.stop()),r=null),o=[]}return Un(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Ua(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class _n extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function wi(e,t){const n=Ua(e);if(!n)return t;const s=n.error;if(typeof s=="string"&&s.length>0)return s;const r=Ua(s);return r&&typeof r.message=="string"&&r.message.length>0?r.message:t}function Es(e,t,n){return e instanceof _n?e:e instanceof Error?new _n(e.message||t,{code:"unknown_error",method:n}):new _n(t,{code:"unknown_error",method:n})}function Bc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function yv(e,t){const n={method:e,params:t??null};let s;try{s=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new _n(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let r=null;try{r=await s.json()}catch{r=null}if(!s.ok)throw new _n(wi(r,`RPC ${e} failed with HTTP ${s.status}`),{code:"http_error",method:e,status:s.status});const o=r;if(!o||typeof o!="object"||!("result"in o))throw new _n(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:s.status});return o.result}function Va(e){const t=Bc(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function wv(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const s=()=>{if(typeof EventSource>"u"||n)return;const r=new EventSource("/codex-api/events");r.onmessage=o=>{try{const i=JSON.parse(o.data),a=Va(i);a&&e(a)}catch{}},t=()=>r.close()};if(typeof WebSocket<"u"){const r=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${r}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),s())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Va(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&s()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&s()},t=()=>o.close()}else s();return()=>{n=!0,t==null||t()}}async function bv(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(s){throw new _n(s instanceof Error?s.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new _n(wi(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function _v(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new _n(wi(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Bc(t),s=n==null?void 0:n.data;return Array.isArray(s)?s:[]}function qa(e){return new Date(e*1e3).toISOString()}function kv(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Tv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Sv=/^##\s+(.+?):\s+(.+?)\s*$/,xv=/^#\s*files mentioned by the user\s*:?\s*$/i;function Cv(e){var r,o;const t=e.split(`
33
+ `).findIndex(i=>xv.test(i.trim()));if(t<0)return[];const n=e.split(`
34
+ `).slice(t+1),s=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Sv);if(!l)break;const d=(r=l[1])==null?void 0:r.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&s.push({label:d,path:u})}return s}function Ev(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const s=n.at(-1);if(!s||typeof s.index!="number")return e.trim();const r=s.index+s[0].length;return e.slice(r).trim()}function Av(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],s=[],r=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&s.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&r.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:Tv(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Cv(o);return{text:Ev(o),images:s,fileAttachments:i,rawBlocks:r}}function Iv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Av(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="commandExecution"){const t=e,n=Rv(t.status),s=typeof t.command=="string"?t.command:"",r=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:s,messageType:"commandExecution",commandExecution:{command:s,cwd:r,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function Rv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function $v(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Mv(e){const t=$v(e);return t.length>0?t:"Untitled thread"}function Pv(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,s=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:e.id,title:Mv(e),projectName:kv(e.cwd),cwd:e.cwd,hasWorktree:s,createdAtIso:qa(e.createdAt),updatedAtIso:qa(e.updatedAt),preview:e.preview,unread:!1,inProgress:!1}}function Nv(e){const t=new Map;for(const n of e){const s=t.get(n.projectName);s?s.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,s])=>({projectName:n,threads:s.sort((r,o)=>new Date(o.updatedAtIso).getTime()-new Date(r.updatedAtIso).getTime())})).sort((n,s)=>{var i,a;const r=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=s.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-r})}function Ov(e){const t=e.data.map(Pv);return Nv(t)}function Fc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let s=0;s<t.length;s++){const r=t[s],o=Array.isArray(r.items)?r.items:[];for(const i of o)for(const a of Iv(i))n.push({...a,turnIndex:s})}return n}async function qt(e,t){try{return await yv(e,t)}catch(n){throw Es(n,`RPC ${e} failed`,e)}}function jv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Lv(){const e=await qt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Ov(e)}async function Dv(e){const t=await qt("thread/read",{threadId:e,includeTurns:!0});return Fc(t)}async function Bv(){try{return await Lv()}catch(e){throw Es(e,"Failed to load thread groups","thread/list")}}async function Fv(e){try{return await Dv(e)}catch(t){throw Es(t,`Failed to load thread ${e}`,"thread/read")}}function Hv(e){return wv(e)}async function Uv(e,t){await bv({id:e,...t})}async function Vv(){return _v()}async function wo(e){await qt("thread/resume",{threadId:e})}async function qv(e){await qt("thread/archive",{threadId:e})}async function Wa(e,t){const n=await qt("thread/rollback",{threadId:e,numTurns:t});return Fc(n)}function Wv(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const s=n.id;if(typeof s=="string"&&s.length>0)return s}return""}async function Ka(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const s=await qt("thread/start",n),r=Wv(s);if(!r)throw new Error("thread/start did not return a thread id");return r}catch(n){throw Es(n,"Failed to start a new thread","thread/start")}}function Kv(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
+ `;for(const s of t)n+=`
37
+ ## ${s.label}: ${s.path}
38
+ `;return`${n}
39
+ ## My request for Codex:
40
+
41
+ ${e}
42
+ `}async function bo(e,t,n=[],s,r,o,i=[]){try{const l=[{type:"text",text:Kv(t,i)}];for(const f of n){const g=f.trim();g&&l.push({type:"image",url:g,image_url:g})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const d=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof s=="string"&&s.length>0&&(u.model=s),typeof r=="string"&&r.length>0&&(u.effort=r),await qt("turn/start",u)}catch(a){throw Es(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Gv(e,t){const n=e.trim(),s=(t==null?void 0:t.trim())||"";if(n)try{if(!s)throw new Error("turn/interrupt requires turnId");await qt("turn/interrupt",{threadId:n,turnId:s})}catch(r){throw Es(r,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function zv(e){await qt("setDefaultModel",{model:e})}async function Yv(){const e=await qt("model/list",{}),t=[];for(const n of e.data){const s=n.id||n.model;!s||t.includes(s)||t.push(s)}return t}async function Jv(){const e=await qt("config/read",{}),t=e.config.model??"",n=jv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function Qv(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},s=t.labels,r={};if(s&&typeof s=="object"&&!Array.isArray(s))for(const[o,i]of Object.entries(s))typeof o=="string"&&o.length>0&&typeof i=="string"&&(r[o]=i);return{order:n(t.order),labels:r,active:n(t.active)}}async function Ga(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return Qv(n.data)}async function za(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},s=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof s.path=="string"?s.path.trim():""}async function Xv(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function Zv(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),s=await n.json();if(!n.ok){const a=bi(s,"Failed to open project root");throw new Error(a)}const r=s&&typeof s=="object"&&!Array.isArray(s)?s:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof o.path=="string"?o.path.trim():""}async function ey(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),s=await n.json();if(!n.ok){const i=bi(s,"Failed to suggest project name");throw new Error(i)}const r=s&&typeof s=="object"&&!Array.isArray(s)?s:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function ty(e,t,n=20){const s=e.trim();if(!s)return[];const r=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:s,query:t.trim(),limit:n})}),o=await r.json();if(!r.ok){const d=bi(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}function bi(e,t){const s=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof s=="string"&&s.trim().length>0?s:t}async function ny(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function Ya(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function sy(e,t){var n;try{return((n=(await qt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function ry(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await qt("skills/list",t),s=[],r=new Set;for(const o of n.data)for(const i of o.skills)!i.name||r.has(i.path)||(r.add(i.path),s.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return s}catch{return[]}}async function oy(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const iy={},ay={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ly(e,t){return k(),x("svg",ay,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const cy=We(iy,[["render",ly]]),uy={},dy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fy(e,t){return k(),x("svg",dy,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const hy=We(uy,[["render",fy]]),py={},my={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gy(e,t){return k(),x("svg",my,[...t[0]||(t[0]=[w("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),w("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const vy=We(py,[["render",gy]]),yy=["disabled"],wy={class:"composer-dropdown-value"},by={class:"composer-dropdown-menu"},_y={key:0,class:"composer-dropdown-search-wrap"},ky=["placeholder","onKeydown"],Ty={class:"composer-dropdown-options",role:"listbox"},Sy=["onClick"],xy={key:0,class:"composer-dropdown-empty"},Cy={key:1,class:"composer-dropdown-add-wrap"},Ey=["placeholder","onKeydown"],Ay=Ct({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,s=t,r=O(null),o=O(null),i=O(null),a=O(!1),l=O(""),d=O(!1),u=O(""),f=ae(()=>{var ge;const Z=n.options.find(Q=>Q.value===n.modelValue);return Z?Z.label:((ge=n.placeholder)==null?void 0:ge.trim())||""}),g=ae(()=>n.openDirection??"down"),_=ae(()=>n.enableSearch===!0),M=ae(()=>n.showAddAction===!0),I=ae(()=>{var Z;return((Z=n.searchPlaceholder)==null?void 0:Z.trim())||"Quick search projects"}),D=ae(()=>{var Z;return((Z=n.addActionLabel)==null?void 0:Z.trim())||"Add new project"}),G=ae(()=>{var Z;return((Z=n.addPlaceholder)==null?void 0:Z.trim())||"Project name or absolute path"}),P=ae(()=>{const Z=l.value.trim().toLowerCase();return Z?n.options.filter(ge=>ge.label.toLowerCase().includes(Z)||ge.value.toLowerCase().includes(Z)):n.options});function U(){n.disabled||(a.value=!a.value)}function B(Z){s("update:modelValue",Z),a.value=!1,l.value=""}function le(){var Z;d.value=!0,u.value=((Z=n.defaultAddValue)==null?void 0:Z.trim())||"",tn(()=>{var ge;return(ge=i.value)==null?void 0:ge.focus()})}function ie(){if(l.value.length>0){l.value="";return}a.value=!1}function ce(){const Z=u.value.trim();Z&&(s("add",Z),d.value=!1,u.value="",a.value=!1,l.value="")}function me(){d.value=!1,u.value="",a.value=!1,l.value=""}function oe(Z){if(!a.value)return;const ge=r.value;if(!ge)return;const Q=Z.target;Q instanceof Node&&(ge.contains(Q)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return pt(a,Z=>{if(!Z){d.value=!1,u.value="";return}_.value&&tn(()=>{var ge;return(ge=o.value)==null?void 0:ge.focus()})}),Hn(()=>{window.addEventListener("pointerdown",oe)}),Un(()=>{window.removeEventListener("pointerdown",oe)}),(Z,ge)=>(k(),x("div",{ref_key:"rootRef",ref:r,class:"composer-dropdown"},[w("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[w("span",wy,be(f.value),1),Ce(vi,{class:"composer-dropdown-chevron"})],8,yy),a.value?(k(),x("div",{key:0,class:lt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[w("div",by,[_.value?(k(),x("div",_y,[Ln(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ge[0]||(ge[0]=Q=>l.value=Q),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Vt(dt(ie,["prevent"]),["esc"])},null,40,ky),[[Bn,l.value]])])):pe("",!0),w("ul",Ty,[(k(!0),x(Le,null,mt(P.value,Q=>(k(),x("li",{key:Q.value},[w("button",{class:lt(["composer-dropdown-option",{"is-selected":Q.value===e.modelValue}]),type:"button",onClick:Ne=>B(Q.value)},be(Q.label),11,Sy)]))),128)),P.value.length===0?(k(),x("li",xy," No matching projects ")):pe("",!0)]),M.value?(k(),x("div",Cy,[d.value?(k(),x(Le,{key:0},[Ln(w("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ge[1]||(ge[1]=Q=>u.value=Q),class:"composer-dropdown-add-input",type:"text",placeholder:G.value,onKeydown:[Vt(dt(ce,["prevent"]),["enter"]),Vt(dt(me,["prevent"]),["esc"])]},null,40,Ey),[[Bn,u.value]]),w("div",{class:"composer-dropdown-add-actions"},[w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ce},"Open"),w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:me},"Cancel")])],64)):(k(),x("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:le},be(D.value),1))])):pe("",!0)])],2)):pe("",!0)],512))}}),qo=We(Ay,[["__scopeId","data-v-7cfa2012"]]),Iy=["disabled"],Ry={class:"search-dropdown-value"},$y={class:"search-dropdown-search-wrap"},My=["placeholder","onKeydown"],Py={key:0,class:"search-dropdown-list",role:"listbox"},Ny=["onClick","onPointerenter"],Oy={class:"search-dropdown-option-check"},jy={class:"search-dropdown-option-label"},Ly={key:0,class:"search-dropdown-option-desc"},Dy={key:1,class:"search-dropdown-empty"},By=Ct({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,s=t,r=O(null),o=O(null),i=O(!1),a=O(""),l=O(0),d=ae(()=>n.openDirection??"down"),u=ae(()=>new Set(n.selectedValues)),f=ae(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const P=n.options.find(U=>U.value===n.selectedValues[0]);return(P==null?void 0:P.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ae(()=>{const P=a.value.toLowerCase().trim();return P?n.options.filter(U=>{var B;return U.label.toLowerCase().includes(P)||(((B=U.description)==null?void 0:B.toLowerCase().includes(P))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var P;return(P=o.value)==null?void 0:P.focus()})))}function M(P){s("toggle",P.value,!u.value.has(P.value))}function I(P){g.value.length!==0&&(l.value=(l.value+P+g.value.length)%g.value.length)}function D(){const P=g.value[l.value];P&&M(P)}function G(P){if(!i.value)return;const U=r.value;if(!U)return;const B=P.target;B instanceof Node&&(U.contains(B)||(i.value=!1))}return pt(a,()=>{l.value=0}),Hn(()=>window.addEventListener("pointerdown",G)),Un(()=>window.removeEventListener("pointerdown",G)),(P,U)=>(k(),x("div",{ref_key:"rootRef",ref:r,class:"search-dropdown"},[w("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[w("span",Ry,be(f.value),1),Ce(vi,{class:"search-dropdown-chevron"})],8,Iy),i.value?(k(),x("div",{key:0,class:lt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[w("div",$y,[Ln(w("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=B=>a.value=B),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Vt(dt(B=>i.value=!1,["prevent"]),["escape"])),Vt(dt(D,["prevent"]),["enter"]),U[2]||(U[2]=Vt(dt(B=>I(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Vt(dt(B=>I(-1),["prevent"]),["arrow-up"]))]},null,40,My),[[Bn,a.value]])]),g.value.length>0?(k(),x("ul",Py,[(k(!0),x(Le,null,mt(g.value,(B,le)=>(k(),x("li",{key:B.value},[w("button",{class:lt(["search-dropdown-option",{"is-selected":u.value.has(B.value),"is-highlighted":le===l.value}]),type:"button",onClick:ie=>M(B),onPointerenter:ie=>l.value=le},[w("span",Oy,be(u.value.has(B.value)?"✓":""),1),w("span",jy,be(B.label),1),B.description?(k(),x("span",Ly,be(B.description),1)):pe("",!0)],42,Ny)]))),128))])):(k(),x("div",Dy,"No results"))],2)):pe("",!0)],512))}}),Fy=We(By,[["__scopeId","data-v-a0f2edd4"]]),Hy={class:"skill-picker-header"},Uy=["onKeydown"],Vy={key:0,class:"skill-picker-list",role:"listbox"},qy=["onClick","onPointerenter"],Wy={class:"skill-picker-name"},Ky={key:0,class:"skill-picker-desc"},Gy={key:1,class:"skill-picker-empty"},zy=Ct({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,s=t,r=O(null),o=O(null),i=O(""),a=O(0),l=ae(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),d=ae(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&s("select",g)}return pt(()=>n.visible,g=>{g&&(i.value="",a.value=0,tn(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),pt(i,()=>{a.value=0}),(g,_)=>e.visible?(k(),x("div",{key:0,ref_key:"rootRef",ref:r,class:"skill-picker",style:rs(d.value)},[w("div",Hy,[Ln(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=M=>i.value=M),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Vt(dt(M=>g.$emit("close"),["prevent"]),["escape"])),Vt(dt(f,["prevent"]),["enter"]),_[2]||(_[2]=Vt(dt(M=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Vt(dt(M=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Uy),[[Bn,i.value]])]),l.value.length>0?(k(),x("ul",Vy,[(k(!0),x(Le,null,mt(l.value,(M,I)=>(k(),x("li",{key:M.path},[w("button",{class:lt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:D=>g.$emit("select",M),onPointerenter:D=>a.value=I},[w("span",Wy,be(M.name),1),M.description?(k(),x("span",Ky,be(M.description),1)):pe("",!0)],42,qy)]))),128))])):(k(),x("div",Gy,"No skills found"))],4)):pe("",!0)}}),Yy=We(zy,[["__scopeId","data-v-d6a08788"]]),Jy={key:0,class:"thread-composer-attachments"},Qy=["src","alt"],Xy=["aria-label","disabled","onClick"],Zy={key:1,class:"thread-composer-file-chips"},ew=["title"],tw=["aria-label","disabled","onClick"],nw={key:2,class:"thread-composer-skill-chips"},sw={class:"thread-composer-skill-chip-name"},rw=["aria-label","onClick"],ow={class:"thread-composer-input-wrap"},iw={key:0,class:"thread-composer-file-mentions"},aw=["onMousedown"],lw={key:1,class:"thread-composer-file-mention-icon-markdown"},cw={class:"thread-composer-file-mention-text"},uw={class:"thread-composer-file-mention-name"},dw={key:0,class:"thread-composer-file-mention-dir"},fw={key:1,class:"thread-composer-file-mention-empty"},hw=["placeholder","disabled"],pw={class:"thread-composer-controls"},mw=["disabled"],gw={key:0,class:"thread-composer-attach-menu"},vw=["disabled"],yw=["disabled"],ww={class:"thread-composer-actions"},bw=["aria-label","title","disabled"],_w=["disabled"],kw=["aria-label","title","disabled"],Tw=["disabled"],Sw=["disabled"],xw=Ct({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,s=t,r=O(""),o=O([]),i=O([]),a=O([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=vv({onTranscript:F=>{r.value=r.value?`${r.value}
43
+ ${F}`:F}}),g=O(null),_=O(null),M=O(null),I=O(null),D=O(!1),G=O(!1),P=O(null),U=O(""),B=O([]),le=O(!1),ie=O(0);let ce=0,me=null;const oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Z=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ge=ae(()=>n.models.map(F=>({value:F,label:F}))),Q=ae(()=>n.skills??[]),Ne=ae(()=>i.value.map(F=>F.path)),Ve=ae(()=>(n.skills??[]).map(F=>({value:F.path,label:F.name,description:F.description}))),rt=ae(()=>n.disabled||!n.activeThreadId?!1:r.value.trim().length>0||o.value.length>0||a.value.length>0),Pe=ae(()=>n.disabled||!n.activeThreadId),_e=ae(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Ae=ae(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function ct(F="steer"){var b;const p=r.value.trim();if(rt.value){if(s("submit",{text:p,imageUrls:o.value.map(E=>E.url),fileAttachments:[...a.value],skills:i.value.map(E=>({name:E.name,path:E.path})),mode:F}),r.value="",o.value=[],i.value=[],a.value=[],D.value=!1,G.value=!1,ee(),oe){(b=I.value)==null||b.blur();return}tn(()=>{var E;return(E=I.value)==null?void 0:E.focus()})}}function ot(){s("interrupt")}function Je(F){s("update:selected-model",F)}function ze(F){s("update:selected-reasoning-effort",F)}function Ke(){Pe.value||(D.value=!D.value)}function ue(){var F;(F=_.value)==null||F.click()}function Se(){var F;(F=M.value)==null||F.click()}function he(F){o.value=o.value.filter(p=>p.id!==F)}function A(F){i.value=i.value.filter(p=>p.path!==F)}function X(F){a.value=a.value.filter(p=>p.fsPath!==F)}function J(F){const p=F.replace(/\\/g,"/");if(a.value.some(q=>q.fsPath===p))return;const b=p.split("/").filter(Boolean),E=b[b.length-1]??p;a.value=[...a.value,{label:E,path:p,fsPath:p}]}function ye(F){return F.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(F.name)}function Te(F){if(!(!F||F.length===0))for(const p of Array.from(F))if(ye(p)){const b=new FileReader;b.onload=()=>{typeof b.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:p.name,url:b.result})},b.readAsDataURL(p)}else oy(p).then(b=>{b&&J(b)}).catch(()=>{})}function m(F){F&&(F.value="")}function y(F){const p=F.target;Te((p==null?void 0:p.files)??null),m(p),D.value=!1}function C(F){const p=F.target;Te((p==null?void 0:p.files)??null),m(p),D.value=!1}function L(){const p=r.value.startsWith("/");p!==G.value&&(G.value=p),te()}function V(F){if(le.value){if(F.key==="Escape"){F.preventDefault(),ee();return}if(F.key==="ArrowDown"){F.preventDefault(),B.value.length>0&&(ie.value=(ie.value+1)%B.value.length);return}if(F.key==="ArrowUp"){if(F.preventDefault(),B.value.length>0){const b=B.value.length;ie.value=(ie.value+b-1)%b}return}if(F.key==="Enter"||F.key==="Tab"){F.preventDefault();const b=B.value[ie.value];b?H(b):ee();return}}if(n.sendWithEnter!==!1?F.key==="Enter"&&!F.shiftKey:F.key==="Enter"&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ct(n.isTurnInProgress?_e.value:"steer");return}if(G.value){if(F.key==="Escape"){F.preventDefault(),j();return}if(F.key==="ArrowDown"||F.key==="ArrowUp"){F.preventDefault();return}}}function j(){var F;G.value=!1,(F=I.value)==null||F.focus()}function ee(){le.value=!1,P.value=null,U.value="",B.value=[],ie.value=0}function te(){const F=I.value;if(!F){ee();return}const p=F.selectionStart??r.value.length,E=r.value.slice(0,p).match(/(^|\s)(@[^\s@]*)$/);if(!E){ee();return}const q=E[2]??"",re=q.length,xe=p-re;P.value=xe,U.value=q.slice(1),le.value=!0,z()}async function z(){if(!le.value)return;const F=(n.cwd??"").trim();if(!F){B.value=[];return}me&&clearTimeout(me);const p=++ce;me=setTimeout(async()=>{try{const b=await ty(F,U.value,20);if(!le.value||p!==ce)return;B.value=b,ie.value=0}catch{if(!le.value||p!==ce)return;B.value=[]}},120)}function H(F){const p=I.value,b=P.value;if(b!==null&&p){const E=p.selectionStart??r.value.length;r.value=`${r.value.slice(0,b)}${r.value.slice(E)}`.trimEnd()}J(F.path),ee(),tn(()=>p==null?void 0:p.focus())}function de(F){const p=F.lastIndexOf("/");return p<0?F:F.slice(p+1)}function se(F){const p=F.lastIndexOf("/");return p<=0?"":F.slice(0,p)}function fe(F){const p=de(F),b=p.lastIndexOf(".");return b<=0?"":p.slice(b+1).toLowerCase()}function ke(F){const p=fe(F);return p==="ts"?"TS":p==="tsx"?"TSX":p==="js"?"JS":p==="jsx"?"JSX":p==="json"?"{}":""}function je(F){const p=fe(F);return p.startsWith("ts")?"ts":p.startsWith("js")?"js":p==="json"?"json":"default"}function He(F){const p=fe(F);return p==="md"||p==="mdx"}function Re(F){var p;i.value.some(b=>b.path===F.path)||(i.value=[...i.value,F]),r.value=r.value.startsWith("/")?"":r.value,G.value=!1,(p=I.value)==null||p.focus()}function ft(F,p){if(p){const b=(n.skills??[]).find(E=>E.path===F);b&&!i.value.some(E=>E.path===F)&&(i.value=[...i.value,b])}else i.value=i.value.filter(b=>b.path!==F)}function nt(F){if(!D.value)return;const p=g.value;if(!p)return;const b=F.target;!b||p.contains(b)||(D.value=!1)}return Hn(()=>{document.addEventListener("click",nt)}),Un(()=>{document.removeEventListener("click",nt),me&&clearTimeout(me)}),pt(()=>n.activeThreadId,()=>{r.value="",o.value=[],i.value=[],a.value=[],D.value=!1,G.value=!1,ee()}),pt(()=>n.cwd,()=>{le.value&&z()}),(F,p)=>(k(),x("form",{class:"thread-composer",onSubmit:p[7]||(p[7]=dt(b=>ct("steer"),["prevent"]))},[w("div",{class:lt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(k(),x("div",Jy,[(k(!0),x(Le,null,mt(o.value,b=>(k(),x("div",{key:b.id,class:"thread-composer-attachment"},[w("img",{class:"thread-composer-attachment-image",src:b.url,alt:b.name||"Selected image"},null,8,Qy),w("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${b.name||"image"}`,disabled:Pe.value,onClick:E=>he(b.id)}," x ",8,Xy)]))),128))])):pe("",!0),a.value.length>0?(k(),x("div",Zy,[(k(!0),x(Le,null,mt(a.value,b=>(k(),x("span",{key:b.fsPath,class:"thread-composer-file-chip"},[Ce(xr,{class:"thread-composer-file-chip-icon"}),w("span",{class:"thread-composer-file-chip-name",title:b.fsPath},be(b.label),9,ew),w("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${b.label}`,disabled:Pe.value,onClick:E=>X(b.fsPath)},"×",8,tw)]))),128))])):pe("",!0),i.value.length>0?(k(),x("div",nw,[(k(!0),x(Le,null,mt(i.value,b=>(k(),x("span",{key:b.path,class:"thread-composer-skill-chip"},[w("span",sw,be(b.name),1),w("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${b.name}`,onClick:E=>A(b.path)},"×",8,rw)]))),128))])):pe("",!0),w("div",ow,[le.value?(k(),x("div",iw,[B.value.length>0?(k(!0),x(Le,{key:0},mt(B.value,(b,E)=>(k(),x("button",{key:b.path,class:lt(["thread-composer-file-mention-row",{"is-active":E===ie.value}]),type:"button",onMousedown:dt(q=>H(b),["prevent"])},[ke(b.path)?(k(),x("span",{key:0,class:lt(["thread-composer-file-mention-icon-badge",`is-${je(b.path)}`])},be(ke(b.path)),3)):He(b.path)?(k(),x("span",lw,"↓")):(k(),it(xr,{key:2,class:"thread-composer-file-mention-icon-file"})),w("span",cw,[w("span",uw,be(de(b.path)),1),se(b.path)?(k(),x("span",dw,be(se(b.path)),1)):pe("",!0)])],42,aw))),128)):(k(),x("div",fw,"No matching files"))])):pe("",!0),Ln(w("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":p[0]||(p[0]=b=>r.value=b),class:"thread-composer-input",placeholder:Ae.value,disabled:Pe.value,onInput:L,onKeydown:V},null,40,hw),[[Bn,r.value]]),Ce(Yy,{skills:Q.value,visible:G.value,"anchor-bottom":44,"anchor-left":0,onSelect:Re,onClose:j},null,8,["skills","visible"])]),w("div",pw,[w("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[w("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Pe.value,onClick:Ke}," + ",8,mw),D.value?(k(),x("div",gw,[w("button",{class:"thread-composer-attach-item",type:"button",disabled:Pe.value,onClick:ue}," Add photos & files ",8,vw),w("button",{class:"thread-composer-attach-item",type:"button",disabled:Pe.value,onClick:Se}," Take photo ",8,yw)])):pe("",!0)],512),Ce(qo,{class:"thread-composer-control","model-value":e.selectedModel,options:ge.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Je},null,8,["model-value","options","disabled"]),Ce(Fy,{class:"thread-composer-control",options:Ve.value,"selected-values":Ne.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:ft},null,8,["options","selected-values","disabled"]),Ce(qo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Z,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":ze},null,8,["model-value","disabled"]),w("div",ww,[$e(d)&&!e.isTurnInProgress?(k(),x("button",{key:0,class:lt(["thread-composer-mic",{"thread-composer-mic--active":$e(l)!=="idle"}]),type:"button","aria-label":$e(l)==="recording"?"Stop dictation":"Hold to dictate",title:$e(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Pe.value,onMousedown:p[1]||(p[1]=dt((...b)=>$e(u)&&$e(u)(...b),["prevent"])),onMouseup:p[2]||(p[2]=(...b)=>$e(f)&&$e(f)(...b)),onMouseleave:p[3]||(p[3]=b=>$e(l)==="recording"&&$e(f)()),onTouchstart:p[4]||(p[4]=dt((...b)=>$e(u)&&$e(u)(...b),["prevent"])),onTouchend:p[5]||(p[5]=(...b)=>$e(f)&&$e(f)(...b))},[Ce(hy,{class:"thread-composer-mic-icon"})],42,bw)):pe("",!0),e.isTurnInProgress?(k(),x("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:ot},[Ce(vy,{class:"thread-composer-stop-icon"})],8,_w)):pe("",!0),w("button",{class:lt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&_e.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&_e.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${_e.value}`:"Send",disabled:!rt.value,onClick:p[6]||(p[6]=b=>ct(e.isTurnInProgress?_e.value:"steer"))},[Ce(cy,{class:"thread-composer-submit-icon"})],10,kw)])])],2),w("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Pe.value,onChange:y},null,40,Tw),w("input",{ref_key:"cameraCaptureInputRef",ref:M,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Pe.value,onChange:C},null,40,Sw)],32))}}),Ja=We(xw,[["__scopeId","data-v-983e7906"]]),Cw={key:0,class:"queued-messages"},Ew={class:"queued-messages-inner"},Aw={class:"queued-row-text"},Iw={class:"queued-row-actions"},Rw=["onClick"],$w=["onClick"],Mw=Ct({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(k(),x("div",Cw,[w("div",Ew,[(k(!0),x(Le,null,mt(e.messages,s=>(k(),x("div",{key:s.id,class:"queued-row"},[n[1]||(n[1]=w("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),w("span",Aw,be(s.text),1),w("div",Iw,[w("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:r=>t.$emit("steer",s.id)},"Steer",8,Rw),w("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:r=>t.$emit("delete",s.id)},[...n[0]||(n[0]=[w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,$w)])]))),128))])])):pe("",!0)}}),Pw=We(Mw,[["__scopeId","data-v-ea583733"]]),Nw={},Ow={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function jw(e,t){return k(),x("svg",Ow,[...t[0]||(t[0]=[w("circle",{cx:"11",cy:"11",r:"8"},null,-1),w("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Wo=We(Nw,[["render",jw]]),Lw={class:"skill-card-top"},Dw=["src","alt"],Bw={key:1,class:"skill-card-avatar-fallback"},Fw={class:"skill-card-info"},Hw={class:"skill-card-header"},Uw={class:"skill-card-name"},Vw={key:0,class:"skill-card-badge-disabled"},qw={key:1,class:"skill-card-badge"},Ww={class:"skill-card-owner"},Kw={key:0,class:"skill-card-desc"},Gw={key:1,class:"skill-card-date"},zw=Ct({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ae(()=>{const r=t.skill.publishedAt;if(!r)return"";const o=new Date(r),a=Date.now()-r;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function s(r){const o=r.target;o.style.display="none"}return(r,o)=>(k(),x("button",{class:lt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>r.$emit("select",e.skill))},[w("div",Lw,[e.skill.avatarUrl?(k(),x("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:s},null,40,Dw)):(k(),x("div",Bw,be(e.skill.owner.charAt(0)),1)),w("div",Fw,[w("div",Hw,[w("span",Uw,be(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(k(),x("span",Vw,"Disabled")):e.skill.installed?(k(),x("span",qw,"Installed")):pe("",!0)]),w("span",Ww,be(e.skill.owner),1)])]),e.skill.description?(k(),x("p",Kw,be(e.skill.description),1)):pe("",!0),n.value?(k(),x("span",Gw,be(n.value),1)):pe("",!0)],2))}}),Qa=We(zw,[["__scopeId","data-v-2a1e8196"]]),Yw={class:"sdm-panel"},Jw={class:"sdm-header"},Qw={class:"sdm-title-area"},Xw=["src","alt"],Zw={class:"sdm-title-col"},eb={class:"sdm-title-row"},tb={class:"sdm-title"},nb={key:0,class:"sdm-badge-disabled"},sb={class:"sdm-owner"},rb={class:"sdm-body"},ob={key:0,class:"sdm-desc"},ib={key:1,class:"sdm-readme-loading"},ab=["innerHTML"],lb=["href"],cb={class:"sdm-footer"},ub={class:"sdm-footer-actions"},db=["disabled"],fb=["disabled"],hb=["disabled"],pb=Ct({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,s=t,r=O(null),o=O(""),i=O(!1),a=ae(()=>r.value??n.skill.enabled??!0),l=ae(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ae(()=>{const I=o.value;if(!I)return"";const D=I.replace(/^---[\s\S]*?---\s*/,"");return u(D)});function u(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),D=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!D.ok)return;const G=await D.json();o.value=G.content??""}catch{}finally{i.value=!1}}}pt(()=>n.visible,I=>{I&&(r.value=null,o.value="",f())});function g(){s("install",n.skill)}function _(){s("uninstall",n.skill)}function M(){const I=!a.value;r.value=I,s("toggle-enabled",n.skill,I)}return(I,D)=>(k(),it(ql,{to:"body"},[e.visible?(k(),x("div",{key:0,class:"sdm-overlay",onClick:D[1]||(D[1]=dt(G=>I.$emit("close"),["self"]))},[w("div",Yw,[w("div",Jw,[w("div",Qw,[e.skill.avatarUrl?(k(),x("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,Xw)):pe("",!0),w("div",Zw,[w("div",eb,[w("h3",tb,be(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(k(),x("span",nb,"Disabled")):pe("",!0)]),w("span",sb,be(e.skill.owner),1)])]),w("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:D[0]||(D[0]=G=>I.$emit("close"))},[Ce(yi,{class:"sdm-close-icon"})])]),w("div",rb,[e.skill.description?(k(),x("p",ob,be(e.skill.description),1)):pe("",!0),i.value?(k(),x("div",ib,"Loading skill contents...")):o.value?(k(),x("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,ab)):pe("",!0),w("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,lb)]),w("div",cb,[w("div",ub,[e.skill.installed?(k(),x("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},be(n.isUninstalling?"Uninstalling...":"Uninstall"),9,db)):(k(),x("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},be(n.isInstalling?"Installing...":"Install"),9,fb)),e.skill.installed?(k(),x("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:M},be(a.value?"Disable":"Enable"),9,hb)):pe("",!0)])])])])):pe("",!0)]))}}),mb=We(pb,[["__scopeId","data-v-19a385ca"]]),gb={class:"skills-hub"},vb={class:"skills-hub-toolbar"},yb={class:"skills-hub-search-wrap"},wb={key:0,class:"skills-hub-count"},bb={key:1,class:"skills-hub-section"},_b={class:"skills-hub-section-title"},kb={key:0,class:"skills-hub-grid"},Tb={class:"skills-hub-section"},Sb={key:0,class:"skills-hub-loading"},xb={key:1,class:"skills-hub-error"},Cb={key:0,class:"skills-hub-grid"},Eb={key:1,class:"skills-hub-empty"},cr="codex-web-local.skills-hub.cache.v1",Ab=Ct({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},s=O(null),r=O(""),o=O("date"),i=O([]),a=O([]),l=O(0),d=O(!1),u=O(""),f=O(!0),g=O(!1),_=O(n),M=O(null),I=O(""),D=O(!1),G=O(!1);let P=null,U=null;const B=t,le=ae(()=>o.value==="date"?"Newest":"A-Z"),ie=ae(()=>{var ue;return((ue=M.value)==null?void 0:ue.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ce=ae(()=>`${_.value.owner}/${_.value.name}`),me=ae(()=>D.value&&I.value===ce.value),oe=ae(()=>G.value&&I.value===ce.value),Z=ae(()=>{const ue=r.value.toLowerCase().trim();return ue?a.value.filter(Se=>Se.name.toLowerCase().includes(ue)||Se.owner.toLowerCase().includes(ue)||(Se.displayName??"").toLowerCase().includes(ue)):a.value});function ge(ue,Se="success"){M.value={text:ue,type:Se},U&&clearTimeout(U),U=setTimeout(()=>{M.value=null},3e3)}function Q(){o.value=o.value==="date"?"name":"date",Ae(r.value)}function Ne(ue){return`${o.value}::${ue.trim().toLowerCase()}`}function Ve(ue){var Se;if(typeof window>"u")return null;try{const he=window.localStorage.getItem(cr);return he?((Se=JSON.parse(he).byKey)==null?void 0:Se[ue])??null:null}catch{return null}}function rt(ue,Se){if(!(typeof window>"u"))try{const he=window.localStorage.getItem(cr),X=(he?JSON.parse(he):{}).byKey??{};X[ue]=Se,window.localStorage.setItem(cr,JSON.stringify({byKey:X}))}catch{}}function Pe(){if(!(typeof window>"u"))try{window.localStorage.removeItem(cr)}catch{}}function _e(ue){const Se=ue.installed??[];a.value=Se;const he=new Set(Se.map(A=>A.name));i.value=ue.data.map(A=>{if(A.installed||he.has(A.name)){const X=Se.find(J=>J.name===A.name);return{...A,installed:!0,path:(X==null?void 0:X.path)??A.path,enabled:(X==null?void 0:X.enabled)??A.enabled}}return A}).filter(A=>!A.installed),l.value=ue.total}async function Ae(ue){const Se=Ne(ue),he=Ve(Se);he&&_e(he),d.value=!he,u.value="";try{const A=new URLSearchParams;ue.trim()&&A.set("q",ue.trim()),A.set("limit","100"),A.set("sort",o.value);const X=await fetch(`/codex-api/skills-hub?${A}`);if(!X.ok)throw new Error(`HTTP ${X.status}`);const J=await X.json();_e(J),rt(Se,J)}catch(A){u.value=A instanceof Error?A.message:"Failed to load skills"}finally{d.value=!1}}function ct(){P&&clearTimeout(P),P=setTimeout(()=>Ae(r.value),300)}function ot(ue){_.value=ue,g.value=!0}async function Je(ue){I.value=`${ue.owner}/${ue.name}`,D.value=!0;try{const he=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:ue.owner,name:ue.name})})).json();if(!he.ok)throw new Error(he.error||"Install failed");const A={...ue,installed:!0,path:he.path,enabled:!0};a.value=[...a.value,A],i.value=i.value.filter(X=>X.name!==ue.name),_.value=A,ge(`${ue.displayName||ue.name} skill installed`),g.value=!1,Pe(),B("skills-changed")}catch(Se){ge(Se instanceof Error?Se.message:"Failed to install skill","error")}finally{D.value=!1}}async function ze(ue){I.value=`${ue.owner}/${ue.name}`,G.value=!0;try{const he=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue.name,path:ue.path})})).json();if(!he.ok)throw new Error(he.error||"Uninstall failed");a.value=a.value.filter(A=>A.name!==ue.name),ue.owner!=="local"&&(i.value=[...i.value,{...ue,installed:!1,path:void 0,enabled:void 0}]),ge(`${ue.displayName||ue.name} skill uninstalled`),g.value=!1,Pe(),B("skills-changed")}catch(Se){ge(Se instanceof Error?Se.message:"Failed to uninstall skill","error")}finally{G.value=!1}}async function Ke(ue,Se){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:ue.path,enabled:Se}})})).ok)throw new Error("Failed to update skill");ge(`${ue.displayName||ue.name} skill ${Se?"enabled":"disabled"}`),await Ae(r.value)}catch(he){ge(he instanceof Error?he.message:"Failed to update skill","error")}}return Hn(()=>{Ae("")}),(ue,Se)=>(k(),x("div",gb,[Se[3]||(Se[3]=w("div",{class:"skills-hub-header"},[w("h2",{class:"skills-hub-title"},"Skills Hub"),w("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),w("div",vb,[w("div",yb,[Ce(Wo,{class:"skills-hub-search-icon"}),Ln(w("input",{ref_key:"searchRef",ref:s,"onUpdate:modelValue":Se[0]||(Se[0]=he=>r.value=he),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:ct},null,544),[[Bn,r.value]]),l.value>0?(k(),x("span",wb,be(l.value)+" skills",1)):pe("",!0)]),w("button",{class:"skills-hub-sort",type:"button",onClick:Q},be(le.value),1)]),M.value?(k(),x("div",{key:0,class:lt(["skills-hub-toast",ie.value])},be(M.value.text),3)):pe("",!0),Z.value.length>0?(k(),x("div",bb,[w("button",{class:"skills-hub-section-toggle",type:"button",onClick:Se[1]||(Se[1]=he=>f.value=!f.value)},[w("span",_b,"Installed ("+be(Z.value.length)+")",1),Ce(Dc,{class:lt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(k(),x("div",kb,[(k(!0),x(Le,null,mt(Z.value,he=>(k(),it(Qa,{key:he.name,skill:he,onSelect:A=>ot(A)},null,8,["skill","onSelect"]))),128))])):pe("",!0)])):pe("",!0),w("div",Tb,[d.value?(k(),x("div",Sb,"Loading skills...")):u.value?(k(),x("div",xb,be(u.value),1)):(k(),x(Le,{key:2},[i.value.length>0?(k(),x("div",Cb,[(k(!0),x(Le,null,mt(i.value,he=>(k(),it(Qa,{key:he.url,skill:he,onSelect:A=>ot(A)},null,8,["skill","onSelect"]))),128))])):r.value.trim()?(k(),x("div",Eb,'No skills found for "'+be(r.value)+'"',1)):pe("",!0)],64))]),Ce(mb,{skill:_.value,visible:g.value,"is-installing":me.value,"is-uninstalling":oe.value,onClose:Se[2]||(Se[2]=he=>g.value=!1),onInstall:Je,onUninstall:ze,onToggleEnabled:Ke},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Ib=We(Ab,[["__scopeId","data-v-1967b404"]]),Rb={},$b={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Mb(e,t){return k(),x("svg",$b,[...t[0]||(t[0]=[w("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),w("path",{d:"M9 4l0 16"},null,-1)])])}const Pb=We(Rb,[["render",Mb]]),Nb={},Ob={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function jb(e,t){return k(),x("svg",Ob,[...t[0]||(t[0]=[w("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const Lb=We(Nb,[["render",jb]]),Db={},Bb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Fb(e,t){return k(),x("svg",Bb,[...t[0]||(t[0]=[w("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),w("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Hb=We(Db,[["render",Fb]]),Ub={class:"sidebar-thread-controls"},Vb=["aria-label","title"],qb=["aria-pressed","aria-label","title"],Wb=Ct({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(k(),x("div",Ub,[w("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=s=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(k(),it(Lb,{key:0,class:"sidebar-thread-controls-icon"})):(k(),it(Pb,{key:1,class:"sidebar-thread-controls-icon"}))],8,Vb),w("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=s=>t.$emit("toggle-auto-refresh"))},[Ce(Hb,{class:"sidebar-thread-controls-icon"})],8,qb),dn(t.$slots,"default",{},void 0),e.showNewThreadButton?(k(),x("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=s=>t.$emit("start-new-thread"))},[Ce(xr,{class:"sidebar-thread-controls-icon"})])):pe("",!0)]))}}),Xa=We(Wb,[["__scopeId","data-v-57866500"]]),Kb={},Gb={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function zb(e,t){return k(),x("svg",Gb,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),w("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const Yb=We(Kb,[["render",zb]]);function On(e){return e.flatMap(t=>t.threads)}const Hc="codex-web-local.thread-read-state.v1",Uc="codex-web-local.thread-scroll-state.v1",Ko="codex-web-local.selected-thread-id.v1",Vc="codex-web-local.project-order.v1",qc="codex-web-local.project-display-name.v1",Wc="codex-web-local.auto-refresh-enabled.v1",_o=220,Ns=4e3,Za=["none","minimal","low","medium","high","xhigh"],Os="__global__",Gt="gpt-5.2-codex";function Jb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Hc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function el(e){typeof window>"u"||window.localStorage.setItem(Hc,JSON.stringify(e))}function Qb(){return typeof window>"u"?!1:window.localStorage.getItem(Wc)==="1"}function tl(e){typeof window>"u"||window.localStorage.setItem(Wc,e?"1":"0")}function Kc(e,t,n){return Math.min(Math.max(e,t),n)}function Xb(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=Kc(t.scrollRatio,0,1)),n}function Zb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Uc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,r]of Object.entries(t)){if(!s)continue;const o=Xb(r);o&&(n[s]=o)}return n}catch{return{}}}function nl(e){typeof window>"u"||window.localStorage.setItem(Uc,JSON.stringify(e))}function e0(){return typeof window>"u"?"":window.localStorage.getItem(Ko)??""}function t0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ko);return}window.localStorage.setItem(Ko,e)}}function n0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Vc);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const s of t)typeof s=="string"&&s.length>0&&!n.includes(s)&&n.push(s);return n}catch{return[]}}function ms(e){typeof window>"u"||window.localStorage.setItem(Vc,JSON.stringify(e))}function s0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,r]of Object.entries(t))typeof s=="string"&&s.length>0&&typeof r=="string"&&(n[s]=r);return n}catch{return{}}}function ko(e){typeof window>"u"||window.localStorage.setItem(qc,JSON.stringify(e))}function ur(e,t){const n=[];for(const s of e)n.includes(s)||n.push(s);for(const s of t)n.includes(s.projectName)||n.push(s.projectName);return es(e,n)?e:n}function To(e,t){const n=new Map(e.map(r=>[r.projectName,r])),s=t.map(r=>n.get(r)??{projectName:r,threads:[]});for(const r of e)t.includes(r.projectName)||s.push(r);return s}function es(e,t){const n=Array.isArray(e)?e:[],s=Array.isArray(t)?t:[];if(n.length!==s.length)return!1;for(let r=0;r<n.length;r+=1)if(n[r]!==s[r])return!1;return!0}function r0(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const s=[...e],[r]=s.splice(t,1);return s.splice(n,0,r),s}function o0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function dr(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Go(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&es(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&o0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Cr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function i0(e,t,n={}){const s=new Map(e.map(u=>[u.id,u])),r=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=s.get(u.id);return f&&Go(f,u)?f:u});if(n.preserveMissing!==!0)return Cr(e,o)?e:o;const i=e.map(u=>{const f=r.get(u.id);return!f||Go(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Cr(e,d)?e:d}function zo(e){return e.replace(/\s+/gu," ").trim()}function a0(e,t){const n=new Set(t.filter(r=>r.role==="assistant").map(r=>zo(r.text)).filter(r=>r.length>0));if(n.size===0)return e;const s=e.filter(r=>{if(r.messageType!=="agentMessage.live")return!0;const o=zo(r.text);return o.length===0?!1:!n.has(o)});return s.length===e.length?e:s}function sl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const s=e[n];if(Go(s,t))return e;const r=[...e];return r.splice(n,1,t),r}const Gc="worked";function $n(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function l0(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60),r=t%60,o=[];n>0&&o.push(`${n}h`),(s>0||n>0)&&o.push(`${s}m`);const i=r>0||o.length===0?r:0;return o.push(`${i}s`),o.join(" ")}function c0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function u0(e,t){if(!e&&!t)return!0;if(!e||!t||e.label!==t.label||e.details.length!==t.details.length)return!1;for(let n=0;n<e.details.length;n+=1)if(e.details[n]!==t.details[n])return!1;return!0}function d0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${l0(e.durationMs)}`,messageType:Gc}}function f0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function h0(e,t){const n=d0(t),s=e.filter(i=>i.messageType!==Gc),r=f0(s);if(r<0)return[...s,n];const o=[...s];return o.splice(r,0,n),o}function St(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function p0(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function m0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function g0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Et(e,t){const n=Object.entries(e).filter(([s])=>t.has(s));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function fr(e,t){const n=new Map(e.map(r=>[r.projectName,r])),s=t.map(r=>{const o=n.get(r.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=r.threads.map(l=>{const d=i.get(l.id);return d&&p0(d,l)?d:l});return o&&o.projectName===r.projectName&&m0(o.threads,a)?o:{projectName:r.projectName,threads:a}});return g0(e,s)?e:s}function v0(e,t,n){const s=new Set(On(t).map(a=>a.id)),r=On(e).filter(a=>n[a.id]===!0&&!s.has(a.id));if(r.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of r){if(o.get(a.projectName)){const d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function y0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function So(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function w0(e){const t=e.split(`
44
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function b0(){const e=O([]),t=O([]),n=O(e0()),s=O({}),r=O({}),o=O({}),i=O({}),a=O({}),l=O({}),d=O({}),u=O([]),f=O(""),g=O("medium"),_=O(Jb()),M=O(Zb()),I=O(n0()),D=O(s0()),G=O({}),P=O({}),U=O({}),B=O({}),le=O({}),ie=O({}),ce=O({}),me=O({}),oe=O({}),Z=O({}),ge=O([]),Q=O(!1),Ne=O(!1),Ve=O(!1),rt=O(!1),Pe=O(!1),_e=O(""),Ae=O(!1),ct=O(!1),ot=O(Qb()),Je=O(Math.floor(Ns/1e3));let ze=null,Ke=null,ue=null,Se=null,he=!1;const A=new Set;let X=!1,J=!1;const ye=new Map,Te=new Set,m=ae(()=>On(e.value)),y=ae(()=>m.value.find(c=>c.id===n.value)??null),C=ae(()=>M.value[n.value]??null),L=ae(()=>{const c=[],h=n.value;return h&&Array.isArray(me.value[h])&&c.push(...me.value[h]),Array.isArray(me.value[Os])&&c.push(...me.value[Os]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),V=ae(()=>{var K;const c=n.value;if(!c)return null;const h=le.value[c],v=(o.value[c]??"").trim(),T=(((K=ie.value[c])==null?void 0:K.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),j=ae(()=>{const c=n.value;if(!c)return[];const h=s.value[c]??[],v=r.value[c]??[],T=i.value[c]??[],K=[...h,...T,...v],W=B.value[c];return W?h0(K,W):K});function ee(c){n.value!==c&&(n.value=c,t0(c),J=!1)}function te(c){f.value=c.trim()}async function z(){f.value=Gt,u.value.includes(Gt)||(u.value=[...u.value,Gt]);try{await zv(Gt)}catch{}}function H(c,h){oe.value={...oe.value,[c]:h}}function de(c){oe.value[c]&&(oe.value=St(oe.value,c))}async function se(c){if(Te.has(c))return;const h=oe.value[c];if(!(!h||h.fallbackRetried)){Te.add(c),H(c,{...h,fallbackRetried:!0});try{await z();try{const v=await Wa(c,1);Ge(c,v),Xe(c,[]),rn(c),i.value[c]&&(i.value=St(i.value,c))}catch{}re(c,null),_e.value="",p(c,null),q(c,{label:"Thinking",details:ke(Gt,h.effort)}),b(c,!0),U.value[c]!==!0&&await wo(c),await bo(c,h.text,h.imageUrls,Gt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},A.add(c),he=!0,await Wn()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";re(c,T),_e.value=T,b(c,!1),q(c,null)}finally{Te.delete(c)}}}function fe(c){c&&!Za.includes(c)||(g.value=c)}function ke(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function je(){try{const[c,h]=await Promise.all([Yv(),Jv()]);u.value=c,f.value.length>0&&c.includes(f.value)||(h.model&&c.includes(h.model)?f.value=h.model:c.length>0?f.value=c[0]:f.value=""),h.reasoningEffort&&Za.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function He(c){const h=Z.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const K=h[T.id];return K?{...T,title:K}:T})}))}function Re(){const h=He(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const K=a.value[T.id]===!0,W=n.value===T.id,we=_.value[T.id],Ee=d.value[T.id]===!0,ve=!W&&!K&&(Ee||we!==T.updatedAtIso);return{...T,inProgress:K,unread:ve}})}));e.value=fr(e.value,h)}function ft(c,h,v){const T=new Date().toISOString(),K=h.trim(),W=y0(K),we={id:c,title:w0(v),projectName:W,cwd:K,hasWorktree:K.includes("/.codex/worktrees/")||K.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Ee=t.value.findIndex(qe=>qe.projectName===W);if(Ee>=0){const yt=t.value[Ee].threads.filter(An=>An.id!==c),hs={projectName:W,threads:[we,...yt]},hn=[...t.value];hn.splice(Ee,1,hs),t.value=hn}else t.value=[{projectName:W,threads:[we]},...t.value];const ve=ur(I.value,t.value);es(I.value,ve)||(I.value=ve,ms(I.value)),Re()}function nt(c){const h=new Set(c.map(W=>W.id)),v=Et(_.value,h);v!==_.value&&(_.value=v,el(v));const T=Et(M.value,h);T!==M.value&&(M.value=T,nl(T)),P.value=Et(P.value,h),G.value=Et(G.value,h),U.value=Et(U.value,h),s.value=Et(s.value,h),r.value=Et(r.value,h),o.value=Et(o.value,h),i.value=Et(i.value,h),B.value=Et(B.value,h),le.value=Et(le.value,h),ie.value=Et(ie.value,h),ce.value=Et(ce.value,h),d.value=Et(d.value,h),a.value=Et(a.value,h);const K={};for(const[W,we]of Object.entries(me.value))(W===Os||h.has(W))&&(K[W]=we);me.value=K}function F(c){const h=On(t.value).find(v=>v.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},el(_.value),d.value[c]&&(d.value=St(d.value,c)),Re())}function p(c,h){if(!c)return;const v=B.value[c];if(h){if(c0(v,h))return;B.value={...B.value,[c]:h}}else v&&(B.value=St(B.value,c))}function b(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=St(a.value,c),Re())}function E(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Re())}function q(c,h){if(!c)return;const v=le.value[c];if(!h){v&&(le.value=St(le.value,c));return}const T=$(h.label)||"Thinking",K=h.details.map(Ee=>$(Ee)).filter(Ee=>Ee.length>0&&Ee!==T),W=Array.from(new Set([...(v==null?void 0:v.details)??[],...K])).slice(-3),we={label:T,details:W};u0(v,we)||(le.value={...le.value,[c]:we})}function re(c,h){if(!c)return;const v=ie.value[c],T=h?zo(h):"";if(!T){v&&(ie.value=St(ie.value,c));return}(v==null?void 0:v.message)!==T&&(ie.value={...ie.value,[c]:{message:T}})}function xe(c){const h=On(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Qe(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Kc(h.scrollRatio,0,1));const T=M.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(M.value={...M.value,[c]:v},nl(M.value))}function Ge(c,h){const v=s.value[c]??[];Cr(v,h)||(s.value={...s.value,[c]:h})}function Xe(c,h){const v=r.value[c]??[];Cr(v,h)||(r.value={...r.value,[c]:h})}function ht(c,h){const v=r.value[c]??[],T=sl(v,h);Xe(c,T)}function Pt(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=St(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function sn(c,h){if(!c)return;const v=o.value[c]??"";Pt(c,`${v}${h}`)}function rn(c){c&&c in o.value&&(o.value=St(o.value,c))}function Be(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Ie(c){return typeof c=="string"?c:""}function os(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function kt(c){const h=Be(c.params);if(!h)return"";const v=Ie(h.threadId);if(v)return v;const T=Ie(h.thread_id);if(T)return T;const K=Ie(h.conversationId);if(K)return K;const W=Ie(h.conversation_id);if(W)return W;const we=Be(h.thread),Ee=Ie(we==null?void 0:we.id);if(Ee)return Ee;const ve=Be(h.turn),qe=Ie(ve==null?void 0:ve.threadId);if(qe)return qe;const yt=Ie(ve==null?void 0:ve.thread_id);return yt||""}function Bt(c){if(c.method!=="turn/completed")return"";const h=Be(c.params),v=Be(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Be(v.error);return Ie(T==null?void 0:T.message)}function is(c){var v;if(c.method!=="error")return"";const h=Be(c.params);return Ie(h==null?void 0:h.message)||Ie((v=Be(h==null?void 0:h.error))==null?void 0:v.message)}function Vn(c){const h=Be(c);if(!h)return null;const v=h.id,T=Ie(h.method),K=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const W=Be(K),we=Ie(W==null?void 0:W.threadId)||Os,Ee=Ie(W==null?void 0:W.turnId),ve=Ie(W==null?void 0:W.itemId),qe=Ie(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:we,turnId:Ee,itemId:ve,receivedAtIso:qe,params:K??null}}function Cn(c){const h=c.threadId||Os,v=me.value[h]??[],T=v.findIndex(W=>W.id===c.id),K=[...v];T>=0?K.splice(T,1,c):K.push(c),me.value={...me.value,[h]:K.sort((W,we)=>W.receivedAtIso.localeCompare(we.receivedAtIso))}}function as(c){const h={};for(const[v,T]of Object.entries(me.value)){const K=T.filter(W=>W.id!==c);K.length>0&&(h[v]=K)}me.value=h}function S(c){if(c.method==="server/request"){const h=Vn(c.params);return h&&Cn(h),!0}if(c.method==="server/request/resolved"){const h=Be(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&as(v),!0}return!1}function $(c){return c.replace(/\s+/gu," ").trim()}function N(c){const h=kt(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Be(c.params),T=Be(v==null?void 0:v.item),K=Ie(T==null?void 0:T.type).toLowerCase();if(K==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(K==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(K==="commandexecution"){const W=Ie(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:W?[W]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function Y(c){if(c.method!=="turn/started")return null;const h=Be(c.params);if(!h)return null;const v=kt(c);if(!v)return null;const T=Be(h.turn),K=Ie(T==null?void 0:T.id)||Ie(h.turnId)||`${v}:unknown`;if(!K)return null;const W=$n(Ie(T==null?void 0:T.startedAt))??$n(Ie(h.startedAt))??$n(c.atIso)??Date.now();return{threadId:v,turnId:K,startedAtMs:W}}function Ue(c){if(c.method!=="turn/completed")return null;const h=Be(c.params);if(!h)return null;const v=kt(c);if(!v)return null;const T=Be(h.turn),K=Ie(T==null?void 0:T.id)||Ie(h.turnId)||`${v}:unknown`;if(!K)return null;const W=$n(Ie(T==null?void 0:T.completedAt))??$n(Ie(h.completedAt))??$n(c.atIso)??Date.now(),we=$n(Ie(T==null?void 0:T.startedAt))??$n(Ie(h.startedAt))??void 0;return{threadId:v,turnId:K,completedAtMs:W,startedAtMs:we}}function vt(c){return`${c}:live-reasoning`}function Lt(c){const h=Be(c.params);if(!h)return"";if(c.method==="item/started"){const v=Be(h.item);return!v||v.type!=="reasoning"?"":Ie(v.id)}return""}function ls(c){const h=Be(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Ie(h.itemId),T=Ie(h.delta);return!v||!T?null:{messageId:vt(v),delta:T}}return null}function qn(c){const h=Be(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Ie(h.itemId);return v?vt(v):""}return""}function Ft(c){const h=Be(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Be(h.item);return!v||v.type!=="reasoning"?"":vt(Ie(v.id))}return""}function En(c){const h=Be(c.params);if(!h)return"";if(c.method==="item/started"){const v=Be(h.item);return!v||v.type!=="agentMessage"?"":Ie(v.id)}return""}function cs(c){const h=Be(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Ie(h.itemId),T=Ie(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function As(c){const h=Be(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Be(h.item);if(!v||v.type!=="agentMessage")return null;const T=Ie(v.id),K=Ie(v.text);return!T||!K?null:{id:T,role:"assistant",text:K,messageType:"agentMessage.live"}}return null}function Ur(c){if(c.method!=="item/started")return null;const h=Be(c.params),v=Be(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Ie(v.id),K=Ie(v.command);if(!T)return null;const W=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:W,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Vr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Be(c.params);if(!h)return null;const v=Ie(h.itemId),T=Ie(h.delta);return!v||!T?null:{itemId:v,delta:T}}function qr(c){if(c.method!=="item/completed")return null;const h=Be(c.params),v=Be(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Ie(v.id),K=Ie(v.command);if(!T)return null;const W=typeof v.cwd=="string"?v.cwd:null,we=Ie(v.status),Ee=we==="failed"?"failed":we==="declined"?"declined":we==="interrupted"?"interrupted":"completed",ve=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",qe=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:W,status:Ee,aggregatedOutput:ve,exitCode:qe}}}function Is(c,h){const v=i.value[c]??[],T=sl(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Wr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(W=>W.id)),K=v.filter(W=>!T.has(W.id));K.length!==v.length&&(K.length===0?i.value=St(i.value,c):i.value={...i.value,[c]:K})}function us(c){if(c.method==="item/agentMessage/delta")return!0;const h=Be(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Be(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Kr(c){var Ci,Ei,Ai,Ii;if(S(c))return;if(c.method==="thread/name/updated"){const Fe=Be(c.params),on=Ie(Fe==null?void 0:Fe.threadId),Kn=Ie(Fe==null?void 0:Fe.threadName);on&&Kn&&(Z.value={...Z.value,[on]:Kn},Re(),Ya(on,Kn))}const h=N(c);h&&q(h.threadId,h.activity);const v=Y(c);v&&(ye.set(v.turnId,v),ce.value={...ce.value,[v.threadId]:v.turnId},p(v.threadId,null),re(v.threadId,null),b(v.threadId,!0),d.value[v.threadId]&&(d.value=St(d.value,v.threadId)));const T=Ue(c),K=Bt(c),we=!!((T==null?void 0:T.threadId)??kt(c))&&!!K&&f.value!==Gt&&dr(new Error(K));if(T){const Fe=ye.get(T.turnId);Fe&&ye.delete(T.turnId);const on=os((Ci=Be(c.params))==null?void 0:Ci.durationMs)??os((Ai=Be((Ei=Be(c.params))==null?void 0:Ei.turn))==null?void 0:Ai.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(Fe?T.completedAtMs-Fe.startedAtMs:null),Kn=typeof on=="number"?Math.max(0,on):0;p(T.threadId,{turnId:T.turnId,durationMs:Kn}),ce.value[T.threadId]&&(ce.value=St(ce.value,T.threadId)),b(T.threadId,!1),q(T.threadId,null),E(T.threadId),we||(de(T.threadId),_i(T.threadId))}if(K){const Fe=(T==null?void 0:T.threadId)||kt(c);Fe&&re(Fe,K),_e.value=K,Fe&&we&&se(Fe)}else T&&re(T.threadId,null);const Ee=is(c);if(Ee){const Fe=kt(c);Fe&&re(Fe,Ee),_e.value=Ee,f.value!==Gt&&dr(new Error(Ee))&&(Fe?se(Fe):z())}const ve=kt(c);if(!ve||ve!==n.value)return;En(c);const qe=cs(c);if(qe){const Fe=(r.value[ve]??[]).find(Kn=>Kn.id===qe.messageId),on=`${(Fe==null?void 0:Fe.text)??""}${qe.delta}`;ht(ve,{id:qe.messageId,role:"assistant",text:on,messageType:"agentMessage.live"})}const yt=As(c);yt&&ht(ve,yt),Lt(c);const hs=ls(c);if(hs&&sn(ve,hs.delta),qn(c)){const Fe=o.value[ve]??"";Fe.trim().length>0&&!Fe.endsWith(`
45
+
46
+ `)&&Pt(ve,`${Fe}
47
+
48
+ `)}Ft(c);const An=Ur(c);An&&(Is(ve,An),q(ve,{label:"Running command",details:[((Ii=An.commandExecution)==null?void 0:Ii.command)??""]}));const Qr=Vr(c);if(Qr){const Fe=(i.value[ve]??[]).find(on=>on.id===Qr.itemId);Fe!=null&&Fe.commandExecution&&Is(ve,{...Fe,commandExecution:{...Fe.commandExecution,aggregatedOutput:`${Fe.commandExecution.aggregatedOutput}${Qr.delta}`}})}const xi=qr(c);if(xi&&Is(ve,xi),us(c)&&(J&&n.value&&Qe(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(ve)),c.method==="turn/completed"){J=!1,rn(ve),i.value[ve]&&(i.value=St(i.value,ve));const Fe=kt(c);Fe&&(b(Fe,!1),q(Fe,null),E(Fe),we||(de(Fe),_i(Fe)))}}function Gr(c){const h=kt(c);h&&A.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(he=!0),!(Ke!==null||typeof window>"u")&&(Ke=window.setTimeout(()=>{Ke=null,Wn()},_o))}async function zr(c){if(!X){X=!0;try{const h=await Ga(),v=[];for(const T of h.order){const K=So(T);v.includes(K)||v.push(K)}if(v.length>0){const T=ur(v,c);es(I.value,T)||(I.value=T,ms(I.value))}if(Object.keys(h.labels).length>0){const T={...D.value};let K=!1;for(const[W,we]of Object.entries(h.labels)){const Ee=So(W);T[Ee]!==we&&(T[Ee]=we,K=!0)}K&&(D.value=T,ko(T))}}catch{}}}async function Yr(){if(!(Object.keys(Z.value).length>0))try{const c=await ny();Object.keys(c.titles).length>0&&(Z.value=c.titles)}catch{}}async function sr(c,h,v){if(Z.value[c])return;const T=h.trim();if(!T)return;const K=T.length>300?T.slice(0,300):T;try{const W=await sy(K,v);if(!W||Z.value[c])return;Z.value={...Z.value,[c]:W},Re(),Ya(c,W)}catch{}}async function ds(){var c;ct.value||(Q.value=!0);try{const[h]=await Promise.all([Bv(),Yr()]);await zr(h);const v=ur(I.value,h);es(I.value,v)||(I.value=v,ms(I.value));const T=To(h,I.value),K=v0(t.value,T,a.value);t.value=fr(t.value,K),a.value=Et(a.value,new Set(On(t.value).map(Ee=>Ee.id))),Re(),ct.value=!0;const W=On(e.value);nt(W),W.some(Ee=>Ee.id===n.value)||ee(((c=W[0])==null?void 0:c.id)??"")}finally{Q.value=!1}}async function R(c,h={}){if(!c)return;const v=P.value[c]===!0,T=h.silent!==!0&&!v;T&&(Ne.value=!0);try{U.value[c]!==!0&&(await wo(c),U.value={...U.value,[c]:!0});const K=await Fv(c),W=s.value[c]??[],we=i0(W,K,{preserveMissing:h.silent===!0});Ge(c,we);const Ee=r.value[c]??[],ve=a0(Ee,K);Xe(c,ve),Wr(c,K),P.value={...P.value,[c]:!0};const qe=xe(c);qe&&(G.value={...G.value,[c]:qe}),F(c)}finally{T&&(Ne.value=!1)}}async function ne(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);ge.value=await ry(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Oe(){_e.value="";try{await ds(),await Promise.all([je(),ne()]),await R(n.value)}catch(c){_e.value=c instanceof Error?c.message:"Unknown application error"}}async function Tt(c){ee(c);try{await R(c)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function Ht(c){try{await qv(c),await ds(),n.value===c&&await R(n.value)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function Wt(c,h=[],v=[],T="steer",K=[]){const W=n.value,we=c.trim();if(!W||!we&&h.length===0&&K.length===0)return;const Ee=a.value[W]===!0;if(Ee&&T==="queue"){const ve=l.value[W]??[],qe=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[W]:[...ve,{id:qe,text:we,imageUrls:h,skills:v,fileAttachments:K}]};return}if(Ee){J=!0,rr(W,we,h,v,K).catch(ve=>{const qe=ve instanceof Error?ve.message:"Unknown application error";re(W,qe),_e.value=qe});return}_e.value="",J=!0,p(W,null),q(W,{label:"Thinking",details:ke(f.value,g.value)}),re(W,null),b(W,!0);try{await rr(W,we,h,v,K)}catch(ve){J=!1,b(W,!1),q(W,null);const qe=ve instanceof Error?ve.message:"Unknown application error";throw re(W,qe),_e.value=qe,ve}}async function fs(c,h,v=[],T=[],K=[]){const W=c.trim(),we=h.trim(),Ee=f.value.trim();if(!W&&v.length===0&&K.length===0)return"";Ve.value=!0,_e.value="";let ve="";try{try{ve=await Ka(we||void 0,Ee||void 0)}catch(hn){if(Ee&&Ee!==Gt&&dr(hn))await z(),ve=await Ka(we||void 0,Gt);else throw hn}if(!ve)return"";ft(ve,we,W||"[Image]"),U.value={...U.value,[ve]:!0},ee(ve),J=!0,p(ve,null),q(ve,{label:"Thinking",details:ke(f.value,g.value)}),re(ve,null),b(ve,!0);const qe=ve,yt=we||null,hs=W;return rr(ve,W,v,T,K).catch(hn=>{J=!1,b(ve,!1),q(ve,null);const An=hn instanceof Error?hn.message:"Unknown application error";re(ve,An),_e.value=An}).finally(()=>{Ve.value=!1}),sr(qe,hs,yt),ve}catch(qe){J=!1,ve&&(b(ve,!1),q(ve,null));const yt=qe instanceof Error?qe.message:"Unknown application error";throw ve&&re(ve,yt),_e.value=yt,Ve.value=!1,qe}}async function rr(c,h,v=[],T=[],K=[]){const W=f.value.trim(),we=g.value,Ee=h.trim(),ve=T.map(yt=>({name:yt.name,path:yt.path})),qe=K.map(yt=>({...yt}));H(c,{text:Ee,imageUrls:[...v],skills:ve,fileAttachments:qe,effort:we,fallbackRetried:!1});try{U.value[c]!==!0&&await wo(c);try{await bo(c,h,v,W||void 0,we||void 0,T.length>0?T:void 0,K)}catch(yt){if(W&&W!==Gt&&dr(yt))await z(),H(c,{text:Ee,imageUrls:[...v],skills:ve,fileAttachments:qe,effort:we,fallbackRetried:!0}),await bo(c,h,v,Gt,we||void 0,T.length>0?T:void 0,K);else throw yt}U.value={...U.value,[c]:!0},A.add(c),he=!0,await Wn()}catch(yt){throw yt}}async function _i(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:St(l.value,c),Ve.value=!0,_e.value="",J=!0,p(c,null),q(c,{label:"Thinking",details:ke(f.value,g.value)}),re(c,null),b(c,!0);try{await rr(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{b(c,!1),q(c,null)}finally{Ve.value=!1}}async function zc(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=ce.value[c];rt.value=!0,_e.value="";try{await Gv(c,h),b(c,!1),q(c,null),re(c,null),ce.value[c]&&(ce.value=St(ce.value,c)),A.add(c),he=!0,await Wn()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";re(c,T),_e.value=T}finally{rt.value=!1}}async function Yc(c){const h=n.value;if(!h||Pe.value)return;const T=(s.value[h]??[]).reduce((W,we)=>typeof we.turnIndex=="number"&&we.turnIndex>W?we.turnIndex:W,-1);if(T<0||c>T)return;const K=T-c+1;if(!(K<1)){Pe.value=!0,_e.value="";try{const W=await Wa(h,K);Ge(h,W),Xe(h,[]),rn(h),i.value[h]&&(i.value=St(i.value,h)),p(h,null),q(h,null),re(h,null),he=!0,await Wn()}catch(W){_e.value=W instanceof Error?W.message:"Failed to rollback thread"}finally{Pe.value=!1}}}function Jc(c,h){c.length===0||(D.value[c]??"")===h||(D.value={...D.value,[c]:h},ko(D.value))}function Qc(c){var K;if(c.length===0)return;const h=I.value.filter(W=>W!==c);if(es(I.value,h)||(I.value=h,ms(I.value)),t.value=t.value.filter(W=>W.projectName!==c),D.value[c]!==void 0){const W={...D.value};delete W[c],D.value=W,ko(W)}Re();const v=On(e.value);nt(v),v.some(W=>W.id===n.value)||ee(((K=v[0])==null?void 0:K.id)??""),Jr()}function Xc(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(ve=>ve.projectName),T=v.indexOf(c);if(T===-1)return;const K=Math.max(0,Math.min(h,v.length-1)),W=r0(v,T,K);if(W===v)return;const we=ur(W,t.value);I.value=we,ms(I.value);const Ee=To(t.value,I.value);t.value=fr(t.value,Ee),Re(),Jr()}function Zc(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(K=>K!==h)];if(es(I.value,v))return;I.value=v,ms(I.value);const T=To(t.value,I.value);t.value=fr(t.value,T),Re(),Jr()}async function Jr(){var c,h;try{const v=await Ga(),T=new Map;for(const we of v.order){const Ee=So(we);T.has(Ee)||T.set(Ee,we)}for(const we of t.value){const Ee=((h=(c=we.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Ee&&T.set(we.projectName,Ee)}const K=[];for(const we of I.value){const Ee=T.get(we);Ee&&!K.includes(Ee)&&K.push(Ee)}for(const we of v.order)K.includes(we)||K.push(we);const W=v.active.filter(we=>K.includes(we));W.length===0&&K.length>0&&W.push(K[0]),await Xv({order:K,labels:v.labels,active:W})}catch{}}async function eu(){if(!Ae.value){Ae.value=!0;try{if(await ds(),!n.value)return;const c=n.value,h=xe(c),v=G.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await R(c,{silent:!0})}catch{}finally{Ae.value=!1}}}async function Wn(){if(Ae.value){typeof window<"u"&&Ke===null&&(Ke=window.setTimeout(()=>{Ke=null,Wn()},_o));return}Ae.value=!0;const c=he,h=new Set(A);he=!1,A.clear();try{c&&await ds();const v=n.value;if(!v)return;const T=h.has(v),K=a.value[v]===!0,W=xe(v),we=G.value[v]??"",Ee=W.length>0&&W!==we;(T||K||Ee||c)&&await R(v,{silent:!0})}catch{}finally{Ae.value=!1,(he||A.size>0)&&typeof window<"u"&&Ke===null&&(Ke=window.setTimeout(()=>{Ke=null,Wn()},_o))}}function tu(){typeof window>"u"||ze||(ot.value&&Ti(),nu(),ze=Hv(c=>{Kr(c),Gr(c)}))}async function nu(){try{const c=await Vv();for(const h of c){const v=Vn(h);v&&Cn(v)}}catch{}}async function su(c){try{await Uv(c.id,{result:c.result,error:c.error}),as(c.id)}catch(h){_e.value=h instanceof Error?h.message:"Failed to reply to server request"}}function ki(c={}){const h=c.updatePreference??!0;ue!==null&&typeof window<"u"&&(window.clearInterval(ue),ue=null),Se!==null&&typeof window<"u"&&(window.clearInterval(Se),Se=null),h&&(ot.value=!1,tl(!1)),Je.value=Math.floor(Ns/1e3)}function Ti(){typeof window>"u"||ue!==null||Se!==null||(ot.value=!0,tl(!0),Je.value=Math.floor(Ns/1e3),ue=window.setInterval(()=>{Je.value=Math.floor(Ns/1e3),eu()},Ns),Se=window.setInterval(()=>{Je.value=Math.max(0,Je.value-1)},1e3))}function ru(){if(ot.value){ki();return}Ti()}function ou(){ki({updatePreference:!1}),ze&&(ze(),ze=null),he=!1,A.clear(),ye.clear(),Ke!==null&&typeof window<"u"&&(window.clearTimeout(Ke),Ke=null),J=!1,s.value={},r.value={},o.value={},i.value={},le.value={},B.value={},ie.value={},ce.value={},l.value={}}const iu=ae(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Si(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(K=>K.id!==c);l.value=T.length>0?{...l.value,[h]:T}:St(l.value,h)}function au(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(K=>K.id===c);T&&(Si(c),Wt(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:D,selectedThread:y,selectedThreadScrollState:C,selectedThreadServerRequests:L,selectedLiveOverlay:V,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:ge,messages:j,isLoadingThreads:Q,isLoadingMessages:Ne,isSendingMessage:Ve,isInterruptingTurn:rt,isAutoRefreshEnabled:ot,autoRefreshSecondsLeft:Je,error:_e,refreshAll:Oe,refreshSkills:ne,selectThread:Tt,setThreadScrollState:Qe,archiveThreadById:Ht,sendMessageToSelectedThread:Wt,sendMessageToNewThread:fs,interruptSelectedThreadTurn:zc,rollbackSelectedThread:Yc,isRollingBack:Pe,selectedThreadQueuedMessages:iu,removeQueuedMessage:Si,steerQueuedMessage:au,setSelectedModelId:te,setSelectedReasoningEffort:fe,respondToPendingServerRequest:su,renameProject:Jc,removeProject:Qc,reorderProject:Xc,pinProjectToTop:Zc,toggleAutoRefreshTimer:ru,startPolling:tu,stopPolling:ou}}const _0={class:"sidebar-root"},k0={class:"sidebar-scrollable"},T0=["aria-pressed"],S0={key:1,class:"sidebar-search-bar"},x0={key:0,class:"sidebar-settings-area"},C0={key:0,class:"sidebar-settings-panel"},E0={class:"sidebar-settings-value"},A0={class:"sidebar-settings-value"},I0={class:"content-root"},R0={class:"content-body"},$0={key:1,class:"content-grid"},M0={class:"new-thread-empty"},P0={key:2,class:"content-grid"},N0={class:"content-thread"},O0={class:"composer-with-queue"},j0={class:"build-badge","aria-label":"Worktree name"},rl="codex-web-local.sidebar-collapsed.v1",ol="codex-web-local.send-with-enter.v1",il="codex-web-local.in-progress-send-mode.v1",al="codex-web-local.dark-mode.v1",L0=Ct({__name:"App",setup(e){const t="codex-web-local",{projectGroups:n,projectDisplayNameById:s,selectedThread:r,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:_,isLoadingThreads:M,isLoadingMessages:I,isInterruptingTurn:D,isAutoRefreshEnabled:G,autoRefreshSecondsLeft:P,refreshAll:U,refreshSkills:B,selectThread:le,setThreadScrollState:ie,archiveThreadById:ce,sendMessageToSelectedThread:me,sendMessageToNewThread:oe,interruptSelectedThreadTurn:Z,rollbackSelectedThread:ge,isRollingBack:Q,selectedThreadQueuedMessages:Ne,removeQueuedMessage:Ve,steerQueuedMessage:rt,setSelectedModelId:Pe,setSelectedReasoningEffort:_e,respondToPendingServerRequest:Ae,renameProject:ct,removeProject:ot,reorderProject:Je,pinProjectToTop:ze,toggleAutoRefreshTimer:Ke,startPolling:ue,stopPolling:Se}=b0(),he=Kh(),A=Wh(),{isMobile:X}=Lc(),J=O(!1),ye=O(!1),Te=O(""),m=O(Kr()),y=O(""),C=O(!1),L=O(null),V=O("New Project (1)"),j=O(""),ee=O(!1),te=O(As(ol,!0)),z=O(Vr()),H=O(Ur()),de=ae(()=>{const R=he.params.threadId;return typeof R=="string"?R:""}),se=ae(()=>{const R=new Set;for(const ne of n.value)for(const Oe of ne.threads)R.add(Oe.id);return R}),fe=ae(()=>he.name==="home"),ke=ae(()=>he.name==="skills"),je=ae(()=>{var R;return ke.value?"Skills":fe.value?"New thread":((R=r.value)==null?void 0:R.title)??"Choose a thread"}),He=ae(()=>G.value?`Auto refresh in ${String(P.value)}s`:"Enable 4s refresh"),Re=ae(()=>_.value.filter(R=>{const ne=zr(R.messageType,R.role);return ne==="worked"?!0:!(ne==="turnActivity.live"||ne==="turnError.live"||ne==="agentReasoning.live")})),ft=ae(()=>a.value),nt=ae(()=>fe.value?"__new-thread__":l.value),F=ae(()=>{var R,ne;return fe.value?Te.value.trim():((ne=(R=r.value)==null?void 0:R.cwd)==null?void 0:ne.trim())??""}),p=ae(()=>{var R;return!fe.value&&((R=r.value)==null?void 0:R.inProgress)===!0}),b=ae(()=>{var Tt,Ht;const R=[],ne=new Set;for(const Wt of n.value){const fs=((Ht=(Tt=Wt.threads[0])==null?void 0:Tt.cwd)==null?void 0:Ht.trim())??"";!fs||ne.has(fs)||(ne.add(fs),R.push({value:fs,label:s.value[Wt.projectName]??Wt.projectName}))}const Oe=Te.value.trim();return Oe&&!ne.has(Oe)&&R.unshift({value:Oe,label:Lt(Oe)}),R}),E=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Hn(()=>{window.addEventListener("keydown",is),us(),E==null||E.addEventListener("change",us),Yr(),Ue(),N()}),jr(()=>{window.removeEventListener("keydown",is),E==null||E.removeEventListener("change",us),Se()});function q(){B()}function re(){C.value=!C.value,C.value?tn(()=>{var R;return(R=L.value)==null?void 0:R.focus()}):y.value=""}function xe(){var R;y.value="",(R=L.value)==null||R.focus()}function Qe(R){R.key==="Escape"&&(C.value=!1,y.value="")}function Ge(R){R&&(he.name==="thread"&&de.value===R||(A.push({name:"thread",params:{threadId:R}}),X.value&&Bt(!0)))}function Xe(R){ce(R)}function ht(R){var Tt,Ht;const ne=n.value.find(Wt=>Wt.projectName===R),Oe=((Ht=(Tt=ne==null?void 0:ne.threads[0])==null?void 0:Tt.cwd)==null?void 0:Ht.trim())??"";Oe&&(Te.value=Oe),X.value&&Bt(!0),!fe.value&&A.push({name:"home"})}function Pt(){var ne,Oe;const R=((Oe=(ne=r.value)==null?void 0:ne.cwd)==null?void 0:Oe.trim())??"";R&&(Te.value=R),X.value&&Bt(!0),!fe.value&&A.push({name:"home"})}function sn(R){ct(R.projectName,R.displayName)}function rn(R){ot(R)}function Be(R){Je(R.projectName,R.toIndex)}function Ie(R){ie(R.threadId,R.state)}function os(R){Ae(R)}function kt(){Ke()}function Bt(R){m.value!==R&&(m.value=R,Gr(R))}function is(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Bt(!m.value))}function Vn(R){const ne=R.text;if(fe.value){ds(ne,R.imageUrls,R.skills,R.fileAttachments);return}me(ne,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function Cn(R){Te.value=R.trim()}async function as(R){const ne=R.trim();if(!ne)return;const Oe=$(ne),Tt=await S(),Ht=Oe?ne:ls(Tt,ne);if(Ht)try{const Wt=await Zv(Ht,{createIfMissing:!Oe,label:Oe?"":ne});Wt&&(Te.value=Wt,ze(Lt(Wt)),N())}catch{}}async function S(){const R=Y();if(R)return R;try{const ne=await za();if(ne)return j.value=ne,ne}catch{}return""}function $(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function N(){const R=Y();if(!R){V.value="New Project (1)";return}try{const ne=await ey(R);V.value=ne.name||"New Project (1)"}catch{V.value="New Project (1)"}}function Y(){var Oe,Tt;const R=Te.value.trim();if(R)return vt(R);const ne=((Tt=(Oe=b.value[0])==null?void 0:Oe.value)==null?void 0:Tt.trim())??"";return ne?vt(ne):j.value.trim()}async function Ue(){try{j.value=await za()}catch{j.value=""}}function vt(R){const ne=R.trim().replace(/\/+$/,"");if(!ne)return"";const Oe=ne.lastIndexOf("/");return Oe<=0?"":ne.slice(0,Oe)}function Lt(R){const ne=R.trim().replace(/\/+$/,"");if(!ne)return"";const Oe=ne.lastIndexOf("/");return Oe<0?ne:ne.slice(Oe+1)}function ls(R,ne){const Oe=R.trim().replace(/\/+$/,""),Tt=ne.trim().replace(/^\/+/,"");return!Oe||!Tt?"":`${Oe}/${Tt}`}function qn(R){Pe(R)}function Ft(R){_e(R)}function En(){Z()}function cs(R){ge(R.turnIndex)}function As(R,ne){if(typeof window>"u")return ne;const Oe=window.localStorage.getItem(R);return Oe===null?ne:Oe==="1"}function Ur(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(al);return R==="light"||R==="dark"?R:"system"}function Vr(){return typeof window>"u"?"queue":window.localStorage.getItem(il)==="steer"?"steer":"queue"}function qr(){te.value=!te.value,window.localStorage.setItem(ol,te.value?"1":"0")}function Is(){z.value=z.value==="steer"?"queue":"steer",window.localStorage.setItem(il,z.value)}function Wr(){const R=["system","light","dark"],ne=R.indexOf(H.value);H.value=R[(ne+1)%R.length],window.localStorage.setItem(al,H.value),us()}function us(){const R=document.documentElement;if(H.value==="dark")R.classList.add("dark");else if(H.value==="light")R.classList.remove("dark");else{const ne=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",ne)}}function Kr(){return typeof window>"u"?!1:window.localStorage.getItem(rl)==="1"}function Gr(R){typeof window>"u"||window.localStorage.setItem(rl,R?"1":"0")}function zr(R,ne){const Oe=(R??"").trim();return Oe.length>0?Oe:ne.trim()||"message"}async function Yr(){await U(),ye.value=!0,await sr(),ue()}async function sr(){if(!J.value){J.value=!0;try{if(he.name==="home"||he.name==="skills"){l.value!==""&&await le("");return}if(he.name==="thread"){const R=de.value;if(!R)return;if(!se.value.has(R)){await A.replace({name:"home"});return}l.value!==R&&await le(R);return}}finally{J.value=!1}}}pt(()=>[he.name,de.value,M.value,se.value.has(de.value),l.value],async()=>{ye.value&&await sr()}),pt(()=>l.value,async R=>{if(ye.value&&!J.value&&!(fe.value||ke.value)){if(!R){he.name!=="home"&&await A.replace({name:"home"});return}he.name==="thread"&&de.value===R||await A.replace({name:"thread",params:{threadId:R}})}}),pt(()=>b.value,R=>{if(R.length===0){Te.value="";return}R.some(Oe=>Oe.value===Te.value)||(Te.value=R[0].value),N()},{immediate:!0}),pt(()=>Te.value,()=>{N()}),pt(X,R=>{R&&!m.value&&Bt(!0)});async function ds(R,ne=[],Oe=[],Tt=[]){try{const Ht=await oe(R,Te.value,ne,Oe,Tt);if(!Ht)return;await A.replace({name:"thread",params:{threadId:Ht}})}catch{}}return(R,ne)=>(k(),x(Le,null,[Ce(Xh,{"is-sidebar-collapsed":m.value,onCloseSidebar:ne[5]||(ne[5]=Oe=>Bt(!0))},{sidebar:st(()=>[w("section",_0,[w("div",k0,[m.value?pe("",!0):(k(),it(Xa,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":m.value,"is-auto-refresh-enabled":$e(G),"auto-refresh-button-label":He.value,"show-new-thread-button":!0,onToggleSidebar:ne[0]||(ne[0]=Oe=>Bt(!m.value)),onToggleAutoRefresh:kt,onStartNewThread:Pt},{default:st(()=>[w("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":C.value,"aria-label":"Search threads",title:"Search threads",onClick:re},[Ce(Wo,{class:"sidebar-search-toggle-icon"})],8,T0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!m.value&&C.value?(k(),x("div",S0,[Ce(Wo,{class:"sidebar-search-bar-icon"}),Ln(w("input",{ref_key:"sidebarSearchInputRef",ref:L,"onUpdate:modelValue":ne[1]||(ne[1]=Oe=>y.value=Oe),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Qe},null,544),[[Bn,y.value]]),y.value.length>0?(k(),x("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:xe},[Ce(yi,{class:"sidebar-search-clear-icon"})])):pe("",!0)])):pe("",!0),m.value?pe("",!0):(k(),x("button",{key:2,class:lt(["sidebar-skills-link",{"is-active":ke.value}]),type:"button",onClick:ne[2]||(ne[2]=Oe=>{$e(A).push({name:"skills"}),$e(X)&&Bt(!0)})}," Skills Hub ",2)),m.value?pe("",!0):(k(),it(Nm,{key:3,groups:$e(n),"project-display-name-by-id":$e(s),"selected-thread-id":$e(l),"is-loading":$e(M),"search-query":y.value,onSelect:Ge,onArchive:Xe,onStartNewThread:ht,onRenameProject:sn,onRemoveProject:rn,onReorderProject:Be},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))]),m.value?pe("",!0):(k(),x("div",x0,[Ce(Sc,{name:"settings-panel"},{default:st(()=>[ee.value?(k(),x("div",C0,[w("button",{class:"sidebar-settings-row",type:"button",onClick:qr},[ne[6]||(ne[6]=w("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),w("span",{class:lt(["sidebar-settings-toggle",{"is-on":!te.value}])},null,2)]),w("button",{class:"sidebar-settings-row",type:"button",onClick:Is},[ne[7]||(ne[7]=w("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),w("span",E0,be(z.value==="steer"?"Steer":"Queue"),1)]),w("button",{class:"sidebar-settings-row",type:"button",onClick:Wr},[ne[8]||(ne[8]=w("span",{class:"sidebar-settings-label"},"Appearance",-1)),w("span",A0,be(H.value==="system"?"System":H.value==="dark"?"Dark":"Light"),1)])])):pe("",!0)]),_:1}),w("button",{class:"sidebar-settings-button",type:"button",onClick:ne[3]||(ne[3]=Oe=>ee.value=!ee.value)},[Ce(Yb,{class:"sidebar-settings-icon"}),ne[9]||(ne[9]=w("span",null,"Settings",-1))])]))])]),content:st(()=>[w("section",I0,[Ce(Fm,{title:je.value},{leading:st(()=>[m.value||$e(X)?(k(),it(Xa,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":m.value,"is-auto-refresh-enabled":$e(G),"auto-refresh-button-label":He.value,"show-new-thread-button":!0,onToggleSidebar:ne[4]||(ne[4]=Oe=>Bt(!m.value)),onToggleAutoRefresh:kt,onStartNewThread:Pt},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):pe("",!0)]),_:1},8,["title"]),w("section",R0,[ke.value?(k(),it(Ib,{key:0,onSkillsChanged:q})):fe.value?(k(),x("div",$0,[w("div",M0,[ne[10]||(ne[10]=w("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(qo,{class:"new-thread-folder-dropdown","model-value":Te.value,options:b.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":V.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Cn,onAdd:as},null,8,["model-value","options","default-add-value"])]),Ce(Ja,{"active-thread-id":nt.value,cwd:F.value,models:$e(d),"selected-model":$e(u),"selected-reasoning-effort":$e(f),skills:$e(g),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":te.value,"in-progress-submit-mode":z.value,onSubmit:Vn,"onUpdate:selectedModel":qn,"onUpdate:selectedReasoningEffort":Ft},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(k(),x("div",P0,[w("div",N0,[Ce(gv,{messages:Re.value,"is-loading":$e(I),"active-thread-id":nt.value,"scroll-state":$e(o),"live-overlay":ft.value,"pending-requests":$e(i),"is-turn-in-progress":p.value,"is-rolling-back":$e(Q),onUpdateScrollState:Ie,onRespondServerRequest:os,onRollback:cs},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),w("div",O0,[Ce(Pw,{messages:$e(Ne),onSteer:$e(rt),onDelete:$e(Ve)},null,8,["messages","onSteer","onDelete"]),Ce(Ja,{"active-thread-id":nt.value,cwd:F.value,models:$e(d),"selected-model":$e(u),"selected-reasoning-effort":$e(f),skills:$e(g),"is-turn-in-progress":p.value,"is-interrupting-turn":$e(D),"has-queue-above":$e(Ne).length>0,"send-with-enter":te.value,"in-progress-submit-mode":z.value,onSubmit:Vn,"onUpdate:selectedModel":qn,"onUpdate:selectedReasoningEffort":Ft,onInterrupt:En},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),w("div",j0," WT "+be($e(t)),1)],64))}}),D0=We(L0,[["__scopeId","data-v-24afb6fd"]]),xo={render:()=>null},B0=qh({history:kh(),routes:[{path:"/",name:"home",component:xo},{path:"/thread/:threadId",name:"thread",component:xo},{path:"/skills",name:"skills",component:xo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Of(D0).use(B0).mount("#app");