codexapp 0.1.42 → 0.1.45
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-B6BqKv1b.css +1 -0
- package/dist/assets/index-DFsz7W1m.js +50 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +447 -1269
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/assets/index-Dwgxc732.js +0 -1424
- package/dist/assets/index-eKA4YUIc.css +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
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.30
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function li(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const gt={},Or=[],Sn=()=>{},gl=()=>!1,Gs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ci=e=>e.startsWith("onUpdate:"),It=Object.assign,ui=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,ct=(e,t)=>du.call(e,t),Be=Array.isArray,Nr=e=>ws(e)==="[object Map]",vl=e=>ws(e)==="[object Set]",Hi=e=>ws(e)==="[object Date]",We=e=>typeof e=="function",Tt=e=>typeof e=="string",dn=e=>typeof e=="symbol",ut=e=>e!==null&&typeof e=="object",yl=e=>(ut(e)||We(e))&&We(e.then)&&We(e.catch),wl=Object.prototype.toString,ws=e=>wl.call(e),fu=e=>ws(e).slice(8,-1),bl=e=>ws(e)==="[object Object]",di=e=>Tt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ns=li(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,zt=zs(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,or=zs(e=>e.replace(pu,"-$1").toLowerCase()),Ys=zs(e=>e.charAt(0).toUpperCase()+e.slice(1)),uo=zs(e=>e?`on${Ys(e)}`:""),kn=(e,t)=>!Object.is(e,t),$s=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_l=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=Tt(e)?Number(e):NaN;return isNaN(t)?e:t};let Ui;const Js=()=>Ui||(Ui=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Tr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Tt(r)?wu(r):Tr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Tt(e)||ut(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 ht(e){let t="";if(Tt(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=ht(e[n]);r&&(t+=r+" ")}else if(ut(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=li(bu);function kl(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=hi(e[r],t[r]);return n}function hi(e,t){if(e===t)return!0;let n=Hi(e),r=Hi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=dn(e),r=dn(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?ku(e,t):!1;if(n=ut(e),r=ut(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||!hi(e[i],t[i]))return!1}}return String(e)===String(t)}const Tl=e=>!!(e&&e.__v_isRef===!0),he=e=>Tt(e)?e:e==null?"":Be(e)||ut(e)&&(e.toString===wl||!We(e.toString))?Tl(e)?he(e.value):JSON.stringify(e,Sl,2):String(e),Sl=(e,t)=>Tl(t)?Sl(e,t.value):Nr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[fo(r,o)+" =>"]=s,n),{})}:vl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fo(n))}:dn(t)?fo(t):ut(t)&&!Be(t)&&!bl(t)?String(t):t,fo=(e,t="")=>{var n;return dn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
+
* @vue/reactivity v3.5.30
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let Xt;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=Xt,!t&&Xt&&(this.index=(Xt.scopes||(Xt.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=Xt;try{return Xt=this,t()}finally{Xt=n}}}on(){++this._on===1&&(this.prevScope=Xt,Xt=this)}off(){this._on>0&&--this._on===0&&(Xt=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 Xt}let vt;const ho=new WeakSet;class xl{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,Xt&&Xt.active&&Xt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ho.has(this)&&(ho.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vi(this),Al(this);const t=vt,n=cn;vt=this,cn=!0;try{return this.fn()}finally{Il(this),vt=t,cn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gi(t);this.deps=this.depsTail=void 0,Vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ho.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Do(this)&&this.run()}get dirty(){return Do(this)}}let Cl=0,rs,ss;function El(e,t=!1){if(e.flags|=8,t){e.next=ss,ss=e;return}e.next=rs,rs=e}function pi(){Cl++}function mi(){if(--Cl>0)return;if(ss){let t=ss;for(ss=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rs;){let t=rs;for(rs=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 Al(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Il(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),gi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Do(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Rl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Rl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===us)||(e.globalVersion=us,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Do(e))))return;e.flags|=2;const t=e.dep,n=vt,r=cn;vt=e,cn=!0;try{Al(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{vt=n,cn=r,Il(e),e.flags&=-3}}function gi(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)gi(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 cn=!0;const $l=[];function Bn(){$l.push(cn),cn=!1}function Fn(){const e=$l.pop();cn=e===void 0?!0:e}function Vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=vt;vt=void 0;try{t()}finally{vt=n}}}let us=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 vi{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(!vt||!cn||vt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==vt)n=this.activeLink=new Cu(vt,this),vt.deps?(n.prevDep=vt.depsTail,vt.depsTail.nextDep=n,vt.depsTail=n):vt.deps=vt.depsTail=n,Ml(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=vt.depsTail,n.nextDep=void 0,vt.depsTail.nextDep=n,vt.depsTail=n,vt.deps===n&&(vt.deps=r)}return n}trigger(t){this.version++,us++,this.notify(t)}notify(t){pi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mi()}}}function Ml(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)Ml(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Lo=new WeakMap,_r=Symbol(""),Bo=Symbol(""),ds=Symbol("");function Ft(e,t,n){if(cn&&vt){let r=Lo.get(e);r||Lo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new vi),s.map=r,s.key=n),s.track()}}function jn(e,t,n,r,s,o){const i=Lo.get(e);if(!i){us++;return}const a=l=>{l&&l.trigger()};if(pi(),t==="clear")i.forEach(a);else{const l=Be(e),d=l&&di(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===ds||!dn(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ds)),t){case"add":l?d&&a(i.get("length")):(a(i.get(_r)),Nr(e)&&a(i.get(Bo)));break;case"delete":l||(a(i.get(_r)),Nr(e)&&a(i.get(Bo)));break;case"set":Nr(e)&&a(i.get(_r));break}}mi()}function Ir(e){const t=at(e);return t===e?t:(Ft(t,"iterate",ds),an(e)?t:t.map(fn))}function Qs(e){return Ft(e=at(e),"iterate",ds),e}function bn(e,t){return Hn(e)?Br(kr(e)?fn(t):t):fn(t)}const Eu={__proto__:null,[Symbol.iterator](){return po(this,Symbol.iterator,e=>bn(this,e))},concat(...e){return Ir(this).concat(...e.map(t=>Be(t)?Ir(t):t))},entries(){return po(this,"entries",e=>(e[1]=bn(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=>bn(this,r)),arguments)},find(e,t){return $n(this,"find",e,t,n=>bn(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=>bn(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 mo(this,"includes",e)},indexOf(...e){return mo(this,"indexOf",e)},join(e){return Ir(this).join(e)},lastIndexOf(...e){return mo(this,"lastIndexOf",e)},map(e,t){return $n(this,"map",e,t,void 0,arguments)},pop(){return zr(this,"pop")},push(...e){return zr(this,"push",e)},reduce(e,...t){return Wi(this,"reduce",e,t)},reduceRight(e,...t){return Wi(this,"reduceRight",e,t)},shift(){return zr(this,"shift")},some(e,t){return $n(this,"some",e,t,void 0,arguments)},splice(...e){return zr(this,"splice",e)},toReversed(){return Ir(this).toReversed()},toSorted(e){return Ir(this).toSorted(e)},toSpliced(...e){return Ir(this).toSpliced(...e)},unshift(...e){return zr(this,"unshift",e)},values(){return po(this,"values",e=>bn(this,e))}};function po(e,t,n){const r=Qs(e),s=r[t]();return r!==e&&!an(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=Qs(e),a=i!==e&&!an(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?fn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,bn(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 Wi(e,t,n,r){const s=Qs(e),o=s!==e&&!an(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,u,f){return a&&(a=!1,d=bn(e,d)),n.call(this,d,bn(e,u),f,e)}):n.length>3&&(i=function(d,u,f){return n.call(this,d,u,f,e)}));const l=s[t](i,...r);return a?bn(e,l):l}function mo(e,t,n){const r=at(e);Ft(r,"iterate",ds);const s=r[t](...n);return(s===-1||s===!1)&&bi(n[0])?(n[0]=at(n[0]),r[t](...n)):s}function zr(e,t,n=[]){Bn(),pi();const r=at(e)[t].apply(e,n);return mi(),Fn(),r}const Iu=li("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(dn));function Ru(e){dn(e)||(e=String(e));const t=at(this);return Ft(t,"has",e),t.hasOwnProperty(e)}class Ol{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:Ll:o?Dl:jl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Be(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Vt(t)?t:r);if((dn(n)?Pl.has(n):Iu(n))||(s||Ft(t,"get",n),o))return a;if(Vt(a)){const l=i&&di(n)?a:a.value;return s&&ut(l)?Ho(l):l}return ut(a)?s?Ho(a):Xs(a):a}}class Nl extends Ol{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Be(t)&&di(n);if(!this._isShallow){const d=Hn(o);if(!an(r)&&!Hn(r)&&(o=at(o),r=at(r)),!i&&Vt(o)&&!Vt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:ct(t,n),l=Reflect.set(t,n,r,Vt(t)?t:s);return t===at(s)&&(a?kn(r,o)&&jn(t,"set",n,r):jn(t,"add",n,r)),l}deleteProperty(t,n){const r=ct(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&jn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!dn(n)||!Pl.has(n))&&Ft(t,"has",n),r}ownKeys(t){return Ft(t,"iterate",Be(t)?"length":_r),Reflect.ownKeys(t)}}class $u extends Ol{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Nl,Pu=new $u,Ou=new Nl(!0);const Fo=e=>e,Ts=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=at(s),i=Nr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Fo:t?Br:fn;return!t&&Ft(o,"iterate",l?Bo:_r),It(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 Ss(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=at(o),a=at(s);e||(kn(s,a)&&Ft(i,"get",s),Ft(i,"get",a));const{has:l}=Ts(i),d=t?Fo:e?Br:fn;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&&Ft(at(s),"iterate",_r),s.size},has(s){const o=this.__v_raw,i=at(o),a=at(s);return e||(kn(s,a)&&Ft(i,"has",s),Ft(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=at(a),d=t?Fo:e?Br:fn;return!e&&Ft(l,"iterate",_r),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return It(n,e?{add:Ss("add"),set:Ss("set"),delete:Ss("delete"),clear:Ss("clear")}:{add(s){const o=at(this),i=Ts(o),a=at(s),l=!t&&!an(s)&&!Hn(s)?a:s;return i.has.call(o,l)||kn(s,l)&&i.has.call(o,s)||kn(a,l)&&i.has.call(o,a)||(o.add(l),jn(o,"add",l,l)),this},set(s,o){!t&&!an(o)&&!Hn(o)&&(o=at(o));const i=at(this),{has:a,get:l}=Ts(i);let d=a.call(i,s);d||(s=at(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?kn(o,u)&&jn(i,"set",s,o):jn(i,"add",s,o),this},delete(s){const o=at(this),{has:i,get:a}=Ts(o);let l=i.call(o,s);l||(s=at(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&jn(o,"delete",s,void 0),d},clear(){const s=at(this),o=s.size!==0,i=s.clear();return o&&jn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function yi(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(ct(n,s)&&s in r?n:r,s,o)}const Du={get:yi(!1,!1)},Lu={get:yi(!1,!0)},Bu={get:yi(!0,!1)};const jl=new WeakMap,Dl=new WeakMap,Ll=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 Xs(e){return Hn(e)?e:wi(e,!1,Mu,Du,jl)}function Bl(e){return wi(e,!1,Ou,Lu,Dl)}function Ho(e){return wi(e,!0,Pu,Bu,Ll)}function wi(e,t,n,r,s){if(!ut(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 kr(e){return Hn(e)?kr(e.__v_raw):!!(e&&e.__v_isReactive)}function Hn(e){return!!(e&&e.__v_isReadonly)}function an(e){return!!(e&&e.__v_isShallow)}function bi(e){return e?!!e.__v_raw:!1}function at(e){const t=e&&e.__v_raw;return t?at(t):e}function Vu(e){return!ct(e,"__v_skip")&&Object.isExtensible(e)&&_l(e,"__v_skip",!0),e}const fn=e=>ut(e)?Xs(e):e,Br=e=>ut(e)?Ho(e):e;function Vt(e){return e?e.__v_isRef===!0:!1}function P(e){return Fl(e,!1)}function Wu(e){return Fl(e,!0)}function Fl(e,t){return Vt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new vi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:at(t),this._value=n?t:fn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||an(t)||Hn(t);t=r?t:at(t),kn(t,n)&&(this._rawValue=t,this._value=r?t:fn(t),this.dep.trigger())}}function De(e){return Vt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:De(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Vt(s)&&!Vt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Hl(e){return kr(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 vi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=us-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&vt!==this)return El(this,!0),!0}get value(){const t=this.dep.track();return Rl(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 We(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const xs={},Ds=new WeakMap;let vr;function Yu(e,t=!1,n=vr){if(n){let r=Ds.get(n);r||Ds.set(n,r=[]),r.push(e)}}function Ju(e,t,n=gt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=D=>s?D:an(D)||s===!1||s===0?Dn(D,1):Dn(D);let u,f,g,_,N=!1,I=!1;if(Vt(e)?(f=()=>e.value,N=an(e)):kr(e)?(f=()=>d(e),N=!0):Be(e)?(I=!0,N=e.some(D=>kr(D)||an(D)),f=()=>e.map(D=>{if(Vt(D))return D.value;if(kr(D))return d(D);if(We(D))return l?l(D,2):D()})):We(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){Bn();try{g()}finally{Fn()}}const D=vr;vr=u;try{return l?l(e,3,[_]):e(_)}finally{vr=D}}:f=Sn,t&&s){const D=f,ce=s===!0?1/0:s;f=()=>Dn(D(),ce)}const U=Su(),J=()=>{u.stop(),U&&U.active&&ui(U.effects,u)};if(o&&t){const D=t;t=(...ce)=>{D(...ce),J()}}let O=I?new Array(e.length).fill(xs):xs;const W=D=>{if(!(!(u.flags&1)||!u.dirty&&!D))if(t){const ce=u.run();if(s||N||(I?ce.some((fe,pe)=>kn(fe,O[pe])):kn(ce,O))){g&&g();const fe=vr;vr=u;try{const pe=[ce,O===xs?void 0:I&&O[0]===xs?[]:O,_];O=ce,l?l(t,3,pe):t(...pe)}finally{vr=fe}}}else u.run()};return a&&a(W),u=new xl(f),u.scheduler=i?()=>i(W,!1):W,_=D=>Yu(D,!1,u),g=u.onStop=()=>{const D=Ds.get(u);if(D){if(l)l(D,4);else for(const ce of D)ce();Ds.delete(u)}},t?r?W(!0):O=u.run():i?i(W.bind(null,!0),!0):u.run(),J.pause=u.pause.bind(u),J.resume=u.resume.bind(u),J.stop=J,J}function Dn(e,t=1/0,n){if(t<=0||!ut(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Vt(e))Dn(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)Dn(e[r],t,n);else if(vl(e)||Nr(e))e.forEach(r=>{Dn(r,t,n)});else if(bl(e)){for(const r in e)Dn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Dn(e[r],t,n)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.30
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function bs(e,t,n,r){try{return r?e(...r):e()}catch(s){Zs(s,t,n)}}function hn(e,t,n,r){if(We(e)){const s=bs(e,t,n,r);return s&&yl(s)&&s.catch(o=>{Zs(o,t,n)}),s}if(Be(e)){const s=[];for(let o=0;o<e.length;o++)s.push(hn(e[o],t,n,r));return s}}function Zs(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||gt;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){Bn(),bs(o,null,10,[e,l,d]),Fn();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Kt=[];let yn=-1;const jr=[];let tr=null,$r=0;const Ul=Promise.resolve();let Ls=null;function tn(e){const t=Ls||Ul;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=yn+1,n=Kt.length;for(;t<n;){const r=t+n>>>1,s=Kt[r],o=fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function _i(e){if(!(e.flags&1)){const t=fs(e),n=Kt[Kt.length-1];!n||!(e.flags&2)&&t>=fs(n)?Kt.push(e):Kt.splice(Xu(t),0,e),e.flags|=1,Vl()}}function Vl(){Ls||(Ls=Ul.then(ql))}function Zu(e){Be(e)?jr.push(...e):tr&&e.id===-1?tr.splice($r+1,0,e):e.flags&1||(jr.push(e),e.flags|=1),Vl()}function qi(e,t,n=yn+1){for(;n<Kt.length;n++){const r=Kt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Kt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wl(e){if(jr.length){const t=[...new Set(jr)].sort((n,r)=>fs(n)-fs(r));if(jr.length=0,tr){tr.push(...t);return}for(tr=t,$r=0;$r<tr.length;$r++){const n=tr[$r];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}tr=null,$r=0}}const fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ql(e){try{for(yn=0;yn<Kt.length;yn++){const t=Kt[yn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;yn<Kt.length;yn++){const t=Kt[yn];t&&(t.flags&=-2)}yn=-1,Kt.length=0,Wl(),Ls=null,(Kt.length||jr.length)&&ql()}}let Nt=null,Kl=null;function Bs(e){const t=Nt;return Nt=e,Kl=e&&e.type.__scopeId||null,t}function dt(e,t=Nt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Vs(-1);const o=Bs(t);let i;try{i=e(...s)}finally{Bs(o),r._d&&Vs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Un(e,t){if(Nt===null)return e;const n=oo(Nt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=gt]=t[s];o&&(We(o)&&(o={mounted:o,updated:o}),o.deep&&Dn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function fr(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&&(Bn(),hn(l,n,8,[e.el,a,e,t]),Fn())}}function Ms(e,t){if(Ut){let n=Ut.provides;const r=Ut.parent&&Ut.parent.provides;r===n&&(n=Ut.provides=Object.create(r)),n[e]=t}}function un(e,t,n=!1){const r=Ci();if(r||Lr){let s=Lr?Lr._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&&We(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>un(ed);function ft(e,t,n){return Gl(e,t,n)}function Gl(e,t,n=gt){const{immediate:r,deep:s,flush:o,once:i}=n,a=It({},n),l=t&&r||!t&&o!=="post";let d;if(gs){if(o==="sync"){const _=td();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=Sn,_.resume=Sn,_.pause=Sn,_}}const u=Ut;a.call=(_,N,I)=>hn(_,u,N,I);let f=!1;o==="post"?a.scheduler=_=>{Bt(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,N)=>{N?_():_i(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const g=Ju(e,t,a);return gs&&(d?d.push(g):l&&g()),g}function nd(e,t,n){const r=this.proxy,s=Tt(e)?e.includes(".")?zl(r,e):()=>r[e]:e.bind(r,r);let o;We(t)?o=t:(o=t.handler,n=t);const i=_s(this),a=Gl(s,o.bind(r),n);return i(),a}function zl(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 Yl=Symbol("_vte"),Jl=e=>e.__isTeleport,os=e=>e&&(e.disabled||e.disabled===""),Ki=e=>e&&(e.defer||e.defer===""),Gi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,zi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Uo=(e,t)=>{const n=e&&e.to;return Tt(n)?t?t(n):null:n},Ql={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:N,createText:I,createComment:U}}=d,J=os(t.props);let{shapeFlag:O,children:W,dynamicChildren:D}=t;if(e==null){const ce=t.el=I(""),fe=t.anchor=I("");_(ce,n,r),_(fe,n,r);const pe=(ie,te)=>{O&16&&u(W,ie,te,s,o,i,a,l)},Se=()=>{const ie=t.target=Uo(t.props,N),te=Vo(ie,t,I,_);ie&&(i!=="svg"&&Gi(ie)?i="svg":i!=="mathml"&&zi(ie)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ie),J||(pe(ie,te),Ps(t,!1)))};J&&(pe(n,fe),Ps(t,!0)),Ki(t.props)?(t.el.__isMounted=!1,Bt(()=>{Se(),delete t.el.__isMounted},o)):Se()}else{if(Ki(t.props)&&e.el.__isMounted===!1){Bt(()=>{Ql.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ce=t.anchor=e.anchor,fe=t.target=e.target,pe=t.targetAnchor=e.targetAnchor,Se=os(e.props),ie=Se?n:fe,te=Se?ce:pe;if(i==="svg"||Gi(fe)?i="svg":(i==="mathml"||zi(fe))&&(i="mathml"),D?(g(e.dynamicChildren,D,ie,s,o,i,a),Si(e,t,!0)):l||f(e,t,ie,te,s,o,i,a,!1),J)Se?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cs(t,n,ce,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=Uo(t.props,N);ye&&Cs(t,ye,null,d,0)}else Se&&Cs(t,fe,pe,d,1);Ps(t,J)}},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||!os(g);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,_,!!I.dynamicChildren)}}},move:Cs,hydrate:rd};function Cs(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||os(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(U,J){let O=J;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,U._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function _(U,J){J.anchor=f(i(U),J,a(U),n,r,s,o)}const N=t.target=Uo(t.props,l),I=os(t.props);if(N){const U=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(_(e,t),g(N,U),t.targetAnchor||Vo(N,t,u,d,a(e)===N?e:null)):(t.anchor=i(e),g(N,U),t.targetAnchor||Vo(N,t,u,d),f(U&&i(U),t,N,n,r,s,o))),Ps(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fs=Ql;function Ps(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 Vo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yl]=i,e&&(r(o,e,s),r(i,e,s)),i}const wn=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return qn(()=>{e.isMounted=!0}),Kn(()=>{e.isUnmounting=!0}),e}const sn=[Function,Array],Xl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sn,onEnter:sn,onAfterEnter:sn,onEnterCancelled:sn,onBeforeLeave:sn,onLeave:sn,onAfterLeave:sn,onLeaveCancelled:sn,onBeforeAppear:sn,onAppear:sn,onAfterAppear:sn,onAppearCancelled:sn},Zl=e=>{const t=e.subTree;return t.component?Zl(t.component):t},od={name:"BaseTransition",props:Xl,setup(e,{slots:t}){const n=Ci(),r=sd();return()=>{const s=t.default&&nc(t.default(),!0);if(!s||!s.length)return;const o=ec(s),i=at(e),{mode:a}=i;if(r.isLeaving)return go(o);const l=Yi(o);if(!l)return go(o);let d=Wo(l,i,r,n,f=>d=f);l.type!==Ht&&hs(l,d);let u=n.subTree&&Yi(n.subTree);if(u&&u.type!==Ht&&!yr(u,l)&&Zl(n).type!==Ht){let f=Wo(u,i,r,n);if(hs(u,f),a==="out-in"&&l.type!==Ht)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},go(o);a==="in-out"&&l.type!==Ht?f.delayLeave=(g,_,N)=>{const I=tc(r,u);I[String(u.key)]=u,g[wn]=()=>{_(),g[wn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function ec(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ht){t=n;break}}return t}const id=od;function tc(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 Wo(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:N,onLeaveCancelled:I,onBeforeAppear:U,onAppear:J,onAfterAppear:O,onAppearCancelled:W}=t,D=String(e.key),ce=tc(n,e),fe=(ie,te)=>{ie&&hn(ie,r,9,te)},pe=(ie,te)=>{const ye=te[1];fe(ie,te),Be(ie)?ie.every(re=>re.length<=1)&&ye():ie.length<=1&&ye()},Se={mode:i,persisted:a,beforeEnter(ie){let te=l;if(!n.isMounted)if(o)te=U||l;else return;ie[wn]&&ie[wn](!0);const ye=ce[D];ye&&yr(e,ye)&&ye.el[wn]&&ye.el[wn](),fe(te,[ie])},enter(ie){if(ce[D]===e)return;let te=d,ye=u,re=f;if(!n.isMounted)if(o)te=J||d,ye=O||u,re=W||f;else return;let Ue=!1;ie[Yr]=Ye=>{Ue||(Ue=!0,Ye?fe(re,[ie]):fe(ye,[ie]),Se.delayedLeave&&Se.delayedLeave(),ie[Yr]=void 0)};const Fe=ie[Yr].bind(null,!1);te?pe(te,[ie,Fe]):Fe()},leave(ie,te){const ye=String(e.key);if(ie[Yr]&&ie[Yr](!0),n.isUnmounting)return te();fe(g,[ie]);let re=!1;ie[wn]=Fe=>{re||(re=!0,te(),Fe?fe(I,[ie]):fe(N,[ie]),ie[wn]=void 0,ce[ye]===e&&delete ce[ye])};const Ue=ie[wn].bind(null,!1);ce[ye]=e,_?pe(_,[ie,Ue]):Ue()},clone(ie){const te=Wo(ie,t,n,r,s);return s&&s(te),te}};return Se}function go(e){if(eo(e))return e=sr(e),e.children=null,e}function Yi(e){if(!eo(e))return Jl(e.type)&&e.children?ec(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&&We(n.default))return n.default()}}function hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hs(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 nc(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===Ve?(i.patchFlag&128&&s++,r=r.concat(nc(i.children,t,a))):(t||i.type!==Ht)&&r.push(a!=null?sr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Mt(e,t){return We(e)?It({name:e.name},t,{setup:e}):e}function rc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ji(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hs=new WeakMap;function is(e,t,n,r,s=!1){if(Be(e)){e.forEach((I,U)=>is(I,t&&(Be(t)?t[U]:t),n,r,s));return}if(Dr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&is(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?oo(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===gt?a.refs={}:a.refs,f=a.setupState,g=at(f),_=f===gt?gl:I=>Ji(u,I)?!1:ct(g,I),N=(I,U)=>!(U&&Ji(u,U));if(d!=null&&d!==l){if(Qi(t),Tt(d))u[d]=null,_(d)&&(f[d]=null);else if(Vt(d)){const I=t;N(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(We(l))bs(l,a,12,[i,u]);else{const I=Tt(l),U=Vt(l);if(I||U){const J=()=>{if(e.f){const O=I?_(l)?f[l]:u[l]:N()||!e.k?l.value:u[e.k];if(s)Be(O)&&ui(O,o);else if(Be(O))O.includes(o)||O.push(o);else if(I)u[l]=[o],_(l)&&(f[l]=u[l]);else{const W=[o];N(l,e.k)&&(l.value=W),e.k&&(u[e.k]=W)}}else I?(u[l]=i,_(l)&&(f[l]=i)):U&&(N(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const O=()=>{J(),Hs.delete(e)};O.id=-1,Hs.set(e,O),Bt(O,n)}else Qi(e),J()}}}function Qi(e){const t=Hs.get(e);t&&(t.flags|=8,Hs.delete(e))}Js().requestIdleCallback;Js().cancelIdleCallback;const Dr=e=>!!e.type.__asyncLoader,eo=e=>e.type.__isKeepAlive;function ad(e,t){sc(e,"a",t)}function ld(e,t){sc(e,"da",t)}function sc(e,t,n=Ut){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(to(t,r,n),n){let s=n.parent;for(;s&&s.parent;)eo(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=to(t,e,r,!0);no(()=>{ui(r[t],s)},n)}function to(e,t,n=Ut,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Bn();const a=_s(n),l=hn(t,n,e,i);return a(),Fn(),l});return r?s.unshift(o):s.push(o),o}}const Wn=e=>(t,n=Ut)=>{(!gs||e==="sp")&&to(e,(...r)=>t(...r),n)},ud=Wn("bm"),qn=Wn("m"),dd=Wn("bu"),fd=Wn("u"),Kn=Wn("bum"),no=Wn("um"),hd=Wn("sp"),pd=Wn("rtg"),md=Wn("rtc");function gd(e,t=Ut){to("ec",e,t)}const vd="components",oc=Symbol.for("v-ndc");function qo(e){return Tt(e)?yd(vd,e,!1)||e:e||oc}function yd(e,t,n=!0,r=!1){const s=Nt||Ut;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===zt(t)||a===Ys(zt(t))))return o}const i=Xi(s[e]||o[e],t)||Xi(s.appContext[e],t);return!i&&r?o:i}}function Xi(e,t){return e&&(e[t]||e[zt(t)]||e[Ys(zt(t))])}function _t(e,t,n,r){let s;const o=n,i=Be(e);if(i||Tt(e)){const a=i&&kr(e);let l=!1,d=!1;a&&(l=!an(e),d=Hn(e),e=Qs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Br(fn(e[u])):fn(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(ut(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 Tn(e,t,n={},r,s){if(Nt.ce||Nt.parent&&Dr(Nt.parent)&&Nt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),mt(Ve,null,[Ae("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),b();const i=o&&ic(o(n)),a=n.key||i&&i.key,l=mt(Ve,{key:(a&&!dn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ic(e){return e.some(t=>ms(t)?!(t.type===Ht||t.type===Ve&&!ic(t.children)):!0)?e:null}const Ko=e=>e?Cc(e)?oo(e):Ko(e.parent):null,as=It(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=>Ko(e.parent),$root:e=>Ko(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lc(e),$forceUpdate:e=>e.f||(e.f=()=>{_i(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>nd.bind(e)}),vo=(e,t)=>e!==gt&&!e.__isScriptSetup&&ct(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(vo(r,t))return i[t]=1,r[t];if(s!==gt&&ct(s,t))return i[t]=2,s[t];if(ct(o,t))return i[t]=3,o[t];if(n!==gt&&ct(n,t))return i[t]=4,n[t];Go&&(i[t]=0)}}const d=as[t];let u,f;if(d)return t==="$attrs"&&Ft(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==gt&&ct(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,ct(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return vo(s,t)?(s[t]=n,!0):r!==gt&&ct(r,t)?(r[t]=n,!0):ct(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!==gt&&a[0]!=="$"&&ct(e,a)||vo(t,a)||ct(o,a)||ct(r,a)||ct(as,a)||ct(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ct(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=Ci();return t.setupContext||(t.setupContext=Ac(t))}function Zi(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Go=!0;function kd(e){const t=lc(e),n=e.proxy,r=e.ctx;Go=!1,t.beforeCreate&&ea(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:N,activated:I,deactivated:U,beforeDestroy:J,beforeUnmount:O,destroyed:W,unmounted:D,render:ce,renderTracked:fe,renderTriggered:pe,errorCaptured:Se,serverPrefetch:ie,expose:te,inheritAttrs:ye,components:re,directives:Ue,filters:Fe}=t;if(d&&Td(d,r,null),i)for(const Te in i){const Oe=i[Te];We(Oe)&&(r[Te]=Oe.bind(n))}if(s){const Te=s.call(n,n);ut(Te)&&(e.data=Xs(Te))}if(Go=!0,o)for(const Te in o){const Oe=o[Te],yt=We(Oe)?Oe.bind(n,n):We(Oe.get)?Oe.get.bind(n,n):Sn,et=!We(Oe)&&We(Oe.set)?Oe.set.bind(n):Sn,nt=de({get:yt,set:et});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>nt.value,set:ot=>nt.value=ot})}if(a)for(const Te in a)ac(a[Te],r,n,Te);if(l){const Te=We(l)?l.call(n):l;Reflect.ownKeys(Te).forEach(Oe=>{Ms(Oe,Te[Oe])})}u&&ea(u,e,"c");function $e(Te,Oe){Be(Oe)?Oe.forEach(yt=>Te(yt.bind(n))):Oe&&Te(Oe.bind(n))}if($e(ud,f),$e(qn,g),$e(dd,_),$e(fd,N),$e(ad,I),$e(ld,U),$e(gd,Se),$e(md,fe),$e(pd,pe),$e(Kn,O),$e(no,D),$e(hd,ie),Be(te))if(te.length){const Te=e.exposed||(e.exposed={});te.forEach(Oe=>{Object.defineProperty(Te,Oe,{get:()=>n[Oe],set:yt=>n[Oe]=yt,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===Sn&&(e.render=ce),ye!=null&&(e.inheritAttrs=ye),re&&(e.components=re),Ue&&(e.directives=Ue),ie&&rc(e)}function Td(e,t,n=Sn){Be(e)&&(e=zo(e));for(const r in e){const s=e[r];let o;ut(s)?"default"in s?o=un(s.from||r,s.default,!0):o=un(s.from||r):o=un(s),Vt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ea(e,t,n){hn(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ac(e,t,n,r){let s=r.includes(".")?zl(n,r):()=>n[r];if(Tt(e)){const o=t[e];We(o)&&ft(s,o)}else if(We(e))ft(s,e.bind(n));else if(ut(e))if(Be(e))e.forEach(o=>ac(o,t,n,r));else{const o=We(e.handler)?e.handler.bind(n):t[e.handler];We(o)&&ft(s,o,e)}}function lc(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=>Us(l,d,i,!0)),Us(l,t,i)),ut(t)&&o.set(t,l),l}function Us(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Us(e,o,n,!0),s&&s.forEach(i=>Us(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:ta,props:na,emits:na,methods:ts,computed:ts,beforeCreate:Wt,created:Wt,beforeMount:Wt,mounted:Wt,beforeUpdate:Wt,updated:Wt,beforeDestroy:Wt,beforeUnmount:Wt,destroyed:Wt,unmounted:Wt,activated:Wt,deactivated:Wt,errorCaptured:Wt,serverPrefetch:Wt,components:ts,directives:ts,watch:Cd,provide:ta,inject:xd};function ta(e,t){return t?e?function(){return It(We(e)?e.call(this,this):e,We(t)?t.call(this,this):t)}:t:e}function xd(e,t){return ts(zo(e),zo(t))}function zo(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Wt(e,t){return e?[...new Set([].concat(e,t))]:t}function ts(e,t){return e?It(Object.create(null),e,t):t}function na(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:It(Object.create(null),Zi(e),Zi(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=It(Object.create(null),e);for(const r in t)n[r]=Wt(e[r],t[r]);return n}function cc(){return{app:null,config:{isNativeTag:gl,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){We(r)||(r=It({},r)),s!=null&&!ut(s)&&(s=null);const o=cc(),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&&We(u.install)?(i.add(u),u.install(d,...f)):We(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||Ae(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,oo(_.component)}},onUnmount(u){a.push(u)},unmount(){l&&(hn(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=Lr;Lr=d;try{return u()}finally{Lr=f}}};return d}}let Lr=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${zt(t)}Modifiers`]||e[`${or(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||gt;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>Tt(u)?u.trim():u)),i.number&&(s=n.map(fi)));let a,l=r[a=uo(t)]||r[a=uo(zt(t))];!l&&o&&(l=r[a=uo(or(t))]),l&&hn(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,hn(d,e,6,s)}}const $d=new WeakMap;function uc(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(!We(e)){const l=d=>{const u=uc(d,t,!0);u&&(a=!0,It(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ut(e)&&r.set(e,null),null):(Be(o)?o.forEach(l=>i[l]=null):It(i,o),ut(e)&&r.set(e,i),i)}function ro(e,t){return!e||!Gs(t)?!1:(t=t.slice(2).replace(/Once$/,""),ct(e,t[0].toLowerCase()+t.slice(1))||ct(e,or(t))||ct(e,t))}function ra(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:N,inheritAttrs:I}=e,U=Bs(e);let J,O;try{if(n.shapeFlag&4){const D=s||r,ce=D;J=_n(d.call(ce,D,u,f,_,g,N)),O=a}else{const D=t;J=_n(D.length>1?D(f,{attrs:a,slots:i,emit:l}):D(f,null)),O=t.props?a:Md(a)}}catch(D){ls.length=0,Zs(D,e,1),J=Ae(Ht)}let W=J;if(O&&I!==!1){const D=Object.keys(O),{shapeFlag:ce}=W;D.length&&ce&7&&(o&&D.some(ci)&&(O=Pd(O,o)),W=sr(W,O,!1,!0))}return n.dirs&&(W=sr(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&hs(W,n.transition),J=W,Bs(U),J}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Gs(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!ci(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?sa(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(dc(i,r,g)&&!ro(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?sa(r,i,d):!0:!!i;return!1}function sa(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(dc(t,e,o)&&!ro(n,o))return!0}return!1}function dc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ut(r)&&ut(s)?!hi(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 fc={},hc=()=>Object.create(fc),pc=e=>Object.getPrototypeOf(e)===fc;function jd(e,t,n,r=!1){const s={},o=hc();e.propsDefaults=Object.create(null),mc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Bl(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=at(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(ro(e.emitsOptions,g))continue;const _=t[g];if(l)if(ct(o,g))_!==o[g]&&(o[g]=_,d=!0);else{const N=zt(g);s[N]=Yo(l,a,N,_,e,!1)}else _!==o[g]&&(o[g]=_,d=!0)}}}else{mc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!ct(t,f)&&((u=or(f))===f||!ct(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Yo(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!ct(t,f))&&(delete o[f],d=!0)}d&&jn(e.attrs,"set","")}function mc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ns(l))continue;const d=t[l];let u;s&&ct(s,u=zt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:ro(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=at(n),d=a||gt;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Yo(s,l,f,d[f],e,!ct(d,f))}}return i}function Yo(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=ct(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&We(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=_s(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===or(n))&&(r=!0))}return r}const Ld=new WeakMap;function gc(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(!We(e)){const u=f=>{l=!0;const[g,_]=gc(f,t,!0);It(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 ut(e)&&r.set(e,Or),Or;if(Be(o))for(let u=0;u<o.length;u++){const f=zt(o[u]);oa(f)&&(i[f]=gt)}else if(o)for(const u in o){const f=zt(u);if(oa(f)){const g=o[u],_=i[f]=Be(g)||We(g)?{type:g}:It({},g),N=_.type;let I=!1,U=!0;if(Be(N))for(let J=0;J<N.length;++J){const O=N[J],W=We(O)&&O.name;if(W==="Boolean"){I=!0;break}else W==="String"&&(U=!1)}else I=We(N)&&N.name==="Boolean";_[0]=I,_[1]=U,(I||ct(_,"default"))&&a.push(f)}}const d=[i,a];return ut(e)&&r.set(e,d),d}function oa(e){return e[0]!=="$"&&!ns(e)}const ki=e=>e==="_"||e==="_ctx"||e==="$stable",Ti=e=>Be(e)?e.map(_n):[_n(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=dt((...s)=>Ti(t(...s)),n);return r._c=!1,r},vc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ki(s))continue;const o=e[s];if(We(o))t[s]=Bd(s,o,r);else if(o!=null){const i=Ti(o);t[s]=()=>i}}},yc=(e,t)=>{const n=Ti(t);e.slots.default=()=>n},wc=(e,t,n)=>{for(const r in t)(n||!ki(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=hc();if(e.vnode.shapeFlag&32){const s=t._;s?(wc(r,t,n),n&&_l(r,"_",s,!0)):vc(t,r)}else t&&yc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=gt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:wc(s,t,n):(o=!t.$stable,vc(t,s)),i=t}else t&&(yc(e,t),i={default:1});if(o)for(const a in s)!ki(a)&&i[a]==null&&delete s[a]},Bt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Js();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:_=Sn,insertStaticContent:N}=e,I=(v,w,E,B=null,F=null,j=null,ee=void 0,se=null,Y=!!w.dynamicChildren)=>{if(v===w)return;v&&!yr(v,w)&&(B=R(v),ot(v,F,j,!0),v=null),w.patchFlag===-2&&(Y=!1,w.dynamicChildren=null);const{type:K,ref:we,shapeFlag:le}=w;switch(K){case so:U(v,w,E,B);break;case Ht:J(v,w,E,B);break;case wo:v==null&&O(w,E,B,ee);break;case Ve:re(v,w,E,B,F,j,ee,se,Y);break;default:le&1?ce(v,w,E,B,F,j,ee,se,Y):le&6?Ue(v,w,E,B,F,j,ee,se,Y):(le&64||le&128)&&K.process(v,w,E,B,F,j,ee,se,Y,ge)}we!=null&&F?is(we,v&&v.ref,j,w||v,!w):we==null&&v&&v.ref!=null&&is(v.ref,null,j,v,!0)},U=(v,w,E,B)=>{if(v==null)r(w.el=a(w.children),E,B);else{const F=w.el=v.el;w.children!==v.children&&d(F,w.children)}},J=(v,w,E,B)=>{v==null?r(w.el=l(w.children||""),E,B):w.el=v.el},O=(v,w,E,B)=>{[v.el,v.anchor]=N(v.children,w,E,B,v.el,v.anchor)},W=({el:v,anchor:w},E,B)=>{let F;for(;v&&v!==w;)F=g(v),r(v,E,B),v=F;r(w,E,B)},D=({el:v,anchor:w})=>{let E;for(;v&&v!==w;)E=g(v),s(v),v=E;s(w)},ce=(v,w,E,B,F,j,ee,se,Y)=>{if(w.type==="svg"?ee="svg":w.type==="math"&&(ee="mathml"),v==null)fe(w,E,B,F,j,ee,se,Y);else{const K=v.el&&v.el._isVueCE?v.el:null;try{K&&K._beginPatch(),ie(v,w,F,j,ee,se,Y)}finally{K&&K._endPatch()}}},fe=(v,w,E,B,F,j,ee,se)=>{let Y,K;const{props:we,shapeFlag:le,transition:_e,dirs:Ce}=v;if(Y=v.el=i(v.type,j,we&&we.is,we),le&8?u(Y,v.children):le&16&&Se(v.children,Y,null,B,F,yo(v,j),ee,se),Ce&&fr(v,null,B,"created"),pe(Y,v,v.scopeId,ee,B),we){for(const Ge in we)Ge!=="value"&&!ns(Ge)&&o(Y,Ge,null,we[Ge],j,B);"value"in we&&o(Y,"value",null,we.value,j),(K=we.onVnodeBeforeMount)&&vn(K,B,v)}Ce&&fr(v,null,B,"beforeMount");const je=Wd(F,_e);je&&_e.beforeEnter(Y),r(Y,w,E),((K=we&&we.onVnodeMounted)||je||Ce)&&Bt(()=>{K&&vn(K,B,v),je&&_e.enter(Y),Ce&&fr(v,null,B,"mounted")},F)},pe=(v,w,E,B,F)=>{if(E&&_(v,E),B)for(let j=0;j<B.length;j++)_(v,B[j]);if(F){let j=F.subTree;if(w===j||kc(j.type)&&(j.ssContent===w||j.ssFallback===w)){const ee=F.vnode;pe(v,ee,ee.scopeId,ee.slotScopeIds,F.parent)}}},Se=(v,w,E,B,F,j,ee,se,Y=0)=>{for(let K=Y;K<v.length;K++){const we=v[K]=se?Nn(v[K]):_n(v[K]);I(null,we,w,E,B,F,j,ee,se)}},ie=(v,w,E,B,F,j,ee)=>{const se=w.el=v.el;let{patchFlag:Y,dynamicChildren:K,dirs:we}=w;Y|=v.patchFlag&16;const le=v.props||gt,_e=w.props||gt;let Ce;if(E&&hr(E,!1),(Ce=_e.onVnodeBeforeUpdate)&&vn(Ce,E,w,v),we&&fr(w,v,E,"beforeUpdate"),E&&hr(E,!0),(le.innerHTML&&_e.innerHTML==null||le.textContent&&_e.textContent==null)&&u(se,""),K?te(v.dynamicChildren,K,se,E,B,yo(w,F),j):ee||Oe(v,w,se,null,E,B,yo(w,F),j,!1),Y>0){if(Y&16)ye(se,le,_e,E,F);else if(Y&2&&le.class!==_e.class&&o(se,"class",null,_e.class,F),Y&4&&o(se,"style",le.style,_e.style,F),Y&8){const je=w.dynamicProps;for(let Ge=0;Ge<je.length;Ge++){const Re=je[Ge],pt=le[Re],Xe=_e[Re];(Xe!==pt||Re==="value")&&o(se,Re,pt,Xe,F,E)}}Y&1&&v.children!==w.children&&u(se,w.children)}else!ee&&K==null&&ye(se,le,_e,E,F);((Ce=_e.onVnodeUpdated)||we)&&Bt(()=>{Ce&&vn(Ce,E,w,v),we&&fr(w,v,E,"updated")},B)},te=(v,w,E,B,F,j,ee)=>{for(let se=0;se<w.length;se++){const Y=v[se],K=w[se],we=Y.el&&(Y.type===Ve||!yr(Y,K)||Y.shapeFlag&198)?f(Y.el):E;I(Y,K,we,null,B,F,j,ee,!0)}},ye=(v,w,E,B,F)=>{if(w!==E){if(w!==gt)for(const j in w)!ns(j)&&!(j in E)&&o(v,j,w[j],null,F,B);for(const j in E){if(ns(j))continue;const ee=E[j],se=w[j];ee!==se&&j!=="value"&&o(v,j,se,ee,F,B)}"value"in E&&o(v,"value",w.value,E.value,F)}},re=(v,w,E,B,F,j,ee,se,Y)=>{const K=w.el=v?v.el:a(""),we=w.anchor=v?v.anchor:a("");let{patchFlag:le,dynamicChildren:_e,slotScopeIds:Ce}=w;Ce&&(se=se?se.concat(Ce):Ce),v==null?(r(K,E,B),r(we,E,B),Se(w.children||[],E,we,F,j,ee,se,Y)):le>0&&le&64&&_e&&v.dynamicChildren&&v.dynamicChildren.length===_e.length?(te(v.dynamicChildren,_e,E,F,j,ee,se),(w.key!=null||F&&w===F.subTree)&&Si(v,w,!0)):Oe(v,w,E,we,F,j,ee,se,Y)},Ue=(v,w,E,B,F,j,ee,se,Y)=>{w.slotScopeIds=se,v==null?w.shapeFlag&512?F.ctx.activate(w,E,B,ee,Y):Fe(w,E,B,F,j,ee,Y):Ye(v,w,Y)},Fe=(v,w,E,B,F,j,ee)=>{const se=v.component=Zd(v,B,F);if(eo(v)&&(se.ctx.renderer=ge),ef(se,!1,ee),se.asyncDep){if(F&&F.registerDep(se,$e,ee),!v.el){const Y=se.subTree=Ae(Ht);J(null,Y,w,E),v.placeholder=Y.el}}else $e(se,v,w,E,F,j,ee)},Ye=(v,w,E)=>{const B=w.component=v.component;if(Od(v,w,E))if(B.asyncDep&&!B.asyncResolved){Te(B,w,E);return}else B.next=w,B.update();else w.el=v.el,B.vnode=w},$e=(v,w,E,B,F,j,ee)=>{const se=()=>{if(v.isMounted){let{next:le,bu:_e,u:Ce,parent:je,vnode:Ge}=v;{const V=bc(v);if(V){le&&(le.el=Ge.el,Te(v,le,ee)),V.asyncDep.then(()=>{Bt(()=>{v.isUnmounted||K()},F)});return}}let Re=le,pt;hr(v,!1),le?(le.el=Ge.el,Te(v,le,ee)):le=Ge,_e&&$s(_e),(pt=le.props&&le.props.onVnodeBeforeUpdate)&&vn(pt,je,le,Ge),hr(v,!0);const Xe=ra(v),H=v.subTree;v.subTree=Xe,I(H,Xe,f(H.el),R(H),v,F,j),le.el=Xe.el,Re===null&&Nd(v,Xe.el),Ce&&Bt(Ce,F),(pt=le.props&&le.props.onVnodeUpdated)&&Bt(()=>vn(pt,je,le,Ge),F)}else{let le;const{el:_e,props:Ce}=w,{bm:je,m:Ge,parent:Re,root:pt,type:Xe}=v,H=Dr(w);hr(v,!1),je&&$s(je),!H&&(le=Ce&&Ce.onVnodeBeforeMount)&&vn(le,Re,w),hr(v,!0);{pt.ce&&pt.ce._hasShadowRoot()&&pt.ce._injectChildStyle(Xe,v.parent?v.parent.type:void 0);const V=v.subTree=ra(v);I(null,V,E,B,v,F,j),w.el=V.el}if(Ge&&Bt(Ge,F),!H&&(le=Ce&&Ce.onVnodeMounted)){const V=w;Bt(()=>vn(le,Re,V),F)}(w.shapeFlag&256||Re&&Dr(Re.vnode)&&Re.vnode.shapeFlag&256)&&v.a&&Bt(v.a,F),v.isMounted=!0,w=E=B=null}};v.scope.on();const Y=v.effect=new xl(se);v.scope.off();const K=v.update=Y.run.bind(Y),we=v.job=Y.runIfDirty.bind(Y);we.i=v,we.id=v.uid,Y.scheduler=()=>_i(we),hr(v,!0),K()},Te=(v,w,E)=>{w.component=v;const B=v.vnode.props;v.vnode=w,v.next=null,Dd(v,w.props,B,E),Hd(v,w.children,E),Bn(),qi(v),Fn()},Oe=(v,w,E,B,F,j,ee,se,Y=!1)=>{const K=v&&v.children,we=v?v.shapeFlag:0,le=w.children,{patchFlag:_e,shapeFlag:Ce}=w;if(_e>0){if(_e&128){et(K,le,E,B,F,j,ee,se,Y);return}else if(_e&256){yt(K,le,E,B,F,j,ee,se,Y);return}}Ce&8?(we&16&&xe(K,F,j),le!==K&&u(E,le)):we&16?Ce&16?et(K,le,E,B,F,j,ee,se,Y):xe(K,F,j,!0):(we&8&&u(E,""),Ce&16&&Se(le,E,B,F,j,ee,se,Y))},yt=(v,w,E,B,F,j,ee,se,Y)=>{v=v||Or,w=w||Or;const K=v.length,we=w.length,le=Math.min(K,we);let _e;for(_e=0;_e<le;_e++){const Ce=w[_e]=Y?Nn(w[_e]):_n(w[_e]);I(v[_e],Ce,E,null,F,j,ee,se,Y)}K>we?xe(v,F,j,!0,!1,le):Se(w,E,B,F,j,ee,se,Y,le)},et=(v,w,E,B,F,j,ee,se,Y)=>{let K=0;const we=w.length;let le=v.length-1,_e=we-1;for(;K<=le&&K<=_e;){const Ce=v[K],je=w[K]=Y?Nn(w[K]):_n(w[K]);if(yr(Ce,je))I(Ce,je,E,null,F,j,ee,se,Y);else break;K++}for(;K<=le&&K<=_e;){const Ce=v[le],je=w[_e]=Y?Nn(w[_e]):_n(w[_e]);if(yr(Ce,je))I(Ce,je,E,null,F,j,ee,se,Y);else break;le--,_e--}if(K>le){if(K<=_e){const Ce=_e+1,je=Ce<we?w[Ce].el:B;for(;K<=_e;)I(null,w[K]=Y?Nn(w[K]):_n(w[K]),E,je,F,j,ee,se,Y),K++}}else if(K>_e)for(;K<=le;)ot(v[K],F,j,!0),K++;else{const Ce=K,je=K,Ge=new Map;for(K=je;K<=_e;K++){const qe=w[K]=Y?Nn(w[K]):_n(w[K]);qe.key!=null&&Ge.set(qe.key,K)}let Re,pt=0;const Xe=_e-je+1;let H=!1,V=0;const Q=new Array(Xe);for(K=0;K<Xe;K++)Q[K]=0;for(K=Ce;K<=le;K++){const qe=v[K];if(pt>=Xe){ot(qe,F,j,!0);continue}let Qe;if(qe.key!=null)Qe=Ge.get(qe.key);else for(Re=je;Re<=_e;Re++)if(Q[Re-je]===0&&yr(qe,w[Re])){Qe=Re;break}Qe===void 0?ot(qe,F,j,!0):(Q[Qe-je]=K+1,Qe>=V?V=Qe:H=!0,I(qe,w[Qe],E,null,F,j,ee,se,Y),pt++)}const Je=H?qd(Q):Or;for(Re=Je.length-1,K=Xe-1;K>=0;K--){const qe=je+K,Qe=w[qe],jt=w[qe+1],Yt=qe+1<we?jt.el||_c(jt):B;Q[K]===0?I(null,Qe,E,Yt,F,j,ee,se,Y):H&&(Re<0||K!==Je[Re]?nt(Qe,E,Yt,2):Re--)}}},nt=(v,w,E,B,F=null)=>{const{el:j,type:ee,transition:se,children:Y,shapeFlag:K}=v;if(K&6){nt(v.component.subTree,w,E,B);return}if(K&128){v.suspense.move(w,E,B);return}if(K&64){ee.move(v,w,E,ge);return}if(ee===Ve){r(j,w,E);for(let le=0;le<Y.length;le++)nt(Y[le],w,E,B);r(v.anchor,w,E);return}if(ee===wo){W(v,w,E);return}if(B!==2&&K&1&&se)if(B===0)se.beforeEnter(j),r(j,w,E),Bt(()=>se.enter(j),F);else{const{leave:le,delayLeave:_e,afterLeave:Ce}=se,je=()=>{v.ctx.isUnmounted?s(j):r(j,w,E)},Ge=()=>{j._isLeaving&&j[wn](!0),le(j,()=>{je(),Ce&&Ce()})};_e?_e(j,je,Ge):Ge()}else r(j,w,E)},ot=(v,w,E,B=!1,F=!1)=>{const{type:j,props:ee,ref:se,children:Y,dynamicChildren:K,shapeFlag:we,patchFlag:le,dirs:_e,cacheIndex:Ce}=v;if(le===-2&&(F=!1),se!=null&&(Bn(),is(se,null,E,v,!0),Fn()),Ce!=null&&(w.renderCache[Ce]=void 0),we&256){w.ctx.deactivate(v);return}const je=we&1&&_e,Ge=!Dr(v);let Re;if(Ge&&(Re=ee&&ee.onVnodeBeforeUnmount)&&vn(Re,w,v),we&6)Ie(v.component,E,B);else{if(we&128){v.suspense.unmount(E,B);return}je&&fr(v,null,w,"beforeUnmount"),we&64?v.type.remove(v,w,E,ge,B):K&&!K.hasOnce&&(j!==Ve||le>0&&le&64)?xe(K,w,E,!1,!0):(j===Ve&&le&384||!F&&we&16)&&xe(Y,w,E),B&&rt(v)}(Ge&&(Re=ee&&ee.onVnodeUnmounted)||je)&&Bt(()=>{Re&&vn(Re,w,v),je&&fr(v,null,w,"unmounted")},E)},rt=v=>{const{type:w,el:E,anchor:B,transition:F}=v;if(w===Ve){me(E,B);return}if(w===wo){D(v);return}const j=()=>{s(E),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(v.shapeFlag&1&&F&&!F.persisted){const{leave:ee,delayLeave:se}=F,Y=()=>ee(E,j);se?se(v.el,j,Y):Y()}else j()},me=(v,w)=>{let E;for(;v!==w;)E=g(v),s(v),v=E;s(w)},Ie=(v,w,E)=>{const{bum:B,scope:F,job:j,subTree:ee,um:se,m:Y,a:K}=v;ia(Y),ia(K),B&&$s(B),F.stop(),j&&(j.flags|=8,ot(ee,v,w,E)),se&&Bt(se,w),Bt(()=>{v.isUnmounted=!0},w)},xe=(v,w,E,B=!1,F=!1,j=0)=>{for(let ee=j;ee<v.length;ee++)ot(v[ee],w,E,B,F)},R=v=>{if(v.shapeFlag&6)return R(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const w=g(v.anchor||v.el),E=w&&w[Yl];return E?g(E):w};let Z=!1;const X=(v,w,E)=>{let B;v==null?w._vnode&&(ot(w._vnode,null,null,!0),B=w._vnode.component):I(w._vnode||null,v,w,null,null,null,E),w._vnode=v,Z||(Z=!0,qi(B),Wl(),Z=!1)},ge={p:I,um:ot,m:nt,r:rt,mt:Fe,mc:Se,pc:Oe,pbc:te,n:R,o:e};return{render:X,hydrate:void 0,createApp:Ad(X)}}function yo({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 hr({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 Si(e,t,n=!1){const r=e.children,s=t.children;if(Be(r)&&Be(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]=Nn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Si(i,a)),a.type===so&&(a.patchFlag===-1&&(a=s[o]=Nn(a)),a.el=i.el),a.type===Ht&&!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 bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bc(t)}function ia(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _c(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_c(t.subTree):null}const kc=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const Ve=Symbol.for("v-fgt"),so=Symbol.for("v-txt"),Ht=Symbol.for("v-cmt"),wo=Symbol.for("v-stc"),ls=[];let en=null;function b(e=!1){ls.push(en=e?null:[])}function Gd(){ls.pop(),en=ls[ls.length-1]||null}let ps=1;function Vs(e,t=!1){ps+=e,e<0&&en&&t&&(en.hasOnce=!0)}function Tc(e){return e.dynamicChildren=ps>0?en||Or:null,Gd(),ps>0&&en&&en.push(e),e}function C(e,t,n,r,s,o){return Tc(m(e,t,n,r,s,o,!0))}function mt(e,t,n,r,s){return Tc(Ae(e,t,n,r,s,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function yr(e,t){return e.type===t.type&&e.key===t.key}const Sc=({key:e})=>e??null,Os=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Tt(e)||Vt(e)||We(e)?{i:Nt,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===Ve?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sc(t),ref:t&&Os(t),scopeId:Kl,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:Nt};return a?(xi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Tt(n)?8:16),ps>0&&!i&&en&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&en.push(l),l}const Ae=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===oc)&&(e=Ht),ms(e)){const a=sr(e,t,!0);return n&&xi(a,n),ps>0&&!o&&en&&(a.shapeFlag&6?en[en.indexOf(e)]=a:en.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!Tt(a)&&(t.class=ht(a)),ut(l)&&(bi(l)&&!Be(l)&&(l=It({},l)),t.style=Tr(l))}const i=Tt(e)?1:kc(e)?128:Jl(e)?64:ut(e)?4:We(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Yd(e){return e?bi(e)||pc(e)?It({},e):e:null}function sr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?xc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Sc(d),ref:t&&t.ref?n&&o?Be(o)?o.concat(Os(t)):[o,Os(t)]:Os(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!==Ve?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&&sr(e.ssContent),ssFallback:e.ssFallback&&sr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hs(u,l.clone(u)),u}function Jd(e=" ",t=0){return Ae(so,null,e,t)}function ue(e="",t=!1){return t?(b(),mt(Ht,null,e)):Ae(Ht,null,e)}function _n(e){return e==null||typeof e=="boolean"?Ae(Ht):Be(e)?Ae(Ve,null,e.slice()):ms(e)?Nn(e):Ae(so,null,String(e))}function Nn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sr(e)}function xi(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Be(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),xi(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!pc(t)?t._ctx=Nt:s===3&&Nt&&(Nt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else We(t)?(t={default:t,_ctx:Nt},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function xc(...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=ht([t.class,r.class]));else if(s==="style")t.style=Tr([t.style,r.style]);else if(Gs(s)){const o=t[s],i=r[s];i&&o!==i&&!(Be(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function vn(e,t,n,r=null){hn(e,t,7,[n,r])}const Qd=cc();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:gc(r,s),emitsOptions:uc(r,s),emit:null,emitted:null,propsDefaults:gt,inheritAttrs:r.inheritAttrs,ctx:gt,data:gt,props:gt,attrs:gt,slots:gt,refs:gt,setupState:gt,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 Ut=null;const Ci=()=>Ut||Nt;let Ws,Jo;{const e=Js(),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)}};Ws=t("__VUE_INSTANCE_SETTERS__",n=>Ut=n),Jo=t("__VUE_SSR_SETTERS__",n=>gs=n)}const _s=e=>{const t=Ut;return Ws(e),e.scope.on(),()=>{e.scope.off(),Ws(t)}},aa=()=>{Ut&&Ut.scope.off(),Ws(null)};function Cc(e){return e.vnode.shapeFlag&4}let gs=!1;function ef(e,t=!1,n=!1){t&&Jo(t);const{props:r,children:s}=e.vnode,o=Cc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Jo(!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){Bn();const s=e.setupContext=r.length>1?Ac(e):null,o=_s(e),i=bs(r,e,0,[e.props,s]),a=yl(i);if(Fn(),o(),(a||e.sp)&&!Dr(e)&&rc(e),a){if(i.then(aa,aa),t)return i.then(l=>{la(e,l)}).catch(l=>{Zs(l,e,0)});e.asyncDep=i}else la(e,i)}else Ec(e)}function la(e,t,n){We(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ut(t)&&(e.setupState=Hl(t)),Ec(e)}function Ec(e,t,n){const r=e.type;e.render||(e.render=r.render||Sn);{const s=_s(e);Bn();try{kd(e)}finally{Fn(),s()}}}const nf={get(e,t){return Ft(e,"get",""),e[t]}};function Ac(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function oo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hl(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in as)return as[n](e)},has(t,n){return n in t||n in as}})):e.proxy}function rf(e,t=!0){return We(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return We(e)&&"__vccOpts"in e}const de=(e,t)=>zu(e,t,gs);function Ei(e,t,n){try{Vs(-1);const r=arguments.length;return r===2?ut(t)&&!Be(t)?ms(t)?Ae(e,null,[t]):Ae(e,t):Ae(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),Ae(e,t,n))}finally{Vs(1)}}const of="3.5.30";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.30
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let Qo;const ca=typeof window<"u"&&window.trustedTypes;if(ca)try{Qo=ca.createPolicy("vue",{createHTML:e=>e})}catch{}const Ic=Qo?e=>Qo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",On=typeof document<"u"?document:null,ua=On&&On.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"?On.createElementNS(af,e):t==="mathml"?On.createElementNS(lf,e):n?On.createElement(e,{is:n}):On.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>On.createTextNode(e),createComment:e=>On.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>On.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{ua.innerHTML=Ic(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ua.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]}},Xn="transition",Jr="animation",vs=Symbol("_vtc"),Rc={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=It({},Xl,Rc),df=e=>(e.displayName="Transition",e.props=uf,e),$c=df((e,{slots:t})=>Ei(id,ff(e),t)),pr=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},da=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const re in e)re in Rc||(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,N=hf(s),I=N&&N[0],U=N&&N[1],{onBeforeEnter:J,onEnter:O,onEnterCancelled:W,onLeave:D,onLeaveCancelled:ce,onBeforeAppear:fe=J,onAppear:pe=O,onAppearCancelled:Se=W}=t,ie=(re,Ue,Fe,Ye)=>{re._enterCancelled=Ye,mr(re,Ue?u:a),mr(re,Ue?d:i),Fe&&Fe()},te=(re,Ue)=>{re._isLeaving=!1,mr(re,f),mr(re,_),mr(re,g),Ue&&Ue()},ye=re=>(Ue,Fe)=>{const Ye=re?pe:O,$e=()=>ie(Ue,re,Fe);pr(Ye,[Ue,$e]),fa(()=>{mr(Ue,re?l:o),Mn(Ue,re?u:a),da(Ye)||ha(Ue,r,I,$e)})};return It(t,{onBeforeEnter(re){pr(J,[re]),Mn(re,o),Mn(re,i)},onBeforeAppear(re){pr(fe,[re]),Mn(re,l),Mn(re,d)},onEnter:ye(!1),onAppear:ye(!0),onLeave(re,Ue){re._isLeaving=!0;const Fe=()=>te(re,Ue);Mn(re,f),re._enterCancelled?(Mn(re,g),ga(re)):(ga(re),Mn(re,g)),fa(()=>{re._isLeaving&&(mr(re,f),Mn(re,_),da(D)||ha(re,r,U,Fe))}),pr(D,[re,Fe])},onEnterCancelled(re){ie(re,!1,void 0,!0),pr(W,[re])},onAppearCancelled(re){ie(re,!0,void 0,!0),pr(Se,[re])},onLeaveCancelled(re){te(re),pr(ce,[re])}})}function hf(e){if(e==null)return null;if(ut(e))return[bo(e.enter),bo(e.leave)];{const t=bo(e);return[t,t]}}function bo(e){return mu(e)}function Mn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[vs]||(e[vs]=new Set)).add(t)}function mr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[vs];n&&(n.delete(t),n.size||(e[vs]=void 0))}function fa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function ha(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=N=>(n[N]||"").split(", "),s=r(`${Xn}Delay`),o=r(`${Xn}Duration`),i=pa(s,o),a=r(`${Jr}Delay`),l=r(`${Jr}Duration`),d=pa(a,l);let u=null,f=0,g=0;t===Xn?i>0&&(u=Xn,f=i,g=o.length):t===Jr?d>0&&(u=Jr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Xn:Jr:null,g=u?u===Xn?o.length:l.length:0);const _=u===Xn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Xn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:_}}function pa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ma(n)+ma(e[r])))}function ma(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ga(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[vs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const va=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=Tt(n);let o=!1;if(n&&!s){if(t)if(Tt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ns(r,a,"")}else for(const i in t)n[i]==null&&Ns(r,i,"");for(const i in n)i==="display"&&(o=!0),Ns(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");va in e&&(e[va]=o?r.display:"",e[vf]&&(r.display="none"))}const ya=/\s*!important$/;function Ns(e,t,n){if(Be(n))n.forEach(r=>Ns(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);ya.test(n)?e.setProperty(or(r),n.replace(ya,""),"important"):e[r]=n}}const wa=["Webkit","Moz","ms"],_o={};function _f(e,t){const n=_o[t];if(n)return n;let r=zt(t);if(r!=="filter"&&r in e)return _o[t]=r;r=Ys(r);for(let s=0;s<wa.length;s++){const o=wa[s]+r;if(o in e)return _o[t]=o}return t}const ba="http://www.w3.org/1999/xlink";function _a(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ba,t.slice(6,t.length)):e.setAttributeNS(ba,t,n):n==null||o&&!kl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":dn(n)?String(n):n)}function ka(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ic(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=kl(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 Mr(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const Ta=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[Ta]||(e[Ta]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Mr(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const Sa=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(Sa.test(e)){t={};let r;for(;r=e.match(Sa);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):or(e.slice(2)),t]}let ko=0;const xf=Promise.resolve(),Cf=()=>ko||(xf.then(()=>ko=0),ko=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;hn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(Be(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 xa=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):Gs(t)?ci(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))?(ka(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_a(e,t,r,i,o,t!=="value")):e._isVueCE&&($f(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Tt(r)))?ka(e,zt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_a(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&xa(t)&&We(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 xa(t)&&Tt(n)?!1:t in e}function $f(e,t){const n=e._def.props;if(!n)return!1;const r=zt(t);return Array.isArray(n)?n.some(s=>zt(s)===r):Object.keys(n).some(s=>zt(s)===r)}const Ca=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>$s(t,n):t};function Mf(e){e.target.composing=!0}function Ea(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const To=Symbol("_assign");function Aa(e,t,n){return t&&(e=e.trim()),n&&(e=fi(e)),e}const Vn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[To]=Ca(s);const o=r||s.props&&s.props.type==="number";Mr(e,t?"change":"input",i=>{i.target.composing||e[To](Aa(e.value,n,o))}),(n||o)&&Mr(e,"change",()=>{e.value=Aa(e.value,n,o)}),t||(Mr(e,"compositionstart",Mf),Mr(e,"compositionend",Ea),Mr(e,"change",Ea))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[To]=Ca(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?fi(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))}},Pf=["ctrl","shift","alt","meta"],Of={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)=>Pf.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=Of[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Nf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Gt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=or(s.key);if(t.some(i=>i===o||Nf[i]===o))return e(s)}))},jf=It({patchProp:If},cf);let Ia;function Df(){return Ia||(Ia=Ud(jf))}const Lf=((...e)=>{const t=Df().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Ff(r);if(!s)return;const o=t._component;!We(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Bf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Bf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ff(e){return Tt(e)?document.querySelector(e):e}/*!
|
|
18
|
+
* vue-router v4.6.4
|
|
19
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/const Pr=typeof document<"u";function Mc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Hf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Mc(e.default)}const lt=Object.assign;function So(e,t){const n={};for(const r in t){const s=t[r];n[r]=pn(s)?s.map(e):e(s)}return n}const cs=()=>{},pn=Array.isArray;function Ra(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Pc=/#/g,Uf=/&/g,Vf=/\//g,Wf=/=/g,qf=/\?/g,Oc=/\+/g,Kf=/%5B/g,Gf=/%5D/g,Nc=/%5E/g,zf=/%60/g,jc=/%7B/g,Yf=/%7C/g,Dc=/%7D/g,Jf=/%20/g;function Ai(e){return e==null?"":encodeURI(""+e).replace(Yf,"|").replace(Kf,"[").replace(Gf,"]")}function Qf(e){return Ai(e).replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xo(e){return Ai(e).replace(Oc,"%2B").replace(Jf,"+").replace(Pc,"%23").replace(Uf,"%26").replace(zf,"`").replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xf(e){return Xo(e).replace(Wf,"%3D")}function Zf(e){return Ai(e).replace(Pc,"%23").replace(qf,"%3F")}function eh(e){return Zf(e).replace(Vf,"%2F")}function ys(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const th=/\/$/,nh=e=>e.replace(th,"");function xo(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=ih(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ys(i)}}function rh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $a(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Fr(t.matched[r],n.matched[s])&&Lc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Fr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Lc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!oh(e[n],t[n]))return!1;return!0}function oh(e,t){return pn(e)?Ma(e,t):pn(t)?Ma(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ma(e,t){return pn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ih(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 Zn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Zo=(function(e){return e.pop="pop",e.push="push",e})({}),Co=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ah(e){if(!e)if(Pr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),nh(e)}const lh=/^[^#]+#/;function ch(e,t){return e.replace(lh,"#")+t}function uh(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 io=()=>({left:window.scrollX,top:window.scrollY});function dh(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=uh(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 Pa(e,t){return(history.state?history.state.position-t:-1)+e}const ei=new Map;function fh(e,t){ei.set(e,t)}function hh(e){const t=ei.get(e);return ei.delete(e),t}function ph(e){return typeof e=="string"||e&&typeof e=="object"}function Bc(e){return typeof e=="string"||typeof e=="symbol"}let St=(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 Fc=Symbol("");St.MATCHER_NOT_FOUND+"",St.NAVIGATION_GUARD_REDIRECT+"",St.NAVIGATION_ABORTED+"",St.NAVIGATION_CANCELLED+"",St.NAVIGATION_DUPLICATED+"";function Hr(e,t){return lt(new Error,{type:e,[Fc]:!0},t)}function Pn(e,t){return e instanceof Error&&Fc in e&&(t==null||!!(e.type&t))}const mh=["params","query","hash"];function gh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of mh)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function vh(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(Oc," "),o=s.indexOf("="),i=ys(o<0?s:s.slice(0,o)),a=o<0?null:ys(s.slice(o+1));if(i in t){let l=t[i];pn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Oa(e){let t="";for(let n in e){const r=e[n];if(n=Xf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(pn(r)?r.map(s=>s&&Xo(s)):[r&&Xo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function yh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=pn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const wh=Symbol(""),Na=Symbol(""),ao=Symbol(""),Ii=Symbol(""),ti=Symbol("");function Qr(){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 nr(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(Hr(St.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):ph(g)?l(Hr(St.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 Eo(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(Mc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(nr(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=Hf(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&nr(g,n,r,i,a,s)()}))}}return o}function bh(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=>Fr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Fr(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 _h=()=>location.protocol+"//"+location.host;function Hc(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),$a(a,"")}return $a(n,e)+r+s}function kh(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const _=Hc(e,location),N=n.value,I=t.value;let U=0;if(g){if(n.value=_,t.value=g,i&&i===N){i=null;return}U=I?g.position-I.position:0}else r(_);s.forEach(J=>{J(n.value,N,{delta:U,type:Zo.pop,direction:U?U>0?Co.forward:Co.back:Co.unknown})})};function l(){i=n.value}function d(g){s.push(g);const _=()=>{const N=s.indexOf(g);N>-1&&s.splice(N,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(lt({},g.state,{scroll:io()}),"")}}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 ja(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?io():null}}function Th(e){const{history:t,location:n}=window,r={value:Hc(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:_h()+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,lt({},t.state,ja(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=lt({},s.value,t.state,{forward:l,scroll:io()});o(u.current,u,!0),o(l,lt({},ja(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Sh(e){e=ah(e);const t=Th(e),n=kh(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=lt({location:"",base:e,go:r,createHref:ch.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 xh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Sh(e)}let br=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var At=(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})(At||{});const Ch={type:br.Static,value:""},Eh=/[a-zA-Z0-9_]/;function Ah(e){if(!e)return[[]];if(e==="/")return[[Ch]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=At.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===At.Static?o.push({type:br.Static,value:d}):n===At.Param||n===At.ParamRegExp||n===At.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:br.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!==At.ParamRegExp){r=n,n=At.EscapeNext;continue}switch(n){case At.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=At.Param):g();break;case At.EscapeNext:g(),n=r;break;case At.Param:l==="("?n=At.ParamRegExp:Eh.test(l)?g():(f(),n=At.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case At.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=At.ParamRegExpEnd:u+=l;break;case At.ParamRegExpEnd:f(),n=At.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===At.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Da="[^/]+?",Ih={sensitive:!1,strict:!1,start:!0,end:!0};var qt=(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})(qt||{});const Rh=/[.+*?^${}()[\]/\\]/g;function $h(e,t){const n=lt({},Ih,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[qt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let _=qt.Segment+(n.sensitive?qt.BonusCaseSensitive:0);if(g.type===br.Static)f||(s+="/"),s+=g.value.replace(Rh,"\\$&"),_+=qt.Static;else if(g.type===br.Param){const{value:N,repeatable:I,optional:U,regexp:J}=g;o.push({name:N,repeatable:I,optional:U});const O=J||Da;if(O!==Da){_+=qt.BonusCustomRegExp;try{`${O}`}catch(D){throw new Error(`Invalid custom RegExp for param "${N}" (${O}): `+D.message)}}let W=I?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(W=U&&d.length<2?`(?:/${W})`:"/"+W),U&&(W+="?"),s+=W,_+=qt.Dynamic,U&&(_+=qt.BonusOptional),I&&(_+=qt.BonusRepeatable),O===".*"&&(_+=qt.BonusWildcard)}u.push(_)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=qt.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]||"",N=o[g-1];f[N.name]=_&&N.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===br.Static)u+=_.value;else if(_.type===br.Param){const{value:N,repeatable:I,optional:U}=_,J=N in d?d[N]:"";if(pn(J)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const O=pn(J)?J.join("/"):J;if(!O)if(U)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);u+=O}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Mh(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]===qt.Static+qt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===qt.Static+qt.Segment?1:-1:0}function Uc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Mh(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(La(r))return 1;if(La(s))return-1}return s.length-r.length}function La(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Ph={strict:!1,end:!0,sensitive:!1};function Oh(e,t,n){const r=$h(Ah(e.path),n),s=lt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Nh(e,t){const n=[],r=new Map;t=Ra(Ph,t);function s(f){return r.get(f)}function o(f,g,_){const N=!_,I=Fa(f);I.aliasOf=_&&_.record;const U=Ra(t,f),J=[I];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of D)J.push(Fa(lt({},I,{components:_?_.record.components:I.components,path:ce,aliasOf:_?_.record:I})))}let O,W;for(const D of J){const{path:ce}=D;if(g&&ce[0]!=="/"){const fe=g.record.path,pe=fe[fe.length-1]==="/"?"":"/";D.path=g.record.path+(ce&&pe+ce)}if(O=Oh(D,g,U),_?_.alias.push(O):(W=W||O,W!==O&&W.alias.push(O),N&&f.name&&!Ha(O)&&i(f.name)),Vc(O)&&l(O),I.children){const fe=I.children;for(let pe=0;pe<fe.length;pe++)o(fe[pe],O,_&&_.children[pe])}_=_||O}return W?()=>{i(W)}:cs}function i(f){if(Bc(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=Lh(f,n);n.splice(g,0,f),f.record.name&&!Ha(f)&&r.set(f.record.name,f)}function d(f,g){let _,N={},I,U;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw Hr(St.MATCHER_NOT_FOUND,{location:f});U=_.record.name,N=lt(Ba(g.params,_.keys.filter(W=>!W.optional).concat(_.parent?_.parent.keys.filter(W=>W.optional):[]).map(W=>W.name)),f.params&&Ba(f.params,_.keys.map(W=>W.name))),I=_.stringify(N)}else if(f.path!=null)I=f.path,_=n.find(W=>W.re.test(I)),_&&(N=_.parse(I),U=_.record.name);else{if(_=g.name?r.get(g.name):n.find(W=>W.re.test(g.path)),!_)throw Hr(St.MATCHER_NOT_FOUND,{location:f,currentLocation:g});U=_.record.name,N=lt({},g.params,f.params),I=_.stringify(N)}const J=[];let O=_;for(;O;)J.unshift(O.record),O=O.parent;return{name:U,path:I,params:N,matched:J,meta:Dh(J)}}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 Ba(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:jh(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 jh(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 Ha(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Dh(e){return e.reduce((t,n)=>lt(t,n.meta),{})}function Lh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Uc(e,t[o])<0?r=o:n=o+1}const s=Bh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Bh(e){let t=e;for(;t=t.parent;)if(Vc(t)&&Uc(e,t)===0)return t}function Vc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ua(e){const t=un(ao),n=un(Ii),r=de(()=>{const l=De(e.to);return t.resolve(l)}),s=de(()=>{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(Fr.bind(null,u));if(g>-1)return g;const _=Va(l[d-2]);return d>1&&Va(u)===_&&f[f.length-1].path!==_?f.findIndex(Fr.bind(null,l[d-2])):g}),o=de(()=>s.value>-1&&Wh(n.params,r.value.params)),i=de(()=>s.value>-1&&s.value===n.matched.length-1&&Lc(n.params,r.value.params));function a(l={}){if(Vh(l)){const d=t[De(e.replace)?"replace":"push"](De(e.to)).catch(cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:de(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Fh(e){return e.length===1?e[0]:e}const Hh=Mt({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:Ua,setup(e,{slots:t}){const n=Xs(Ua(e)),{options:r}=un(ao),s=de(()=>({[Wa(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Wa(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Fh(t.default(n));return e.custom?o:Ei("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Uh=Hh;function Vh(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 Wh(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(!pn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Va(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wa=(e,t,n)=>e??t??n,qh=Mt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=un(ti),s=de(()=>e.route||r.value),o=un(Na,0),i=de(()=>{let d=De(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=de(()=>s.value.matched[i.value]);Ms(Na,de(()=>i.value+1)),Ms(wh,a),Ms(ti,s);const l=P();return ft(()=>[l.value,a.value,e.name],([d,u,f],[g,_,N])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!Fr(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 qa(n.default,{Component:g,route:d});const _=f.props[u],N=_?_===!0?d.params:typeof _=="function"?_(d):_:null,U=Ei(g,lt({},N,t,{onVnodeUnmounted:J=>{J.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return qa(n.default,{Component:U,route:d})||U}}});function qa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Kh=qh;function Gh(e){const t=Nh(e.routes,e),n=e.parseQuery||vh,r=e.stringifyQuery||Oa,s=e.history,o=Qr(),i=Qr(),a=Qr(),l=Wu(Zn);let d=Zn;Pr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=So.bind(null,R=>""+R),f=So.bind(null,eh),g=So.bind(null,ys);function _(R,Z){let X,ge;return Bc(R)?(X=t.getRecordMatcher(R),ge=Z):ge=R,t.addRoute(ge,X)}function N(R){const Z=t.getRecordMatcher(R);Z&&t.removeRoute(Z)}function I(){return t.getRoutes().map(R=>R.record)}function U(R){return!!t.getRecordMatcher(R)}function J(R,Z){if(Z=lt({},Z||l.value),typeof R=="string"){const E=xo(n,R,Z.path),B=t.resolve({path:E.path},Z),F=s.createHref(E.fullPath);return lt(E,B,{params:g(B.params),hash:ys(E.hash),redirectedFrom:void 0,href:F})}let X;if(R.path!=null)X=lt({},R,{path:xo(n,R.path,Z.path).path});else{const E=lt({},R.params);for(const B in E)E[B]==null&&delete E[B];X=lt({},R,{params:f(E)}),Z.params=f(Z.params)}const ge=t.resolve(X,Z),Ne=R.hash||"";ge.params=u(g(ge.params));const v=rh(r,lt({},R,{hash:Qf(Ne),path:ge.path})),w=s.createHref(v);return lt({fullPath:v,hash:Ne,query:r===Oa?yh(R.query):R.query||{}},ge,{redirectedFrom:void 0,href:w})}function O(R){return typeof R=="string"?xo(n,R,l.value.path):lt({},R)}function W(R,Z){if(d!==R)return Hr(St.NAVIGATION_CANCELLED,{from:Z,to:R})}function D(R){return pe(R)}function ce(R){return D(lt(O(R),{replace:!0}))}function fe(R,Z){const X=R.matched[R.matched.length-1];if(X&&X.redirect){const{redirect:ge}=X;let Ne=typeof ge=="function"?ge(R,Z):ge;return typeof Ne=="string"&&(Ne=Ne.includes("?")||Ne.includes("#")?Ne=O(Ne):{path:Ne},Ne.params={}),lt({query:R.query,hash:R.hash,params:Ne.path!=null?{}:R.params},Ne)}}function pe(R,Z){const X=d=J(R),ge=l.value,Ne=R.state,v=R.force,w=R.replace===!0,E=fe(X,ge);if(E)return pe(lt(O(E),{state:typeof E=="object"?lt({},Ne,E.state):Ne,force:v,replace:w}),Z||X);const B=X;B.redirectedFrom=Z;let F;return!v&&sh(r,ge,X)&&(F=Hr(St.NAVIGATION_DUPLICATED,{to:B,from:ge}),nt(ge,ge,!0,!1)),(F?Promise.resolve(F):te(B,ge)).catch(j=>Pn(j)?Pn(j,St.NAVIGATION_GUARD_REDIRECT)?j:et(j):Oe(j,B,ge)).then(j=>{if(j){if(Pn(j,St.NAVIGATION_GUARD_REDIRECT))return pe(lt({replace:w},O(j.to),{state:typeof j.to=="object"?lt({},Ne,j.to.state):Ne,force:v}),Z||B)}else j=re(B,ge,!0,w,Ne);return ye(B,ge,j),j})}function Se(R,Z){const X=W(R,Z);return X?Promise.reject(X):Promise.resolve()}function ie(R){const Z=me.values().next().value;return Z&&typeof Z.runWithContext=="function"?Z.runWithContext(R):R()}function te(R,Z){let X;const[ge,Ne,v]=bh(R,Z);X=Eo(ge.reverse(),"beforeRouteLeave",R,Z);for(const E of ge)E.leaveGuards.forEach(B=>{X.push(nr(B,R,Z))});const w=Se.bind(null,R,Z);return X.push(w),xe(X).then(()=>{X=[];for(const E of o.list())X.push(nr(E,R,Z));return X.push(w),xe(X)}).then(()=>{X=Eo(Ne,"beforeRouteUpdate",R,Z);for(const E of Ne)E.updateGuards.forEach(B=>{X.push(nr(B,R,Z))});return X.push(w),xe(X)}).then(()=>{X=[];for(const E of v)if(E.beforeEnter)if(pn(E.beforeEnter))for(const B of E.beforeEnter)X.push(nr(B,R,Z));else X.push(nr(E.beforeEnter,R,Z));return X.push(w),xe(X)}).then(()=>(R.matched.forEach(E=>E.enterCallbacks={}),X=Eo(v,"beforeRouteEnter",R,Z,ie),X.push(w),xe(X))).then(()=>{X=[];for(const E of i.list())X.push(nr(E,R,Z));return X.push(w),xe(X)}).catch(E=>Pn(E,St.NAVIGATION_CANCELLED)?E:Promise.reject(E))}function ye(R,Z,X){a.list().forEach(ge=>ie(()=>ge(R,Z,X)))}function re(R,Z,X,ge,Ne){const v=W(R,Z);if(v)return v;const w=Z===Zn,E=Pr?history.state:{};X&&(ge||w?s.replace(R.fullPath,lt({scroll:w&&E&&E.scroll},Ne)):s.push(R.fullPath,Ne)),l.value=R,nt(R,Z,X,w),et()}let Ue;function Fe(){Ue||(Ue=s.listen((R,Z,X)=>{if(!Ie.listening)return;const ge=J(R),Ne=fe(ge,Ie.currentRoute.value);if(Ne){pe(lt(Ne,{replace:!0,force:!0}),ge).catch(cs);return}d=ge;const v=l.value;Pr&&fh(Pa(v.fullPath,X.delta),io()),te(ge,v).catch(w=>Pn(w,St.NAVIGATION_ABORTED|St.NAVIGATION_CANCELLED)?w:Pn(w,St.NAVIGATION_GUARD_REDIRECT)?(pe(lt(O(w.to),{force:!0}),ge).then(E=>{Pn(E,St.NAVIGATION_ABORTED|St.NAVIGATION_DUPLICATED)&&!X.delta&&X.type===Zo.pop&&s.go(-1,!1)}).catch(cs),Promise.reject()):(X.delta&&s.go(-X.delta,!1),Oe(w,ge,v))).then(w=>{w=w||re(ge,v,!1),w&&(X.delta&&!Pn(w,St.NAVIGATION_CANCELLED)?s.go(-X.delta,!1):X.type===Zo.pop&&Pn(w,St.NAVIGATION_ABORTED|St.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(ge,v,w)}).catch(cs)}))}let Ye=Qr(),$e=Qr(),Te;function Oe(R,Z,X){et(R);const ge=$e.list();return ge.length?ge.forEach(Ne=>Ne(R,Z,X)):console.error(R),Promise.reject(R)}function yt(){return Te&&l.value!==Zn?Promise.resolve():new Promise((R,Z)=>{Ye.add([R,Z])})}function et(R){return Te||(Te=!R,Fe(),Ye.list().forEach(([Z,X])=>R?X(R):Z()),Ye.reset()),R}function nt(R,Z,X,ge){const{scrollBehavior:Ne}=e;if(!Pr||!Ne)return Promise.resolve();const v=!X&&hh(Pa(R.fullPath,0))||(ge||!X)&&history.state&&history.state.scroll||null;return tn().then(()=>Ne(R,Z,v)).then(w=>w&&dh(w)).catch(w=>Oe(w,R,Z))}const ot=R=>s.go(R);let rt;const me=new Set,Ie={currentRoute:l,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:U,getRoutes:I,resolve:J,options:e,push:D,replace:ce,go:ot,back:()=>ot(-1),forward:()=>ot(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:$e.add,isReady:yt,install(R){R.component("RouterLink",Uh),R.component("RouterView",Kh),R.config.globalProperties.$router=Ie,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>De(l)}),Pr&&!rt&&l.value===Zn&&(rt=!0,D(s.location).catch(ge=>{}));const Z={};for(const ge in Zn)Object.defineProperty(Z,ge,{get:()=>l.value[ge],enumerable:!0});R.provide(ao,Ie),R.provide(Ii,Bl(Z)),R.provide(ti,l);const X=R.unmount;me.add(R),R.unmount=function(){me.delete(R),me.size<1&&(d=Zn,Ue&&Ue(),Ue=null,l.value=Zn,rt=!1,Te=!1),X()}}};function xe(R){return R.reduce((Z,X)=>Z.then(()=>ie(X)),Promise.resolve())}return Ie}function zh(){return un(ao)}function Yh(e){return un(Ii)}const Ka=768;function Wc(){const e=P(typeof window<"u"?window.innerWidth<Ka:!1);let t=null;function n(r){e.value=r.matches}return qn(()=>{t=window.matchMedia(`(max-width: ${Ka-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),no(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Jh={key:0,class:"desktop-sidebar"},Qh={class:"desktop-main"},Ga="codex-web-local.sidebar-width.v1",Xh=260,Zh=620,za=320,ep=Mt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Wc();function r(d){return Math.min(Zh,Math.max(Xh,d))}function s(){if(typeof window>"u")return za;const d=window.localStorage.getItem(Ga),u=Number(d);return Number.isFinite(u)?r(u):za}const o=P(s()),i=de(()=>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(Ga,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=N=>{const I=N.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)=>(b(),C("div",{class:ht(["desktop-layout",{"is-mobile":De(n)}]),style:Tr(i.value)},[De(n)?(b(),mt(Fs,{key:0,to:"body"},[Ae($c,{name:"drawer"},{default:dt(()=>[e.isSidebarCollapsed?ue("",!0):(b(),C("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"]))},[Tn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ue("",!0),De(n)?ue("",!0):(b(),C(Ve,{key:1},[e.isSidebarCollapsed?ue("",!0):(b(),C("aside",Jh,[Tn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ue("",!0):(b(),C("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Qh,[Tn(d.$slots,"content",{},void 0)])],6))}}),tt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},tp=tt(ep,[["__scopeId","data-v-df29c633"]]),np={},rp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sp(e,t){return b(),C("svg",rp,[...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 lo=tt(np,[["render",sp]]),op={},ip={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ap(e,t){return b(),C("svg",ip,[...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 qc=tt(op,[["render",ap]]),lp={},cp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function up(e,t){return b(),C("svg",cp,[...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 Xr=tt(lp,[["render",up]]),dp={},fp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hp(e,t){return b(),C("svg",fp,[...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 qs=tt(dp,[["render",hp]]),pp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gp(e,t){return b(),C("svg",mp,[...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 Kc=tt(pp,[["render",gp]]),vp={},yp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wp(e,t){return b(),C("svg",yp,[...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 bp=tt(vp,[["render",wp]]),_p={},kp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tp(e,t){return b(),C("svg",kp,[...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 js=tt(_p,[["render",Tp]]),Sp={},xp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cp(e,t){return b(),C("svg",xp,[...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 Ao=tt(Sp,[["render",Cp]]),Ep={key:0,class:"sidebar-menu-row-left"},Ap={class:"sidebar-menu-row-main"},Ip={key:1,class:"sidebar-menu-row-right"},Rp={key:0,class:"sidebar-menu-row-right-default"},$p={key:1,class:"sidebar-menu-row-right-hover"},Mp=Mt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=de(()=>!!n.left),s=de(()=>!!n.right),o=de(()=>!!n["right-hover"]),i=de(()=>s.value||o.value);return(a,l)=>(b(),mt(qo(t.as),xc({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:dt(()=>[r.value?(b(),C("span",Ep,[Tn(a.$slots,"left",{},void 0,!0)])):ue("",!0),m("span",Ap,[Tn(a.$slots,"default",{},void 0,!0)]),i.value?(b(),C("span",Ip,[s.value?(b(),C("span",Rp,[Tn(a.$slots,"right",{},void 0,!0)])):ue("",!0),o.value?(b(),C("span",$p,[Tn(a.$slots,"right-hover",{},void 0,!0)])):ue("",!0)])):ue("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),gr=tt(Mp,[["__scopeId","data-v-daeca4df"]]),Pp={class:"thread-tree-root"},Op={key:0,class:"pinned-section"},Np={class:"thread-list"},jp={class:"thread-left-stack"},Dp=["data-state"],Lp=["onClick"],Bp=["onClick"],Fp={class:"thread-row-title-wrap"},Hp={class:"thread-row-title"},Up={class:"thread-row-time"},Vp=["onClick"],Wp=["onClick"],qp=["onClick"],Kp=["aria-expanded"],Gp=["data-active"],zp={key:0},Yp=["data-active"],Jp={key:0},Qp={key:1,class:"thread-tree-no-results"},Xp={key:2,class:"thread-tree-loading"},Zp={key:3,class:"thread-list thread-list-global"},em={class:"thread-left-stack"},tm=["data-state"],nm=["onClick"],rm=["onClick"],sm={class:"thread-row-title-wrap"},om={class:"thread-row-title"},im={class:"thread-row-time"},am=["onClick"],lm=["onClick"],cm=["onClick"],um=["data-project-name","data-expanded","data-dragging"],dm={class:"project-icon-stack"},fm={class:"project-icon-folder"},hm={class:"project-icon-chevron"},pm=["data-dragging-handle","onMousedown"],mm={class:"project-title"},gm={class:"project-hover-controls"},vm=["onClick"],ym=["onClick"],wm=["onClick"],bm=["onClick"],_m=["onInput"],km=["aria-label","title","onClick"],Tm={key:0,class:"thread-list"},Sm={class:"thread-left-stack"},xm=["data-state"],Cm=["onClick"],Em=["onClick"],Am={class:"thread-row-title-wrap"},Im={class:"thread-row-title"},Rm={class:"thread-row-time"},$m=["onClick"],Mm=["onClick"],Pm=["onClick"],Om=["onClick"],Nm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},jm=["onKeydown"],Dm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Lm={class:"rename-thread-subtitle"},Bm=4,Ya=6,Ja="codex-web-local.thread-view-mode.v1",Qa="codex-web-local.collapsed-projects.v1",Fm=Mt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","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(""),N=P(null),I=P(!1),U=P(""),J=P(""),O=P(null),W=P(null),D=P(null);let ce=null,fe=null;const pe=P(""),Se=P({}),ie=new Map,te=new Map,ye=new Map,re=new WeakMap,Ue=P(null),Fe=P(!1),Ye=P(Oe()),$e=typeof window<"u"?new ResizeObserver(k=>{for(const A of k){const $=A.target,q=re.get($);q&&be(q,$)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Qa);if(!k)return{};const A=JSON.parse(k);return!A||typeof A!="object"||Array.isArray(A)?{}:A}catch{return{}}}function Oe(){return typeof window>"u"?"project":window.localStorage.getItem(Ja)==="chronological"?"chronological":"project"}o.value=Te(),ft(o,k=>{typeof window>"u"||window.localStorage.setItem(Qa,JSON.stringify(k))},{deep:!0}),ft(Ye,k=>{typeof window>"u"||window.localStorage.setItem(Ja,k)});const yt=de(()=>n.searchQuery.trim().toLowerCase()),et=de(()=>yt.value.length>0),nt=de(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function ot(k){if(!et.value)return!0;if(nt.value)return nt.value.has(k.id);const A=yt.value;return k.title.toLowerCase().includes(A)||k.preview.toLowerCase().includes(A)}const rt=de(()=>et.value?n.groups.map(k=>({...k,threads:k.threads.filter(ot)})).filter(k=>k.threads.length>0):n.groups),me=de(()=>Ye.value==="chronological"),Ie=de(()=>{const k=rt.value,A=[];for(const $ of k)for(const q of $.threads)w(q.id)||A.push(q);return A.sort(($,q)=>{const Le=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-Le})}),xe=de(()=>{const k=new Map;for(const A of n.groups)for(const $ of A.threads)k.set($.id,$);return k}),R=de(()=>i.value.map(k=>xe.value.get(k)??null).filter(k=>k!==null).filter(ot)),Z=de(()=>{const k=D.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const A=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),$=A>k.fromIndex?A-1:A,q=Math.max(0,Math.min($,n.groups.length-1));return q===k.fromIndex?null:q}),X=de(()=>{const A=(et.value?rt.value:n.groups).map(Qt=>Qt.projectName),$=D.value,q=Z.value;if(!$||q===null)return A;const Le=[...A],[kt]=Le.splice($.fromIndex,1);return kt?(Le.splice(q,0,kt),Le):A}),ge=de(()=>{const k={};let A=0;for(const $ of X.value)k[$]=A,A+=xn($);return k}),Ne=de(()=>{let k=0;for(const A of X.value)k+=xn(A);return{height:`${Math.max(0,k)}px`}});function v(k){const A=new Date(k).getTime();if(Number.isNaN(A))return"n/a";const $=Math.abs(Date.now()-A);if($<6e4)return"now";const q=Math.floor($/6e4);if(q<60)return`${q}m`;const Le=Math.floor(q/60);return Le<24?`${Le}h`:`${Math.floor(Le/24)}d`}function w(k){return i.value.includes(k)}function E(k){if(w(k)){i.value=i.value.filter(A=>A!==k);return}i.value=[k,...i.value]}function B(k){r("select",k)}function F(k){return`start new thread ${Re(k)}`}function j(k){r("start-new-thread",k)}function ee(k){l.value===k&&Y()}function se(k){return l.value===k}function Y(){l.value=""}function K(k){if(l.value===k){Y();return}l.value=k}function we(k,A){g.value=k,_.value=A,f.value=!0,Y(),tn(()=>{var $,q;($=N.value)==null||$.focus(),(q=N.value)==null||q.select()})}function le(){f.value=!1,g.value="",_.value=""}function _e(){const k=g.value,A=_.value.trim();!k||!A||(r("rename-thread",{threadId:k,title:A}),le())}function Ce(k,A){U.value=k,J.value=A,I.value=!0,Y()}function je(){I.value=!1,U.value="",J.value=""}function Ge(){const k=U.value;k&&(i.value=i.value.filter(A=>A!==k),r("archive",k),je())}function Re(k){return n.projectDisplayNameById[k]??k}function pt(k){return a.value===k}function Xe(){a.value="",d.value="actions",u.value=""}function H(){Fe.value=!Fe.value}function V(k){Ye.value=k,Fe.value=!1}function Q(k){if(a.value===k){Xe();return}a.value=k,d.value="actions",u.value=Re(k)}function Je(k){a.value=k,d.value="rename",u.value=Re(k)}function qe(k){r("rename-project",{projectName:k,displayName:u.value})}function Qe(k){r("remove-project",k),Xe()}function jt(k){r("browse-project-files",k),Xe()}function Yt(k,A){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const $=n.groups.findIndex(kt=>kt.projectName===A);if($<0)return;const q=k.key==="ArrowUp"?-1:1,Le=Math.max(0,Math.min($+q,n.groups.length-1));Le!==$&&(k.preventDefault(),r("reorder-project",{projectName:A,toIndex:Le}))}function nn(k){return s.value[k]===!0}function xt(k){return o.value[k]===!0}function Jt(k){s.value={...s.value,[k]:!nn(k)}}function mn(k){if(pe.value===k){pe.value="";return}o.value={...o.value,[k]:!xt(k)}}function xn(k){const A=Se.value[k]??0,$=D.value,Le=(($==null?void 0:$.projectName)===k?$.groupHeight:null)??A,kt=xt(k)?0:Ya;return Math.max(0,Le+kt)}function ln(k,A){const $=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if($){te.set(k,$);return}te.delete(k)}function He(k,A){const $=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if($){ye.set(k,$);return}ye.delete(k)}function p(k){const A=a.value;if(!A)return!1;const $=te.get(A);if(!$)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes($))return!0;const Le=k.target;return Le instanceof Node?$.contains(Le):!1}function T(k){const A=l.value;if(!A)return!1;const $=ye.get(A);if(!$)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes($))return!0;const Le=k.target;return Le instanceof Node?$.contains(Le):!1}function S(k){if(Fe.value){const A=Ue.value,$=typeof k.composedPath=="function"?k.composedPath():[];!!A&&($.includes(A)||k.target instanceof Node&&A.contains(k.target))||(Fe.value=!1)}a.value&&(p(k)||Xe(),l.value&&(T(k)||Y()))}function L(k){a.value&&!p(k)&&Xe(),l.value&&!T(k)&&Y()}function oe(){Fe.value&&(Fe.value=!1),a.value&&Xe(),l.value&&Y()}function ae(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",L,{capture:!0}),window.addEventListener("blur",oe)}function Ee(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",L,{capture:!0}),window.removeEventListener("blur",oe)}function be(k,A){const $=A.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const q=Se.value[k];q!==void 0&&Math.abs(q-$)<.5||(Se.value={...Se.value,[k]:$})}function ze(k,A){const $=ie.get(k);$&&$!==A&&$e&&$e.unobserve($);const q=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if(q){ie.set(k,q),re.set(q,k),be(k,q),$e==null||$e.observe(q);return}$&&($e==null||$e.unobserve($)),ie.delete(k)}function it(k,A){if(k.button!==0||W.value||D.value)return;const $=n.groups.findIndex(Qt=>Qt.projectName===A),q=ie.get(A);if($<0||!q)return;const Le=q.getBoundingClientRect(),kt=xt(A)?0:Ya;W.value={projectName:A,fromIndex:$,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Le.top,groupLeft:Le.left,groupWidth:Le.width,groupHeight:Le.height,groupOuterHeight:Le.height+kt},k.preventDefault(),wt()}function wt(){window.addEventListener("mousemove",Ct),window.addEventListener("mouseup",Cn),window.addEventListener("keydown",ir)}function Pt(){window.removeEventListener("mousemove",Ct),window.removeEventListener("mouseup",Cn),window.removeEventListener("keydown",ir)}function Ct(k){ce={clientX:k.clientX,clientY:k.clientY},Vr()}function Cn(k){Sr({clientX:k.clientX,clientY:k.clientY});const A=D.value;if(A&&Z.value!==null){const $=n.groups.findIndex(q=>q.projectName===A.projectName);if($>=0){const q=Z.value;q!==$&&r("reorder-project",{projectName:A.projectName,toIndex:q})}}Gn()}function ir(k){k.key==="Escape"&&(!W.value&&!D.value||(k.preventDefault(),Gn()))}function Gn(){fe!==null&&(window.cancelAnimationFrame(fe),fe=null),ce=null,W.value=null,D.value=null,pe.value="",Pt()}function Vr(){fe===null&&(fe=window.requestAnimationFrame(()=>{if(fe=null,!ce)return;const k=ce;ce=null,Sr(k)}))}function Sr(k){const A=W.value;if(!D.value&&A){const $=k.clientX-A.startClientX,q=k.clientY-A.startClientY;if(Math.hypot($,q)<Bm)return;Xe(),pe.value=A.projectName,D.value={projectName:A.projectName,fromIndex:A.fromIndex,pointerOffsetY:A.pointerOffsetY,groupLeft:A.groupLeft,groupWidth:A.groupWidth,groupHeight:A.groupHeight,groupOuterHeight:A.groupOuterHeight,ghostTop:k.clientY-A.pointerOffsetY,dropTargetIndexFull:null}}D.value&&Wr(k)}function Wr(k){const A=D.value;if(!A)return;if(A.ghostTop=k.clientY-A.pointerOffsetY,!zn(k)){A.dropTargetIndexFull=null;return}const $=k.clientY,q=O.value;if(!q){A.dropTargetIndexFull=null;return}const Le=q.getBoundingClientRect(),kt=new Map(n.groups.map((rn,Jn)=>[rn.projectName,Jn])),Qt=n.groups.map(rn=>rn.projectName).filter(rn=>rn!==A.projectName);let Er=0,In=n.groups.length;for(const rn of Qt){const Jn=kt.get(rn);if(Jn===void 0)continue;const lr=xn(rn),Gr=Le.top+Er+lr/2;if($<Gr){In=Jn;break}Er+=lr}A.dropTargetIndexFull=In}function zn(k){const A=O.value;if(!A)return!1;const $=A.getBoundingClientRect(),q=k.clientX>=$.left&&k.clientX<=$.right,Le=k.clientY>=$.top-32&&k.clientY<=$.bottom+32;return q&&Le}function ar(k){var A;return((A=D.value)==null?void 0:A.projectName)===k}function qr(k){const A=D.value,$=ge.value[k]??0,q=a.value===k;return!A||A.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${A.groupLeft}px`,width:`${A.groupWidth}px`,height:`${A.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${A.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function En(k){return k.threads.filter(A=>!w(A.id))}function xr(k){if(et.value)return En(k);if(xt(k.projectName))return[];const A=En(k);return nn(k.projectName)?A:A.slice(0,10)}function An(k){return et.value?!1:!xt(k.projectName)&&En(k).length>10}function Kr(k){return En(k).length>0}function Yn(k){return k.inProgress?"working":k.unread?"unread":"idle"}ft(()=>n.groups.map(k=>k.projectName),k=>{var Le,kt;const A=((Le=D.value)==null?void 0:Le.projectName)??((kt=W.value)==null?void 0:kt.projectName)??"";A&&!n.groups.some(Qt=>Qt.projectName===A)&&Gn();const $=new Set(k),q=Object.fromEntries(Object.entries(Se.value).filter(([Qt])=>$.has(Qt)));Object.keys(q).length!==Object.keys(Se.value).length&&(Se.value=q)});const Cr=de(()=>Fe.value||a.value!=="");return ft(Cr,k=>{if(k){ae();return}Ee()}),Kn(()=>{for(const k of ie.values())$e==null||$e.unobserve(k);ie.clear(),te.clear(),Ee(),Gn()}),(k,A)=>(b(),C("section",Pp,[R.value.length>0?(b(),C("section",Op,[m("ul",Np,[(b(!0),C(Ve,null,_t(R.value,$=>(b(),C("li",{key:$.id,class:"thread-row-item"},[Ae(gr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":w($.id),onMouseleave:q=>ee($.id)},{left:dt(()=>[m("span",jp,[$.inProgress||$.unread?(b(),C("span",{key:0,class:"thread-status-indicator","data-state":Yn($)},null,8,Dp)):ue("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>E($.id)},[Ae(Ao,{class:"thread-icon"})],8,Lp)])]),right:dt(()=>[m("span",Up,he(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":dt(()=>[m("div",{ref_for:!0,ref:q=>He($.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(q=>K($.id),["stop"])},[Ae(Xr,{class:"thread-icon"})],8,Vp),se($.id)?(b(),C("div",{key:0,class:"thread-menu-panel",onClick:A[0]||(A[0]=Ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>we($.id,$.title)}," Rename thread ",8,Wp),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>Ce($.id,$.title)}," Delete thread ",8,qp)])):ue("",!0)],512)]),default:dt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>B($.id)},[m("span",Fp,[m("span",Hp,he($.title),1),$.hasWorktree?(b(),mt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,Bp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ue("",!0),Ae(gr,{as:"header",class:"thread-tree-header-row"},{right:dt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Ue,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Fe.value,"aria-label":"Organize threads",title:"Organize threads",onClick:H},[Ae(Xr,{class:"thread-icon"})],8,Kp),Fe.value?(b(),C("div",{key:0,class:"organize-menu-panel",onClick:A[3]||(A[3]=Ze(()=>{},["stop"]))},[A[11]||(A[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Ye.value==="project",type:"button",onClick:A[1]||(A[1]=$=>V("project"))},[A[9]||(A[9]=m("span",null,"By project",-1)),Ye.value==="project"?(b(),C("span",zp,"✓")):ue("",!0)],8,Gp),m("button",{class:"organize-menu-item","data-active":Ye.value==="chronological",type:"button",onClick:A[2]||(A[2]=$=>V("chronological"))},[A[10]||(A[10]=m("span",null,"Chronological list",-1)),Ye.value==="chronological"?(b(),C("span",Jp,"✓")):ue("",!0)],8,Yp)])):ue("",!0)],512)]),default:dt(()=>[A[12]||(A[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),et.value&&rt.value.length===0?(b(),C("p",Qp,"No matching threads")):e.isLoading&&e.groups.length===0?(b(),C("p",Xp,"Loading threads...")):me.value?(b(),C("ul",Zp,[(b(!0),C(Ve,null,_t(Ie.value,$=>(b(),C("li",{key:$.id,class:"thread-row-item"},[Ae(gr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":w($.id),onMouseleave:q=>ee($.id)},{left:dt(()=>[m("span",em,[$.inProgress||$.unread?(b(),C("span",{key:0,class:"thread-status-indicator","data-state":Yn($)},null,8,tm)):ue("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>E($.id)},[Ae(Ao,{class:"thread-icon"})],8,nm)])]),right:dt(()=>[m("span",im,he(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":dt(()=>[m("div",{ref_for:!0,ref:q=>He($.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(q=>K($.id),["stop"])},[Ae(Xr,{class:"thread-icon"})],8,am),se($.id)?(b(),C("div",{key:0,class:"thread-menu-panel",onClick:A[4]||(A[4]=Ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>we($.id,$.title)}," Rename thread ",8,lm),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>Ce($.id,$.title)}," Delete thread ",8,cm)])):ue("",!0)],512)]),default:dt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>B($.id)},[m("span",sm,[m("span",om,he($.title),1),$.hasWorktree?(b(),mt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,rm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),C("div",{key:4,ref_key:"groupsContainerRef",ref:O,class:"thread-tree-groups",style:Tr(Ne.value)},[(b(!0),C(Ve,null,_t(rt.value,$=>(b(),C("article",{key:$.projectName,ref_for:!0,ref:q=>ze($.projectName,q),class:"project-group","data-project-name":$.projectName,"data-expanded":!xt($.projectName),"data-dragging":ar($.projectName),style:Tr(qr($.projectName))},[Ae(gr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>mn($.projectName),onKeydown:[q=>Yt(q,$.projectName),Gt(Ze(q=>mn($.projectName),["prevent"]),["enter"]),Gt(Ze(q=>mn($.projectName),["prevent"]),["space"])]},{left:dt(()=>[m("span",dm,[m("span",fm,[xt($.projectName)?(b(),mt(Kc,{key:0,class:"thread-icon"})):(b(),mt(bp,{key:1,class:"thread-icon"}))]),m("span",hm,[xt($.projectName)?(b(),mt(qc,{key:0,class:"thread-icon"})):(b(),mt(lo,{key:1,class:"thread-icon"}))])])]),right:dt(()=>[m("div",gm,[m("div",{ref_for:!0,ref:q=>ln($.projectName,q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Ze(q=>Q($.projectName),["stop"])},[Ae(Xr,{class:"thread-icon"})],8,vm),pt($.projectName)?(b(),C("div",{key:0,class:"project-menu-panel",onClick:A[6]||(A[6]=Ze(()=>{},["stop"]))},[d.value==="actions"?(b(),C(Ve,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:q=>jt($.projectName)}," Browse files ",8,ym),m("button",{class:"project-menu-item",type:"button",onClick:q=>Je($.projectName)}," Edit name ",8,wm),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>Qe($.projectName)}," Remove ",8,bm)],64)):(b(),C(Ve,{key:1},[A[13]||(A[13]=m("label",{class:"project-menu-label"},"Project name",-1)),Un(m("input",{"onUpdate:modelValue":A[5]||(A[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>qe($.projectName)},null,40,_m),[[Vn,u.value]])],64))])):ue("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":F($.projectName),title:F($.projectName),onClick:Ze(q=>j($.projectName),["stop"])},[Ae(qs,{class:"thread-icon"})],8,km)])]),default:dt(()=>[m("span",{class:"project-main-button","data-dragging-handle":ar($.projectName),onMousedown:Ze(q=>it(q,$.projectName),["left"])},[m("span",mm,he(Re($.projectName)),1)],40,pm)]),_:2},1032,["onClick","onKeydown"]),Kr($)?(b(),C("ul",Tm,[(b(!0),C(Ve,null,_t(xr($),q=>(b(),C("li",{key:q.id,class:"thread-row-item"},[Ae(gr,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":w(q.id),onMouseleave:Le=>ee(q.id)},{left:dt(()=>[m("span",Sm,[q.inProgress||q.unread?(b(),C("span",{key:0,class:"thread-status-indicator","data-state":Yn(q)},null,8,xm)):ue("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Le=>E(q.id)},[Ae(Ao,{class:"thread-icon"})],8,Cm)])]),right:dt(()=>[m("span",Rm,he(v(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":dt(()=>[m("div",{ref_for:!0,ref:Le=>He(q.id,Le),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(Le=>K(q.id),["stop"])},[Ae(Xr,{class:"thread-icon"})],8,$m),se(q.id)?(b(),C("div",{key:0,class:"thread-menu-panel",onClick:A[7]||(A[7]=Ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Le=>we(q.id,q.title)}," Rename thread ",8,Mm),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Le=>Ce(q.id,q.title)}," Delete thread ",8,Pm)])):ue("",!0)],512)]),default:dt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Le=>B(q.id)},[m("span",Am,[m("span",Im,he(q.title),1),q.hasWorktree?(b(),mt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,Em)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),mt(gr,{key:1,as:"p",class:"project-empty-row"},{left:dt(()=>[...A[14]||(A[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:dt(()=>[A[15]||(A[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),An($)?(b(),mt(gr,{key:2,class:"thread-show-more-row"},{left:dt(()=>[...A[16]||(A[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:dt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:q=>Jt($.projectName)},he(nn($.projectName)?"Show less":"Show more"),9,Om)]),_:2},1024)):ue("",!0)],12,um))),128))],4)),(b(),mt(Fs,{to:"body"},[f.value?(b(),C("div",{key:0,class:"rename-thread-overlay",onClick:Ze(le,["self"])},[m("div",Nm,[A[17]||(A[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),A[18]||(A[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Un(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":A[8]||(A[8]=$=>_.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Gt(Ze(_e,["prevent"]),["enter"]),Gt(Ze(le,["prevent"]),["esc"])]},null,40,jm),[[Vn,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:le},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:_e},"Save")])])])):ue("",!0)])),(b(),mt(Fs,{to:"body"},[I.value?(b(),C("div",{key:0,class:"rename-thread-overlay",onClick:Ze(je,["self"])},[m("div",Dm,[A[19]||(A[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Lm,' This will archive the thread "'+he(J.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:je},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Ge},"Delete")])])])):ue("",!0)]))]))}}),Hm=tt(Fm,[["__scopeId","data-v-7c022821"]]),Um={class:"content-header"},Vm={class:"content-leading"},Wm={class:"content-title"},qm={class:"content-actions"},Km=Mt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(b(),C("header",Um,[m("div",Vm,[Tn(t.$slots,"leading",{},void 0)]),m("h1",Wm,he(e.title),1),m("div",qm,[Tn(t.$slots,"actions",{},void 0)])]))}}),Gm=tt(Km,[["__scopeId","data-v-66ee223c"]]),zm={},Ym={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jm(e,t){return b(),C("svg",Ym,[...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 Ri=tt(zm,[["render",Jm]]),Qm={},Xm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Zm(e,t){return b(),C("svg",Xm,[...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 eg=tt(Qm,[["render",Zm]]),tg={class:"conversation-root"},ng={key:0,class:"conversation-loading"},rg={key:1,class:"conversation-empty"},sg={class:"message-row"},og={class:"message-stack"},ig={class:"request-card"},ag={class:"request-title"},lg={class:"request-meta"},cg={key:0,class:"request-reason"},ug={key:1,class:"request-actions"},dg=["onClick"],fg=["onClick"],hg=["onClick"],pg=["onClick"],mg={key:2,class:"request-actions"},gg=["onClick"],vg=["onClick"],yg=["onClick"],wg=["onClick"],bg={key:3,class:"request-user-input"},_g={class:"request-question-title"},kg={key:0,class:"request-question-text"},Tg=["value","onChange"],Sg=["value"],xg=["value","onInput"],Cg=["onClick"],Eg={key:4,class:"request-actions"},Ag=["onClick"],Ig=["onClick"],Rg={key:5,class:"request-actions"},$g=["onClick"],Mg=["onClick"],Pg=["data-role","data-message-type"],Og={key:0,class:"message-row","data-role":"system"},Ng={class:"message-stack","data-role":"system"},jg=["onClick"],Dg={class:"cmd-label"},Lg={class:"cmd-status"},Bg={class:"cmd-output-inner"},Fg={class:"cmd-output"},Hg=["data-role","data-message-type"],Ug=["data-role"],Vg=["data-role"],Wg=["data-role"],qg=["onClick"],Kg=["src"],Gg={key:1,class:"message-file-attachments"},zg=["href","title"],Yg=["data-role"],Jg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Qg=["onClick"],Xg={class:"worked-separator-text"},Zg={key:0,class:"worked-details"},ev=["onClick"],tv={class:"cmd-label"},nv={class:"cmd-status"},rv={class:"cmd-output-inner"},sv={class:"cmd-output"},ov={key:1,class:"message-text-flow"},iv={key:0,class:"message-text"},av={key:0},lv={key:1,class:"message-bold-text"},cv=["href","title"],uv=["href","title"],dv={key:4,class:"message-inline-code"},fv={key:1,class:"message-text"},hv=["onClick"],pv=["src","alt","onError"],mv=["onClick"],gv={key:0,class:"conversation-item conversation-item-overlay"},vv={class:"message-row"},yv={class:"message-stack"},wv={class:"live-overlay-inline","aria-live":"polite"},bv={class:"live-overlay-label"},_v={key:1,class:"live-overlay-error"},kv=["src"],Tv=16,Sv=Mt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},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(p){return p.messageType==="commandExecution"&&!!p.commandExecution}function a(p){var T;return((T=p.commandExecution)==null?void 0:T.status)==="inProgress"||r.value.has(p.id)?!0:n.value.has(p.id)}function l(p){return r.value.has(p.id)}function d(p){var S;if(((S=p.commandExecution)==null?void 0:S.status)==="inProgress")return;const T=new Set(n.value);T.has(p.id)?T.delete(p.id):T.add(p.id),n.value=T}function u(p){const T=new Set(s.value);T.has(p.id)?T.delete(p.id):T.add(p.id),s.value=T}function f(p){return s.value.has(p.id)}function g(p){const T=p.commandExecution;if(!T)return"";switch(T.status){case"inProgress":return"⟳ Running";case"completed":return T.exitCode===0?"✓ Completed":`✗ Exit ${T.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(p){var S,L;const T=(S=p.commandExecution)==null?void 0:S.status;return T==="inProgress"?"cmd-status-running":T==="completed"&&((L=p.commandExecution)==null?void 0:L.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(p){const T=new Set(r.value);T.add(p),r.value=T,setTimeout(()=>{const S=new Set(r.value);S.delete(p),r.value=S},1e3)}function I(p,T){const S=[];for(let L=T-1;L>=0;L--){const oe=p[L];if(oe.messageType==="commandExecution")S.unshift(oe);else if(oe.role==="user"||oe.messageType==="worked")break}return S}const U=e,J=t,O=P(null),W=P(null),D=P(null),ce=P(""),fe=P({}),pe=P({});let Se=0,ie=0,te=0;const ye=new WeakSet,re=P(new Set);function Ue(p){if(!p||p.endsWith("/")||p.endsWith("\\"))return!1;if(p.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(p))return!1;const T=p.startsWith("/"),S=/^[A-Za-z]:[\\/]/u.test(p),L=p.startsWith("./")||p.startsWith("../")||p.startsWith("~/"),oe=p.includes("/")||p.includes("\\");return T||S||L||oe}function Fe(p){return p.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||p}function Ye(p){return p.replace(/\\/gu,"/")}function $e(p){if(!p.startsWith("file://"))return p;let T=p.replace(/^file:\/\//u,"");try{T=decodeURIComponent(T)}catch{}return/^\/[A-Za-z]:\//u.test(T)&&(T=T.slice(1)),T}function Te(p){const T=Ye(p),S=T.match(/^\/Users\/([^/]+)/u);if(S)return`/Users/${S[1]}`;const L=T.match(/^\/home\/([^/]+)/u);return L?`/home/${L[1]}`:""}function Oe(p){const T=Ye(p);if(!T)return T;let S="",L=T;const oe=L.match(/^([A-Za-z]:)(\/.*)?$/u);oe?(S=`${oe[1]}/`,L=(oe[2]??"").replace(/^\/+/u,"")):L.startsWith("/")&&(S="/",L=L.slice(1));const ae=L.split("/").filter(Boolean),Ee=[];for(const ze of ae)if(ze!=="."){if(ze===".."){Ee.length>0&&Ee.pop();continue}Ee.push(ze)}const be=Ee.join("/");return S?`${S}${be}`.replace(/\/+$/u,"")||S:be||T}function yt(p,T){const S=Ye($e(p.trim()));if(!S)return"";if(S.startsWith("/")||/^[A-Za-z]:\//u.test(S))return Oe(S);if(S.startsWith("~/")){const ae=Te(T);if(ae)return Oe(`${ae}/${S.slice(2)}`)}const oe=Ye(T.trim());return Oe(oe?`${oe.replace(/\/+$/u,"")}/${S}`:S)}function et(p){if(!p)return null;let T=p.trim();T=nt(T).core.trim();let L=null;const oe=T.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(oe)T=oe[1],L=Number(oe[2]);else{const ae=T.match(/^(.*):(\d+)(?::\d+)?$/u);ae&&(T=ae[1],L=Number(ae[2]))}return T=$e(T),Ue(T)?{path:T,line:L}:null}function nt(p){let T=p,S="",L="";for(;/^[('"`[{<“‘]/u.test(T);)S+=T[0],T=T.slice(1);for(;/[)"'`\]}>”’]$/u.test(T);)L=T.slice(-1)+L,T=T.slice(0,-1);return{core:T,leading:S,trailing:L}}function ot(p){const T=p.trim(),S=rt(T,0);if(!S||S.end!==T.length)return null;const L=S.label.trim(),oe=S.target.trim(),ae=nt(L).core.trim()||L,Ee=nt(oe).core.trim();return Ee?{label:ae,target:Ee}:null}function rt(p,T){if(p[T]!=="[")return null;const S=p.indexOf("](",T+1);if(S<0)return null;const L=p.slice(T+1,S);if(!L||L.includes(`
|
|
26
|
+
`))return null;let oe=S+2,ae=1;for(;oe<p.length;){const Ee=p[oe];if(Ee===`
|
|
27
|
+
`)return null;if(Ee==="(")ae+=1;else if(Ee===")"&&(ae-=1,ae===0)){const be=p.slice(S+2,oe);return be.trim()?{label:L,target:be,end:oe+1}:null}oe+=1}return null}function me(p){const T=[],S=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let L=0;for(const oe of p.matchAll(S)){if(typeof oe.index!="number")continue;const ae=oe.index,Ee=ae+oe[0].length;ae>L&&T.push({kind:"text",value:p.slice(L,ae)});let be=oe[0],ze="";for(;/[.,;:]$/u.test(be);)ze=be.slice(-1)+ze,be=be.slice(0,-1);const it=nt(be);be=it.core;const wt=it.leading,Pt=it.trailing+ze;if(wt&&T.push({kind:"text",value:wt}),be.startsWith("**")&&be.endsWith("**")&&be.length>4)T.push({kind:"bold",value:be.slice(2,-2)}),Pt&&T.push({kind:"text",value:Pt});else if(/^https?:\/\//u.test(be))T.push({kind:"url",value:be,href:be}),Pt&&T.push({kind:"text",value:Pt});else{const Ct=et(be);Ct?(T.push({kind:"file",value:be,path:Ct.path,displayPath:be,downloadName:Fe(Ct.path)}),Pt&&T.push({kind:"text",value:Pt})):T.push({kind:"text",value:oe[0]})}L=Ee}return L<p.length&&T.push({kind:"text",value:p.slice(L)}),Ie(T)}function Ie(p){const T=[];let S=!1,L="";const oe=ae=>{ae&&T.push({kind:"text",value:ae})};for(const ae of p){if(ae.kind!=="text"){S&&(oe(`**${L}`),S=!1,L=""),T.push(ae);continue}let Ee=ae.value;for(;Ee.length>0;){const be=Ee.indexOf("**");if(be<0){S?L+=Ee:oe(Ee);break}const ze=Ee.slice(0,be);S?L+=ze:oe(ze),Ee=Ee.slice(be+2),S?(L.length>0?T.push({kind:"bold",value:L}):oe("****"),L="",S=!1):S=!0}}return S&&oe(`**${L}`),T}function xe(p){const T=[];let S=0;for(;S<p.length;){const L=p.indexOf("[",S);if(L<0)break;const oe=rt(p,L);if(!oe){S=L+1;continue}L>S&&T.push(...me(p.slice(S,L)));const ae=nt(oe.label.trim()).core.trim()||oe.label.trim(),Ee=nt(oe.target.trim()).core.trim();if(/^https?:\/\//u.test(Ee))T.push({kind:"url",value:ae||Ee,href:Ee});else{const be=et(Ee);be?T.push({kind:"file",value:Ee,path:be.path,displayPath:ae||Ee,downloadName:Fe(be.path)}):T.push({kind:"text",value:p.slice(L,oe.end)})}S=oe.end}return S<p.length&&T.push(...me(p.slice(S))),T}function R(p){if(!p.includes("`"))return xe(p);const T=[];let S=0,L=0;for(;S<p.length;){if(p[S]!=="`"){S+=1;continue}let oe=1;for(;S+oe<p.length&&p[S+oe]==="`";)oe+=1;const ae="`".repeat(oe);let Ee=S+oe,be=-1;for(;Ee<p.length;){const it=p.indexOf(ae,Ee);if(it<0)break;const wt=it>0&&p[it-1]==="`",Pt=it+oe<p.length&&p[it+oe]==="`",Ct=p.slice(S+oe,it).includes(`
|
|
28
|
+
`);if(!wt&&!Pt&&!Ct){be=it;break}Ee=it+1}if(be<0){S+=oe;continue}S>L&&T.push(...xe(p.slice(L,S)));const ze=p.slice(S+oe,be);if(ze.length>0){const it=ot(ze);if(it)if(/^https?:\/\//u.test(it.target))T.push({kind:"url",value:it.label||it.target,href:it.target});else{const wt=et(it.target);wt?T.push({kind:"file",value:it.target,path:wt.path,displayPath:it.label||it.target,downloadName:Fe(wt.path)}):T.push({kind:"code",value:ze})}else{const wt=et(ze);if(wt){const Pt=wt.line?`${wt.path}:${String(wt.line)}`:wt.path;T.push({kind:"file",value:ze,path:wt.path,displayPath:Pt,downloadName:Fe(wt.path)})}else T.push({kind:"code",value:ze})}}else T.push({kind:"text",value:`${ae}${ae}`});S=be+oe,L=S}return L<p.length&&T.push(...xe(p.slice(L))),T}function Z(p){const T=p.trim();if(!T)return"";if(T.startsWith("data:")||T.startsWith("blob:")||T.startsWith("http://")||T.startsWith("https://")||T.startsWith("/codex-local-image?"))return T;if(T.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(T)}`;const S=T.startsWith("/"),L=/^[A-Za-z]:[\\/]/u.test(T);return S||L?`/codex-local-image?path=${encodeURIComponent(T)}`:T}function X(p){const T=p.trim();if(!T)return"#";const S=Ee=>Ee.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ee),L=et(T),oe=(L==null?void 0:L.path)??T,ae=yt(oe,U.cwd);if(S(ae)){const Ee=ae.startsWith("/")?ae:`/${ae}`;return`/codex-local-browse${encodeURI(Ee)}`}return"#"}function ge(p){if(!p.includes(")return[{kind:"text",value:p}];const T=[],S=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let L=0;for(const oe of p.matchAll(S)){const[ae,Ee,be]=oe;if(typeof oe.index!="number")continue;const ze=oe.index,it=ze+ae.length,wt=Z(be.trim());wt&&(ze>L&&T.push({kind:"text",value:p.slice(L,ze)}),T.push({kind:"image",url:wt,alt:Ee.trim(),markdown:ae}),L=it)}return L<p.length&&T.push({kind:"text",value:p.slice(L)}),T.length>0?T:[{kind:"text",value:p}]}function Ne(p){return p!==null&&typeof p=="object"&&!Array.isArray(p)?p:null}function v(p){const T=new Date(p);return Number.isNaN(T.getTime())?p:T.toLocaleTimeString()}function w(p){const T=Ne(p.params),S=T==null?void 0:T.reason;return typeof S=="string"?S.trim():""}function E(p,T){return`${String(p)}:${T}`}function B(p){const T=Ne(p.params),S=Array.isArray(T==null?void 0:T.questions)?T.questions:[],L=[];for(const oe of S){const ae=Ne(oe);if(!ae)continue;const Ee=typeof ae.id=="string"?ae.id:"";if(!Ee)continue;const be=Array.isArray(ae.options)?ae.options.map(ze=>Ne(ze)).map(ze=>ze==null?void 0:ze.label).filter(ze=>typeof ze=="string"&&ze.length>0):[];L.push({id:Ee,header:typeof ae.header=="string"?ae.header:"",question:typeof ae.question=="string"?ae.question:"",isOther:ae.isOther===!0,options:be})}return L}function F(p,T,S){const L=E(p,T),oe=fe.value[L];return typeof oe=="string"&&oe.length>0?oe:S}function j(p,T){const S=E(p,T);return pe.value[S]??""}function ee(p,T,S){const L=S.target;if(!(L instanceof HTMLSelectElement))return;const oe=E(p,T);fe.value={...fe.value,[oe]:L.value}}function se(p,T,S){const L=S.target;if(!(L instanceof HTMLInputElement))return;const oe=E(p,T);pe.value={...pe.value,[oe]:L.value}}function Y(p,T){J("respondServerRequest",{id:p,result:{decision:T}})}function K(p){const T=B(p),S={};for(const L of T){const oe=F(p.id,L.id,L.options[0]||""),ae=j(p.id,L.id).trim(),Ee=[oe,ae].map(be=>be.trim()).filter(be=>be.length>0);S[L.id]={answers:Ee}}J("respondServerRequest",{id:p.id,result:{answers:S}})}function we(p){J("respondServerRequest",{id:p,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function le(p){J("respondServerRequest",{id:p,result:{success:!0,contentItems:[]}})}function _e(p){J("respondServerRequest",{id:p,result:{}})}function Ce(p){J("respondServerRequest",{id:p,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function je(p){return!(p.role!=="user"&&p.role!=="assistant"||typeof p.turnIndex!="number"||U.isTurnInProgress||U.isRollingBack)}function Ge(p){je(p)&&J("rollback",{turnIndex:p.turnIndex})}function Re(){const p=O.value,T=W.value;!p||!T||(p.scrollTop=p.scrollHeight,T.scrollIntoView({block:"end"}))}function pt(p){return p.scrollHeight-(p.scrollTop+p.clientHeight)<=Tv}function Xe(p){if(!U.activeThreadId)return;const T=Math.max(p.scrollHeight-p.clientHeight,0),S=T>0?Math.min(Math.max(p.scrollTop/T,0),1):1;J("updateScrollState",{threadId:U.activeThreadId,state:{scrollTop:p.scrollTop,isAtBottom:pt(p),scrollRatio:S}})}function H(){const p=O.value;if(!p)return;const T=U.scrollState;if(!T||T.isAtBottom){V();return}const S=Math.max(p.scrollHeight-p.clientHeight,0),L=typeof T.scrollRatio=="number"?T.scrollRatio*S:T.scrollTop;p.scrollTop=Math.min(Math.max(L,0),S),Xe(p)}function V(){const p=O.value;p&&(Re(),Xe(p))}function Q(){const p=U.scrollState;return!p||p.isAtBottom===!0}function Je(){if(!Q()){te=0,ie=0;return}if(V(),te-=1,te<=0){ie=0;return}ie=requestAnimationFrame(Je)}function qe(p=6){Q()&&(ie&&(cancelAnimationFrame(ie),ie=0),te=Math.max(p,1),ie=requestAnimationFrame(Je))}function Qe(){qe(3)}function jt(){if(!Q())return;const p=O.value;if(!p)return;const T=p.querySelectorAll("img.message-image-preview");for(const S of T)S.complete||ye.has(S)||(ye.add(S),S.addEventListener("load",Qe,{once:!0}),S.addEventListener("error",Qe,{once:!0}))}async function Yt(){await tn(),Se&&cancelAnimationFrame(Se),Se=requestAnimationFrame(()=>{Se=0,H(),jt(),qe()})}ft(()=>U.messages,async p=>{if(!U.isLoading){for(const T of p){if(T.messageType!=="commandExecution"||!T.commandExecution)continue;const S=o.value[T.id],L=T.commandExecution.status;S==="inProgress"&&L!=="inProgress"&&N(T.id),o.value[T.id]=L}await Yt()}}),ft(()=>U.liveOverlay,async p=>{p&&(await tn(),V(),qe(8))},{deep:!0}),ft(()=>U.isLoading,async p=>{p||await Yt()}),ft(()=>U.activeThreadId,()=>{ce.value="",re.value=new Set},{flush:"post"});function nn(){const p=O.value;!p||U.isLoading||Xe(p)}function xt(p){ce.value=Z(p)}function Jt(p,T){return`${p}:${String(T)}`}function mn(p,T){const S=new Set(re.value);S.add(Jt(p,T)),re.value=S}function xn(p,T){return re.value.has(Jt(p,T))}function ln(){ce.value=""}function He(){const p=D.value;p&&(p.scrollTop=p.scrollHeight)}return ft(()=>{var p;return(p=U.liveOverlay)==null?void 0:p.reasoningText},async p=>{p&&(await tn(),He())}),Kn(()=>{Se&&cancelAnimationFrame(Se),ie&&cancelAnimationFrame(ie)}),(p,T)=>(b(),C("section",tg,[e.isLoading?(b(),C("p",ng,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(b(),C("p",rg," No messages in this thread yet. ")):(b(),C("ul",{key:2,ref_key:"conversationListRef",ref:O,class:"conversation-list",onScroll:nn},[(b(!0),C(Ve,null,_t(e.pendingRequests,S=>(b(),C("li",{key:`server-request:${S.id}`,class:"conversation-item conversation-item-request"},[m("div",sg,[m("div",og,[m("article",ig,[m("p",ag,he(S.method),1),m("p",lg,"Request #"+he(S.id)+" · "+he(v(S.receivedAtIso)),1),w(S)?(b(),C("p",cg,he(w(S)),1)):ue("",!0),S.method==="item/commandExecution/requestApproval"?(b(),C("section",ug,[m("button",{type:"button",class:"request-button request-button-primary",onClick:L=>Y(S.id,"accept")},"Accept",8,dg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"acceptForSession")},"Accept for Session",8,fg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"decline")},"Decline",8,hg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"cancel")},"Cancel",8,pg)])):S.method==="item/fileChange/requestApproval"?(b(),C("section",mg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:L=>Y(S.id,"accept")},"Accept",8,gg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"acceptForSession")},"Accept for Session",8,vg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"decline")},"Decline",8,yg),m("button",{type:"button",class:"request-button",onClick:L=>Y(S.id,"cancel")},"Cancel",8,wg)])):S.method==="item/tool/requestUserInput"?(b(),C("section",bg,[(b(!0),C(Ve,null,_t(B(S),L=>(b(),C("div",{key:`${S.id}:${L.id}`,class:"request-question"},[m("p",_g,he(L.header||L.question),1),L.header&&L.question?(b(),C("p",kg,he(L.question),1)):ue("",!0),m("select",{class:"request-select",value:F(S.id,L.id,L.options[0]||""),onChange:oe=>ee(S.id,L.id,oe)},[(b(!0),C(Ve,null,_t(L.options,oe=>(b(),C("option",{key:`${S.id}:${L.id}:${oe}`,value:oe},he(oe),9,Sg))),128))],40,Tg),L.isOther?(b(),C("input",{key:1,class:"request-input",type:"text",value:j(S.id,L.id),placeholder:"Other answer",onInput:oe=>se(S.id,L.id,oe)},null,40,xg)):ue("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:L=>K(S)}," Submit Answers ",8,Cg)])):S.method==="item/tool/call"?(b(),C("section",Eg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:L=>we(S.id)},"Fail Tool Call",8,Ag),m("button",{type:"button",class:"request-button",onClick:L=>le(S.id)},"Success (Empty)",8,Ig)])):(b(),C("section",Rg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:L=>_e(S.id)},"Return Empty Result",8,$g),m("button",{type:"button",class:"request-button",onClick:L=>Ce(S.id)},"Reject Request",8,Mg)]))])])])]))),128)),(b(!0),C(Ve,null,_t(e.messages,S=>{var L,oe;return b(),C("li",{key:S.id,class:ht(["conversation-item",{"conversation-item-rollbackable":je(S)}]),"data-role":S.role,"data-message-type":S.messageType||""},[i(S)?(b(),C("div",Og,[m("div",Ng,[m("button",{type:"button",class:ht(["cmd-row",[_(S),{"cmd-expanded":a(S)}]]),onClick:ae=>d(S)},[m("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a(S)}])},"▶",2),m("code",Dg,he(((L=S.commandExecution)==null?void 0:L.command)||"(command)"),1),m("span",Lg,he(g(S)),1)],10,jg),m("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a(S),"cmd-output-collapsing":l(S)}])},[m("div",Bg,[m("pre",Fg,he(((oe=S.commandExecution)==null?void 0:oe.aggregatedOutput)||"(no output)"),1)])],2)])])):(b(),C("div",{key:1,class:"message-row","data-role":S.role,"data-message-type":S.messageType||""},[m("div",{class:"message-stack","data-role":S.role},[m("article",{class:"message-body","data-role":S.role},[S.images&&S.images.length>0?(b(),C("ul",{key:0,class:"message-image-list","data-role":S.role},[(b(!0),C(Ve,null,_t(S.images,ae=>(b(),C("li",{key:ae,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ee=>xt(ae)},[m("img",{class:"message-image-preview",src:Z(ae),alt:"Message image preview",loading:"lazy"},null,8,Kg)],8,qg)]))),128))],8,Wg)):ue("",!0),S.fileAttachments&&S.fileAttachments.length>0?(b(),C("div",Gg,[(b(!0),C(Ve,null,_t(S.fileAttachments,ae=>(b(),C("span",{key:ae.path,class:"message-file-chip"},[T[1]||(T[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:X(ae.path),target:"_blank",rel:"noopener noreferrer",title:ae.path},he(ae.path),9,zg)]))),128))])):ue("",!0),S.text.length>0?(b(),C("article",{key:2,class:"message-card","data-role":S.role},[S.messageType==="worked"?(b(),C("div",Jg,[m("button",{type:"button",class:"worked-separator",onClick:ae=>u(S)},[T[2]||(T[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:ht(["worked-chevron",{"worked-chevron-open":f(S)}])},"▶",2),m("p",Xg,he(S.text),1),T[3]||(T[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Qg),f(S)?(b(),C("div",Zg,[(b(!0),C(Ve,null,_t(I(e.messages,e.messages.indexOf(S)),ae=>{var Ee,be;return b(),C("div",{key:`worked-cmd-${ae.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:ht(["cmd-row",[_(ae),{"cmd-expanded":a(ae)}]]),onClick:ze=>d(ae)},[m("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a(ae)}])},"▶",2),m("code",tv,he(((Ee=ae.commandExecution)==null?void 0:Ee.command)||"(command)"),1),m("span",nv,he(g(ae)),1)],10,ev),m("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a(ae),"cmd-output-collapsing":l(ae)}])},[m("div",rv,[m("pre",sv,he(((be=ae.commandExecution)==null?void 0:be.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ue("",!0)])):(b(),C("div",ov,[(b(!0),C(Ve,null,_t(ge(S.text),(ae,Ee)=>(b(),C(Ve,{key:`block-${Ee}`},[ae.kind==="text"?(b(),C("p",iv,[(b(!0),C(Ve,null,_t(R(ae.value),(be,ze)=>(b(),C(Ve,{key:`seg-${Ee}-${ze}`},[be.kind==="text"?(b(),C("span",av,he(be.value),1)):be.kind==="bold"?(b(),C("strong",lv,he(be.value),1)):be.kind==="file"?(b(),C("a",{key:2,class:"message-file-link",href:X(be.path),target:"_blank",rel:"noopener noreferrer",title:be.path},he(be.displayPath),9,cv)):be.kind==="url"?(b(),C("a",{key:3,class:"message-file-link",href:be.href,target:"_blank",rel:"noopener noreferrer",title:be.href},he(be.value),9,uv)):(b(),C("code",dv,he(be.value),1))],64))),128))])):xn(S.id,Ee)?(b(),C("p",fv,he(ae.markdown),1)):(b(),C("button",{key:2,class:"message-image-button",type:"button",onClick:be=>xt(ae.url)},[m("img",{class:"message-image-preview message-markdown-image",src:ae.url,alt:ae.alt||"Embedded message image",loading:"lazy",onError:be=>mn(S.id,Ee)},null,40,pv)],8,hv))],64))),128))]))],8,Yg)):ue("",!0)],8,Vg),je(S)?(b(),C("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:ae=>Ge(S)},[Ae(eg,{class:"rollback-icon"}),T[4]||(T[4]=m("span",{class:"rollback-label"},"Rollback",-1))],8,mv)):ue("",!0)],8,Ug)],8,Hg))],10,Pg)}),128)),e.liveOverlay?(b(),C("li",gv,[m("div",vv,[m("div",yv,[m("article",wv,[m("p",bv,he(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(b(),C("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:D},he(e.liveOverlay.reasoningText),513)):ue("",!0),e.liveOverlay.errorText?(b(),C("p",_v,he(e.liveOverlay.errorText),1)):ue("",!0)])])])])):ue("",!0),m("li",{ref_key:"bottomAnchorRef",ref:W,class:"conversation-bottom-anchor"},null,512)],544)),ce.value.length>0?(b(),C("div",{key:3,class:"image-modal-backdrop",onClick:ln},[m("div",{class:"image-modal-content",onClick:T[0]||(T[0]=Ze(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:ln},[Ae(Ri,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ce.value,alt:"Expanded message image"},null,8,kv)])])):ue("",!0)]))}}),xv=tt(Sv,[["__scopeId","data-v-3c1b4130"]]);function Cv(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 N;const g=o,_=(r==null?void 0:r.mimeType)||((N=g[0])==null?void 0:N.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 N;if(f.length===0)return;const _=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",U=`----codex-transcribe-${crypto.randomUUID()}`,J=new Uint8Array(await _.arrayBuffer()),O=new TextEncoder,W=[];W.push(O.encode(`--${U}\r
|
|
29
|
+
`)),W.push(O.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
|
|
30
|
+
`)),W.push(O.encode(`Content-Type: ${g}\r
|
|
31
|
+
\r
|
|
32
|
+
`)),W.push(J),W.push(O.encode(`\r
|
|
33
|
+
--${U}--\r
|
|
34
|
+
`));let D=0;for(const te of W)D+=te.byteLength;const ce=new Uint8Array(D);let fe=0;for(const te of W)ce.set(te,fe),fe+=te.byteLength;const pe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${U}`},body:ce});if(!pe.ok)throw new Error(`Transcription failed: ${pe.status}`);const ie=((await pe.json()).text??"").trim();ie.length>0&&e.onTranscript(ie)}catch(I){(N=e.onError)==null||N.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 Kn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Xa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Ln extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function $i(e,t){const n=Xa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Xa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Ur(e,t,n){return e instanceof Ln?e:e instanceof Error?new Ln(e.message||t,{code:"unknown_error",method:n}):new Ln(t,{code:"unknown_error",method:n})}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Ev(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 Ln(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 Ln($i(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 Ln(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Za(e){const t=Gc(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 Av(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=Za(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=Za(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 Iv(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 Ln(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 Ln($i(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Rv(){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 Ln($i(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Gc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function el(e){return new Date(e*1e3).toISOString()}function $v(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Mv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Pv=/^##\s+(.+?):\s+(.+?)\s*$/,Ov=/^#\s*files mentioned by the user\s*:?\s*$/i;function Nv(e){var s,o;const t=e.split(`
|
|
35
|
+
`).findIndex(i=>Ov.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
36
|
+
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Pv);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 jv(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 Dv(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:Mv(l),isUnhandled:!0});const o=n.join(`
|
|
37
|
+
`),i=Nv(o);return{text:jv(o),images:r,fileAttachments:i,rawBlocks:s}}function Lv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Dv(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=Bv(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 Bv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Fv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Hv(e){const t=Fv(e);return t.length>0?t:"Untitled thread"}function zc(e){return(e==null?void 0:e.status)==="inProgress"}function Uv(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 zc(r)}function Vv(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:Hv(e),projectName:$v(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:el(e.createdAt),updatedAtIso:el(e.updatedAt),preview:e.preview,unread:!1,inProgress:Uv(e)}}function Wv(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 qv(e){const t=e.data.map(Vv);return Wv(t)}function Yc(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 Lv(i))n.push({...a,turnIndex:r})}return n}function Kv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return zc(t.at(-1))}async function Zt(e,t){try{return await Ev(e,t)}catch(n){throw Ur(n,`RPC ${e} failed`,e)}}function Gv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function zv(){const e=await Zt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return qv(e)}async function Yv(e){const t=await Zt("thread/read",{threadId:e,includeTurns:!0});return{messages:Yc(t),inProgress:Kv(t)}}async function Jv(){try{return await zv()}catch(e){throw Ur(e,"Failed to load thread groups","thread/list")}}async function Qv(e){try{return await Yv(e)}catch(t){throw Ur(t,`Failed to load thread ${e}`,"thread/read")}}function Xv(e){return Av(e)}async function Zv(e,t){await Iv({id:e,...t})}async function ey(){return Rv()}async function Io(e){await Zt("thread/resume",{threadId:e})}async function ty(e){await Zt("thread/archive",{threadId:e})}async function ny(e,t){await Zt("thread/name/set",{threadId:e,name:t})}async function tl(e,t){const n=await Zt("thread/rollback",{threadId:e,numTurns:t});return Yc(n)}function ry(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 nl(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 Zt("thread/start",n),s=ry(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Ur(n,"Failed to start a new thread","thread/start")}}function sy(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
38
|
+
`;for(const r of t)n+=`
|
|
39
|
+
## ${r.label}: ${r.path}
|
|
40
|
+
`;return`${n}
|
|
41
|
+
## My request for Codex:
|
|
42
|
+
|
|
43
|
+
${e}
|
|
44
|
+
`}async function Ro(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:sy(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 Zt("turn/start",u)}catch(a){throw Ur(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function oy(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 Zt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Ur(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function iy(e){await Zt("setDefaultModel",{model:e})}async function ay(){const e=await Zt("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 ly(){const e=await Zt("config/read",{}),t=e.config.model??"",n=Gv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function cy(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 ni(){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 cy(n.data)}async function uy(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 rl(){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 dy(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 fy(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=Mi(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 hy(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=Mi(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 py(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=Mi(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}async function my(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function Mi(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 gy(){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 $o(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 vy(e,t){var n;try{return((n=(await Zt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function yy(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Zt("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 wy(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 by={},_y={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ky(e,t){return b(),C("svg",_y,[...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 Ty=tt(by,[["render",ky]]),Sy={},xy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cy(e,t){return b(),C("svg",xy,[...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 Ey=tt(Sy,[["render",Cy]]),Ay={},Iy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ry(e,t){return b(),C("svg",Iy,[...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 $y=tt(Ay,[["render",Ry]]),My=["disabled"],Py={class:"composer-dropdown-value"},Oy={class:"composer-dropdown-menu"},Ny={key:0,class:"composer-dropdown-search-wrap"},jy=["placeholder","onKeydown"],Dy={class:"composer-dropdown-options",role:"listbox"},Ly=["onClick"],By={key:0,class:"composer-dropdown-empty"},Fy={key:1,class:"composer-dropdown-add-wrap"},Hy=["placeholder","onKeydown"],Uy=Mt({__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=de(()=>{var ye;const te=n.options.find(re=>re.value===n.modelValue);return te?te.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),g=de(()=>n.openDirection??"down"),_=de(()=>n.enableSearch===!0),N=de(()=>n.showAddAction===!0),I=de(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),U=de(()=>{var te;return((te=n.addActionLabel)==null?void 0:te.trim())||"Add new project"}),J=de(()=>{var te;return((te=n.addPlaceholder)==null?void 0:te.trim())||"Project name or absolute path"}),O=de(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(ye=>ye.label.toLowerCase().includes(te)||ye.value.toLowerCase().includes(te)):n.options});function W(){n.disabled||(a.value=!a.value)}function D(te){r("update:modelValue",te),a.value=!1,l.value=""}function ce(){var te;d.value=!0,u.value=((te=n.defaultAddValue)==null?void 0:te.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function fe(){if(l.value.length>0){l.value="";return}a.value=!1}function pe(){const te=u.value.trim();te&&(r("add",te),d.value=!1,u.value="",a.value=!1,l.value="")}function Se(){d.value=!1,u.value="",a.value=!1,l.value=""}function ie(te){if(!a.value)return;const ye=s.value;if(!ye)return;const re=te.target;re instanceof Node&&(ye.contains(re)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ft(a,te=>{if(!te){d.value=!1,u.value="";return}_.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),qn(()=>{window.addEventListener("pointerdown",ie)}),Kn(()=>{window.removeEventListener("pointerdown",ie)}),(te,ye)=>(b(),C("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:W},[m("span",Py,he(f.value),1),Ae(lo,{class:"composer-dropdown-chevron"})],8,My),a.value?(b(),C("div",{key:0,class:ht(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[m("div",Oy,[_.value?(b(),C("div",Ny,[Un(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=re=>l.value=re),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Gt(Ze(fe,["prevent"]),["esc"])},null,40,jy),[[Vn,l.value]])])):ue("",!0),m("ul",Dy,[(b(!0),C(Ve,null,_t(O.value,re=>(b(),C("li",{key:re.value},[m("button",{class:ht(["composer-dropdown-option",{"is-selected":re.value===e.modelValue}]),type:"button",onClick:Ue=>D(re.value)},he(re.label),11,Ly)]))),128)),O.value.length===0?(b(),C("li",By," No matching projects ")):ue("",!0)]),N.value?(b(),C("div",Fy,[d.value?(b(),C(Ve,{key:0},[Un(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=re=>u.value=re),class:"composer-dropdown-add-input",type:"text",placeholder:J.value,onKeydown:[Gt(Ze(pe,["prevent"]),["enter"]),Gt(Ze(Se,["prevent"]),["esc"])]},null,40,Hy),[[Vn,u.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:pe},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Se},"Cancel")])],64)):(b(),C("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ce},he(U.value),1))])):ue("",!0)])],2)):ue("",!0)],512))}}),ri=tt(Uy,[["__scopeId","data-v-7cfa2012"]]),Vy=["disabled"],Wy={class:"search-dropdown-value"},qy={class:"search-dropdown-search-wrap"},Ky=["placeholder","onKeydown"],Gy={key:0,class:"search-dropdown-list",role:"listbox"},zy=["onClick","onPointerenter"],Yy={class:"search-dropdown-option-check"},Jy={class:"search-dropdown-option-label"},Qy={key:0,class:"search-dropdown-option-desc"},Xy={key:1,class:"search-dropdown-empty"},Zy=Mt({__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=de(()=>n.openDirection??"down"),u=de(()=>new Set(n.selectedValues)),f=de(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const O=n.options.find(W=>W.value===n.selectedValues[0]);return(O==null?void 0:O.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=de(()=>{const O=a.value.toLowerCase().trim();return O?n.options.filter(W=>{var D;return W.label.toLowerCase().includes(O)||(((D=W.description)==null?void 0:D.toLowerCase().includes(O))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var O;return(O=o.value)==null?void 0:O.focus()})))}function N(O){r("toggle",O.value,!u.value.has(O.value))}function I(O){g.value.length!==0&&(l.value=(l.value+O+g.value.length)%g.value.length)}function U(){const O=g.value[l.value];O&&N(O)}function J(O){if(!i.value)return;const W=s.value;if(!W)return;const D=O.target;D instanceof Node&&(W.contains(D)||(i.value=!1))}return ft(a,()=>{l.value=0}),qn(()=>window.addEventListener("pointerdown",J)),Kn(()=>window.removeEventListener("pointerdown",J)),(O,W)=>(b(),C("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",Wy,he(f.value),1),Ae(lo,{class:"search-dropdown-chevron"})],8,Vy),i.value?(b(),C("div",{key:0,class:ht(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[m("div",qy,[Un(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":W[0]||(W[0]=D=>a.value=D),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[W[1]||(W[1]=Gt(Ze(D=>i.value=!1,["prevent"]),["escape"])),Gt(Ze(U,["prevent"]),["enter"]),W[2]||(W[2]=Gt(Ze(D=>I(1),["prevent"]),["arrow-down"])),W[3]||(W[3]=Gt(Ze(D=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Ky),[[Vn,a.value]])]),g.value.length>0?(b(),C("ul",Gy,[(b(!0),C(Ve,null,_t(g.value,(D,ce)=>(b(),C("li",{key:D.value},[m("button",{class:ht(["search-dropdown-option",{"is-selected":u.value.has(D.value),"is-highlighted":ce===l.value}]),type:"button",onClick:fe=>N(D),onPointerenter:fe=>l.value=ce},[m("span",Yy,he(u.value.has(D.value)?"✓":""),1),m("span",Jy,he(D.label),1),D.description?(b(),C("span",Qy,he(D.description),1)):ue("",!0)],42,zy)]))),128))])):(b(),C("div",Xy,"No results"))],2)):ue("",!0)],512))}}),ew=tt(Zy,[["__scopeId","data-v-a0f2edd4"]]),tw={class:"skill-picker-header"},nw=["onKeydown"],rw={key:0,class:"skill-picker-list",role:"listbox"},sw=["onClick","onPointerenter"],ow={class:"skill-picker-name"},iw={key:0,class:"skill-picker-desc"},aw={key:1,class:"skill-picker-empty"},lw=Mt({__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=de(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),d=de(()=>{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 ft(()=>n.visible,g=>{g&&(i.value="",a.value=0,tn(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),ft(i,()=>{a.value=0}),(g,_)=>e.visible?(b(),C("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Tr(d.value)},[m("div",tw,[Un(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Gt(Ze(N=>g.$emit("close"),["prevent"]),["escape"])),Gt(Ze(f,["prevent"]),["enter"]),_[2]||(_[2]=Gt(Ze(N=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Gt(Ze(N=>u(-1),["prevent"]),["arrow-up"]))]},null,40,nw),[[Vn,i.value]])]),l.value.length>0?(b(),C("ul",rw,[(b(!0),C(Ve,null,_t(l.value,(N,I)=>(b(),C("li",{key:N.path},[m("button",{class:ht(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:U=>g.$emit("select",N),onPointerenter:U=>a.value=I},[m("span",ow,he(N.name),1),N.description?(b(),C("span",iw,he(N.description),1)):ue("",!0)],42,sw)]))),128))])):(b(),C("div",aw,"No skills found"))],4)):ue("",!0)}}),cw=tt(lw,[["__scopeId","data-v-d6a08788"]]),uw={key:0,class:"thread-composer-attachments"},dw=["src","alt"],fw=["aria-label","disabled","onClick"],hw={key:1,class:"thread-composer-file-chips"},pw=["title"],mw=["aria-label","disabled","onClick"],gw={key:2,class:"thread-composer-skill-chips"},vw={class:"thread-composer-skill-chip-name"},yw=["aria-label","onClick"],ww={class:"thread-composer-input-wrap"},bw={key:0,class:"thread-composer-file-mentions"},_w=["onMousedown"],kw={key:1,class:"thread-composer-file-mention-icon-markdown"},Tw={class:"thread-composer-file-mention-text"},Sw={class:"thread-composer-file-mention-name"},xw={key:0,class:"thread-composer-file-mention-dir"},Cw={key:1,class:"thread-composer-file-mention-empty"},Ew=["placeholder","disabled"],Aw={class:"thread-composer-controls"},Iw=["disabled"],Rw={key:0,class:"thread-composer-attach-menu"},$w=["disabled"],Mw=["disabled"],Pw={class:"thread-composer-actions"},Ow=["aria-label","title","disabled"],Nw=["disabled"],jw=["aria-label","title","disabled"],Dw=["disabled"],Lw=["disabled"],Bw=Mt({__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}=Cv({onTranscript:H=>{s.value=s.value?`${s.value}
|
|
45
|
+
${H}`:H}}),g=P(null),_=P(null),N=P(null),I=P(null),U=P(!1),J=P(!1),O=P(null),W=P(""),D=P([]),ce=P(!1),fe=P(0);let pe=0,Se=null;const ie=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),te=[{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"}],ye=de(()=>n.models.map(H=>({value:H,label:H}))),re=de(()=>n.skills??[]),Ue=de(()=>i.value.map(H=>H.path)),Fe=de(()=>(n.skills??[]).map(H=>({value:H.path,label:H.name,description:H.description}))),Ye=de(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),$e=de(()=>n.disabled||!n.activeThreadId),Te=de(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Oe=de(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function yt(H="steer"){var Q;const V=s.value.trim();if(Ye.value){if(r("submit",{text:V,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:H}),s.value="",o.value=[],i.value=[],a.value=[],U.value=!1,J.value=!1,ee(),ie){(Q=I.value)==null||Q.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function et(){r("interrupt")}function nt(H){r("update:selected-model",H)}function ot(H){r("update:selected-reasoning-effort",H)}function rt(){$e.value||(U.value=!U.value)}function me(){var H;(H=_.value)==null||H.click()}function Ie(){var H;(H=N.value)==null||H.click()}function xe(H){o.value=o.value.filter(V=>V.id!==H)}function R(H){i.value=i.value.filter(V=>V.path!==H)}function Z(H){a.value=a.value.filter(V=>V.fsPath!==H)}function X(H){const V=H.replace(/\\/g,"/");if(a.value.some(qe=>qe.fsPath===V))return;const Q=V.split("/").filter(Boolean),Je=Q[Q.length-1]??V;a.value=[...a.value,{label:Je,path:V,fsPath:V}]}function ge(H){return H.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(H.name)}function Ne(H){if(!(!H||H.length===0))for(const V of Array.from(H))if(ge(V)){const Q=new FileReader;Q.onload=()=>{typeof Q.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:V.name,url:Q.result})},Q.readAsDataURL(V)}else wy(V).then(Q=>{Q&&X(Q)}).catch(()=>{})}function v(H){H&&(H.value="")}function w(H){const V=H.target;Ne((V==null?void 0:V.files)??null),v(V),U.value=!1}function E(H){const V=H.target;Ne((V==null?void 0:V.files)??null),v(V),U.value=!1}function B(){const V=s.value.startsWith("/");V!==J.value&&(J.value=V),se()}function F(H){if(ce.value){if(H.key==="Escape"){H.preventDefault(),ee();return}if(H.key==="ArrowDown"){H.preventDefault(),D.value.length>0&&(fe.value=(fe.value+1)%D.value.length);return}if(H.key==="ArrowUp"){if(H.preventDefault(),D.value.length>0){const Q=D.value.length;fe.value=(fe.value+Q-1)%Q}return}if(H.key==="Enter"||H.key==="Tab"){H.preventDefault();const Q=D.value[fe.value];Q?K(Q):ee();return}}if(n.sendWithEnter!==!1?H.key==="Enter"&&!H.shiftKey:H.key==="Enter"&&(H.metaKey||H.ctrlKey)){H.preventDefault(),yt(n.isTurnInProgress?Te.value:"steer");return}if(J.value){if(H.key==="Escape"){H.preventDefault(),j();return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();return}}}function j(){var H;J.value=!1,(H=I.value)==null||H.focus()}function ee(){ce.value=!1,O.value=null,W.value="",D.value=[],fe.value=0}function se(){const H=I.value;if(!H){ee();return}const V=H.selectionStart??s.value.length,Je=s.value.slice(0,V).match(/(^|\s)(@[^\s@]*)$/);if(!Je){ee();return}const qe=Je[2]??"",Qe=qe.length,jt=V-Qe;O.value=jt,W.value=qe.slice(1),ce.value=!0,Y()}async function Y(){if(!ce.value)return;const H=(n.cwd??"").trim();if(!H){D.value=[];return}Se&&clearTimeout(Se);const V=++pe;Se=setTimeout(async()=>{try{const Q=await py(H,W.value,20);if(!ce.value||V!==pe)return;D.value=Q,fe.value=0}catch{if(!ce.value||V!==pe)return;D.value=[]}},120)}function K(H){const V=I.value,Q=O.value;if(Q!==null&&V){const Je=V.selectionStart??s.value.length;s.value=`${s.value.slice(0,Q)}${s.value.slice(Je)}`.trimEnd()}X(H.path),ee(),tn(()=>V==null?void 0:V.focus())}function we(H){const V=H.lastIndexOf("/");return V<0?H:H.slice(V+1)}function le(H){const V=H.lastIndexOf("/");return V<=0?"":H.slice(0,V)}function _e(H){const V=we(H),Q=V.lastIndexOf(".");return Q<=0?"":V.slice(Q+1).toLowerCase()}function Ce(H){const V=_e(H);return V==="ts"?"TS":V==="tsx"?"TSX":V==="js"?"JS":V==="jsx"?"JSX":V==="json"?"{}":""}function je(H){const V=_e(H);return V.startsWith("ts")?"ts":V.startsWith("js")?"js":V==="json"?"json":"default"}function Ge(H){const V=_e(H);return V==="md"||V==="mdx"}function Re(H){var V;i.value.some(Q=>Q.path===H.path)||(i.value=[...i.value,H]),s.value=s.value.startsWith("/")?"":s.value,J.value=!1,(V=I.value)==null||V.focus()}function pt(H,V){if(V){const Q=(n.skills??[]).find(Je=>Je.path===H);Q&&!i.value.some(Je=>Je.path===H)&&(i.value=[...i.value,Q])}else i.value=i.value.filter(Q=>Q.path!==H)}function Xe(H){if(!U.value)return;const V=g.value;if(!V)return;const Q=H.target;!Q||V.contains(Q)||(U.value=!1)}return qn(()=>{document.addEventListener("click",Xe)}),Kn(()=>{document.removeEventListener("click",Xe),Se&&clearTimeout(Se)}),ft(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],U.value=!1,J.value=!1,ee()}),ft(()=>n.cwd,()=>{ce.value&&Y()}),(H,V)=>(b(),C("form",{class:"thread-composer",onSubmit:V[7]||(V[7]=Ze(Q=>yt("steer"),["prevent"]))},[m("div",{class:ht(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(b(),C("div",uw,[(b(!0),C(Ve,null,_t(o.value,Q=>(b(),C("div",{key:Q.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:Q.url,alt:Q.name||"Selected image"},null,8,dw),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${Q.name||"image"}`,disabled:$e.value,onClick:Je=>xe(Q.id)}," x ",8,fw)]))),128))])):ue("",!0),a.value.length>0?(b(),C("div",hw,[(b(!0),C(Ve,null,_t(a.value,Q=>(b(),C("span",{key:Q.fsPath,class:"thread-composer-file-chip"},[Ae(qs,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:Q.fsPath},he(Q.label),9,pw),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${Q.label}`,disabled:$e.value,onClick:Je=>Z(Q.fsPath)},"×",8,mw)]))),128))])):ue("",!0),i.value.length>0?(b(),C("div",gw,[(b(!0),C(Ve,null,_t(i.value,Q=>(b(),C("span",{key:Q.path,class:"thread-composer-skill-chip"},[m("span",vw,he(Q.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${Q.name}`,onClick:Je=>R(Q.path)},"×",8,yw)]))),128))])):ue("",!0),m("div",ww,[ce.value?(b(),C("div",bw,[D.value.length>0?(b(!0),C(Ve,{key:0},_t(D.value,(Q,Je)=>(b(),C("button",{key:Q.path,class:ht(["thread-composer-file-mention-row",{"is-active":Je===fe.value}]),type:"button",onMousedown:Ze(qe=>K(Q),["prevent"])},[Ce(Q.path)?(b(),C("span",{key:0,class:ht(["thread-composer-file-mention-icon-badge",`is-${je(Q.path)}`])},he(Ce(Q.path)),3)):Ge(Q.path)?(b(),C("span",kw,"↓")):(b(),mt(qs,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",Tw,[m("span",Sw,he(we(Q.path)),1),le(Q.path)?(b(),C("span",xw,he(le(Q.path)),1)):ue("",!0)])],42,_w))),128)):(b(),C("div",Cw,"No matching files"))])):ue("",!0),Un(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":V[0]||(V[0]=Q=>s.value=Q),class:"thread-composer-input",placeholder:Oe.value,disabled:$e.value,onInput:B,onKeydown:F},null,40,Ew),[[Vn,s.value]]),Ae(cw,{skills:re.value,visible:J.value,"anchor-bottom":44,"anchor-left":0,onSelect:Re,onClose:j},null,8,["skills","visible"])]),m("div",Aw,[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:$e.value,onClick:rt}," + ",8,Iw),U.value?(b(),C("div",Rw,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:$e.value,onClick:me}," Add photos & files ",8,$w),m("button",{class:"thread-composer-attach-item",type:"button",disabled:$e.value,onClick:Ie}," Take photo ",8,Mw)])):ue("",!0)],512),Ae(ri,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":nt},null,8,["model-value","options","disabled"]),Ae(ew,{class:"thread-composer-control",options:Fe.value,"selected-values":Ue.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:pt},null,8,["options","selected-values","disabled"]),Ae(ri,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:te,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":ot},null,8,["model-value","disabled"]),m("div",Pw,[De(d)&&!e.isTurnInProgress?(b(),C("button",{key:0,class:ht(["thread-composer-mic",{"thread-composer-mic--active":De(l)!=="idle"}]),type:"button","aria-label":De(l)==="recording"?"Stop dictation":"Hold to dictate",title:De(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:$e.value,onMousedown:V[1]||(V[1]=Ze((...Q)=>De(u)&&De(u)(...Q),["prevent"])),onMouseup:V[2]||(V[2]=(...Q)=>De(f)&&De(f)(...Q)),onMouseleave:V[3]||(V[3]=Q=>De(l)==="recording"&&De(f)()),onTouchstart:V[4]||(V[4]=Ze((...Q)=>De(u)&&De(u)(...Q),["prevent"])),onTouchend:V[5]||(V[5]=(...Q)=>De(f)&&De(f)(...Q))},[Ae(Ey,{class:"thread-composer-mic-icon"})],42,Ow)):ue("",!0),e.isTurnInProgress?(b(),C("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:et},[Ae($y,{class:"thread-composer-stop-icon"})],8,Nw)):ue("",!0),m("button",{class:ht(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Ye.value,onClick:V[6]||(V[6]=Q=>yt(e.isTurnInProgress?Te.value:"steer"))},[Ae(Ty,{class:"thread-composer-submit-icon"})],10,jw)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:$e.value,onChange:w},null,40,Dw),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:$e.value,onChange:E},null,40,Lw)],32))}}),sl=tt(Bw,[["__scopeId","data-v-983e7906"]]),Fw={key:0,class:"queued-messages"},Hw={class:"queued-messages-inner"},Uw={class:"queued-row-text"},Vw={class:"queued-row-actions"},Ww=["onClick"],qw=["onClick"],Kw=Mt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(b(),C("div",Fw,[m("div",Hw,[(b(!0),C(Ve,null,_t(e.messages,r=>(b(),C("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",Uw,he(r.text),1),m("div",Vw,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Ww),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,qw)])]))),128))])])):ue("",!0)}}),Gw=tt(Kw,[["__scopeId","data-v-ea583733"]]),zw={class:"runtime-dropdown-trigger-label"},Yw={key:0,class:"runtime-dropdown-menu-wrap"},Jw={class:"runtime-dropdown-menu"},Qw=["onClick"],Xw={class:"runtime-dropdown-option-label"},Zw={key:0,class:"runtime-dropdown-option-check"},eb=Mt({__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:Kc},{value:"worktree",label:"New worktree",icon:js}],a=de(()=>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 qn(()=>{window.addEventListener("pointerdown",d)}),Kn(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(b(),C("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)},[(b(),mt(qo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",zw,he(a.value.label),1),Ae(lo,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(b(),C("div",Yw,[m("div",Jw,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(b(),C(Ve,null,_t(i,g=>m("button",{key:g.value,class:ht(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:_=>l(g.value)},[(b(),mt(qo(g.icon),{class:"runtime-dropdown-option-icon"})),m("span",Xw,he(g.label),1),e.modelValue===g.value?(b(),C("span",Zw,"✓")):ue("",!0)],10,Qw)),64))])])):ue("",!0)],512))}}),tb=tt(eb,[["__scopeId","data-v-9c9b71e5"]]),nb={},rb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function sb(e,t){return b(),C("svg",rb,[...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 si=tt(nb,[["render",sb]]),ob={class:"skill-card-top"},ib=["src","alt"],ab={key:1,class:"skill-card-avatar-fallback"},lb={class:"skill-card-info"},cb={class:"skill-card-header"},ub={class:"skill-card-name"},db={key:0,class:"skill-card-badge-disabled"},fb={key:1,class:"skill-card-badge"},hb={class:"skill-card-owner"},pb={key:0,class:"skill-card-desc"},mb={key:1,class:"skill-card-date"},gb=Mt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=de(()=>{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)=>(b(),C("button",{class:ht(["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",ob,[e.skill.avatarUrl?(b(),C("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,ib)):(b(),C("div",ab,he(e.skill.owner.charAt(0)),1)),m("div",lb,[m("div",cb,[m("span",ub,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(b(),C("span",db,"Disabled")):e.skill.installed?(b(),C("span",fb,"Installed")):ue("",!0)]),m("span",hb,he(e.skill.owner),1)])]),e.skill.description?(b(),C("p",pb,he(e.skill.description),1)):ue("",!0),n.value?(b(),C("span",mb,he(n.value),1)):ue("",!0)],2))}}),ol=tt(gb,[["__scopeId","data-v-2a1e8196"]]),vb={class:"sdm-panel"},yb={class:"sdm-header"},wb={class:"sdm-title-area"},bb=["src","alt"],_b={class:"sdm-title-col"},kb={class:"sdm-title-row"},Tb={class:"sdm-title"},Sb={key:0,class:"sdm-badge-disabled"},xb={class:"sdm-owner"},Cb={class:"sdm-body"},Eb={key:0,class:"sdm-desc"},Ab={key:1,class:"sdm-readme-loading"},Ib=["innerHTML"],Rb=["href"],$b={class:"sdm-footer"},Mb={class:"sdm-footer-actions"},Pb=["disabled"],Ob=["disabled"],Nb=["disabled"],jb=Mt({__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=de(()=>s.value??n.skill.enabled??!0),l=de(()=>n.isInstalling===!0||n.isUninstalling===!0),d=de(()=>{const I=o.value;if(!I)return"";const U=I.replace(/^---[\s\S]*?---\s*/,"");return u(U)});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}),U=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!U.ok)return;const J=await U.json();o.value=J.content??""}catch{}finally{i.value=!1}}}ft(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,U)=>(b(),mt(Fs,{to:"body"},[e.visible?(b(),C("div",{key:0,class:"sdm-overlay",onClick:U[1]||(U[1]=Ze(J=>I.$emit("close"),["self"]))},[m("div",vb,[m("div",yb,[m("div",wb,[e.skill.avatarUrl?(b(),C("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,bb)):ue("",!0),m("div",_b,[m("div",kb,[m("h3",Tb,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(b(),C("span",Sb,"Disabled")):ue("",!0)]),m("span",xb,he(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:U[0]||(U[0]=J=>I.$emit("close"))},[Ae(Ri,{class:"sdm-close-icon"})])]),m("div",Cb,[e.skill.description?(b(),C("p",Eb,he(e.skill.description),1)):ue("",!0),i.value?(b(),C("div",Ab,"Loading skill contents...")):o.value?(b(),C("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Ib)):ue("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Rb)]),m("div",$b,[m("div",Mb,[e.skill.installed?(b(),C("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},he(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Pb)):(b(),C("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},he(n.isInstalling?"Installing...":"Install"),9,Ob)),e.skill.installed?(b(),C("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},he(a.value?"Disable":"Enable"),9,Nb)):ue("",!0)])])])])):ue("",!0)]))}}),Db=tt(jb,[["__scopeId","data-v-19a385ca"]]),Lb={class:"skills-hub"},Bb={class:"skills-hub-toolbar"},Fb={class:"skills-hub-search-wrap"},Hb={key:0,class:"skills-hub-count"},Ub={key:1,class:"skills-hub-section"},Vb={class:"skills-hub-section-title"},Wb={key:0,class:"skills-hub-grid"},qb={class:"skills-hub-section"},Kb={key:0,class:"skills-hub-loading"},Gb={key:1,class:"skills-hub-error"},zb={key:0,class:"skills-hub-grid"},Yb={key:1,class:"skills-hub-empty"},Es="codex-web-local.skills-hub.cache.v1",Jb=Mt({__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),N=P(null),I=P(""),U=P(!1),J=P(!1);let O=null,W=null;const D=t,ce=de(()=>o.value==="date"?"Newest":"A-Z"),fe=de(()=>{var me;return((me=N.value)==null?void 0:me.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),pe=de(()=>`${_.value.owner}/${_.value.name}`),Se=de(()=>U.value&&I.value===pe.value),ie=de(()=>J.value&&I.value===pe.value),te=de(()=>{const me=s.value.toLowerCase().trim();return me?a.value.filter(Ie=>Ie.name.toLowerCase().includes(me)||Ie.owner.toLowerCase().includes(me)||(Ie.displayName??"").toLowerCase().includes(me)):a.value});function ye(me,Ie="success"){N.value={text:me,type:Ie},W&&clearTimeout(W),W=setTimeout(()=>{N.value=null},3e3)}function re(){o.value=o.value==="date"?"name":"date",Oe(s.value)}function Ue(me){return`${o.value}::${me.trim().toLowerCase()}`}function Fe(me){var Ie;if(typeof window>"u")return null;try{const xe=window.localStorage.getItem(Es);return xe?((Ie=JSON.parse(xe).byKey)==null?void 0:Ie[me])??null:null}catch{return null}}function Ye(me,Ie){if(!(typeof window>"u"))try{const xe=window.localStorage.getItem(Es),Z=(xe?JSON.parse(xe):{}).byKey??{};Z[me]=Ie,window.localStorage.setItem(Es,JSON.stringify({byKey:Z}))}catch{}}function $e(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Es)}catch{}}function Te(me){const Ie=me.installed??[];a.value=Ie;const xe=new Set(Ie.map(R=>R.name));i.value=me.data.map(R=>{if(R.installed||xe.has(R.name)){const Z=Ie.find(X=>X.name===R.name);return{...R,installed:!0,path:(Z==null?void 0:Z.path)??R.path,enabled:(Z==null?void 0:Z.enabled)??R.enabled}}return R}).filter(R=>!R.installed),l.value=me.total}async function Oe(me){const Ie=Ue(me),xe=Fe(Ie);xe&&Te(xe),d.value=!xe,u.value="";try{const R=new URLSearchParams;me.trim()&&R.set("q",me.trim()),R.set("limit","100"),R.set("sort",o.value);const Z=await fetch(`/codex-api/skills-hub?${R}`);if(!Z.ok)throw new Error(`HTTP ${Z.status}`);const X=await Z.json();Te(X),Ye(Ie,X)}catch(R){u.value=R instanceof Error?R.message:"Failed to load skills"}finally{d.value=!1}}function yt(){O&&clearTimeout(O),O=setTimeout(()=>Oe(s.value),300)}function et(me){_.value=me,g.value=!0}async function nt(me){I.value=`${me.owner}/${me.name}`,U.value=!0;try{const xe=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:me.owner,name:me.name})})).json();if(!xe.ok)throw new Error(xe.error||"Install failed");const R={...me,installed:!0,path:xe.path,enabled:!0};a.value=[...a.value,R],i.value=i.value.filter(Z=>Z.name!==me.name),_.value=R,ye(`${me.displayName||me.name} skill installed`),g.value=!1,$e(),D("skills-changed")}catch(Ie){ye(Ie instanceof Error?Ie.message:"Failed to install skill","error")}finally{U.value=!1}}async function ot(me){I.value=`${me.owner}/${me.name}`,J.value=!0;try{const xe=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:me.name,path:me.path})})).json();if(!xe.ok)throw new Error(xe.error||"Uninstall failed");a.value=a.value.filter(R=>R.name!==me.name),me.owner!=="local"&&(i.value=[...i.value,{...me,installed:!1,path:void 0,enabled:void 0}]),ye(`${me.displayName||me.name} skill uninstalled`),g.value=!1,$e(),D("skills-changed")}catch(Ie){ye(Ie instanceof Error?Ie.message:"Failed to uninstall skill","error")}finally{J.value=!1}}async function rt(me,Ie){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:me.path,enabled:Ie}})})).ok)throw new Error("Failed to update skill");ye(`${me.displayName||me.name} skill ${Ie?"enabled":"disabled"}`),await Oe(s.value)}catch(xe){ye(xe instanceof Error?xe.message:"Failed to update skill","error")}}return qn(()=>{Oe("")}),(me,Ie)=>(b(),C("div",Lb,[Ie[3]||(Ie[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",Bb,[m("div",Fb,[Ae(si,{class:"skills-hub-search-icon"}),Un(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Ie[0]||(Ie[0]=xe=>s.value=xe),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:yt},null,544),[[Vn,s.value]]),l.value>0?(b(),C("span",Hb,he(l.value)+" skills",1)):ue("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:re},he(ce.value),1)]),N.value?(b(),C("div",{key:0,class:ht(["skills-hub-toast",fe.value])},he(N.value.text),3)):ue("",!0),te.value.length>0?(b(),C("div",Ub,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:Ie[1]||(Ie[1]=xe=>f.value=!f.value)},[m("span",Vb,"Installed ("+he(te.value.length)+")",1),Ae(qc,{class:ht(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(b(),C("div",Wb,[(b(!0),C(Ve,null,_t(te.value,xe=>(b(),mt(ol,{key:xe.name,skill:xe,onSelect:R=>et(R)},null,8,["skill","onSelect"]))),128))])):ue("",!0)])):ue("",!0),m("div",qb,[d.value?(b(),C("div",Kb,"Loading skills...")):u.value?(b(),C("div",Gb,he(u.value),1)):(b(),C(Ve,{key:2},[i.value.length>0?(b(),C("div",zb,[(b(!0),C(Ve,null,_t(i.value,xe=>(b(),mt(ol,{key:xe.url,skill:xe,onSelect:R=>et(R)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(b(),C("div",Yb,'No skills found for "'+he(s.value)+'"',1)):ue("",!0)],64))]),Ae(Db,{skill:_.value,visible:g.value,"is-installing":Se.value,"is-uninstalling":ie.value,onClose:Ie[2]||(Ie[2]=xe=>g.value=!1),onInstall:nt,onUninstall:ot,onToggleEnabled:rt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Qb=tt(Jb,[["__scopeId","data-v-1967b404"]]),Xb={},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 e0(e,t){return b(),C("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 t0=tt(Xb,[["render",e0]]),n0={},r0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function s0(e,t){return b(),C("svg",r0,[...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 o0=tt(n0,[["render",s0]]),i0={},a0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function l0(e,t){return b(),C("svg",a0,[...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 c0=tt(i0,[["render",l0]]),u0={class:"sidebar-thread-controls"},d0=["aria-label","title"],f0=["aria-pressed","aria-label","title"],h0=Mt({__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)=>(b(),C("div",u0,[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?(b(),mt(o0,{key:0,class:"sidebar-thread-controls-icon"})):(b(),mt(t0,{key:1,class:"sidebar-thread-controls-icon"}))],8,d0),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"))},[Ae(c0,{class:"sidebar-thread-controls-icon"})],8,f0),Tn(t.$slots,"default",{},void 0),e.showNewThreadButton?(b(),C("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"))},[Ae(qs,{class:"sidebar-thread-controls-icon"})])):ue("",!0)]))}}),il=tt(h0,[["__scopeId","data-v-57866500"]]),p0={},m0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function g0(e,t){return b(),C("svg",m0,[...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 v0=tt(p0,[["render",g0]]);function rr(e){return e.flatMap(t=>t.threads)}const Jc="codex-web-local.thread-read-state.v1",Qc="codex-web-local.thread-scroll-state.v1",oi="codex-web-local.selected-thread-id.v1",Xc="codex-web-local.project-order.v1",Zc="codex-web-local.project-display-name.v1",eu="codex-web-local.auto-refresh-enabled.v1",Mo=220,Zr=4e3,al=["none","minimal","low","medium","high","xhigh"],es="__global__",on="gpt-5.2-codex";function y0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ll(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function w0(){return typeof window>"u"?!1:window.localStorage.getItem(eu)==="1"}function cl(e){typeof window>"u"||window.localStorage.setItem(eu,e?"1":"0")}function tu(e,t,n){return Math.min(Math.max(e,t),n)}function b0(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=tu(t.scrollRatio,0,1)),n}function _0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Qc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=b0(s);o&&(n[r]=o)}return n}catch{return{}}}function ul(e){typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(e))}function k0(){return typeof window>"u"?"":window.localStorage.getItem(oi)??""}function T0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(oi);return}window.localStorage.setItem(oi,e)}}function S0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Xc);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 Rr(e){typeof window>"u"||window.localStorage.setItem(Xc,JSON.stringify(e))}function x0(){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))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function Po(e){typeof window>"u"||window.localStorage.setItem(Zc,JSON.stringify(e))}function As(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 wr(e,n)?e:n}function Oo(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 wr(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 C0(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 E0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Is(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 ii(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&wr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&E0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ks(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 A0(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&&ii(f,u)?f:u});if(n.preserveMissing!==!0)return Ks(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||ii(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Ks(e,d)?e:d}function ai(e){return e.replace(/\s+/gu," ").trim()}function I0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>ai(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=ai(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function dl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ii(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const nu="worked";function er(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function R0(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 $0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function M0(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 P0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${R0(e.durationMs)}`,messageType:nu}}function O0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function N0(e,t){const n=P0(t),r=e.filter(i=>i.messageType!==nu),s=O0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Ot(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function j0(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 D0(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 L0(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 Lt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Rs(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&&j0(d,l)?d:l});return o&&o.projectName===s.projectName&&D0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return L0(e,r)?e:r}function B0(e,t,n){const r=new Set(rr(t).map(a=>a.id)),s=rr(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 F0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function No(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function H0(e){const t=e.split(`
|
|
46
|
+
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function U0(){const e=P([]),t=P([]),n=P(k0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),g=P("medium"),_=P(y0()),N=P(_0()),I=P(S0()),U=P(x0()),J=P({}),O=P({}),W=P({}),D=P({}),ce=P({}),fe=P({}),pe=P({}),Se=P({}),ie=P({}),te=P({}),ye=P([]),re=P(!1),Ue=P(!1),Fe=P(!1),Ye=P(!1),$e=P(!1),Te=P(""),Oe=P(!1),yt=P(!1),et=P(w0()),nt=P(Math.floor(Zr/1e3));let ot=null,rt=null,me=null,Ie=null,xe=!1;const R=new Set;let Z=!1,X=!1;const ge=new Map,Ne=new Set,v=de(()=>rr(e.value)),w=de(()=>v.value.find(c=>c.id===n.value)??null),E=de(()=>N.value[n.value]??null),B=de(()=>{const c=[],h=n.value;return h&&Array.isArray(Se.value[h])&&c.push(...Se.value[h]),Array.isArray(Se.value[es])&&c.push(...Se.value[es]),c.sort((y,x)=>y.receivedAtIso.localeCompare(x.receivedAtIso))}),F=de(()=>{var z;const c=n.value;if(!c)return null;const h=ce.value[c],y=(o.value[c]??"").trim(),x=(((z=fe.value[c])==null?void 0:z.message)??"").trim();return!h&&!y&&!x?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:y,errorText:x}}),j=de(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],y=s.value[c]??[],x=i.value[c]??[],z=[...h,...x,...y],G=D.value[c];return G?N0(z,G):z});function ee(c){n.value!==c&&(n.value=c,T0(c),X=!1)}function se(c){f.value=c.trim()}async function Y(){f.value=on,u.value.includes(on)||(u.value=[...u.value,on]);try{await iy(on)}catch{}}function K(c,h){ie.value={...ie.value,[c]:h}}function we(c){ie.value[c]&&(ie.value=Ot(ie.value,c))}async function le(c){if(Ne.has(c))return;const h=ie.value[c];if(!(!h||h.fallbackRetried)){Ne.add(c),K(c,{...h,fallbackRetried:!0});try{await Y();try{const y=await tl(c,1);nn(c,y),xt(c,[]),ln(c),i.value[c]&&(i.value=Ot(i.value,c))}catch{}Qe(c,null),Te.value="",V(c,null),qe(c,{label:"Thinking",details:Ce(on,h.effort)}),Q(c,!0),W.value[c]!==!0&&await Io(c),await Ro(c,h.text,h.imageUrls,on,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),W.value={...W.value,[c]:!0},R.add(c),xe=!0,await ur()}catch(y){const x=y instanceof Error?y.message:"Unknown application error";Qe(c,x),Te.value=x,Q(c,!1),qe(c,null)}finally{Ne.delete(c)}}}function _e(c){c&&!al.includes(c)||(g.value=c)}function Ce(c,h){const y=c.trim()||"default",x=h||"default";return[`Model: ${y}`,`Thinking: ${x}`]}async function je(){try{const[c,h]=await Promise.all([ay(),ly()]);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&&al.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function Ge(c){const h=te.value;return Object.keys(h).length===0?c:c.map(y=>({projectName:y.projectName,threads:y.threads.map(x=>{const z=h[x.id];return z?{...x,title:z}:x})}))}function Re(){const h=Ge(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(x=>{const z=a.value[x.id]===!0,G=n.value===x.id,ke=_.value[x.id],Me=d.value[x.id]===!0,ve=!G&&!z&&(Me||ke!==x.updatedAtIso);return{...x,inProgress:z,unread:ve}})}));e.value=Rs(e.value,h)}function pt(c,h,y){const x=new Date().toISOString(),z=h.trim(),G=F0(z),ke={id:c,title:H0(y),projectName:G,cwd:z,hasWorktree:z.includes("/.codex/worktrees/")||z.includes("/.git/worktrees/"),createdAtIso:x,updatedAtIso:x,preview:y,unread:!1,inProgress:!1},Me=t.value.findIndex(st=>st.projectName===G);if(Me>=0){const bt=t.value[Me].threads.filter(Qn=>Qn.id!==c),Ar={projectName:G,threads:[ke,...bt]},Rn=[...t.value];Rn.splice(Me,1,Ar),t.value=Rn}else t.value=[{projectName:G,threads:[ke]},...t.value];const ve=As(I.value,t.value);wr(I.value,ve)||(I.value=ve,Rr(I.value)),Re()}function Xe(c){const h=new Set(c.map(G=>G.id)),y=Lt(_.value,h);y!==_.value&&(_.value=y,ll(y));const x=Lt(N.value,h);x!==N.value&&(N.value=x,ul(x)),O.value=Lt(O.value,h),J.value=Lt(J.value,h),W.value=Lt(W.value,h),r.value=Lt(r.value,h),s.value=Lt(s.value,h),o.value=Lt(o.value,h),i.value=Lt(i.value,h),D.value=Lt(D.value,h),ce.value=Lt(ce.value,h),fe.value=Lt(fe.value,h),pe.value=Lt(pe.value,h),d.value=Lt(d.value,h),a.value=Lt(a.value,h);const z={};for(const[G,ke]of Object.entries(Se.value))(G===es||h.has(G))&&(z[G]=ke);Se.value=z}function H(c){const h=rr(t.value).find(y=>y.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},ll(_.value),d.value[c]&&(d.value=Ot(d.value,c)),Re())}function V(c,h){if(!c)return;const y=D.value[c];if(h){if($0(y,h))return;D.value={...D.value,[c]:h}}else y&&(D.value=Ot(D.value,c))}function Q(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Ot(a.value,c),Re())}function Je(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Re())}function qe(c,h){if(!c)return;const y=ce.value[c];if(!h){y&&(ce.value=Ot(ce.value,c));return}const x=it(h.label)||"Thinking",z=h.details.map(Me=>it(Me)).filter(Me=>Me.length>0&&Me!==x),G=Array.from(new Set([...(y==null?void 0:y.details)??[],...z])).slice(-3),ke={label:x,details:G};M0(y,ke)||(ce.value={...ce.value,[c]:ke})}function Qe(c,h){if(!c)return;const y=fe.value[c],x=h?ai(h):"";if(!x){y&&(fe.value=Ot(fe.value,c));return}(y==null?void 0:y.message)!==x&&(fe.value={...fe.value,[c]:{message:x}})}function jt(c){const h=rr(t.value).find(y=>y.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Yt(c,h){if(!c)return;const y={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(y.scrollRatio=tu(h.scrollRatio,0,1));const x=N.value[c];x&&x.scrollTop===y.scrollTop&&x.isAtBottom===y.isAtBottom&&x.scrollRatio===y.scrollRatio||(N.value={...N.value,[c]:y},ul(N.value))}function nn(c,h){const y=r.value[c]??[];Ks(y,h)||(r.value={...r.value,[c]:h})}function xt(c,h){const y=s.value[c]??[];Ks(y,h)||(s.value={...s.value,[c]:h})}function Jt(c,h){const y=s.value[c]??[],x=dl(y,h);xt(c,x)}function mn(c,h){if(!c)return;const y=h.trim(),x=o.value[c]??"";if(y.length===0){if(!x)return;o.value=Ot(o.value,c);return}x!==y&&(o.value={...o.value,[c]:y})}function xn(c,h){if(!c)return;const y=o.value[c]??"";mn(c,`${y}${h}`)}function ln(c){c&&c in o.value&&(o.value=Ot(o.value,c))}function He(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function p(c){return typeof c=="string"?c:""}function T(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function S(c){const h=He(c.params);if(!h)return"";const y=p(h.threadId);if(y)return y;const x=p(h.thread_id);if(x)return x;const z=p(h.conversationId);if(z)return z;const G=p(h.conversation_id);if(G)return G;const ke=He(h.thread),Me=p(ke==null?void 0:ke.id);if(Me)return Me;const ve=He(h.turn),st=p(ve==null?void 0:ve.threadId);if(st)return st;const bt=p(ve==null?void 0:ve.thread_id);return bt||""}function L(c){if(c.method!=="turn/completed")return"";const h=He(c.params),y=He(h==null?void 0:h.turn);if(!y||y.status!=="failed")return"";const x=He(y.error);return p(x==null?void 0:x.message)}function oe(c){var y;if(c.method!=="error")return"";const h=He(c.params);return p(h==null?void 0:h.message)||p((y=He(h==null?void 0:h.error))==null?void 0:y.message)}function ae(c){const h=He(c);if(!h)return null;const y=h.id,x=p(h.method),z=h.params;if(typeof y!="number"||!Number.isInteger(y)||!x)return null;const G=He(z),ke=p(G==null?void 0:G.threadId)||es,Me=p(G==null?void 0:G.turnId),ve=p(G==null?void 0:G.itemId),st=p(h.receivedAtIso)||new Date().toISOString();return{id:y,method:x,threadId:ke,turnId:Me,itemId:ve,receivedAtIso:st,params:z??null}}function Ee(c){const h=c.threadId||es,y=Se.value[h]??[],x=y.findIndex(G=>G.id===c.id),z=[...y];x>=0?z.splice(x,1,c):z.push(c),Se.value={...Se.value,[h]:z.sort((G,ke)=>G.receivedAtIso.localeCompare(ke.receivedAtIso))}}function be(c){const h={};for(const[y,x]of Object.entries(Se.value)){const z=x.filter(G=>G.id!==c);z.length>0&&(h[y]=z)}Se.value=h}function ze(c){if(c.method==="server/request"){const h=ae(c.params);return h&&Ee(h),!0}if(c.method==="server/request/resolved"){const h=He(c.params),y=h==null?void 0:h.id;return typeof y=="number"&&Number.isInteger(y)&&be(y),!0}return!1}function it(c){return c.replace(/\s+/gu," ").trim()}function wt(c){const h=S(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const y=He(c.params),x=He(y==null?void 0:y.item),z=p(x==null?void 0:x.type).toLowerCase();if(z==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(z==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(z==="commandexecution"){const G=p(x==null?void 0:x.command);return{threadId:h,activity:{label:"Running command",details:G?[G]:[]}}}}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 Pt(c){if(c.method!=="turn/started")return null;const h=He(c.params);if(!h)return null;const y=S(c);if(!y)return null;const x=He(h.turn),z=p(x==null?void 0:x.id)||p(h.turnId)||`${y}:unknown`;if(!z)return null;const G=er(p(x==null?void 0:x.startedAt))??er(p(h.startedAt))??er(c.atIso)??Date.now();return{threadId:y,turnId:z,startedAtMs:G}}function Ct(c){if(c.method!=="turn/completed")return null;const h=He(c.params);if(!h)return null;const y=S(c);if(!y)return null;const x=He(h.turn),z=p(x==null?void 0:x.id)||p(h.turnId)||`${y}:unknown`;if(!z)return null;const G=er(p(x==null?void 0:x.completedAt))??er(p(h.completedAt))??er(c.atIso)??Date.now(),ke=er(p(x==null?void 0:x.startedAt))??er(p(h.startedAt))??void 0;return{threadId:y,turnId:z,completedAtMs:G,startedAtMs:ke}}function Cn(c){return`${c}:live-reasoning`}function ir(c){const h=He(c.params);if(!h)return"";if(c.method==="item/started"){const y=He(h.item);return!y||y.type!=="reasoning"?"":p(y.id)}return""}function Gn(c){const h=He(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const y=p(h.itemId),x=p(h.delta);return!y||!x?null:{messageId:Cn(y),delta:x}}return null}function Vr(c){const h=He(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const y=p(h.itemId);return y?Cn(y):""}return""}function Sr(c){const h=He(c.params);if(!h)return"";if(c.method==="item/completed"){const y=He(h.item);return!y||y.type!=="reasoning"?"":Cn(p(y.id))}return""}function Wr(c){const h=He(c.params);if(!h)return"";if(c.method==="item/started"){const y=He(h.item);return!y||y.type!=="agentMessage"?"":p(y.id)}return""}function zn(c){const h=He(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const y=p(h.itemId),x=p(h.delta);return!y||!x?null:{messageId:y,delta:x}}return null}function ar(c){const h=He(c.params);if(!h)return null;if(c.method==="item/completed"){const y=He(h.item);if(!y||y.type!=="agentMessage")return null;const x=p(y.id),z=p(y.text);return!x||!z?null:{id:x,role:"assistant",text:z,messageType:"agentMessage.live"}}return null}function qr(c){if(c.method!=="item/started")return null;const h=He(c.params),y=He(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const x=p(y.id),z=p(y.command);if(!x)return null;const G=typeof y.cwd=="string"?y.cwd:null;return{id:x,role:"system",text:z,messageType:"commandExecution",commandExecution:{command:z,cwd:G,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function En(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=He(c.params);if(!h)return null;const y=p(h.itemId),x=p(h.delta);return!y||!x?null:{itemId:y,delta:x}}function xr(c){if(c.method!=="item/completed")return null;const h=He(c.params),y=He(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const x=p(y.id),z=p(y.command);if(!x)return null;const G=typeof y.cwd=="string"?y.cwd:null,ke=p(y.status),Me=ke==="failed"?"failed":ke==="declined"?"declined":ke==="interrupted"?"interrupted":"completed",ve=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",st=typeof y.exitCode=="number"?y.exitCode:null;return{id:x,role:"system",text:z,messageType:"commandExecution",commandExecution:{command:z,cwd:G,status:Me,aggregatedOutput:ve,exitCode:st}}}function An(c,h){const y=i.value[c]??[],x=dl(y,h);x!==y&&(i.value={...i.value,[c]:x})}function Kr(c,h){const y=i.value[c];if(!y||y.length===0)return;const x=new Set(h.map(G=>G.id)),z=y.filter(G=>!x.has(G.id));z.length!==y.length&&(z.length===0?i.value=Ot(i.value,c):i.value={...i.value,[c]:z})}function Yn(c){if(c.method==="item/agentMessage/delta")return!0;const h=He(c.params);if(!h)return!1;if(c.method==="item/completed"){const y=He(h.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function Cr(c){var Di,Li,Bi,Fi;if(ze(c))return;if(c.method==="thread/name/updated"){const Ke=He(c.params),gn=p(Ke==null?void 0:Ke.threadId),dr=p(Ke==null?void 0:Ke.threadName);gn&&dr&&(te.value={...te.value,[gn]:dr},Re(),$o(gn,dr))}const h=wt(c);h&&qe(h.threadId,h.activity);const y=Pt(c);y&&(ge.set(y.turnId,y),pe.value={...pe.value,[y.threadId]:y.turnId},V(y.threadId,null),Qe(y.threadId,null),Q(y.threadId,!0),d.value[y.threadId]&&(d.value=Ot(d.value,y.threadId)));const x=Ct(c),z=L(c),ke=!!((x==null?void 0:x.threadId)??S(c))&&!!z&&f.value!==on&&Is(new Error(z));if(x){const Ke=ge.get(x.turnId);Ke&&ge.delete(x.turnId);const gn=T((Di=He(c.params))==null?void 0:Di.durationMs)??T((Bi=He((Li=He(c.params))==null?void 0:Li.turn))==null?void 0:Bi.durationMs)??(typeof x.startedAtMs=="number"?x.completedAtMs-x.startedAtMs:null)??(Ke?x.completedAtMs-Ke.startedAtMs:null),dr=typeof gn=="number"?Math.max(0,gn):0;V(x.threadId,{turnId:x.turnId,durationMs:dr}),pe.value[x.threadId]&&(pe.value=Ot(pe.value,x.threadId)),Q(x.threadId,!1),qe(x.threadId,null),Je(x.threadId),ke||(we(x.threadId),ks(x.threadId))}if(z){const Ke=(x==null?void 0:x.threadId)||S(c);Ke&&Qe(Ke,z),Te.value=z,Ke&&ke&&le(Ke)}else x&&Qe(x.threadId,null);const Me=oe(c);if(Me){const Ke=S(c);Ke&&Qe(Ke,Me),Te.value=Me,f.value!==on&&Is(new Error(Me))&&(Ke?le(Ke):Y())}const ve=S(c);if(!ve||ve!==n.value)return;Wr(c);const st=zn(c);if(st){const Ke=(s.value[ve]??[]).find(dr=>dr.id===st.messageId),gn=`${(Ke==null?void 0:Ke.text)??""}${st.delta}`;Jt(ve,{id:st.messageId,role:"assistant",text:gn,messageType:"agentMessage.live"})}const bt=ar(c);bt&&Jt(ve,bt),ir(c);const Ar=Gn(c);if(Ar&&xn(ve,Ar.delta),Vr(c)){const Ke=o.value[ve]??"";Ke.trim().length>0&&!Ke.endsWith(`
|
|
47
|
+
|
|
48
|
+
`)&&mn(ve,`${Ke}
|
|
49
|
+
|
|
50
|
+
`)}Sr(c);const Qn=qr(c);Qn&&(An(ve,Qn),qe(ve,{label:"Running command",details:[((Fi=Qn.commandExecution)==null?void 0:Fi.command)??""]}));const co=En(c);if(co){const Ke=(i.value[ve]??[]).find(gn=>gn.id===co.itemId);Ke!=null&&Ke.commandExecution&&An(ve,{...Ke,commandExecution:{...Ke.commandExecution,aggregatedOutput:`${Ke.commandExecution.aggregatedOutput}${co.delta}`}})}const ji=xr(c);if(ji&&An(ve,ji),Yn(c)&&(X&&n.value&&Yt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),ln(ve)),c.method==="turn/completed"){X=!1,ln(ve),i.value[ve]&&(i.value=Ot(i.value,ve));const Ke=S(c);Ke&&(Q(Ke,!1),qe(Ke,null),Je(Ke),ke||(we(Ke),ks(Ke)))}}function k(c){const h=S(c);h&&R.add(h);const y=c.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(xe=!0),!(rt!==null||typeof window>"u")&&(rt=window.setTimeout(()=>{rt=null,ur()},Mo))}async function A(c){if(!Z){Z=!0;try{const h=await ni(),y=[];for(const x of h.order){const z=No(x);y.includes(z)||y.push(z)}if(y.length>0){const x=As(y,c);wr(I.value,x)||(I.value=x,Rr(I.value))}if(Object.keys(h.labels).length>0){const x={...U.value};let z=!1;for(const[G,ke]of Object.entries(h.labels)){const Me=No(G);x[Me]!==ke&&(x[Me]=ke,z=!0)}z&&(U.value=x,Po(x))}}catch{}}}async function $(){if(!(Object.keys(te.value).length>0))try{const c=await gy();Object.keys(c.titles).length>0&&(te.value=c.titles)}catch{}}async function q(c,h,y){if(te.value[c])return;const x=h.trim();if(!x)return;const z=x.length>300?x.slice(0,300):x;try{const G=await vy(z,y);if(!G||te.value[c])return;te.value={...te.value,[c]:G},Re(),$o(c,G)}catch{}}async function Le(){var c;yt.value||(re.value=!0);try{const[h]=await Promise.all([Jv(),$()]);await A(h);const y=As(I.value,h);wr(I.value,y)||(I.value=y,Rr(I.value));const x=Oo(h,I.value),z=B0(t.value,x,a.value);t.value=Rs(t.value,z),a.value=Lt(a.value,new Set(rr(t.value).map(Me=>Me.id))),Re(),yt.value=!0;const G=rr(e.value);Xe(G),G.some(Me=>Me.id===n.value)||ee(((c=G[0])==null?void 0:c.id)??"")}finally{re.value=!1}}async function kt(c,h={}){if(!c)return;const y=O.value[c]===!0,x=h.silent!==!0&&!y;x&&(Ue.value=!0);try{W.value[c]!==!0&&(await Io(c),W.value={...W.value,[c]:!0});const{messages:z,inProgress:G}=await Qv(c),ke=r.value[c]??[],Me=A0(ke,z,{preserveMissing:h.silent===!0});nn(c,Me);const ve=s.value[c]??[],st=I0(ve,z);xt(c,st),Kr(c,z),O.value={...O.value,[c]:!0};const bt=jt(c);bt&&(J.value={...J.value,[c]:bt}),Q(c,G),H(c)}finally{x&&(Ue.value=!1)}}async function Qt(){try{const c=t.value.flatMap(h=>h.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await yy(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Er(){Te.value="";try{await Le(),await Promise.all([je(),Qt()]),await kt(n.value)}catch(c){Te.value=c instanceof Error?c.message:"Unknown application error"}}async function In(c){ee(c);try{await kt(c)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function rn(c){try{await ty(c),await Le(),n.value===c&&await kt(n.value)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Jn(c,h){const y=h.trim();if(!(!c||!y))try{await ny(c,y),te.value={...te.value,[c]:y},Re(),$o(c,y)}catch(x){Te.value=x instanceof Error?x.message:"Unknown application error"}}async function lr(c,h=[],y=[],x="steer",z=[]){const G=n.value,ke=c.trim();if(!G||!ke&&h.length===0&&z.length===0)return;const Me=a.value[G]===!0;if(Me&&x==="queue"){const ve=l.value[G]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[G]:[...ve,{id:st,text:ke,imageUrls:h,skills:y,fileAttachments:z}]};return}if(Me){X=!0,cr(G,ke,h,y,z).catch(ve=>{const st=ve instanceof Error?ve.message:"Unknown application error";Qe(G,st),Te.value=st});return}Te.value="",X=!0,V(G,null),qe(G,{label:"Thinking",details:Ce(f.value,g.value)}),Qe(G,null),Q(G,!0);try{await cr(G,ke,h,y,z)}catch(ve){X=!1,Q(G,!1),qe(G,null);const st=ve instanceof Error?ve.message:"Unknown application error";throw Qe(G,st),Te.value=st,ve}}async function Gr(c,h,y=[],x=[],z=[]){const G=c.trim(),ke=h.trim(),Me=f.value.trim();if(!G&&y.length===0&&z.length===0)return"";Fe.value=!0,Te.value="";let ve="";try{try{ve=await nl(ke||void 0,Me||void 0)}catch(Rn){if(Me&&Me!==on&&Is(Rn))await Y(),ve=await nl(ke||void 0,on);else throw Rn}if(!ve)return"";pt(ve,ke,G||"[Image]"),W.value={...W.value,[ve]:!0},ee(ve),X=!0,V(ve,null),qe(ve,{label:"Thinking",details:Ce(f.value,g.value)}),Qe(ve,null),Q(ve,!0);const st=ve,bt=ke||null,Ar=G;return cr(ve,G,y,x,z).catch(Rn=>{X=!1,Q(ve,!1),qe(ve,null);const Qn=Rn instanceof Error?Rn.message:"Unknown application error";Qe(ve,Qn),Te.value=Qn}).finally(()=>{Fe.value=!1}),q(st,Ar,bt),ve}catch(st){X=!1,ve&&(Q(ve,!1),qe(ve,null));const bt=st instanceof Error?st.message:"Unknown application error";throw ve&&Qe(ve,bt),Te.value=bt,Fe.value=!1,st}}async function cr(c,h,y=[],x=[],z=[]){const G=f.value.trim(),ke=g.value,Me=h.trim(),ve=x.map(bt=>({name:bt.name,path:bt.path})),st=z.map(bt=>({...bt}));K(c,{text:Me,imageUrls:[...y],skills:ve,fileAttachments:st,effort:ke,fallbackRetried:!1});try{W.value[c]!==!0&&await Io(c);try{await Ro(c,h,y,G||void 0,ke||void 0,x.length>0?x:void 0,z)}catch(bt){if(G&&G!==on&&Is(bt))await Y(),K(c,{text:Me,imageUrls:[...y],skills:ve,fileAttachments:st,effort:ke,fallbackRetried:!0}),await Ro(c,h,y,on,ke||void 0,x.length>0?x:void 0,z);else throw bt}W.value={...W.value,[c]:!0},R.add(c),xe=!0,await ur()}catch(bt){throw bt}}async function ks(c){const h=l.value[c];if(!h||h.length===0)return;const[y,...x]=h;l.value=x.length>0?{...l.value,[c]:x}:Ot(l.value,c),Fe.value=!0,Te.value="",X=!0,V(c,null),qe(c,{label:"Thinking",details:Ce(f.value,g.value)}),Qe(c,null),Q(c,!0);try{await cr(c,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Q(c,!1),qe(c,null)}finally{Fe.value=!1}}async function M(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=pe.value[c];Ye.value=!0,Te.value="";try{await oy(c,h),Q(c,!1),qe(c,null),Qe(c,null),pe.value[c]&&(pe.value=Ot(pe.value,c)),R.add(c),xe=!0,await ur()}catch(y){const x=y instanceof Error?y.message:"Failed to interrupt active turn";Qe(c,x),Te.value=x}finally{Ye.value=!1}}async function ne(c){const h=n.value;if(!h||$e.value)return;const x=(r.value[h]??[]).reduce((G,ke)=>typeof ke.turnIndex=="number"&&ke.turnIndex>G?ke.turnIndex:G,-1);if(x<0||c>x)return;const z=x-c+1;if(!(z<1)){$e.value=!0,Te.value="";try{const G=await tl(h,z);nn(h,G),xt(h,[]),ln(h),i.value[h]&&(i.value=Ot(i.value,h)),V(h,null),qe(h,null),Qe(h,null),xe=!0,await ur()}catch(G){Te.value=G instanceof Error?G.message:"Failed to rollback thread"}finally{$e.value=!1}}}function Pe(c,h){c.length===0||(U.value[c]??"")===h||(U.value={...U.value,[c]:h},Po(U.value))}function Et(c){var z;if(c.length===0)return;const h=I.value.filter(G=>G!==c);if(wr(I.value,h)||(I.value=h,Rr(I.value)),t.value=t.value.filter(G=>G.projectName!==c),U.value[c]!==void 0){const G={...U.value};delete G[c],U.value=G,Po(G)}Re();const y=rr(e.value);Xe(y),y.some(G=>G.id===n.value)||ee(((z=y[0])==null?void 0:z.id)??""),$t()}function Dt(c,h){if(c.length===0||t.value.length===0)return;const y=t.value.map(ve=>ve.projectName),x=y.indexOf(c);if(x===-1)return;const z=Math.max(0,Math.min(h,y.length-1)),G=C0(y,x,z);if(G===y)return;const ke=As(G,t.value);I.value=ke,Rr(I.value);const Me=Oo(t.value,I.value);t.value=Rs(t.value,Me),Re(),$t()}function Rt(c){const h=c.trim();if(!h)return;const y=[h,...I.value.filter(z=>z!==h)];if(wr(I.value,y))return;I.value=y,Rr(I.value);const x=Oo(t.value,I.value);t.value=Rs(t.value,x),Re(),$t()}async function $t(){var c,h;try{const y=await ni(),x=new Map;for(const ke of y.order){const Me=No(ke);x.has(Me)||x.set(Me,ke)}for(const ke of t.value){const Me=((h=(c=ke.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Me&&x.set(ke.projectName,Me)}const z=[];for(const ke of I.value){const Me=x.get(ke);Me&&!z.includes(Me)&&z.push(Me)}for(const ke of y.order)z.includes(ke)||z.push(ke);const G=y.active.filter(ke=>z.includes(ke));G.length===0&&z.length>0&&G.push(z[0]),await dy({order:z,labels:y.labels,active:G})}catch{}}async function ru(){if(!Oe.value){Oe.value=!0;try{if(await Le(),!n.value)return;const c=n.value,h=jt(c),y=J.value[c]??"",x=h.length>0&&h!==y;(a.value[c]===!0||x)&&await kt(c,{silent:!0})}catch{}finally{Oe.value=!1}}}async function ur(){if(Oe.value){typeof window<"u"&&rt===null&&(rt=window.setTimeout(()=>{rt=null,ur()},Mo));return}Oe.value=!0;const c=xe,h=new Set(R);xe=!1,R.clear();try{c&&await Le();const y=n.value;if(!y)return;const x=h.has(y),z=a.value[y]===!0,G=jt(y),ke=J.value[y]??"",Me=G.length>0&&G!==ke;(x||z||Me||c)&&await kt(y,{silent:!0})}catch{}finally{Oe.value=!1,(xe||R.size>0)&&typeof window<"u"&&rt===null&&(rt=window.setTimeout(()=>{rt=null,ur()},Mo))}}function su(){typeof window>"u"||ot||(et.value&&Oi(),ou(),ot=Xv(c=>{Cr(c),k(c)}))}async function ou(){try{const c=await ey();for(const h of c){const y=ae(h);y&&Ee(y)}}catch{}}async function iu(c){try{await Zv(c.id,{result:c.result,error:c.error}),be(c.id)}catch(h){Te.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Pi(c={}){const h=c.updatePreference??!0;me!==null&&typeof window<"u"&&(window.clearInterval(me),me=null),Ie!==null&&typeof window<"u"&&(window.clearInterval(Ie),Ie=null),h&&(et.value=!1,cl(!1)),nt.value=Math.floor(Zr/1e3)}function Oi(){typeof window>"u"||me!==null||Ie!==null||(et.value=!0,cl(!0),nt.value=Math.floor(Zr/1e3),me=window.setInterval(()=>{nt.value=Math.floor(Zr/1e3),ru()},Zr),Ie=window.setInterval(()=>{nt.value=Math.max(0,nt.value-1)},1e3))}function au(){if(et.value){Pi();return}Oi()}function lu(){Pi({updatePreference:!1}),ot&&(ot(),ot=null),xe=!1,R.clear(),ge.clear(),rt!==null&&typeof window<"u"&&(window.clearTimeout(rt),rt=null),X=!1,r.value={},s.value={},o.value={},i.value={},ce.value={},D.value={},fe.value={},pe.value={},l.value={}}const cu=de(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Ni(c){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const x=y.filter(z=>z.id!==c);l.value=x.length>0?{...l.value,[h]:x}:Ot(l.value,h)}function uu(c){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const x=y.find(z=>z.id===c);x&&(Ni(c),lr(x.text,x.imageUrls,x.skills,"steer",x.fileAttachments))}return{projectGroups:e,projectDisplayNameById:U,selectedThread:w,selectedThreadScrollState:E,selectedThreadServerRequests:B,selectedLiveOverlay:F,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:ye,messages:j,isLoadingThreads:re,isLoadingMessages:Ue,isSendingMessage:Fe,isInterruptingTurn:Ye,isAutoRefreshEnabled:et,autoRefreshSecondsLeft:nt,error:Te,refreshAll:Er,refreshSkills:Qt,selectThread:In,setThreadScrollState:Yt,archiveThreadById:rn,renameThreadById:Jn,sendMessageToSelectedThread:lr,sendMessageToNewThread:Gr,interruptSelectedThreadTurn:M,rollbackSelectedThread:ne,isRollingBack:$e,selectedThreadQueuedMessages:cu,removeQueuedMessage:Ni,steerQueuedMessage:uu,setSelectedModelId:se,setSelectedReasoningEffort:_e,respondToPendingServerRequest:iu,renameProject:Pe,removeProject:Et,reorderProject:Dt,pinProjectToTop:Rt,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const V0={class:"sidebar-root"},W0={class:"sidebar-scrollable"},q0=["aria-pressed"],K0={key:1,class:"sidebar-search-bar"},G0={key:0,class:"sidebar-settings-area"},z0={key:0,class:"sidebar-settings-panel"},Y0={class:"sidebar-settings-value"},J0={class:"sidebar-settings-value"},Q0={class:"content-root"},X0={class:"content-body"},Z0={key:1,class:"content-grid"},e_={class:"new-thread-empty"},t_={class:"worktree-init-status-title"},n_={class:"worktree-init-status-message"},r_={key:2,class:"content-grid"},s_={class:"content-thread"},o_={class:"composer-with-queue"},i_={class:"build-badge","aria-label":"Worktree name and version"},fl="codex-web-local.sidebar-collapsed.v1",hl="codex-web-local.send-with-enter.v1",pl="codex-web-local.in-progress-send-mode.v1",ml="codex-web-local.dark-mode.v1",a_=Mt({__name:"App",setup(e){const t="63ac",n="0.1.45",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:_,messages:N,isLoadingThreads:I,isLoadingMessages:U,isInterruptingTurn:J,isAutoRefreshEnabled:O,autoRefreshSecondsLeft:W,refreshAll:D,refreshSkills:ce,selectThread:fe,setThreadScrollState:pe,archiveThreadById:Se,renameThreadById:ie,sendMessageToSelectedThread:te,sendMessageToNewThread:ye,interruptSelectedThreadTurn:re,rollbackSelectedThread:Ue,isRollingBack:Fe,selectedThreadQueuedMessages:Ye,removeQueuedMessage:$e,steerQueuedMessage:Te,setSelectedModelId:Oe,setSelectedReasoningEffort:yt,respondToPendingServerRequest:et,renameProject:nt,removeProject:ot,reorderProject:rt,pinProjectToTop:me,toggleAutoRefreshTimer:Ie,startPolling:xe,stopPolling:R}=U0(),Z=Yh(),X=zh(),{isMobile:ge}=Wc(),Ne=P(!1),v=P(!1),w=P(""),E=P("local"),B=P({order:[],labels:{}}),F=P({phase:"idle",title:"",message:""}),j=P(rn()),ee=P(""),se=P(!1),Y=P(null),K=P(null);let we=null;const le=P("New Project (1)"),_e=P(""),Ce=P(!1),je=P($(hl,!0)),Ge=P(Le()),Re=P(q()),pt=de(()=>{const M=Z.params.threadId;return typeof M=="string"?M:""}),Xe=de(()=>{const M=new Set;for(const ne of r.value)for(const Pe of ne.threads)M.add(Pe.id);return M}),H=de(()=>Z.name==="home"),V=de(()=>Z.name==="skills"),Q=de(()=>{var M;return V.value?"Skills":H.value?"New thread":((M=o.value)==null?void 0:M.title)??"Choose a thread"}),Je=de(()=>O.value?`Auto refresh in ${String(W.value)}s`:"Enable 4s refresh"),qe=de(()=>N.value.filter(M=>{const ne=lr(M.messageType,M.role);return ne==="worked"?!0:!(ne==="turnActivity.live"||ne==="turnError.live"||ne==="agentReasoning.live")})),Qe=de(()=>l.value),jt=de(()=>H.value?"__new-thread__":d.value),Yt=de(()=>{var M,ne;return H.value?w.value.trim():((ne=(M=o.value)==null?void 0:M.cwd)==null?void 0:ne.trim())??""}),nn=de(()=>{var M;return!H.value&&((M=o.value)==null?void 0:M.inProgress)===!0}),xt=de(()=>{var Et,Dt;const M=[],ne=new Set;for(const Rt of B.value.order){const $t=Rt.trim();!$t||ne.has($t)||(ne.add($t),M.push({value:$t,label:B.value.labels[$t]||An($t)}))}for(const Rt of r.value){const $t=((Dt=(Et=Rt.threads[0])==null?void 0:Et.cwd)==null?void 0:Dt.trim())??"";!$t||ne.has($t)||(ne.add($t),M.push({value:$t,label:s.value[Rt.projectName]??Rt.projectName}))}const Pe=w.value.trim();return Pe&&!ne.has(Pe)&&M.unshift({value:Pe,label:An(Pe)}),M}),Jt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;qn(()=>{window.addEventListener("keydown",Cn),In(),Jt==null||Jt.addEventListener("change",In),Gr(),qr(),En(),zn()}),no(()=>{window.removeEventListener("keydown",Cn),Jt==null||Jt.removeEventListener("change",In),we&&(clearTimeout(we),we=null),R()}),ft(ee,M=>{const ne=M.trim();if(we&&(clearTimeout(we),we=null),!ne){K.value=null;return}we=setTimeout(()=>{my(ne,1e3).then(Pe=>{ee.value.trim()===ne&&(K.value=Pe.threadIds)}).catch(()=>{ee.value.trim()===ne&&(K.value=null)})},220)});function mn(){ce()}function xn(){se.value=!se.value,se.value?tn(()=>{var M;return(M=Y.value)==null?void 0:M.focus()}):ee.value=""}function ln(){var M;ee.value="",(M=Y.value)==null||M.focus()}function He(M){M.key==="Escape"&&(se.value=!1,ee.value="")}function p(M){M&&(Z.name==="thread"&&pt.value===M||(X.push({name:"thread",params:{threadId:M}}),ge.value&&Ct(!0)))}function T(M){Se(M)}function S(M){var Et,Dt;const ne=r.value.find(Rt=>Rt.projectName===M),Pe=((Dt=(Et=ne==null?void 0:ne.threads[0])==null?void 0:Et.cwd)==null?void 0:Dt.trim())??"";Pe&&(w.value=Pe),ge.value&&Ct(!0),!H.value&&X.push({name:"home"})}function L(M){var Et,Dt;const ne=r.value.find(Rt=>Rt.projectName===M),Pe=((Dt=(Et=ne==null?void 0:ne.threads[0])==null?void 0:Et.cwd)==null?void 0:Dt.trim())??"";!Pe||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Pe)}`,"_blank","noopener,noreferrer")}function oe(){var ne,Pe;const M=((Pe=(ne=o.value)==null?void 0:ne.cwd)==null?void 0:Pe.trim())??"";M&&(w.value=M),ge.value&&Ct(!0),!H.value&&X.push({name:"home"})}function ae(M){nt(M.projectName,M.displayName)}function Ee(M){ie(M.threadId,M.title)}function be(M){ot(M)}function ze(M){rt(M.projectName,M.toIndex)}function it(M){pe(M.threadId,M.state)}function wt(M){et(M)}function Pt(){Ie()}function Ct(M){j.value!==M&&(j.value=M,Jn(M))}function Cn(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),Ct(!j.value))}function ir(M){const ne=M.text;if(H.value){ks(ne,M.imageUrls,M.skills,M.fileAttachments);return}te(ne,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function Gn(M){w.value=M.trim()}async function Vr(M){const ne=M.trim();if(!ne)return;const Pe=Wr(ne),Et=await Sr(),Dt=Pe?ne:Kr(Et,ne);if(Dt)try{const Rt=await fy(Dt,{createIfMissing:!Pe,label:Pe?"":ne});Rt&&(w.value=Rt,me(An(Rt)),En(),zn())}catch{}}async function Sr(){const M=ar();if(M)return M;try{const ne=await rl();if(ne)return _e.value=ne,ne}catch{}return""}function Wr(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function zn(){const M=ar();if(!M){le.value="New Project (1)";return}try{const ne=await hy(M);le.value=ne.name||"New Project (1)"}catch{le.value="New Project (1)"}}function ar(){var Pe,Et;const M=w.value.trim();if(M)return xr(M);const ne=((Et=(Pe=xt.value[0])==null?void 0:Pe.value)==null?void 0:Et.trim())??"";return ne?xr(ne):_e.value.trim()}async function qr(){try{_e.value=await rl()}catch{_e.value=""}}async function En(){try{const M=await ni();B.value={order:[...M.order],labels:{...M.labels}}}catch{B.value={order:[],labels:{}}}}function xr(M){const ne=M.trim().replace(/\/+$/,"");if(!ne)return"";const Pe=ne.lastIndexOf("/");return Pe<=0?"":ne.slice(0,Pe)}function An(M){const ne=M.trim().replace(/\/+$/,"");if(!ne)return"";const Pe=ne.lastIndexOf("/");return Pe<0?ne:ne.slice(Pe+1)}function Kr(M,ne){const Pe=M.trim().replace(/\/+$/,""),Et=ne.trim().replace(/^\/+/,"");return!Pe||!Et?"":`${Pe}/${Et}`}function Yn(M){Oe(M)}function Cr(M){yt(M)}function k(){re()}function A(M){Ue(M.turnIndex)}function $(M,ne){if(typeof window>"u")return ne;const Pe=window.localStorage.getItem(M);return Pe===null?ne:Pe==="1"}function q(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(ml);return M==="light"||M==="dark"?M:"system"}function Le(){return typeof window>"u"?"queue":window.localStorage.getItem(pl)==="steer"?"steer":"queue"}function kt(){je.value=!je.value,window.localStorage.setItem(hl,je.value?"1":"0")}function Qt(){Ge.value=Ge.value==="steer"?"queue":"steer",window.localStorage.setItem(pl,Ge.value)}function Er(){const M=["system","light","dark"],ne=M.indexOf(Re.value);Re.value=M[(ne+1)%M.length],window.localStorage.setItem(ml,Re.value),In()}function In(){const M=document.documentElement;if(Re.value==="dark")M.classList.add("dark");else if(Re.value==="light")M.classList.remove("dark");else{const ne=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",ne)}}function rn(){return typeof window>"u"?!1:window.localStorage.getItem(fl)==="1"}function Jn(M){typeof window>"u"||window.localStorage.setItem(fl,M?"1":"0")}function lr(M,ne){const Pe=(M??"").trim();return Pe.length>0?Pe:ne.trim()||"message"}async function Gr(){await D(),v.value=!0,await cr(),xe()}async function cr(){if(!Ne.value){Ne.value=!0;try{if(Z.name==="home"||Z.name==="skills"){d.value!==""&&await fe("");return}if(Z.name==="thread"){const M=pt.value;if(!M)return;if(!Xe.value.has(M)){await X.replace({name:"home"});return}d.value!==M&&await fe(M);return}}finally{Ne.value=!1}}}ft(()=>[Z.name,pt.value,I.value,Xe.value.has(pt.value),d.value],async()=>{v.value&&await cr()}),ft(()=>d.value,async M=>{if(v.value&&!Ne.value&&!(H.value||V.value)){if(!M){Z.name!=="home"&&await X.replace({name:"home"});return}Z.name==="thread"&&pt.value===M||await X.replace({name:"thread",params:{threadId:M}})}}),ft(()=>xt.value,M=>{if(M.length===0){w.value="";return}M.some(Pe=>Pe.value===w.value)||(w.value=M[0].value),zn()},{immediate:!0}),ft(()=>w.value,()=>{F.value={phase:"idle",title:"",message:""},zn()}),ft(()=>E.value,M=>{M==="local"&&(F.value={phase:"idle",title:"",message:""})}),ft(()=>Z.name,M=>{M!=="home"&&(F.value={phase:"idle",title:"",message:""})}),ft(()=>d.value,()=>{F.value={phase:"idle",title:"",message:""}}),ft(ge,M=>{M&&!j.value&&Ct(!0)});async function ks(M,ne=[],Pe=[],Et=[]){try{F.value={phase:"idle",title:"",message:""};let Dt=w.value;if(E.value==="worktree"){F.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const $t=await uy(w.value);Dt=$t.cwd,w.value=$t.cwd,F.value={phase:"idle",title:"",message:""}}catch{F.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Rt=await ye(M,Dt,ne,Pe,Et);if(!Rt)return;await X.replace({name:"thread",params:{threadId:Rt}})}catch{}}return(M,ne)=>(b(),C(Ve,null,[Ae(tp,{"is-sidebar-collapsed":j.value,onCloseSidebar:ne[6]||(ne[6]=Pe=>Ct(!0))},{sidebar:dt(()=>[m("section",V0,[m("div",W0,[j.value?ue("",!0):(b(),mt(il,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":De(O),"auto-refresh-button-label":Je.value,"show-new-thread-button":!0,onToggleSidebar:ne[0]||(ne[0]=Pe=>Ct(!j.value)),onToggleAutoRefresh:Pt,onStartNewThread:oe},{default:dt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":se.value,"aria-label":"Search threads",title:"Search threads",onClick:xn},[Ae(si,{class:"sidebar-search-toggle-icon"})],8,q0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!j.value&&se.value?(b(),C("div",K0,[Ae(si,{class:"sidebar-search-bar-icon"}),Un(m("input",{ref_key:"sidebarSearchInputRef",ref:Y,"onUpdate:modelValue":ne[1]||(ne[1]=Pe=>ee.value=Pe),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:He},null,544),[[Vn,ee.value]]),ee.value.length>0?(b(),C("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:ln},[Ae(Ri,{class:"sidebar-search-clear-icon"})])):ue("",!0)])):ue("",!0),j.value?ue("",!0):(b(),C("button",{key:2,class:ht(["sidebar-skills-link",{"is-active":V.value}]),type:"button",onClick:ne[2]||(ne[2]=Pe=>{De(X).push({name:"skills"}),De(ge)&&Ct(!0)})}," Skills Hub ",2)),j.value?ue("",!0):(b(),mt(Hm,{key:3,groups:De(r),"project-display-name-by-id":De(s),"selected-thread-id":De(d),"is-loading":De(I),"search-query":ee.value,"search-matched-thread-ids":K.value,onSelect:p,onArchive:T,onStartNewThread:S,onRenameProject:ae,onBrowseProjectFiles:L,onRenameThread:Ee,onRemoveProject:be,onReorderProject:ze},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),j.value?ue("",!0):(b(),C("div",G0,[Ae($c,{name:"settings-panel"},{default:dt(()=>[Ce.value?(b(),C("div",z0,[m("button",{class:"sidebar-settings-row",type:"button",onClick:kt},[ne[7]||(ne[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:ht(["sidebar-settings-toggle",{"is-on":!je.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Qt},[ne[8]||(ne[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",Y0,he(Ge.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Er},[ne[9]||(ne[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",J0,he(Re.value==="system"?"System":Re.value==="dark"?"Dark":"Light"),1)])])):ue("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:ne[3]||(ne[3]=Pe=>Ce.value=!Ce.value)},[Ae(v0,{class:"sidebar-settings-icon"}),ne[10]||(ne[10]=m("span",null,"Settings",-1))])]))])]),content:dt(()=>[m("section",Q0,[Ae(Gm,{title:Q.value},{leading:dt(()=>[j.value||De(ge)?(b(),mt(il,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":De(O),"auto-refresh-button-label":Je.value,"show-new-thread-button":!0,onToggleSidebar:ne[4]||(ne[4]=Pe=>Ct(!j.value)),onToggleAutoRefresh:Pt,onStartNewThread:oe},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ue("",!0)]),_:1},8,["title"]),m("section",X0,[V.value?(b(),mt(Qb,{key:0,onSkillsChanged:mn})):H.value?(b(),C("div",Z0,[m("div",e_,[ne[11]||(ne[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ae(ri,{class:"new-thread-folder-dropdown","model-value":w.value,options:xt.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":le.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Gn,onAdd:Vr},null,8,["model-value","options","default-add-value"]),Ae(tb,{class:"new-thread-runtime-dropdown",modelValue:E.value,"onUpdate:modelValue":ne[5]||(ne[5]=Pe=>E.value=Pe)},null,8,["modelValue"]),F.value.phase!=="idle"?(b(),C("div",{key:0,class:ht(["worktree-init-status",{"is-running":F.value.phase==="running","is-error":F.value.phase==="error"}])},[m("strong",t_,he(F.value.title),1),m("span",n_,he(F.value.message),1)],2)):ue("",!0)]),Ae(sl,{"active-thread-id":jt.value,cwd:Yt.value,models:De(u),"selected-model":De(f),"selected-reasoning-effort":De(g),skills:De(_),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":je.value,"in-progress-submit-mode":Ge.value,onSubmit:ir,"onUpdate:selectedModel":Yn,"onUpdate:selectedReasoningEffort":Cr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(b(),C("div",r_,[m("div",s_,[Ae(xv,{messages:qe.value,"is-loading":De(U),"active-thread-id":jt.value,cwd:Yt.value,"scroll-state":De(i),"live-overlay":Qe.value,"pending-requests":De(a),"is-turn-in-progress":nn.value,"is-rolling-back":De(Fe),onUpdateScrollState:it,onRespondServerRequest:wt,onRollback:A},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",o_,[Ae(Gw,{messages:De(Ye),onSteer:De(Te),onDelete:De($e)},null,8,["messages","onSteer","onDelete"]),Ae(sl,{"active-thread-id":jt.value,cwd:Yt.value,models:De(u),"selected-model":De(f),"selected-reasoning-effort":De(g),skills:De(_),"is-turn-in-progress":nn.value,"is-interrupting-turn":De(J),"has-queue-above":De(Ye).length>0,"send-with-enter":je.value,"in-progress-submit-mode":Ge.value,onSubmit:ir,"onUpdate:selectedModel":Yn,"onUpdate:selectedReasoningEffort":Cr,onInterrupt:k},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",i_," WT "+he(De(t))+" · v"+he(De(n)),1)],64))}}),l_=tt(a_,[["__scopeId","data-v-8f56bd79"]]),jo={render:()=>null},c_=Gh({history:xh(),routes:[{path:"/",name:"home",component:jo},{path:"/thread/:threadId",name:"thread",component:jo},{path:"/skills",name:"skills",component:jo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Lf(l_).use(c_).mount("#app");
|