codexapp 0.1.24 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-Bhfj4wvl.js +48 -0
- package/dist/assets/index-CBIbfWDP.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +208 -4
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-BNrLRqWJ.css +0 -1
- package/dist/assets/index-oKlr-X4X.js +0 -48
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
|
|
2
|
-
* @vue/shared v3.5.28
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function oi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const mt={},Rr=[],gn=()=>{},hl=()=>!1,Vs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ii=e=>e.startsWith("onUpdate:"),xt=Object.assign,ai=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,st=(e,t)=>du.call(e,t),De=Array.isArray,$r=e=>gs(e)==="[object Map]",pl=e=>gs(e)==="[object Set]",Li=e=>gs(e)==="[object Date]",Ve=e=>typeof e=="function",bt=e=>typeof e=="string",nn=e=>typeof e=="symbol",ot=e=>e!==null&&typeof e=="object",ml=e=>(ot(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),gl=Object.prototype.toString,gs=e=>gl.call(e),fu=e=>gs(e).slice(8,-1),vl=e=>gs(e)==="[object Object]",li=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zr=oi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ws=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,Zt=Ws(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,zn=Ws(e=>e.replace(pu,"-$1").toLowerCase()),qs=Ws(e=>e.charAt(0).toUpperCase()+e.slice(1)),ao=Ws(e=>e?`on${qs(e)}`:""),Kn=(e,t)=>!Object.is(e,t),Es=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},yl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ci=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Bi;const Ks=()=>Bi||(Bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function mr(e){if(De(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=bt(r)?wu(r):mr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(bt(e)||ot(e))return e}const gu=/;(?![^(]*\))/g,vu=/:([^]+)/,yu=/\/\*[^]*?\*\//g;function wu(e){const t={};return e.replace(yu,"").split(gu).forEach(n=>{if(n){const r=n.split(vu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function at(e){let t="";if(bt(e))t=e;else if(De(e))for(let n=0;n<e.length;n++){const r=at(e[n]);r&&(t+=r+" ")}else if(ot(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=oi(bu);function wl(e){return!!e||e===""}function ku(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ui(e[r],t[r]);return n}function ui(e,t){if(e===t)return!0;let n=Li(e),r=Li(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=nn(e),r=nn(t),n||r)return e===t;if(n=De(e),r=De(t),n||r)return n&&r?ku(e,t):!1;if(n=ot(e),r=ot(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!ui(e[i],t[i]))return!1}}return String(e)===String(t)}const bl=e=>!!(e&&e.__v_isRef===!0),he=e=>bt(e)?e:e==null?"":De(e)||ot(e)&&(e.toString===gl||!Ve(e.toString))?bl(e)?he(e.value):JSON.stringify(e,_l,2):String(e),_l=(e,t)=>bl(t)?_l(e,t.value):$r(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[lo(r,o)+" =>"]=s,n),{})}:pl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>lo(n))}:nn(t)?lo(t):ot(t)&&!De(t)&&!vl(t)?String(t):t,lo=(e,t="")=>{var n;return nn(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 Vt;class Tu{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=Vt,!t&&Vt&&(this.index=(Vt.scopes||(Vt.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=Vt;try{return Vt=this,t()}finally{Vt=n}}}on(){++this._on===1&&(this.prevScope=Vt,Vt=this)}off(){this._on>0&&--this._on===0&&(Vt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Su(){return Vt}let gt;const co=new WeakSet;class kl{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,Vt&&Vt.active&&Vt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,co.has(this)&&(co.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Sl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Fi(this),xl(this);const t=gt,n=en;gt=this,en=!0;try{return this.fn()}finally{Cl(this),gt=t,en=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)hi(t);this.deps=this.depsTail=void 0,Fi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?co.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Oo(this)&&this.run()}get dirty(){return Oo(this)}}let Tl=0,es,ts;function Sl(e,t=!1){if(e.flags|=8,t){e.next=ts,ts=e;return}e.next=es,es=e}function di(){Tl++}function fi(){if(--Tl>0)return;if(ts){let t=ts;for(ts=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;es;){let t=es;for(es=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function xl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Cl(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),hi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Oo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(El(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function El(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===as)||(e.globalVersion=as,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Oo(e))))return;e.flags|=2;const t=e.dep,n=gt,r=en;gt=e,en=!0;try{xl(e);const s=e.fn(e._value);(t.version===0||Kn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{gt=n,en=r,Cl(e),e.flags&=-3}}function hi(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)hi(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let en=!0;const Al=[];function In(){Al.push(en),en=!1}function Rn(){const e=Al.pop();en=e===void 0?!0:e}function Fi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let as=0;class Cu{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 pi{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(!gt||!en||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Cu(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,Il(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,as++,this.notify(t)}notify(t){di();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{fi()}}}function Il(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Il(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const No=new WeakMap,hr=Symbol(""),jo=Symbol(""),ls=Symbol("");function Ot(e,t,n){if(en&>){let r=No.get(e);r||No.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new pi),s.map=r,s.key=n),s.track()}}function Cn(e,t,n,r,s,o){const i=No.get(e);if(!i){as++;return}const a=l=>{l&&l.trigger()};if(di(),t==="clear")i.forEach(a);else{const l=De(e),d=l&&li(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===ls||!nn(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ls)),t){case"add":l?d&&a(i.get("length")):(a(i.get(hr)),$r(e)&&a(i.get(jo)));break;case"delete":l||(a(i.get(hr)),$r(e)&&a(i.get(jo)));break;case"set":$r(e)&&a(i.get(hr));break}}fi()}function xr(e){const t=nt(e);return t===e?t:(Ot(t,"iterate",ls),Xt(e)?t:t.map(rn))}function Gs(e){return Ot(e=nt(e),"iterate",ls),e}function Un(e,t){return $n(e)?Nr(pr(e)?rn(t):t):rn(t)}const Eu={__proto__:null,[Symbol.iterator](){return uo(this,Symbol.iterator,e=>Un(this,e))},concat(...e){return xr(this).concat(...e.map(t=>De(t)?xr(t):t))},entries(){return uo(this,"entries",e=>(e[1]=Un(this,e[1]),e))},every(e,t){return _n(this,"every",e,t,void 0,arguments)},filter(e,t){return _n(this,"filter",e,t,n=>n.map(r=>Un(this,r)),arguments)},find(e,t){return _n(this,"find",e,t,n=>Un(this,n),arguments)},findIndex(e,t){return _n(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _n(this,"findLast",e,t,n=>Un(this,n),arguments)},findLastIndex(e,t){return _n(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _n(this,"forEach",e,t,void 0,arguments)},includes(...e){return fo(this,"includes",e)},indexOf(...e){return fo(this,"indexOf",e)},join(e){return xr(this).join(e)},lastIndexOf(...e){return fo(this,"lastIndexOf",e)},map(e,t){return _n(this,"map",e,t,void 0,arguments)},pop(){return qr(this,"pop")},push(...e){return qr(this,"push",e)},reduce(e,...t){return Hi(this,"reduce",e,t)},reduceRight(e,...t){return Hi(this,"reduceRight",e,t)},shift(){return qr(this,"shift")},some(e,t){return _n(this,"some",e,t,void 0,arguments)},splice(...e){return qr(this,"splice",e)},toReversed(){return xr(this).toReversed()},toSorted(e){return xr(this).toSorted(e)},toSpliced(...e){return xr(this).toSpliced(...e)},unshift(...e){return qr(this,"unshift",e)},values(){return uo(this,"values",e=>Un(this,e))}};function uo(e,t,n){const r=Gs(e),s=r[t]();return r!==e&&!Xt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Au=Array.prototype;function _n(e,t,n,r,s,o){const i=Gs(e),a=i!==e&&!Xt(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?rn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,Un(e,f),g,e)}:n.length>2&&(d=function(f,g){return n.call(this,f,g,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function Hi(e,t,n,r){const s=Gs(e);let o=n;return s!==e&&(Xt(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,Un(e,a),l,e)}),s[t](o,...r)}function fo(e,t,n){const r=nt(e);Ot(r,"iterate",ls);const s=r[t](...n);return(s===-1||s===!1)&&vi(n[0])?(n[0]=nt(n[0]),r[t](...n)):s}function qr(e,t,n=[]){In(),di();const r=nt(e)[t].apply(e,n);return fi(),Rn(),r}const Iu=oi("__proto__,__v_isRef,__isVue"),Rl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nn));function Ru(e){nn(e)||(e=String(e));const t=nt(this);return Ot(t,"has",e),t.hasOwnProperty(e)}class $l{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Fu:Nl:o?Ol:Pl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=De(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Dt(t)?t:r);if((nn(n)?Rl.has(n):Iu(n))||(s||Ot(t,"get",n),o))return a;if(Dt(a)){const l=i&&li(n)?a:a.value;return s&&ot(l)?Lo(l):l}return ot(a)?s?Lo(a):zs(a):a}}class Ml extends $l{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=De(t)&&li(n);if(!this._isShallow){const d=$n(o);if(!Xt(r)&&!$n(r)&&(o=nt(o),r=nt(r)),!i&&Dt(o)&&!Dt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:st(t,n),l=Reflect.set(t,n,r,Dt(t)?t:s);return t===nt(s)&&(a?Kn(r,o)&&Cn(t,"set",n,r):Cn(t,"add",n,r)),l}deleteProperty(t,n){const r=st(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Cn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!nn(n)||!Rl.has(n))&&Ot(t,"has",n),r}ownKeys(t){return Ot(t,"iterate",De(t)?"length":hr),Reflect.ownKeys(t)}}class $u extends $l{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Ml,Pu=new $u,Ou=new Ml(!0);const Do=e=>e,ws=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=nt(s),i=$r(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Do:t?Nr:rn;return!t&&Ot(o,"iterate",l?jo:hr),xt(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 bs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ju(e,t){const n={get(s){const o=this.__v_raw,i=nt(o),a=nt(s);e||(Kn(s,a)&&Ot(i,"get",s),Ot(i,"get",a));const{has:l}=ws(i),d=t?Do:e?Nr:rn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Ot(nt(s),"iterate",hr),s.size},has(s){const o=this.__v_raw,i=nt(o),a=nt(s);return e||(Kn(s,a)&&Ot(i,"has",s),Ot(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=nt(a),d=t?Do:e?Nr:rn;return!e&&Ot(l,"iterate",hr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return xt(n,e?{add:bs("add"),set:bs("set"),delete:bs("delete"),clear:bs("clear")}:{add(s){!t&&!Xt(s)&&!$n(s)&&(s=nt(s));const o=nt(this);return ws(o).has.call(o,s)||(o.add(s),Cn(o,"add",s,s)),this},set(s,o){!t&&!Xt(o)&&!$n(o)&&(o=nt(o));const i=nt(this),{has:a,get:l}=ws(i);let d=a.call(i,s);d||(s=nt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?Kn(o,u)&&Cn(i,"set",s,o):Cn(i,"add",s,o),this},delete(s){const o=nt(this),{has:i,get:a}=ws(o);let l=i.call(o,s);l||(s=nt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Cn(o,"delete",s,void 0),d},clear(){const s=nt(this),o=s.size!==0,i=s.clear();return o&&Cn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function mi(e,t){const n=ju(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(st(n,s)&&s in r?n:r,s,o)}const Du={get:mi(!1,!1)},Lu={get:mi(!1,!0)},Bu={get:mi(!0,!1)};const Pl=new WeakMap,Ol=new WeakMap,Nl=new WeakMap,Fu=new WeakMap;function Hu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Hu(fu(e))}function zs(e){return $n(e)?e:gi(e,!1,Mu,Du,Pl)}function jl(e){return gi(e,!1,Ou,Lu,Ol)}function Lo(e){return gi(e,!0,Pu,Bu,Nl)}function gi(e,t,n,r,s){if(!ot(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Uu(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function pr(e){return $n(e)?pr(e.__v_raw):!!(e&&e.__v_isReactive)}function $n(e){return!!(e&&e.__v_isReadonly)}function Xt(e){return!!(e&&e.__v_isShallow)}function vi(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function Vu(e){return!st(e,"__v_skip")&&Object.isExtensible(e)&&yl(e,"__v_skip",!0),e}const rn=e=>ot(e)?zs(e):e,Nr=e=>ot(e)?Lo(e):e;function Dt(e){return e?e.__v_isRef===!0:!1}function P(e){return Dl(e,!1)}function Wu(e){return Dl(e,!0)}function Dl(e,t){return Dt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new pi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:rn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Xt(t)||$n(t);t=r?t:nt(t),Kn(t,n)&&(this._rawValue=t,this._value=r?t:rn(t),this.dep.trigger())}}function je(e){return Dt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Dt(s)&&!Dt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Ll(e){return pr(e)?e:new Proxy(e,Ku)}class Gu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new pi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=as-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&>!==this)return Sl(this,!0),!0}get value(){const t=this.dep.track();return El(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zu(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const _s={},Ps=new WeakMap;let cr;function Yu(e,t=!1,n=cr){if(n){let r=Ps.get(n);r||Ps.set(n,r=[]),r.push(e)}}function Ju(e,t,n=mt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=D=>s?D:Xt(D)||s===!1||s===0?En(D,1):En(D);let u,f,g,_,O=!1,I=!1;if(Dt(e)?(f=()=>e.value,O=Xt(e)):pr(e)?(f=()=>d(e),O=!0):De(e)?(I=!0,O=e.some(D=>pr(D)||Xt(D)),f=()=>e.map(D=>{if(Dt(D))return D.value;if(pr(D))return d(D);if(Ve(D))return l?l(D,2):D()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){In();try{g()}finally{Rn()}}const D=cr;cr=u;try{return l?l(e,3,[_]):e(_)}finally{cr=D}}:f=gn,t&&s){const D=f,ae=s===!0?1/0:s;f=()=>En(D(),ae)}const F=Su(),z=()=>{u.stop(),F&&F.active&&ai(F.effects,u)};if(o&&t){const D=t;t=(...ae)=>{D(...ae),z()}}let j=I?new Array(e.length).fill(_s):_s;const U=D=>{if(!(!(u.flags&1)||!u.dirty&&!D))if(t){const ae=u.run();if(s||O||(I?ae.some((ue,fe)=>Kn(ue,j[fe])):Kn(ae,j))){g&&g();const ue=cr;cr=u;try{const fe=[ae,j===_s?void 0:I&&j[0]===_s?[]:j,_];j=ae,l?l(t,3,fe):t(...fe)}finally{cr=ue}}}else u.run()};return a&&a(U),u=new kl(f),u.scheduler=i?()=>i(U,!1):U,_=D=>Yu(D,!1,u),g=u.onStop=()=>{const D=Ps.get(u);if(D){if(l)l(D,4);else for(const ae of D)ae();Ps.delete(u)}},t?r?U(!0):j=u.run():i?i(U.bind(null,!0),!0):u.run(),z.pause=u.pause.bind(u),z.resume=u.resume.bind(u),z.stop=z,z}function En(e,t=1/0,n){if(t<=0||!ot(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Dt(e))En(e.value,t,n);else if(De(e))for(let r=0;r<e.length;r++)En(e[r],t,n);else if(pl(e)||$r(e))e.forEach(r=>{En(r,t,n)});else if(vl(e)){for(const r in e)En(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&En(e[r],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 vs(e,t,n,r){try{return r?e(...r):e()}catch(s){Ys(s,t,n)}}function sn(e,t,n,r){if(Ve(e)){const s=vs(e,t,n,r);return s&&ml(s)&&s.catch(o=>{Ys(o,t,n)}),s}if(De(e)){const s=[];for(let o=0;o<e.length;o++)s.push(sn(e[o],t,n,r));return s}}function Ys(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||mt;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){In(),vs(o,null,10,[e,l,d]),Rn();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ft=[];let fn=-1;const Mr=[];let Vn=null,Er=0;const Bl=Promise.resolve();let Os=null;function zt(e){const t=Os||Bl;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=fn+1,n=Ft.length;for(;t<n;){const r=t+n>>>1,s=Ft[r],o=cs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function yi(e){if(!(e.flags&1)){const t=cs(e),n=Ft[Ft.length-1];!n||!(e.flags&2)&&t>=cs(n)?Ft.push(e):Ft.splice(Xu(t),0,e),e.flags|=1,Fl()}}function Fl(){Os||(Os=Bl.then(Ul))}function Zu(e){De(e)?Mr.push(...e):Vn&&e.id===-1?Vn.splice(Er+1,0,e):e.flags&1||(Mr.push(e),e.flags|=1),Fl()}function Ui(e,t,n=fn+1){for(;n<Ft.length;n++){const r=Ft[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ft.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Hl(e){if(Mr.length){const t=[...new Set(Mr)].sort((n,r)=>cs(n)-cs(r));if(Mr.length=0,Vn){Vn.push(...t);return}for(Vn=t,Er=0;Er<Vn.length;Er++){const n=Vn[Er];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Vn=null,Er=0}}const cs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ul(e){try{for(fn=0;fn<Ft.length;fn++){const t=Ft[fn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),vs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;fn<Ft.length;fn++){const t=Ft[fn];t&&(t.flags&=-2)}fn=-1,Ft.length=0,Hl(),Os=null,(Ft.length||Mr.length)&&Ul()}}let It=null,Vl=null;function Ns(e){const t=It;return It=e,Vl=e&&e.type.__scopeId||null,t}function it(e,t=It,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Bs(-1);const o=Ns(t);let i;try{i=e(...s)}finally{Ns(o),r._d&&Bs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Mn(e,t){if(It===null)return e;const n=to(It),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=mt]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&En(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function sr(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(In(),sn(l,n,8,[e.el,a,e,t]),Rn())}}function As(e,t){if(jt){let n=jt.provides;const r=jt.parent&&jt.parent.provides;r===n&&(n=jt.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=Ti();if(r||Or){let s=Or?Or._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ve(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>tn(ed);function ht(e,t,n){return Wl(e,t,n)}function Wl(e,t,n=mt){const{immediate:r,deep:s,flush:o,once:i}=n,a=xt({},n),l=t&&r||!t&&o!=="post";let d;if(hs){if(o==="sync"){const _=td();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=gn,_.resume=gn,_.pause=gn,_}}const u=jt;a.call=(_,O,I)=>sn(_,u,O,I);let f=!1;o==="post"?a.scheduler=_=>{Pt(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,O)=>{O?_():yi(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const g=Ju(e,t,a);return hs&&(d?d.push(g):l&&g()),g}function nd(e,t,n){const r=this.proxy,s=bt(e)?e.includes(".")?ql(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=ys(this),a=Wl(s,o.bind(r),n);return i(),a}function ql(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Kl=Symbol("_vte"),Gl=e=>e.__isTeleport,ns=e=>e&&(e.disabled||e.disabled===""),Vi=e=>e&&(e.defer||e.defer===""),Wi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,qi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Bo=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},zl={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:_,querySelector:O,createText:I,createComment:F}}=d,z=ns(t.props);let{shapeFlag:j,children:U,dynamicChildren:D}=t;if(e==null){const ae=t.el=I(""),ue=t.anchor=I("");_(ae,n,r),_(ue,n,r);const fe=(se,X)=>{j&16&&u(U,se,X,s,o,i,a,l)},ke=()=>{const se=t.target=Bo(t.props,O),X=Fo(se,t,I,_);se&&(i!=="svg"&&Wi(se)?i="svg":i!=="mathml"&&qi(se)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(se),z||(fe(se,X),Is(t,!1)))};z&&(fe(n,ue),Is(t,!0)),Vi(t.props)?(t.el.__isMounted=!1,Pt(()=>{ke(),delete t.el.__isMounted},o)):ke()}else{if(Vi(t.props)&&e.el.__isMounted===!1){Pt(()=>{zl.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,ue=t.target=e.target,fe=t.targetAnchor=e.targetAnchor,ke=ns(e.props),se=ke?n:ue,X=ke?ae:fe;if(i==="svg"||Wi(ue)?i="svg":(i==="mathml"||qi(ue))&&(i="mathml"),D?(g(e.dynamicChildren,D,se,s,o,i,a),_i(e,t,!0)):l||f(e,t,se,X,s,o,i,a,!1),z)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ks(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ge=t.target=Bo(t.props,O);ge&&ks(t,ge,null,d,0)}else ke&&ks(t,ue,fe,d,1);Is(t,z)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:g}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const _=o||!ns(g);for(let O=0;O<a.length;O++){const I=a[O];r(I,t,n,_,!!I.dynamicChildren)}}},move:ks,hydrate:rd};function ks(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,f=o===2;if(f&&r(i,t,n),(!f||ns(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function rd(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(F,z){let j=z;for(;j;){if(j&&j.nodeType===8){if(j.data==="teleport start anchor")t.targetStart=j;else if(j.data==="teleport anchor"){t.targetAnchor=j,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}j=i(j)}}function _(F,z){z.anchor=f(i(F),z,a(F),n,r,s,o)}const O=t.target=Bo(t.props,l),I=ns(t.props);if(O){const F=O._lpa||O.firstChild;t.shapeFlag&16&&(I?(_(e,t),g(O,F),t.targetAnchor||Fo(O,t,u,d,a(e)===O?e:null)):(t.anchor=i(e),g(O,F),t.targetAnchor||Fo(O,t,u,d),f(F&&i(F),t,O,n,r,s,o))),Is(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const js=zl;function Is(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Fo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Kl]=i,e&&(r(o,e,s),r(i,e,s)),i}const hn=Symbol("_leaveCb"),Kr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Nn(()=>{e.isMounted=!0}),jn(()=>{e.isUnmounting=!0}),e}const Jt=[Function,Array],Yl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},Jl=e=>{const t=e.subTree;return t.component?Jl(t.component):t},od={name:"BaseTransition",props:Yl,setup(e,{slots:t}){const n=Ti(),r=sd();return()=>{const s=t.default&&Zl(t.default(),!0);if(!s||!s.length)return;const o=Ql(s),i=nt(e),{mode:a}=i;if(r.isLeaving)return ho(o);const l=Ki(o);if(!l)return ho(o);let d=Ho(l,i,r,n,f=>d=f);l.type!==Nt&&us(l,d);let u=n.subTree&&Ki(n.subTree);if(u&&u.type!==Nt&&!ur(u,l)&&Jl(n).type!==Nt){let f=Ho(u,i,r,n);if(us(u,f),a==="out-in"&&l.type!==Nt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},ho(o);a==="in-out"&&l.type!==Nt?f.delayLeave=(g,_,O)=>{const I=Xl(r,u);I[String(u.key)]=u,g[hn]=()=>{_(),g[hn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{O(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Ql(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nt){t=n;break}}return t}const id=od;function Xl(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Ho(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:_,onAfterLeave:O,onLeaveCancelled:I,onBeforeAppear:F,onAppear:z,onAfterAppear:j,onAppearCancelled:U}=t,D=String(e.key),ae=Xl(n,e),ue=(se,X)=>{se&&sn(se,r,9,X)},fe=(se,X)=>{const ge=X[1];ue(se,X),De(se)?se.every(re=>re.length<=1)&&ge():se.length<=1&&ge()},ke={mode:i,persisted:a,beforeEnter(se){let X=l;if(!n.isMounted)if(o)X=F||l;else return;se[hn]&&se[hn](!0);const ge=ae[D];ge&&ur(e,ge)&&ge.el[hn]&&ge.el[hn](),ue(X,[se])},enter(se){let X=d,ge=u,re=f;if(!n.isMounted)if(o)X=z||d,ge=j||u,re=U||f;else return;let Be=!1;se[Kr]=Ge=>{Be||(Be=!0,Ge?ue(re,[se]):ue(ge,[se]),ke.delayedLeave&&ke.delayedLeave(),se[Kr]=void 0)};const He=se[Kr].bind(null,!1);X?fe(X,[se,He]):He()},leave(se,X){const ge=String(e.key);if(se[Kr]&&se[Kr](!0),n.isUnmounting)return X();ue(g,[se]);let re=!1;se[hn]=He=>{re||(re=!0,X(),He?ue(I,[se]):ue(O,[se]),se[hn]=void 0,ae[ge]===e&&delete ae[ge])};const Be=se[hn].bind(null,!1);ae[ge]=e,_?fe(_,[se,Be]):Be()},clone(se){const X=Ho(se,t,n,r,s);return s&&s(X),X}};return ke}function ho(e){if(Js(e))return e=Gn(e),e.children=null,e}function Ki(e){if(!Js(e))return Gl(e.type)&&e.children?Ql(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&&Ve(n.default))return n.default()}}function us(e,t){e.shapeFlag&6&&e.component?(e.transition=t,us(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 Zl(e,t=!1,n){let r=[],s=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===Ue?(i.patchFlag&128&&s++,r=r.concat(Zl(i.children,t,a))):(t||i.type!==Nt)&&r.push(a!=null?Gn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Et(e,t){return Ve(e)?xt({name:e.name},t,{setup:e}):e}function ec(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Gi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ds=new WeakMap;function rs(e,t,n,r,s=!1){if(De(e)){e.forEach((I,F)=>rs(I,t&&(De(t)?t[F]:t),n,r,s));return}if(Pr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&rs(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?to(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===mt?a.refs={}:a.refs,f=a.setupState,g=nt(f),_=f===mt?hl:I=>Gi(u,I)?!1:st(g,I),O=(I,F)=>!(F&&Gi(u,F));if(d!=null&&d!==l){if(zi(t),bt(d))u[d]=null,_(d)&&(f[d]=null);else if(Dt(d)){const I=t;O(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(Ve(l))vs(l,a,12,[i,u]);else{const I=bt(l),F=Dt(l);if(I||F){const z=()=>{if(e.f){const j=I?_(l)?f[l]:u[l]:O()||!e.k?l.value:u[e.k];if(s)De(j)&&ai(j,o);else if(De(j))j.includes(o)||j.push(o);else if(I)u[l]=[o],_(l)&&(f[l]=u[l]);else{const U=[o];O(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else I?(u[l]=i,_(l)&&(f[l]=i)):F&&(O(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const j=()=>{z(),Ds.delete(e)};j.id=-1,Ds.set(e,j),Pt(j,n)}else zi(e),z()}}}function zi(e){const t=Ds.get(e);t&&(t.flags|=8,Ds.delete(e))}Ks().requestIdleCallback;Ks().cancelIdleCallback;const Pr=e=>!!e.type.__asyncLoader,Js=e=>e.type.__isKeepAlive;function ad(e,t){tc(e,"a",t)}function ld(e,t){tc(e,"da",t)}function tc(e,t,n=jt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Qs(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Js(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=Qs(t,e,r,!0);Xs(()=>{ai(r[t],s)},n)}function Qs(e,t,n=jt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{In();const a=ys(n),l=sn(t,n,e,i);return a(),Rn(),l});return r?s.unshift(o):s.push(o),o}}const On=e=>(t,n=jt)=>{(!hs||e==="sp")&&Qs(e,(...r)=>t(...r),n)},ud=On("bm"),Nn=On("m"),dd=On("bu"),fd=On("u"),jn=On("bum"),Xs=On("um"),hd=On("sp"),pd=On("rtg"),md=On("rtc");function gd(e,t=jt){Qs("ec",e,t)}const vd="components",nc=Symbol.for("v-ndc");function Uo(e){return bt(e)?yd(vd,e,!1)||e:e||nc}function yd(e,t,n=!0,r=!1){const s=It||jt;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===Zt(t)||a===qs(Zt(t))))return o}const i=Yi(s[e]||o[e],t)||Yi(s.appContext[e],t);return!i&&r?o:i}}function Yi(e,t){return e&&(e[t]||e[Zt(t)]||e[qs(Zt(t))])}function wt(e,t,n,r){let s;const o=n,i=De(e);if(i||bt(e)){const a=i&&pr(e);let l=!1,d=!1;a&&(l=!Xt(e),d=$n(e),e=Gs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Nr(rn(e[u])):rn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(ot(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function mn(e,t,n={},r,s){if(It.ce||It.parent&&Pr(It.parent)&&It.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ft(Ue,null,[Se("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&rc(o(n)),a=n.key||i&&i.key,l=ft(Ue,{key:(a&&!nn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function rc(e){return e.some(t=>fs(t)?!(t.type===Nt||t.type===Ue&&!rc(t.children)):!0)?e:null}const Vo=e=>e?Tc(e)?to(e):Vo(e.parent):null,ss=xt(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=>Vo(e.parent),$root:e=>Vo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oc(e),$forceUpdate:e=>e.f||(e.f=()=>{yi(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>nd.bind(e)}),po=(e,t)=>e!==mt&&!e.__isScriptSetup&&st(e,t),wd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,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 r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(po(r,t))return i[t]=1,r[t];if(s!==mt&&st(s,t))return i[t]=2,s[t];if(st(o,t))return i[t]=3,o[t];if(n!==mt&&st(n,t))return i[t]=4,n[t];Wo&&(i[t]=0)}}const d=ss[t];let u,f;if(d)return t==="$attrs"&&Ot(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==mt&&st(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,st(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return po(s,t)?(s[t]=n,!0):r!==mt&&st(r,t)?(r[t]=n,!0):st(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==mt&&a[0]!=="$"&&st(e,a)||po(t,a)||st(o,a)||st(r,a)||st(ss,a)||st(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:st(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=Ti();return t.setupContext||(t.setupContext=xc(t))}function Ji(e){return De(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Wo=!0;function kd(e){const t=oc(e),n=e.proxy,r=e.ctx;Wo=!1,t.beforeCreate&&Qi(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:_,updated:O,activated:I,deactivated:F,beforeDestroy:z,beforeUnmount:j,destroyed:U,unmounted:D,render:ae,renderTracked:ue,renderTriggered:fe,errorCaptured:ke,serverPrefetch:se,expose:X,inheritAttrs:ge,components:re,directives:Be,filters:He}=t;if(d&&Td(d,r,null),i)for(const be in i){const Pe=i[be];Ve(Pe)&&(r[be]=Pe.bind(n))}if(s){const be=s.call(n,n);ot(be)&&(e.data=zs(be))}if(Wo=!0,o)for(const be in o){const Pe=o[be],vt=Ve(Pe)?Pe.bind(n,n):Ve(Pe.get)?Pe.get.bind(n,n):gn,Qe=!Ve(Pe)&&Ve(Pe.set)?Pe.set.bind(n):gn,lt=ce({get:vt,set:Qe});Object.defineProperty(r,be,{enumerable:!0,configurable:!0,get:()=>lt.value,set:Ye=>lt.value=Ye})}if(a)for(const be in a)sc(a[be],r,n,be);if(l){const be=Ve(l)?l.call(n):l;Reflect.ownKeys(be).forEach(Pe=>{As(Pe,be[Pe])})}u&&Qi(u,e,"c");function Ie(be,Pe){De(Pe)?Pe.forEach(vt=>be(vt.bind(n))):Pe&&be(Pe.bind(n))}if(Ie(ud,f),Ie(Nn,g),Ie(dd,_),Ie(fd,O),Ie(ad,I),Ie(ld,F),Ie(gd,ke),Ie(md,ue),Ie(pd,fe),Ie(jn,j),Ie(Xs,D),Ie(hd,se),De(X))if(X.length){const be=e.exposed||(e.exposed={});X.forEach(Pe=>{Object.defineProperty(be,Pe,{get:()=>n[Pe],set:vt=>n[Pe]=vt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===gn&&(e.render=ae),ge!=null&&(e.inheritAttrs=ge),re&&(e.components=re),Be&&(e.directives=Be),se&&ec(e)}function Td(e,t,n=gn){De(e)&&(e=qo(e));for(const r in e){const s=e[r];let o;ot(s)?"default"in s?o=tn(s.from||r,s.default,!0):o=tn(s.from||r):o=tn(s),Dt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Qi(e,t,n){sn(De(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function sc(e,t,n,r){let s=r.includes(".")?ql(n,r):()=>n[r];if(bt(e)){const o=t[e];Ve(o)&&ht(s,o)}else if(Ve(e))ht(s,e.bind(n));else if(ot(e))if(De(e))e.forEach(o=>sc(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&&ht(s,o,e)}}function oc(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>Ls(l,d,i,!0)),Ls(l,t,i)),ot(t)&&o.set(t,l),l}function Ls(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Ls(e,o,n,!0),s&&s.forEach(i=>Ls(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Sd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Sd={data:Xi,props:Zi,emits:Zi,methods:Xr,computed:Xr,beforeCreate:Lt,created:Lt,beforeMount:Lt,mounted:Lt,beforeUpdate:Lt,updated:Lt,beforeDestroy:Lt,beforeUnmount:Lt,destroyed:Lt,unmounted:Lt,activated:Lt,deactivated:Lt,errorCaptured:Lt,serverPrefetch:Lt,components:Xr,directives:Xr,watch:Cd,provide:Xi,inject:xd};function Xi(e,t){return t?e?function(){return xt(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function xd(e,t){return Xr(qo(e),qo(t))}function qo(e){if(De(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Lt(e,t){return e?[...new Set([].concat(e,t))]:t}function Xr(e,t){return e?xt(Object.create(null),e,t):t}function Zi(e,t){return e?De(e)&&De(t)?[...new Set([...e,...t])]:xt(Object.create(null),Ji(e),Ji(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=xt(Object.create(null),e);for(const r in t)n[r]=Lt(e[r],t[r]);return n}function ic(){return{app:null,config:{isNativeTag:hl,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 Ed=0;function Ad(e,t){return function(r,s=null){Ve(r)||(r=xt({},r)),s!=null&&!ot(s)&&(s=null);const o=ic(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Ed++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:of,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ve(u.install)?(i.add(u),u.install(d,...f)):Ve(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||Se(r,s);return _.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(_,u,g),l=!0,d._container=u,u.__vue_app__=d,to(_.component)}},onUnmount(u){a.push(u)},unmount(){l&&(sn(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=Or;Or=d;try{return u()}finally{Or=f}}};return d}}let Or=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Zt(t)}Modifiers`]||e[`${zn(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||mt;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>bt(u)?u.trim():u)),i.number&&(s=n.map(ci)));let a,l=r[a=ao(t)]||r[a=ao(Zt(t))];!l&&o&&(l=r[a=ao(zn(t))]),l&&sn(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,sn(d,e,6,s)}}const $d=new WeakMap;function ac(e,t,n=!1){const r=n?$d:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=d=>{const u=ac(d,t,!0);u&&(a=!0,xt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ot(e)&&r.set(e,null),null):(De(o)?o.forEach(l=>i[l]=null):xt(i,o),ot(e)&&r.set(e,i),i)}function Zs(e,t){return!e||!Vs(t)?!1:(t=t.slice(2).replace(/Once$/,""),st(e,t[0].toLowerCase()+t.slice(1))||st(e,zn(t))||st(e,t))}function ea(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:_,ctx:O,inheritAttrs:I}=e,F=Ns(e);let z,j;try{if(n.shapeFlag&4){const D=s||r,ae=D;z=pn(d.call(ae,D,u,f,_,g,O)),j=a}else{const D=t;z=pn(D.length>1?D(f,{attrs:a,slots:i,emit:l}):D(f,null)),j=t.props?a:Md(a)}}catch(D){os.length=0,Ys(D,e,1),z=Se(Nt)}let U=z;if(j&&I!==!1){const D=Object.keys(j),{shapeFlag:ae}=U;D.length&&ae&7&&(o&&D.some(ii)&&(j=Pd(j,o)),U=Gn(U,j,!1,!0))}return n.dirs&&(U=Gn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&us(U,n.transition),z=U,Ns(F),z}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vs(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!ii(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Od(e,t,n){const{props:r,children:s,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 r?ta(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(lc(i,r,g)&&!Zs(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?ta(r,i,d):!0:!!i;return!1}function ta(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(lc(t,e,o)&&!Zs(n,o))return!0}return!1}function lc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ot(r)&&ot(s)?!ui(r,s):r!==s}function Nd({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const cc={},uc=()=>Object.create(cc),dc=e=>Object.getPrototypeOf(e)===cc;function jd(e,t,n,r=!1){const s={},o=uc();e.propsDefaults=Object.create(null),fc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:jl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Dd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=nt(s),[l]=e.propsOptions;let d=!1;if((r||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(Zs(e.emitsOptions,g))continue;const _=t[g];if(l)if(st(o,g))_!==o[g]&&(o[g]=_,d=!0);else{const O=Zt(g);s[O]=Ko(l,a,O,_,e,!1)}else _!==o[g]&&(o[g]=_,d=!0)}}}else{fc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!st(t,f)&&((u=zn(f))===f||!st(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Ko(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!st(t,f))&&(delete o[f],d=!0)}d&&Cn(e.attrs,"set","")}function fc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Zr(l))continue;const d=t[l];let u;s&&st(s,u=Zt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:Zs(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=nt(n),d=a||mt;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Ko(s,l,f,d[f],e,!st(d,f))}}return i}function Ko(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=st(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ve(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=ys(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===zn(n))&&(r=!0))}return r}const Ld=new WeakMap;function hc(e,t,n=!1){const r=n?Ld:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const u=f=>{l=!0;const[g,_]=hc(f,t,!0);xt(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 ot(e)&&r.set(e,Rr),Rr;if(De(o))for(let u=0;u<o.length;u++){const f=Zt(o[u]);na(f)&&(i[f]=mt)}else if(o)for(const u in o){const f=Zt(u);if(na(f)){const g=o[u],_=i[f]=De(g)||Ve(g)?{type:g}:xt({},g),O=_.type;let I=!1,F=!0;if(De(O))for(let z=0;z<O.length;++z){const j=O[z],U=Ve(j)&&j.name;if(U==="Boolean"){I=!0;break}else U==="String"&&(F=!1)}else I=Ve(O)&&O.name==="Boolean";_[0]=I,_[1]=F,(I||st(_,"default"))&&a.push(f)}}const d=[i,a];return ot(e)&&r.set(e,d),d}function na(e){return e[0]!=="$"&&!Zr(e)}const wi=e=>e==="_"||e==="_ctx"||e==="$stable",bi=e=>De(e)?e.map(pn):[pn(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=it((...s)=>bi(t(...s)),n);return r._c=!1,r},pc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(wi(s))continue;const o=e[s];if(Ve(o))t[s]=Bd(s,o,r);else if(o!=null){const i=bi(o);t[s]=()=>i}}},mc=(e,t)=>{const n=bi(t);e.slots.default=()=>n},gc=(e,t,n)=>{for(const r in t)(n||!wi(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=uc();if(e.vnode.shapeFlag&32){const s=t._;s?(gc(r,t,n),n&&yl(r,"_",s,!0)):pc(t,r)}else t&&mc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=mt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:gc(s,t,n):(o=!t.$stable,pc(t,s)),i=t}else t&&(mc(e,t),i={default:1});if(o)for(const a in s)!wi(a)&&i[a]==null&&delete s[a]},Pt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Ks();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:_=gn,insertStaticContent:O}=e,I=(p,y,x,N=null,B=null,L=null,te=void 0,ne=null,Z=!!y.dynamicChildren)=>{if(p===y)return;p&&!ur(p,y)&&(N=E(p),Ye(p,B,L,!0),p=null),y.patchFlag===-2&&(Z=!1,y.dynamicChildren=null);const{type:V,ref:ye,shapeFlag:ie}=y;switch(V){case eo:F(p,y,x,N);break;case Nt:z(p,y,x,N);break;case go:p==null&&j(y,x,N,te);break;case Ue:re(p,y,x,N,B,L,te,ne,Z);break;default:ie&1?ae(p,y,x,N,B,L,te,ne,Z):ie&6?Be(p,y,x,N,B,L,te,ne,Z):(ie&64||ie&128)&&V.process(p,y,x,N,B,L,te,ne,Z,ve)}ye!=null&&B?rs(ye,p&&p.ref,L,y||p,!y):ye==null&&p&&p.ref!=null&&rs(p.ref,null,L,p,!0)},F=(p,y,x,N)=>{if(p==null)r(y.el=a(y.children),x,N);else{const B=y.el=p.el;y.children!==p.children&&d(B,y.children)}},z=(p,y,x,N)=>{p==null?r(y.el=l(y.children||""),x,N):y.el=p.el},j=(p,y,x,N)=>{[p.el,p.anchor]=O(p.children,y,x,N,p.el,p.anchor)},U=({el:p,anchor:y},x,N)=>{let B;for(;p&&p!==y;)B=g(p),r(p,x,N),p=B;r(y,x,N)},D=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=g(p),s(p),p=x;s(y)},ae=(p,y,x,N,B,L,te,ne,Z)=>{if(y.type==="svg"?te="svg":y.type==="math"&&(te="mathml"),p==null)ue(y,x,N,B,L,te,ne,Z);else{const V=p.el&&p.el._isVueCE?p.el:null;try{V&&V._beginPatch(),se(p,y,B,L,te,ne,Z)}finally{V&&V._endPatch()}}},ue=(p,y,x,N,B,L,te,ne)=>{let Z,V;const{props:ye,shapeFlag:ie,transition:de,dirs:_e}=p;if(Z=p.el=i(p.type,L,ye&&ye.is,ye),ie&8?u(Z,p.children):ie&16&&ke(p.children,Z,null,N,B,mo(p,L),te,ne),_e&&sr(p,null,N,"created"),fe(Z,p,p.scopeId,te,N),ye){for(const qe in ye)qe!=="value"&&!Zr(qe)&&o(Z,qe,null,ye[qe],L,N);"value"in ye&&o(Z,"value",null,ye.value,L),(V=ye.onVnodeBeforeMount)&&dn(V,N,p)}_e&&sr(p,null,N,"beforeMount");const Le=Wd(B,de);Le&&de.beforeEnter(Z),r(Z,y,x),((V=ye&&ye.onVnodeMounted)||Le||_e)&&Pt(()=>{V&&dn(V,N,p),Le&&de.enter(Z),_e&&sr(p,null,N,"mounted")},B)},fe=(p,y,x,N,B)=>{if(x&&_(p,x),N)for(let L=0;L<N.length;L++)_(p,N[L]);if(B){let L=B.subTree;if(y===L||wc(L.type)&&(L.ssContent===y||L.ssFallback===y)){const te=B.vnode;fe(p,te,te.scopeId,te.slotScopeIds,B.parent)}}},ke=(p,y,x,N,B,L,te,ne,Z=0)=>{for(let V=Z;V<p.length;V++){const ye=p[V]=ne?xn(p[V]):pn(p[V]);I(null,ye,y,x,N,B,L,te,ne)}},se=(p,y,x,N,B,L,te)=>{const ne=y.el=p.el;let{patchFlag:Z,dynamicChildren:V,dirs:ye}=y;Z|=p.patchFlag&16;const ie=p.props||mt,de=y.props||mt;let _e;if(x&&or(x,!1),(_e=de.onVnodeBeforeUpdate)&&dn(_e,x,y,p),ye&&sr(y,p,x,"beforeUpdate"),x&&or(x,!0),(ie.innerHTML&&de.innerHTML==null||ie.textContent&&de.textContent==null)&&u(ne,""),V?X(p.dynamicChildren,V,ne,x,N,mo(y,B),L):te||Pe(p,y,ne,null,x,N,mo(y,B),L,!1),Z>0){if(Z&16)ge(ne,ie,de,x,B);else if(Z&2&&ie.class!==de.class&&o(ne,"class",null,de.class,B),Z&4&&o(ne,"style",ie.style,de.style,B),Z&8){const Le=y.dynamicProps;for(let qe=0;qe<Le.length;qe++){const Ae=Le[qe],Xe=ie[Ae],pt=de[Ae];(pt!==Xe||Ae==="value")&&o(ne,Ae,Xe,pt,B,x)}}Z&1&&p.children!==y.children&&u(ne,y.children)}else!te&&V==null&&ge(ne,ie,de,x,B);((_e=de.onVnodeUpdated)||ye)&&Pt(()=>{_e&&dn(_e,x,y,p),ye&&sr(y,p,x,"updated")},N)},X=(p,y,x,N,B,L,te)=>{for(let ne=0;ne<y.length;ne++){const Z=p[ne],V=y[ne],ye=Z.el&&(Z.type===Ue||!ur(Z,V)||Z.shapeFlag&198)?f(Z.el):x;I(Z,V,ye,null,N,B,L,te,!0)}},ge=(p,y,x,N,B)=>{if(y!==x){if(y!==mt)for(const L in y)!Zr(L)&&!(L in x)&&o(p,L,y[L],null,B,N);for(const L in x){if(Zr(L))continue;const te=x[L],ne=y[L];te!==ne&&L!=="value"&&o(p,L,ne,te,B,N)}"value"in x&&o(p,"value",y.value,x.value,B)}},re=(p,y,x,N,B,L,te,ne,Z)=>{const V=y.el=p?p.el:a(""),ye=y.anchor=p?p.anchor:a("");let{patchFlag:ie,dynamicChildren:de,slotScopeIds:_e}=y;_e&&(ne=ne?ne.concat(_e):_e),p==null?(r(V,x,N),r(ye,x,N),ke(y.children||[],x,ye,B,L,te,ne,Z)):ie>0&&ie&64&&de&&p.dynamicChildren&&p.dynamicChildren.length===de.length?(X(p.dynamicChildren,de,x,B,L,te,ne),(y.key!=null||B&&y===B.subTree)&&_i(p,y,!0)):Pe(p,y,x,ye,B,L,te,ne,Z)},Be=(p,y,x,N,B,L,te,ne,Z)=>{y.slotScopeIds=ne,p==null?y.shapeFlag&512?B.ctx.activate(y,x,N,te,Z):He(y,x,N,B,L,te,Z):Ge(p,y,Z)},He=(p,y,x,N,B,L,te)=>{const ne=p.component=Zd(p,N,B);if(Js(p)&&(ne.ctx.renderer=ve),ef(ne,!1,te),ne.asyncDep){if(B&&B.registerDep(ne,Ie,te),!p.el){const Z=ne.subTree=Se(Nt);z(null,Z,y,x),p.placeholder=Z.el}}else Ie(ne,p,y,x,B,L,te)},Ge=(p,y,x)=>{const N=y.component=p.component;if(Od(p,y,x))if(N.asyncDep&&!N.asyncResolved){be(N,y,x);return}else N.next=y,N.update();else y.el=p.el,N.vnode=y},Ie=(p,y,x,N,B,L,te)=>{const ne=()=>{if(p.isMounted){let{next:ie,bu:de,u:_e,parent:Le,vnode:qe}=p;{const W=vc(p);if(W){ie&&(ie.el=qe.el,be(p,ie,te)),W.asyncDep.then(()=>{Pt(()=>{p.isUnmounted||V()},B)});return}}let Ae=ie,Xe;or(p,!1),ie?(ie.el=qe.el,be(p,ie,te)):ie=qe,de&&Es(de),(Xe=ie.props&&ie.props.onVnodeBeforeUpdate)&&dn(Xe,Le,ie,qe),or(p,!0);const pt=ea(p),H=p.subTree;p.subTree=pt,I(H,pt,f(H.el),E(H),p,B,L),ie.el=pt.el,Ae===null&&Nd(p,pt.el),_e&&Pt(_e,B),(Xe=ie.props&&ie.props.onVnodeUpdated)&&Pt(()=>dn(Xe,Le,ie,qe),B)}else{let ie;const{el:de,props:_e}=y,{bm:Le,m:qe,parent:Ae,root:Xe,type:pt}=p,H=Pr(y);or(p,!1),Le&&Es(Le),!H&&(ie=_e&&_e.onVnodeBeforeMount)&&dn(ie,Ae,y),or(p,!0);{Xe.ce&&Xe.ce._hasShadowRoot()&&Xe.ce._injectChildStyle(pt);const W=p.subTree=ea(p);I(null,W,x,N,p,B,L),y.el=W.el}if(qe&&Pt(qe,B),!H&&(ie=_e&&_e.onVnodeMounted)){const W=y;Pt(()=>dn(ie,Ae,W),B)}(y.shapeFlag&256||Ae&&Pr(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&p.a&&Pt(p.a,B),p.isMounted=!0,y=x=N=null}};p.scope.on();const Z=p.effect=new kl(ne);p.scope.off();const V=p.update=Z.run.bind(Z),ye=p.job=Z.runIfDirty.bind(Z);ye.i=p,ye.id=p.uid,Z.scheduler=()=>yi(ye),or(p,!0),V()},be=(p,y,x)=>{y.component=p;const N=p.vnode.props;p.vnode=y,p.next=null,Dd(p,y.props,N,x),Hd(p,y.children,x),In(),Ui(p),Rn()},Pe=(p,y,x,N,B,L,te,ne,Z=!1)=>{const V=p&&p.children,ye=p?p.shapeFlag:0,ie=y.children,{patchFlag:de,shapeFlag:_e}=y;if(de>0){if(de&128){Qe(V,ie,x,N,B,L,te,ne,Z);return}else if(de&256){vt(V,ie,x,N,B,L,te,ne,Z);return}}_e&8?(ye&16&&Te(V,B,L),ie!==V&&u(x,ie)):ye&16?_e&16?Qe(V,ie,x,N,B,L,te,ne,Z):Te(V,B,L,!0):(ye&8&&u(x,""),_e&16&&ke(ie,x,N,B,L,te,ne,Z))},vt=(p,y,x,N,B,L,te,ne,Z)=>{p=p||Rr,y=y||Rr;const V=p.length,ye=y.length,ie=Math.min(V,ye);let de;for(de=0;de<ie;de++){const _e=y[de]=Z?xn(y[de]):pn(y[de]);I(p[de],_e,x,null,B,L,te,ne,Z)}V>ye?Te(p,B,L,!0,!1,ie):ke(y,x,N,B,L,te,ne,Z,ie)},Qe=(p,y,x,N,B,L,te,ne,Z)=>{let V=0;const ye=y.length;let ie=p.length-1,de=ye-1;for(;V<=ie&&V<=de;){const _e=p[V],Le=y[V]=Z?xn(y[V]):pn(y[V]);if(ur(_e,Le))I(_e,Le,x,null,B,L,te,ne,Z);else break;V++}for(;V<=ie&&V<=de;){const _e=p[ie],Le=y[de]=Z?xn(y[de]):pn(y[de]);if(ur(_e,Le))I(_e,Le,x,null,B,L,te,ne,Z);else break;ie--,de--}if(V>ie){if(V<=de){const _e=de+1,Le=_e<ye?y[_e].el:N;for(;V<=de;)I(null,y[V]=Z?xn(y[V]):pn(y[V]),x,Le,B,L,te,ne,Z),V++}}else if(V>de)for(;V<=ie;)Ye(p[V],B,L,!0),V++;else{const _e=V,Le=V,qe=new Map;for(V=Le;V<=de;V++){const b=y[V]=Z?xn(y[V]):pn(y[V]);b.key!=null&&qe.set(b.key,V)}let Ae,Xe=0;const pt=de-Le+1;let H=!1,W=0;const J=new Array(pt);for(V=0;V<pt;V++)J[V]=0;for(V=_e;V<=ie;V++){const b=p[V];if(Xe>=pt){Ye(b,B,L,!0);continue}let A;if(b.key!=null)A=qe.get(b.key);else for(Ae=Le;Ae<=de;Ae++)if(J[Ae-Le]===0&&ur(b,y[Ae])){A=Ae;break}A===void 0?Ye(b,B,L,!0):(J[A-Le]=V+1,A>=W?W=A:H=!0,I(b,y[A],x,null,B,L,te,ne,Z),Xe++)}const Ke=H?qd(J):Rr;for(Ae=Ke.length-1,V=pt-1;V>=0;V--){const b=Le+V,A=y[b],$=y[b+1],Q=b+1<ye?$.el||yc($):N;J[V]===0?I(null,A,x,Q,B,L,te,ne,Z):H&&(Ae<0||V!==Ke[Ae]?lt(A,x,Q,2):Ae--)}}},lt=(p,y,x,N,B=null)=>{const{el:L,type:te,transition:ne,children:Z,shapeFlag:V}=p;if(V&6){lt(p.component.subTree,y,x,N);return}if(V&128){p.suspense.move(y,x,N);return}if(V&64){te.move(p,y,x,ve);return}if(te===Ue){r(L,y,x);for(let ie=0;ie<Z.length;ie++)lt(Z[ie],y,x,N);r(p.anchor,y,x);return}if(te===go){U(p,y,x);return}if(N!==2&&V&1&&ne)if(N===0)ne.beforeEnter(L),r(L,y,x),Pt(()=>ne.enter(L),B);else{const{leave:ie,delayLeave:de,afterLeave:_e}=ne,Le=()=>{p.ctx.isUnmounted?s(L):r(L,y,x)},qe=()=>{L._isLeaving&&L[hn](!0),ie(L,()=>{Le(),_e&&_e()})};de?de(L,Le,qe):qe()}else r(L,y,x)},Ye=(p,y,x,N=!1,B=!1)=>{const{type:L,props:te,ref:ne,children:Z,dynamicChildren:V,shapeFlag:ye,patchFlag:ie,dirs:de,cacheIndex:_e}=p;if(ie===-2&&(B=!1),ne!=null&&(In(),rs(ne,null,x,p,!0),Rn()),_e!=null&&(y.renderCache[_e]=void 0),ye&256){y.ctx.deactivate(p);return}const Le=ye&1&&de,qe=!Pr(p);let Ae;if(qe&&(Ae=te&&te.onVnodeBeforeUnmount)&&dn(Ae,y,p),ye&6)xe(p.component,x,N);else{if(ye&128){p.suspense.unmount(x,N);return}Le&&sr(p,null,y,"beforeUnmount"),ye&64?p.type.remove(p,y,x,ve,N):V&&!V.hasOnce&&(L!==Ue||ie>0&&ie&64)?Te(V,y,x,!1,!0):(L===Ue&&ie&384||!B&&ye&16)&&Te(Z,y,x),N&&et(p)}(qe&&(Ae=te&&te.onVnodeUnmounted)||Le)&&Pt(()=>{Ae&&dn(Ae,y,p),Le&&sr(p,null,y,"unmounted")},x)},et=p=>{const{type:y,el:x,anchor:N,transition:B}=p;if(y===Ue){pe(x,N);return}if(y===go){D(p);return}const L=()=>{s(x),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(p.shapeFlag&1&&B&&!B.persisted){const{leave:te,delayLeave:ne}=B,Z=()=>te(x,L);ne?ne(p.el,L,Z):Z()}else L()},pe=(p,y)=>{let x;for(;p!==y;)x=g(p),s(p),p=x;s(y)},xe=(p,y,x)=>{const{bum:N,scope:B,job:L,subTree:te,um:ne,m:Z,a:V}=p;ra(Z),ra(V),N&&Es(N),B.stop(),L&&(L.flags|=8,Ye(te,p,y,x)),ne&&Pt(ne,y),Pt(()=>{p.isUnmounted=!0},y)},Te=(p,y,x,N=!1,B=!1,L=0)=>{for(let te=L;te<p.length;te++)Ye(p[te],y,x,N,B)},E=p=>{if(p.shapeFlag&6)return E(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=g(p.anchor||p.el),x=y&&y[Kl];return x?g(x):y};let ee=!1;const Y=(p,y,x)=>{let N;p==null?y._vnode&&(Ye(y._vnode,null,null,!0),N=y._vnode.component):I(y._vnode||null,p,y,null,null,null,x),y._vnode=p,ee||(ee=!0,Ui(N),Hl(),ee=!1)},ve={p:I,um:Ye,m:lt,r:et,mt:He,mc:ke,pc:Pe,pbc:X,n:E,o:e};return{render:Y,hydrate:void 0,createApp:Ad(Y)}}function mo({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 or({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function _i(e,t,n=!1){const r=e.children,s=t.children;if(De(r)&&De(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=xn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&_i(i,a)),a.type===eo&&(a.patchFlag===-1&&(a=s[o]=xn(a)),a.el=i.el),a.type===Nt&&!a.el&&(a.el=i.el)}}function qd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);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[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function vc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vc(t)}function ra(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function yc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?yc(t.subTree):null}const wc=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?De(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const Ue=Symbol.for("v-fgt"),eo=Symbol.for("v-txt"),Nt=Symbol.for("v-cmt"),go=Symbol.for("v-stc"),os=[];let Gt=null;function w(e=!1){os.push(Gt=e?null:[])}function Gd(){os.pop(),Gt=os[os.length-1]||null}let ds=1;function Bs(e,t=!1){ds+=e,e<0&&Gt&&t&&(Gt.hasOnce=!0)}function bc(e){return e.dynamicChildren=ds>0?Gt||Rr:null,Gd(),ds>0&&Gt&&Gt.push(e),e}function S(e,t,n,r,s,o){return bc(m(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return bc(Se(e,t,n,r,s,!0))}function fs(e){return e?e.__v_isVNode===!0:!1}function ur(e,t){return e.type===t.type&&e.key===t.key}const _c=({key:e})=>e??null,Rs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Dt(e)||Ve(e)?{i:It,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===Ue?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_c(t),ref:t&&Rs(t),scopeId:Vl,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:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:It};return a?(ki(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=bt(n)?8:16),ds>0&&!i&&Gt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Gt.push(l),l}const Se=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===nc)&&(e=Nt),fs(e)){const a=Gn(e,t,!0);return n&&ki(a,n),ds>0&&!o&&Gt&&(a.shapeFlag&6?Gt[Gt.indexOf(e)]=a:Gt.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!bt(a)&&(t.class=at(a)),ot(l)&&(vi(l)&&!De(l)&&(l=xt({},l)),t.style=mr(l))}const i=bt(e)?1:wc(e)?128:Gl(e)?64:ot(e)?4:Ve(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Yd(e){return e?vi(e)||dc(e)?xt({},e):e:null}function Gn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?kc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&_c(d),ref:t&&t.ref?n&&o?De(o)?o.concat(Rs(t)):[o,Rs(t)]:Rs(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!==Ue?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&&Gn(e.ssContent),ssFallback:e.ssFallback&&Gn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&us(u,l.clone(u)),u}function Jd(e=" ",t=0){return Se(eo,null,e,t)}function le(e="",t=!1){return t?(w(),ft(Nt,null,e)):Se(Nt,null,e)}function pn(e){return e==null||typeof e=="boolean"?Se(Nt):De(e)?Se(Ue,null,e.slice()):fs(e)?xn(e):Se(eo,null,String(e))}function xn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Gn(e)}function ki(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(De(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),ki(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!dc(t)?t._ctx=It:s===3&&It&&(It.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:It},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function kc(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=at([t.class,r.class]));else if(s==="style")t.style=mr([t.style,r.style]);else if(Vs(s)){const o=t[s],i=r[s];i&&o!==i&&!(De(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function dn(e,t,n,r=null){sn(e,t,7,[n,r])}const Qd=ic();let Xd=0;function Zd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Qd,o={uid:Xd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:hc(r,s),emitsOptions:ac(r,s),emit:null,emitted:null,propsDefaults:mt,inheritAttrs:r.inheritAttrs,ctx:mt,data:mt,props:mt,attrs:mt,slots:mt,refs:mt,setupState:mt,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=Rd.bind(null,o),e.ce&&e.ce(o),o}let jt=null;const Ti=()=>jt||It;let Fs,Go;{const e=Ks(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Fs=t("__VUE_INSTANCE_SETTERS__",n=>jt=n),Go=t("__VUE_SSR_SETTERS__",n=>hs=n)}const ys=e=>{const t=jt;return Fs(e),e.scope.on(),()=>{e.scope.off(),Fs(t)}},sa=()=>{jt&&jt.scope.off(),Fs(null)};function Tc(e){return e.vnode.shapeFlag&4}let hs=!1;function ef(e,t=!1,n=!1){t&&Go(t);const{props:r,children:s}=e.vnode,o=Tc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Go(!1),i}function tf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wd);const{setup:r}=n;if(r){In();const s=e.setupContext=r.length>1?xc(e):null,o=ys(e),i=vs(r,e,0,[e.props,s]),a=ml(i);if(Rn(),o(),(a||e.sp)&&!Pr(e)&&ec(e),a){if(i.then(sa,sa),t)return i.then(l=>{oa(e,l)}).catch(l=>{Ys(l,e,0)});e.asyncDep=i}else oa(e,i)}else Sc(e)}function oa(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ot(t)&&(e.setupState=Ll(t)),Sc(e)}function Sc(e,t,n){const r=e.type;e.render||(e.render=r.render||gn);{const s=ys(e);In();try{kd(e)}finally{Rn(),s()}}}const nf={get(e,t){return Ot(e,"get",""),e[t]}};function xc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function to(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ll(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ss)return ss[n](e)},has(t,n){return n in t||n in ss}})):e.proxy}function rf(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return Ve(e)&&"__vccOpts"in e}const ce=(e,t)=>zu(e,t,hs);function Si(e,t,n){try{Bs(-1);const r=arguments.length;return r===2?ot(t)&&!De(t)?fs(t)?Se(e,null,[t]):Se(e,t):Se(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&fs(n)&&(n=[n]),Se(e,t,n))}finally{Bs(1)}}const of="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 zo;const ia=typeof window<"u"&&window.trustedTypes;if(ia)try{zo=ia.createPolicy("vue",{createHTML:e=>e})}catch{}const Cc=zo?e=>zo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",Sn=typeof document<"u"?document:null,aa=Sn&&Sn.createElement("template"),cf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Sn.createElementNS(af,e):t==="mathml"?Sn.createElementNS(lf,e):n?Sn.createElement(e,{is:n}):Sn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Sn.createTextNode(e),createComment:e=>Sn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{aa.innerHTML=Cc(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=aa.content;if(r==="svg"||r==="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]}},Bn="transition",Gr="animation",ps=Symbol("_vtc"),Ec={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},uf=xt({},Yl,Ec),df=e=>(e.displayName="Transition",e.props=uf,e),Ac=df((e,{slots:t})=>Si(id,ff(e),t)),ir=(e,t=[])=>{De(e)?e.forEach(n=>n(...t)):e&&e(...t)},la=e=>e?De(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const re in e)re in Ec||(t[re]=e[re]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,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,O=hf(s),I=O&&O[0],F=O&&O[1],{onBeforeEnter:z,onEnter:j,onEnterCancelled:U,onLeave:D,onLeaveCancelled:ae,onBeforeAppear:ue=z,onAppear:fe=j,onAppearCancelled:ke=U}=t,se=(re,Be,He,Ge)=>{re._enterCancelled=Ge,ar(re,Be?u:a),ar(re,Be?d:i),He&&He()},X=(re,Be)=>{re._isLeaving=!1,ar(re,f),ar(re,_),ar(re,g),Be&&Be()},ge=re=>(Be,He)=>{const Ge=re?fe:j,Ie=()=>se(Be,re,He);ir(Ge,[Be,Ie]),ca(()=>{ar(Be,re?l:o),kn(Be,re?u:a),la(Ge)||ua(Be,r,I,Ie)})};return xt(t,{onBeforeEnter(re){ir(z,[re]),kn(re,o),kn(re,i)},onBeforeAppear(re){ir(ue,[re]),kn(re,l),kn(re,d)},onEnter:ge(!1),onAppear:ge(!0),onLeave(re,Be){re._isLeaving=!0;const He=()=>X(re,Be);kn(re,f),re._enterCancelled?(kn(re,g),ha(re)):(ha(re),kn(re,g)),ca(()=>{re._isLeaving&&(ar(re,f),kn(re,_),la(D)||ua(re,r,F,He))}),ir(D,[re,He])},onEnterCancelled(re){se(re,!1,void 0,!0),ir(U,[re])},onAppearCancelled(re){se(re,!0,void 0,!0),ir(ke,[re])},onLeaveCancelled(re){X(re),ir(ae,[re])}})}function hf(e){if(e==null)return null;if(ot(e))return[vo(e.enter),vo(e.leave)];{const t=vo(e);return[t,t]}}function vo(e){return mu(e)}function kn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ps]||(e[ps]=new Set)).add(t)}function ar(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[ps];n&&(n.delete(t),n.size||(e[ps]=void 0))}function ca(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function ua(e,t,n,r){const s=e._endId=++pf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=mf(e,t);if(!i)return r();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 mf(e,t){const n=window.getComputedStyle(e),r=O=>(n[O]||"").split(", "),s=r(`${Bn}Delay`),o=r(`${Bn}Duration`),i=da(s,o),a=r(`${Gr}Delay`),l=r(`${Gr}Duration`),d=da(a,l);let u=null,f=0,g=0;t===Bn?i>0&&(u=Bn,f=i,g=o.length):t===Gr?d>0&&(u=Gr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Bn:Gr:null,g=u?u===Bn?o.length:l.length:0);const _=u===Bn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Bn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:_}}function da(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>fa(n)+fa(e[r])))}function fa(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ha(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[ps];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const pa=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=bt(n);let o=!1;if(n&&!s){if(t)if(bt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&$s(r,a,"")}else for(const i in t)n[i]==null&&$s(r,i,"");for(const i in n)i==="display"&&(o=!0),$s(r,i,n[i])}else if(s){if(t!==n){const i=r[yf];i&&(n+=";"+i),r.cssText=n,o=wf.test(n)}}else t&&e.removeAttribute("style");pa in e&&(e[pa]=o?r.display:"",e[vf]&&(r.display="none"))}const ma=/\s*!important$/;function $s(e,t,n){if(De(n))n.forEach(r=>$s(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);ma.test(n)?e.setProperty(zn(r),n.replace(ma,""),"important"):e[r]=n}}const ga=["Webkit","Moz","ms"],yo={};function _f(e,t){const n=yo[t];if(n)return n;let r=Zt(t);if(r!=="filter"&&r in e)return yo[t]=r;r=qs(r);for(let s=0;s<ga.length;s++){const o=ga[s]+r;if(o in e)return yo[t]=o}return t}const va="http://www.w3.org/1999/xlink";function ya(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(va,t.slice(6,t.length)):e.setAttributeNS(va,t,n):n==null||o&&!wl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":nn(n)?String(n):n)}function wa(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Cc(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=wl(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function Ar(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const ba=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[ba]||(e[ba]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Ar(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const _a=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(_a.test(e)){t={};let r;for(;r=e.match(_a);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):zn(e.slice(2)),t]}let wo=0;const xf=Promise.resolve(),Cf=()=>wo||(xf.then(()=>wo=0),wo=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;sn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(De(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const ka=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,If=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?gf(e,r,i):t==="style"?bf(e,n,r):Vs(t)?ii(t)||Tf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rf(e,t,r,i))?(wa(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ya(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!bt(r))?wa(e,Zt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),ya(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ka(t)&&Ve(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 s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ka(t)&&bt(n)?!1:t in e}const Ta=e=>{const t=e.props["onUpdate:modelValue"]||!1;return De(t)?n=>Es(t,n):t};function $f(e){e.target.composing=!0}function Sa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bo=Symbol("_assign");function xa(e,t,n){return t&&(e=e.trim()),n&&(e=ci(e)),e}const Pn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[bo]=Ta(s);const o=r||s.props&&s.props.type==="number";Ar(e,t?"change":"input",i=>{i.target.composing||e[bo](xa(e.value,n,o))}),(n||o)&&Ar(e,"change",()=>{e.value=xa(e.value,n,o)}),t||(Ar(e,"compositionstart",$f),Ar(e,"compositionend",Sa),Ar(e,"change",Sa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[bo]=Ta(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?ci(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Mf=["ctrl","shift","alt","meta"],Pf={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)=>Mf.some(n=>e[`${n}Key`]&&!t.includes(n))},ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Pf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Of={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ht=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=zn(s.key);if(t.some(i=>i===o||Of[i]===o))return e(s)}))},Nf=xt({patchProp:If},cf);let Ca;function jf(){return Ca||(Ca=Ud(Nf))}const Df=((...e)=>{const t=jf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Bf(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Lf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Lf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bf(e){return bt(e)?document.querySelector(e):e}/*!
|
|
18
|
-
* vue-router v4.6.4
|
|
19
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/const Ir=typeof document<"u";function Ic(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ff(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ic(e.default)}const rt=Object.assign;function _o(e,t){const n={};for(const r in t){const s=t[r];n[r]=on(s)?s.map(e):e(s)}return n}const is=()=>{},on=Array.isArray;function Ea(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Rc=/#/g,Hf=/&/g,Uf=/\//g,Vf=/=/g,Wf=/\?/g,$c=/\+/g,qf=/%5B/g,Kf=/%5D/g,Mc=/%5E/g,Gf=/%60/g,Pc=/%7B/g,zf=/%7C/g,Oc=/%7D/g,Yf=/%20/g;function xi(e){return e==null?"":encodeURI(""+e).replace(zf,"|").replace(qf,"[").replace(Kf,"]")}function Jf(e){return xi(e).replace(Pc,"{").replace(Oc,"}").replace(Mc,"^")}function Yo(e){return xi(e).replace($c,"%2B").replace(Yf,"+").replace(Rc,"%23").replace(Hf,"%26").replace(Gf,"`").replace(Pc,"{").replace(Oc,"}").replace(Mc,"^")}function Qf(e){return Yo(e).replace(Vf,"%3D")}function Xf(e){return xi(e).replace(Rc,"%23").replace(Wf,"%3F")}function Zf(e){return Xf(e).replace(Uf,"%2F")}function ms(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const eh=/\/$/,th=e=>e.replace(eh,"");function ko(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=oh(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ms(i)}}function nh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Aa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function rh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&jr(t.matched[r],n.matched[s])&&Nc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function jr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Nc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!sh(e[n],t[n]))return!1;return!0}function sh(e,t){return on(e)?Ia(e,t):on(t)?Ia(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ia(e,t){return on(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function oh(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Fn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Jo=(function(e){return e.pop="pop",e.push="push",e})({}),To=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ih(e){if(!e)if(Ir){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),th(e)}const ah=/^[^#]+#/;function lh(e,t){return e.replace(ah,"#")+t}function ch(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const no=()=>({left:window.scrollX,top:window.scrollY});function uh(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=ch(s,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 Ra(e,t){return(history.state?history.state.position-t:-1)+e}const Qo=new Map;function dh(e,t){Qo.set(e,t)}function fh(e){const t=Qo.get(e);return Qo.delete(e),t}function hh(e){return typeof e=="string"||e&&typeof e=="object"}function jc(e){return typeof e=="string"||typeof e=="symbol"}let _t=(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 Dc=Symbol("");_t.MATCHER_NOT_FOUND+"",_t.NAVIGATION_GUARD_REDIRECT+"",_t.NAVIGATION_ABORTED+"",_t.NAVIGATION_CANCELLED+"",_t.NAVIGATION_DUPLICATED+"";function Dr(e,t){return rt(new Error,{type:e,[Dc]:!0},t)}function Tn(e,t){return e instanceof Error&&Dc in e&&(t==null||!!(e.type&t))}const ph=["params","query","hash"];function mh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ph)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function gh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace($c," "),o=s.indexOf("="),i=ms(o<0?s:s.slice(0,o)),a=o<0?null:ms(s.slice(o+1));if(i in t){let l=t[i];on(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function $a(e){let t="";for(let n in e){const r=e[n];if(n=Qf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(on(r)?r.map(s=>s&&Yo(s)):[r&&Yo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=on(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const yh=Symbol(""),Ma=Symbol(""),ro=Symbol(""),Ci=Symbol(""),Xo=Symbol("");function zr(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Wn(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=g=>{g===!1?l(Dr(_t.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):hh(g)?l(Dr(_t.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(u);e.length<3&&(f=f.then(d)),f.catch(g=>l(g))})}function So(e,t,n,r,s=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(Ic(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Wn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Ff(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Wn(g,n,r,i,a,s)()}))}}return o}function wh(e,t){const n=[],r=[],s=[],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=>jr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>jr(d,l))||s.push(l))}return[n,r,s]}/*!
|
|
22
|
-
* vue-router v4.6.4
|
|
23
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
24
|
-
* @license MIT
|
|
25
|
-
*/let bh=()=>location.protocol+"//"+location.host;function Lc(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),Aa(a,"")}return Aa(n,e)+r+s}function _h(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const _=Lc(e,location),O=n.value,I=t.value;let F=0;if(g){if(n.value=_,t.value=g,i&&i===O){i=null;return}F=I?g.position-I.position:0}else r(_);s.forEach(z=>{z(n.value,O,{delta:F,type:Jo.pop,direction:F?F>0?To.forward:To.back:To.unknown})})};function l(){i=n.value}function d(g){s.push(g);const _=()=>{const O=s.indexOf(g);O>-1&&s.splice(O,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(rt({},g.state,{scroll:no()}),"")}}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 Pa(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?no():null}}function kh(e){const{history:t,location:n}=window,r={value:Lc(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.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:bh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(_){console.error(_),n[u?"replace":"assign"](g)}}function i(l,d){o(l,rt({},t.state,Pa(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=rt({},s.value,t.state,{forward:l,scroll:no()});o(u.current,u,!0),o(l,rt({},Pa(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Th(e){e=ih(e);const t=kh(e),n=_h(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=rt({location:"",base:e,go:r,createHref:lh.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Sh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Th(e)}let fr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var St=(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})(St||{});const xh={type:fr.Static,value:""},Ch=/[a-zA-Z0-9_]/;function Eh(e){if(!e)return[[]];if(e==="/")return[[xh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=St.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===St.Static?o.push({type:fr.Static,value:d}):n===St.Param||n===St.ParamRegExp||n===St.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:fr.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!==St.ParamRegExp){r=n,n=St.EscapeNext;continue}switch(n){case St.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=St.Param):g();break;case St.EscapeNext:g(),n=r;break;case St.Param:l==="("?n=St.ParamRegExp:Ch.test(l)?g():(f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case St.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=St.ParamRegExpEnd:u+=l;break;case St.ParamRegExpEnd:f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===St.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Oa="[^/]+?",Ah={sensitive:!1,strict:!1,start:!0,end:!0};var Bt=(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})(Bt||{});const Ih=/[.+*?^${}()[\]/\\]/g;function Rh(e,t){const n=rt({},Ah,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Bt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let _=Bt.Segment+(n.sensitive?Bt.BonusCaseSensitive:0);if(g.type===fr.Static)f||(s+="/"),s+=g.value.replace(Ih,"\\$&"),_+=Bt.Static;else if(g.type===fr.Param){const{value:O,repeatable:I,optional:F,regexp:z}=g;o.push({name:O,repeatable:I,optional:F});const j=z||Oa;if(j!==Oa){_+=Bt.BonusCustomRegExp;try{`${j}`}catch(D){throw new Error(`Invalid custom RegExp for param "${O}" (${j}): `+D.message)}}let U=I?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;f||(U=F&&d.length<2?`(?:/${U})`:"/"+U),F&&(U+="?"),s+=U,_+=Bt.Dynamic,F&&(_+=Bt.BonusOptional),I&&(_+=Bt.BonusRepeatable),j===".*"&&(_+=Bt.BonusWildcard)}u.push(_)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Bt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,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]||"",O=o[g-1];f[O.name]=_&&O.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===fr.Static)u+=_.value;else if(_.type===fr.Param){const{value:O,repeatable:I,optional:F}=_,z=O in d?d[O]:"";if(on(z)&&!I)throw new Error(`Provided param "${O}" is an array but it is not repeatable (* or + modifiers)`);const j=on(z)?z.join("/"):z;if(!j)if(F)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${O}"`);u+=j}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function $h(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Bt.Static+Bt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Bt.Static+Bt.Segment?1:-1:0}function Bc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=$h(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Na(r))return 1;if(Na(s))return-1}return s.length-r.length}function Na(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Mh={strict:!1,end:!0,sensitive:!1};function Ph(e,t,n){const r=Rh(Eh(e.path),n),s=rt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Oh(e,t){const n=[],r=new Map;t=Ea(Mh,t);function s(f){return r.get(f)}function o(f,g,_){const O=!_,I=Da(f);I.aliasOf=_&&_.record;const F=Ea(t,f),z=[I];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of D)z.push(Da(rt({},I,{components:_?_.record.components:I.components,path:ae,aliasOf:_?_.record:I})))}let j,U;for(const D of z){const{path:ae}=D;if(g&&ae[0]!=="/"){const ue=g.record.path,fe=ue[ue.length-1]==="/"?"":"/";D.path=g.record.path+(ae&&fe+ae)}if(j=Ph(D,g,F),_?_.alias.push(j):(U=U||j,U!==j&&U.alias.push(j),O&&f.name&&!La(j)&&i(f.name)),Fc(j)&&l(j),I.children){const ue=I.children;for(let fe=0;fe<ue.length;fe++)o(ue[fe],j,_&&_.children[fe])}_=_||j}return U?()=>{i(U)}:is}function i(f){if(jc(f)){const g=r.get(f);g&&(r.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&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Dh(f,n);n.splice(g,0,f),f.record.name&&!La(f)&&r.set(f.record.name,f)}function d(f,g){let _,O={},I,F;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw Dr(_t.MATCHER_NOT_FOUND,{location:f});F=_.record.name,O=rt(ja(g.params,_.keys.filter(U=>!U.optional).concat(_.parent?_.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&ja(f.params,_.keys.map(U=>U.name))),I=_.stringify(O)}else if(f.path!=null)I=f.path,_=n.find(U=>U.re.test(I)),_&&(O=_.parse(I),F=_.record.name);else{if(_=g.name?r.get(g.name):n.find(U=>U.re.test(g.path)),!_)throw Dr(_t.MATCHER_NOT_FOUND,{location:f,currentLocation:g});F=_.record.name,O=rt({},g.params,f.params),I=_.stringify(O)}const z=[];let j=_;for(;j;)z.unshift(j.record),j=j.parent;return{name:F,path:I,params:O,matched:z,meta:jh(z)}}e.forEach(f=>o(f));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function ja(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Da(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Nh(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 Nh(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function La(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jh(e){return e.reduce((t,n)=>rt(t,n.meta),{})}function Dh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Bc(e,t[o])<0?r=o:n=o+1}const s=Lh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Lh(e){let t=e;for(;t=t.parent;)if(Fc(t)&&Bc(e,t)===0)return t}function Fc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ba(e){const t=tn(ro),n=tn(Ci),r=ce(()=>{const l=je(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(jr.bind(null,u));if(g>-1)return g;const _=Fa(l[d-2]);return d>1&&Fa(u)===_&&f[f.length-1].path!==_?f.findIndex(jr.bind(null,l[d-2])):g}),o=ce(()=>s.value>-1&&Vh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Nc(n.params,r.value.params));function a(l={}){if(Uh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(is);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Bh(e){return e.length===1?e[0]:e}const Fh=Et({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:Ba,setup(e,{slots:t}){const n=zs(Ba(e)),{options:r}=tn(ro),s=ce(()=>({[Ha(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ha(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Bh(t.default(n));return e.custom?o:Si("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Hh=Fh;function Uh(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 Vh(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!on(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Fa(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ha=(e,t,n)=>e??t??n,Wh=Et({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=tn(Xo),s=ce(()=>e.route||r.value),o=tn(Ma,0),i=ce(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);As(Ma,ce(()=>i.value+1)),As(yh,a),As(Xo,s);const l=P();return ht(()=>[l.value,a.value,e.name],([d,u,f],[g,_,O])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!jr(u,_)||!g)&&(u.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return Ua(n.default,{Component:g,route:d});const _=f.props[u],O=_?_===!0?d.params:typeof _=="function"?_(d):_:null,F=Si(g,rt({},O,t,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Ua(n.default,{Component:F,route:d})||F}}});function Ua(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const qh=Wh;function Kh(e){const t=Oh(e.routes,e),n=e.parseQuery||gh,r=e.stringifyQuery||$a,s=e.history,o=zr(),i=zr(),a=zr(),l=Wu(Fn);let d=Fn;Ir&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=_o.bind(null,E=>""+E),f=_o.bind(null,Zf),g=_o.bind(null,ms);function _(E,ee){let Y,ve;return jc(E)?(Y=t.getRecordMatcher(E),ve=ee):ve=E,t.addRoute(ve,Y)}function O(E){const ee=t.getRecordMatcher(E);ee&&t.removeRoute(ee)}function I(){return t.getRoutes().map(E=>E.record)}function F(E){return!!t.getRecordMatcher(E)}function z(E,ee){if(ee=rt({},ee||l.value),typeof E=="string"){const x=ko(n,E,ee.path),N=t.resolve({path:x.path},ee),B=s.createHref(x.fullPath);return rt(x,N,{params:g(N.params),hash:ms(x.hash),redirectedFrom:void 0,href:B})}let Y;if(E.path!=null)Y=rt({},E,{path:ko(n,E.path,ee.path).path});else{const x=rt({},E.params);for(const N in x)x[N]==null&&delete x[N];Y=rt({},E,{params:f(x)}),ee.params=f(ee.params)}const ve=t.resolve(Y,ee),Oe=E.hash||"";ve.params=u(g(ve.params));const p=nh(r,rt({},E,{hash:Jf(Oe),path:ve.path})),y=s.createHref(p);return rt({fullPath:p,hash:Oe,query:r===$a?vh(E.query):E.query||{}},ve,{redirectedFrom:void 0,href:y})}function j(E){return typeof E=="string"?ko(n,E,l.value.path):rt({},E)}function U(E,ee){if(d!==E)return Dr(_t.NAVIGATION_CANCELLED,{from:ee,to:E})}function D(E){return fe(E)}function ae(E){return D(rt(j(E),{replace:!0}))}function ue(E,ee){const Y=E.matched[E.matched.length-1];if(Y&&Y.redirect){const{redirect:ve}=Y;let Oe=typeof ve=="function"?ve(E,ee):ve;return typeof Oe=="string"&&(Oe=Oe.includes("?")||Oe.includes("#")?Oe=j(Oe):{path:Oe},Oe.params={}),rt({query:E.query,hash:E.hash,params:Oe.path!=null?{}:E.params},Oe)}}function fe(E,ee){const Y=d=z(E),ve=l.value,Oe=E.state,p=E.force,y=E.replace===!0,x=ue(Y,ve);if(x)return fe(rt(j(x),{state:typeof x=="object"?rt({},Oe,x.state):Oe,force:p,replace:y}),ee||Y);const N=Y;N.redirectedFrom=ee;let B;return!p&&rh(r,ve,Y)&&(B=Dr(_t.NAVIGATION_DUPLICATED,{to:N,from:ve}),lt(ve,ve,!0,!1)),(B?Promise.resolve(B):X(N,ve)).catch(L=>Tn(L)?Tn(L,_t.NAVIGATION_GUARD_REDIRECT)?L:Qe(L):Pe(L,N,ve)).then(L=>{if(L){if(Tn(L,_t.NAVIGATION_GUARD_REDIRECT))return fe(rt({replace:y},j(L.to),{state:typeof L.to=="object"?rt({},Oe,L.to.state):Oe,force:p}),ee||N)}else L=re(N,ve,!0,y,Oe);return ge(N,ve,L),L})}function ke(E,ee){const Y=U(E,ee);return Y?Promise.reject(Y):Promise.resolve()}function se(E){const ee=pe.values().next().value;return ee&&typeof ee.runWithContext=="function"?ee.runWithContext(E):E()}function X(E,ee){let Y;const[ve,Oe,p]=wh(E,ee);Y=So(ve.reverse(),"beforeRouteLeave",E,ee);for(const x of ve)x.leaveGuards.forEach(N=>{Y.push(Wn(N,E,ee))});const y=ke.bind(null,E,ee);return Y.push(y),Te(Y).then(()=>{Y=[];for(const x of o.list())Y.push(Wn(x,E,ee));return Y.push(y),Te(Y)}).then(()=>{Y=So(Oe,"beforeRouteUpdate",E,ee);for(const x of Oe)x.updateGuards.forEach(N=>{Y.push(Wn(N,E,ee))});return Y.push(y),Te(Y)}).then(()=>{Y=[];for(const x of p)if(x.beforeEnter)if(on(x.beforeEnter))for(const N of x.beforeEnter)Y.push(Wn(N,E,ee));else Y.push(Wn(x.beforeEnter,E,ee));return Y.push(y),Te(Y)}).then(()=>(E.matched.forEach(x=>x.enterCallbacks={}),Y=So(p,"beforeRouteEnter",E,ee,se),Y.push(y),Te(Y))).then(()=>{Y=[];for(const x of i.list())Y.push(Wn(x,E,ee));return Y.push(y),Te(Y)}).catch(x=>Tn(x,_t.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function ge(E,ee,Y){a.list().forEach(ve=>se(()=>ve(E,ee,Y)))}function re(E,ee,Y,ve,Oe){const p=U(E,ee);if(p)return p;const y=ee===Fn,x=Ir?history.state:{};Y&&(ve||y?s.replace(E.fullPath,rt({scroll:y&&x&&x.scroll},Oe)):s.push(E.fullPath,Oe)),l.value=E,lt(E,ee,Y,y),Qe()}let Be;function He(){Be||(Be=s.listen((E,ee,Y)=>{if(!xe.listening)return;const ve=z(E),Oe=ue(ve,xe.currentRoute.value);if(Oe){fe(rt(Oe,{replace:!0,force:!0}),ve).catch(is);return}d=ve;const p=l.value;Ir&&dh(Ra(p.fullPath,Y.delta),no()),X(ve,p).catch(y=>Tn(y,_t.NAVIGATION_ABORTED|_t.NAVIGATION_CANCELLED)?y:Tn(y,_t.NAVIGATION_GUARD_REDIRECT)?(fe(rt(j(y.to),{force:!0}),ve).then(x=>{Tn(x,_t.NAVIGATION_ABORTED|_t.NAVIGATION_DUPLICATED)&&!Y.delta&&Y.type===Jo.pop&&s.go(-1,!1)}).catch(is),Promise.reject()):(Y.delta&&s.go(-Y.delta,!1),Pe(y,ve,p))).then(y=>{y=y||re(ve,p,!1),y&&(Y.delta&&!Tn(y,_t.NAVIGATION_CANCELLED)?s.go(-Y.delta,!1):Y.type===Jo.pop&&Tn(y,_t.NAVIGATION_ABORTED|_t.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ge(ve,p,y)}).catch(is)}))}let Ge=zr(),Ie=zr(),be;function Pe(E,ee,Y){Qe(E);const ve=Ie.list();return ve.length?ve.forEach(Oe=>Oe(E,ee,Y)):console.error(E),Promise.reject(E)}function vt(){return be&&l.value!==Fn?Promise.resolve():new Promise((E,ee)=>{Ge.add([E,ee])})}function Qe(E){return be||(be=!E,He(),Ge.list().forEach(([ee,Y])=>E?Y(E):ee()),Ge.reset()),E}function lt(E,ee,Y,ve){const{scrollBehavior:Oe}=e;if(!Ir||!Oe)return Promise.resolve();const p=!Y&&fh(Ra(E.fullPath,0))||(ve||!Y)&&history.state&&history.state.scroll||null;return zt().then(()=>Oe(E,ee,p)).then(y=>y&&uh(y)).catch(y=>Pe(y,E,ee))}const Ye=E=>s.go(E);let et;const pe=new Set,xe={currentRoute:l,listening:!0,addRoute:_,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:I,resolve:z,options:e,push:D,replace:ae,go:Ye,back:()=>Ye(-1),forward:()=>Ye(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ie.add,isReady:vt,install(E){E.component("RouterLink",Hh),E.component("RouterView",qh),E.config.globalProperties.$router=xe,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),Ir&&!et&&l.value===Fn&&(et=!0,D(s.location).catch(ve=>{}));const ee={};for(const ve in Fn)Object.defineProperty(ee,ve,{get:()=>l.value[ve],enumerable:!0});E.provide(ro,xe),E.provide(Ci,jl(ee)),E.provide(Xo,l);const Y=E.unmount;pe.add(E),E.unmount=function(){pe.delete(E),pe.size<1&&(d=Fn,Be&&Be(),Be=null,l.value=Fn,et=!1,be=!1),Y()}}};function Te(E){return E.reduce((ee,Y)=>ee.then(()=>se(Y)),Promise.resolve())}return xe}function Gh(){return tn(ro)}function zh(e){return tn(Ci)}const Va=768;function Hc(){const e=P(typeof window<"u"?window.innerWidth<Va:!1);let t=null;function n(r){e.value=r.matches}return Nn(()=>{t=window.matchMedia(`(max-width: ${Va-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Xs(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Yh={key:0,class:"desktop-sidebar"},Jh={class:"desktop-main"},Wa="codex-web-local.sidebar-width.v1",Qh=260,Xh=620,qa=320,Zh=Et({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Hc();function r(d){return Math.min(Xh,Math.max(Qh,d))}function s(){if(typeof window>"u")return qa;const d=window.localStorage.getItem(Wa),u=Number(d);return Number.isFinite(u)?r(u):qa}const o=P(s()),i=ce(()=>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(Wa,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=O=>{const I=O.clientX-u;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)}return(d,u)=>(w(),S("div",{class:at(["desktop-layout",{"is-mobile":je(n)}]),style:mr(i.value)},[je(n)?(w(),ft(js,{key:0,to:"body"},[Se(Ac,{name:"drawer"},{default:it(()=>[e.isSidebarCollapsed?le("",!0):(w(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=ze(()=>{},["stop"]))},[mn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),je(n)?le("",!0):(w(),S(Ue,{key:1},[e.isSidebarCollapsed?le("",!0):(w(),S("aside",Yh,[mn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(w(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Jh,[mn(d.$slots,"content",{},void 0)])],6))}}),Je=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ep=Je(Zh,[["__scopeId","data-v-df29c633"]]),tp={},np={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rp(e,t){return w(),S("svg",np,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const so=Je(tp,[["render",rp]]),sp={},op={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ip(e,t){return w(),S("svg",op,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Uc=Je(sp,[["render",ip]]),ap={},lp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cp(e,t){return w(),S("svg",lp,[...t[0]||(t[0]=[m("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 Yr=Je(ap,[["render",cp]]),up={},dp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function fp(e,t){return w(),S("svg",dp,[...t[0]||(t[0]=[m("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 Hs=Je(up,[["render",fp]]),hp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mp(e,t){return w(),S("svg",pp,[...t[0]||(t[0]=[m("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 Vc=Je(hp,[["render",mp]]),gp={},vp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yp(e,t){return w(),S("svg",vp,[...t[0]||(t[0]=[m("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 wp=Je(gp,[["render",yp]]),bp={},_p={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function kp(e,t){return w(),S("svg",_p,[...t[0]||(t[0]=[m("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 Ms=Je(bp,[["render",kp]]),Tp={},Sp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xp(e,t){return w(),S("svg",Sp,[...t[0]||(t[0]=[m("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 xo=Je(Tp,[["render",xp]]),Cp={key:0,class:"sidebar-menu-row-left"},Ep={class:"sidebar-menu-row-main"},Ap={key:1,class:"sidebar-menu-row-right"},Ip={key:0,class:"sidebar-menu-row-right-default"},Rp={key:1,class:"sidebar-menu-row-right-hover"},$p=Et({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(w(),ft(Uo(t.as),kc({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:it(()=>[r.value?(w(),S("span",Cp,[mn(a.$slots,"left",{},void 0,!0)])):le("",!0),m("span",Ep,[mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),S("span",Ap,[s.value?(w(),S("span",Ip,[mn(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(w(),S("span",Rp,[mn(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),lr=Je($p,[["__scopeId","data-v-daeca4df"]]),Mp={class:"thread-tree-root"},Pp={key:0,class:"pinned-section"},Op={class:"thread-list"},Np={class:"thread-left-stack"},jp=["data-state"],Dp=["onClick"],Lp=["onClick"],Bp={class:"thread-row-title-wrap"},Fp={class:"thread-row-title"},Hp={class:"thread-row-time"},Up=["onClick"],Vp=["onClick"],Wp=["onClick"],qp=["aria-expanded"],Kp=["data-active"],Gp={key:0},zp=["data-active"],Yp={key:0},Jp={key:1,class:"thread-tree-no-results"},Qp={key:2,class:"thread-tree-loading"},Xp={key:3,class:"thread-list thread-list-global"},Zp={class:"thread-left-stack"},em=["data-state"],tm=["onClick"],nm=["onClick"],rm={class:"thread-row-title-wrap"},sm={class:"thread-row-title"},om={class:"thread-row-time"},im=["onClick"],am=["onClick"],lm=["onClick"],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=["onClick"],Rm=["onClick"],$m=["onClick"],Mm=["onClick"],Pm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Om=["onKeydown"],Nm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},jm={class:"rename-thread-subtitle"},Dm=4,Ka=6,Ga="codex-web-local.thread-view-mode.v1",za="codex-web-local.collapsed-projects.v1",Lm=Et({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=P({}),o=P({}),i=P([]),a=P(""),l=P(""),d=P("actions"),u=P(""),f=P(!1),g=P(""),_=P(""),O=P(null),I=P(!1),F=P(""),z=P(""),j=P(null),U=P(null),D=P(null);let ae=null,ue=null;const fe=P(""),ke=P({}),se=new Map,X=new Map,ge=new Map,re=new WeakMap,Be=P(null),He=P(!1),Ge=P(Pe()),Ie=typeof window<"u"?new ResizeObserver(k=>{for(const C of k){const R=C.target,q=re.get(R);q&&Yn(q,R)}}):null;function be(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(za);if(!k)return{};const C=JSON.parse(k);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function Pe(){return typeof window>"u"?"project":window.localStorage.getItem(Ga)==="chronological"?"chronological":"project"}o.value=be(),ht(o,k=>{typeof window>"u"||window.localStorage.setItem(za,JSON.stringify(k))},{deep:!0}),ht(Ge,k=>{typeof window>"u"||window.localStorage.setItem(Ga,k)});const vt=ce(()=>n.searchQuery.trim().toLowerCase()),Qe=ce(()=>vt.value.length>0);function lt(k){if(!Qe.value)return!0;const C=vt.value;return k.title.toLowerCase().includes(C)||k.preview.toLowerCase().includes(C)}const Ye=ce(()=>Qe.value?n.groups.map(k=>({...k,threads:k.threads.filter(lt)})).filter(k=>k.threads.length>0):n.groups),et=ce(()=>Ge.value==="chronological"),pe=ce(()=>{const k=Ye.value,C=[];for(const R of k)for(const q of R.threads)p(q.id)||C.push(q);return C.sort((R,q)=>{const Fe=new Date(R.updatedAtIso||R.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-Fe})}),xe=ce(()=>{const k=new Map;for(const C of n.groups)for(const R of C.threads)k.set(R.id,R);return k}),Te=ce(()=>i.value.map(k=>xe.value.get(k)??null).filter(k=>k!==null).filter(lt)),E=ce(()=>{const k=D.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),R=C>k.fromIndex?C-1:C,q=Math.max(0,Math.min(R,n.groups.length-1));return q===k.fromIndex?null:q}),ee=ce(()=>{const C=(Qe.value?Ye.value:n.groups).map(Tt=>Tt.projectName),R=D.value,q=E.value;if(!R||q===null)return C;const Fe=[...C],[kt]=Fe.splice(R.fromIndex,1);return kt?(Fe.splice(q,0,kt),Fe):C}),Y=ce(()=>{const k={};let C=0;for(const R of ee.value)k[R]=C,C+=ct(R);return k}),ve=ce(()=>{let k=0;for(const C of ee.value)k+=ct(C);return{height:`${Math.max(0,k)}px`}});function Oe(k){const C=new Date(k).getTime();if(Number.isNaN(C))return"n/a";const R=Math.abs(Date.now()-C);if(R<6e4)return"now";const q=Math.floor(R/6e4);if(q<60)return`${q}m`;const Fe=Math.floor(q/60);return Fe<24?`${Fe}h`:`${Math.floor(Fe/24)}d`}function p(k){return i.value.includes(k)}function y(k){if(p(k)){i.value=i.value.filter(C=>C!==k);return}i.value=[k,...i.value]}function x(k){r("select",k)}function N(k){return`start new thread ${qe(k)}`}function B(k){r("start-new-thread",k)}function L(k){l.value===k&&ne()}function te(k){return l.value===k}function ne(){l.value=""}function Z(k){if(l.value===k){ne();return}l.value=k}function V(k,C){g.value=k,_.value=C,f.value=!0,ne(),zt(()=>{var R,q;(R=O.value)==null||R.focus(),(q=O.value)==null||q.select()})}function ye(){f.value=!1,g.value="",_.value=""}function ie(){const k=g.value,C=_.value.trim();!k||!C||(r("rename-thread",{threadId:k,title:C}),ye())}function de(k,C){F.value=k,z.value=C,I.value=!0,ne()}function _e(){I.value=!1,F.value="",z.value=""}function Le(){const k=F.value;k&&(i.value=i.value.filter(C=>C!==k),r("archive",k),_e())}function qe(k){return n.projectDisplayNameById[k]??k}function Ae(k){return a.value===k}function Xe(){a.value="",d.value="actions",u.value=""}function pt(){He.value=!He.value}function H(k){Ge.value=k,He.value=!1}function W(k){if(a.value===k){Xe();return}a.value=k,d.value="actions",u.value=qe(k)}function J(k){a.value=k,d.value="rename",u.value=qe(k)}function Ke(k){r("rename-project",{projectName:k,displayName:u.value})}function b(k){r("remove-project",k),Xe()}function A(k,C){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const R=n.groups.findIndex(kt=>kt.projectName===C);if(R<0)return;const q=k.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(R+q,n.groups.length-1));Fe!==R&&(k.preventDefault(),r("reorder-project",{projectName:C,toIndex:Fe}))}function $(k){return s.value[k]===!0}function Q(k){return o.value[k]===!0}function Ce(k){s.value={...s.value,[k]:!$(k)}}function Ee(k){if(fe.value===k){fe.value="";return}o.value={...o.value,[k]:!Q(k)}}function ct(k){const C=ke.value[k]??0,R=D.value,Fe=((R==null?void 0:R.projectName)===k?R.groupHeight:null)??C,kt=Q(k)?0:Ka;return Math.max(0,Fe+kt)}function tt(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){X.set(k,R);return}X.delete(k)}function ut(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){ge.set(k,R);return}ge.delete(k)}function dt(k){const C=a.value;if(!C)return!1;const R=X.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Fe=k.target;return Fe instanceof Node?R.contains(Fe):!1}function Ne(k){const C=l.value;if(!C)return!1;const R=ge.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Fe=k.target;return Fe instanceof Node?R.contains(Fe):!1}function $e(k){if(He.value){const C=Be.value,R=typeof k.composedPath=="function"?k.composedPath():[];!!C&&(R.includes(C)||k.target instanceof Node&&C.contains(k.target))||(He.value=!1)}a.value&&(dt(k)||Xe(),l.value&&(Ne(k)||ne()))}function vn(k){a.value&&!dt(k)&&Xe(),l.value&&!Ne(k)&&ne()}function Ut(){He.value&&(He.value=!1),a.value&&Xe(),l.value&&ne()}function Br(){window.addEventListener("pointerdown",$e,{capture:!0}),window.addEventListener("focusin",vn,{capture:!0}),window.addEventListener("blur",Ut)}function gr(){window.removeEventListener("pointerdown",$e,{capture:!0}),window.removeEventListener("focusin",vn,{capture:!0}),window.removeEventListener("blur",Ut)}function Yn(k,C){const R=C.getBoundingClientRect().height;if(!Number.isFinite(R)||R<=0)return;const q=ke.value[k];q!==void 0&&Math.abs(q-R)<.5||(ke.value={...ke.value,[k]:R})}function vr(k,C){const R=se.get(k);R&&R!==C&&Ie&&Ie.unobserve(R);const q=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(q){se.set(k,q),re.set(q,k),Yn(k,q),Ie==null||Ie.observe(q);return}R&&(Ie==null||Ie.unobserve(R)),se.delete(k)}function Jn(k,C){if(k.button!==0||U.value||D.value)return;const R=n.groups.findIndex(Tt=>Tt.projectName===C),q=se.get(C);if(R<0||!q)return;const Fe=q.getBoundingClientRect(),kt=Q(C)?0:Ka;U.value={projectName:C,fromIndex:R,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+kt},k.preventDefault(),qt()}function qt(){window.addEventListener("mousemove",Xn),window.addEventListener("mouseup",yr),window.addEventListener("keydown",wr)}function Qn(){window.removeEventListener("mousemove",Xn),window.removeEventListener("mouseup",yr),window.removeEventListener("keydown",wr)}function Xn(k){ae={clientX:k.clientX,clientY:k.clientY},Fr()}function yr(k){yn({clientX:k.clientX,clientY:k.clientY});const C=D.value;if(C&&E.value!==null){const R=n.groups.findIndex(q=>q.projectName===C.projectName);if(R>=0){const q=E.value;q!==R&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}an()}function wr(k){k.key==="Escape"&&(!U.value&&!D.value||(k.preventDefault(),an()))}function an(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,U.value=null,D.value=null,fe.value="",Qn()}function Fr(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const k=ae;ae=null,yn(k)}))}function yn(k){const C=U.value;if(!D.value&&C){const R=k.clientX-C.startClientX,q=k.clientY-C.startClientY;if(Math.hypot(R,q)<Dm)return;Xe(),fe.value=C.projectName,D.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:k.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}D.value&&br(k)}function br(k){const C=D.value;if(!C)return;if(C.ghostTop=k.clientY-C.pointerOffsetY,!Hr(k)){C.dropTargetIndexFull=null;return}const R=k.clientY,q=j.value;if(!q){C.dropTargetIndexFull=null;return}const Fe=q.getBoundingClientRect(),kt=new Map(n.groups.map((Yt,Dn)=>[Yt.projectName,Dn])),Tt=n.groups.map(Yt=>Yt.projectName).filter(Yt=>Yt!==C.projectName);let cn=0,er=n.groups.length;for(const Yt of Tt){const Dn=kt.get(Yt);if(Dn===void 0)continue;const tr=ct(Yt),Wr=Fe.top+cn+tr/2;if(R<Wr){er=Dn;break}cn+=tr}C.dropTargetIndexFull=er}function Hr(k){const C=j.value;if(!C)return!1;const R=C.getBoundingClientRect(),q=k.clientX>=R.left&&k.clientX<=R.right,Fe=k.clientY>=R.top-32&&k.clientY<=R.bottom+32;return q&&Fe}function Zn(k){var C;return((C=D.value)==null?void 0:C.projectName)===k}function _r(k){const C=D.value,R=Y.value[k]??0,q=a.value===k;return!C||C.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${R}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function ln(k){return k.threads.filter(C=>!p(C.id))}function Ur(k){if(Qe.value)return ln(k);if(Q(k.projectName))return[];const C=ln(k);return $(k.projectName)?C:C.slice(0,10)}function kr(k){return Qe.value?!1:!Q(k.projectName)&&ln(k).length>10}function Tr(k){return ln(k).length>0}function wn(k){return k.inProgress?"working":k.unread?"unread":"idle"}ht(()=>n.groups.map(k=>k.projectName),k=>{var Fe,kt;const C=((Fe=D.value)==null?void 0:Fe.projectName)??((kt=U.value)==null?void 0:kt.projectName)??"";C&&!n.groups.some(Tt=>Tt.projectName===C)&&an();const R=new Set(k),q=Object.fromEntries(Object.entries(ke.value).filter(([Tt])=>R.has(Tt)));Object.keys(q).length!==Object.keys(ke.value).length&&(ke.value=q)});const Vr=ce(()=>He.value||a.value!=="");return ht(Vr,k=>{if(k){Br();return}gr()}),jn(()=>{for(const k of se.values())Ie==null||Ie.unobserve(k);se.clear(),X.clear(),gr(),an()}),(k,C)=>(w(),S("section",Mp,[Te.value.length>0?(w(),S("section",Pp,[m("ul",Op,[(w(!0),S(Ue,null,wt(Te.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Se(lr,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":p(R.id),onMouseleave:q=>L(R.id)},{left:it(()=>[m("span",Np,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":wn(R)},null,8,jp)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>y(R.id)},[Se(xo,{class:"thread-icon"})],8,Dp)])]),right:it(()=>[m("span",Hp,he(Oe(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:q=>ut(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(q=>Z(R.id),["stop"])},[Se(Yr,{class:"thread-icon"})],8,Up),te(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>V(R.id,R.title)}," Rename thread ",8,Vp),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>de(R.id,R.title)}," Delete thread ",8,Wp)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>x(R.id)},[m("span",Bp,[m("span",Fp,he(R.title),1),R.hasWorktree?(w(),ft(Ms,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Lp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Se(lr,{as:"header",class:"thread-tree-header-row"},{right:it(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Be,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":He.value,"aria-label":"Organize threads",title:"Organize threads",onClick:pt},[Se(Yr,{class:"thread-icon"})],8,qp),He.value?(w(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=ze(()=>{},["stop"]))},[C[11]||(C[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Ge.value==="project",type:"button",onClick:C[1]||(C[1]=R=>H("project"))},[C[9]||(C[9]=m("span",null,"By project",-1)),Ge.value==="project"?(w(),S("span",Gp,"✓")):le("",!0)],8,Kp),m("button",{class:"organize-menu-item","data-active":Ge.value==="chronological",type:"button",onClick:C[2]||(C[2]=R=>H("chronological"))},[C[10]||(C[10]=m("span",null,"Chronological list",-1)),Ge.value==="chronological"?(w(),S("span",Yp,"✓")):le("",!0)],8,zp)])):le("",!0)],512)]),default:it(()=>[C[12]||(C[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Qe.value&&Ye.value.length===0?(w(),S("p",Jp,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),S("p",Qp,"Loading threads...")):et.value?(w(),S("ul",Xp,[(w(!0),S(Ue,null,wt(pe.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Se(lr,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":p(R.id),onMouseleave:q=>L(R.id)},{left:it(()=>[m("span",Zp,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":wn(R)},null,8,em)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>y(R.id)},[Se(xo,{class:"thread-icon"})],8,tm)])]),right:it(()=>[m("span",om,he(Oe(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:q=>ut(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(q=>Z(R.id),["stop"])},[Se(Yr,{class:"thread-icon"})],8,im),te(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>V(R.id,R.title)}," Rename thread ",8,am),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>de(R.id,R.title)}," Delete thread ",8,lm)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>x(R.id)},[m("span",rm,[m("span",sm,he(R.title),1),R.hasWorktree?(w(),ft(Ms,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,nm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),S("div",{key:4,ref_key:"groupsContainerRef",ref:j,class:"thread-tree-groups",style:mr(ve.value)},[(w(!0),S(Ue,null,wt(Ye.value,R=>(w(),S("article",{key:R.projectName,ref_for:!0,ref:q=>vr(R.projectName,q),class:"project-group","data-project-name":R.projectName,"data-expanded":!Q(R.projectName),"data-dragging":Zn(R.projectName),style:mr(_r(R.projectName))},[Se(lr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>Ee(R.projectName),onKeydown:[q=>A(q,R.projectName),Ht(ze(q=>Ee(R.projectName),["prevent"]),["enter"]),Ht(ze(q=>Ee(R.projectName),["prevent"]),["space"])]},{left:it(()=>[m("span",um,[m("span",dm,[Q(R.projectName)?(w(),ft(Vc,{key:0,class:"thread-icon"})):(w(),ft(wp,{key:1,class:"thread-icon"}))]),m("span",fm,[Q(R.projectName)?(w(),ft(Uc,{key:0,class:"thread-icon"})):(w(),ft(so,{key:1,class:"thread-icon"}))])])]),right:it(()=>[m("div",mm,[m("div",{ref_for:!0,ref:q=>tt(R.projectName,q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ze(q=>W(R.projectName),["stop"])},[Se(Yr,{class:"thread-icon"})],8,gm),Ae(R.projectName)?(w(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=ze(()=>{},["stop"]))},[d.value==="actions"?(w(),S(Ue,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:q=>J(R.projectName)}," Edit name ",8,vm),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>b(R.projectName)}," Remove ",8,ym)],64)):(w(),S(Ue,{key:1},[C[13]||(C[13]=m("label",{class:"project-menu-label"},"Project name",-1)),Mn(m("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>Ke(R.projectName)},null,40,wm),[[Pn,u.value]])],64))])):le("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":N(R.projectName),title:N(R.projectName),onClick:ze(q=>B(R.projectName),["stop"])},[Se(Hs,{class:"thread-icon"})],8,bm)])]),default:it(()=>[m("span",{class:"project-main-button","data-dragging-handle":Zn(R.projectName),onMousedown:ze(q=>Jn(q,R.projectName),["left"])},[m("span",pm,he(qe(R.projectName)),1)],40,hm)]),_:2},1032,["onClick","onKeydown"]),Tr(R)?(w(),S("ul",_m,[(w(!0),S(Ue,null,wt(Ur(R),q=>(w(),S("li",{key:q.id,class:"thread-row-item"},[Se(lr,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":p(q.id),onMouseleave:Fe=>L(q.id)},{left:it(()=>[m("span",km,[q.inProgress||q.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":wn(q)},null,8,Tm)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>y(q.id)},[Se(xo,{class:"thread-icon"})],8,Sm)])]),right:it(()=>[m("span",Am,he(Oe(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:Fe=>ut(q.id,Fe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(Fe=>Z(q.id),["stop"])},[Se(Yr,{class:"thread-icon"})],8,Im),te(q.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Fe=>V(q.id,q.title)}," Rename thread ",8,Rm),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>de(q.id,q.title)}," Delete thread ",8,$m)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Fe=>x(q.id)},[m("span",Cm,[m("span",Em,he(q.title),1),q.hasWorktree?(w(),ft(Ms,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,xm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ft(lr,{key:1,as:"p",class:"project-empty-row"},{left:it(()=>[...C[14]||(C[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:it(()=>[C[15]||(C[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),kr(R)?(w(),ft(lr,{key:2,class:"thread-show-more-row"},{left:it(()=>[...C[16]||(C[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:it(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:q=>Ce(R.projectName)},he($(R.projectName)?"Show less":"Show more"),9,Mm)]),_:2},1024)):le("",!0)],12,cm))),128))],4)),(w(),ft(js,{to:"body"},[f.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:ze(ye,["self"])},[m("div",Pm,[C[17]||(C[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[18]||(C[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Mn(m("input",{ref_key:"renameThreadInputRef",ref:O,"onUpdate:modelValue":C[8]||(C[8]=R=>_.value=R),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ht(ze(ie,["prevent"]),["enter"]),Ht(ze(ye,["prevent"]),["esc"])]},null,40,Om),[[Pn,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:ye},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ie},"Save")])])])):le("",!0)])),(w(),ft(js,{to:"body"},[I.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:ze(_e,["self"])},[m("div",Nm,[C[19]||(C[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",jm,' This will archive the thread "'+he(z.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:_e},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Le},"Delete")])])])):le("",!0)]))]))}}),Bm=Je(Lm,[["__scopeId","data-v-1257b57b"]]),Fm={class:"content-header"},Hm={class:"content-leading"},Um={class:"content-title"},Vm={class:"content-actions"},Wm=Et({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),S("header",Fm,[m("div",Hm,[mn(t.$slots,"leading",{},void 0)]),m("h1",Um,he(e.title),1),m("div",Vm,[mn(t.$slots,"actions",{},void 0)])]))}}),qm=Je(Wm,[["__scopeId","data-v-66ee223c"]]),Km={},Gm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zm(e,t){return w(),S("svg",Gm,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ei=Je(Km,[["render",zm]]),Ym={},Jm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qm(e,t){return w(),S("svg",Jm,[...t[0]||(t[0]=[m("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 Xm=Je(Ym,[["render",Qm]]),Zm={class:"conversation-root"},eg={key:0,class:"conversation-loading"},tg={key:1,class:"conversation-empty"},ng={class:"message-row"},rg={class:"message-stack"},sg={class:"request-card"},og={class:"request-title"},ig={class:"request-meta"},ag={key:0,class:"request-reason"},lg={key:1,class:"request-actions"},cg=["onClick"],ug=["onClick"],dg=["onClick"],fg=["onClick"],hg={key:2,class:"request-actions"},pg=["onClick"],mg=["onClick"],gg=["onClick"],vg=["onClick"],yg={key:3,class:"request-user-input"},wg={class:"request-question-title"},bg={key:0,class:"request-question-text"},_g=["value","onChange"],kg=["value"],Tg=["value","onInput"],Sg=["onClick"],xg={key:4,class:"request-actions"},Cg=["onClick"],Eg=["onClick"],Ag={key:5,class:"request-actions"},Ig=["onClick"],Rg=["onClick"],$g=["data-role","data-message-type"],Mg={key:0,class:"message-row","data-role":"system"},Pg={class:"message-stack","data-role":"system"},Og=["onClick"],Ng={class:"cmd-label"},jg={class:"cmd-status"},Dg={class:"cmd-output-inner"},Lg={class:"cmd-output"},Bg=["data-role","data-message-type"],Fg=["data-role"],Hg=["data-role"],Ug=["data-role"],Vg=["onClick"],Wg=["src"],qg={key:1,class:"message-file-attachments"},Kg=["href","title"],Gg=["data-role"],zg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Yg=["onClick"],Jg={class:"worked-separator-text"},Qg={key:0,class:"worked-details"},Xg=["onClick"],Zg={class:"cmd-label"},ev={class:"cmd-status"},tv={class:"cmd-output-inner"},nv={class:"cmd-output"},rv={key:1,class:"message-text-flow"},sv={key:0,class:"message-text"},ov={key:0},iv=["href","title"],av={key:2,class:"message-inline-code"},lv={key:1,class:"message-text"},cv=["onClick"],uv=["src","alt","onError"],dv=["onClick"],fv={key:0,class:"conversation-item conversation-item-overlay"},hv={class:"message-row"},pv={class:"message-stack"},mv={class:"live-overlay-inline","aria-live":"polite"},gv={class:"live-overlay-label"},vv={key:1,class:"live-overlay-error"},yv=["src"],wv=16,bv=Et({__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=P(new Set),r=P(new Set),s=P(new Set),o=P({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var A;return((A=b.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function d(b){var $;if((($=b.commandExecution)==null?void 0:$.status)==="inProgress")return;const A=new Set(n.value);A.has(b.id)?A.delete(b.id):A.add(b.id),n.value=A}function u(b){const A=new Set(s.value);A.has(b.id)?A.delete(b.id):A.add(b.id),s.value=A}function f(b){return s.value.has(b.id)}function g(b){const A=b.commandExecution;if(!A)return"";switch(A.status){case"inProgress":return"⟳ Running";case"completed":return A.exitCode===0?"✓ Completed":`✗ Exit ${A.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(b){var $,Q;const A=($=b.commandExecution)==null?void 0:$.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((Q=b.commandExecution)==null?void 0:Q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function O(b){const A=new Set(r.value);A.add(b),r.value=A,setTimeout(()=>{const $=new Set(r.value);$.delete(b),r.value=$},1e3)}function I(b,A){const $=[];for(let Q=A-1;Q>=0;Q--){const Ce=b[Q];if(Ce.messageType==="commandExecution")$.unshift(Ce);else if(Ce.role==="user"||Ce.messageType==="worked")break}return $}const F=e,z=t,j=P(null),U=P(null),D=P(null),ae=P(""),ue=P({}),fe=P({});let ke=0,se=0,X=0;const ge=new WeakSet,re=P(new Set);function Be(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const A=b.startsWith("/"),$=/^[A-Za-z]:[\\/]/u.test(b),Q=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),Ce=b.includes("/")||b.includes("\\");return A||$||Q||Ce}function He(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Ge(b){if(!b)return null;let A=b,$=null;const Q=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(Q)A=Q[1],$=Number(Q[2]);else{const Ce=A.match(/^(.*):(\d+)(?::\d+)?$/u);Ce&&(A=Ce[1],$=Number(Ce[2]))}return Be(A)?{path:A,line:$}:null}function Ie(b){if(!b.includes("`"))return[{kind:"text",value:b}];const A=[];let $=0,Q=0;for(;$<b.length;){if(b[$]!=="`"){$+=1;continue}let Ce=1;for(;$+Ce<b.length&&b[$+Ce]==="`";)Ce+=1;const Ee="`".repeat(Ce);let ct=$+Ce,tt=-1;for(;ct<b.length;){const dt=b.indexOf(Ee,ct);if(dt<0)break;const Ne=dt>0&&b[dt-1]==="`",$e=dt+Ce<b.length&&b[dt+Ce]==="`",vn=b.slice($+Ce,dt).includes(`
|
|
26
|
-
`);if(!Ne&&!$e&&!vn){tt=dt;break}ct=dt+1}if(tt<0){$+=Ce;continue}$>Q&&A.push({kind:"text",value:b.slice(Q,$)});const ut=b.slice($+Ce,tt);if(ut.length>0){const dt=Ge(ut);if(dt){const Ne=dt.line?`${dt.path}:${String(dt.line)}`:dt.path;A.push({kind:"file",value:ut,path:dt.path,displayPath:Ne,downloadName:He(dt.path)})}else A.push({kind:"code",value:ut})}else A.push({kind:"text",value:`${Ee}${Ee}`});$=tt+Ce,Q=$}return Q<b.length&&A.push({kind:"text",value:b.slice(Q)}),A}function be(b){const A=b.trim();if(!A)return"";if(A.startsWith("data:")||A.startsWith("blob:")||A.startsWith("http://")||A.startsWith("https://")||A.startsWith("/codex-local-image?"))return A;if(A.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(A)}`;const $=A.startsWith("/"),Q=/^[A-Za-z]:[\\/]/u.test(A);return $||Q?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function Pe(b){const A=b.trim();if(!A)return"#";const $=Ce=>Ce.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ce),Q=Ge(A);return Q!=null&&Q.path&&$(Q.path)?`/codex-local-browse${encodeURI(Q.path)}`:$(A)?`/codex-local-browse${encodeURI(A)}`:"#"}function vt(b){if(!b.includes(")return[{kind:"text",value:b}];const A=[],$=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let Q=0;for(const Ce of b.matchAll($)){const[Ee,ct,tt]=Ce;if(typeof Ce.index!="number")continue;const ut=Ce.index,dt=ut+Ee.length,Ne=be(tt.trim());Ne&&(ut>Q&&A.push({kind:"text",value:b.slice(Q,ut)}),A.push({kind:"image",url:Ne,alt:ct.trim(),markdown:Ee}),Q=dt)}return Q<b.length&&A.push({kind:"text",value:b.slice(Q)}),A.length>0?A:[{kind:"text",value:b}]}function Qe(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function lt(b){const A=new Date(b);return Number.isNaN(A.getTime())?b:A.toLocaleTimeString()}function Ye(b){const A=Qe(b.params),$=A==null?void 0:A.reason;return typeof $=="string"?$.trim():""}function et(b,A){return`${String(b)}:${A}`}function pe(b){const A=Qe(b.params),$=Array.isArray(A==null?void 0:A.questions)?A.questions:[],Q=[];for(const Ce of $){const Ee=Qe(Ce);if(!Ee)continue;const ct=typeof Ee.id=="string"?Ee.id:"";if(!ct)continue;const tt=Array.isArray(Ee.options)?Ee.options.map(ut=>Qe(ut)).map(ut=>ut==null?void 0:ut.label).filter(ut=>typeof ut=="string"&&ut.length>0):[];Q.push({id:ct,header:typeof Ee.header=="string"?Ee.header:"",question:typeof Ee.question=="string"?Ee.question:"",isOther:Ee.isOther===!0,options:tt})}return Q}function xe(b,A,$){const Q=et(b,A),Ce=ue.value[Q];return typeof Ce=="string"&&Ce.length>0?Ce:$}function Te(b,A){const $=et(b,A);return fe.value[$]??""}function E(b,A,$){const Q=$.target;if(!(Q instanceof HTMLSelectElement))return;const Ce=et(b,A);ue.value={...ue.value,[Ce]:Q.value}}function ee(b,A,$){const Q=$.target;if(!(Q instanceof HTMLInputElement))return;const Ce=et(b,A);fe.value={...fe.value,[Ce]:Q.value}}function Y(b,A){z("respondServerRequest",{id:b,result:{decision:A}})}function ve(b){const A=pe(b),$={};for(const Q of A){const Ce=xe(b.id,Q.id,Q.options[0]||""),Ee=Te(b.id,Q.id).trim(),ct=[Ce,Ee].map(tt=>tt.trim()).filter(tt=>tt.length>0);$[Q.id]={answers:ct}}z("respondServerRequest",{id:b.id,result:{answers:$}})}function Oe(b){z("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function p(b){z("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function y(b){z("respondServerRequest",{id:b,result:{}})}function x(b){z("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function N(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function B(b){N(b)&&z("rollback",{turnIndex:b.turnIndex})}function L(){const b=j.value,A=U.value;!b||!A||(b.scrollTop=b.scrollHeight,A.scrollIntoView({block:"end"}))}function te(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=wv}function ne(b){if(!F.activeThreadId)return;const A=Math.max(b.scrollHeight-b.clientHeight,0),$=A>0?Math.min(Math.max(b.scrollTop/A,0),1):1;z("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:te(b),scrollRatio:$}})}function Z(){const b=j.value;if(!b)return;const A=F.scrollState;if(!A||A.isAtBottom){V();return}const $=Math.max(b.scrollHeight-b.clientHeight,0),Q=typeof A.scrollRatio=="number"?A.scrollRatio*$:A.scrollTop;b.scrollTop=Math.min(Math.max(Q,0),$),ne(b)}function V(){const b=j.value;b&&(L(),ne(b))}function ye(){const b=F.scrollState;return!b||b.isAtBottom===!0}function ie(){if(!ye()){X=0,se=0;return}if(V(),X-=1,X<=0){se=0;return}se=requestAnimationFrame(ie)}function de(b=6){ye()&&(se&&(cancelAnimationFrame(se),se=0),X=Math.max(b,1),se=requestAnimationFrame(ie))}function _e(){de(3)}function Le(){if(!ye())return;const b=j.value;if(!b)return;const A=b.querySelectorAll("img.message-image-preview");for(const $ of A)$.complete||ge.has($)||(ge.add($),$.addEventListener("load",_e,{once:!0}),$.addEventListener("error",_e,{once:!0}))}async function qe(){await zt(),ke&&cancelAnimationFrame(ke),ke=requestAnimationFrame(()=>{ke=0,Z(),Le(),de()})}ht(()=>F.messages,async b=>{if(!F.isLoading){for(const A of b){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const $=o.value[A.id],Q=A.commandExecution.status;$==="inProgress"&&Q!=="inProgress"&&O(A.id),o.value[A.id]=Q}await qe()}}),ht(()=>F.liveOverlay,async b=>{b&&(await zt(),V(),de(8))},{deep:!0}),ht(()=>F.isLoading,async b=>{b||await qe()}),ht(()=>F.activeThreadId,()=>{ae.value="",re.value=new Set},{flush:"post"});function Ae(){const b=j.value;!b||F.isLoading||ne(b)}function Xe(b){ae.value=be(b)}function pt(b,A){return`${b}:${String(A)}`}function H(b,A){const $=new Set(re.value);$.add(pt(b,A)),re.value=$}function W(b,A){return re.value.has(pt(b,A))}function J(){ae.value=""}function Ke(){const b=D.value;b&&(b.scrollTop=b.scrollHeight)}return ht(()=>{var b;return(b=F.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await zt(),Ke())}),jn(()=>{ke&&cancelAnimationFrame(ke),se&&cancelAnimationFrame(se)}),(b,A)=>(w(),S("section",Zm,[e.isLoading?(w(),S("p",eg,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),S("p",tg," No messages in this thread yet. ")):(w(),S("ul",{key:2,ref_key:"conversationListRef",ref:j,class:"conversation-list",onScroll:Ae},[(w(!0),S(Ue,null,wt(e.pendingRequests,$=>(w(),S("li",{key:`server-request:${$.id}`,class:"conversation-item conversation-item-request"},[m("div",ng,[m("div",rg,[m("article",sg,[m("p",og,he($.method),1),m("p",ig,"Request #"+he($.id)+" · "+he(lt($.receivedAtIso)),1),Ye($)?(w(),S("p",ag,he(Ye($)),1)):le("",!0),$.method==="item/commandExecution/requestApproval"?(w(),S("section",lg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Q=>Y($.id,"accept")},"Accept",8,cg),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"acceptForSession")},"Accept for Session",8,ug),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"decline")},"Decline",8,dg),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"cancel")},"Cancel",8,fg)])):$.method==="item/fileChange/requestApproval"?(w(),S("section",hg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Q=>Y($.id,"accept")},"Accept",8,pg),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"acceptForSession")},"Accept for Session",8,mg),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"decline")},"Decline",8,gg),m("button",{type:"button",class:"request-button",onClick:Q=>Y($.id,"cancel")},"Cancel",8,vg)])):$.method==="item/tool/requestUserInput"?(w(),S("section",yg,[(w(!0),S(Ue,null,wt(pe($),Q=>(w(),S("div",{key:`${$.id}:${Q.id}`,class:"request-question"},[m("p",wg,he(Q.header||Q.question),1),Q.header&&Q.question?(w(),S("p",bg,he(Q.question),1)):le("",!0),m("select",{class:"request-select",value:xe($.id,Q.id,Q.options[0]||""),onChange:Ce=>E($.id,Q.id,Ce)},[(w(!0),S(Ue,null,wt(Q.options,Ce=>(w(),S("option",{key:`${$.id}:${Q.id}:${Ce}`,value:Ce},he(Ce),9,kg))),128))],40,_g),Q.isOther?(w(),S("input",{key:1,class:"request-input",type:"text",value:Te($.id,Q.id),placeholder:"Other answer",onInput:Ce=>ee($.id,Q.id,Ce)},null,40,Tg)):le("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:Q=>ve($)}," Submit Answers ",8,Sg)])):$.method==="item/tool/call"?(w(),S("section",xg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Q=>Oe($.id)},"Fail Tool Call",8,Cg),m("button",{type:"button",class:"request-button",onClick:Q=>p($.id)},"Success (Empty)",8,Eg)])):(w(),S("section",Ag,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Q=>y($.id)},"Return Empty Result",8,Ig),m("button",{type:"button",class:"request-button",onClick:Q=>x($.id)},"Reject Request",8,Rg)]))])])])]))),128)),(w(!0),S(Ue,null,wt(e.messages,$=>{var Q,Ce;return w(),S("li",{key:$.id,class:at(["conversation-item",{"conversation-item-rollbackable":N($)}]),"data-role":$.role,"data-message-type":$.messageType||""},[i($)?(w(),S("div",Mg,[m("div",Pg,[m("button",{type:"button",class:at(["cmd-row",[_($),{"cmd-expanded":a($)}]]),onClick:Ee=>d($)},[m("span",{class:at(["cmd-chevron",{"cmd-chevron-open":a($)}])},"▶",2),m("code",Ng,he(((Q=$.commandExecution)==null?void 0:Q.command)||"(command)"),1),m("span",jg,he(g($)),1)],10,Og),m("div",{class:at(["cmd-output-wrap",{"cmd-output-visible":a($),"cmd-output-collapsing":l($)}])},[m("div",Dg,[m("pre",Lg,he(((Ce=$.commandExecution)==null?void 0:Ce.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),S("div",{key:1,class:"message-row","data-role":$.role,"data-message-type":$.messageType||""},[m("div",{class:"message-stack","data-role":$.role},[m("article",{class:"message-body","data-role":$.role},[$.images&&$.images.length>0?(w(),S("ul",{key:0,class:"message-image-list","data-role":$.role},[(w(!0),S(Ue,null,wt($.images,Ee=>(w(),S("li",{key:Ee,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:ct=>Xe(Ee)},[m("img",{class:"message-image-preview",src:be(Ee),alt:"Message image preview",loading:"lazy"},null,8,Wg)],8,Vg)]))),128))],8,Ug)):le("",!0),$.fileAttachments&&$.fileAttachments.length>0?(w(),S("div",qg,[(w(!0),S(Ue,null,wt($.fileAttachments,Ee=>(w(),S("span",{key:Ee.path,class:"message-file-chip"},[A[1]||(A[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:Pe(Ee.path),target:"_blank",rel:"noopener noreferrer",title:Ee.path},he(Ee.path),9,Kg)]))),128))])):le("",!0),$.text.length>0?(w(),S("article",{key:2,class:"message-card","data-role":$.role},[$.messageType==="worked"?(w(),S("div",zg,[m("button",{type:"button",class:"worked-separator",onClick:Ee=>u($)},[A[2]||(A[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:at(["worked-chevron",{"worked-chevron-open":f($)}])},"▶",2),m("p",Jg,he($.text),1),A[3]||(A[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Yg),f($)?(w(),S("div",Qg,[(w(!0),S(Ue,null,wt(I(e.messages,e.messages.indexOf($)),Ee=>{var ct,tt;return w(),S("div",{key:`worked-cmd-${Ee.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:at(["cmd-row",[_(Ee),{"cmd-expanded":a(Ee)}]]),onClick:ut=>d(Ee)},[m("span",{class:at(["cmd-chevron",{"cmd-chevron-open":a(Ee)}])},"▶",2),m("code",Zg,he(((ct=Ee.commandExecution)==null?void 0:ct.command)||"(command)"),1),m("span",ev,he(g(Ee)),1)],10,Xg),m("div",{class:at(["cmd-output-wrap",{"cmd-output-visible":a(Ee),"cmd-output-collapsing":l(Ee)}])},[m("div",tv,[m("pre",nv,he(((tt=Ee.commandExecution)==null?void 0:tt.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(w(),S("div",rv,[(w(!0),S(Ue,null,wt(vt($.text),(Ee,ct)=>(w(),S(Ue,{key:`block-${ct}`},[Ee.kind==="text"?(w(),S("p",sv,[(w(!0),S(Ue,null,wt(Ie(Ee.value),(tt,ut)=>(w(),S(Ue,{key:`seg-${ct}-${ut}`},[tt.kind==="text"?(w(),S("span",ov,he(tt.value),1)):tt.kind==="file"?(w(),S("a",{key:1,class:"message-file-link",href:Pe(tt.path),target:"_blank",rel:"noopener noreferrer",title:tt.path},he(tt.displayPath),9,iv)):(w(),S("code",av,he(tt.value),1))],64))),128))])):W($.id,ct)?(w(),S("p",lv,he(Ee.markdown),1)):(w(),S("button",{key:2,class:"message-image-button",type:"button",onClick:tt=>Xe(Ee.url)},[m("img",{class:"message-image-preview message-markdown-image",src:Ee.url,alt:Ee.alt||"Embedded message image",loading:"lazy",onError:tt=>H($.id,ct)},null,40,uv)],8,cv))],64))),128))]))],8,Gg)):le("",!0)],8,Hg),N($)?(w(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:Ee=>B($)},[Se(Xm,{class:"rollback-icon"}),A[4]||(A[4]=m("span",{class:"rollback-label"},"Rollback",-1))],8,dv)):le("",!0)],8,Fg)],8,Bg))],10,$g)}),128)),e.liveOverlay?(w(),S("li",fv,[m("div",hv,[m("div",pv,[m("article",mv,[m("p",gv,he(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:D},he(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(w(),S("p",vv,he(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),m("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(w(),S("div",{key:3,class:"image-modal-backdrop",onClick:J},[m("div",{class:"image-modal-content",onClick:A[0]||(A[0]=ze(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:J},[Se(Ei,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,yv)])])):le("",!0)]))}}),_v=Je(bv,[["__scopeId","data-v-454a8117"]]);function kv(e){var u;const t=P("idle"),n=P(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var O;const g=o,_=(r==null?void 0:r.mimeType)||((O=g[0])==null?void 0:O.type)||"audio/webm";d(),t.value="idle",l(g,_)},r.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,g){var O;if(f.length===0)return;const _=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",F=`----codex-transcribe-${crypto.randomUUID()}`,z=new Uint8Array(await _.arrayBuffer()),j=new TextEncoder,U=[];U.push(j.encode(`--${F}\r
|
|
27
|
-
`)),U.push(j.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
|
|
28
|
-
`)),U.push(j.encode(`Content-Type: ${g}\r
|
|
29
|
-
\r
|
|
30
|
-
`)),U.push(z),U.push(j.encode(`\r
|
|
31
|
-
--${F}--\r
|
|
32
|
-
`));let D=0;for(const X of U)D+=X.byteLength;const ae=new Uint8Array(D);let ue=0;for(const X of U)ae.set(X,ue),ue+=X.byteLength;const fe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${F}`},body:ae});if(!fe.ok)throw new Error(`Transcription failed: ${fe.status}`);const se=((await fe.json()).text??"").trim();se.length>0&&e.onTranscript(se)}catch(I){(O=e.onError)==null||O.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return jn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Ya(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class An extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Ai(e,t){const n=Ya(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Ya(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Lr(e,t,n){return e instanceof An?e:e instanceof Error?new An(e.message||t,{code:"unknown_error",method:n}):new An(t,{code:"unknown_error",method:n})}function Wc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Tv(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new An(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new An(Ai(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new An(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Ja(e){const t=Wc(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 Sv(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=Ja(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Ja(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function xv(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new An(r instanceof Error?r.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 An(Ai(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Cv(){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 An(Ai(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Wc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Qa(e){return new Date(e*1e3).toISOString()}function Ev(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Av(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Iv=/^##\s+(.+?):\s+(.+?)\s*$/,Rv=/^#\s*files mentioned by the user\s*:?\s*$/i;function $v(e){var s,o;const t=e.split(`
|
|
33
|
-
`).findIndex(i=>Rv.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
34
|
-
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Iv);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function Mv(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 r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const s=r.index+r[0].length;return e.slice(s).trim()}function Pv(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],s=[];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&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&s.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:Av(l),isUnhandled:!0});const o=n.join(`
|
|
35
|
-
`),i=$v(o);return{text:Mv(o),images:r,fileAttachments:i,rawBlocks:s}}function Ov(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Pv(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=Nv(t.status),r=typeof t.command=="string"?t.command:"",s=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:r,messageType:"commandExecution",commandExecution:{command:r,cwd:s,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function Nv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function jv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Dv(e){const t=jv(e);return t.length>0?t:"Untitled thread"}function qc(e){return(e==null?void 0:e.status)==="inProgress"}function Lv(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return qc(r)}function Bv(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,r=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:Dv(e),projectName:Ev(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Qa(e.createdAt),updatedAtIso:Qa(e.updatedAt),preview:e.preview,unread:!1,inProgress:Lv(e)}}function Fv(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((s,o)=>new Date(o.updatedAtIso).getTime()-new Date(s.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const s=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-s})}function Hv(e){const t=e.data.map(Bv);return Fv(t)}function Kc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Ov(i))n.push({...a,turnIndex:r})}return n}function Uv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return qc(t.at(-1))}async function Wt(e,t){try{return await Tv(e,t)}catch(n){throw Lr(n,`RPC ${e} failed`,e)}}function Vv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Wv(){const e=await Wt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Hv(e)}async function qv(e){const t=await Wt("thread/read",{threadId:e,includeTurns:!0});return{messages:Kc(t),inProgress:Uv(t)}}async function Kv(){try{return await Wv()}catch(e){throw Lr(e,"Failed to load thread groups","thread/list")}}async function Gv(e){try{return await qv(e)}catch(t){throw Lr(t,`Failed to load thread ${e}`,"thread/read")}}function zv(e){return Sv(e)}async function Yv(e,t){await xv({id:e,...t})}async function Jv(){return Cv()}async function Co(e){await Wt("thread/resume",{threadId:e})}async function Qv(e){await Wt("thread/archive",{threadId:e})}async function Xv(e,t){await Wt("thread/name/set",{threadId:e,name:t})}async function Xa(e,t){const n=await Wt("thread/rollback",{threadId:e,numTurns:t});return Kc(n)}function Zv(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function Za(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 r=await Wt("thread/start",n),s=Zv(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Lr(n,"Failed to start a new thread","thread/start")}}function ey(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
36
|
-
`;for(const r of t)n+=`
|
|
37
|
-
## ${r.label}: ${r.path}
|
|
38
|
-
`;return`${n}
|
|
39
|
-
## My request for Codex:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
`}async function Eo(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:ey(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 r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await Wt("turn/start",u)}catch(a){throw Lr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function ty(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await Wt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Lr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function ny(e){await Wt("setDefaultModel",{model:e})}async function ry(){const e=await Wt("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function sy(){const e=await Wt("config/read",{}),t=e.config.model??"",n=Vv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function oy(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},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Zo(){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 oy(n.data)}async function iy(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function el(){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:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function ay(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 ly(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)??""})}),r=await n.json();if(!n.ok){const a=Ii(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function cy(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Ii(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function uy(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=Ii(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 Ii(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function dy(){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 Ao(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 fy(e,t){var n;try{return((n=(await Wt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function hy(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Wt("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function py(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 my={},gy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vy(e,t){return w(),S("svg",gy,[...t[0]||(t[0]=[m("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 yy=Je(my,[["render",vy]]),wy={},by={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _y(e,t){return w(),S("svg",by,[...t[0]||(t[0]=[m("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 ky=Je(wy,[["render",_y]]),Ty={},Sy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xy(e,t){return w(),S("svg",Sy,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("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 Cy=Je(Ty,[["render",xy]]),Ey=["disabled"],Ay={class:"composer-dropdown-value"},Iy={class:"composer-dropdown-menu"},Ry={key:0,class:"composer-dropdown-search-wrap"},$y=["placeholder","onKeydown"],My={class:"composer-dropdown-options",role:"listbox"},Py=["onClick"],Oy={key:0,class:"composer-dropdown-empty"},Ny={key:1,class:"composer-dropdown-add-wrap"},jy=["placeholder","onKeydown"],Dy=Et({__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,r=t,s=P(null),o=P(null),i=P(null),a=P(!1),l=P(""),d=P(!1),u=P(""),f=ce(()=>{var ge;const X=n.options.find(re=>re.value===n.modelValue);return X?X.label:((ge=n.placeholder)==null?void 0:ge.trim())||""}),g=ce(()=>n.openDirection??"down"),_=ce(()=>n.enableSearch===!0),O=ce(()=>n.showAddAction===!0),I=ce(()=>{var X;return((X=n.searchPlaceholder)==null?void 0:X.trim())||"Quick search projects"}),F=ce(()=>{var X;return((X=n.addActionLabel)==null?void 0:X.trim())||"Add new project"}),z=ce(()=>{var X;return((X=n.addPlaceholder)==null?void 0:X.trim())||"Project name or absolute path"}),j=ce(()=>{const X=l.value.trim().toLowerCase();return X?n.options.filter(ge=>ge.label.toLowerCase().includes(X)||ge.value.toLowerCase().includes(X)):n.options});function U(){n.disabled||(a.value=!a.value)}function D(X){r("update:modelValue",X),a.value=!1,l.value=""}function ae(){var X;d.value=!0,u.value=((X=n.defaultAddValue)==null?void 0:X.trim())||"",zt(()=>{var ge;return(ge=i.value)==null?void 0:ge.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function fe(){const X=u.value.trim();X&&(r("add",X),d.value=!1,u.value="",a.value=!1,l.value="")}function ke(){d.value=!1,u.value="",a.value=!1,l.value=""}function se(X){if(!a.value)return;const ge=s.value;if(!ge)return;const re=X.target;re instanceof Node&&(ge.contains(re)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ht(a,X=>{if(!X){d.value=!1,u.value="";return}_.value&&zt(()=>{var ge;return(ge=o.value)==null?void 0:ge.focus()})}),Nn(()=>{window.addEventListener("pointerdown",se)}),jn(()=>{window.removeEventListener("pointerdown",se)}),(X,ge)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[m("span",Ay,he(f.value),1),Se(so,{class:"composer-dropdown-chevron"})],8,Ey),a.value?(w(),S("div",{key:0,class:at(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[m("div",Iy,[_.value?(w(),S("div",Ry,[Mn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ge[0]||(ge[0]=re=>l.value=re),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Ht(ze(ue,["prevent"]),["esc"])},null,40,$y),[[Pn,l.value]])])):le("",!0),m("ul",My,[(w(!0),S(Ue,null,wt(j.value,re=>(w(),S("li",{key:re.value},[m("button",{class:at(["composer-dropdown-option",{"is-selected":re.value===e.modelValue}]),type:"button",onClick:Be=>D(re.value)},he(re.label),11,Py)]))),128)),j.value.length===0?(w(),S("li",Oy," No matching projects ")):le("",!0)]),O.value?(w(),S("div",Ny,[d.value?(w(),S(Ue,{key:0},[Mn(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ge[1]||(ge[1]=re=>u.value=re),class:"composer-dropdown-add-input",type:"text",placeholder:z.value,onKeydown:[Ht(ze(fe,["prevent"]),["enter"]),Ht(ze(ke,["prevent"]),["esc"])]},null,40,jy),[[Pn,u.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:fe},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ke},"Cancel")])],64)):(w(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},he(F.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),ei=Je(Dy,[["__scopeId","data-v-7cfa2012"]]),Ly=["disabled"],By={class:"search-dropdown-value"},Fy={class:"search-dropdown-search-wrap"},Hy=["placeholder","onKeydown"],Uy={key:0,class:"search-dropdown-list",role:"listbox"},Vy=["onClick","onPointerenter"],Wy={class:"search-dropdown-option-check"},qy={class:"search-dropdown-option-label"},Ky={key:0,class:"search-dropdown-option-desc"},Gy={key:1,class:"search-dropdown-empty"},zy=Et({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(!1),a=P(""),l=P(0),d=ce(()=>n.openDirection??"down"),u=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const j=n.options.find(U=>U.value===n.selectedValues[0]);return(j==null?void 0:j.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const j=a.value.toLowerCase().trim();return j?n.options.filter(U=>{var D;return U.label.toLowerCase().includes(j)||(((D=U.description)==null?void 0:D.toLowerCase().includes(j))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,zt(()=>{var j;return(j=o.value)==null?void 0:j.focus()})))}function O(j){r("toggle",j.value,!u.value.has(j.value))}function I(j){g.value.length!==0&&(l.value=(l.value+j+g.value.length)%g.value.length)}function F(){const j=g.value[l.value];j&&O(j)}function z(j){if(!i.value)return;const U=s.value;if(!U)return;const D=j.target;D instanceof Node&&(U.contains(D)||(i.value=!1))}return ht(a,()=>{l.value=0}),Nn(()=>window.addEventListener("pointerdown",z)),jn(()=>window.removeEventListener("pointerdown",z)),(j,U)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",By,he(f.value),1),Se(so,{class:"search-dropdown-chevron"})],8,Ly),i.value?(w(),S("div",{key:0,class:at(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[m("div",Fy,[Mn(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=D=>a.value=D),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Ht(ze(D=>i.value=!1,["prevent"]),["escape"])),Ht(ze(F,["prevent"]),["enter"]),U[2]||(U[2]=Ht(ze(D=>I(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Ht(ze(D=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Hy),[[Pn,a.value]])]),g.value.length>0?(w(),S("ul",Uy,[(w(!0),S(Ue,null,wt(g.value,(D,ae)=>(w(),S("li",{key:D.value},[m("button",{class:at(["search-dropdown-option",{"is-selected":u.value.has(D.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>O(D),onPointerenter:ue=>l.value=ae},[m("span",Wy,he(u.value.has(D.value)?"✓":""),1),m("span",qy,he(D.label),1),D.description?(w(),S("span",Ky,he(D.description),1)):le("",!0)],42,Vy)]))),128))])):(w(),S("div",Gy,"No results"))],2)):le("",!0)],512))}}),Yy=Je(zy,[["__scopeId","data-v-a0f2edd4"]]),Jy={class:"skill-picker-header"},Qy=["onKeydown"],Xy={key:0,class:"skill-picker-list",role:"listbox"},Zy=["onClick","onPointerenter"],ew={class:"skill-picker-name"},tw={key:0,class:"skill-picker-desc"},nw={key:1,class:"skill-picker-empty"},rw=Et({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(""),a=P(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),d=ce(()=>{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&&r("select",g)}return ht(()=>n.visible,g=>{g&&(i.value="",a.value=0,zt(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),ht(i,()=>{a.value=0}),(g,_)=>e.visible?(w(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:mr(d.value)},[m("div",Jy,[Mn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=O=>i.value=O),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Ht(ze(O=>g.$emit("close"),["prevent"]),["escape"])),Ht(ze(f,["prevent"]),["enter"]),_[2]||(_[2]=Ht(ze(O=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Ht(ze(O=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Qy),[[Pn,i.value]])]),l.value.length>0?(w(),S("ul",Xy,[(w(!0),S(Ue,null,wt(l.value,(O,I)=>(w(),S("li",{key:O.path},[m("button",{class:at(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:F=>g.$emit("select",O),onPointerenter:F=>a.value=I},[m("span",ew,he(O.name),1),O.description?(w(),S("span",tw,he(O.description),1)):le("",!0)],42,Zy)]))),128))])):(w(),S("div",nw,"No skills found"))],4)):le("",!0)}}),sw=Je(rw,[["__scopeId","data-v-d6a08788"]]),ow={key:0,class:"thread-composer-attachments"},iw=["src","alt"],aw=["aria-label","disabled","onClick"],lw={key:1,class:"thread-composer-file-chips"},cw=["title"],uw=["aria-label","disabled","onClick"],dw={key:2,class:"thread-composer-skill-chips"},fw={class:"thread-composer-skill-chip-name"},hw=["aria-label","onClick"],pw={class:"thread-composer-input-wrap"},mw={key:0,class:"thread-composer-file-mentions"},gw=["onMousedown"],vw={key:1,class:"thread-composer-file-mention-icon-markdown"},yw={class:"thread-composer-file-mention-text"},ww={class:"thread-composer-file-mention-name"},bw={key:0,class:"thread-composer-file-mention-dir"},_w={key:1,class:"thread-composer-file-mention-empty"},kw=["placeholder","disabled"],Tw={class:"thread-composer-controls"},Sw=["disabled"],xw={key:0,class:"thread-composer-attach-menu"},Cw=["disabled"],Ew=["disabled"],Aw={class:"thread-composer-actions"},Iw=["aria-label","title","disabled"],Rw=["disabled"],$w=["aria-label","title","disabled"],Mw=["disabled"],Pw=["disabled"],Ow=Et({__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,r=t,s=P(""),o=P([]),i=P([]),a=P([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=kv({onTranscript:H=>{s.value=s.value?`${s.value}
|
|
43
|
-
${H}`:H}}),g=P(null),_=P(null),O=P(null),I=P(null),F=P(!1),z=P(!1),j=P(null),U=P(""),D=P([]),ae=P(!1),ue=P(0);let fe=0,ke=null;const se=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),X=[{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=ce(()=>n.models.map(H=>({value:H,label:H}))),re=ce(()=>n.skills??[]),Be=ce(()=>i.value.map(H=>H.path)),He=ce(()=>(n.skills??[]).map(H=>({value:H.path,label:H.name,description:H.description}))),Ge=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ie=ce(()=>n.disabled||!n.activeThreadId),be=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Pe=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function vt(H="steer"){var J;const W=s.value.trim();if(Ge.value){if(r("submit",{text:W,imageUrls:o.value.map(Ke=>Ke.url),fileAttachments:[...a.value],skills:i.value.map(Ke=>({name:Ke.name,path:Ke.path})),mode:H}),s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,te(),se){(J=I.value)==null||J.blur();return}zt(()=>{var Ke;return(Ke=I.value)==null?void 0:Ke.focus()})}}function Qe(){r("interrupt")}function lt(H){r("update:selected-model",H)}function Ye(H){r("update:selected-reasoning-effort",H)}function et(){Ie.value||(F.value=!F.value)}function pe(){var H;(H=_.value)==null||H.click()}function xe(){var H;(H=O.value)==null||H.click()}function Te(H){o.value=o.value.filter(W=>W.id!==H)}function E(H){i.value=i.value.filter(W=>W.path!==H)}function ee(H){a.value=a.value.filter(W=>W.fsPath!==H)}function Y(H){const W=H.replace(/\\/g,"/");if(a.value.some(b=>b.fsPath===W))return;const J=W.split("/").filter(Boolean),Ke=J[J.length-1]??W;a.value=[...a.value,{label:Ke,path:W,fsPath:W}]}function ve(H){return H.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(H.name)}function Oe(H){if(!(!H||H.length===0))for(const W of Array.from(H))if(ve(W)){const J=new FileReader;J.onload=()=>{typeof J.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:W.name,url:J.result})},J.readAsDataURL(W)}else py(W).then(J=>{J&&Y(J)}).catch(()=>{})}function p(H){H&&(H.value="")}function y(H){const W=H.target;Oe((W==null?void 0:W.files)??null),p(W),F.value=!1}function x(H){const W=H.target;Oe((W==null?void 0:W.files)??null),p(W),F.value=!1}function N(){const W=s.value.startsWith("/");W!==z.value&&(z.value=W),ne()}function B(H){if(ae.value){if(H.key==="Escape"){H.preventDefault(),te();return}if(H.key==="ArrowDown"){H.preventDefault(),D.value.length>0&&(ue.value=(ue.value+1)%D.value.length);return}if(H.key==="ArrowUp"){if(H.preventDefault(),D.value.length>0){const J=D.value.length;ue.value=(ue.value+J-1)%J}return}if(H.key==="Enter"||H.key==="Tab"){H.preventDefault();const J=D.value[ue.value];J?V(J):te();return}}if(n.sendWithEnter!==!1?H.key==="Enter"&&!H.shiftKey:H.key==="Enter"&&(H.metaKey||H.ctrlKey)){H.preventDefault(),vt(n.isTurnInProgress?be.value:"steer");return}if(z.value){if(H.key==="Escape"){H.preventDefault(),L();return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();return}}}function L(){var H;z.value=!1,(H=I.value)==null||H.focus()}function te(){ae.value=!1,j.value=null,U.value="",D.value=[],ue.value=0}function ne(){const H=I.value;if(!H){te();return}const W=H.selectionStart??s.value.length,Ke=s.value.slice(0,W).match(/(^|\s)(@[^\s@]*)$/);if(!Ke){te();return}const b=Ke[2]??"",A=b.length,$=W-A;j.value=$,U.value=b.slice(1),ae.value=!0,Z()}async function Z(){if(!ae.value)return;const H=(n.cwd??"").trim();if(!H){D.value=[];return}ke&&clearTimeout(ke);const W=++fe;ke=setTimeout(async()=>{try{const J=await uy(H,U.value,20);if(!ae.value||W!==fe)return;D.value=J,ue.value=0}catch{if(!ae.value||W!==fe)return;D.value=[]}},120)}function V(H){const W=I.value,J=j.value;if(J!==null&&W){const Ke=W.selectionStart??s.value.length;s.value=`${s.value.slice(0,J)}${s.value.slice(Ke)}`.trimEnd()}Y(H.path),te(),zt(()=>W==null?void 0:W.focus())}function ye(H){const W=H.lastIndexOf("/");return W<0?H:H.slice(W+1)}function ie(H){const W=H.lastIndexOf("/");return W<=0?"":H.slice(0,W)}function de(H){const W=ye(H),J=W.lastIndexOf(".");return J<=0?"":W.slice(J+1).toLowerCase()}function _e(H){const W=de(H);return W==="ts"?"TS":W==="tsx"?"TSX":W==="js"?"JS":W==="jsx"?"JSX":W==="json"?"{}":""}function Le(H){const W=de(H);return W.startsWith("ts")?"ts":W.startsWith("js")?"js":W==="json"?"json":"default"}function qe(H){const W=de(H);return W==="md"||W==="mdx"}function Ae(H){var W;i.value.some(J=>J.path===H.path)||(i.value=[...i.value,H]),s.value=s.value.startsWith("/")?"":s.value,z.value=!1,(W=I.value)==null||W.focus()}function Xe(H,W){if(W){const J=(n.skills??[]).find(Ke=>Ke.path===H);J&&!i.value.some(Ke=>Ke.path===H)&&(i.value=[...i.value,J])}else i.value=i.value.filter(J=>J.path!==H)}function pt(H){if(!F.value)return;const W=g.value;if(!W)return;const J=H.target;!J||W.contains(J)||(F.value=!1)}return Nn(()=>{document.addEventListener("click",pt)}),jn(()=>{document.removeEventListener("click",pt),ke&&clearTimeout(ke)}),ht(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,te()}),ht(()=>n.cwd,()=>{ae.value&&Z()}),(H,W)=>(w(),S("form",{class:"thread-composer",onSubmit:W[7]||(W[7]=ze(J=>vt("steer"),["prevent"]))},[m("div",{class:at(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),S("div",ow,[(w(!0),S(Ue,null,wt(o.value,J=>(w(),S("div",{key:J.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:J.url,alt:J.name||"Selected image"},null,8,iw),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${J.name||"image"}`,disabled:Ie.value,onClick:Ke=>Te(J.id)}," x ",8,aw)]))),128))])):le("",!0),a.value.length>0?(w(),S("div",lw,[(w(!0),S(Ue,null,wt(a.value,J=>(w(),S("span",{key:J.fsPath,class:"thread-composer-file-chip"},[Se(Hs,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:J.fsPath},he(J.label),9,cw),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${J.label}`,disabled:Ie.value,onClick:Ke=>ee(J.fsPath)},"×",8,uw)]))),128))])):le("",!0),i.value.length>0?(w(),S("div",dw,[(w(!0),S(Ue,null,wt(i.value,J=>(w(),S("span",{key:J.path,class:"thread-composer-skill-chip"},[m("span",fw,he(J.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${J.name}`,onClick:Ke=>E(J.path)},"×",8,hw)]))),128))])):le("",!0),m("div",pw,[ae.value?(w(),S("div",mw,[D.value.length>0?(w(!0),S(Ue,{key:0},wt(D.value,(J,Ke)=>(w(),S("button",{key:J.path,class:at(["thread-composer-file-mention-row",{"is-active":Ke===ue.value}]),type:"button",onMousedown:ze(b=>V(J),["prevent"])},[_e(J.path)?(w(),S("span",{key:0,class:at(["thread-composer-file-mention-icon-badge",`is-${Le(J.path)}`])},he(_e(J.path)),3)):qe(J.path)?(w(),S("span",vw,"↓")):(w(),ft(Hs,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",yw,[m("span",ww,he(ye(J.path)),1),ie(J.path)?(w(),S("span",bw,he(ie(J.path)),1)):le("",!0)])],42,gw))),128)):(w(),S("div",_w,"No matching files"))])):le("",!0),Mn(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":W[0]||(W[0]=J=>s.value=J),class:"thread-composer-input",placeholder:Pe.value,disabled:Ie.value,onInput:N,onKeydown:B},null,40,kw),[[Pn,s.value]]),Se(sw,{skills:re.value,visible:z.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ae,onClose:L},null,8,["skills","visible"])]),m("div",Tw,[m("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ie.value,onClick:et}," + ",8,Sw),F.value?(w(),S("div",xw,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:pe}," Add photos & files ",8,Cw),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:xe}," Take photo ",8,Ew)])):le("",!0)],512),Se(ei,{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":lt},null,8,["model-value","options","disabled"]),Se(Yy,{class:"thread-composer-control",options:He.value,"selected-values":Be.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Xe},null,8,["options","selected-values","disabled"]),Se(ei,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:X,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ye},null,8,["model-value","disabled"]),m("div",Aw,[je(d)&&!e.isTurnInProgress?(w(),S("button",{key:0,class:at(["thread-composer-mic",{"thread-composer-mic--active":je(l)!=="idle"}]),type:"button","aria-label":je(l)==="recording"?"Stop dictation":"Hold to dictate",title:je(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ie.value,onMousedown:W[1]||(W[1]=ze((...J)=>je(u)&&je(u)(...J),["prevent"])),onMouseup:W[2]||(W[2]=(...J)=>je(f)&&je(f)(...J)),onMouseleave:W[3]||(W[3]=J=>je(l)==="recording"&&je(f)()),onTouchstart:W[4]||(W[4]=ze((...J)=>je(u)&&je(u)(...J),["prevent"])),onTouchend:W[5]||(W[5]=(...J)=>je(f)&&je(f)(...J))},[Se(ky,{class:"thread-composer-mic-icon"})],42,Iw)):le("",!0),e.isTurnInProgress?(w(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Qe},[Se(Cy,{class:"thread-composer-stop-icon"})],8,Rw)):le("",!0),m("button",{class:at(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&be.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&be.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${be.value}`:"Send",disabled:!Ge.value,onClick:W[6]||(W[6]=J=>vt(e.isTurnInProgress?be.value:"steer"))},[Se(yy,{class:"thread-composer-submit-icon"})],10,$w)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ie.value,onChange:y},null,40,Mw),m("input",{ref_key:"cameraCaptureInputRef",ref:O,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ie.value,onChange:x},null,40,Pw)],32))}}),tl=Je(Ow,[["__scopeId","data-v-983e7906"]]),Nw={key:0,class:"queued-messages"},jw={class:"queued-messages-inner"},Dw={class:"queued-row-text"},Lw={class:"queued-row-actions"},Bw=["onClick"],Fw=["onClick"],Hw=Et({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),S("div",Nw,[m("div",jw,[(w(!0),S(Ue,null,wt(e.messages,r=>(w(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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)),m("span",Dw,he(r.text),1),m("div",Lw,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Bw),m("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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,Fw)])]))),128))])])):le("",!0)}}),Uw=Je(Hw,[["__scopeId","data-v-ea583733"]]),Vw={class:"runtime-dropdown-trigger-label"},Ww={key:0,class:"runtime-dropdown-menu-wrap"},qw={class:"runtime-dropdown-menu"},Kw=["onClick"],Gw={class:"runtime-dropdown-option-label"},zw={key:0,class:"runtime-dropdown-option-check"},Yw=Et({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(!1),i=[{value:"local",label:"Local project",icon:Vc},{value:"worktree",label:"New worktree",icon:Ms}],a=ce(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const f=s.value;if(!f)return;const g=u.target;g instanceof Node&&(f.contains(g)||(o.value=!1))}return Nn(()=>{window.addEventListener("pointerdown",d)}),jn(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=g=>o.value=!o.value)},[(w(),ft(Uo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Vw,he(a.value.label),1),Se(so,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),S("div",Ww,[m("div",qw,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),S(Ue,null,wt(i,g=>m("button",{key:g.value,class:at(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:_=>l(g.value)},[(w(),ft(Uo(g.icon),{class:"runtime-dropdown-option-icon"})),m("span",Gw,he(g.label),1),e.modelValue===g.value?(w(),S("span",zw,"✓")):le("",!0)],10,Kw)),64))])])):le("",!0)],512))}}),Jw=Je(Yw,[["__scopeId","data-v-9c9b71e5"]]),Qw={},Xw={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Zw(e,t){return w(),S("svg",Xw,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const ti=Je(Qw,[["render",Zw]]),eb={class:"skill-card-top"},tb=["src","alt"],nb={key:1,class:"skill-card-avatar-fallback"},rb={class:"skill-card-info"},sb={class:"skill-card-header"},ob={class:"skill-card-name"},ib={key:0,class:"skill-card-badge-disabled"},ab={key:1,class:"skill-card-badge"},lb={class:"skill-card-owner"},cb={key:0,class:"skill-card-desc"},ub={key:1,class:"skill-card-date"},db=Et({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;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 r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),S("button",{class:at(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",eb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,tb)):(w(),S("div",nb,he(e.skill.owner.charAt(0)),1)),m("div",rb,[m("div",sb,[m("span",ob,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),S("span",ib,"Disabled")):e.skill.installed?(w(),S("span",ab,"Installed")):le("",!0)]),m("span",lb,he(e.skill.owner),1)])]),e.skill.description?(w(),S("p",cb,he(e.skill.description),1)):le("",!0),n.value?(w(),S("span",ub,he(n.value),1)):le("",!0)],2))}}),nl=Je(db,[["__scopeId","data-v-2a1e8196"]]),fb={class:"sdm-panel"},hb={class:"sdm-header"},pb={class:"sdm-title-area"},mb=["src","alt"],gb={class:"sdm-title-col"},vb={class:"sdm-title-row"},yb={class:"sdm-title"},wb={key:0,class:"sdm-badge-disabled"},bb={class:"sdm-owner"},_b={class:"sdm-body"},kb={key:0,class:"sdm-desc"},Tb={key:1,class:"sdm-readme-loading"},Sb=["innerHTML"],xb=["href"],Cb={class:"sdm-footer"},Eb={class:"sdm-footer-actions"},Ab=["disabled"],Ib=["disabled"],Rb=["disabled"],$b=Et({__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,r=t,s=P(null),o=P(""),i=P(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const I=o.value;if(!I)return"";const F=I.replace(/^---[\s\S]*?---\s*/,"");return u(F)});function u(I){return I.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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}),F=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!F.ok)return;const z=await F.json();o.value=z.content??""}catch{}finally{i.value=!1}}}ht(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function O(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,F)=>(w(),ft(js,{to:"body"},[e.visible?(w(),S("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=ze(z=>I.$emit("close"),["self"]))},[m("div",fb,[m("div",hb,[m("div",pb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,mb)):le("",!0),m("div",gb,[m("div",vb,[m("h3",yb,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),S("span",wb,"Disabled")):le("",!0)]),m("span",bb,he(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=z=>I.$emit("close"))},[Se(Ei,{class:"sdm-close-icon"})])]),m("div",_b,[e.skill.description?(w(),S("p",kb,he(e.skill.description),1)):le("",!0),i.value?(w(),S("div",Tb,"Loading skill contents...")):o.value?(w(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Sb)):le("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,xb)]),m("div",Cb,[m("div",Eb,[e.skill.installed?(w(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},he(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Ab)):(w(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},he(n.isInstalling?"Installing...":"Install"),9,Ib)),e.skill.installed?(w(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:O},he(a.value?"Disable":"Enable"),9,Rb)):le("",!0)])])])])):le("",!0)]))}}),Mb=Je($b,[["__scopeId","data-v-19a385ca"]]),Pb={class:"skills-hub"},Ob={class:"skills-hub-toolbar"},Nb={class:"skills-hub-search-wrap"},jb={key:0,class:"skills-hub-count"},Db={key:1,class:"skills-hub-section"},Lb={class:"skills-hub-section-title"},Bb={key:0,class:"skills-hub-grid"},Fb={class:"skills-hub-section"},Hb={key:0,class:"skills-hub-loading"},Ub={key:1,class:"skills-hub-error"},Vb={key:0,class:"skills-hub-grid"},Wb={key:1,class:"skills-hub-empty"},Ts="codex-web-local.skills-hub.cache.v1",qb=Et({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=P(null),s=P(""),o=P("date"),i=P([]),a=P([]),l=P(0),d=P(!1),u=P(""),f=P(!0),g=P(!1),_=P(n),O=P(null),I=P(""),F=P(!1),z=P(!1);let j=null,U=null;const D=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ue=ce(()=>{var pe;return((pe=O.value)==null?void 0:pe.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),fe=ce(()=>`${_.value.owner}/${_.value.name}`),ke=ce(()=>F.value&&I.value===fe.value),se=ce(()=>z.value&&I.value===fe.value),X=ce(()=>{const pe=s.value.toLowerCase().trim();return pe?a.value.filter(xe=>xe.name.toLowerCase().includes(pe)||xe.owner.toLowerCase().includes(pe)||(xe.displayName??"").toLowerCase().includes(pe)):a.value});function ge(pe,xe="success"){O.value={text:pe,type:xe},U&&clearTimeout(U),U=setTimeout(()=>{O.value=null},3e3)}function re(){o.value=o.value==="date"?"name":"date",Pe(s.value)}function Be(pe){return`${o.value}::${pe.trim().toLowerCase()}`}function He(pe){var xe;if(typeof window>"u")return null;try{const Te=window.localStorage.getItem(Ts);return Te?((xe=JSON.parse(Te).byKey)==null?void 0:xe[pe])??null:null}catch{return null}}function Ge(pe,xe){if(!(typeof window>"u"))try{const Te=window.localStorage.getItem(Ts),ee=(Te?JSON.parse(Te):{}).byKey??{};ee[pe]=xe,window.localStorage.setItem(Ts,JSON.stringify({byKey:ee}))}catch{}}function Ie(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Ts)}catch{}}function be(pe){const xe=pe.installed??[];a.value=xe;const Te=new Set(xe.map(E=>E.name));i.value=pe.data.map(E=>{if(E.installed||Te.has(E.name)){const ee=xe.find(Y=>Y.name===E.name);return{...E,installed:!0,path:(ee==null?void 0:ee.path)??E.path,enabled:(ee==null?void 0:ee.enabled)??E.enabled}}return E}).filter(E=>!E.installed),l.value=pe.total}async function Pe(pe){const xe=Be(pe),Te=He(xe);Te&&be(Te),d.value=!Te,u.value="";try{const E=new URLSearchParams;pe.trim()&&E.set("q",pe.trim()),E.set("limit","100"),E.set("sort",o.value);const ee=await fetch(`/codex-api/skills-hub?${E}`);if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const Y=await ee.json();be(Y),Ge(xe,Y)}catch(E){u.value=E instanceof Error?E.message:"Failed to load skills"}finally{d.value=!1}}function vt(){j&&clearTimeout(j),j=setTimeout(()=>Pe(s.value),300)}function Qe(pe){_.value=pe,g.value=!0}async function lt(pe){I.value=`${pe.owner}/${pe.name}`,F.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:pe.owner,name:pe.name})})).json();if(!Te.ok)throw new Error(Te.error||"Install failed");const E={...pe,installed:!0,path:Te.path,enabled:!0};a.value=[...a.value,E],i.value=i.value.filter(ee=>ee.name!==pe.name),_.value=E,ge(`${pe.displayName||pe.name} skill installed`),g.value=!1,Ie(),D("skills-changed")}catch(xe){ge(xe instanceof Error?xe.message:"Failed to install skill","error")}finally{F.value=!1}}async function Ye(pe){I.value=`${pe.owner}/${pe.name}`,z.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:pe.name,path:pe.path})})).json();if(!Te.ok)throw new Error(Te.error||"Uninstall failed");a.value=a.value.filter(E=>E.name!==pe.name),pe.owner!=="local"&&(i.value=[...i.value,{...pe,installed:!1,path:void 0,enabled:void 0}]),ge(`${pe.displayName||pe.name} skill uninstalled`),g.value=!1,Ie(),D("skills-changed")}catch(xe){ge(xe instanceof Error?xe.message:"Failed to uninstall skill","error")}finally{z.value=!1}}async function et(pe,xe){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:pe.path,enabled:xe}})})).ok)throw new Error("Failed to update skill");ge(`${pe.displayName||pe.name} skill ${xe?"enabled":"disabled"}`),await Pe(s.value)}catch(Te){ge(Te instanceof Error?Te.message:"Failed to update skill","error")}}return Nn(()=>{Pe("")}),(pe,xe)=>(w(),S("div",Pb,[xe[3]||(xe[3]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",Ob,[m("div",Nb,[Se(ti,{class:"skills-hub-search-icon"}),Mn(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":xe[0]||(xe[0]=Te=>s.value=Te),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:vt},null,544),[[Pn,s.value]]),l.value>0?(w(),S("span",jb,he(l.value)+" skills",1)):le("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:re},he(ae.value),1)]),O.value?(w(),S("div",{key:0,class:at(["skills-hub-toast",ue.value])},he(O.value.text),3)):le("",!0),X.value.length>0?(w(),S("div",Db,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:xe[1]||(xe[1]=Te=>f.value=!f.value)},[m("span",Lb,"Installed ("+he(X.value.length)+")",1),Se(Uc,{class:at(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),S("div",Bb,[(w(!0),S(Ue,null,wt(X.value,Te=>(w(),ft(nl,{key:Te.name,skill:Te,onSelect:E=>Qe(E)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),m("div",Fb,[d.value?(w(),S("div",Hb,"Loading skills...")):u.value?(w(),S("div",Ub,he(u.value),1)):(w(),S(Ue,{key:2},[i.value.length>0?(w(),S("div",Vb,[(w(!0),S(Ue,null,wt(i.value,Te=>(w(),ft(nl,{key:Te.url,skill:Te,onSelect:E=>Qe(E)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),S("div",Wb,'No skills found for "'+he(s.value)+'"',1)):le("",!0)],64))]),Se(Mb,{skill:_.value,visible:g.value,"is-installing":ke.value,"is-uninstalling":se.value,onClose:xe[2]||(xe[2]=Te=>g.value=!1),onInstall:lt,onUninstall:Ye,onToggleEnabled:et},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Kb=Je(qb,[["__scopeId","data-v-1967b404"]]),Gb={},zb={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 Yb(e,t){return w(),S("svg",zb,[...t[0]||(t[0]=[m("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),m("path",{d:"M9 4l0 16"},null,-1)])])}const Jb=Je(Gb,[["render",Yb]]),Qb={},Xb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function Zb(e,t){return w(),S("svg",Xb,[...t[0]||(t[0]=[m("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 e0=Je(Qb,[["render",Zb]]),t0={},n0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function r0(e,t){return w(),S("svg",n0,[...t[0]||(t[0]=[m("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),m("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const s0=Je(t0,[["render",r0]]),o0={class:"sidebar-thread-controls"},i0=["aria-label","title"],a0=["aria-pressed","aria-label","title"],l0=Et({__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)=>(w(),S("div",o0,[m("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]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),ft(e0,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ft(Jb,{key:1,class:"sidebar-thread-controls-icon"}))],8,i0),m("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Se(s0,{class:"sidebar-thread-controls-icon"})],8,a0),mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Se(Hs,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),rl=Je(l0,[["__scopeId","data-v-57866500"]]),c0={},u0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function d0(e,t){return w(),S("svg",u0,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("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"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const f0=Je(c0,[["render",d0]]);function qn(e){return e.flatMap(t=>t.threads)}const Gc="codex-web-local.thread-read-state.v1",zc="codex-web-local.thread-scroll-state.v1",ni="codex-web-local.selected-thread-id.v1",Yc="codex-web-local.project-order.v1",Jc="codex-web-local.project-display-name.v1",Qc="codex-web-local.auto-refresh-enabled.v1",Io=220,Jr=4e3,sl=["none","minimal","low","medium","high","xhigh"],Qr="__global__",Qt="gpt-5.2-codex";function h0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ol(e){typeof window>"u"||window.localStorage.setItem(Gc,JSON.stringify(e))}function p0(){return typeof window>"u"?!1:window.localStorage.getItem(Qc)==="1"}function il(e){typeof window>"u"||window.localStorage.setItem(Qc,e?"1":"0")}function Xc(e,t,n){return Math.min(Math.max(e,t),n)}function m0(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=Xc(t.scrollRatio,0,1)),n}function g0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=m0(s);o&&(n[r]=o)}return n}catch{return{}}}function al(e){typeof window>"u"||window.localStorage.setItem(zc,JSON.stringify(e))}function v0(){return typeof window>"u"?"":window.localStorage.getItem(ni)??""}function y0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(ni);return}window.localStorage.setItem(ni,e)}}function w0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Yc);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function Cr(e){typeof window>"u"||window.localStorage.setItem(Yc,JSON.stringify(e))}function b0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function Ro(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function Ss(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return dr(e,n)?e:n}function $o(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function dr(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function _0(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function k0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function xs(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 ri(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&dr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&k0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Us(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 T0(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=r.get(u.id);return f&&ri(f,u)?f:u});if(n.preserveMissing!==!0)return Us(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||ri(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Us(e,d)?e:d}function si(e){return e.replace(/\s+/gu," ").trim()}function S0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>si(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=si(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function ll(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ri(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Zc="worked";function Hn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function x0(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s: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 E0(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 A0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${x0(e.durationMs)}`,messageType:Zc}}function I0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function R0(e,t){const n=A0(t),r=e.filter(i=>i.messageType!==Zc),s=I0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function At(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function $0(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 P0(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 Mt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Cs(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&$0(d,l)?d:l});return o&&o.projectName===s.projectName&&M0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return P0(e,r)?e:r}function O0(e,t,n){const r=new Set(qn(t).map(a=>a.id)),s=qn(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.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 s){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 N0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Mo(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function j0(e){const t=e.split(`
|
|
44
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function D0(){const e=P([]),t=P([]),n=P(v0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),g=P("medium"),_=P(h0()),O=P(g0()),I=P(w0()),F=P(b0()),z=P({}),j=P({}),U=P({}),D=P({}),ae=P({}),ue=P({}),fe=P({}),ke=P({}),se=P({}),X=P({}),ge=P([]),re=P(!1),Be=P(!1),He=P(!1),Ge=P(!1),Ie=P(!1),be=P(""),Pe=P(!1),vt=P(!1),Qe=P(p0()),lt=P(Math.floor(Jr/1e3));let Ye=null,et=null,pe=null,xe=null,Te=!1;const E=new Set;let ee=!1,Y=!1;const ve=new Map,Oe=new Set,p=ce(()=>qn(e.value)),y=ce(()=>p.value.find(c=>c.id===n.value)??null),x=ce(()=>O.value[n.value]??null),N=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(ke.value[h])&&c.push(...ke.value[h]),Array.isArray(ke.value[Qr])&&c.push(...ke.value[Qr]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),B=ce(()=>{var G;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),T=(((G=ue.value[c])==null?void 0:G.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}}),L=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=D.value[c];return K?R0(G,K):G});function te(c){n.value!==c&&(n.value=c,y0(c),Y=!1)}function ne(c){f.value=c.trim()}async function Z(){f.value=Qt,u.value.includes(Qt)||(u.value=[...u.value,Qt]);try{await ny(Qt)}catch{}}function V(c,h){se.value={...se.value,[c]:h}}function ye(c){se.value[c]&&(se.value=At(se.value,c))}async function ie(c){if(Oe.has(c))return;const h=se.value[c];if(!(!h||h.fallbackRetried)){Oe.add(c),V(c,{...h,fallbackRetried:!0});try{await Z();try{const v=await Xa(c,1);Ce(c,v),Ee(c,[]),dt(c),i.value[c]&&(i.value=At(i.value,c))}catch{}A(c,null),be.value="",W(c,null),b(c,{label:"Thinking",details:_e(Qt,h.effort)}),J(c,!0),U.value[c]!==!0&&await Co(c),await Eo(c,h.text,h.imageUrls,Qt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},E.add(c),Te=!0,await nr()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";A(c,T),be.value=T,J(c,!1),b(c,null)}finally{Oe.delete(c)}}}function de(c){c&&!sl.includes(c)||(g.value=c)}function _e(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Le(){try{const[c,h]=await Promise.all([ry(),sy()]);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&&sl.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function qe(c){const h=X.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=h[T.id];return G?{...T,title:G}:T})}))}function Ae(){const h=qe(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,we=_.value[T.id],Re=d.value[T.id]===!0,me=!K&&!G&&(Re||we!==T.updatedAtIso);return{...T,inProgress:G,unread:me}})}));e.value=Cs(e.value,h)}function Xe(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=N0(G),we={id:c,title:j0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Re=t.value.findIndex(Ze=>Ze.projectName===K);if(Re>=0){const yt=t.value[Re].threads.filter(Ln=>Ln.id!==c),Sr={projectName:K,threads:[we,...yt]},bn=[...t.value];bn.splice(Re,1,Sr),t.value=bn}else t.value=[{projectName:K,threads:[we]},...t.value];const me=Ss(I.value,t.value);dr(I.value,me)||(I.value=me,Cr(I.value)),Ae()}function pt(c){const h=new Set(c.map(K=>K.id)),v=Mt(_.value,h);v!==_.value&&(_.value=v,ol(v));const T=Mt(O.value,h);T!==O.value&&(O.value=T,al(T)),j.value=Mt(j.value,h),z.value=Mt(z.value,h),U.value=Mt(U.value,h),r.value=Mt(r.value,h),s.value=Mt(s.value,h),o.value=Mt(o.value,h),i.value=Mt(i.value,h),D.value=Mt(D.value,h),ae.value=Mt(ae.value,h),ue.value=Mt(ue.value,h),fe.value=Mt(fe.value,h),d.value=Mt(d.value,h),a.value=Mt(a.value,h);const G={};for(const[K,we]of Object.entries(ke.value))(K===Qr||h.has(K))&&(G[K]=we);ke.value=G}function H(c){const h=qn(t.value).find(v=>v.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},ol(_.value),d.value[c]&&(d.value=At(d.value,c)),Ae())}function W(c,h){if(!c)return;const v=D.value[c];if(h){if(C0(v,h))return;D.value={...D.value,[c]:h}}else v&&(D.value=At(D.value,c))}function J(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=At(a.value,c),Ae())}function Ke(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Ae())}function b(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=At(ae.value,c));return}const T=Qn(h.label)||"Thinking",G=h.details.map(Re=>Qn(Re)).filter(Re=>Re.length>0&&Re!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),we={label:T,details:K};E0(v,we)||(ae.value={...ae.value,[c]:we})}function A(c,h){if(!c)return;const v=ue.value[c],T=h?si(h):"";if(!T){v&&(ue.value=At(ue.value,c));return}(v==null?void 0:v.message)!==T&&(ue.value={...ue.value,[c]:{message:T}})}function $(c){const h=qn(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Q(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=Xc(h.scrollRatio,0,1));const T=O.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(O.value={...O.value,[c]:v},al(O.value))}function Ce(c,h){const v=r.value[c]??[];Us(v,h)||(r.value={...r.value,[c]:h})}function Ee(c,h){const v=s.value[c]??[];Us(v,h)||(s.value={...s.value,[c]:h})}function ct(c,h){const v=s.value[c]??[],T=ll(v,h);Ee(c,T)}function tt(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=At(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function ut(c,h){if(!c)return;const v=o.value[c]??"";tt(c,`${v}${h}`)}function dt(c){c&&c in o.value&&(o.value=At(o.value,c))}function Ne(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function $e(c){return typeof c=="string"?c:""}function vn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Ut(c){const h=Ne(c.params);if(!h)return"";const v=$e(h.threadId);if(v)return v;const T=$e(h.thread_id);if(T)return T;const G=$e(h.conversationId);if(G)return G;const K=$e(h.conversation_id);if(K)return K;const we=Ne(h.thread),Re=$e(we==null?void 0:we.id);if(Re)return Re;const me=Ne(h.turn),Ze=$e(me==null?void 0:me.threadId);if(Ze)return Ze;const yt=$e(me==null?void 0:me.thread_id);return yt||""}function Br(c){if(c.method!=="turn/completed")return"";const h=Ne(c.params),v=Ne(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Ne(v.error);return $e(T==null?void 0:T.message)}function gr(c){var v;if(c.method!=="error")return"";const h=Ne(c.params);return $e(h==null?void 0:h.message)||$e((v=Ne(h==null?void 0:h.error))==null?void 0:v.message)}function Yn(c){const h=Ne(c);if(!h)return null;const v=h.id,T=$e(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Ne(G),we=$e(K==null?void 0:K.threadId)||Qr,Re=$e(K==null?void 0:K.turnId),me=$e(K==null?void 0:K.itemId),Ze=$e(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:we,turnId:Re,itemId:me,receivedAtIso:Ze,params:G??null}}function vr(c){const h=c.threadId||Qr,v=ke.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),ke.value={...ke.value,[h]:G.sort((K,we)=>K.receivedAtIso.localeCompare(we.receivedAtIso))}}function Jn(c){const h={};for(const[v,T]of Object.entries(ke.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}ke.value=h}function qt(c){if(c.method==="server/request"){const h=Yn(c.params);return h&&vr(h),!0}if(c.method==="server/request/resolved"){const h=Ne(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&Jn(v),!0}return!1}function Qn(c){return c.replace(/\s+/gu," ").trim()}function Xn(c){const h=Ut(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Ne(c.params),T=Ne(v==null?void 0:v.item),G=$e(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=$e(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}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 yr(c){if(c.method!=="turn/started")return null;const h=Ne(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Ne(h.turn),G=$e(T==null?void 0:T.id)||$e(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Hn($e(T==null?void 0:T.startedAt))??Hn($e(h.startedAt))??Hn(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function wr(c){if(c.method!=="turn/completed")return null;const h=Ne(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Ne(h.turn),G=$e(T==null?void 0:T.id)||$e(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Hn($e(T==null?void 0:T.completedAt))??Hn($e(h.completedAt))??Hn(c.atIso)??Date.now(),we=Hn($e(T==null?void 0:T.startedAt))??Hn($e(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:we}}function an(c){return`${c}:live-reasoning`}function Fr(c){const h=Ne(c.params);if(!h)return"";if(c.method==="item/started"){const v=Ne(h.item);return!v||v.type!=="reasoning"?"":$e(v.id)}return""}function yn(c){const h=Ne(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{messageId:an(v),delta:T}}return null}function br(c){const h=Ne(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=$e(h.itemId);return v?an(v):""}return""}function Hr(c){const h=Ne(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Ne(h.item);return!v||v.type!=="reasoning"?"":an($e(v.id))}return""}function Zn(c){const h=Ne(c.params);if(!h)return"";if(c.method==="item/started"){const v=Ne(h.item);return!v||v.type!=="agentMessage"?"":$e(v.id)}return""}function _r(c){const h=Ne(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function ln(c){const h=Ne(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Ne(h.item);if(!v||v.type!=="agentMessage")return null;const T=$e(v.id),G=$e(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function Ur(c){if(c.method!=="item/started")return null;const h=Ne(c.params),v=Ne(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=$e(v.id),G=$e(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function kr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Ne(c.params);if(!h)return null;const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{itemId:v,delta:T}}function Tr(c){if(c.method!=="item/completed")return null;const h=Ne(c.params),v=Ne(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=$e(v.id),G=$e(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,we=$e(v.status),Re=we==="failed"?"failed":we==="declined"?"declined":we==="interrupted"?"interrupted":"completed",me=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",Ze=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Re,aggregatedOutput:me,exitCode:Ze}}}function wn(c,h){const v=i.value[c]??[],T=ll(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Vr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=At(i.value,c):i.value={...i.value,[c]:G})}function k(c){if(c.method==="item/agentMessage/delta")return!0;const h=Ne(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Ne(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function C(c){var Oi,Ni,ji,Di;if(qt(c))return;if(c.method==="thread/name/updated"){const We=Ne(c.params),un=$e(We==null?void 0:We.threadId),rr=$e(We==null?void 0:We.threadName);un&&rr&&(X.value={...X.value,[un]:rr},Ae(),Ao(un,rr))}const h=Xn(c);h&&b(h.threadId,h.activity);const v=yr(c);v&&(ve.set(v.turnId,v),fe.value={...fe.value,[v.threadId]:v.turnId},W(v.threadId,null),A(v.threadId,null),J(v.threadId,!0),d.value[v.threadId]&&(d.value=At(d.value,v.threadId)));const T=wr(c),G=Br(c),we=!!((T==null?void 0:T.threadId)??Ut(c))&&!!G&&f.value!==Qt&&xs(new Error(G));if(T){const We=ve.get(T.turnId);We&&ve.delete(T.turnId);const un=vn((Oi=Ne(c.params))==null?void 0:Oi.durationMs)??vn((ji=Ne((Ni=Ne(c.params))==null?void 0:Ni.turn))==null?void 0:ji.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(We?T.completedAtMs-We.startedAtMs:null),rr=typeof un=="number"?Math.max(0,un):0;W(T.threadId,{turnId:T.turnId,durationMs:rr}),fe.value[T.threadId]&&(fe.value=At(fe.value,T.threadId)),J(T.threadId,!1),b(T.threadId,null),Ke(T.threadId),we||(ye(T.threadId),Ct(T.threadId))}if(G){const We=(T==null?void 0:T.threadId)||Ut(c);We&&A(We,G),be.value=G,We&&we&&ie(We)}else T&&A(T.threadId,null);const Re=gr(c);if(Re){const We=Ut(c);We&&A(We,Re),be.value=Re,f.value!==Qt&&xs(new Error(Re))&&(We?ie(We):Z())}const me=Ut(c);if(!me||me!==n.value)return;Zn(c);const Ze=_r(c);if(Ze){const We=(s.value[me]??[]).find(rr=>rr.id===Ze.messageId),un=`${(We==null?void 0:We.text)??""}${Ze.delta}`;ct(me,{id:Ze.messageId,role:"assistant",text:un,messageType:"agentMessage.live"})}const yt=ln(c);yt&&ct(me,yt),Fr(c);const Sr=yn(c);if(Sr&&ut(me,Sr.delta),br(c)){const We=o.value[me]??"";We.trim().length>0&&!We.endsWith(`
|
|
45
|
-
|
|
46
|
-
`)&&tt(me,`${We}
|
|
47
|
-
|
|
48
|
-
`)}Hr(c);const Ln=Ur(c);Ln&&(wn(me,Ln),b(me,{label:"Running command",details:[((Di=Ln.commandExecution)==null?void 0:Di.command)??""]}));const io=kr(c);if(io){const We=(i.value[me]??[]).find(un=>un.id===io.itemId);We!=null&&We.commandExecution&&wn(me,{...We,commandExecution:{...We.commandExecution,aggregatedOutput:`${We.commandExecution.aggregatedOutput}${io.delta}`}})}const Pi=Tr(c);if(Pi&&wn(me,Pi),k(c)&&(Y&&n.value&&Q(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),dt(me)),c.method==="turn/completed"){Y=!1,dt(me),i.value[me]&&(i.value=At(i.value,me));const We=Ut(c);We&&(J(We,!1),b(We,null),Ke(We),we||(ye(We),Ct(We)))}}function R(c){const h=Ut(c);h&&E.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Te=!0),!(et!==null||typeof window>"u")&&(et=window.setTimeout(()=>{et=null,nr()},Io))}async function q(c){if(!ee){ee=!0;try{const h=await Zo(),v=[];for(const T of h.order){const G=Mo(T);v.includes(G)||v.push(G)}if(v.length>0){const T=Ss(v,c);dr(I.value,T)||(I.value=T,Cr(I.value))}if(Object.keys(h.labels).length>0){const T={...F.value};let G=!1;for(const[K,we]of Object.entries(h.labels)){const Re=Mo(K);T[Re]!==we&&(T[Re]=we,G=!0)}G&&(F.value=T,Ro(T))}}catch{}}}async function Fe(){if(!(Object.keys(X.value).length>0))try{const c=await dy();Object.keys(c.titles).length>0&&(X.value=c.titles)}catch{}}async function kt(c,h,v){if(X.value[c])return;const T=h.trim();if(!T)return;const G=T.length>300?T.slice(0,300):T;try{const K=await fy(G,v);if(!K||X.value[c])return;X.value={...X.value,[c]:K},Ae(),Ao(c,K)}catch{}}async function Tt(){var c;vt.value||(re.value=!0);try{const[h]=await Promise.all([Kv(),Fe()]);await q(h);const v=Ss(I.value,h);dr(I.value,v)||(I.value=v,Cr(I.value));const T=$o(h,I.value),G=O0(t.value,T,a.value);t.value=Cs(t.value,G),a.value=Mt(a.value,new Set(qn(t.value).map(Re=>Re.id))),Ae(),vt.value=!0;const K=qn(e.value);pt(K),K.some(Re=>Re.id===n.value)||te(((c=K[0])==null?void 0:c.id)??"")}finally{re.value=!1}}async function cn(c,h={}){if(!c)return;const v=j.value[c]===!0,T=h.silent!==!0&&!v;T&&(Be.value=!0);try{U.value[c]!==!0&&(await Co(c),U.value={...U.value,[c]:!0});const{messages:G,inProgress:K}=await Gv(c),we=r.value[c]??[],Re=T0(we,G,{preserveMissing:h.silent===!0});Ce(c,Re);const me=s.value[c]??[],Ze=S0(me,G);Ee(c,Ze),Vr(c,G),j.value={...j.value,[c]:!0};const yt=$(c);yt&&(z.value={...z.value,[c]:yt}),J(c,K),H(c)}finally{T&&(Be.value=!1)}}async function er(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);ge.value=await hy(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Yt(){be.value="";try{await Tt(),await Promise.all([Le(),er()]),await cn(n.value)}catch(c){be.value=c instanceof Error?c.message:"Unknown application error"}}async function Dn(c){te(c);try{await cn(c)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function tr(c){try{await Qv(c),await Tt(),n.value===c&&await cn(n.value)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function Wr(c,h){const v=h.trim();if(!(!c||!v))try{await Xv(c,v),X.value={...X.value,[c]:v},Ae(),Ao(c,v)}catch(T){be.value=T instanceof Error?T.message:"Unknown application error"}}async function M(c,h=[],v=[],T="steer",G=[]){const K=n.value,we=c.trim();if(!K||!we&&h.length===0&&G.length===0)return;const Re=a.value[K]===!0;if(Re&&T==="queue"){const me=l.value[K]??[],Ze=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...me,{id:Ze,text:we,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Re){Y=!0,Me(K,we,h,v,G).catch(me=>{const Ze=me instanceof Error?me.message:"Unknown application error";A(K,Ze),be.value=Ze});return}be.value="",Y=!0,W(K,null),b(K,{label:"Thinking",details:_e(f.value,g.value)}),A(K,null),J(K,!0);try{await Me(K,we,h,v,G)}catch(me){Y=!1,J(K,!1),b(K,null);const Ze=me instanceof Error?me.message:"Unknown application error";throw A(K,Ze),be.value=Ze,me}}async function oe(c,h,v=[],T=[],G=[]){const K=c.trim(),we=h.trim(),Re=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";He.value=!0,be.value="";let me="";try{try{me=await Za(we||void 0,Re||void 0)}catch(bn){if(Re&&Re!==Qt&&xs(bn))await Z(),me=await Za(we||void 0,Qt);else throw bn}if(!me)return"";Xe(me,we,K||"[Image]"),U.value={...U.value,[me]:!0},te(me),Y=!0,W(me,null),b(me,{label:"Thinking",details:_e(f.value,g.value)}),A(me,null),J(me,!0);const Ze=me,yt=we||null,Sr=K;return Me(me,K,v,T,G).catch(bn=>{Y=!1,J(me,!1),b(me,null);const Ln=bn instanceof Error?bn.message:"Unknown application error";A(me,Ln),be.value=Ln}).finally(()=>{He.value=!1}),kt(Ze,Sr,yt),me}catch(Ze){Y=!1,me&&(J(me,!1),b(me,null));const yt=Ze instanceof Error?Ze.message:"Unknown application error";throw me&&A(me,yt),be.value=yt,He.value=!1,Ze}}async function Me(c,h,v=[],T=[],G=[]){const K=f.value.trim(),we=g.value,Re=h.trim(),me=T.map(yt=>({name:yt.name,path:yt.path})),Ze=G.map(yt=>({...yt}));V(c,{text:Re,imageUrls:[...v],skills:me,fileAttachments:Ze,effort:we,fallbackRetried:!1});try{U.value[c]!==!0&&await Co(c);try{await Eo(c,h,v,K||void 0,we||void 0,T.length>0?T:void 0,G)}catch(yt){if(K&&K!==Qt&&xs(yt))await Z(),V(c,{text:Re,imageUrls:[...v],skills:me,fileAttachments:Ze,effort:we,fallbackRetried:!0}),await Eo(c,h,v,Qt,we||void 0,T.length>0?T:void 0,G);else throw yt}U.value={...U.value,[c]:!0},E.add(c),Te=!0,await nr()}catch(yt){throw yt}}async function Ct(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}:At(l.value,c),He.value=!0,be.value="",Y=!0,W(c,null),b(c,{label:"Thinking",details:_e(f.value,g.value)}),A(c,null),J(c,!0);try{await Me(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{J(c,!1),b(c,null)}finally{He.value=!1}}async function Kt(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=fe.value[c];Ge.value=!0,be.value="";try{await ty(c,h),J(c,!1),b(c,null),A(c,null),fe.value[c]&&(fe.value=At(fe.value,c)),E.add(c),Te=!0,await nr()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";A(c,T),be.value=T}finally{Ge.value=!1}}async function Rt(c){const h=n.value;if(!h||Ie.value)return;const T=(r.value[h]??[]).reduce((K,we)=>typeof we.turnIndex=="number"&&we.turnIndex>K?we.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ie.value=!0,be.value="";try{const K=await Xa(h,G);Ce(h,K),Ee(h,[]),dt(h),i.value[h]&&(i.value=At(i.value,h)),W(h,null),b(h,null),A(h,null),Te=!0,await nr()}catch(K){be.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ie.value=!1}}}function $t(c,h){c.length===0||(F.value[c]??"")===h||(F.value={...F.value,[c]:h},Ro(F.value))}function eu(c){var G;if(c.length===0)return;const h=I.value.filter(K=>K!==c);if(dr(I.value,h)||(I.value=h,Cr(I.value)),t.value=t.value.filter(K=>K.projectName!==c),F.value[c]!==void 0){const K={...F.value};delete K[c],F.value=K,Ro(K)}Ae();const v=qn(e.value);pt(v),v.some(K=>K.id===n.value)||te(((G=v[0])==null?void 0:G.id)??""),oo()}function tu(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(me=>me.projectName),T=v.indexOf(c);if(T===-1)return;const G=Math.max(0,Math.min(h,v.length-1)),K=_0(v,T,G);if(K===v)return;const we=Ss(K,t.value);I.value=we,Cr(I.value);const Re=$o(t.value,I.value);t.value=Cs(t.value,Re),Ae(),oo()}function nu(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(G=>G!==h)];if(dr(I.value,v))return;I.value=v,Cr(I.value);const T=$o(t.value,I.value);t.value=Cs(t.value,T),Ae(),oo()}async function oo(){var c,h;try{const v=await Zo(),T=new Map;for(const we of v.order){const Re=Mo(we);T.has(Re)||T.set(Re,we)}for(const we of t.value){const Re=((h=(c=we.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Re&&T.set(we.projectName,Re)}const G=[];for(const we of I.value){const Re=T.get(we);Re&&!G.includes(Re)&&G.push(Re)}for(const we of v.order)G.includes(we)||G.push(we);const K=v.active.filter(we=>G.includes(we));K.length===0&&G.length>0&&K.push(G[0]),await ay({order:G,labels:v.labels,active:K})}catch{}}async function ru(){if(!Pe.value){Pe.value=!0;try{if(await Tt(),!n.value)return;const c=n.value,h=$(c),v=z.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await cn(c,{silent:!0})}catch{}finally{Pe.value=!1}}}async function nr(){if(Pe.value){typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,nr()},Io));return}Pe.value=!0;const c=Te,h=new Set(E);Te=!1,E.clear();try{c&&await Tt();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=$(v),we=z.value[v]??"",Re=K.length>0&&K!==we;(T||G||Re||c)&&await cn(v,{silent:!0})}catch{}finally{Pe.value=!1,(Te||E.size>0)&&typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,nr()},Io))}}function su(){typeof window>"u"||Ye||(Qe.value&&$i(),ou(),Ye=zv(c=>{C(c),R(c)}))}async function ou(){try{const c=await Jv();for(const h of c){const v=Yn(h);v&&vr(v)}}catch{}}async function iu(c){try{await Yv(c.id,{result:c.result,error:c.error}),Jn(c.id)}catch(h){be.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Ri(c={}){const h=c.updatePreference??!0;pe!==null&&typeof window<"u"&&(window.clearInterval(pe),pe=null),xe!==null&&typeof window<"u"&&(window.clearInterval(xe),xe=null),h&&(Qe.value=!1,il(!1)),lt.value=Math.floor(Jr/1e3)}function $i(){typeof window>"u"||pe!==null||xe!==null||(Qe.value=!0,il(!0),lt.value=Math.floor(Jr/1e3),pe=window.setInterval(()=>{lt.value=Math.floor(Jr/1e3),ru()},Jr),xe=window.setInterval(()=>{lt.value=Math.max(0,lt.value-1)},1e3))}function au(){if(Qe.value){Ri();return}$i()}function lu(){Ri({updatePreference:!1}),Ye&&(Ye(),Ye=null),Te=!1,E.clear(),ve.clear(),et!==null&&typeof window<"u"&&(window.clearTimeout(et),et=null),Y=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},D.value={},ue.value={},fe.value={},l.value={}}const cu=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Mi(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:At(l.value,h)}function uu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Mi(c),M(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:F,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:N,selectedLiveOverlay:B,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:ge,messages:L,isLoadingThreads:re,isLoadingMessages:Be,isSendingMessage:He,isInterruptingTurn:Ge,isAutoRefreshEnabled:Qe,autoRefreshSecondsLeft:lt,error:be,refreshAll:Yt,refreshSkills:er,selectThread:Dn,setThreadScrollState:Q,archiveThreadById:tr,renameThreadById:Wr,sendMessageToSelectedThread:M,sendMessageToNewThread:oe,interruptSelectedThreadTurn:Kt,rollbackSelectedThread:Rt,isRollingBack:Ie,selectedThreadQueuedMessages:cu,removeQueuedMessage:Mi,steerQueuedMessage:uu,setSelectedModelId:ne,setSelectedReasoningEffort:de,respondToPendingServerRequest:iu,renameProject:$t,removeProject:eu,reorderProject:tu,pinProjectToTop:nu,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const L0={class:"sidebar-root"},B0={class:"sidebar-scrollable"},F0=["aria-pressed"],H0={key:1,class:"sidebar-search-bar"},U0={key:0,class:"sidebar-settings-area"},V0={key:0,class:"sidebar-settings-panel"},W0={class:"sidebar-settings-value"},q0={class:"sidebar-settings-value"},K0={class:"content-root"},G0={class:"content-body"},z0={key:1,class:"content-grid"},Y0={class:"new-thread-empty"},J0={class:"worktree-init-status-title"},Q0={class:"worktree-init-status-message"},X0={key:2,class:"content-grid"},Z0={class:"content-thread"},e_={class:"composer-with-queue"},t_={class:"build-badge","aria-label":"Worktree name"},cl="codex-web-local.sidebar-collapsed.v1",ul="codex-web-local.send-with-enter.v1",dl="codex-web-local.in-progress-send-mode.v1",fl="codex-web-local.dark-mode.v1",n_=Et({__name:"App",setup(e){const t="codex-web-local",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:_,isLoadingThreads:O,isLoadingMessages:I,isInterruptingTurn:F,isAutoRefreshEnabled:z,autoRefreshSecondsLeft:j,refreshAll:U,refreshSkills:D,selectThread:ae,setThreadScrollState:ue,archiveThreadById:fe,renameThreadById:ke,sendMessageToSelectedThread:se,sendMessageToNewThread:X,interruptSelectedThreadTurn:ge,rollbackSelectedThread:re,isRollingBack:Be,selectedThreadQueuedMessages:He,removeQueuedMessage:Ge,steerQueuedMessage:Ie,setSelectedModelId:be,setSelectedReasoningEffort:Pe,respondToPendingServerRequest:vt,renameProject:Qe,removeProject:lt,reorderProject:Ye,pinProjectToTop:et,toggleAutoRefreshTimer:pe,startPolling:xe,stopPolling:Te}=D0(),E=zh(),ee=Gh(),{isMobile:Y}=Hc(),ve=P(!1),Oe=P(!1),p=P(""),y=P("local"),x=P({order:[],labels:{}}),N=P({phase:"idle",title:"",message:""}),B=P(cn()),L=P(""),te=P(!1),ne=P(null),Z=P("New Project (1)"),V=P(""),ye=P(!1),ie=P(k(ul,!0)),de=P(R()),_e=P(C()),Le=ce(()=>{const M=E.params.threadId;return typeof M=="string"?M:""}),qe=ce(()=>{const M=new Set;for(const oe of n.value)for(const Me of oe.threads)M.add(Me.id);return M}),Ae=ce(()=>E.name==="home"),Xe=ce(()=>E.name==="skills"),pt=ce(()=>{var M;return Xe.value?"Skills":Ae.value?"New thread":((M=s.value)==null?void 0:M.title)??"Choose a thread"}),H=ce(()=>z.value?`Auto refresh in ${String(j.value)}s`:"Enable 4s refresh"),W=ce(()=>_.value.filter(M=>{const oe=Yt(M.messageType,M.role);return oe==="worked"?!0:!(oe==="turnActivity.live"||oe==="turnError.live"||oe==="agentReasoning.live")})),J=ce(()=>a.value),Ke=ce(()=>Ae.value?"__new-thread__":l.value),b=ce(()=>{var M,oe;return Ae.value?p.value.trim():((oe=(M=s.value)==null?void 0:M.cwd)==null?void 0:oe.trim())??""}),A=ce(()=>{var M;return!Ae.value&&((M=s.value)==null?void 0:M.inProgress)===!0}),$=ce(()=>{var Ct,Kt;const M=[],oe=new Set;for(const Rt of x.value.order){const $t=Rt.trim();!$t||oe.has($t)||(oe.add($t),M.push({value:$t,label:x.value.labels[$t]||ln($t)}))}for(const Rt of n.value){const $t=((Kt=(Ct=Rt.threads[0])==null?void 0:Ct.cwd)==null?void 0:Kt.trim())??"";!$t||oe.has($t)||(oe.add($t),M.push({value:$t,label:r.value[Rt.projectName]??Rt.projectName}))}const Me=p.value.trim();return Me&&!oe.has(Me)&&M.unshift({value:Me,label:ln(Me)}),M}),Q=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Nn(()=>{window.addEventListener("keydown",Qn),Tt(),Q==null||Q.addEventListener("change",Tt),Dn(),Hr(),Zn(),yn()}),Xs(()=>{window.removeEventListener("keydown",Qn),Q==null||Q.removeEventListener("change",Tt),Te()});function Ce(){D()}function Ee(){te.value=!te.value,te.value?zt(()=>{var M;return(M=ne.value)==null?void 0:M.focus()}):L.value=""}function ct(){var M;L.value="",(M=ne.value)==null||M.focus()}function tt(M){M.key==="Escape"&&(te.value=!1,L.value="")}function ut(M){M&&(E.name==="thread"&&Le.value===M||(ee.push({name:"thread",params:{threadId:M}}),Y.value&&qt(!0)))}function dt(M){fe(M)}function Ne(M){var Ct,Kt;const oe=n.value.find(Rt=>Rt.projectName===M),Me=((Kt=(Ct=oe==null?void 0:oe.threads[0])==null?void 0:Ct.cwd)==null?void 0:Kt.trim())??"";Me&&(p.value=Me),Y.value&&qt(!0),!Ae.value&&ee.push({name:"home"})}function $e(){var oe,Me;const M=((Me=(oe=s.value)==null?void 0:oe.cwd)==null?void 0:Me.trim())??"";M&&(p.value=M),Y.value&&qt(!0),!Ae.value&&ee.push({name:"home"})}function vn(M){Qe(M.projectName,M.displayName)}function Ut(M){ke(M.threadId,M.title)}function Br(M){lt(M)}function gr(M){Ye(M.projectName,M.toIndex)}function Yn(M){ue(M.threadId,M.state)}function vr(M){vt(M)}function Jn(){pe()}function qt(M){B.value!==M&&(B.value=M,er(M))}function Qn(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),qt(!B.value))}function Xn(M){const oe=M.text;if(Ae.value){Wr(oe,M.imageUrls,M.skills,M.fileAttachments);return}se(oe,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function yr(M){p.value=M.trim()}async function wr(M){const oe=M.trim();if(!oe)return;const Me=Fr(oe),Ct=await an(),Kt=Me?oe:Ur(Ct,oe);if(Kt)try{const Rt=await ly(Kt,{createIfMissing:!Me,label:Me?"":oe});Rt&&(p.value=Rt,et(ln(Rt)),Zn(),yn())}catch{}}async function an(){const M=br();if(M)return M;try{const oe=await el();if(oe)return V.value=oe,oe}catch{}return""}function Fr(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function yn(){const M=br();if(!M){Z.value="New Project (1)";return}try{const oe=await cy(M);Z.value=oe.name||"New Project (1)"}catch{Z.value="New Project (1)"}}function br(){var Me,Ct;const M=p.value.trim();if(M)return _r(M);const oe=((Ct=(Me=$.value[0])==null?void 0:Me.value)==null?void 0:Ct.trim())??"";return oe?_r(oe):V.value.trim()}async function Hr(){try{V.value=await el()}catch{V.value=""}}async function Zn(){try{const M=await Zo();x.value={order:[...M.order],labels:{...M.labels}}}catch{x.value={order:[],labels:{}}}}function _r(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const Me=oe.lastIndexOf("/");return Me<=0?"":oe.slice(0,Me)}function ln(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const Me=oe.lastIndexOf("/");return Me<0?oe:oe.slice(Me+1)}function Ur(M,oe){const Me=M.trim().replace(/\/+$/,""),Ct=oe.trim().replace(/^\/+/,"");return!Me||!Ct?"":`${Me}/${Ct}`}function kr(M){be(M)}function Tr(M){Pe(M)}function wn(){ge()}function Vr(M){re(M.turnIndex)}function k(M,oe){if(typeof window>"u")return oe;const Me=window.localStorage.getItem(M);return Me===null?oe:Me==="1"}function C(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(fl);return M==="light"||M==="dark"?M:"system"}function R(){return typeof window>"u"?"queue":window.localStorage.getItem(dl)==="steer"?"steer":"queue"}function q(){ie.value=!ie.value,window.localStorage.setItem(ul,ie.value?"1":"0")}function Fe(){de.value=de.value==="steer"?"queue":"steer",window.localStorage.setItem(dl,de.value)}function kt(){const M=["system","light","dark"],oe=M.indexOf(_e.value);_e.value=M[(oe+1)%M.length],window.localStorage.setItem(fl,_e.value),Tt()}function Tt(){const M=document.documentElement;if(_e.value==="dark")M.classList.add("dark");else if(_e.value==="light")M.classList.remove("dark");else{const oe=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",oe)}}function cn(){return typeof window>"u"?!1:window.localStorage.getItem(cl)==="1"}function er(M){typeof window>"u"||window.localStorage.setItem(cl,M?"1":"0")}function Yt(M,oe){const Me=(M??"").trim();return Me.length>0?Me:oe.trim()||"message"}async function Dn(){await U(),Oe.value=!0,await tr(),xe()}async function tr(){if(!ve.value){ve.value=!0;try{if(E.name==="home"||E.name==="skills"){l.value!==""&&await ae("");return}if(E.name==="thread"){const M=Le.value;if(!M)return;if(!qe.value.has(M)){await ee.replace({name:"home"});return}l.value!==M&&await ae(M);return}}finally{ve.value=!1}}}ht(()=>[E.name,Le.value,O.value,qe.value.has(Le.value),l.value],async()=>{Oe.value&&await tr()}),ht(()=>l.value,async M=>{if(Oe.value&&!ve.value&&!(Ae.value||Xe.value)){if(!M){E.name!=="home"&&await ee.replace({name:"home"});return}E.name==="thread"&&Le.value===M||await ee.replace({name:"thread",params:{threadId:M}})}}),ht(()=>$.value,M=>{if(M.length===0){p.value="";return}M.some(Me=>Me.value===p.value)||(p.value=M[0].value),yn()},{immediate:!0}),ht(()=>p.value,()=>{N.value={phase:"idle",title:"",message:""},yn()}),ht(()=>y.value,M=>{M==="local"&&(N.value={phase:"idle",title:"",message:""})}),ht(()=>E.name,M=>{M!=="home"&&(N.value={phase:"idle",title:"",message:""})}),ht(()=>l.value,()=>{N.value={phase:"idle",title:"",message:""}}),ht(Y,M=>{M&&!B.value&&qt(!0)});async function Wr(M,oe=[],Me=[],Ct=[]){try{N.value={phase:"idle",title:"",message:""};let Kt=p.value;if(y.value==="worktree"){N.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const $t=await iy(p.value);Kt=$t.cwd,p.value=$t.cwd,N.value={phase:"idle",title:"",message:""}}catch{N.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Rt=await X(M,Kt,oe,Me,Ct);if(!Rt)return;await ee.replace({name:"thread",params:{threadId:Rt}})}catch{}}return(M,oe)=>(w(),S(Ue,null,[Se(ep,{"is-sidebar-collapsed":B.value,onCloseSidebar:oe[6]||(oe[6]=Me=>qt(!0))},{sidebar:it(()=>[m("section",L0,[m("div",B0,[B.value?le("",!0):(w(),ft(rl,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":H.value,"show-new-thread-button":!0,onToggleSidebar:oe[0]||(oe[0]=Me=>qt(!B.value)),onToggleAutoRefresh:Jn,onStartNewThread:$e},{default:it(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":te.value,"aria-label":"Search threads",title:"Search threads",onClick:Ee},[Se(ti,{class:"sidebar-search-toggle-icon"})],8,F0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!B.value&&te.value?(w(),S("div",H0,[Se(ti,{class:"sidebar-search-bar-icon"}),Mn(m("input",{ref_key:"sidebarSearchInputRef",ref:ne,"onUpdate:modelValue":oe[1]||(oe[1]=Me=>L.value=Me),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:tt},null,544),[[Pn,L.value]]),L.value.length>0?(w(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:ct},[Se(Ei,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),B.value?le("",!0):(w(),S("button",{key:2,class:at(["sidebar-skills-link",{"is-active":Xe.value}]),type:"button",onClick:oe[2]||(oe[2]=Me=>{je(ee).push({name:"skills"}),je(Y)&&qt(!0)})}," Skills Hub ",2)),B.value?le("",!0):(w(),ft(Bm,{key:3,groups:je(n),"project-display-name-by-id":je(r),"selected-thread-id":je(l),"is-loading":je(O),"search-query":L.value,onSelect:ut,onArchive:dt,onStartNewThread:Ne,onRenameProject:vn,onRenameThread:Ut,onRemoveProject:Br,onReorderProject:gr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))]),B.value?le("",!0):(w(),S("div",U0,[Se(Ac,{name:"settings-panel"},{default:it(()=>[ye.value?(w(),S("div",V0,[m("button",{class:"sidebar-settings-row",type:"button",onClick:q},[oe[7]||(oe[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:at(["sidebar-settings-toggle",{"is-on":!ie.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Fe},[oe[8]||(oe[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",W0,he(de.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:kt},[oe[9]||(oe[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",q0,he(_e.value==="system"?"System":_e.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:oe[3]||(oe[3]=Me=>ye.value=!ye.value)},[Se(f0,{class:"sidebar-settings-icon"}),oe[10]||(oe[10]=m("span",null,"Settings",-1))])]))])]),content:it(()=>[m("section",K0,[Se(qm,{title:pt.value},{leading:it(()=>[B.value||je(Y)?(w(),ft(rl,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":H.value,"show-new-thread-button":!0,onToggleSidebar:oe[4]||(oe[4]=Me=>qt(!B.value)),onToggleAutoRefresh:Jn,onStartNewThread:$e},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):le("",!0)]),_:1},8,["title"]),m("section",G0,[Xe.value?(w(),ft(Kb,{key:0,onSkillsChanged:Ce})):Ae.value?(w(),S("div",z0,[m("div",Y0,[oe[11]||(oe[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Se(ei,{class:"new-thread-folder-dropdown","model-value":p.value,options:$.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":Z.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":yr,onAdd:wr},null,8,["model-value","options","default-add-value"]),Se(Jw,{class:"new-thread-runtime-dropdown",modelValue:y.value,"onUpdate:modelValue":oe[5]||(oe[5]=Me=>y.value=Me)},null,8,["modelValue"]),N.value.phase!=="idle"?(w(),S("div",{key:0,class:at(["worktree-init-status",{"is-running":N.value.phase==="running","is-error":N.value.phase==="error"}])},[m("strong",J0,he(N.value.title),1),m("span",Q0,he(N.value.message),1)],2)):le("",!0)]),Se(tl,{"active-thread-id":Ke.value,cwd:b.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ie.value,"in-progress-submit-mode":de.value,onSubmit:Xn,"onUpdate:selectedModel":kr,"onUpdate:selectedReasoningEffort":Tr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),S("div",X0,[m("div",Z0,[Se(_v,{messages:W.value,"is-loading":je(I),"active-thread-id":Ke.value,"scroll-state":je(o),"live-overlay":J.value,"pending-requests":je(i),"is-turn-in-progress":A.value,"is-rolling-back":je(Be),onUpdateScrollState:Yn,onRespondServerRequest:vr,onRollback:Vr},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",e_,[Se(Uw,{messages:je(He),onSteer:je(Ie),onDelete:je(Ge)},null,8,["messages","onSteer","onDelete"]),Se(tl,{"active-thread-id":Ke.value,cwd:b.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":A.value,"is-interrupting-turn":je(F),"has-queue-above":je(He).length>0,"send-with-enter":ie.value,"in-progress-submit-mode":de.value,onSubmit:Xn,"onUpdate:selectedModel":kr,"onUpdate:selectedReasoningEffort":Tr,onInterrupt:wn},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"]),m("div",t_," WT "+he(je(t)),1)],64))}}),r_=Je(n_,[["__scopeId","data-v-abd766e6"]]),Po={render:()=>null},s_=Kh({history:Sh(),routes:[{path:"/",name:"home",component:Po},{path:"/thread/:threadId",name:"thread",component:Po},{path:"/skills",name:"skills",component:Po},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Df(r_).use(s_).mount("#app");
|