codexui-android 0.1.72 → 0.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/ReviewPane-C5squOEL.js +2 -0
  3. package/dist/assets/ReviewPane-C5squOEL.js.map +1 -0
  4. package/dist/assets/{SkillsHub-BkLIHbuN.js → SkillsHub-Crvp1wow.js} +2 -1
  5. package/dist/assets/SkillsHub-Crvp1wow.js.map +1 -0
  6. package/dist/assets/ThreadConversation-BsN7bN3q.css +1 -0
  7. package/dist/assets/ThreadConversation-qnvp4E2o.js +40 -0
  8. package/dist/assets/ThreadConversation-qnvp4E2o.js.map +1 -0
  9. package/dist/assets/common-BeuopZEI.js +1 -0
  10. package/dist/assets/common-BeuopZEI.js.map +1 -0
  11. package/dist/assets/index-C4y0SuPN.js +559 -0
  12. package/dist/assets/index-C4y0SuPN.js.map +1 -0
  13. package/dist/assets/index-CsHtQi-g.css +1 -0
  14. package/dist/assets/index.esm-BilMXo9u.js +1 -0
  15. package/dist/assets/index.esm-BilMXo9u.js.map +1 -0
  16. package/dist/assets/index.esm-DtVW_dfU.js +1 -0
  17. package/dist/assets/index.esm-DtVW_dfU.js.map +1 -0
  18. package/dist/assets/index.esm-mbv_PYjX.js +1 -0
  19. package/dist/assets/index.esm-mbv_PYjX.js.map +1 -0
  20. package/dist/index.html +2 -2
  21. package/dist-cli/chunk-NWKUDLO2.js +111 -0
  22. package/dist-cli/chunk-NWKUDLO2.js.map +1 -0
  23. package/dist-cli/index.js +2170 -868
  24. package/dist-cli/index.js.map +1 -1
  25. package/dist-cli/instrument.js +8 -0
  26. package/dist-cli/instrument.js.map +1 -0
  27. package/package.json +9 -4
  28. package/dist/assets/ReviewPane-jxaR-1Q1.js +0 -1
  29. package/dist/assets/ThreadConversation-1LJi-Pk9.js +0 -36
  30. package/dist/assets/ThreadConversation-Ct-Pc8bX.css +0 -1
  31. package/dist/assets/index-1Zt4k_jO.css +0 -1
  32. package/dist/assets/index-Tdn545FN.js +0 -62
@@ -1,62 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-1LJi-Pk9.js","assets/ThreadConversation-Ct-Pc8bX.css","assets/ReviewPane-jxaR-1Q1.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-BkLIHbuN.js","assets/SkillsHub-Bg1Le103.css"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/**
3
- * @vue/shared v3.5.32
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function Sl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const xt={},jo=[],kr=()=>{},Xc=()=>!1,Ea=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ia=e=>e.startsWith("onUpdate:"),Xt=Object.assign,xl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},wh=Object.prototype.hasOwnProperty,gt=(e,t)=>wh.call(e,t),Be=Array.isArray,Fo=e=>Ps(e)==="[object Map]",Yo=e=>Ps(e)==="[object Set]",ru=e=>Ps(e)==="[object Date]",Ge=e=>typeof e=="function",Pt=e=>typeof e=="string",dr=e=>typeof e=="symbol",vt=e=>e!==null&&typeof e=="object",Zc=e=>(vt(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),ed=Object.prototype.toString,Ps=e=>ed.call(e),yh=e=>Ps(e).slice(8,-1),td=e=>Ps(e)==="[object Object]",kl=e=>Pt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ps=Sl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ma=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},bh=/-\w/g,On=Ma(e=>e.replace(bh,t=>t.slice(1).toUpperCase())),Th=/\B([A-Z])/g,ao=Ma(e=>e.replace(Th,"-$1").toLowerCase()),Ra=Ma(e=>e.charAt(0).toUpperCase()+e.slice(1)),vi=Ma(e=>e?`on${Ra(e)}`:""),Sr=(e,t)=>!Object.is(e,t),ha=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},nd=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Pa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},_h=e=>{const t=Pt(e)?Number(e):NaN;return isNaN(t)?e:t};let ou;const $a=()=>ou||(ou=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Nr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Pt(r)?Ch(r):Nr(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Pt(e)||vt(e))return e}const Sh=/;(?![^(]*\))/g,xh=/:([^]+)/,kh=/\/\*[^]*?\*\//g;function Ch(e){const t={};return e.replace(kh,"").split(Sh).forEach(n=>{if(n){const r=n.split(xh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function tt(e){let t="";if(Pt(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=tt(e[n]);r&&(t+=r+" ")}else if(vt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ah="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Eh=Sl(Ah);function rd(e){return!!e||e===""}function Ih(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Jo(e[r],t[r]);return n}function Jo(e,t){if(e===t)return!0;let n=ru(e),r=ru(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=dr(e),r=dr(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?Ih(e,t):!1;if(n=vt(e),r=vt(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,s=Object.keys(t).length;if(o!==s)return!1;for(const a in e){const i=e.hasOwnProperty(a),u=t.hasOwnProperty(a);if(i&&!u||!i&&u||!Jo(e[a],t[a]))return!1}}return String(e)===String(t)}function Cl(e,t){return e.findIndex(n=>Jo(n,t))}const od=e=>!!(e&&e.__v_isRef===!0),ce=e=>Pt(e)?e:e==null?"":Be(e)||vt(e)&&(e.toString===ed||!Ge(e.toString))?od(e)?ce(e.value):JSON.stringify(e,sd,2):String(e),sd=(e,t)=>od(t)?sd(e,t.value):Fo(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[wi(r,s)+" =>"]=o,n),{})}:Yo(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>wi(n))}:dr(t)?wi(t):vt(t)&&!Be(t)&&!td(t)?String(t):t,wi=(e,t="")=>{var n;return dr(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
7
- * @vue/reactivity v3.5.32
8
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
- * @license MIT
10
- **/let qn;class Mh{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=qn,!t&&qn&&(this.index=(qn.scopes||(qn.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=qn;try{return qn=this,t()}finally{qn=n}}}on(){++this._on===1&&(this.prevScope=qn,qn=this)}off(){this._on>0&&--this._on===0&&(qn=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 o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Rh(){return qn}let At;const yi=new WeakSet;class ad{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,qn&&qn.active&&qn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yi.has(this)&&(yi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ld(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,su(this),ud(this);const t=At,n=ur;At=this,ur=!0;try{return this.fn()}finally{cd(this),At=t,ur=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Il(t);this.deps=this.depsTail=void 0,su(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Qi(this)&&this.run()}get dirty(){return Qi(this)}}let id=0,ms,gs;function ld(e,t=!1){if(e.flags|=8,t){e.next=gs,gs=e;return}e.next=ms,ms=e}function Al(){id++}function El(){if(--id>0)return;if(gs){let t=gs;for(gs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ms;){let t=ms;for(ms=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 ud(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function cd(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Il(r),Ph(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Qi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(dd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function dd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ss)||(e.globalVersion=Ss,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Qi(e))))return;e.flags|=2;const t=e.dep,n=At,r=ur;At=e,ur=!0;try{ud(e);const o=e.fn(e._value);(t.version===0||Sr(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{At=n,ur=r,cd(e),e.flags&=-3}}function Il(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Il(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ph(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ur=!0;const fd=[];function Br(){fd.push(ur),ur=!1}function qr(){const e=fd.pop();ur=e===void 0?!0:e}function su(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=At;At=void 0;try{t()}finally{At=n}}}let Ss=0;class $h{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 Ml{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(!At||!ur||At===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==At)n=this.activeLink=new $h(At,this),At.deps?(n.prevDep=At.depsTail,At.depsTail.nextDep=n,At.depsTail=n):At.deps=At.depsTail=n,hd(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=At.depsTail,n.nextDep=void 0,At.depsTail.nextDep=n,At.depsTail=n,At.deps===n&&(At.deps=r)}return n}trigger(t){this.version++,Ss++,this.notify(t)}notify(t){Al();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{El()}}}function hd(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)hd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Xi=new WeakMap,To=Symbol(""),Zi=Symbol(""),xs=Symbol("");function yn(e,t,n){if(ur&&At){let r=Xi.get(e);r||Xi.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Ml),o.map=r,o.key=n),o.track()}}function Dr(e,t,n,r,o,s){const a=Xi.get(e);if(!a){Ss++;return}const i=u=>{u&&u.trigger()};if(Al(),t==="clear")a.forEach(i);else{const u=Be(e),f=u&&kl(n);if(u&&n==="length"){const d=Number(r);a.forEach((m,v)=>{(v==="length"||v===xs||!dr(v)&&v>=d)&&i(m)})}else switch((n!==void 0||a.has(void 0))&&i(a.get(n)),f&&i(a.get(xs)),t){case"add":u?f&&i(a.get("length")):(i(a.get(To)),Fo(e)&&i(a.get(Zi)));break;case"delete":u||(i(a.get(To)),Fo(e)&&i(a.get(Zi)));break;case"set":Fo(e)&&i(a.get(To));break}}El()}function Io(e){const t=ft(e);return t===e?t:(yn(t,"iterate",xs),or(e)?t:t.map(fr))}function Oa(e){return yn(e=ft(e),"iterate",xs),e}function Tr(e,t){return Ur(e)?Wo(_o(e)?fr(t):t):fr(t)}const Oh={__proto__:null,[Symbol.iterator](){return bi(this,Symbol.iterator,e=>Tr(this,e))},concat(...e){return Io(this).concat(...e.map(t=>Be(t)?Io(t):t))},entries(){return bi(this,"entries",e=>(e[1]=Tr(this,e[1]),e))},every(e,t){return Mr(this,"every",e,t,void 0,arguments)},filter(e,t){return Mr(this,"filter",e,t,n=>n.map(r=>Tr(this,r)),arguments)},find(e,t){return Mr(this,"find",e,t,n=>Tr(this,n),arguments)},findIndex(e,t){return Mr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Mr(this,"findLast",e,t,n=>Tr(this,n),arguments)},findLastIndex(e,t){return Mr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Mr(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ti(this,"includes",e)},indexOf(...e){return Ti(this,"indexOf",e)},join(e){return Io(this).join(e)},lastIndexOf(...e){return Ti(this,"lastIndexOf",e)},map(e,t){return Mr(this,"map",e,t,void 0,arguments)},pop(){return as(this,"pop")},push(...e){return as(this,"push",e)},reduce(e,...t){return au(this,"reduce",e,t)},reduceRight(e,...t){return au(this,"reduceRight",e,t)},shift(){return as(this,"shift")},some(e,t){return Mr(this,"some",e,t,void 0,arguments)},splice(...e){return as(this,"splice",e)},toReversed(){return Io(this).toReversed()},toSorted(e){return Io(this).toSorted(e)},toSpliced(...e){return Io(this).toSpliced(...e)},unshift(...e){return as(this,"unshift",e)},values(){return bi(this,"values",e=>Tr(this,e))}};function bi(e,t,n){const r=Oa(e),o=r[t]();return r!==e&&!or(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Dh=Array.prototype;function Mr(e,t,n,r,o,s){const a=Oa(e),i=a!==e&&!or(e),u=a[t];if(u!==Dh[t]){const m=u.apply(e,s);return i?fr(m):m}let f=n;a!==e&&(i?f=function(m,v){return n.call(this,Tr(e,m),v,e)}:n.length>2&&(f=function(m,v){return n.call(this,m,v,e)}));const d=u.call(a,f,r);return i&&o?o(d):d}function au(e,t,n,r){const o=Oa(e),s=o!==e&&!or(e);let a=n,i=!1;o!==e&&(s?(i=r.length===0,a=function(f,d,m){return i&&(i=!1,f=Tr(e,f)),n.call(this,f,Tr(e,d),m,e)}):n.length>3&&(a=function(f,d,m){return n.call(this,f,d,m,e)}));const u=o[t](a,...r);return i?Tr(e,u):u}function Ti(e,t,n){const r=ft(e);yn(r,"iterate",xs);const o=r[t](...n);return(o===-1||o===!1)&&$l(n[0])?(n[0]=ft(n[0]),r[t](...n)):o}function as(e,t,n=[]){Br(),Al();const r=ft(e)[t].apply(e,n);return El(),qr(),r}const Lh=Sl("__proto__,__v_isRef,__isVue"),pd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(dr));function Nh(e){dr(e)||(e=String(e));const t=ft(this);return yn(t,"has",e),t.hasOwnProperty(e)}class md{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?Gh:yd:s?wd:vd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=Be(t);if(!o){let u;if(a&&(u=Oh[n]))return u;if(n==="hasOwnProperty")return Nh}const i=Reflect.get(t,n,Tn(t)?t:r);if((dr(n)?pd.has(n):Lh(n))||(o||yn(t,"get",n),s))return i;if(Tn(i)){const u=a&&kl(n)?i:i.value;return o&&vt(u)?tl(u):u}return vt(i)?o?tl(i):Da(i):i}}class gd extends md{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const a=Be(t)&&kl(n);if(!this._isShallow){const f=Ur(s);if(!or(r)&&!Ur(r)&&(s=ft(s),r=ft(r)),!a&&Tn(s)&&!Tn(r))return f||(s.value=r),!0}const i=a?Number(n)<t.length:gt(t,n),u=Reflect.set(t,n,r,Tn(t)?t:o);return t===ft(o)&&(i?Sr(r,s)&&Dr(t,"set",n,r):Dr(t,"add",n,r)),u}deleteProperty(t,n){const r=gt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&Dr(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!dr(n)||!pd.has(n))&&yn(t,"has",n),r}ownKeys(t){return yn(t,"iterate",Be(t)?"length":To),Reflect.ownKeys(t)}}class jh extends md{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Fh=new gd,Bh=new jh,qh=new gd(!0);const el=e=>e,oa=e=>Reflect.getPrototypeOf(e);function Uh(e,t,n){return function(...r){const o=this.__v_raw,s=ft(o),a=Fo(s),i=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,f=o[e](...r),d=n?el:t?Wo:fr;return!t&&yn(s,"iterate",u?Zi:To),Xt(Object.create(f),{next(){const{value:m,done:v}=f.next();return v?{value:m,done:v}:{value:i?[d(m[0]),d(m[1])]:d(m),done:v}}})}}function sa(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hh(e,t){const n={get(o){const s=this.__v_raw,a=ft(s),i=ft(o);e||(Sr(o,i)&&yn(a,"get",o),yn(a,"get",i));const{has:u}=oa(a),f=t?el:e?Wo:fr;if(u.call(a,o))return f(s.get(o));if(u.call(a,i))return f(s.get(i));s!==a&&s.get(o)},get size(){const o=this.__v_raw;return!e&&yn(ft(o),"iterate",To),o.size},has(o){const s=this.__v_raw,a=ft(s),i=ft(o);return e||(Sr(o,i)&&yn(a,"has",o),yn(a,"has",i)),o===i?s.has(o):s.has(o)||s.has(i)},forEach(o,s){const a=this,i=a.__v_raw,u=ft(i),f=t?el:e?Wo:fr;return!e&&yn(u,"iterate",To),i.forEach((d,m)=>o.call(s,f(d),f(m),a))}};return Xt(n,e?{add:sa("add"),set:sa("set"),delete:sa("delete"),clear:sa("clear")}:{add(o){const s=ft(this),a=oa(s),i=ft(o),u=!t&&!or(o)&&!Ur(o)?i:o;return a.has.call(s,u)||Sr(o,u)&&a.has.call(s,o)||Sr(i,u)&&a.has.call(s,i)||(s.add(u),Dr(s,"add",u,u)),this},set(o,s){!t&&!or(s)&&!Ur(s)&&(s=ft(s));const a=ft(this),{has:i,get:u}=oa(a);let f=i.call(a,o);f||(o=ft(o),f=i.call(a,o));const d=u.call(a,o);return a.set(o,s),f?Sr(s,d)&&Dr(a,"set",o,s):Dr(a,"add",o,s),this},delete(o){const s=ft(this),{has:a,get:i}=oa(s);let u=a.call(s,o);u||(o=ft(o),u=a.call(s,o)),i&&i.call(s,o);const f=s.delete(o);return u&&Dr(s,"delete",o,void 0),f},clear(){const o=ft(this),s=o.size!==0,a=o.clear();return s&&Dr(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Uh(o,e,t)}),n}function Rl(e,t){const n=Hh(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(gt(n,o)&&o in r?n:r,o,s)}const Wh={get:Rl(!1,!1)},Vh={get:Rl(!1,!0)},zh={get:Rl(!0,!1)};const vd=new WeakMap,wd=new WeakMap,yd=new WeakMap,Gh=new WeakMap;function Kh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yh(e){return e.__v_skip||!Object.isExtensible(e)?0:Kh(yh(e))}function Da(e){return Ur(e)?e:Pl(e,!1,Fh,Wh,vd)}function bd(e){return Pl(e,!1,qh,Vh,wd)}function tl(e){return Pl(e,!0,Bh,zh,yd)}function Pl(e,t,n,r,o){if(!vt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Yh(e);if(s===0)return e;const a=o.get(e);if(a)return a;const i=new Proxy(e,s===2?r:n);return o.set(e,i),i}function _o(e){return Ur(e)?_o(e.__v_raw):!!(e&&e.__v_isReactive)}function Ur(e){return!!(e&&e.__v_isReadonly)}function or(e){return!!(e&&e.__v_isShallow)}function $l(e){return e?!!e.__v_raw:!1}function ft(e){const t=e&&e.__v_raw;return t?ft(t):e}function Jh(e){return!gt(e,"__v_skip")&&Object.isExtensible(e)&&nd(e,"__v_skip",!0),e}const fr=e=>vt(e)?Da(e):e,Wo=e=>vt(e)?tl(e):e;function Tn(e){return e?e.__v_isRef===!0:!1}function R(e){return Td(e,!1)}function Qh(e){return Td(e,!0)}function Td(e,t){return Tn(e)?e:new Xh(e,t)}class Xh{constructor(t,n){this.dep=new Ml,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ft(t),this._value=n?t:fr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||or(t)||Ur(t);t=r?t:ft(t),Sr(t,n)&&(this._rawValue=t,this._value=r?t:fr(t),this.dep.trigger())}}function $e(e){return Tn(e)?e.value:e}const Zh={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Tn(o)&&!Tn(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function _d(e){return _o(e)?e:new Proxy(e,Zh)}class ep{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ml(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ss-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&At!==this)return ld(this,!0),!0}get value(){const t=this.dep.track();return dd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function tp(e,t,n=!1){let r,o;return Ge(e)?r=e:(r=e.get,o=e.set),new ep(r,o,n)}const aa={},ya=new WeakMap;let go;function np(e,t=!1,n=go){if(n){let r=ya.get(n);r||ya.set(n,r=[]),r.push(e)}}function rp(e,t,n=xt){const{immediate:r,deep:o,once:s,scheduler:a,augmentJob:i,call:u}=n,f=W=>o?W:or(W)||o===!1||o===0?Lr(W,1):Lr(W);let d,m,v,S,j=!1,N=!1;if(Tn(e)?(m=()=>e.value,j=or(e)):_o(e)?(m=()=>f(e),j=!0):Be(e)?(N=!0,j=e.some(W=>_o(W)||or(W)),m=()=>e.map(W=>{if(Tn(W))return W.value;if(_o(W))return f(W);if(Ge(W))return u?u(W,2):W()})):Ge(e)?t?m=u?()=>u(e,2):e:m=()=>{if(v){Br();try{v()}finally{qr()}}const W=go;go=d;try{return u?u(e,3,[S]):e(S)}finally{go=W}}:m=kr,t&&o){const W=m,ae=o===!0?1/0:o;m=()=>Lr(W(),ae)}const X=Rh(),M=()=>{d.stop(),X&&X.active&&xl(X.effects,d)};if(s&&t){const W=t;t=(...ae)=>{W(...ae),M()}}let L=N?new Array(e.length).fill(aa):aa;const q=W=>{if(!(!(d.flags&1)||!d.dirty&&!W))if(t){const ae=d.run();if(o||j||(N?ae.some((Y,le)=>Sr(Y,L[le])):Sr(ae,L))){v&&v();const Y=go;go=d;try{const le=[ae,L===aa?void 0:N&&L[0]===aa?[]:L,S];L=ae,u?u(t,3,le):t(...le)}finally{go=Y}}}else d.run()};return i&&i(q),d=new ad(m),d.scheduler=a?()=>a(q,!1):q,S=W=>np(W,!1,d),v=d.onStop=()=>{const W=ya.get(d);if(W){if(u)u(W,4);else for(const ae of W)ae();ya.delete(d)}},t?r?q(!0):L=d.run():a?a(q.bind(null,!0),!0):d.run(),M.pause=d.pause.bind(d),M.resume=d.resume.bind(d),M.stop=M,M}function Lr(e,t=1/0,n){if(t<=0||!vt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Tn(e))Lr(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)Lr(e[r],t,n);else if(Yo(e)||Fo(e))e.forEach(r=>{Lr(r,t,n)});else if(td(e)){for(const r in e)Lr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Lr(e[r],t,n)}return e}/**
11
- * @vue/runtime-core v3.5.32
12
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
- * @license MIT
14
- **/function $s(e,t,n,r){try{return r?e(...r):e()}catch(o){Os(o,t,n)}}function hr(e,t,n,r){if(Ge(e)){const o=$s(e,t,n,r);return o&&Zc(o)&&o.catch(s=>{Os(s,t,n)}),o}if(Be(e)){const o=[];for(let s=0;s<e.length;s++)o.push(hr(e[s],t,n,r));return o}}function Os(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||xt;if(t){let i=t.parent;const u=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const d=i.ec;if(d){for(let m=0;m<d.length;m++)if(d[m](e,u,f)===!1)return}i=i.parent}if(s){Br(),$s(s,null,10,[e,u,f]),qr();return}}op(e,n,o,r,a)}function op(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const $n=[];let wr=-1;const Bo=[];let no=null,$o=0;const Sd=Promise.resolve();let ba=null;function Bt(e){const t=ba||Sd;return e?t.then(this?e.bind(this):e):t}function sp(e){let t=wr+1,n=$n.length;for(;t<n;){const r=t+n>>>1,o=$n[r],s=ks(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Ol(e){if(!(e.flags&1)){const t=ks(e),n=$n[$n.length-1];!n||!(e.flags&2)&&t>=ks(n)?$n.push(e):$n.splice(sp(t),0,e),e.flags|=1,xd()}}function xd(){ba||(ba=Sd.then(Cd))}function ap(e){Be(e)?Bo.push(...e):no&&e.id===-1?no.splice($o+1,0,e):e.flags&1||(Bo.push(e),e.flags|=1),xd()}function iu(e,t,n=wr+1){for(;n<$n.length;n++){const r=$n[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;$n.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function kd(e){if(Bo.length){const t=[...new Set(Bo)].sort((n,r)=>ks(n)-ks(r));if(Bo.length=0,no){no.push(...t);return}for(no=t,$o=0;$o<no.length;$o++){const n=no[$o];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}no=null,$o=0}}const ks=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Cd(e){try{for(wr=0;wr<$n.length;wr++){const t=$n[wr];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),$s(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;wr<$n.length;wr++){const t=$n[wr];t&&(t.flags&=-2)}wr=-1,$n.length=0,kd(),ba=null,($n.length||Bo.length)&&Cd()}}let cn=null,Ad=null;function Ta(e){const t=cn;return cn=e,Ad=e&&e.type.__scopeId||null,t}function pt(e,t=cn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&xa(-1);const s=Ta(t);let a;try{a=e(...o)}finally{Ta(s),r._d&&xa(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function lr(e,t){if(cn===null)return e;const n=Ba(cn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,a,i,u=xt]=t[o];s&&(Ge(s)&&(s={mounted:s,updated:s}),s.deep&&Lr(a),r.push({dir:s,instance:n,value:a,oldValue:void 0,arg:i,modifiers:u}))}return e}function uo(e,t,n,r){const o=e.dirs,s=t&&t.dirs;for(let a=0;a<o.length;a++){const i=o[a];s&&(i.oldValue=s[a].value);let u=i.dir[r];u&&(Br(),hr(u,n,8,[e.el,i,e,t]),qr())}}function pa(e,t){if(un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function cr(e,t,n=!1){const r=ql();if(r||Uo){let o=Uo?Uo._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Ge(t)?t.call(r&&r.proxy):t}}const ip=Symbol.for("v-scx"),lp=()=>cr(ip);function rt(e,t,n){return Ed(e,t,n)}function Ed(e,t,n=xt){const{immediate:r,deep:o,flush:s,once:a}=n,i=Xt({},n),u=t&&r||!t&&s!=="post";let f;if(Vo){if(s==="sync"){const S=lp();f=S.__watcherHandles||(S.__watcherHandles=[])}else if(!u){const S=()=>{};return S.stop=kr,S.resume=kr,S.pause=kr,S}}const d=un;i.call=(S,j,N)=>hr(S,d,j,N);let m=!1;s==="post"?i.scheduler=S=>{Rn(S,d&&d.suspense)}:s!=="sync"&&(m=!0,i.scheduler=(S,j)=>{j?S():Ol(S)}),i.augmentJob=S=>{t&&(S.flags|=4),m&&(S.flags|=2,d&&(S.id=d.uid,S.i=d))};const v=rp(e,t,i);return Vo&&(f?f.push(v):u&&v()),v}function up(e,t,n){const r=this.proxy,o=Pt(e)?e.includes(".")?Id(r,e):()=>r[e]:e.bind(r,r);let s;Ge(t)?s=t:(s=t.handler,n=t);const a=Ls(this),i=Ed(o,s.bind(r),n);return a(),i}function Id(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const co=new WeakMap,Md=Symbol("_vte"),Rd=e=>e.__isTeleport,vo=e=>e&&(e.disabled||e.disabled===""),cp=e=>e&&(e.defer||e.defer===""),lu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,uu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,nl=(e,t)=>{const n=e&&e.to;return Pt(n)?t?t(n):null:n},dp={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,a,i,u,f){const{mc:d,pc:m,pbc:v,o:{insert:S,querySelector:j,createText:N,createComment:X}}=f,M=vo(t.props);let{dynamicChildren:L}=t;const q=(Y,le,De)=>{Y.shapeFlag&16&&d(Y.children,le,De,o,s,a,i,u)},W=(Y=t)=>{const le=vo(Y.props),De=Y.target=nl(Y.props,j),ye=rl(De,Y,N,S);De&&(a!=="svg"&&lu(De)?a="svg":a!=="mathml"&&uu(De)&&(a="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(De),le||(q(Y,De,ye),ds(Y,!1)))},ae=Y=>{const le=()=>{co.get(Y)===le&&(co.delete(Y),vo(Y.props)&&(q(Y,n,Y.anchor),ds(Y,!0)),W(Y))};co.set(Y,le),Rn(le,s)};if(e==null){const Y=t.el=N(""),le=t.anchor=N("");if(S(Y,n,r),S(le,n,r),cp(t.props)||s&&s.pendingBranch){ae(t);return}M&&(q(t,n,le),ds(t,!0)),W()}else{t.el=e.el;const Y=t.anchor=e.anchor,le=co.get(e);if(le){le.flags|=8,co.delete(e),ae(t);return}t.targetStart=e.targetStart;const De=t.target=e.target,ye=t.targetAnchor=e.targetAnchor,be=vo(e.props),de=be?n:De,V=be?Y:ye;if(a==="svg"||lu(De)?a="svg":(a==="mathml"||uu(De))&&(a="mathml"),L?(v(e.dynamicChildren,L,de,o,s,a,i),Fl(e,t,!0)):u||m(e,t,de,V,o,s,a,i,!1),M)be?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ia(t,n,Y,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ie=t.target=nl(t.props,j);ie&&ia(t,ie,null,f,0)}else be&&ia(t,De,ye,f,1);ds(t,M)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:a,children:i,anchor:u,targetStart:f,targetAnchor:d,target:m,props:v}=e;let S=s||!vo(v);const j=co.get(e);if(j&&(j.flags|=8,co.delete(e),S=!1),m&&(o(f),o(d)),s&&o(u),a&16)for(let N=0;N<i.length;N++){const X=i[N];r(X,t,n,S,!!X.dynamicChildren)}},move:ia,hydrate:fp};function ia(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:a,anchor:i,shapeFlag:u,children:f,props:d}=e,m=s===2;if(m&&r(a,t,n),(!m||vo(d))&&u&16)for(let v=0;v<f.length;v++)o(f[v],t,n,2);m&&r(i,t,n)}function fp(e,t,n,r,o,s,{o:{nextSibling:a,parentNode:i,querySelector:u,insert:f,createText:d}},m){function v(X,M){let L=M;for(;L;){if(L&&L.nodeType===8){if(L.data==="teleport start anchor")t.targetStart=L;else if(L.data==="teleport anchor"){t.targetAnchor=L,X._lpa=t.targetAnchor&&a(t.targetAnchor);break}}L=a(L)}}function S(X,M){M.anchor=m(a(X),M,i(X),n,r,o,s)}const j=t.target=nl(t.props,u),N=vo(t.props);if(j){const X=j._lpa||j.firstChild;t.shapeFlag&16&&(N?(S(e,t),v(j,X),t.targetAnchor||rl(j,t,d,f,i(e)===j?e:null)):(t.anchor=a(e),v(j,X),t.targetAnchor||rl(j,t,d,f),m(X&&a(X),t,j,n,r,o,s))),ds(t,N)}else N&&t.shapeFlag&16&&(S(e,t),t.targetStart=e,t.targetAnchor=a(e));return t.anchor&&a(t.anchor)}const ma=dp;function ds(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function rl(e,t,n,r,o=null){const s=t.targetStart=n(""),a=t.targetAnchor=n("");return s[Md]=a,e&&(r(s,e,o),r(a,e,o)),a}const br=Symbol("_leaveCb"),is=Symbol("_enterCb");function hp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return So(()=>{e.isMounted=!0}),xo(()=>{e.isUnmounting=!0}),e}const nr=[Function,Array],Pd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nr,onEnter:nr,onAfterEnter:nr,onEnterCancelled:nr,onBeforeLeave:nr,onLeave:nr,onAfterLeave:nr,onLeaveCancelled:nr,onBeforeAppear:nr,onAppear:nr,onAfterAppear:nr,onAppearCancelled:nr},$d=e=>{const t=e.subTree;return t.component?$d(t.component):t},pp={name:"BaseTransition",props:Pd,setup(e,{slots:t}){const n=ql(),r=hp();return()=>{const o=t.default&&Ld(t.default(),!0);if(!o||!o.length)return;const s=Od(o),a=ft(e),{mode:i}=a;if(r.isLeaving)return _i(s);const u=cu(s);if(!u)return _i(s);let f=ol(u,a,r,n,m=>f=m);u.type!==bn&&Cs(u,f);let d=n.subTree&&cu(n.subTree);if(d&&d.type!==bn&&!wo(d,u)&&$d(n).type!==bn){let m=ol(d,a,r,n);if(Cs(d,m),i==="out-in"&&u.type!==bn)return r.isLeaving=!0,m.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete m.afterLeave,d=void 0},_i(s);i==="in-out"&&u.type!==bn?m.delayLeave=(v,S,j)=>{const N=Dd(r,d);N[String(d.key)]=d,v[br]=()=>{S(),v[br]=void 0,delete f.delayedLeave,d=void 0},f.delayedLeave=()=>{j(),delete f.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function Od(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==bn){t=n;break}}return t}const mp=pp;function Dd(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 ol(e,t,n,r,o){const{appear:s,mode:a,persisted:i=!1,onBeforeEnter:u,onEnter:f,onAfterEnter:d,onEnterCancelled:m,onBeforeLeave:v,onLeave:S,onAfterLeave:j,onLeaveCancelled:N,onBeforeAppear:X,onAppear:M,onAfterAppear:L,onAppearCancelled:q}=t,W=String(e.key),ae=Dd(n,e),Y=(ye,be)=>{ye&&hr(ye,r,9,be)},le=(ye,be)=>{const de=be[1];Y(ye,be),Be(ye)?ye.every(V=>V.length<=1)&&de():ye.length<=1&&de()},De={mode:a,persisted:i,beforeEnter(ye){let be=u;if(!n.isMounted)if(s)be=X||u;else return;ye[br]&&ye[br](!0);const de=ae[W];de&&wo(e,de)&&de.el[br]&&de.el[br](),Y(be,[ye])},enter(ye){if(ae[W]===e)return;let be=f,de=d,V=m;if(!n.isMounted)if(s)be=M||f,de=L||d,V=q||m;else return;let ie=!1;ye[is]=Ce=>{ie||(ie=!0,Ce?Y(V,[ye]):Y(de,[ye]),De.delayedLeave&&De.delayedLeave(),ye[is]=void 0)};const Le=ye[is].bind(null,!1);be?le(be,[ye,Le]):Le()},leave(ye,be){const de=String(e.key);if(ye[is]&&ye[is](!0),n.isUnmounting)return be();Y(v,[ye]);let V=!1;ye[br]=Le=>{V||(V=!0,be(),Le?Y(N,[ye]):Y(j,[ye]),ye[br]=void 0,ae[de]===e&&delete ae[de])};const ie=ye[br].bind(null,!1);ae[de]=e,S?le(S,[ye,ie]):ie()},clone(ye){const be=ol(ye,t,n,r,o);return o&&o(be),be}};return De}function _i(e){if(Ds(e))return e=so(e),e.children=null,e}function cu(e){if(!Ds(e))return Rd(e.type)&&e.children?Od(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&&Ge(n.default))return n.default()}}function Cs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Cs(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 Ld(e,t=!1,n){let r=[],o=0;for(let s=0;s<e.length;s++){let a=e[s];const i=n==null?a.key:String(n)+String(a.key!=null?a.key:s);a.type===We?(a.patchFlag&128&&o++,r=r.concat(Ld(a.children,t,i))):(t||a.type!==bn)&&r.push(i!=null?so(a,{key:i}):a)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function dn(e,t){return Ge(e)?Xt({name:e.name},t,{setup:e}):e}function Dl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function du(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const _a=new WeakMap;function vs(e,t,n,r,o=!1){if(Be(e)){e.forEach((N,X)=>vs(N,t&&(Be(t)?t[X]:t),n,r,o));return}if(qo(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&vs(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Ba(r.component):r.el,a=o?null:s,{i,r:u}=e,f=t&&t.r,d=i.refs===xt?i.refs={}:i.refs,m=i.setupState,v=ft(m),S=m===xt?Xc:N=>du(d,N)?!1:gt(v,N),j=(N,X)=>!(X&&du(d,X));if(f!=null&&f!==u){if(fu(t),Pt(f))d[f]=null,S(f)&&(m[f]=null);else if(Tn(f)){const N=t;j(f,N.k)&&(f.value=null),N.k&&(d[N.k]=null)}}if(Ge(u))$s(u,i,12,[a,d]);else{const N=Pt(u),X=Tn(u);if(N||X){const M=()=>{if(e.f){const L=N?S(u)?m[u]:d[u]:j()||!e.k?u.value:d[e.k];if(o)Be(L)&&xl(L,s);else if(Be(L))L.includes(s)||L.push(s);else if(N)d[u]=[s],S(u)&&(m[u]=d[u]);else{const q=[s];j(u,e.k)&&(u.value=q),e.k&&(d[e.k]=q)}}else N?(d[u]=a,S(u)&&(m[u]=a)):X&&(j(u,e.k)&&(u.value=a),e.k&&(d[e.k]=a))};if(a){const L=()=>{M(),_a.delete(e)};L.id=-1,_a.set(e,L),Rn(L,n)}else fu(e),M()}}}function fu(e){const t=_a.get(e);t&&(t.flags|=8,_a.delete(e))}const hu=e=>e.nodeType===8;$a().requestIdleCallback;$a().cancelIdleCallback;function gp(e,t){if(hu(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(hu(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const qo=e=>!!e.type.__asyncLoader;function Si(e){Ge(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:a,suspensible:i=!0,onError:u}=e;let f=null,d,m=0;const v=()=>(m++,f=null,S()),S=()=>{let j;return f||(j=f=t().catch(N=>{if(N=N instanceof Error?N:new Error(String(N)),u)return new Promise((X,M)=>{u(N,()=>X(v()),()=>M(N),m+1)});throw N}).then(N=>j!==f&&f?f:(N&&(N.__esModule||N[Symbol.toStringTag]==="Module")&&(N=N.default),d=N,N)))};return dn({name:"AsyncComponentWrapper",__asyncLoader:S,__asyncHydrate(j,N,X){let M=!1;(N.bu||(N.bu=[])).push(()=>M=!0);const L=()=>{M||X()},q=s?()=>{const W=s(L,ae=>gp(j,ae));W&&(N.bum||(N.bum=[])).push(W)}:L;d?q():S().then(()=>!N.isUnmounted&&q())},get __asyncResolved(){return d},setup(){const j=un;if(Dl(j),d)return()=>la(d,j);const N=q=>{f=null,Os(q,j,13,!r)};if(i&&j.suspense||Vo)return S().then(q=>()=>la(q,j)).catch(q=>(N(q),()=>r?Ne(r,{error:q}):null));const X=R(!1),M=R(),L=R(!!o);return o&&setTimeout(()=>{L.value=!1},o),a!=null&&setTimeout(()=>{if(!X.value&&!M.value){const q=new Error(`Async component timed out after ${a}ms.`);N(q),M.value=q}},a),S().then(()=>{X.value=!0,j.parent&&Ds(j.parent.vnode)&&j.parent.update()}).catch(q=>{N(q),M.value=q}),()=>{if(X.value&&d)return la(d,j);if(M.value&&r)return Ne(r,{error:M.value});if(n&&!L.value)return la(n,j)}}})}function la(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,a=Ne(e,r,o);return a.ref=n,a.ce=s,delete t.vnode.ce,a}const Ds=e=>e.type.__isKeepAlive;function vp(e,t){Nd(e,"a",t)}function wp(e,t){Nd(e,"da",t)}function Nd(e,t,n=un){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(La(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Ds(o.parent.vnode)&&yp(r,t,n,o),o=o.parent}}function yp(e,t,n,r){const o=La(t,e,r,!0);Na(()=>{xl(r[t],o)},n)}function La(e,t,n=un,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...a)=>{Br();const i=Ls(n),u=hr(t,n,e,a);return i(),qr(),u});return r?o.unshift(s):o.push(s),s}}const Wr=e=>(t,n=un)=>{(!Vo||e==="sp")&&La(e,(...r)=>t(...r),n)},bp=Wr("bm"),So=Wr("m"),Tp=Wr("bu"),_p=Wr("u"),xo=Wr("bum"),Na=Wr("um"),Sp=Wr("sp"),xp=Wr("rtg"),kp=Wr("rtc");function Cp(e,t=un){La("ec",e,t)}const Ap="components",jd=Symbol.for("v-ndc");function Ll(e){return Pt(e)?Ep(Ap,e,!1)||e:e||jd}function Ep(e,t,n=!0,r=!1){const o=cn||un;if(o){const s=o.type;{const i=fm(s,!1);if(i&&(i===t||i===On(t)||i===Ra(On(t))))return s}const a=pu(o[e]||s[e],t)||pu(o.appContext[e],t);return!a&&r?s:a}}function pu(e,t){return e&&(e[t]||e[On(t)]||e[Ra(On(t))])}function Dt(e,t,n,r){let o;const s=n,a=Be(e);if(a||Pt(e)){const i=a&&_o(e);let u=!1,f=!1;i&&(u=!or(e),f=Ur(e),e=Oa(e)),o=new Array(e.length);for(let d=0,m=e.length;d<m;d++)o[d]=t(u?f?Wo(fr(e[d])):fr(e[d]):e[d],d,void 0,s)}else if(typeof e=="number"){o=new Array(e);for(let i=0;i<e;i++)o[i]=t(i+1,i,void 0,s)}else if(vt(e))if(e[Symbol.iterator])o=Array.from(e,(i,u)=>t(i,u,void 0,s));else{const i=Object.keys(e);o=new Array(i.length);for(let u=0,f=i.length;u<f;u++){const d=i[u];o[u]=t(e[d],d,u,s)}}else o=[];return o}function xr(e,t,n={},r,o){if(cn.ce||cn.parent&&qo(cn.parent)&&cn.parent.ce){const f=Object.keys(n).length>0;return t!=="default"&&(n.name=t),A(),it(We,null,[Ne("slot",n,r)],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),A();const a=s&&Fd(s(n)),i=n.key||a&&a.key,u=it(We,{key:(i&&!dr(i)?i:`_${t}`)+(!a&&r?"_fb":"")},a||[],a&&e._===1?64:-2);return s&&s._c&&(s._d=!0),u}function Fd(e){return e.some(t=>Es(t)?!(t.type===bn||t.type===We&&!Fd(t.children)):!0)?e:null}const sl=e=>e?sf(e)?Ba(e):sl(e.parent):null,ws=Xt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>sl(e.parent),$root:e=>sl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qd(e),$forceUpdate:e=>e.f||(e.f=()=>{Ol(e.update)}),$nextTick:e=>e.n||(e.n=Bt.bind(e.proxy)),$watch:e=>up.bind(e)}),xi=(e,t)=>e!==xt&&!e.__isScriptSetup&&gt(e,t),Ip={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:a,type:i,appContext:u}=e;if(t[0]!=="$"){const v=a[t];if(v!==void 0)switch(v){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(xi(r,t))return a[t]=1,r[t];if(o!==xt&&gt(o,t))return a[t]=2,o[t];if(gt(s,t))return a[t]=3,s[t];if(n!==xt&&gt(n,t))return a[t]=4,n[t];al&&(a[t]=0)}}const f=ws[t];let d,m;if(f)return t==="$attrs"&&yn(e.attrs,"get",""),f(e);if((d=i.__cssModules)&&(d=d[t]))return d;if(n!==xt&&gt(n,t))return a[t]=4,n[t];if(m=u.config.globalProperties,gt(m,t))return m[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return xi(o,t)?(o[t]=n,!0):r!==xt&&gt(r,t)?(r[t]=n,!0):gt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:s,type:a}},i){let u;return!!(n[i]||e!==xt&&i[0]!=="$"&&gt(e,i)||xi(t,i)||gt(s,i)||gt(r,i)||gt(ws,i)||gt(o.config.globalProperties,i)||(u=a.__cssModules)&&u[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:gt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Mp(){return Rp().slots}function Rp(e){const t=ql();return t.setupContext||(t.setupContext=lf(t))}function mu(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let al=!0;function Pp(e){const t=qd(e),n=e.proxy,r=e.ctx;al=!1,t.beforeCreate&&gu(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:a,watch:i,provide:u,inject:f,created:d,beforeMount:m,mounted:v,beforeUpdate:S,updated:j,activated:N,deactivated:X,beforeDestroy:M,beforeUnmount:L,destroyed:q,unmounted:W,render:ae,renderTracked:Y,renderTriggered:le,errorCaptured:De,serverPrefetch:ye,expose:be,inheritAttrs:de,components:V,directives:ie,filters:Le}=t;if(f&&$p(f,r,null),a)for(const Re in a){const _e=a[Re];Ge(_e)&&(r[Re]=_e.bind(n))}if(o){const Re=o.call(n,n);vt(Re)&&(e.data=Da(Re))}if(al=!0,s)for(const Re in s){const _e=s[Re],Fe=Ge(_e)?_e.bind(n,n):Ge(_e.get)?_e.get.bind(n,n):kr,Ve=!Ge(_e)&&Ge(_e.set)?_e.set.bind(n):kr,ee=te({get:Fe,set:Ve});Object.defineProperty(r,Re,{enumerable:!0,configurable:!0,get:()=>ee.value,set:oe=>ee.value=oe})}if(i)for(const Re in i)Bd(i[Re],r,n,Re);if(u){const Re=Ge(u)?u.call(n):u;Reflect.ownKeys(Re).forEach(_e=>{pa(_e,Re[_e])})}d&&gu(d,e,"c");function Se(Re,_e){Be(_e)?_e.forEach(Fe=>Re(Fe.bind(n))):_e&&Re(_e.bind(n))}if(Se(bp,m),Se(So,v),Se(Tp,S),Se(_p,j),Se(vp,N),Se(wp,X),Se(Cp,De),Se(kp,Y),Se(xp,le),Se(xo,L),Se(Na,W),Se(Sp,ye),Be(be))if(be.length){const Re=e.exposed||(e.exposed={});be.forEach(_e=>{Object.defineProperty(Re,_e,{get:()=>n[_e],set:Fe=>n[_e]=Fe,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===kr&&(e.render=ae),de!=null&&(e.inheritAttrs=de),V&&(e.components=V),ie&&(e.directives=ie),ye&&Dl(e)}function $p(e,t,n=kr){Be(e)&&(e=il(e));for(const r in e){const o=e[r];let s;vt(o)?"default"in o?s=cr(o.from||r,o.default,!0):s=cr(o.from||r):s=cr(o),Tn(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:a=>s.value=a}):t[r]=s}}function gu(e,t,n){hr(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Bd(e,t,n,r){let o=r.includes(".")?Id(n,r):()=>n[r];if(Pt(e)){const s=t[e];Ge(s)&&rt(o,s)}else if(Ge(e))rt(o,e.bind(n));else if(vt(e))if(Be(e))e.forEach(s=>Bd(s,t,n,r));else{const s=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(s)&&rt(o,s,e)}}function qd(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:a}}=e.appContext,i=s.get(t);let u;return i?u=i:!o.length&&!n&&!r?u=t:(u={},o.length&&o.forEach(f=>Sa(u,f,a,!0)),Sa(u,t,a)),vt(t)&&s.set(t,u),u}function Sa(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Sa(e,s,n,!0),o&&o.forEach(a=>Sa(e,a,n,!0));for(const a in t)if(!(r&&a==="expose")){const i=Op[a]||n&&n[a];e[a]=i?i(e[a],t[a]):t[a]}return e}const Op={data:vu,props:wu,emits:wu,methods:fs,computed:fs,beforeCreate:Mn,created:Mn,beforeMount:Mn,mounted:Mn,beforeUpdate:Mn,updated:Mn,beforeDestroy:Mn,beforeUnmount:Mn,destroyed:Mn,unmounted:Mn,activated:Mn,deactivated:Mn,errorCaptured:Mn,serverPrefetch:Mn,components:fs,directives:fs,watch:Lp,provide:vu,inject:Dp};function vu(e,t){return t?e?function(){return Xt(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function Dp(e,t){return fs(il(e),il(t))}function il(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Mn(e,t){return e?[...new Set([].concat(e,t))]:t}function fs(e,t){return e?Xt(Object.create(null),e,t):t}function wu(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:Xt(Object.create(null),mu(e),mu(t??{})):t}function Lp(e,t){if(!e)return t;if(!t)return e;const n=Xt(Object.create(null),e);for(const r in t)n[r]=Mn(e[r],t[r]);return n}function Ud(){return{app:null,config:{isNativeTag:Xc,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 Np=0;function jp(e,t){return function(r,o=null){Ge(r)||(r=Xt({},r)),o!=null&&!vt(o)&&(o=null);const s=Ud(),a=new WeakSet,i=[];let u=!1;const f=s.app={_uid:Np++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:pm,get config(){return s.config},set config(d){},use(d,...m){return a.has(d)||(d&&Ge(d.install)?(a.add(d),d.install(f,...m)):Ge(d)&&(a.add(d),d(f,...m))),f},mixin(d){return s.mixins.includes(d)||s.mixins.push(d),f},component(d,m){return m?(s.components[d]=m,f):s.components[d]},directive(d,m){return m?(s.directives[d]=m,f):s.directives[d]},mount(d,m,v){if(!u){const S=f._ceVNode||Ne(r,o);return S.appContext=s,v===!0?v="svg":v===!1&&(v=void 0),e(S,d,v),u=!0,f._container=d,d.__vue_app__=f,Ba(S.component)}},onUnmount(d){i.push(d)},unmount(){u&&(hr(i,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(d,m){return s.provides[d]=m,f},runWithContext(d){const m=Uo;Uo=f;try{return d()}finally{Uo=m}}};return f}}let Uo=null;const Fp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${On(t)}Modifiers`]||e[`${ao(t)}Modifiers`];function Bp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||xt;let o=n;const s=t.startsWith("update:"),a=s&&Fp(r,t.slice(7));a&&(a.trim&&(o=n.map(d=>Pt(d)?d.trim():d)),a.number&&(o=n.map(Pa)));let i,u=r[i=vi(t)]||r[i=vi(On(t))];!u&&s&&(u=r[i=vi(ao(t))]),u&&hr(u,e,6,o);const f=r[i+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,hr(f,e,6,o)}}const qp=new WeakMap;function Hd(e,t,n=!1){const r=n?qp:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let a={},i=!1;if(!Ge(e)){const u=f=>{const d=Hd(f,t,!0);d&&(i=!0,Xt(a,d))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!s&&!i?(vt(e)&&r.set(e,null),null):(Be(s)?s.forEach(u=>a[u]=null):Xt(a,s),vt(e)&&r.set(e,a),a)}function ja(e,t){return!e||!Ea(t)?!1:(t=t.slice(2).replace(/Once$/,""),gt(e,t[0].toLowerCase()+t.slice(1))||gt(e,ao(t))||gt(e,t))}function yu(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:a,attrs:i,emit:u,render:f,renderCache:d,props:m,data:v,setupState:S,ctx:j,inheritAttrs:N}=e,X=Ta(e);let M,L;try{if(n.shapeFlag&4){const W=o||r,ae=W;M=_r(f.call(ae,W,d,m,S,v,j)),L=i}else{const W=t;M=_r(W.length>1?W(m,{attrs:i,slots:a,emit:u}):W(m,null)),L=t.props?i:Up(i)}}catch(W){ys.length=0,Os(W,e,1),M=Ne(bn)}let q=M;if(L&&N!==!1){const W=Object.keys(L),{shapeFlag:ae}=q;W.length&&ae&7&&(s&&W.some(Ia)&&(L=Hp(L,s)),q=so(q,L,!1,!0))}return n.dirs&&(q=so(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&Cs(q,n.transition),M=q,Ta(X),M}const Up=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ea(n))&&((t||(t={}))[n]=e[n]);return t},Hp=(e,t)=>{const n={};for(const r in e)(!Ia(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Wp(e,t,n){const{props:r,children:o,component:s}=e,{props:a,children:i,patchFlag:u}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return r?bu(r,a,f):!!a;if(u&8){const d=t.dynamicProps;for(let m=0;m<d.length;m++){const v=d[m];if(Wd(a,r,v)&&!ja(f,v))return!0}}}else return(o||i)&&(!i||!i.$stable)?!0:r===a?!1:r?a?bu(r,a,f):!0:!!a;return!1}function bu(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(Wd(t,e,s)&&!ja(n,s))return!0}return!1}function Wd(e,t,n){const r=e[n],o=t[n];return n==="style"&&vt(r)&&vt(o)?!Jo(r,o):r!==o}function Vp({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Vd={},zd=()=>Object.create(Vd),Gd=e=>Object.getPrototypeOf(e)===Vd;function zp(e,t,n,r=!1){const o={},s=zd();e.propsDefaults=Object.create(null),Kd(e,t,o,s);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=r?o:bd(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function Gp(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:a}}=e,i=ft(o),[u]=e.propsOptions;let f=!1;if((r||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m<d.length;m++){let v=d[m];if(ja(e.emitsOptions,v))continue;const S=t[v];if(u)if(gt(s,v))S!==s[v]&&(s[v]=S,f=!0);else{const j=On(v);o[j]=ll(u,i,j,S,e,!1)}else S!==s[v]&&(s[v]=S,f=!0)}}}else{Kd(e,t,o,s)&&(f=!0);let d;for(const m in i)(!t||!gt(t,m)&&((d=ao(m))===m||!gt(t,d)))&&(u?n&&(n[m]!==void 0||n[d]!==void 0)&&(o[m]=ll(u,i,m,void 0,e,!0)):delete o[m]);if(s!==i)for(const m in s)(!t||!gt(t,m))&&(delete s[m],f=!0)}f&&Dr(e.attrs,"set","")}function Kd(e,t,n,r){const[o,s]=e.propsOptions;let a=!1,i;if(t)for(let u in t){if(ps(u))continue;const f=t[u];let d;o&&gt(o,d=On(u))?!s||!s.includes(d)?n[d]=f:(i||(i={}))[d]=f:ja(e.emitsOptions,u)||(!(u in r)||f!==r[u])&&(r[u]=f,a=!0)}if(s){const u=ft(n),f=i||xt;for(let d=0;d<s.length;d++){const m=s[d];n[m]=ll(o,u,m,f[m],e,!gt(f,m))}}return a}function ll(e,t,n,r,o,s){const a=e[n];if(a!=null){const i=gt(a,"default");if(i&&r===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&Ge(u)){const{propsDefaults:f}=o;if(n in f)r=f[n];else{const d=Ls(o);r=f[n]=u.call(null,t),d()}}else r=u;o.ce&&o.ce._setProp(n,r)}a[0]&&(s&&!i?r=!1:a[1]&&(r===""||r===ao(n))&&(r=!0))}return r}const Kp=new WeakMap;function Yd(e,t,n=!1){const r=n?Kp:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,a={},i=[];let u=!1;if(!Ge(e)){const d=m=>{u=!0;const[v,S]=Yd(m,t,!0);Xt(a,v),S&&i.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!u)return vt(e)&&r.set(e,jo),jo;if(Be(s))for(let d=0;d<s.length;d++){const m=On(s[d]);Tu(m)&&(a[m]=xt)}else if(s)for(const d in s){const m=On(d);if(Tu(m)){const v=s[d],S=a[m]=Be(v)||Ge(v)?{type:v}:Xt({},v),j=S.type;let N=!1,X=!0;if(Be(j))for(let M=0;M<j.length;++M){const L=j[M],q=Ge(L)&&L.name;if(q==="Boolean"){N=!0;break}else q==="String"&&(X=!1)}else N=Ge(j)&&j.name==="Boolean";S[0]=N,S[1]=X,(N||gt(S,"default"))&&i.push(m)}}const f=[a,i];return vt(e)&&r.set(e,f),f}function Tu(e){return e[0]!=="$"&&!ps(e)}const Nl=e=>e==="_"||e==="_ctx"||e==="$stable",jl=e=>Be(e)?e.map(_r):[_r(e)],Yp=(e,t,n)=>{if(t._n)return t;const r=pt((...o)=>jl(t(...o)),n);return r._c=!1,r},Jd=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Nl(o))continue;const s=e[o];if(Ge(s))t[o]=Yp(o,s,r);else if(s!=null){const a=jl(s);t[o]=()=>a}}},Qd=(e,t)=>{const n=jl(t);e.slots.default=()=>n},Xd=(e,t,n)=>{for(const r in t)(n||!Nl(r))&&(e[r]=t[r])},Jp=(e,t,n)=>{const r=e.slots=zd();if(e.vnode.shapeFlag&32){const o=t._;o?(Xd(r,t,n),n&&nd(r,"_",o,!0)):Jd(t,r)}else t&&Qd(e,t)},Qp=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,a=xt;if(r.shapeFlag&32){const i=t._;i?n&&i===1?s=!1:Xd(o,t,n):(s=!t.$stable,Jd(t,o)),a=t}else t&&(Qd(e,t),a={default:1});if(s)for(const i in o)!Nl(i)&&a[i]==null&&delete o[i]},Rn=nm;function Xp(e){return Zp(e)}function Zp(e,t){const n=$a();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:a,createText:i,createComment:u,setText:f,setElementText:d,parentNode:m,nextSibling:v,setScopeId:S=kr,insertStaticContent:j}=e,N=(_,x,$,G=null,Q=null,K=null,ne=void 0,fe=null,se=!!x.dynamicChildren)=>{if(_===x)return;_&&!wo(_,x)&&(G=z(_),oe(_,Q,K,!0),_=null),x.patchFlag===-2&&(se=!1,x.dynamicChildren=null);const{type:Z,ref:Oe,shapeFlag:we}=x;switch(Z){case Fa:X(_,x,$,G);break;case bn:M(_,x,$,G);break;case Ci:_==null&&L(x,$,G,ne);break;case We:V(_,x,$,G,Q,K,ne,fe,se);break;default:we&1?ae(_,x,$,G,Q,K,ne,fe,se):we&6?ie(_,x,$,G,Q,K,ne,fe,se):(we&64||we&128)&&Z.process(_,x,$,G,Q,K,ne,fe,se,Ee)}Oe!=null&&Q?vs(Oe,_&&_.ref,K,x||_,!x):Oe==null&&_&&_.ref!=null&&vs(_.ref,null,K,_,!0)},X=(_,x,$,G)=>{if(_==null)r(x.el=i(x.children),$,G);else{const Q=x.el=_.el;x.children!==_.children&&f(Q,x.children)}},M=(_,x,$,G)=>{_==null?r(x.el=u(x.children||""),$,G):x.el=_.el},L=(_,x,$,G)=>{[_.el,_.anchor]=j(_.children,x,$,G,_.el,_.anchor)},q=({el:_,anchor:x},$,G)=>{let Q;for(;_&&_!==x;)Q=v(_),r(_,$,G),_=Q;r(x,$,G)},W=({el:_,anchor:x})=>{let $;for(;_&&_!==x;)$=v(_),o(_),_=$;o(x)},ae=(_,x,$,G,Q,K,ne,fe,se)=>{if(x.type==="svg"?ne="svg":x.type==="math"&&(ne="mathml"),_==null)Y(x,$,G,Q,K,ne,fe,se);else{const Z=_.el&&_.el._isVueCE?_.el:null;try{Z&&Z._beginPatch(),ye(_,x,Q,K,ne,fe,se)}finally{Z&&Z._endPatch()}}},Y=(_,x,$,G,Q,K,ne,fe)=>{let se,Z;const{props:Oe,shapeFlag:we,transition:he,dirs:ke}=_;if(se=_.el=a(_.type,K,Oe&&Oe.is,Oe),we&8?d(se,_.children):we&16&&De(_.children,se,null,G,Q,ki(_,K),ne,fe),ke&&uo(_,null,G,"created"),le(se,_,_.scopeId,ne,G),Oe){for(const Qe in Oe)Qe!=="value"&&!ps(Qe)&&s(se,Qe,null,Oe[Qe],K,G);"value"in Oe&&s(se,"value",null,Oe.value,K),(Z=Oe.onVnodeBeforeMount)&&vr(Z,G,_)}ke&&uo(_,null,G,"beforeMount");const qe=em(Q,he);qe&&he.beforeEnter(se),r(se,x,$),((Z=Oe&&Oe.onVnodeMounted)||qe||ke)&&Rn(()=>{try{Z&&vr(Z,G,_),qe&&he.enter(se),ke&&uo(_,null,G,"mounted")}finally{}},Q)},le=(_,x,$,G,Q)=>{if($&&S(_,$),G)for(let K=0;K<G.length;K++)S(_,G[K]);if(Q){let K=Q.subTree;if(x===K||tf(K.type)&&(K.ssContent===x||K.ssFallback===x)){const ne=Q.vnode;le(_,ne,ne.scopeId,ne.slotScopeIds,Q.parent)}}},De=(_,x,$,G,Q,K,ne,fe,se=0)=>{for(let Z=se;Z<_.length;Z++){const Oe=_[Z]=fe?Or(_[Z]):_r(_[Z]);N(null,Oe,x,$,G,Q,K,ne,fe)}},ye=(_,x,$,G,Q,K,ne)=>{const fe=x.el=_.el;let{patchFlag:se,dynamicChildren:Z,dirs:Oe}=x;se|=_.patchFlag&16;const we=_.props||xt,he=x.props||xt;let ke;if($&&fo($,!1),(ke=he.onVnodeBeforeUpdate)&&vr(ke,$,x,_),Oe&&uo(x,_,$,"beforeUpdate"),$&&fo($,!0),(we.innerHTML&&he.innerHTML==null||we.textContent&&he.textContent==null)&&d(fe,""),Z?be(_.dynamicChildren,Z,fe,$,G,ki(x,Q),K):ne||_e(_,x,fe,null,$,G,ki(x,Q),K,!1),se>0){if(se&16)de(fe,we,he,$,Q);else if(se&2&&we.class!==he.class&&s(fe,"class",null,he.class,Q),se&4&&s(fe,"style",we.style,he.style,Q),se&8){const qe=x.dynamicProps;for(let Qe=0;Qe<qe.length;Qe++){const Ze=qe[Qe],wt=we[Ze],yt=he[Ze];(yt!==wt||Ze==="value")&&s(fe,Ze,wt,yt,Q,$)}}se&1&&_.children!==x.children&&d(fe,x.children)}else!ne&&Z==null&&de(fe,we,he,$,Q);((ke=he.onVnodeUpdated)||Oe)&&Rn(()=>{ke&&vr(ke,$,x,_),Oe&&uo(x,_,$,"updated")},G)},be=(_,x,$,G,Q,K,ne)=>{for(let fe=0;fe<x.length;fe++){const se=_[fe],Z=x[fe],Oe=se.el&&(se.type===We||!wo(se,Z)||se.shapeFlag&198)?m(se.el):$;N(se,Z,Oe,null,G,Q,K,ne,!0)}},de=(_,x,$,G,Q)=>{if(x!==$){if(x!==xt)for(const K in x)!ps(K)&&!(K in $)&&s(_,K,x[K],null,Q,G);for(const K in $){if(ps(K))continue;const ne=$[K],fe=x[K];ne!==fe&&K!=="value"&&s(_,K,fe,ne,Q,G)}"value"in $&&s(_,"value",x.value,$.value,Q)}},V=(_,x,$,G,Q,K,ne,fe,se)=>{const Z=x.el=_?_.el:i(""),Oe=x.anchor=_?_.anchor:i("");let{patchFlag:we,dynamicChildren:he,slotScopeIds:ke}=x;ke&&(fe=fe?fe.concat(ke):ke),_==null?(r(Z,$,G),r(Oe,$,G),De(x.children||[],$,Oe,Q,K,ne,fe,se)):we>0&&we&64&&he&&_.dynamicChildren&&_.dynamicChildren.length===he.length?(be(_.dynamicChildren,he,$,Q,K,ne,fe),(x.key!=null||Q&&x===Q.subTree)&&Fl(_,x,!0)):_e(_,x,$,Oe,Q,K,ne,fe,se)},ie=(_,x,$,G,Q,K,ne,fe,se)=>{x.slotScopeIds=fe,_==null?x.shapeFlag&512?Q.ctx.activate(x,$,G,ne,se):Le(x,$,G,Q,K,ne,se):Ce(_,x,se)},Le=(_,x,$,G,Q,K,ne)=>{const fe=_.component=lm(_,G,Q);if(Ds(_)&&(fe.ctx.renderer=Ee),um(fe,!1,ne),fe.asyncDep){if(Q&&Q.registerDep(fe,Se,ne),!_.el){const se=fe.subTree=Ne(bn);M(null,se,x,$),_.placeholder=se.el}}else Se(fe,_,x,$,Q,K,ne)},Ce=(_,x,$)=>{const G=x.component=_.component;if(Wp(_,x,$))if(G.asyncDep&&!G.asyncResolved){Re(G,x,$);return}else G.next=x,G.update();else x.el=_.el,G.vnode=x},Se=(_,x,$,G,Q,K,ne)=>{const fe=()=>{if(_.isMounted){let{next:we,bu:he,u:ke,parent:qe,vnode:Qe}=_;{const ut=Zd(_);if(ut){we&&(we.el=Qe.el,Re(_,we,ne)),ut.asyncDep.then(()=>{Rn(()=>{_.isUnmounted||Z()},Q)});return}}let Ze=we,wt;fo(_,!1),we?(we.el=Qe.el,Re(_,we,ne)):we=Qe,he&&ha(he),(wt=we.props&&we.props.onVnodeBeforeUpdate)&&vr(wt,qe,we,Qe),fo(_,!0);const yt=yu(_),lt=_.subTree;_.subTree=yt,N(lt,yt,m(lt.el),z(lt),_,Q,K),we.el=yt.el,Ze===null&&Vp(_,yt.el),ke&&Rn(ke,Q),(wt=we.props&&we.props.onVnodeUpdated)&&Rn(()=>vr(wt,qe,we,Qe),Q)}else{let we;const{el:he,props:ke}=x,{bm:qe,m:Qe,parent:Ze,root:wt,type:yt}=_,lt=qo(x);fo(_,!1),qe&&ha(qe),!lt&&(we=ke&&ke.onVnodeBeforeMount)&&vr(we,Ze,x),fo(_,!0);{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(yt,_.parent?_.parent.type:void 0);const ut=_.subTree=yu(_);N(null,ut,$,G,_,Q,K),x.el=ut.el}if(Qe&&Rn(Qe,Q),!lt&&(we=ke&&ke.onVnodeMounted)){const ut=x;Rn(()=>vr(we,Ze,ut),Q)}(x.shapeFlag&256||Ze&&qo(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&_.a&&Rn(_.a,Q),_.isMounted=!0,x=$=G=null}};_.scope.on();const se=_.effect=new ad(fe);_.scope.off();const Z=_.update=se.run.bind(se),Oe=_.job=se.runIfDirty.bind(se);Oe.i=_,Oe.id=_.uid,se.scheduler=()=>Ol(Oe),fo(_,!0),Z()},Re=(_,x,$)=>{x.component=_;const G=_.vnode.props;_.vnode=x,_.next=null,Gp(_,x.props,G,$),Qp(_,x.children,$),Br(),iu(_),qr()},_e=(_,x,$,G,Q,K,ne,fe,se=!1)=>{const Z=_&&_.children,Oe=_?_.shapeFlag:0,we=x.children,{patchFlag:he,shapeFlag:ke}=x;if(he>0){if(he&128){Ve(Z,we,$,G,Q,K,ne,fe,se);return}else if(he&256){Fe(Z,we,$,G,Q,K,ne,fe,se);return}}ke&8?(Oe&16&&je(Z,Q,K),we!==Z&&d($,we)):Oe&16?ke&16?Ve(Z,we,$,G,Q,K,ne,fe,se):je(Z,Q,K,!0):(Oe&8&&d($,""),ke&16&&De(we,$,G,Q,K,ne,fe,se))},Fe=(_,x,$,G,Q,K,ne,fe,se)=>{_=_||jo,x=x||jo;const Z=_.length,Oe=x.length,we=Math.min(Z,Oe);let he;for(he=0;he<we;he++){const ke=x[he]=se?Or(x[he]):_r(x[he]);N(_[he],ke,$,null,Q,K,ne,fe,se)}Z>Oe?je(_,Q,K,!0,!1,we):De(x,$,G,Q,K,ne,fe,se,we)},Ve=(_,x,$,G,Q,K,ne,fe,se)=>{let Z=0;const Oe=x.length;let we=_.length-1,he=Oe-1;for(;Z<=we&&Z<=he;){const ke=_[Z],qe=x[Z]=se?Or(x[Z]):_r(x[Z]);if(wo(ke,qe))N(ke,qe,$,null,Q,K,ne,fe,se);else break;Z++}for(;Z<=we&&Z<=he;){const ke=_[we],qe=x[he]=se?Or(x[he]):_r(x[he]);if(wo(ke,qe))N(ke,qe,$,null,Q,K,ne,fe,se);else break;we--,he--}if(Z>we){if(Z<=he){const ke=he+1,qe=ke<Oe?x[ke].el:G;for(;Z<=he;)N(null,x[Z]=se?Or(x[Z]):_r(x[Z]),$,qe,Q,K,ne,fe,se),Z++}}else if(Z>he)for(;Z<=we;)oe(_[Z],Q,K,!0),Z++;else{const ke=Z,qe=Z,Qe=new Map;for(Z=qe;Z<=he;Z++){const Tt=x[Z]=se?Or(x[Z]):_r(x[Z]);Tt.key!=null&&Qe.set(Tt.key,Z)}let Ze,wt=0;const yt=he-qe+1;let lt=!1,ut=0;const bt=new Array(yt);for(Z=0;Z<yt;Z++)bt[Z]=0;for(Z=ke;Z<=we;Z++){const Tt=_[Z];if(wt>=yt){oe(Tt,Q,K,!0);continue}let Ke;if(Tt.key!=null)Ke=Qe.get(Tt.key);else for(Ze=qe;Ze<=he;Ze++)if(bt[Ze-qe]===0&&wo(Tt,x[Ze])){Ke=Ze;break}Ke===void 0?oe(Tt,Q,K,!0):(bt[Ke-qe]=Z+1,Ke>=ut?ut=Ke:lt=!0,N(Tt,x[Ke],$,null,Q,K,ne,fe,se),wt++)}const zt=lt?tm(bt):jo;for(Ze=zt.length-1,Z=yt-1;Z>=0;Z--){const Tt=qe+Z,Ke=x[Tt],Wt=x[Tt+1],fn=Tt+1<Oe?Wt.el||ef(Wt):G;bt[Z]===0?N(null,Ke,$,fn,Q,K,ne,fe,se):lt&&(Ze<0||Z!==zt[Ze]?ee(Ke,$,fn,2):Ze--)}}},ee=(_,x,$,G,Q=null)=>{const{el:K,type:ne,transition:fe,children:se,shapeFlag:Z}=_;if(Z&6){ee(_.component.subTree,x,$,G);return}if(Z&128){_.suspense.move(x,$,G);return}if(Z&64){ne.move(_,x,$,Ee);return}if(ne===We){r(K,x,$);for(let we=0;we<se.length;we++)ee(se[we],x,$,G);r(_.anchor,x,$);return}if(ne===Ci){q(_,x,$);return}if(G!==2&&Z&1&&fe)if(G===0)fe.beforeEnter(K),r(K,x,$),Rn(()=>fe.enter(K),Q);else{const{leave:we,delayLeave:he,afterLeave:ke}=fe,qe=()=>{_.ctx.isUnmounted?o(K):r(K,x,$)},Qe=()=>{K._isLeaving&&K[br](!0),we(K,()=>{qe(),ke&&ke()})};he?he(K,qe,Qe):Qe()}else r(K,x,$)},oe=(_,x,$,G=!1,Q=!1)=>{const{type:K,props:ne,ref:fe,children:se,dynamicChildren:Z,shapeFlag:Oe,patchFlag:we,dirs:he,cacheIndex:ke,memo:qe}=_;if(we===-2&&(Q=!1),fe!=null&&(Br(),vs(fe,null,$,_,!0),qr()),ke!=null&&(x.renderCache[ke]=void 0),Oe&256){x.ctx.deactivate(_);return}const Qe=Oe&1&&he,Ze=!qo(_);let wt;if(Ze&&(wt=ne&&ne.onVnodeBeforeUnmount)&&vr(wt,x,_),Oe&6)Ie(_.component,$,G);else{if(Oe&128){_.suspense.unmount($,G);return}Qe&&uo(_,null,x,"beforeUnmount"),Oe&64?_.type.remove(_,x,$,Ee,G):Z&&!Z.hasOnce&&(K!==We||we>0&&we&64)?je(Z,x,$,!1,!0):(K===We&&we&384||!Q&&Oe&16)&&je(se,x,$),G&&pe(_)}const yt=qe!=null&&ke==null;(Ze&&(wt=ne&&ne.onVnodeUnmounted)||Qe||yt)&&Rn(()=>{wt&&vr(wt,x,_),Qe&&uo(_,null,x,"unmounted"),yt&&(_.el=null)},$)},pe=_=>{const{type:x,el:$,anchor:G,transition:Q}=_;if(x===We){Ae($,G);return}if(x===Ci){W(_);return}const K=()=>{o($),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave()};if(_.shapeFlag&1&&Q&&!Q.persisted){const{leave:ne,delayLeave:fe}=Q,se=()=>ne($,K);fe?fe(_.el,K,se):se()}else K()},Ae=(_,x)=>{let $;for(;_!==x;)$=v(_),o(_),_=$;o(x)},Ie=(_,x,$)=>{const{bum:G,scope:Q,job:K,subTree:ne,um:fe,m:se,a:Z}=_;_u(se),_u(Z),G&&ha(G),Q.stop(),K&&(K.flags|=8,oe(ne,_,x,$)),fe&&Rn(fe,x),Rn(()=>{_.isUnmounted=!0},x)},je=(_,x,$,G=!1,Q=!1,K=0)=>{for(let ne=K;ne<_.length;ne++)oe(_[ne],x,$,G,Q)},z=_=>{if(_.shapeFlag&6)return z(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const x=v(_.anchor||_.el),$=x&&x[Md];return $?v($):x};let ue=!1;const J=(_,x,$)=>{let G;_==null?x._vnode&&(oe(x._vnode,null,null,!0),G=x._vnode.component):N(x._vnode||null,_,x,null,null,null,$),x._vnode=_,ue||(ue=!0,iu(G),kd(),ue=!1)},Ee={p:N,um:oe,m:ee,r:pe,mt:Le,mc:De,pc:_e,pbc:be,n:z,o:e};return{render:J,hydrate:void 0,createApp:jp(J)}}function ki({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 fo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function em(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Fl(e,t,n=!1){const r=e.children,o=t.children;if(Be(r)&&Be(o))for(let s=0;s<r.length;s++){const a=r[s];let i=o[s];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=o[s]=Or(o[s]),i.el=a.el),!n&&i.patchFlag!==-2&&Fl(a,i)),i.type===Fa&&(i.patchFlag===-1&&(i=o[s]=Or(i)),i.el=a.el),i.type===bn&&!i.el&&(i.el=a.el)}}function tm(e){const t=e.slice(),n=[0];let r,o,s,a,i;const u=e.length;for(r=0;r<u;r++){const f=e[r];if(f!==0){if(o=n[n.length-1],e[o]<f){t[r]=o,n.push(r);continue}for(s=0,a=n.length-1;s<a;)i=s+a>>1,e[n[i]]<f?s=i+1:a=i;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,a=n[s-1];s-- >0;)n[s]=a,a=t[a];return n}function Zd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Zd(t)}function _u(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ef(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ef(t.subTree):null}const tf=e=>e.__isSuspense;function nm(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):ap(e)}const We=Symbol.for("v-fgt"),Fa=Symbol.for("v-txt"),bn=Symbol.for("v-cmt"),Ci=Symbol.for("v-stc"),ys=[];let Kn=null;function A(e=!1){ys.push(Kn=e?null:[])}function rm(){ys.pop(),Kn=ys[ys.length-1]||null}let As=1;function xa(e,t=!1){As+=e,e<0&&Kn&&t&&(Kn.hasOnce=!0)}function nf(e){return e.dynamicChildren=As>0?Kn||jo:null,rm(),As>0&&Kn&&Kn.push(e),e}function P(e,t,n,r,o,s){return nf(g(e,t,n,r,o,s,!0))}function it(e,t,n,r,o){return nf(Ne(e,t,n,r,o,!0))}function Es(e){return e?e.__v_isVNode===!0:!1}function wo(e,t){return e.type===t.type&&e.key===t.key}const rf=({key:e})=>e??null,ga=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Pt(e)||Tn(e)||Ge(e)?{i:cn,r:e,k:t,f:!!n}:e:null);function g(e,t=null,n=null,r=0,o=null,s=e===We?0:1,a=!1,i=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rf(t),ref:t&&ga(t),scopeId:Ad,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:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:cn};return i?(Bl(u,n),s&128&&e.normalize(u)):n&&(u.shapeFlag|=Pt(n)?8:16),As>0&&!a&&Kn&&(u.patchFlag>0||s&6)&&u.patchFlag!==32&&Kn.push(u),u}const Ne=om;function om(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===jd)&&(e=bn),Es(e)){const i=so(e,t,!0);return n&&Bl(i,n),As>0&&!s&&Kn&&(i.shapeFlag&6?Kn[Kn.indexOf(e)]=i:Kn.push(i)),i.patchFlag=-2,i}if(hm(e)&&(e=e.__vccOpts),t){t=sm(t);let{class:i,style:u}=t;i&&!Pt(i)&&(t.class=tt(i)),vt(u)&&($l(u)&&!Be(u)&&(u=Xt({},u)),t.style=Nr(u))}const a=Pt(e)?1:tf(e)?128:Rd(e)?64:vt(e)?4:Ge(e)?2:0;return g(e,t,n,r,o,a,s,!0)}function sm(e){return e?$l(e)||Gd(e)?Xt({},e):e:null}function so(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:a,children:i,transition:u}=e,f=t?of(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&rf(f),ref:t&&t.ref?n&&s?Be(s)?s.concat(ga(t)):[s,ga(t)]:ga(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==We?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&so(e.ssContent),ssFallback:e.ssFallback&&so(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Cs(d,u.clone(d)),d}function Ho(e=" ",t=0){return Ne(Fa,null,e,t)}function ge(e="",t=!1){return t?(A(),it(bn,null,e)):Ne(bn,null,e)}function _r(e){return e==null||typeof e=="boolean"?Ne(bn):Be(e)?Ne(We,null,e.slice()):Es(e)?Or(e):Ne(Fa,null,String(e))}function Or(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:so(e)}function Bl(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 o=t.default;o&&(o._c&&(o._d=!1),Bl(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Gd(t)?t._ctx=cn:o===3&&cn&&(cn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ge(t)?(t={default:t,_ctx:cn},n=32):(t=String(t),r&64?(n=16,t=[Ho(t)]):n=8);e.children=t,e.shapeFlag|=n}function of(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=tt([t.class,r.class]));else if(o==="style")t.style=Nr([t.style,r.style]);else if(Ea(o)){const s=t[o],a=r[o];a&&s!==a&&!(Be(s)&&s.includes(a))?t[o]=s?[].concat(s,a):a:a==null&&s==null&&!Ia(o)&&(t[o]=a)}else o!==""&&(t[o]=r[o])}return t}function vr(e,t,n,r=null){hr(e,t,7,[n,r])}const am=Ud();let im=0;function lm(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||am,s={uid:im++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Mh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yd(r,o),emitsOptions:Hd(r,o),emit:null,emitted:null,propsDefaults:xt,inheritAttrs:r.inheritAttrs,ctx:xt,data:xt,props:xt,attrs:xt,slots:xt,refs:xt,setupState:xt,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 s.ctx={_:s},s.root=t?t.root:s,s.emit=Bp.bind(null,s),e.ce&&e.ce(s),s}let un=null;const ql=()=>un||cn;let ka,ul;{const e=$a(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(a=>a(s)):o[0](s)}};ka=t("__VUE_INSTANCE_SETTERS__",n=>un=n),ul=t("__VUE_SSR_SETTERS__",n=>Vo=n)}const Ls=e=>{const t=un;return ka(e),e.scope.on(),()=>{e.scope.off(),ka(t)}},Su=()=>{un&&un.scope.off(),ka(null)};function sf(e){return e.vnode.shapeFlag&4}let Vo=!1;function um(e,t=!1,n=!1){t&&ul(t);const{props:r,children:o}=e.vnode,s=sf(e);zp(e,r,s,t),Jp(e,o,n||t);const a=s?cm(e,t):void 0;return t&&ul(!1),a}function cm(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ip);const{setup:r}=n;if(r){Br();const o=e.setupContext=r.length>1?lf(e):null,s=Ls(e),a=$s(r,e,0,[e.props,o]),i=Zc(a);if(qr(),s(),(i||e.sp)&&!qo(e)&&Dl(e),i){if(a.then(Su,Su),t)return a.then(u=>{xu(e,u)}).catch(u=>{Os(u,e,0)});e.asyncDep=a}else xu(e,a)}else af(e)}function xu(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:vt(t)&&(e.setupState=_d(t)),af(e)}function af(e,t,n){const r=e.type;e.render||(e.render=r.render||kr);{const o=Ls(e);Br();try{Pp(e)}finally{qr(),o()}}}const dm={get(e,t){return yn(e,"get",""),e[t]}};function lf(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,dm),slots:e.slots,emit:e.emit,expose:t}}function Ba(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_d(Jh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ws)return ws[n](e)},has(t,n){return n in t||n in ws}})):e.proxy}function fm(e,t=!0){return Ge(e)?e.displayName||e.name:e.name||t&&e.__name}function hm(e){return Ge(e)&&"__vccOpts"in e}const te=(e,t)=>tp(e,t,Vo);function Ul(e,t,n){try{xa(-1);const r=arguments.length;return r===2?vt(t)&&!Be(t)?Es(t)?Ne(e,null,[t]):Ne(e,t):Ne(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Es(n)&&(n=[n]),Ne(e,t,n))}finally{xa(1)}}const pm="3.5.32";/**
15
- * @vue/runtime-dom v3.5.32
16
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
- * @license MIT
18
- **/let cl;const ku=typeof window<"u"&&window.trustedTypes;if(ku)try{cl=ku.createPolicy("vue",{createHTML:e=>e})}catch{}const uf=cl?e=>cl.createHTML(e):e=>e,mm="http://www.w3.org/2000/svg",gm="http://www.w3.org/1998/Math/MathML",$r=typeof document<"u"?document:null,Cu=$r&&$r.createElement("template"),vm={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 o=t==="svg"?$r.createElementNS(mm,e):t==="mathml"?$r.createElementNS(gm,e):n?$r.createElement(e,{is:n}):$r.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>$r.createTextNode(e),createComment:e=>$r.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>$r.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const a=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{Cu.innerHTML=uf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const i=Cu.content;if(r==="svg"||r==="mathml"){const u=i.firstChild;for(;u.firstChild;)i.appendChild(u.firstChild);i.removeChild(u)}t.insertBefore(i,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zr="transition",ls="animation",Is=Symbol("_vtc"),cf={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},wm=Xt({},Pd,cf),ym=e=>(e.displayName="Transition",e.props=wm,e),df=ym((e,{slots:t})=>Ul(mp,bm(e),t)),ho=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},Au=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function bm(e){const t={};for(const V in e)V in cf||(t[V]=e[V]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:a=`${n}-enter-active`,enterToClass:i=`${n}-enter-to`,appearFromClass:u=s,appearActiveClass:f=a,appearToClass:d=i,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:v=`${n}-leave-active`,leaveToClass:S=`${n}-leave-to`}=e,j=Tm(o),N=j&&j[0],X=j&&j[1],{onBeforeEnter:M,onEnter:L,onEnterCancelled:q,onLeave:W,onLeaveCancelled:ae,onBeforeAppear:Y=M,onAppear:le=L,onAppearCancelled:De=q}=t,ye=(V,ie,Le,Ce)=>{V._enterCancelled=Ce,po(V,ie?d:i),po(V,ie?f:a),Le&&Le()},be=(V,ie)=>{V._isLeaving=!1,po(V,m),po(V,S),po(V,v),ie&&ie()},de=V=>(ie,Le)=>{const Ce=V?le:L,Se=()=>ye(ie,V,Le);ho(Ce,[ie,Se]),Eu(()=>{po(ie,V?u:s),Rr(ie,V?d:i),Au(Ce)||Iu(ie,r,N,Se)})};return Xt(t,{onBeforeEnter(V){ho(M,[V]),Rr(V,s),Rr(V,a)},onBeforeAppear(V){ho(Y,[V]),Rr(V,u),Rr(V,f)},onEnter:de(!1),onAppear:de(!0),onLeave(V,ie){V._isLeaving=!0;const Le=()=>be(V,ie);Rr(V,m),V._enterCancelled?(Rr(V,v),Pu(V)):(Pu(V),Rr(V,v)),Eu(()=>{V._isLeaving&&(po(V,m),Rr(V,S),Au(W)||Iu(V,r,X,Le))}),ho(W,[V,Le])},onEnterCancelled(V){ye(V,!1,void 0,!0),ho(q,[V])},onAppearCancelled(V){ye(V,!0,void 0,!0),ho(De,[V])},onLeaveCancelled(V){be(V),ho(ae,[V])}})}function Tm(e){if(e==null)return null;if(vt(e))return[Ai(e.enter),Ai(e.leave)];{const t=Ai(e);return[t,t]}}function Ai(e){return _h(e)}function Rr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Is]||(e[Is]=new Set)).add(t)}function po(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Is];n&&(n.delete(t),n.size||(e[Is]=void 0))}function Eu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let _m=0;function Iu(e,t,n,r){const o=e._endId=++_m,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:a,timeout:i,propCount:u}=Sm(e,t);if(!a)return r();const f=a+"end";let d=0;const m=()=>{e.removeEventListener(f,v),s()},v=S=>{S.target===e&&++d>=u&&m()};setTimeout(()=>{d<u&&m()},i+1),e.addEventListener(f,v)}function Sm(e,t){const n=window.getComputedStyle(e),r=j=>(n[j]||"").split(", "),o=r(`${Zr}Delay`),s=r(`${Zr}Duration`),a=Mu(o,s),i=r(`${ls}Delay`),u=r(`${ls}Duration`),f=Mu(i,u);let d=null,m=0,v=0;t===Zr?a>0&&(d=Zr,m=a,v=s.length):t===ls?f>0&&(d=ls,m=f,v=u.length):(m=Math.max(a,f),d=m>0?a>f?Zr:ls:null,v=d?d===Zr?s.length:u.length:0);const S=d===Zr&&/\b(?:transform|all)(?:,|$)/.test(r(`${Zr}Property`).toString());return{type:d,timeout:m,propCount:v,hasTransform:S}}function Mu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ru(n)+Ru(e[r])))}function Ru(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pu(e){return(e?e.ownerDocument:document).body.offsetHeight}function xm(e,t,n){const r=e[Is];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const $u=Symbol("_vod"),km=Symbol("_vsh"),Cm=Symbol(""),Am=/(?:^|;)\s*display\s*:/;function Em(e,t,n){const r=e.style,o=Pt(n);let s=!1;if(n&&!o){if(t)if(Pt(t))for(const a of t.split(";")){const i=a.slice(0,a.indexOf(":")).trim();n[i]==null&&va(r,i,"")}else for(const a in t)n[a]==null&&va(r,a,"");for(const a in n)a==="display"&&(s=!0),va(r,a,n[a])}else if(o){if(t!==n){const a=r[Cm];a&&(n+=";"+a),r.cssText=n,s=Am.test(n)}}else t&&e.removeAttribute("style");$u in e&&(e[$u]=s?r.display:"",e[km]&&(r.display="none"))}const Ou=/\s*!important$/;function va(e,t,n){if(Be(n))n.forEach(r=>va(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Im(e,t);Ou.test(n)?e.setProperty(ao(r),n.replace(Ou,""),"important"):e[r]=n}}const Du=["Webkit","Moz","ms"],Ei={};function Im(e,t){const n=Ei[t];if(n)return n;let r=On(t);if(r!=="filter"&&r in e)return Ei[t]=r;r=Ra(r);for(let o=0;o<Du.length;o++){const s=Du[o]+r;if(s in e)return Ei[t]=s}return t}const Lu="http://www.w3.org/1999/xlink";function Nu(e,t,n,r,o,s=Eh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Lu,t.slice(6,t.length)):e.setAttributeNS(Lu,t,n):n==null||s&&!rd(n)?e.removeAttribute(t):e.setAttribute(t,s?"":dr(n)?String(n):n)}function ju(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?uf(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const i=s==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(i!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let a=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=rd(n):n==null&&i==="string"?(n="",a=!0):i==="number"&&(n=0,a=!0)}try{e[t]=n}catch{}a&&e.removeAttribute(o||t)}function oo(e,t,n,r){e.addEventListener(t,n,r)}function Mm(e,t,n,r){e.removeEventListener(t,n,r)}const Fu=Symbol("_vei");function Rm(e,t,n,r,o=null){const s=e[Fu]||(e[Fu]={}),a=s[t];if(r&&a)a.value=r;else{const[i,u]=Pm(t);if(r){const f=s[t]=Dm(r,o);oo(e,i,f,u)}else a&&(Mm(e,i,a,u),s[t]=void 0)}}const Bu=/(?:Once|Passive|Capture)$/;function Pm(e){let t;if(Bu.test(e)){t={};let r;for(;r=e.match(Bu);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ao(e.slice(2)),t]}let Ii=0;const $m=Promise.resolve(),Om=()=>Ii||($m.then(()=>Ii=0),Ii=Date.now());function Dm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;hr(Lm(r,n.value),t,5,[r])};return n.value=e,n.attached=Om(),n}function Lm(e,t){if(Be(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const qu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Nm=(e,t,n,r,o,s)=>{const a=o==="svg";t==="class"?xm(e,r,a):t==="style"?Em(e,n,r):Ea(t)?Ia(t)||Rm(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jm(e,t,r,a))?(ju(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Nu(e,t,r,a,s,t!=="value")):e._isVueCE&&(Fm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Pt(r)))?ju(e,On(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Nu(e,t,r,a))};function jm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&qu(t)&&Ge(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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return qu(t)&&Pt(n)?!1:t in e}function Fm(e,t){const n=e._def.props;if(!n)return!1;const r=On(t);return Array.isArray(n)?n.some(o=>On(o)===r):Object.keys(n).some(o=>On(o)===r)}const zo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>ha(t,n):t};function Bm(e){e.target.composing=!0}function Uu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const jr=Symbol("_assign");function Hu(e,t,n){return t&&(e=e.trim()),n&&(e=Pa(e)),e}const Cr={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[jr]=zo(o);const s=r||o.props&&o.props.type==="number";oo(e,t?"change":"input",a=>{a.target.composing||e[jr](Hu(e.value,n,s))}),(n||s)&&oo(e,"change",()=>{e.value=Hu(e.value,n,s)}),t||(oo(e,"compositionstart",Bm),oo(e,"compositionend",Uu),oo(e,"change",Uu))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},a){if(e[jr]=zo(a),e.composing)return;const i=(s||e.type==="number")&&!/^0\d/.test(e.value)?Pa(e.value):e.value,u=t??"";if(i===u)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===u)||(e.value=u)}},qm={deep:!0,created(e,t,n){e[jr]=zo(n),oo(e,"change",()=>{const r=e._modelValue,o=Ms(e),s=e.checked,a=e[jr];if(Be(r)){const i=Cl(r,o),u=i!==-1;if(s&&!u)a(r.concat(o));else if(!s&&u){const f=[...r];f.splice(i,1),a(f)}}else if(Yo(r)){const i=new Set(r);s?i.add(o):i.delete(o),a(i)}else a(ff(e,s))})},mounted:Wu,beforeUpdate(e,t,n){e[jr]=zo(n),Wu(e,t,n)}};function Wu(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(Be(t))o=Cl(t,r.props.value)>-1;else if(Yo(t))o=t.has(r.props.value);else{if(t===n)return;o=Jo(t,ff(e,!0))}e.checked!==o&&(e.checked=o)}const pk={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Yo(t);oo(e,"change",()=>{const s=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?Pa(Ms(a)):Ms(a));e[jr](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Bt(()=>{e._assigning=!1})}),e[jr]=zo(r)},mounted(e,{value:t}){Vu(e,t)},beforeUpdate(e,t,n){e[jr]=zo(n)},updated(e,{value:t}){e._assigning||Vu(e,t)}};function Vu(e,t){const n=e.multiple,r=Be(t);if(!(n&&!r&&!Yo(t))){for(let o=0,s=e.options.length;o<s;o++){const a=e.options[o],i=Ms(a);if(n)if(r){const u=typeof i;u==="string"||u==="number"?a.selected=t.some(f=>String(f)===String(i)):a.selected=Cl(t,i)>-1}else a.selected=t.has(i);else if(Jo(Ms(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ms(e){return"_value"in e?e._value:e.value}function ff(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Um=["ctrl","shift","alt","meta"],Hm={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)=>Um.some(n=>e[`${n}Key`]&&!t.includes(n))},at=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let a=0;a<t.length;a++){const i=Hm[t[a]];if(i&&i(o,t))return}return e(o,...s)}))},Wm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},tn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=ao(o.key);if(t.some(a=>a===s||Wm[a]===s))return e(o)}))},Vm=Xt({patchProp:Nm},vm);let zu;function zm(){return zu||(zu=Xp(Vm))}const Gm=((...e)=>{const t=zm().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Ym(r);if(!o)return;const s=t._component;!Ge(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=n(o,!1,Km(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function Km(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ym(e){return Pt(e)?document.querySelector(e):e}const Jm="modulepreload",Qm=function(e){return"/"+e},Gu={},Mi=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),u=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=a(n.map(f=>{if(f=Qm(f),f in Gu)return;Gu[f]=!0;const d=f.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const v=document.createElement("link");if(v.rel=d?"stylesheet":Jm,d||(v.as="script"),v.crossOrigin="",v.href=f,u&&v.setAttribute("nonce",u),document.head.appendChild(v),d)return new Promise((S,j)=>{v.addEventListener("load",S),v.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(a){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a}return o.then(a=>{for(const i of a||[])i.status==="rejected"&&s(i.reason);return t().catch(s)})};/*!
19
- * vue-router v4.6.4
20
- * (c) 2025 Eduardo San Martin Morote
21
- * @license MIT
22
- */const Oo=typeof document<"u";function hf(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Xm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&hf(e.default)}const mt=Object.assign;function Ri(e,t){const n={};for(const r in t){const o=t[r];n[r]=pr(o)?o.map(e):e(o)}return n}const bs=()=>{},pr=Array.isArray;function Ku(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const pf=/#/g,Zm=/&/g,eg=/\//g,tg=/=/g,ng=/\?/g,mf=/\+/g,rg=/%5B/g,og=/%5D/g,gf=/%5E/g,sg=/%60/g,vf=/%7B/g,ag=/%7C/g,wf=/%7D/g,ig=/%20/g;function Hl(e){return e==null?"":encodeURI(""+e).replace(ag,"|").replace(rg,"[").replace(og,"]")}function lg(e){return Hl(e).replace(vf,"{").replace(wf,"}").replace(gf,"^")}function dl(e){return Hl(e).replace(mf,"%2B").replace(ig,"+").replace(pf,"%23").replace(Zm,"%26").replace(sg,"`").replace(vf,"{").replace(wf,"}").replace(gf,"^")}function ug(e){return dl(e).replace(tg,"%3D")}function cg(e){return Hl(e).replace(pf,"%23").replace(ng,"%3F")}function dg(e){return cg(e).replace(eg,"%2F")}function Rs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const fg=/\/$/,hg=e=>e.replace(fg,"");function Pi(e,t,n="/"){let r,o={},s="",a="";const i=t.indexOf("#");let u=t.indexOf("?");return u=i>=0&&u>i?-1:u,u>=0&&(r=t.slice(0,u),s=t.slice(u,i>0?i:t.length),o=e(s.slice(1))),i>=0&&(r=r||t.slice(0,i),a=t.slice(i,t.length)),r=vg(r??t,n),{fullPath:r+s+a,path:r,query:o,hash:Rs(a)}}function pg(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Yu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function mg(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Go(t.matched[r],n.matched[o])&&yf(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Go(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function yf(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!gg(e[n],t[n]))return!1;return!0}function gg(e,t){return pr(e)?Ju(e,t):pr(t)?Ju(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ju(e,t){return pr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function vg(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,a,i;for(a=0;a<r.length;a++)if(i=r[a],i!==".")if(i==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(a).join("/")}const eo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let fl=(function(e){return e.pop="pop",e.push="push",e})({}),$i=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function wg(e){if(!e)if(Oo){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),hg(e)}const yg=/^[^#]+#/;function bg(e,t){return e.replace(yg,"#")+t}function Tg(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 qa=()=>({left:window.scrollX,top:window.scrollY});function _g(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Tg(o,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 Qu(e,t){return(history.state?history.state.position-t:-1)+e}const hl=new Map;function Sg(e,t){hl.set(e,t)}function xg(e){const t=hl.get(e);return hl.delete(e),t}function kg(e){return typeof e=="string"||e&&typeof e=="object"}function bf(e){return typeof e=="string"||typeof e=="symbol"}let Ot=(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 Tf=Symbol("");Ot.MATCHER_NOT_FOUND+"",Ot.NAVIGATION_GUARD_REDIRECT+"",Ot.NAVIGATION_ABORTED+"",Ot.NAVIGATION_CANCELLED+"",Ot.NAVIGATION_DUPLICATED+"";function Ko(e,t){return mt(new Error,{type:e,[Tf]:!0},t)}function Pr(e,t){return e instanceof Error&&Tf in e&&(t==null||!!(e.type&t))}const Cg=["params","query","hash"];function Ag(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Cg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Eg(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 o=n[r].replace(mf," "),s=o.indexOf("="),a=Rs(s<0?o:o.slice(0,s)),i=s<0?null:Rs(o.slice(s+1));if(a in t){let u=t[a];pr(u)||(u=t[a]=[u]),u.push(i)}else t[a]=i}return t}function Xu(e){let t="";for(let n in e){const r=e[n];if(n=ug(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(pr(r)?r.map(o=>o&&dl(o)):[r&&dl(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Ig(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=pr(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const Mg=Symbol(""),Zu=Symbol(""),Ua=Symbol(""),Wl=Symbol(""),pl=Symbol("");function us(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ro(e,t,n,r,o,s=a=>a()){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((i,u)=>{const f=v=>{v===!1?u(Ko(Ot.NAVIGATION_ABORTED,{from:n,to:t})):v instanceof Error?u(v):kg(v)?u(Ko(Ot.NAVIGATION_GUARD_REDIRECT,{from:t,to:v})):(a&&r.enterCallbacks[o]===a&&typeof v=="function"&&a.push(v),i())},d=s(()=>e.call(r&&r.instances[o],t,n,f));let m=Promise.resolve(d);e.length<3&&(m=m.then(f)),m.catch(v=>u(v))})}function Oi(e,t,n,r,o=s=>s()){const s=[];for(const a of e)for(const i in a.components){let u=a.components[i];if(!(t!=="beforeRouteEnter"&&!a.instances[i]))if(hf(u)){const f=(u.__vccOpts||u)[t];f&&s.push(ro(f,n,r,a,i,o))}else{let f=u();s.push(()=>f.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${i}" at "${a.path}"`);const m=Xm(d)?d.default:d;a.mods[i]=d,a.components[i]=m;const v=(m.__vccOpts||m)[t];return v&&ro(v,n,r,a,i,o)()}))}}return s}function Rg(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let a=0;a<s;a++){const i=t.matched[a];i&&(e.matched.find(f=>Go(f,i))?r.push(i):n.push(i));const u=e.matched[a];u&&(t.matched.find(f=>Go(f,u))||o.push(u))}return[n,r,o]}/*!
23
- * vue-router v4.6.4
24
- * (c) 2025 Eduardo San Martin Morote
25
- * @license MIT
26
- */let Pg=()=>location.protocol+"//"+location.host;function _f(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let a=o.includes(e.slice(s))?e.slice(s).length:1,i=o.slice(a);return i[0]!=="/"&&(i="/"+i),Yu(i,"")}return Yu(n,e)+r+o}function $g(e,t,n,r){let o=[],s=[],a=null;const i=({state:v})=>{const S=_f(e,location),j=n.value,N=t.value;let X=0;if(v){if(n.value=S,t.value=v,a&&a===j){a=null;return}X=N?v.position-N.position:0}else r(S);o.forEach(M=>{M(n.value,j,{delta:X,type:fl.pop,direction:X?X>0?$i.forward:$i.back:$i.unknown})})};function u(){a=n.value}function f(v){o.push(v);const S=()=>{const j=o.indexOf(v);j>-1&&o.splice(j,1)};return s.push(S),S}function d(){if(document.visibilityState==="hidden"){const{history:v}=window;if(!v.state)return;v.replaceState(mt({},v.state,{scroll:qa()}),"")}}function m(){for(const v of s)v();s=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:u,listen:f,destroy:m}}function ec(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?qa():null}}function Og(e){const{history:t,location:n}=window,r={value:_f(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(u,f,d){const m=e.indexOf("#"),v=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+u:Pg()+e+u;try{t[d?"replaceState":"pushState"](f,"",v),o.value=f}catch(S){console.error(S),n[d?"replace":"assign"](v)}}function a(u,f){s(u,mt({},t.state,ec(o.value.back,u,o.value.forward,!0),f,{position:o.value.position}),!0),r.value=u}function i(u,f){const d=mt({},o.value,t.state,{forward:u,scroll:qa()});s(d.current,d,!0),s(u,mt({},ec(r.value,u,null),{position:d.position+1},f),!1),r.value=u}return{location:r,state:o,push:i,replace:a}}function Dg(e){e=wg(e);const t=Og(e),n=$g(e,t.state,t.location,t.replace);function r(s,a=!0){a||n.pauseListeners(),history.go(s)}const o=mt({location:"",base:e,go:r,createHref:bg.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Lg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Dg(e)}let bo=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Jt=(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})(Jt||{});const Ng={type:bo.Static,value:""},jg=/[a-zA-Z0-9_]/;function Fg(e){if(!e)return[[]];if(e==="/")return[[Ng]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(S){throw new Error(`ERR (${n})/"${f}": ${S}`)}let n=Jt.Static,r=n;const o=[];let s;function a(){s&&o.push(s),s=[]}let i=0,u,f="",d="";function m(){f&&(n===Jt.Static?s.push({type:bo.Static,value:f}):n===Jt.Param||n===Jt.ParamRegExp||n===Jt.ParamRegExpEnd?(s.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),s.push({type:bo.Param,value:f,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function v(){f+=u}for(;i<e.length;){if(u=e[i++],u==="\\"&&n!==Jt.ParamRegExp){r=n,n=Jt.EscapeNext;continue}switch(n){case Jt.Static:u==="/"?(f&&m(),a()):u===":"?(m(),n=Jt.Param):v();break;case Jt.EscapeNext:v(),n=r;break;case Jt.Param:u==="("?n=Jt.ParamRegExp:jg.test(u)?v():(m(),n=Jt.Static,u!=="*"&&u!=="?"&&u!=="+"&&i--);break;case Jt.ParamRegExp:u===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+u:n=Jt.ParamRegExpEnd:d+=u;break;case Jt.ParamRegExpEnd:m(),n=Jt.Static,u!=="*"&&u!=="?"&&u!=="+"&&i--,d="";break;default:t("Unknown state");break}}return n===Jt.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),m(),a(),o}const tc="[^/]+?",Bg={sensitive:!1,strict:!1,start:!0,end:!0};var Pn=(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})(Pn||{});const qg=/[.+*?^${}()[\]/\\]/g;function Ug(e,t){const n=mt({},Bg,t),r=[];let o=n.start?"^":"";const s=[];for(const f of e){const d=f.length?[]:[Pn.Root];n.strict&&!f.length&&(o+="/");for(let m=0;m<f.length;m++){const v=f[m];let S=Pn.Segment+(n.sensitive?Pn.BonusCaseSensitive:0);if(v.type===bo.Static)m||(o+="/"),o+=v.value.replace(qg,"\\$&"),S+=Pn.Static;else if(v.type===bo.Param){const{value:j,repeatable:N,optional:X,regexp:M}=v;s.push({name:j,repeatable:N,optional:X});const L=M||tc;if(L!==tc){S+=Pn.BonusCustomRegExp;try{`${L}`}catch(W){throw new Error(`Invalid custom RegExp for param "${j}" (${L}): `+W.message)}}let q=N?`((?:${L})(?:/(?:${L}))*)`:`(${L})`;m||(q=X&&f.length<2?`(?:/${q})`:"/"+q),X&&(q+="?"),o+=q,S+=Pn.Dynamic,X&&(S+=Pn.BonusOptional),N&&(S+=Pn.BonusRepeatable),L===".*"&&(S+=Pn.BonusWildcard)}d.push(S)}r.push(d)}if(n.strict&&n.end){const f=r.length-1;r[f][r[f].length-1]+=Pn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const a=new RegExp(o,n.sensitive?"":"i");function i(f){const d=f.match(a),m={};if(!d)return null;for(let v=1;v<d.length;v++){const S=d[v]||"",j=s[v-1];m[j.name]=S&&j.repeatable?S.split("/"):S}return m}function u(f){let d="",m=!1;for(const v of e){(!m||!d.endsWith("/"))&&(d+="/"),m=!1;for(const S of v)if(S.type===bo.Static)d+=S.value;else if(S.type===bo.Param){const{value:j,repeatable:N,optional:X}=S,M=j in f?f[j]:"";if(pr(M)&&!N)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const L=pr(M)?M.join("/"):M;if(!L)if(X)v.length<2&&(d.endsWith("/")?d=d.slice(0,-1):m=!0);else throw new Error(`Missing required param "${j}"`);d+=L}}return d||"/"}return{re:a,score:r,keys:s,parse:i,stringify:u}}function Hg(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]===Pn.Static+Pn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Pn.Static+Pn.Segment?1:-1:0}function Sf(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=Hg(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(nc(r))return 1;if(nc(o))return-1}return o.length-r.length}function nc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Wg={strict:!1,end:!0,sensitive:!1};function Vg(e,t,n){const r=Ug(Fg(e.path),n),o=mt(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function zg(e,t){const n=[],r=new Map;t=Ku(Wg,t);function o(m){return r.get(m)}function s(m,v,S){const j=!S,N=oc(m);N.aliasOf=S&&S.record;const X=Ku(t,m),M=[N];if("alias"in m){const W=typeof m.alias=="string"?[m.alias]:m.alias;for(const ae of W)M.push(oc(mt({},N,{components:S?S.record.components:N.components,path:ae,aliasOf:S?S.record:N})))}let L,q;for(const W of M){const{path:ae}=W;if(v&&ae[0]!=="/"){const Y=v.record.path,le=Y[Y.length-1]==="/"?"":"/";W.path=v.record.path+(ae&&le+ae)}if(L=Vg(W,v,X),S?S.alias.push(L):(q=q||L,q!==L&&q.alias.push(L),j&&m.name&&!sc(L)&&a(m.name)),xf(L)&&u(L),N.children){const Y=N.children;for(let le=0;le<Y.length;le++)s(Y[le],L,S&&S.children[le])}S=S||L}return q?()=>{a(q)}:bs}function a(m){if(bf(m)){const v=r.get(m);v&&(r.delete(m),n.splice(n.indexOf(v),1),v.children.forEach(a),v.alias.forEach(a))}else{const v=n.indexOf(m);v>-1&&(n.splice(v,1),m.record.name&&r.delete(m.record.name),m.children.forEach(a),m.alias.forEach(a))}}function i(){return n}function u(m){const v=Yg(m,n);n.splice(v,0,m),m.record.name&&!sc(m)&&r.set(m.record.name,m)}function f(m,v){let S,j={},N,X;if("name"in m&&m.name){if(S=r.get(m.name),!S)throw Ko(Ot.MATCHER_NOT_FOUND,{location:m});X=S.record.name,j=mt(rc(v.params,S.keys.filter(q=>!q.optional).concat(S.parent?S.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),m.params&&rc(m.params,S.keys.map(q=>q.name))),N=S.stringify(j)}else if(m.path!=null)N=m.path,S=n.find(q=>q.re.test(N)),S&&(j=S.parse(N),X=S.record.name);else{if(S=v.name?r.get(v.name):n.find(q=>q.re.test(v.path)),!S)throw Ko(Ot.MATCHER_NOT_FOUND,{location:m,currentLocation:v});X=S.record.name,j=mt({},v.params,m.params),N=S.stringify(j)}const M=[];let L=S;for(;L;)M.unshift(L.record),L=L.parent;return{name:X,path:N,params:j,matched:M,meta:Kg(M)}}e.forEach(m=>s(m));function d(){n.length=0,r.clear()}return{addRoute:s,resolve:f,removeRoute:a,clearRoutes:d,getRoutes:i,getRecordMatcher:o}}function rc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function oc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Gg(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 Gg(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 sc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Kg(e){return e.reduce((t,n)=>mt(t,n.meta),{})}function Yg(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;Sf(e,t[s])<0?r=s:n=s+1}const o=Jg(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function Jg(e){let t=e;for(;t=t.parent;)if(xf(t)&&Sf(e,t)===0)return t}function xf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ac(e){const t=cr(Ua),n=cr(Wl),r=te(()=>{const u=$e(e.to);return t.resolve(u)}),o=te(()=>{const{matched:u}=r.value,{length:f}=u,d=u[f-1],m=n.matched;if(!d||!m.length)return-1;const v=m.findIndex(Go.bind(null,d));if(v>-1)return v;const S=ic(u[f-2]);return f>1&&ic(d)===S&&m[m.length-1].path!==S?m.findIndex(Go.bind(null,u[f-2])):v}),s=te(()=>o.value>-1&&tv(n.params,r.value.params)),a=te(()=>o.value>-1&&o.value===n.matched.length-1&&yf(n.params,r.value.params));function i(u={}){if(ev(u)){const f=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(bs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:r,href:te(()=>r.value.href),isActive:s,isExactActive:a,navigate:i}}function Qg(e){return e.length===1?e[0]:e}const Xg=dn({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:ac,setup(e,{slots:t}){const n=Da(ac(e)),{options:r}=cr(Ua),o=te(()=>({[lc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[lc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&Qg(t.default(n));return e.custom?s:Ul("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),Zg=Xg;function ev(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 tv(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!pr(o)||o.length!==r.length||r.some((s,a)=>s.valueOf()!==o[a].valueOf()))return!1}return!0}function ic(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const lc=(e,t,n)=>e??t??n,nv=dn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=cr(pl),o=te(()=>e.route||r.value),s=cr(Zu,0),a=te(()=>{let f=$e(s);const{matched:d}=o.value;let m;for(;(m=d[f])&&!m.components;)f++;return f}),i=te(()=>o.value.matched[a.value]);pa(Zu,te(()=>a.value+1)),pa(Mg,i),pa(pl,o);const u=R();return rt(()=>[u.value,i.value,e.name],([f,d,m],[v,S,j])=>{d&&(d.instances[m]=f,S&&S!==d&&f&&f===v&&(d.leaveGuards.size||(d.leaveGuards=S.leaveGuards),d.updateGuards.size||(d.updateGuards=S.updateGuards))),f&&d&&(!S||!Go(d,S)||!v)&&(d.enterCallbacks[m]||[]).forEach(N=>N(f))},{flush:"post"}),()=>{const f=o.value,d=e.name,m=i.value,v=m&&m.components[d];if(!v)return uc(n.default,{Component:v,route:f});const S=m.props[d],j=S?S===!0?f.params:typeof S=="function"?S(f):S:null,X=Ul(v,mt({},j,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(m.instances[d]=null)},ref:u}));return uc(n.default,{Component:X,route:f})||X}}});function uc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const rv=nv;function ov(e){const t=zg(e.routes,e),n=e.parseQuery||Eg,r=e.stringifyQuery||Xu,o=e.history,s=us(),a=us(),i=us(),u=Qh(eo);let f=eo;Oo&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Ri.bind(null,z=>""+z),m=Ri.bind(null,dg),v=Ri.bind(null,Rs);function S(z,ue){let J,Ee;return bf(z)?(J=t.getRecordMatcher(z),Ee=ue):Ee=z,t.addRoute(Ee,J)}function j(z){const ue=t.getRecordMatcher(z);ue&&t.removeRoute(ue)}function N(){return t.getRoutes().map(z=>z.record)}function X(z){return!!t.getRecordMatcher(z)}function M(z,ue){if(ue=mt({},ue||u.value),typeof z=="string"){const $=Pi(n,z,ue.path),G=t.resolve({path:$.path},ue),Q=o.createHref($.fullPath);return mt($,G,{params:v(G.params),hash:Rs($.hash),redirectedFrom:void 0,href:Q})}let J;if(z.path!=null)J=mt({},z,{path:Pi(n,z.path,ue.path).path});else{const $=mt({},z.params);for(const G in $)$[G]==null&&delete $[G];J=mt({},z,{params:m($)}),ue.params=m(ue.params)}const Ee=t.resolve(J,ue),ze=z.hash||"";Ee.params=d(v(Ee.params));const _=pg(r,mt({},z,{hash:lg(ze),path:Ee.path})),x=o.createHref(_);return mt({fullPath:_,hash:ze,query:r===Xu?Ig(z.query):z.query||{}},Ee,{redirectedFrom:void 0,href:x})}function L(z){return typeof z=="string"?Pi(n,z,u.value.path):mt({},z)}function q(z,ue){if(f!==z)return Ko(Ot.NAVIGATION_CANCELLED,{from:ue,to:z})}function W(z){return le(z)}function ae(z){return W(mt(L(z),{replace:!0}))}function Y(z,ue){const J=z.matched[z.matched.length-1];if(J&&J.redirect){const{redirect:Ee}=J;let ze=typeof Ee=="function"?Ee(z,ue):Ee;return typeof ze=="string"&&(ze=ze.includes("?")||ze.includes("#")?ze=L(ze):{path:ze},ze.params={}),mt({query:z.query,hash:z.hash,params:ze.path!=null?{}:z.params},ze)}}function le(z,ue){const J=f=M(z),Ee=u.value,ze=z.state,_=z.force,x=z.replace===!0,$=Y(J,Ee);if($)return le(mt(L($),{state:typeof $=="object"?mt({},ze,$.state):ze,force:_,replace:x}),ue||J);const G=J;G.redirectedFrom=ue;let Q;return!_&&mg(r,Ee,J)&&(Q=Ko(Ot.NAVIGATION_DUPLICATED,{to:G,from:Ee}),ee(Ee,Ee,!0,!1)),(Q?Promise.resolve(Q):be(G,Ee)).catch(K=>Pr(K)?Pr(K,Ot.NAVIGATION_GUARD_REDIRECT)?K:Ve(K):_e(K,G,Ee)).then(K=>{if(K){if(Pr(K,Ot.NAVIGATION_GUARD_REDIRECT))return le(mt({replace:x},L(K.to),{state:typeof K.to=="object"?mt({},ze,K.to.state):ze,force:_}),ue||G)}else K=V(G,Ee,!0,x,ze);return de(G,Ee,K),K})}function De(z,ue){const J=q(z,ue);return J?Promise.reject(J):Promise.resolve()}function ye(z){const ue=Ae.values().next().value;return ue&&typeof ue.runWithContext=="function"?ue.runWithContext(z):z()}function be(z,ue){let J;const[Ee,ze,_]=Rg(z,ue);J=Oi(Ee.reverse(),"beforeRouteLeave",z,ue);for(const $ of Ee)$.leaveGuards.forEach(G=>{J.push(ro(G,z,ue))});const x=De.bind(null,z,ue);return J.push(x),je(J).then(()=>{J=[];for(const $ of s.list())J.push(ro($,z,ue));return J.push(x),je(J)}).then(()=>{J=Oi(ze,"beforeRouteUpdate",z,ue);for(const $ of ze)$.updateGuards.forEach(G=>{J.push(ro(G,z,ue))});return J.push(x),je(J)}).then(()=>{J=[];for(const $ of _)if($.beforeEnter)if(pr($.beforeEnter))for(const G of $.beforeEnter)J.push(ro(G,z,ue));else J.push(ro($.beforeEnter,z,ue));return J.push(x),je(J)}).then(()=>(z.matched.forEach($=>$.enterCallbacks={}),J=Oi(_,"beforeRouteEnter",z,ue,ye),J.push(x),je(J))).then(()=>{J=[];for(const $ of a.list())J.push(ro($,z,ue));return J.push(x),je(J)}).catch($=>Pr($,Ot.NAVIGATION_CANCELLED)?$:Promise.reject($))}function de(z,ue,J){i.list().forEach(Ee=>ye(()=>Ee(z,ue,J)))}function V(z,ue,J,Ee,ze){const _=q(z,ue);if(_)return _;const x=ue===eo,$=Oo?history.state:{};J&&(Ee||x?o.replace(z.fullPath,mt({scroll:x&&$&&$.scroll},ze)):o.push(z.fullPath,ze)),u.value=z,ee(z,ue,J,x),Ve()}let ie;function Le(){ie||(ie=o.listen((z,ue,J)=>{if(!Ie.listening)return;const Ee=M(z),ze=Y(Ee,Ie.currentRoute.value);if(ze){le(mt(ze,{replace:!0,force:!0}),Ee).catch(bs);return}f=Ee;const _=u.value;Oo&&Sg(Qu(_.fullPath,J.delta),qa()),be(Ee,_).catch(x=>Pr(x,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_CANCELLED)?x:Pr(x,Ot.NAVIGATION_GUARD_REDIRECT)?(le(mt(L(x.to),{force:!0}),Ee).then($=>{Pr($,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&!J.delta&&J.type===fl.pop&&o.go(-1,!1)}).catch(bs),Promise.reject()):(J.delta&&o.go(-J.delta,!1),_e(x,Ee,_))).then(x=>{x=x||V(Ee,_,!1),x&&(J.delta&&!Pr(x,Ot.NAVIGATION_CANCELLED)?o.go(-J.delta,!1):J.type===fl.pop&&Pr(x,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),de(Ee,_,x)}).catch(bs)}))}let Ce=us(),Se=us(),Re;function _e(z,ue,J){Ve(z);const Ee=Se.list();return Ee.length?Ee.forEach(ze=>ze(z,ue,J)):console.error(z),Promise.reject(z)}function Fe(){return Re&&u.value!==eo?Promise.resolve():new Promise((z,ue)=>{Ce.add([z,ue])})}function Ve(z){return Re||(Re=!z,Le(),Ce.list().forEach(([ue,J])=>z?J(z):ue()),Ce.reset()),z}function ee(z,ue,J,Ee){const{scrollBehavior:ze}=e;if(!Oo||!ze)return Promise.resolve();const _=!J&&xg(Qu(z.fullPath,0))||(Ee||!J)&&history.state&&history.state.scroll||null;return Bt().then(()=>ze(z,ue,_)).then(x=>x&&_g(x)).catch(x=>_e(x,z,ue))}const oe=z=>o.go(z);let pe;const Ae=new Set,Ie={currentRoute:u,listening:!0,addRoute:S,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:X,getRoutes:N,resolve:M,options:e,push:W,replace:ae,go:oe,back:()=>oe(-1),forward:()=>oe(1),beforeEach:s.add,beforeResolve:a.add,afterEach:i.add,onError:Se.add,isReady:Fe,install(z){z.component("RouterLink",Zg),z.component("RouterView",rv),z.config.globalProperties.$router=Ie,Object.defineProperty(z.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(u)}),Oo&&!pe&&u.value===eo&&(pe=!0,W(o.location).catch(Ee=>{}));const ue={};for(const Ee in eo)Object.defineProperty(ue,Ee,{get:()=>u.value[Ee],enumerable:!0});z.provide(Ua,Ie),z.provide(Wl,bd(ue)),z.provide(pl,u);const J=z.unmount;Ae.add(z),z.unmount=function(){Ae.delete(z),Ae.size<1&&(f=eo,ie&&ie(),ie=null,u.value=eo,pe=!1,Re=!1),J()}}};function je(z){return z.reduce((ue,J)=>ue.then(()=>ye(J)),Promise.resolve())}return Ie}function sv(){return cr(Ua)}function av(e){return cr(Wl)}const cc=768;function Vl(){const e=R(typeof window<"u"?window.innerWidth<cc:!1);let t=null;function n(r){e.value=r.matches}return So(()=>{t=window.matchMedia(`(max-width: ${cc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Na(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const iv={key:0,class:"desktop-sidebar"},lv={class:"desktop-main"},dc="codex-web-local.sidebar-width.v1",uv=260,cv=620,fc=320,dv=dn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Vl();function r(f){return Math.min(cv,Math.max(uv,f))}function o(){if(typeof window>"u")return fc;const f=window.localStorage.getItem(dc),d=Number(f);return Number.isFinite(d)?r(d):fc}const s=R(o()),a=te(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${s.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function i(f){typeof window>"u"||window.localStorage.setItem(dc,String(f))}function u(f){f.preventDefault();const d=f.clientX,m=s.value,v=j=>{const N=j.clientX-d;s.value=r(m+N)},S=()=>{i(s.value),window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",v),window.addEventListener("mouseup",S)}return(f,d)=>(A(),P("div",{class:tt(["desktop-layout",{"is-mobile":$e(n)}]),style:Nr(a.value)},[$e(n)?(A(),it(ma,{key:0,to:"body"},[Ne(df,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?ge("",!0):(A(),P("div",{key:0,class:"mobile-drawer-backdrop",onClick:d[1]||(d[1]=m=>f.$emit("close-sidebar"))},[g("aside",{class:"mobile-drawer",onClick:d[0]||(d[0]=at(()=>{},["stop"]))},[xr(f.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ge("",!0),$e(n)?ge("",!0):(A(),P(We,{key:1},[e.isSidebarCollapsed?ge("",!0):(A(),P("aside",iv,[xr(f.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ge("",!0):(A(),P("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:u},null,32))],64)),g("section",lv,[xr(f.$slots,"content",{},void 0)])],6))}}),ht=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},fv=ht(dv,[["__scopeId","data-v-4c6dbcd7"]]),hv={},pv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mv(e,t){return A(),P("svg",pv,[...t[0]||(t[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const zl=ht(hv,[["render",mv]]),gv={},vv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wv(e,t){return A(),P("svg",vv,[...t[0]||(t[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const yv=ht(gv,[["render",wv]]),bv={},Tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _v(e,t){return A(),P("svg",Tv,[...t[0]||(t[0]=[g("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 cs=ht(bv,[["render",_v]]),Sv={},xv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function kv(e,t){return A(),P("svg",xv,[...t[0]||(t[0]=[g("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 Ca=ht(Sv,[["render",kv]]),Cv={},Av={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ev(e,t){return A(),P("svg",Av,[...t[0]||(t[0]=[g("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 Gl=ht(Cv,[["render",Ev]]),Iv={},Mv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Rv(e,t){return A(),P("svg",Mv,[...t[0]||(t[0]=[g("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 Pv=ht(Iv,[["render",Rv]]),$v={},Ov={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Dv(e,t){return A(),P("svg",Ov,[...t[0]||(t[0]=[g("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 wa=ht($v,[["render",Dv]]),Lv={},Nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function jv(e,t){return A(),P("svg",Nv,[...t[0]||(t[0]=[g("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 Di=ht(Lv,[["render",jv]]),Fv={key:0,class:"sidebar-menu-row-left"},Bv={class:"sidebar-menu-row-main"},qv={key:1,class:"sidebar-menu-row-right"},Uv={key:0,class:"sidebar-menu-row-right-default"},Hv={key:1,class:"sidebar-menu-row-right-hover"},Wv=dn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Mp(),r=te(()=>!!n.left),o=te(()=>!!n.right),s=te(()=>!!n["right-hover"]),a=te(()=>o.value||s.value);return(i,u)=>(A(),it(Ll(t.as),of({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":a.value,"data-has-right-hover":s.value,"data-force-right-hover":t.forceRightHover},i.$attrs),{default:pt(()=>[r.value?(A(),P("span",Fv,[xr(i.$slots,"left",{},void 0,!0)])):ge("",!0),g("span",Bv,[xr(i.$slots,"default",{},void 0,!0)]),a.value?(A(),P("span",qv,[o.value?(A(),P("span",Uv,[xr(i.$slots,"right",{},void 0,!0)])):ge("",!0),s.value?(A(),P("span",Hv,[xr(i.$slots,"right-hover",{},void 0,!0)])):ge("",!0)])):ge("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),mo=ht(Wv,[["__scopeId","data-v-36239f39"]]),Vv={class:"thread-tree-root"},zv={key:0,class:"pinned-section"},Gv={class:"thread-list"},Kv=["data-menu-open"],Yv={class:"thread-left-stack"},Jv=["data-state"],Qv=["onClick"],Xv=["onClick"],Zv={class:"thread-row-title-wrap"},ew={class:"thread-row-title-line"},tw={class:"thread-row-title"},nw=["data-state"],rw={class:"thread-row-time"},ow=["onClick"],sw=["aria-expanded"],aw=["data-active"],iw={key:0},lw=["data-active"],uw={key:0},cw={key:1,class:"thread-tree-no-results"},dw={key:2,class:"thread-tree-loading"},fw={key:3,class:"thread-list thread-list-global"},hw=["data-menu-open"],pw={class:"thread-left-stack"},mw=["data-state"],gw=["onClick"],vw=["onClick"],ww={class:"thread-row-title-wrap"},yw={class:"thread-row-title-line"},bw={class:"thread-row-title"},Tw=["data-state"],_w={class:"thread-row-time"},Sw=["onClick"],xw=["data-project-name","data-expanded","data-dragging"],kw={class:"project-icon-stack"},Cw={class:"project-icon-folder"},Aw={class:"project-icon-chevron"},Ew=["data-dragging-handle","onMousedown"],Iw={class:"project-title"},Mw={class:"project-hover-controls"},Rw=["onClick"],Pw=["data-open-direction"],$w=["onClick"],Ow=["onClick"],Dw=["onInput"],Lw=["aria-label","title","onClick"],Nw={key:0,class:"thread-list"},jw=["data-menu-open"],Fw={class:"thread-left-stack"},Bw=["data-state"],qw=["onClick"],Uw=["onClick"],Hw={class:"thread-row-title-wrap"},Ww={class:"thread-row-title-line"},Vw={class:"thread-row-title"},zw=["data-state"],Gw={class:"thread-row-time"},Kw=["onClick"],Yw=["onClick"],Jw=["data-open-direction"],Qw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Xw=["onKeydown"],Zw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},ey={class:"rename-thread-subtitle"},ty=4,hc=6,pc="codex-web-local.thread-view-mode.v1",mc="codex-web-local.collapsed-projects.v1",ny=dn({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-thread-files","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread"],setup(e,{emit:t}){const n=e,r=t,o=R({}),s=R({}),a=R([]),i=R(""),u=R(""),f=R({}),d=R({}),m=R({}),v=R("actions"),S=R(""),j=R(!1),N=R(""),X=R(""),M=R(null),L=R(!1),q=R(""),W=R(""),ae=R(null),Y=R(null),le=R(null);let De=null,ye=null;const be=R(""),de=R({}),V=new Map,ie=new Map,Le=new Map,Ce=new WeakMap,Se=R(null),Re=R(null),_e=R(!1),Fe=R(oe()),Ve=typeof window<"u"?new ResizeObserver(T=>{for(const k of T){const E=k.target,B=Ce.get(E);B&&St(B,E)}}):null;function ee(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(mc);if(!T)return{};const k=JSON.parse(T);return!k||typeof k!="object"||Array.isArray(k)?{}:k}catch{return{}}}function oe(){return typeof window>"u"?"project":window.localStorage.getItem(pc)==="chronological"?"chronological":"project"}s.value=ee(),rt(s,T=>{typeof window>"u"||window.localStorage.setItem(mc,JSON.stringify(T))},{deep:!0}),rt(Fe,T=>{typeof window>"u"||window.localStorage.setItem(pc,T)});const pe=te(()=>n.searchQuery.trim().toLowerCase()),Ae=te(()=>pe.value.length>0),Ie=te(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),je=te(()=>new Set(a.value));function z(T){if(!Ae.value)return!0;if(Ie.value)return Ie.value.has(T.id);const k=pe.value;return T.title.toLowerCase().includes(k)||T.preview.toLowerCase().includes(k)}const ue=te(()=>Ae.value?n.groups.map(T=>({...T,threads:T.threads.filter(z)})).filter(T=>T.threads.length>0):n.groups),J=te(()=>Fe.value==="chronological"),Ee=te(()=>{const T=ue.value,k=[];for(const E of T)for(const B of E.threads)je.value.has(B.id)||k.push(B);return k.sort((E,B)=>{const y=new Date(E.updatedAtIso||E.createdAtIso).getTime();return new Date(B.updatedAtIso||B.createdAtIso).getTime()-y})}),ze=te(()=>{const T=new Map;for(const k of n.groups)for(const E of k.threads)T.set(E.id,E);return T}),_=te(()=>{const T=new Map;for(const k of n.groups)for(const E of k.threads)T.set(E.id,k.projectName);return T}),x=te(()=>{const T=new Map;for(const k of n.groups){const E=k.threads.filter(B=>!je.value.has(B.id));T.set(k.projectName,E)}return T}),$=te(()=>{const T=new Map;for(const k of n.groups)for(const E of k.threads){const B=new Date(E.updatedAtIso||E.createdAtIso).getTime();T.set(E.id,B)}return T}),G=te(()=>{const T=u.value;return T?ze.value.get(T)??null:null}),Q=te(()=>a.value.map(T=>ze.value.get(T)??null).filter(T=>T!==null).filter(z)),K=te(()=>{const T=le.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const k=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),E=k>T.fromIndex?k-1:k,B=Math.max(0,Math.min(E,n.groups.length-1));return B===T.fromIndex?null:B}),ne=te(()=>{const k=(Ae.value?ue.value:n.groups).map(H=>H.projectName),E=le.value,B=K.value;if(!E||B===null)return k;const y=[...k],[C]=y.splice(E.fromIndex,1);return C?(y.splice(B,0,C),y):k}),fe=te(()=>{const T={};let k=0;for(const E of ne.value)T[E]=k,k+=Zt(E);return T}),se=te(()=>{let T=0;for(const k of ne.value)T+=Zt(k);return{height:`${Math.max(0,T)}px`}});function Z(T){if(Number.isNaN(T))return"n/a";const k=Math.abs(Date.now()-T);if(k<6e4)return"now";const E=Math.floor(k/6e4);if(E<60)return`${E}m`;const B=Math.floor(E/60);return B<24?`${B}h`:`${Math.floor(B/24)}d`}function Oe(T){const k=$.value.get(T.id);return Z(typeof k=="number"?k:new Date(T.updatedAtIso||T.createdAtIso).getTime())}function we(T){return je.value.has(T)}function he(T){if(we(T)){a.value=a.value.filter(k=>k!==T);return}a.value=[T,...a.value]}function ke(T){r("select",T)}function qe(T){r("export-thread",T),bt()}function Qe(T){r("fork-thread",T),bt()}function Ze(T){return`start new thread ${_n(T)}`}function wt(T){r("start-new-thread",T)}function yt(T){r("browse-thread-files",T),bt()}function lt(T,k){if(u.value===T){if(k){const E=k.relatedTarget,B=Re.value;if(E instanceof Node&&B&&B.contains(E))return}bt()}}function ut(T){return u.value===T}function bt(){u.value="",m.value={}}function zt(T){if(u.value===T){bt();return}nn(),_e.value=!1,u.value=T,Bt(()=>{Ln(T)})}function Tt(T,k){T.preventDefault(),u.value=k}function Ke(T,k){N.value=T,X.value=k,j.value=!0,bt(),Bt(()=>{var E,B;(E=M.value)==null||E.focus(),(B=M.value)==null||B.select()})}function Wt(){j.value=!1,N.value="",X.value=""}function fn(){const T=N.value,k=X.value.trim();!T||!k||(r("rename-thread",{threadId:T,title:k}),Wt())}function Lt(T,k){q.value=T,W.value=k,L.value=!0,bt()}function Rt(){L.value=!1,q.value="",W.value=""}function hn(){const T=q.value;T&&(a.value=a.value.filter(k=>k!==T),r("archive",T),Rt())}function _n(T){return n.projectDisplayNameById[T]??T}function Yn(T){return i.value===T}function nn(){i.value="",v.value="actions",S.value=""}function Sn(){const T=!_e.value;T&&(nn(),bt()),_e.value=T}function Un(T){Fe.value=T,_e.value=!1}function Nt(T){if(i.value===T){nn();return}bt(),_e.value=!1,i.value=T,v.value="actions",S.value=_n(T),Bt(()=>{rn(T)})}function Ar(T){bt(),i.value=T,v.value="rename",S.value=_n(T),Bt(()=>{rn(T)})}function Hn(T){r("rename-project",{projectName:T,displayName:S.value})}function Jn(T){r("remove-project",T),nn()}function Vr(T,k){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const E=n.groups.findIndex(C=>C.projectName===k);if(E<0)return;const B=T.key==="ArrowUp"?-1:1,y=Math.max(0,Math.min(E+B,n.groups.length-1));y!==E&&(T.preventDefault(),r("reorder-project",{projectName:k,toIndex:y}))}function Gt(T){return o.value[T]===!0}function nt(T){return s.value[T]===!0}function pn(T){o.value={...o.value,[T]:!Gt(T)}}function mn(T){if(be.value===T){be.value="";return}s.value={...s.value,[T]:!nt(T)}}function Zt(T){const k=de.value[T]??0,E=le.value,y=((E==null?void 0:E.projectName)===T?E.groupHeight:null)??k,C=nt(T)?0:hc;return Math.max(0,y+C)}function It(T,k){const E=k instanceof HTMLElement?k:k&&"$el"in k&&k.$el instanceof HTMLElement?k.$el:null;if(E){ie.set(T,E);return}ie.delete(T)}function et(T,k){const E=k instanceof HTMLElement?k:k&&"$el"in k&&k.$el instanceof HTMLElement?k.$el:null;if(E){Le.set(T,E);return}Le.delete(T)}function Wn(T){let k=T.parentElement;for(;k;){const E=window.getComputedStyle(k),B=E.overflowY||E.overflow;if(B==="auto"||B==="scroll"||B==="hidden"||B==="clip")return k.getBoundingClientRect();k=k.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function ot(T,k){const E=T.getBoundingClientRect(),B=Wn(T),y=6,C=B.bottom-E.bottom,H=E.top-B.top;return C>=k+y?"down":H>C?"up":"down"}function ct(T,k){const E=Le.get(T);if(!E)return"down";const B=ot(E,k);return d.value={...d.value,[T]:B},B}function sr(T){return d.value[T]??"down"}function rn(T){const k=ie.get(T);k&&(f.value={...f.value,[T]:ot(k,112)})}function xn(T,k,E){return Math.min(Math.max(T,k),E)}function Ln(T){const k=Le.get(T);if(!k)return;const E=Re.value,B=E==null?void 0:E.getBoundingClientRect(),y=(B==null?void 0:B.height)||(E==null?void 0:E.offsetHeight)||112,C=(B==null?void 0:B.width)||(E==null?void 0:E.offsetWidth)||160,H=ct(T,y),ve=k.getBoundingClientRect(),Je=8,Et=4,$t=Math.max(Je,window.innerWidth-C-Je),kt=xn(ve.right-C,Je,$t),Kt=xn(H==="up"?ve.top-y-Et:ve.bottom+Et,Je,Math.max(Je,window.innerHeight-y-Je));m.value={left:`${Math.round(kt)}px`,top:`${Math.round(Kt)}px`}}function Nn(){const T=u.value;T&&Ln(T)}function en(){window.addEventListener("resize",Nn),document.addEventListener("scroll",Nn,!0)}function kn(){window.removeEventListener("resize",Nn),document.removeEventListener("scroll",Nn,!0)}function Vn(T){const k=i.value;if(!k)return!1;const E=ie.get(k);if(!E)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(E))return!0;const y=T.target;return y instanceof Node?E.contains(y):!1}function Vt(T){const k=u.value;if(!k)return!1;const E=Le.get(k);if(!E)return!1;const B=typeof T.composedPath=="function"?T.composedPath():[];if(B.includes(E))return!0;const y=Re.value;if(y&&B.includes(y))return!0;const C=T.target;return C instanceof Node?!!(E.contains(C)||y&&y.contains(C)):!1}function on(T){if(_e.value){const k=Se.value,E=typeof T.composedPath=="function"?T.composedPath():[];!!k&&(E.includes(k)||T.target instanceof Node&&k.contains(T.target))||(_e.value=!1)}i.value&&(Vn(T)||nn(),u.value&&(Vt(T)||bt()))}function gn(T){i.value&&!Vn(T)&&nn(),u.value&&!Vt(T)&&bt()}function jt(){_e.value&&(_e.value=!1),i.value&&nn(),u.value&&bt()}function zn(){window.addEventListener("pointerdown",on,{capture:!0}),window.addEventListener("focusin",gn,{capture:!0}),window.addEventListener("blur",jt)}function Cn(){window.removeEventListener("pointerdown",on,{capture:!0}),window.removeEventListener("focusin",gn,{capture:!0}),window.removeEventListener("blur",jt)}function St(T,k){const E=k.getBoundingClientRect().height;if(!Number.isFinite(E)||E<=0)return;const B=de.value[T];B!==void 0&&Math.abs(B-E)<.5||(de.value={...de.value,[T]:E})}function sn(T,k){const E=V.get(T);E&&E!==k&&Ve&&Ve.unobserve(E);const B=k instanceof HTMLElement?k:k&&"$el"in k&&k.$el instanceof HTMLElement?k.$el:null;if(B){V.set(T,B),Ce.set(B,T),St(T,B),Ve==null||Ve.observe(B);return}E&&(Ve==null||Ve.unobserve(E)),V.delete(T)}function jn(T,k){if(T.button!==0||Y.value||le.value)return;const E=n.groups.findIndex(H=>H.projectName===k),B=V.get(k);if(E<0||!B)return;const y=B.getBoundingClientRect(),C=nt(k)?0:hc;Y.value={projectName:k,fromIndex:E,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-y.top,groupLeft:y.left,groupWidth:y.width,groupHeight:y.height,groupOuterHeight:y.height+C},T.preventDefault(),Er()}function Er(){window.addEventListener("mousemove",En),window.addEventListener("mouseup",ar),window.addEventListener("keydown",Pe)}function An(){window.removeEventListener("mousemove",En),window.removeEventListener("mouseup",ar),window.removeEventListener("keydown",Pe)}function En(T){De={clientX:T.clientX,clientY:T.clientY},Mt()}function ar(T){ir({clientX:T.clientX,clientY:T.clientY});const k=le.value;if(k&&K.value!==null){const E=n.groups.findIndex(B=>B.projectName===k.projectName);if(E>=0){const B=K.value;B!==E&&r("reorder-project",{projectName:k.projectName,toIndex:B})}}Te()}function Pe(T){T.key==="Escape"&&(!Y.value&&!le.value||(T.preventDefault(),Te()))}function Te(){ye!==null&&(window.cancelAnimationFrame(ye),ye=null),De=null,Y.value=null,le.value=null,be.value="",An()}function Mt(){ye===null&&(ye=window.requestAnimationFrame(()=>{if(ye=null,!De)return;const T=De;De=null,ir(T)}))}function ir(T){const k=Y.value;if(!le.value&&k){const E=T.clientX-k.startClientX,B=T.clientY-k.startClientY;if(Math.hypot(E,B)<ty)return;nn(),be.value=k.projectName,le.value={projectName:k.projectName,fromIndex:k.fromIndex,pointerOffsetY:k.pointerOffsetY,groupLeft:k.groupLeft,groupWidth:k.groupWidth,groupHeight:k.groupHeight,groupOuterHeight:k.groupOuterHeight,ghostTop:T.clientY-k.pointerOffsetY,dropTargetIndexFull:null}}le.value&&Qn(T)}function Qn(T){const k=le.value;if(!k)return;if(k.ghostTop=T.clientY-k.pointerOffsetY,!In(T)){k.dropTargetIndexFull=null;return}const E=T.clientY,B=ae.value;if(!B){k.dropTargetIndexFull=null;return}const y=B.getBoundingClientRect(),C=new Map(n.groups.map((Et,$t)=>[Et.projectName,$t])),H=n.groups.map(Et=>Et.projectName).filter(Et=>Et!==k.projectName);let ve=0,Je=n.groups.length;for(const Et of H){const $t=C.get(Et);if($t===void 0)continue;const kt=Zt(Et),Kt=y.top+ve+kt/2;if(E<Kt){Je=$t;break}ve+=kt}k.dropTargetIndexFull=Je}function In(T){const k=ae.value;if(!k)return!1;const E=k.getBoundingClientRect(),B=T.clientX>=E.left&&T.clientX<=E.right,y=T.clientY>=E.top-32&&T.clientY<=E.bottom+32;return B&&y}function vn(T){var k;return((k=le.value)==null?void 0:k.projectName)===T}function Ft(T){const k=le.value,E=fe.value[T]??0,B=u.value?_.value.get(u.value)??"":"",y=i.value===T||B===T;return!k||k.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:y?"40":"1",transform:`translate3d(0, ${E}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${k.groupLeft}px`,width:`${k.groupWidth}px`,height:`${k.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${k.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function wn(T){return x.value.get(T.projectName)??[]}function zr(T){if(Ae.value)return wn(T);if(nt(T.projectName))return[];const k=wn(T);return Gt(T.projectName)?k:k.slice(0,10)}function an(T){return Ae.value?!1:!nt(T.projectName)&&wn(T).length>10}function Gr(T){return wn(T).length>0}function Xn(T){return!!T.pendingRequestState||T.inProgress||T.unread}function Zn(T){return T.pendingRequestState==="approval"?"Ожидает одобрения":"Ожидает ответа"}function er(T){return T.pendingRequestState==="approval"?"awaiting-approval":T.pendingRequestState==="response"?"awaiting-response":T.inProgress?"working":T.unread?"unread":"idle"}rt(()=>n.groups.map(T=>T.projectName),T=>{var y,C;const k=((y=le.value)==null?void 0:y.projectName)??((C=Y.value)==null?void 0:C.projectName)??"";k&&!n.groups.some(H=>H.projectName===k)&&Te();const E=new Set(T),B=Object.fromEntries(Object.entries(de.value).filter(([H])=>E.has(H)));Object.keys(B).length!==Object.keys(de.value).length&&(de.value=B)});const Kr=te(()=>_e.value||i.value!==""||u.value!=="");return rt(Kr,T=>{if(T){zn();return}Cn()}),rt(u,T=>{if(!T){kn();return}en(),Bt(()=>{Ln(T)})}),xo(()=>{for(const T of V.values())Ve==null||Ve.unobserve(T);V.clear(),ie.clear(),kn(),Cn(),Te()}),(T,k)=>(A(),P("section",Vv,[Q.value.length>0?(A(),P("section",zv,[g("ul",Gv,[(A(!0),P(We,null,Dt(Q.value,E=>(A(),P("li",{key:E.id,class:"thread-row-item","data-menu-open":ut(E.id)?"true":"false"},[Ne(mo,{class:"thread-row","data-active":E.id===e.selectedThreadId,"data-pinned":we(E.id),"data-menu-open":ut(E.id)?"true":"false","force-right-hover":ut(E.id),onMouseleave:B=>lt(E.id,B),onContextmenu:B=>Tt(B,E.id)},{left:pt(()=>[g("span",Yv,[Xn(E)?(A(),P("span",{key:0,class:"thread-status-indicator","data-state":er(E)},null,8,Jv)):ge("",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:B=>he(E.id)},[Ne(Di,{class:"thread-icon"})],8,Qv)])]),right:pt(()=>[g("span",rw,ce(Oe(E)),1)]),"right-hover":pt(()=>[g("div",{ref_for:!0,ref:B=>et(E.id,B),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:at(B=>zt(E.id),["stop"])},[Ne(cs,{class:"thread-icon"})],8,ow)],512)]),default:pt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:B=>ke(E.id)},[g("span",Zv,[g("span",ew,[g("span",tw,ce(E.title),1),E.hasWorktree?(A(),it(wa,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),E.pendingRequestState?(A(),P("span",{key:1,class:"thread-row-request-chip","data-state":E.pendingRequestState},ce(Zn(E)),9,nw)):ge("",!0)])])],8,Xv)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,Kv))),128))])])):ge("",!0),Ne(mo,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[g("div",{ref_key:"organizeMenuWrapRef",ref:Se,class:"organize-menu-wrap"},[g("button",{class:"organize-menu-trigger",type:"button","aria-expanded":_e.value,"aria-label":"Organize threads",title:"Organize threads",onClick:Sn},[Ne(cs,{class:"thread-icon"})],8,sw),_e.value?(A(),P("div",{key:0,class:"organize-menu-panel",onClick:k[2]||(k[2]=at(()=>{},["stop"]))},[k[14]||(k[14]=g("p",{class:"organize-menu-title"},"Organize",-1)),g("button",{class:"organize-menu-item","data-active":Fe.value==="project",type:"button",onClick:k[0]||(k[0]=E=>Un("project"))},[k[12]||(k[12]=g("span",null,"By project",-1)),Fe.value==="project"?(A(),P("span",iw,"✓")):ge("",!0)],8,aw),g("button",{class:"organize-menu-item","data-active":Fe.value==="chronological",type:"button",onClick:k[1]||(k[1]=E=>Un("chronological"))},[k[13]||(k[13]=g("span",null,"Chronological list",-1)),Fe.value==="chronological"?(A(),P("span",uw,"✓")):ge("",!0)],8,lw)])):ge("",!0)],512)]),default:pt(()=>[k[15]||(k[15]=g("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ae.value&&ue.value.length===0?(A(),P("p",cw,"No matching threads")):e.isLoading&&e.groups.length===0?(A(),P("p",dw,"Loading threads...")):J.value?(A(),P("ul",fw,[(A(!0),P(We,null,Dt(Ee.value,E=>(A(),P("li",{key:E.id,class:"thread-row-item","data-menu-open":ut(E.id)?"true":"false"},[Ne(mo,{class:"thread-row","data-active":E.id===e.selectedThreadId,"data-pinned":we(E.id),"data-menu-open":ut(E.id)?"true":"false","force-right-hover":ut(E.id),onMouseleave:B=>lt(E.id,B),onContextmenu:B=>Tt(B,E.id)},{left:pt(()=>[g("span",pw,[Xn(E)?(A(),P("span",{key:0,class:"thread-status-indicator","data-state":er(E)},null,8,mw)):ge("",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:B=>he(E.id)},[Ne(Di,{class:"thread-icon"})],8,gw)])]),right:pt(()=>[g("span",_w,ce(Oe(E)),1)]),"right-hover":pt(()=>[g("div",{ref_for:!0,ref:B=>et(E.id,B),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:at(B=>zt(E.id),["stop"])},[Ne(cs,{class:"thread-icon"})],8,Sw)],512)]),default:pt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:B=>ke(E.id)},[g("span",ww,[g("span",yw,[g("span",bw,ce(E.title),1),E.hasWorktree?(A(),it(wa,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),E.pendingRequestState?(A(),P("span",{key:1,class:"thread-row-request-chip","data-state":E.pendingRequestState},ce(Zn(E)),9,Tw)):ge("",!0)])])],8,vw)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,hw))),128))])):(A(),P("div",{key:4,ref_key:"groupsContainerRef",ref:ae,class:"thread-tree-groups",style:Nr(se.value)},[(A(!0),P(We,null,Dt(ue.value,E=>(A(),P("article",{key:E.projectName,ref_for:!0,ref:B=>sn(E.projectName,B),class:"project-group","data-project-name":E.projectName,"data-expanded":!nt(E.projectName),"data-dragging":vn(E.projectName),style:Nr(Ft(E.projectName))},[Ne(mo,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:B=>mn(E.projectName),onKeydown:[B=>Vr(B,E.projectName),tn(at(B=>mn(E.projectName),["prevent"]),["enter"]),tn(at(B=>mn(E.projectName),["prevent"]),["space"])]},{left:pt(()=>[g("span",kw,[g("span",Cw,[nt(E.projectName)?(A(),it(Gl,{key:0,class:"thread-icon"})):(A(),it(Pv,{key:1,class:"thread-icon"}))]),g("span",Aw,[nt(E.projectName)?(A(),it(yv,{key:0,class:"thread-icon"})):(A(),it(zl,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[g("div",Mw,[g("div",{ref_for:!0,ref:B=>It(E.projectName,B),class:"project-menu-wrap"},[g("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:at(B=>Nt(E.projectName),["stop"])},[Ne(cs,{class:"thread-icon"})],8,Rw),Yn(E.projectName)?(A(),P("div",{key:0,class:"project-menu-panel","data-open-direction":f.value[E.projectName]??"down",onClick:k[4]||(k[4]=at(()=>{},["stop"]))},[v.value==="actions"?(A(),P(We,{key:0},[g("button",{class:"project-menu-item",type:"button",onClick:B=>Ar(E.projectName)}," Edit name ",8,$w),g("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:B=>Jn(E.projectName)}," Remove ",8,Ow)],64)):(A(),P(We,{key:1},[k[16]||(k[16]=g("label",{class:"project-menu-label"},"Project name",-1)),lr(g("input",{"onUpdate:modelValue":k[3]||(k[3]=B=>S.value=B),class:"project-menu-input",type:"text",onInput:B=>Hn(E.projectName)},null,40,Dw),[[Cr,S.value]])],64))],8,Pw)):ge("",!0)],512),g("button",{class:"thread-start-button",type:"button","aria-label":Ze(E.projectName),title:Ze(E.projectName),onClick:at(B=>wt(E.projectName),["stop"])},[Ne(Ca,{class:"thread-icon"})],8,Lw)])]),default:pt(()=>[g("span",{class:"project-main-button","data-dragging-handle":vn(E.projectName),onMousedown:at(B=>jn(B,E.projectName),["left"])},[g("span",Iw,ce(_n(E.projectName)),1)],40,Ew)]),_:2},1032,["onClick","onKeydown"]),Gr(E)?(A(),P("ul",Nw,[(A(!0),P(We,null,Dt(zr(E),B=>(A(),P("li",{key:B.id,class:"thread-row-item","data-menu-open":ut(B.id)?"true":"false"},[Ne(mo,{class:"thread-row","data-active":B.id===e.selectedThreadId,"data-pinned":we(B.id),"data-menu-open":ut(B.id)?"true":"false","force-right-hover":ut(B.id),onMouseleave:y=>lt(B.id,y),onContextmenu:y=>Tt(y,B.id)},{left:pt(()=>[g("span",Fw,[Xn(B)?(A(),P("span",{key:0,class:"thread-status-indicator","data-state":er(B)},null,8,Bw)):ge("",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:y=>he(B.id)},[Ne(Di,{class:"thread-icon"})],8,qw)])]),right:pt(()=>[g("span",Gw,ce(Oe(B)),1)]),"right-hover":pt(()=>[g("div",{ref_for:!0,ref:y=>et(B.id,y),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:at(y=>zt(B.id),["stop"])},[Ne(cs,{class:"thread-icon"})],8,Kw)],512)]),default:pt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:y=>ke(B.id)},[g("span",Hw,[g("span",Ww,[g("span",Vw,ce(B.title),1),B.hasWorktree?(A(),it(wa,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),B.pendingRequestState?(A(),P("span",{key:1,class:"thread-row-request-chip","data-state":B.pendingRequestState},ce(Zn(B)),9,zw)):ge("",!0)])])],8,Uw)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,jw))),128))])):(A(),it(mo,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...k[17]||(k[17]=[g("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[k[18]||(k[18]=g("span",{class:"project-empty"},"No threads",-1))]),_:1})),an(E)?(A(),it(mo,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...k[19]||(k[19]=[g("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[g("button",{class:"thread-show-more-button",type:"button",onClick:B=>pn(E.projectName)},ce(Gt(E.projectName)?"Show less":"Show more"),9,Yw)]),_:2},1024)):ge("",!0)],12,xw))),128))],4)),(A(),it(ma,{to:"body"},[G.value?(A(),P("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:Re,class:"thread-menu-panel thread-menu-panel-fixed",style:Nr(m.value),"data-open-direction":sr(G.value.id),onClick:k[10]||(k[10]=at(()=>{},["stop"]))},[g("button",{class:"thread-menu-item",type:"button",onClick:k[5]||(k[5]=E=>yt(G.value.id))}," Browse files "),g("button",{class:"thread-menu-item",type:"button",onClick:k[6]||(k[6]=E=>qe(G.value.id))}," Export chat "),g("button",{class:"thread-menu-item",type:"button",onClick:k[7]||(k[7]=E=>Qe(G.value.id))}," Create chat fork "),g("button",{class:"thread-menu-item",type:"button",onClick:k[8]||(k[8]=E=>Ke(G.value.id,G.value.title))}," Rename thread "),g("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:k[9]||(k[9]=E=>Lt(G.value.id,G.value.title))}," Delete thread ")],12,Jw)):ge("",!0)])),(A(),it(ma,{to:"body"},[j.value?(A(),P("div",{key:0,class:"rename-thread-overlay",onClick:at(Wt,["self"])},[g("div",Qw,[k[20]||(k[20]=g("h3",{class:"rename-thread-title"},"Rename thread",-1)),k[21]||(k[21]=g("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),lr(g("input",{ref_key:"renameThreadInputRef",ref:M,"onUpdate:modelValue":k[11]||(k[11]=E=>X.value=E),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[tn(at(fn,["prevent"]),["enter"]),tn(at(Wt,["prevent"]),["esc"])]},null,40,Xw),[[Cr,X.value]]),g("div",{class:"rename-thread-actions"},[g("button",{class:"rename-thread-button",type:"button",onClick:Wt},"Cancel"),g("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:fn},"Save")])])])):ge("",!0)])),(A(),it(ma,{to:"body"},[L.value?(A(),P("div",{key:0,class:"rename-thread-overlay",onClick:at(Rt,["self"])},[g("div",Zw,[k[22]||(k[22]=g("h3",{class:"rename-thread-title"},"Delete thread?",-1)),g("p",ey,' This will archive the thread "'+ce(W.value)+'". You can find it later in archived threads. ',1),g("div",{class:"rename-thread-actions"},[g("button",{class:"rename-thread-button",type:"button",onClick:Rt},"Cancel"),g("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:hn},"Delete")])])])):ge("",!0)]))]))}}),ry=ht(ny,[["__scopeId","data-v-0a1e1517"]]),oy={class:"content-header"},sy={class:"content-leading"},ay={class:"content-title"},iy={class:"content-actions"},ly=dn({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(A(),P("header",oy,[g("div",sy,[xr(t.$slots,"leading",{},void 0)]),g("h1",ay,ce(e.title),1),g("div",iy,[xr(t.$slots,"actions",{},void 0)])]))}}),uy=ht(ly,[["__scopeId","data-v-66ee223c"]]),gc=.0025,Li=3,vc=2,cy=256;function dy(e){var de;const t=R("idle"),n=R(typeof navigator<"u"&&!!((de=navigator.mediaDevices)!=null&&de.getUserMedia)),r=R(0),o=R(null);let s=null,a=null,i=[],u=null,f=null,d=null,m=null,v=[],S=!1,j=!1,N=null;function X(){N&&(N.abort(),N=null),t.value==="transcribing"&&(t.value="idle")}function M(){const V=o.value;if(!V||typeof window>"u")return;const ie=V.getContext("2d");if(!ie)return;const Le=Math.max(1,Math.floor(V.clientWidth)),Ce=Math.max(1,Math.floor(V.clientHeight||36)),Se=window.devicePixelRatio||1,Re=Math.max(1,Math.floor(Le*Se)),_e=Math.max(1,Math.floor(Ce*Se));(V.width!==Re||V.height!==_e)&&(V.width=Re,V.height=_e),ie.setTransform(Se,0,0,Se,0,0),ie.clearRect(0,0,Le,Ce);const Fe=Math.max(12,Math.floor(Le/(Li+vc))),Ve=v.slice(-Fe),ee=Math.max(0,Fe-Ve.length),oe=Ce/2,pe=getComputedStyle(V).color||"#000000";for(let Ae=0;Ae<Fe;Ae+=1){const Ie=Ve[Ae-ee]??0,z=Math.max(.08,Math.min(1,Ie*18))*oe,ue=Ae*(Li+vc);ie.globalAlpha=Ie<=gc?.35:1,ie.fillStyle=pe,ie.fillRect(ue,oe-z,Li,z*2)}ie.globalAlpha=1}function L(){v=[],r.value=0,M()}function q(){d&&(d.disconnect(),d.onaudioprocess=null,d=null),f&&(f.disconnect(),f=null),u&&(u.close(),u=null),m=null}function W(V){if(typeof window>"u")return;const ie=window.webkitAudioContext,Le=window.AudioContext??ie;Le&&(q(),L(),u=new Le,f=u.createMediaStreamSource(V),d=u.createScriptProcessor(2048,1,1),m=performance.now(),d.onaudioprocess=Ce=>{const Se=Ce.inputBuffer.getChannelData(0);let Re=0;for(let _e=0;_e<Se.length;_e+=1){const Fe=Math.abs(Se[_e]??0);Re+=Fe<gc?0:Fe}v.push(Re/Se.length),v.length>cy&&v.shift(),m!==null&&(r.value=Math.max(0,performance.now()-m)),M()},f.connect(d),d.connect(u.destination),M())}async function ae(){var V;if(t.value==="transcribing"&&X(),!(t.value!=="idle"||!n.value||S)){S=!0,j=!1;try{a=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),i=[],s=new MediaRecorder(a),s.ondataavailable=ie=>{ie.data.size>0&&i.push(ie.data)},s.onstop=()=>{var Ce;const ie=i,Le=(s==null?void 0:s.mimeType)||((Ce=ie[0])==null?void 0:Ce.type)||"audio/webm";ye(),De(ie,Le)},W(a),s.start(250),t.value="recording",j&&Y()}catch(ie){ye(),t.value="idle",(V=e.onError)==null||V.call(e,ie)}finally{S=!1}}}function Y(){if(S&&t.value==="idle"){j=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function le(){j=!1,X(),ye(),t.value="idle"}async function De(V,ie){var Se,Re,_e,Fe,Ve;if(V.length===0){(Se=e.onEmpty)==null||Se.call(e),t.value="idle";return}const Le=new Blob(V,{type:ie});t.value="transcribing";let Ce=null;try{const ee=ie.split(/[/;]/)[1]??"webm",oe=new FormData;oe.append("file",Le,`codex.${ee}`);const pe=((Re=e.getLanguage)==null?void 0:Re.call(e).trim())??"";pe&&pe.toLowerCase()!=="auto"&&oe.append("language",pe),Ce=new AbortController,N=Ce;const Ae=await fetch("/codex-api/transcribe",{method:"POST",body:oe,signal:Ce.signal}),Ie=await Ae.text();let je=null;try{je=Ie.trim()?JSON.parse(Ie):null}catch{je=null}if(!Ae.ok){const ue=(_e=je==null?void 0:je.error)==null?void 0:_e.trim(),J=Ie.trim();throw new Error(ue||J||`Transcription failed: ${Ae.status}`)}const z=((je==null?void 0:je.text)??"").trim();z.length>0?e.onTranscript(z):(Fe=e.onEmpty)==null||Fe.call(e)}catch(ee){if(ee instanceof DOMException&&ee.name==="AbortError")return;(Ve=e.onError)==null||Ve.call(e,ee)}finally{Ce&&N===Ce&&(N=null),t.value==="transcribing"&&(t.value="idle")}}function ye(){q(),L(),s&&(s.ondataavailable=null,s.onstop=null,s=null),a&&(a.getTracks().forEach(V=>V.stop()),a=null),i=[]}xo(()=>{le()});function be(){if(t.value==="recording"){Y();return}(t.value==="idle"||t.value==="transcribing")&&ae()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:ae,stopRecording:Y,toggleRecording:be,cancel:le}}function wc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Fr extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Kl(e,t){const n=wc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=wc(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Hr(e,t,n){return e instanceof Fr?e:e instanceof Error?new Fr(e.message||t,{code:"unknown_error",method:n}):new Fr(t,{code:"unknown_error",method:n})}function kf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function fy(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(a){throw new Fr(a instanceof Error?a.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let o=null;try{o=await r.json()}catch{o=null}if(!r.ok)throw new Fr(Kl(o,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const s=o;if(!s||typeof s!="object"||!("result"in s))throw new Fr(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result}function hy(e){const t=kf(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 yc(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function py(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null;const o=()=>{r!==null&&(window.clearTimeout(r),r=null)},s=(f,d)=>{if(n||r!==null)return;const m=Math.min(1e3*2**d,1e4);r=window.setTimeout(()=>{r=null,!n&&f()},m)},a=f=>{const d=hy(f);d&&e(d)},i=(f=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const d=new EventSource("/codex-api/events");let m=!1;d.onmessage=v=>{try{a(JSON.parse(v.data))}catch{}},d.addEventListener("ready",v=>{try{const S=v.data?JSON.parse(v.data):{ok:!0};yc(e,S)}catch{yc(e)}}),d.onerror=()=>{n||m||d.readyState===EventSource.CLOSED&&(m=!0,d.close(),s(()=>i(f+1),f))},t=()=>{m=!0,d.close()}},u=(f=0)=>{if(typeof WebSocket>"u"||n){i();return}t==null||t();const d=window.location.protocol==="https:"?"wss:":"ws:",m=new WebSocket(`${d}//${window.location.host}/codex-api/ws`);let v=!1,S=!1,j=window.setTimeout(()=>{v||n||S||(S=!0,m.close(),i())},2500);m.onopen=()=>{v=!0,o(),j!==null&&(window.clearTimeout(j),j=null)},m.onmessage=N=>{try{a(JSON.parse(String(N.data)))}catch{}},m.onerror=()=>{},m.onclose=()=>{if(j!==null&&(window.clearTimeout(j),j=null),!(n||S)){if(!v){i();return}s(()=>u(f+1),f)}},t=()=>{S=!0,j!==null&&(window.clearTimeout(j),j=null),m.close()}};return typeof WebSocket<"u"?u():i(),()=>{n=!0,o(),t==null||t()}}async function my(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 Fr(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 Fr(Kl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function gy(){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 Fr(Kl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=kf(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function vy(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function qt(e){return vy(e)}function wy(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function yy(e){const t=qt(e).replace(/[\\/]+/gu,"/");return wy(t)?t.toLowerCase():t}function Do(e){const t=qt(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function Ni(e){const t=qt(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function Ns(e){return Do(e)||qt(e)||"unknown-project"}function bc(e){return new Date(e*1e3).toISOString()}function by(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Ty=/^##\s+(.+?):\s+(.+?)\s*$/,_y=/^#\s*files mentioned by the user\s*:?\s*$/i,Sy=/^(?:#{1,6}\s*)?(?:本次修改文件(?:和操作)?(?:如下)?|修改文件和操作)\s*[::]?\s*$/u;function xy(e){var o,s;const t=e.split(`
27
- `).findIndex(a=>_y.test(a.trim()));if(t<0)return[];const n=e.split(`
28
- `).slice(t+1),r=[];for(const a of n){const i=a.trim();if(!i)continue;const u=i.match(Ty);if(!u)break;const f=(o=u[1])==null?void 0:o.trim(),d=(s=u[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");f&&d&&r.push({label:f,path:d})}return r}function ky(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 o=r.index+r[0].length;return e.slice(o).trim()}function Cy(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],o=[];for(const[i,u]of t.entries())u.type==="text"&&typeof u.text=="string"&&u.text.length>0&&n.push(u.text),u.type==="image"&&typeof u.url=="string"&&u.url.trim().length>0&&r.push(u.url.trim()),u.type!=="text"&&u.type!=="image"&&o.push({id:`${e}:user-content:${i}`,role:"user",text:"",messageType:`userContent.${u.type}`,rawPayload:by(u),isUnhandled:!0});const s=n.join(`
29
- `),a=xy(s);return{text:ky(s),images:r,fileAttachments:a,rawBlocks:o}}function Ay(e){var s;const t=e.replace(/\r\n/g,`
30
- `).trim();if(!t)return null;const n=t.split(`
31
- `),r=[],o=[];for(const a of n){const i=a.trim();if(!i){r.length===0&&o.push("");continue}const u=i.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(u){const f=(u[1]??" ").toLowerCase(),d=(s=u[2])==null?void 0:s.trim();if(!d)continue;let m="pending";f==="x"&&(m="completed"),(f==="~"||f===">"||f==="-")&&(m="inProgress"),r.push({step:d,status:m});continue}o.push(i)}return r.length===0?null:{explanation:o.join(`
32
- `).trim()||void 0,steps:r}}function Ey(e){const t=e.join(" ").toLowerCase();return t.includes("重命名")||t.includes("移动")||t.includes("rename")||t.includes("renamed")||t.includes("move")||t.includes("moved")?"update":t.includes("删除")||t.includes("移除")||t.includes("delete")||t.includes("deleted")||t.includes("remove")||t.includes("removed")?"delete":t.includes("新增")||t.includes("添加")||t.includes("增加")||t.includes("add")||t.includes("added")||t.includes("create")||t.includes("created")?"add":"update"}function Iy(e){const t=e.match(/`([^`]+)`/u);return t!=null&&t[1]?t[1].trim():e.replace(/^[-*]\s+/u,"").trim()}function My(e){return/[\\/]/u.test(e)||/[A-Za-z0-9_.-]+\.[A-Za-z0-9_.-]+$/u.test(e)}function Ry(e){var s,a;const t=e.replace(/\r\n/g,`
33
- `).split(`
34
- `),n=t.findIndex(i=>Sy.test(i.trim()));if(n<0)return[];const r=[];let o=null;for(let i=n+1;i<t.length;i+=1){const u=t[i];if(!u.trim()){o&&(r.push(o),o=null);break}const d=u.match(/^(\s*)[-*]\s+(.+)$/u);if(!d){o&&(r.push(o),o=null);break}const m=((s=d[1])==null?void 0:s.length)??0,v=((a=d[2])==null?void 0:a.trim())??"";if(m<=1){o&&r.push(o);const S=Iy(v);o=My(S)?{path:S,details:[]}:null;continue}o&&v&&o.details.push(v)}return o&&r.push(o),r.map(i=>({path:i.path,operation:Ey(i.details),movedToPath:null,diff:"",addedLineCount:0,removedLineCount:0}))}function Tc(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
35
- `),n=t.endsWith(`
36
- `)?t.slice(0,-1):t;return n?n.split(`
37
- `).length:0}function Py(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
38
- `).split(`
39
- `))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function Cf(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function Af(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const o=r,s=typeof o.path=="string"?o.path:"",a=typeof o.diff=="string"?o.diff:"",i=o.kind,u=i==null?void 0:i.type;if(!s||u!=="add"&&u!=="delete"&&u!=="update")continue;const f=u==="update"&&typeof(i==null?void 0:i.move_path)=="string"?i.move_path:null,d=u==="update"?Py(a):u==="add"?{addedLineCount:Tc(a),removedLineCount:0}:{addedLineCount:0,removedLineCount:Tc(a)};n.push({path:s,operation:u,movedToPath:f,diff:a,...d})}return n}function $y(e){if(e.type==="agentMessage"){const t=Ry(e.text);return[{id:e.id,role:"assistant",text:e.text,messageType:e.type,fileChanges:t.length>0?t:void 0}]}if(e.type==="userMessage"){const t=Cy(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==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:Ay(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=Oy(t.status),r=typeof t.command=="string"?t.command:"",o=typeof t.cwd=="string"?t.cwd:null,s=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",a=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:o,status:n,aggregatedOutput:s,exitCode:a}}]}if(e.type==="fileChange"){const t=Af(e.changes),n=Cf(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function Oy(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Dy(e){const t=e,n=[t.name,t.title,e.preview];for(const r of n)if(typeof r=="string"&&r.trim().length>0)return r.trim();return""}function Ly(e){const t=Dy(e);return t.length>0?t:"Untitled thread"}function Yl(e){return(e==null?void 0:e.status)==="inProgress"}function Ny(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 Yl(r)}function jy(e){const t=e,n=qt(typeof t.cwd=="string"?t.cwd:e.cwd),r=yy(n),o=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||r.includes("/.codex/worktrees/")||r.includes("/.git/worktrees/");return{id:e.id,title:Ly(e),projectName:Ns(n),cwd:n,hasWorktree:o,createdAtIso:bc(e.createdAt),updatedAtIso:bc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Ny(e)}}function Fy(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((o,s)=>new Date(s.updatedAtIso).getTime()-new Date(o.updatedAtIso).getTime())})).sort((n,r)=>{var a,i;const o=new Date(((a=n.threads[0])==null?void 0:a.updatedAtIso)??0).getTime();return new Date(((i=r.threads[0])==null?void 0:i.updatedAtIso)??0).getTime()-o})}function By(e){const t=e.data.map(jy);return Fy(t)}function Jl(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const o=t[r],s=typeof(o==null?void 0:o.id)=="string"?o.id:void 0,a=Array.isArray(o.items)?o.items:[];for(const i of a)for(const u of $y(i))n.push({...u,turnId:s,turnIndex:r})}return n}function qy(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Yl(t.at(-1))}function Uy(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Yl(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const Hy=5e3;function ji(e){return e&&e.length>0?e:null}function Fi(e){return e&&e.length>0?e:null}const _c=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function Sc(e,t){const n=t.trim();if(!n)return"";const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[o="",s=""]=e.split("/",2),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=o&&s?`${a}\\s*/\\s*${i}`:r;return n.replace(/^[★☆*\s:|\-]+/u,"").replace(/^(sponsor|star)\s+/i,"").replace(new RegExp(`^${r}\\s*[-:|]*\\s*`,"i"),"").replace(new RegExp(`^${u}\\s*[-:|]*\\s*`,"i"),"").replace(/^(sponsor|star)\s+/i,"").trim()}function Ut(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ye(e){return typeof e=="string"&&e.length>0?e:null}function Qt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Aa(e){return typeof e=="boolean"?e:null}function Wy(e){return e==="payment_required"?e:null}function Vy(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function xc(e){const t=Ut(e);if(!t)return null;const n=Qt(t.usedPercent??t.used_percent);if(n===null)return null;const r=Qt(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:Qt(t.resetsAt??t.resets_at)}}function zy(e){const t=Ut(e);if(!t)return null;const n=Aa(t.hasCredits??t.has_credits),r=Aa(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:Ye(t.balance)}}function ml(e){const t=Ut(e);if(!t)return null;const n=xc(t.primary),r=xc(t.secondary),o=zy(t.credits);return!n&&!r&&!o?null:{limitId:Ye(t.limitId??t.limit_id),limitName:Ye(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:Ye(t.planType??t.plan_type)}}function Ef(e,t=null){const n=Ut(e);if(!n)return null;const r=Ye(n.accountId),o=Ye(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:Ye(n.authMode),email:Ye(n.email),planType:Ye(n.planType),lastRefreshedAtIso:Ye(n.lastRefreshedAtIso)??"",lastActivatedAtIso:Ye(n.lastActivatedAtIso),quotaSnapshot:ml(n.quotaSnapshot),quotaUpdatedAtIso:Ye(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:Ye(n.quotaError),unavailableReason:Wy(n.unavailableReason)??(Vy(Ye(n.quotaError))?"payment_required":null),isActive:Aa(n.isActive)??r===t}:null}function If(e){const t=Ut(e);if(!t)return null;const n=Ut(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=ml(n==null?void 0:n.codex);return r||ml(t.rateLimits??t.rate_limits)}async function Ht(e,t){try{return await fy(e,t)}catch(n){throw Hr(n,`RPC ${e} failed`,e)}}function Gy(e){const t=Ut(e);if(!t)return null;const n=Ye(t.path),r=Ye(t.operation);return!n||r!=="add"&&r!=="delete"&&r!=="update"?null:{path:n,operation:r,movedToPath:Ye(t.movedToPath)??null,diff:Ye(t.diff)??"",addedLineCount:Qt(t.addedLineCount)??0,removedLineCount:Qt(t.removedLineCount)??0}}function Ky(e){const t=Ut(e),n=Array.isArray(t==null?void 0:t.data)?t.data:[],r=[];for(const o of n){const s=Ut(o);if(!s)continue;const a=Ye(s.turnId),i=Qt(s.turnIndex),u=Array.isArray(s.fileChanges)?s.fileChanges.map(f=>Gy(f)).filter(f=>f!==null):[];!a||i===null||u.length===0||r.push({turnId:a,turnIndex:i,fileChanges:u})}return r}function Yy(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n={};for(let r=0;r<t.length;r+=1){const o=t[r];typeof(o==null?void 0:o.id)!="string"||o.id.length===0||(n[o.id]=r)}return n}async function Jy(e){const t=await fetch(`/codex-api/thread-file-change-fallback?threadId=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Fallback request failed with ${t.status}`);return Ky(await t.json())}function Qy(e,t){var u;if(t.length===0)return e;const n=new Map,r=new Set;for(const f of e){const d=typeof f.turnId=="string"&&f.turnId.length>0?f.turnId:void 0,m=typeof f.turnIndex=="number"?f.turnIndex:void 0;d&&m!==void 0&&n.set(d,m),(f.messageType==="fileChange"||Array.isArray(f.fileChanges)&&f.fileChanges.length>0)&&d&&r.add(d)}const o=t.filter(f=>n.has(f.turnId)&&!r.has(f.turnId)).map(f=>({id:`session-file-change:${f.turnId}`,role:"system",text:"",messageType:"fileChange",fileChangeStatus:"completed",fileChanges:f.fileChanges,turnId:f.turnId,turnIndex:n.get(f.turnId)??f.turnIndex}));if(o.length===0)return e;const s=new Map;for(const f of o){const d=f.turnIndex;if(typeof d!="number")continue;const m=s.get(d);m?m.push(f):s.set(d,[f])}const a=new Set,i=[];for(let f=0;f<e.length;f+=1){const d=e[f];i.push(d);const m=d.turnIndex;if(typeof m!="number"||a.has(m)||((u=e[f+1])==null?void 0:u.turnIndex)===m)continue;const S=s.get(m);!S||S.length===0||(i.push(...S),a.add(m))}return i}async function Xy(e,t){try{const n=await Jy(e);return Qy(t,n)}catch{return t}}function Zy(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function eb(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function tb(){const e=await Ht("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return By(e)}async function nb(e){const t=await Ht("thread/read",{threadId:e,includeTurns:!0}),n=Jl(t);return{messages:await Xy(e,n),inProgress:qy(t),activeTurnId:Uy(t),turnIndexByTurnId:Yy(t)}}async function rb(){try{return await tb()}catch(e){throw Hr(e,"Failed to load thread groups","thread/list")}}async function kc(e){try{return await nb(e)}catch(t){throw Hr(t,`Failed to load thread ${e}`,"thread/read")}}function ob(e){const t=Ut(e);if(!t)return null;const n=Ye(t.key),r=typeof t.text=="string"?t.text:"",o=Ye(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:Qt(t.oldLine),newLine:Qt(t.newLine)}}function sb(e){const t=Ut(e);if(!t)return null;const n=Ye(t.id),r=typeof t.header=="string"?t.header:"",o=typeof t.patch=="string"?t.patch:"";return n?{id:n,header:r,patch:o,addedLineCount:Qt(t.addedLineCount)??0,removedLineCount:Qt(t.removedLineCount)??0,oldStart:Qt(t.oldStart),oldLineCount:Qt(t.oldLineCount)??0,newStart:Qt(t.newStart),newLineCount:Qt(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>ob(s)).filter(s=>s!==null):[]}:null}function ab(e){const t=Ut(e);if(!t)return null;const n=Ye(t.id),r=Ye(t.path),o=Ye(t.absolutePath),s=Ye(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:Ye(t.previousPath),previousAbsolutePath:Ye(t.previousAbsolutePath),operation:s,addedLineCount:Qt(t.addedLineCount)??0,removedLineCount:Qt(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(a=>sb(a)).filter(a=>a!==null):[]}}function Mf(e){const t=Ut(e),n=Ut(t==null?void 0:t.data),r=Ut(n==null?void 0:n.summary),o=Ye(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=Ye(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:Ye(n==null?void 0:n.cwd)??"",gitRoot:Ye(n==null?void 0:n.gitRoot),isGitRepo:Aa(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:Ye(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(a=>Ye(a)).filter(a=>typeof a=="string"&&a.length>0):[],headBranch:Ye(n==null?void 0:n.headBranch),mergeBaseSha:Ye(n==null?void 0:n.mergeBaseSha),generatedAtIso:Ye(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:Qt(r==null?void 0:r.fileCount)??0,addedLineCount:Qt(r==null?void 0:r.addedLineCount)??0,removedLineCount:Qt(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(a=>ab(a)).filter(a=>a!==null):[]}}function ib(e){var r;const t=e.trim();if(!t)return{absolutePath:null,startLine:null,endLine:null};const n=t.match(/^(.*?):(\d+)-(\d+)$/u);return n?{absolutePath:((r=n[1])==null?void 0:r.trim())||null,startLine:Number(n[2]),endLine:Number(n[3])}:{absolutePath:t||null,startLine:null,endLine:null}}function lb(e){var a;const t=e.replace(/\r\n/g,`
40
- `).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,o=n>=0?t.slice(n).trim():"",s=[];if(o){const u=o.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let f=0;for(const d of u){const m=((a=d[1])==null?void 0:a.trim())??"",v=ib(d[2]??""),S=(d[0]??"").trim(),j=(d[3]??"").split(`
41
- `).map(N=>N.replace(/^ /u,"")).join(`
42
- `).trim();s.push({id:`finding:${f}`,title:m||`Finding ${f+1}`,body:j,path:v.absolutePath?v.absolutePath.split("/").filter(Boolean).slice(-1)[0]??v.absolutePath:null,absolutePath:v.absolutePath,startLine:v.startLine,endLine:v.endLine,rawText:S}),f+=1}}return{reviewText:t,summary:r,findings:s}}function Cc(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const o=n[r],s=Array.isArray(o==null?void 0:o.items)?o.items:[];for(let a=s.length-1;a>=0;a-=1){const i=s[a];if((i==null?void 0:i.type)!==t)continue;const u=typeof i.review=="string"?i.review.trim():"";if(u)return u}}return null}async function mk(e){const t=await Ht("thread/read",{threadId:e,includeTurns:!0}),n=Cc(t,"exitedReviewMode");return{enteredReviewLabel:Cc(t,"enteredReviewMode"),result:n?lb(n):null}}function ub(e){return py(e)}async function cb(e,t){await my({id:e,...t})}async function db(){return gy()}async function Ac(){try{const e=await Ht("account/rateLimits/read");return If(e)}catch(e){throw Hr(e,"Failed to load account rate limits","account/rateLimits/read")}}function Ql(e){const t=Ut(e),n=Ye(t==null?void 0:t.activeAccountId),r=Array.isArray(t==null?void 0:t.accounts)?t==null?void 0:t.accounts:[];return{activeAccountId:n,importedAccountId:Ye(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>Ef(o,n)).filter(o=>o!==null)}}async function fb(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(Dn(t,"Failed to load accounts"));const n=Ut(t);return Ql(n==null?void 0:n.data)}async function hb(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(Dn(t,"Failed to refresh accounts"));const n=Ut(t);return Ql(n==null?void 0:n.data)}async function pb(e){const t=await fetch("/codex-api/accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to switch account"));const r=Ut(n),o=Ut(r==null?void 0:r.data),s=Ef(o==null?void 0:o.account,Ye(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function mb(e){const t=await fetch("/codex-api/accounts/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to remove account"));const r=Ut(n);return Ql(r==null?void 0:r.data)}async function Bi(e){await Ht("thread/resume",{threadId:e})}async function gb(e){await Ht("thread/archive",{threadId:e})}async function vb(e,t){await Ht("thread/name/set",{threadId:e,name:t})}async function qi(e,t){const n=await Ht("thread/rollback",{threadId:e,numTurns:t});return Jl(n)}function gl(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""}function wb(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.cwd;if(typeof r=="string"&&r.length>0)return r}return""}async function Ec(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 Ht("thread/start",n),o=gl(r);if(!o)throw new Error("thread/start did not return a thread id");return o}catch(n){throw Hr(n,"Failed to start a new thread","thread/start")}}async function Ic(e,t,n){if(arguments.length<=1)try{const r=await Ht("thread/fork",{threadId:e,persistExtendedHistory:!0}),o=gl(r);if(!o)throw new Error("thread/fork did not return a thread id");return{threadId:o,cwd:wb(r),messages:Jl(r)}}catch(r){throw Hr(r,`Failed to fork thread ${e}`,"thread/fork")}try{const r=e.trim();if(!r)throw new Error("thread/fork requires threadId");const o={threadId:r};typeof t=="string"&&t.trim().length>0&&(o.cwd=t.trim()),typeof n=="string"&&n.trim().length>0&&(o.model=n.trim());const s=await Ht("thread/fork",o),a=gl(s);if(!a)throw new Error("thread/fork did not return a thread id");return a}catch(r){throw Hr(r,`Failed to fork thread ${e}`,"thread/fork")}}function yb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
43
- `;for(const r of t)n+=`
44
- ## ${r.label}: ${r.path}
45
- `;return`${n}
46
- ## My request for Codex:
47
-
48
- ${e}
49
- `}async function bb(e,t,n){var u;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?ji(n):Fi(n)};let o=null;try{o=await Pf()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?ji(n??(o==null?void 0:o.reasoningEffort)):Fi(n??(o==null?void 0:o.reasoningEffort))};let a=[];try{a=await Rf()}catch{a=[]}const i=((u=a.find(f=>f.trim().length>0))==null?void 0:u.trim())??"";if(i)return{model:i,reasoningEffort:e==="plan"?ji(n??(o==null?void 0:o.reasoningEffort)):Fi(n??(o==null?void 0:o.reasoningEffort))};throw new Error(`${e==="plan"?"Plan":"Default"} mode requires an available model. Wait for models to load and try again.`)}async function Ui(e,t,n=[],r,o,s,a=[],i){var u;try{const f=(r==null?void 0:r.trim())??"",m=[{type:"text",text:yb(t,a)}];for(const N of n){const X=N.trim();X&&m.push({type:"image",url:X,image_url:X})}if(s)for(const N of s)m.push({type:"skill",name:N.name,path:N.path});const v=a.map(N=>({label:N.label,path:N.path,fsPath:N.fsPath})),S={threadId:e,input:m};if(v.length>0&&(S.attachments=v),f&&(S.model=f),typeof o=="string"&&o.length>0&&(S.effort=o),i){const N=await bb(i,f,o);S.collaborationMode={mode:i,settings:{model:N.model,reasoning_effort:N.reasoningEffort,developer_instructions:null}}}const j=await Ht("turn/start",S);return typeof((u=j==null?void 0:j.turn)==null?void 0:u.id)=="string"?j.turn.id.trim():""}catch(f){throw Hr(f,`Failed to start turn for thread ${e}`,"turn/start")}}async function Tb(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 Ht("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Hr(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function _b(e){await Ht("setDefaultModel",{model:e})}async function Sb(e){const t=e==="fast"?"fast":"standard";await Ht("config/batchWrite",{edits:[{keyPath:"features.fast_mode",value:!0,mergeStrategy:"upsert"},{keyPath:"service_tier",value:t==="fast"?"fast":null,mergeStrategy:t==="fast"?"upsert":"replace"}],filePath:null,expectedVersion:null})}async function Rf(){const e=await Ht("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}try{const n=await fetch("/codex-api/provider-models",{signal:AbortSignal.timeout(Hy)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data))for(const o of r.data){if(typeof o!="string")continue;const s=o.trim();!s||t.includes(s)||t.push(s)}}catch{}return t}async function Pf(){const e=await Ht("config/read",{}),t=e.config.model??"",n=Zy(e.config.model_reasoning_effort),r=eb(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function xb(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function kb(){try{const e=await Ht("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const o=r.mode;o!=="default"&&o!=="plan"||t.has(o)||(t.add(o),n.push({value:o,label:xb(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of _c)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return _c}function Cb(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=s=>{if(!Array.isArray(s))return[];const a=[];for(const i of s)typeof i=="string"&&i.length>0&&!a.includes(i)&&a.push(i);return a},r=t.labels,o={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[s,a]of Object.entries(r)){const i=typeof s=="string"?qt(s):"";i.length>0&&typeof a=="string"&&(o[i]=a)}return{order:n(t.order).map(s=>qt(s)),labels:o,active:n(t.active).map(s=>qt(s))}}async function hs(){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 Cb(n.data)}async function Ab(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,cwd:qt(n.data.cwd),gitRoot:qt(n.data.gitRoot)}}async function gk(e,t,n,r){const o=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&o.set("baseBranch",r.trim());const s=await fetch(`/codex-api/review/snapshot?${o.toString()}`),a=await s.json();if(!s.ok)throw new Error(Dn(a,"Failed to load review snapshot"));return Mf(a)}async function vk(e){const t=await fetch("/codex-api/review/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to apply review action"));return Mf(n)}async function wk(e){const t=await fetch("/codex-api/review/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to initialize Git"))}async function yk(e,t,n,r){const o=t==="baseBranch"?{type:"baseBranch",branch:(r??"").trim()}:{type:"uncommittedChanges"};if(o.type==="baseBranch"&&!o.branch)throw new Error("Base branch is unavailable");await Ht("review/start",{threadId:e,target:o,delivery:"inline"})}async function Mc(){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 Eb(e,t){const n=new URLSearchParams({path:e});(t==null?void 0:t.showHidden)===!0&&n.set("showHidden","1");const r=await fetch(`/codex-local-directories?${n.toString()}`),o=await $f(r);if(!r.ok){const u=Dn(o,"Failed to load local directories");throw new Error(u)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{},i=Array.isArray(a.entries)?a.entries:[];return{path:typeof a.path=="string"?qt(a.path):"",parentPath:typeof a.parentPath=="string"?qt(a.parentPath):"",entries:i.flatMap(u=>{if(!u||typeof u!="object"||Array.isArray(u))return[];const f=u,d=typeof f.name=="string"?f.name.trim():"",m=typeof f.path=="string"?qt(f.path):"";return d&&m?[{name:d,path:m}]:[]})}}async function $f(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function Rc(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 Pc(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 i=Dn(r,"Failed to open project root");throw new Error(i)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return typeof s.path=="string"?qt(s.path):""}async function Ib(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await $f(t);if(!t.ok){const s=Dn(n,"Failed to create local directory");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof o.path=="string"?qt(o.path):""}async function Mb(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 a=Dn(r,"Failed to suggest project name");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return{name:typeof s.name=="string"?s.name.trim():"",path:typeof s.path=="string"?qt(s.path):""}}async function Rb(e,t,n=20){const r=e.trim();if(!r)return[];const o=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),s=await o.json();if(!o.ok){const f=Dn(s,"Failed to search files");throw new Error(f)}const a=s&&typeof s=="object"&&!Array.isArray(s)?s:{},i=Array.isArray(a.data)?a.data:[],u=[];for(const f of i){if(!f||typeof f!="object"||Array.isArray(f))continue;const m=f.path,v=typeof m=="string"?m.trim():"";v&&u.push({path:v})}return u}async function Pb(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}}async function $b(e){const t=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e})}),n=await t.json();if(!t.ok){const r=Dn(n,"Failed to connect Telegram bot");throw new Error(r)}}async function Ob(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=Dn(t,"Failed to load Telegram status");throw new Error(o)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return{configured:r.configured===!0,active:r.active===!0,mappedChats:typeof r.mappedChats=="number"?r.mappedChats:0,mappedThreads:typeof r.mappedThreads=="number"?r.mappedThreads:0,lastError:typeof r.lastError=="string"?r.lastError:""}}function Db(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function Lb(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const d=new Date;e==="search-daily"?d.setUTCDate(d.getUTCDate()-1):e==="search-weekly"?d.setUTCDate(d.getUTCDate()-7):d.setUTCDate(d.getUTCDate()-30);const m=new URLSearchParams({q:`created:>=${Db(d)}`,sort:"stars",order:"desc",per_page:String(n)}),v=await fetch(`https://api.github.com/search/repositories?${m.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!v.ok)throw new Error(`Failed to fetch GitHub search projects (${v.status})`);const S=await v.json(),j=S&&typeof S=="object"&&!Array.isArray(S)?S:{},N=Array.isArray(j.items)?j.items:[],X=[];for(const M of N){if(!M||typeof M!="object"||Array.isArray(M))continue;const L=M,q=typeof L.id=="number"?L.id:0,W=typeof L.full_name=="string"?L.full_name.trim():"",ae=typeof L.html_url=="string"?L.html_url.trim():"";if(!q||!W||!ae)continue;const[Y="",le=""]=W.split("/",2);X.push({id:q,fullName:W,owner:Y,repo:le,url:ae,description:Sc(W,typeof L.description=="string"?L.description:""),language:typeof L.language=="string"?L.language.trim():"",stars:typeof L.stargazers_count=="number"?L.stargazers_count:0})}return X}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",o=new URLSearchParams({since:r,limit:String(n)}),s=await fetch(`/codex-api/github-trending?${o.toString()}`),a=await s.json();if(!s.ok){const d=Dn(a,"Failed to fetch GitHub trending projects");throw new Error(d)}const i=a&&typeof a=="object"&&!Array.isArray(a)?a:{},u=Array.isArray(i.data)?i.data:[],f=[];for(const d of u){if(!d||typeof d!="object"||Array.isArray(d))continue;const m=d,v=typeof m.id=="number"?m.id:0,S=typeof m.fullName=="string"?m.fullName.trim():"",j=typeof m.url=="string"?m.url.trim():"";if(!v||!S||!j)continue;const[N="",X=""]=S.split("/",2);f.push({id:v,fullName:S,owner:N,repo:X,url:j,description:Sc(S,typeof m.description=="string"?m.description:""),language:typeof m.language=="string"?m.language.trim():"",stars:typeof m.stars=="number"?m.stars:0})}return f}function Dn(e,t){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.message;if(typeof r=="string"&&r.trim().length>0)return r;const o=n.error;return typeof o=="string"&&o.trim().length>0?o:t}async function Nb(){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 Hi(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 jb(e,t){var n;try{return((n=(await Ht("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function Fb(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Ht("skills/list",t),r=[],o=new Set;for(const s of n.data)for(const a of s.skills)!a.name||o.has(a.path)||(o.add(a.path),r.push({name:a.name,description:a.shortDescription||a.description||"",path:a.path,scope:a.scope,enabled:a.enabled}));return r}catch{return[]}}const Bb=6e4;async function Wi(e){const t=new AbortController,n=setTimeout(()=>t.abort(),Bb);try{const r=new FormData;r.append("file",e);const o=await fetch("/codex-api/upload-file",{method:"POST",body:r,signal:t.signal});return o.ok?(await o.json()).path??null:null}catch{return null}finally{clearTimeout(n)}}const qb={},Ub={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hb(e,t){return A(),P("svg",Ub,[...t[0]||(t[0]=[g("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 Wb=ht(qb,[["render",Hb]]),Vb={},zb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gb(e,t){return A(),P("svg",zb,[...t[0]||(t[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3L4 14h6l-1 7l9-11h-6z"},null,-1)])])}const Kb=ht(Vb,[["render",Gb]]),Yb={},Jb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qb(e,t){return A(),P("svg",Jb,[...t[0]||(t[0]=[g("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 Xb=ht(Yb,[["render",Qb]]),Zb={},e0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function t0(e,t){return A(),P("svg",e0,[...t[0]||(t[0]=[g("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),g("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 $c=ht(Zb,[["render",t0]]),n0=["disabled"],r0={class:"composer-dropdown-value"},o0={class:"composer-dropdown-menu"},s0={key:0,class:"composer-dropdown-search-wrap"},a0=["placeholder","onKeydown"],i0={class:"composer-dropdown-options",role:"listbox"},l0=["onClick"],u0={key:0,class:"composer-dropdown-empty"},c0={key:1,class:"composer-dropdown-add-wrap"},d0=["placeholder","onKeydown"],f0=dn({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},addActionMode:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add","add-action"],setup(e,{emit:t}){const n=e,r=t,o=R(null),s=R(null),a=R(null),i=R(!1),u=R(""),f=R(!1),d=R(""),m=te(()=>{var V;const de=n.options.find(ie=>ie.value===n.modelValue);return de?de.label:((V=n.placeholder)==null?void 0:V.trim())||""}),v=te(()=>n.openDirection??"down"),S=te(()=>n.enableSearch===!0),j=te(()=>n.showAddAction===!0),N=te(()=>{var de;return((de=n.searchPlaceholder)==null?void 0:de.trim())||"Quick search projects"}),X=te(()=>{var de;return((de=n.addActionLabel)==null?void 0:de.trim())||"Add new project"}),M=te(()=>n.addActionMode??"inline"),L=te(()=>{var de;return((de=n.addPlaceholder)==null?void 0:de.trim())||"Project name or absolute path"}),q=te(()=>{const de=u.value.trim().toLowerCase();return de?n.options.filter(V=>V.label.toLowerCase().includes(de)||V.value.toLowerCase().includes(de)):n.options});function W(){n.disabled||(i.value=!i.value)}function ae(de){r("update:modelValue",de),i.value=!1,u.value=""}function Y(){var de;if(M.value==="event"){r("add-action"),i.value=!1,u.value="";return}f.value=!0,d.value=((de=n.defaultAddValue)==null?void 0:de.trim())||"",Bt(()=>{var V;return(V=a.value)==null?void 0:V.focus()})}function le(){if(u.value.length>0){u.value="";return}i.value=!1}function De(){const de=d.value.trim();de&&(r("add",de),f.value=!1,d.value="",i.value=!1,u.value="")}function ye(){f.value=!1,d.value="",i.value=!1,u.value=""}function be(de){if(!i.value)return;const V=o.value;if(!V)return;const ie=de.target;ie instanceof Node&&(V.contains(ie)||(i.value=!1,u.value="",f.value=!1,d.value=""))}return rt(i,de=>{if(!de){f.value=!1,d.value="";return}S.value&&Bt(()=>{var V;return(V=s.value)==null?void 0:V.focus()})}),So(()=>{window.addEventListener("pointerdown",be)}),xo(()=>{window.removeEventListener("pointerdown",be)}),(de,V)=>(A(),P("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[g("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:W},[e.selectedPrefixIcon?(A(),it(Ll(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ge("",!0),g("span",r0,ce(m.value),1),Ne(zl,{class:"composer-dropdown-chevron"})],8,n0),i.value?(A(),P("div",{key:0,class:tt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":v.value==="up","composer-dropdown-menu-wrap-down":v.value==="down"}])},[g("div",o0,[S.value?(A(),P("div",s0,[lr(g("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":V[0]||(V[0]=ie=>u.value=ie),class:"composer-dropdown-search-input",type:"text",placeholder:N.value,onKeydown:tn(at(le,["prevent"]),["esc"])},null,40,a0),[[Cr,u.value]])])):ge("",!0),g("ul",i0,[(A(!0),P(We,null,Dt(q.value,ie=>(A(),P("li",{key:ie.value},[g("button",{class:tt(["composer-dropdown-option",{"is-selected":ie.value===e.modelValue}]),type:"button",onClick:Le=>ae(ie.value)},ce(ie.label),11,l0)]))),128)),q.value.length===0?(A(),P("li",u0," No matching projects ")):ge("",!0)]),j.value?(A(),P("div",c0,[f.value?(A(),P(We,{key:0},[lr(g("input",{ref_key:"addInputRef",ref:a,"onUpdate:modelValue":V[1]||(V[1]=ie=>d.value=ie),class:"composer-dropdown-add-input",type:"text",placeholder:L.value,onKeydown:[tn(at(De,["prevent"]),["enter"]),tn(at(ye,["prevent"]),["esc"])]},null,40,d0),[[Cr,d.value]]),g("div",{class:"composer-dropdown-add-actions"},[g("button",{type:"button",class:"composer-dropdown-add-btn",onClick:De},"Open"),g("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ye},"Cancel")])],64)):(A(),P("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:Y},ce(X.value),1))])):ge("",!0)])],2)):ge("",!0)],512))}}),Ts=ht(f0,[["__scopeId","data-v-a4e92c86"]]),h0=["disabled"],p0={class:"search-dropdown-value"},m0={class:"search-dropdown-search-wrap"},g0=["placeholder","onKeydown"],v0={key:0,class:"search-dropdown-list",role:"listbox"},w0=["onClick","onPointerenter"],y0={class:"search-dropdown-option-check"},b0={class:"search-dropdown-option-label"},T0={key:0,class:"search-dropdown-option-desc"},_0={key:1,class:"search-dropdown-empty"},S0=dn({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=R(null),s=R(null),a=R(null),i=R(!1),u=R(""),f=R(0),d=te(()=>n.openDirection??"down"),m=te(()=>new Set(n.selectedValues)),v=te(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const W=n.options.find(ae=>ae.value===n.selectedValues[0]);return(W==null?void 0:W.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),S=te(()=>{const W=u.value.toLowerCase().trim();return W?n.options.filter(ae=>{var Y;return ae.label.toLowerCase().includes(W)||(((Y=ae.description)==null?void 0:Y.toLowerCase().includes(W))??!1)}):n.options});function j(){const W=s.value,ae=o.value;if(!W||!ae||window.innerWidth>=640)return;const Y=ae.getBoundingClientRect();d.value==="up"?(W.style.setProperty("bottom",`${window.innerHeight-Y.top+8}px`,"important"),W.style.setProperty("top","auto","important")):(W.style.setProperty("top",`${Y.bottom+8}px`,"important"),W.style.setProperty("bottom","auto","important"))}function N(){n.disabled||(i.value=!i.value,i.value&&(u.value="",f.value=0,Bt(()=>{var W;Bt(()=>{j()}),(W=a.value)==null||W.focus()})))}function X(W){r("toggle",W.value,!m.value.has(W.value)),i.value=!1}function M(W){S.value.length!==0&&(f.value=(f.value+W+S.value.length)%S.value.length)}function L(){const W=S.value[f.value];W&&X(W)}function q(W){if(!i.value)return;const ae=o.value;if(!ae)return;const Y=W.target;Y instanceof Node&&(ae.contains(Y)||(i.value=!1))}return rt(u,()=>{f.value=0}),So(()=>window.addEventListener("pointerdown",q)),xo(()=>window.removeEventListener("pointerdown",q)),(W,ae)=>(A(),P("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[g("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:N},[g("span",p0,ce(v.value),1),Ne(zl,{class:"search-dropdown-chevron"})],8,h0),i.value?(A(),P("div",{key:0,ref_key:"menuRef",ref:s,class:tt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[g("div",m0,[lr(g("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":ae[0]||(ae[0]=Y=>u.value=Y),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[ae[1]||(ae[1]=tn(at(Y=>i.value=!1,["prevent"]),["escape"])),tn(at(L,["prevent"]),["enter"]),ae[2]||(ae[2]=tn(at(Y=>M(1),["prevent"]),["arrow-down"])),ae[3]||(ae[3]=tn(at(Y=>M(-1),["prevent"]),["arrow-up"]))]},null,40,g0),[[Cr,u.value]])]),S.value.length>0?(A(),P("ul",v0,[(A(!0),P(We,null,Dt(S.value,(Y,le)=>(A(),P("li",{key:Y.value},[g("button",{class:tt(["search-dropdown-option",{"is-selected":m.value.has(Y.value),"is-highlighted":le===f.value}]),type:"button",onClick:De=>X(Y),onPointerenter:De=>f.value=le},[g("span",y0,ce(m.value.has(Y.value)?"✓":""),1),g("span",b0,ce(Y.label),1),Y.description?(A(),P("span",T0,ce(Y.description),1)):ge("",!0)],42,w0)]))),128))])):(A(),P("div",_0,"No results"))],2)):ge("",!0)],512))}}),x0=ht(S0,[["__scopeId","data-v-2f2baf53"]]),k0={class:"skill-picker-header"},C0=["onKeydown"],A0={key:0,class:"skill-picker-list",role:"listbox"},E0=["onClick","onPointerenter"],I0={class:"skill-picker-name"},M0={key:0,class:"skill-picker-desc"},R0={key:1,class:"skill-picker-empty"},P0=dn({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=R(null),s=R(null),a=R(""),i=R(0),u=te(()=>{const v=a.value.toLowerCase().trim();return v?n.skills.filter(S=>S.name.toLowerCase().includes(v)||S.description.toLowerCase().includes(v)):n.skills}),f=te(()=>{const v={};return n.anchorBottom!=null&&(v.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(v.left=`${n.anchorLeft}px`),v});function d(v){u.value.length!==0&&(i.value=(i.value+v+u.value.length)%u.value.length)}function m(){const v=u.value[i.value];v&&r("select",v)}return rt(()=>n.visible,v=>{v&&(a.value="",i.value=0,Bt(()=>{var S;return(S=s.value)==null?void 0:S.focus()}))}),rt(a,()=>{i.value=0}),(v,S)=>e.visible?(A(),P("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:Nr(f.value)},[g("div",k0,[lr(g("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":S[0]||(S[0]=j=>a.value=j),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[S[1]||(S[1]=tn(at(j=>v.$emit("close"),["prevent"]),["escape"])),tn(at(m,["prevent"]),["enter"]),S[2]||(S[2]=tn(at(j=>d(1),["prevent"]),["arrow-down"])),S[3]||(S[3]=tn(at(j=>d(-1),["prevent"]),["arrow-up"]))]},null,40,C0),[[Cr,a.value]])]),u.value.length>0?(A(),P("ul",A0,[(A(!0),P(We,null,Dt(u.value,(j,N)=>(A(),P("li",{key:j.path},[g("button",{class:tt(["skill-picker-item",{"is-highlighted":N===i.value}]),type:"button",onClick:X=>v.$emit("select",j),onPointerenter:X=>i.value=N},[g("span",I0,ce(j.name),1),j.description?(A(),P("span",M0,ce(j.description),1)):ge("",!0)],42,E0)]))),128))])):(A(),P("div",R0,"No skills found"))],4)):ge("",!0)}}),$0=ht(P0,[["__scopeId","data-v-ff3fb7dc"]]),O0={key:0,class:"thread-composer-dictation-error"},D0={key:0,class:"thread-composer-attachments"},L0=["src","alt"],N0=["aria-label","disabled","onClick"],j0={key:1,class:"thread-composer-folder-chips"},F0=["title"],B0={class:"thread-composer-folder-chip-meta"},q0=["aria-label","disabled","onClick"],U0={key:2,class:"thread-composer-file-chips"},H0=["title"],W0=["aria-label","disabled","onClick"],V0={key:3,class:"thread-composer-skill-chips"},z0={class:"thread-composer-skill-chip-name"},G0=["aria-label","onClick"],K0={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},Y0={key:1,class:"thread-composer-file-mentions"},J0=["onMousedown"],Q0={key:1,class:"thread-composer-file-mention-icon-markdown"},X0={class:"thread-composer-file-mention-text"},Z0={class:"thread-composer-file-mention-name"},eT={key:0,class:"thread-composer-file-mention-dir"},tT={key:1,class:"thread-composer-file-mention-empty"},nT=["placeholder","disabled"],rT=["disabled"],oT={key:0,class:"thread-composer-attach-menu"},sT=["disabled"],aT=["disabled"],iT=["disabled"],lT={class:"thread-composer-attach-mode"},uT={class:"thread-composer-attach-mode-buttons"},cT=["disabled"],dT=["disabled"],fT=["aria-checked","aria-label","disabled"],hT={class:"thread-composer-attach-setting-copy"},pT={class:"thread-composer-attach-setting-description"},mT=["aria-checked","aria-label","disabled"],gT={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},vT={key:1,class:"thread-composer-dictation-timer"},wT=["aria-label","title","disabled"],yT=["disabled"],bT=["aria-label","title","disabled"],TT=["disabled"],_T=["disabled"],ST=["disabled"],xT=2e3,kT="codex-web-local.thread-draft.v1.",CT=dn({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=R(""),a=R([]),i=R([]),u=R([]),f=R([]),d=R(""),m=R(0),v=R(null),S=R(!1),{state:j,isSupported:N,recordingDurationMs:X,waveformCanvasRef:M,startRecording:L,stopRecording:q,toggleRecording:W,cancel:ae}=dy({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:y=>{if(s.value=s.value?`${s.value}
50
- ${y}`:y,d.value="",r.dictationAutoSend!==!1){const C=r.isTurnInProgress?he.value:"steer";lt(C);return}Bt(()=>{var C;return(C=be.value)==null?void 0:C.focus()})},onEmpty:()=>{d.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:y=>{if(y instanceof DOMException&&y.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=y instanceof Error?y.message:"Dictation failed."}}),Y=R(null),le=R(null),De=R(null),ye=R(null),be=R(null),{isMobile:de}=Vl(),V=R(!1),ie=R(!1),Le=R(null),Ce=R(""),Se=R([]),Re=R(!1),_e=R(0),Fe=R(0);let Ve=0,ee=null,oe=!1,pe=0,Ae=0;const Ie=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let je="";const z=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function ue(y){return y.trim().replace(/^gpt/i,"GPT")}const J=te(()=>r.models.map(y=>({value:y,label:ue(y)}))),Ee=te(()=>r.selectedCollaborationMode==="plan"),ze=te(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),_=te(()=>r.skills??[]),x=te(()=>i.value.map(y=>y.path)),$=te(()=>(r.skills??[]).map(y=>({value:y.path,label:y.name,description:y.description}))),G=te(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||ze.value||m.value>0?!1:s.value.trim().length>0||a.value.length>0||u.value.length>0),Q=te(()=>s.value.trim().length>0||a.value.length>0||i.value.length>0||u.value.length>0||f.value.length>0),K=te(()=>{const y=new Set;for(const C of f.value)for(const H of C.filePaths)y.add(H);return u.value.filter(C=>!y.has(C.fsPath))}),ne=te(()=>r.disabled||!r.activeThreadId),fe=te(()=>r.selectedModel.trim()==="gpt-5.4"),se=te(()=>r.selectedSpeedMode==="fast"&&fe.value),Z=te(()=>ne.value||r.isUpdatingSpeedMode===!0),Oe=te(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),we=te(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),he=R(we.value),ke=te(()=>j.value==="recording"),qe=te(()=>j.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),Qe=te(()=>j.value==="idle"?d.value.trim():""),Ze=te(()=>{const y=Math.max(0,Math.floor(X.value/1e3)),C=Math.floor(y/60),H=y%60;return`${C}:${String(H).padStart(2,"0")}`}),wt=te(()=>r.activeThreadId?ze.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),yt=te(()=>s.value.trim().length>0||a.value.length>0||u.value.length>0);function lt(y="steer"){var H;const C=s.value.trim();if(G.value){if(o("submit",{text:C,imageUrls:a.value.map(ve=>ve.url),fileAttachments:[...u.value],skills:i.value.map(ve=>({name:ve.name,path:ve.path})),mode:y}),fn(r.activeThreadId),zt(),f.value=[],V.value=!1,ie.value=!1,vn(),Ie||de.value){(H=be.value)==null||H.blur();return}Bt(()=>{var ve;return(ve=be.value)==null?void 0:ve.focus()})}}function ut(y){he.value=y}function bt(y){Fe.value+=1,s.value=y.text,a.value=y.imageUrls.map((C,H)=>({id:`queued-${Date.now()}-${H}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${H+1}`,url:C})),i.value=y.skills.map(C=>(r.skills??[]).find(H=>H.path===C.path)??{name:C.name,description:"",path:C.path}),u.value=y.fileAttachments.map(C=>({...C})),f.value=[],d.value="",v.value=null,m.value=0,V.value=!1,ie.value=!1,vn(),Ae+=1}function zt(){bt({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Tt(y){return`${kT}${y}`}function Ke(y){if(typeof window>"u")return null;const C=y.trim();if(!C)return null;try{const H=window.localStorage.getItem(Tt(C));if(!H)return null;const ve=JSON.parse(H);return typeof ve=="string"?{text:ve,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof ve.text=="string"?ve.text:"",imageUrls:Array.isArray(ve.imageUrls)?ve.imageUrls.filter(Je=>typeof Je=="string"):[],fileAttachments:Array.isArray(ve.fileAttachments)?ve.fileAttachments.filter(Je=>!!Je&&typeof Je.label=="string"&&typeof Je.path=="string"&&typeof Je.fsPath=="string"):[],skills:Array.isArray(ve.skills)?ve.skills.filter(Je=>!!Je&&typeof Je.name=="string"&&typeof Je.path=="string"):[]}}catch{return null}}function Wt(y,C){if(typeof window>"u")return;const H=y.trim();if(H)try{if(C.text.trim().length>0||C.imageUrls.length>0||C.fileAttachments.length>0||C.skills.length>0){window.localStorage.setItem(Tt(H),JSON.stringify(C));return}window.localStorage.removeItem(Tt(H))}catch{}}function fn(y){Wt(y,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Lt(){return{text:s.value,imageUrls:a.value.map(y=>y.url),fileAttachments:u.value.map(y=>({...y})),skills:i.value.map(y=>({name:y.name,path:y.path}))}}function Rt(){o("interrupt")}function hn(y){o("update:selected-model",y)}function _n(){o("update:selected-collaboration-mode",Ee.value?"default":"plan")}function Yn(y){o("update:selected-reasoning-effort",y)}function nn(){Z.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function Sn(){r.dictationClickToToggle&&(d.value&&(d.value=""),W())}function Un(y){if(r.dictationClickToToggle||(y.preventDefault(),oe))return;oe=!0;const C=y.currentTarget;if(C)try{C.setPointerCapture(y.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",Nt),window.addEventListener("pointercancel",Nt),window.addEventListener("blur",Nt),L()}function Nt(){r.dictationClickToToggle||oe&&(oe=!1,window.removeEventListener("pointerup",Nt),window.removeEventListener("pointercancel",Nt),window.removeEventListener("blur",Nt),q())}function Ar(){ne.value||(V.value=!V.value)}function Hn(){var y;(y=le.value)==null||y.click()}function Jn(){var y;(y=De.value)==null||y.click()}function Vr(){var y;(y=ye.value)==null||y.click()}function Gt(y){a.value=a.value.filter(C=>C.id!==y)}function nt(y){i.value=i.value.filter(C=>C.path!==y)}function pn(y){u.value=u.value.filter(C=>C.fsPath!==y)}function mn(y){const C=f.value.find(ve=>ve.id===y);if(!C)return;const H=new Set(C.filePaths);u.value=u.value.filter(ve=>!H.has(ve.fsPath)),f.value=f.value.filter(ve=>ve.id!==y)}function Zt(y){return y.total<=0?0:Math.round(y.processed/y.total*100)}function It(y,C){const H=y.replace(/\\/g,"/");if(u.value.some(Et=>Et.fsPath===H))return;const ve=H.split("/").filter(Boolean),Je=(C==null?void 0:C.trim())||ve[ve.length-1]||H;u.value=[...u.value,{label:Je,path:H,fsPath:H}]}function et(y){return y.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(y.name)}function Wn(y){return y?Array.from(y):[]}function ot(y){return y!==Ae?!1:(m.value+=1,!0)}function ct(y){y===Ae&&(m.value=Math.max(0,m.value-1))}function sr(y){if(y<=0)return;const C=v.value,H=C?C.succeeded+C.failed:0;if(!C||H>=C.total){v.value={total:y,succeeded:0,failed:0};return}v.value={...C,total:C.total+y}}function rn(y){const C=v.value;C&&(v.value={...C,succeeded:C.succeeded+(y==="success"?1:0),failed:C.failed+(y==="failure"?1:0)})}function xn(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Ln(y){const C=new Date,H=[C.getFullYear(),String(C.getMonth()+1).padStart(2,"0"),String(C.getDate()).padStart(2,"0"),String(C.getHours()).padStart(2,"0"),String(C.getMinutes()).padStart(2,"0"),String(C.getSeconds()).padStart(2,"0")].join("-"),ve=y.type.startsWith("image/")&&y.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${H}.${ve}`}function Nn(){const y=new Date;return`pasted-text-${[y.getFullYear(),String(y.getMonth()+1).padStart(2,"0"),String(y.getDate()).padStart(2,"0"),String(y.getHours()).padStart(2,"0"),String(y.getMinutes()).padStart(2,"0"),String(y.getSeconds()).padStart(2,"0")].join("-")}.txt`}function en(y){return y.name.trim()?y:new File([y],Ln(y),{type:y.type||"image/png",lastModified:Date.now()})}function kn(y){return new Promise((C,H)=>{const ve=new FileReader;ve.onload=()=>{if(typeof ve.result=="string"){C(ve.result);return}H(new Error("Image read returned an unsupported result"))},ve.onerror=()=>{H(ve.error??new Error("Image read failed"))},ve.readAsDataURL(y)})}async function Vn(y,C){if(ot(C))try{const H=en(y),ve=await kn(H);if(C!==Ae)return;a.value=[...a.value,{id:xn(),name:H.name,url:ve}],rn("success")}catch{C===Ae&&rn("failure")}finally{ct(C)}}async function Vt(y,C){if(ot(C))try{const H=await Wi(y);if(C!==Ae)return;if(!H){rn("failure");return}It(H),rn("success")}catch{C===Ae&&rn("failure")}finally{ct(C)}}function on(y){const C=Wn(y);if(C.length===0)return;sr(C.length),V.value=!1,ie.value=!1,vn();const H=Ae;for(const ve of C)et(ve)?Vn(ve,H):Vt(ve,H)}function gn(){pe=0,S.value=!1}function jt(y){if(!y||y.length===0)return;const C=Fe.value;for(const H of Array.from(y))if(et(H)){const ve=new FileReader;ve.onload=()=>{C===Fe.value&&typeof ve.result=="string"&&a.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:H.name,url:ve.result})},ve.readAsDataURL(H)}else Wi(H).then(ve=>{C===Fe.value&&ve&&It(ve)}).catch(()=>{})}function zn(y){return y?Array.from(y.types??[]).includes("Files"):!1}async function Cn(y){if(!y||y.length===0)return;const C=Fe.value,H=Array.from(y),Je=(H[0].webkitRelativePath||H[0].name).split("/").filter(Boolean)[0]||"Folder",Et=`${Date.now()}-${Math.random().toString(36).slice(2)}`;f.value=[...f.value,{id:Et,name:Je,total:H.length,processed:0,filePaths:[],isUploading:!0}];const $t=kt=>{C===Fe.value&&(f.value=f.value.map(Kt=>Kt.id===Et?kt(Kt):Kt))};for(const kt of H)try{const Kt=await Wi(kt);if(C!==Fe.value)return;if(Kt){const Yr=kt.webkitRelativePath||kt.name;It(Kt,Yr),$t(io=>({...io,processed:io.processed+1,filePaths:[...io.filePaths,Kt]}));continue}$t(Yr=>({...Yr,processed:Yr.processed+1}))}catch{$t(Kt=>({...Kt,processed:Kt.processed+1}))}$t(kt=>({...kt,isUploading:!1}))}function St(y){y&&(y.value="")}function sn(y){const C=y.target;jt((C==null?void 0:C.files)??null),St(C),V.value=!1}function jn(y){const C=y.target;jt((C==null?void 0:C.files)??null),St(C),V.value=!1}function Er(y){const C=y.target;Cn((C==null?void 0:C.files)??null),St(C),V.value=!1}function An(y){ne.value||!zn(y.dataTransfer)||(y.preventDefault(),pe+=1,S.value=!0)}function En(y){ne.value||!zn(y.dataTransfer)||(y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect="copy"),S.value=!0)}function ar(y){S.value&&(y.preventDefault(),pe=Math.max(0,pe-1),pe===0&&gn())}function Pe(y){var C;ne.value||!zn(y.dataTransfer)||(y.preventDefault(),gn(),on(((C=y.dataTransfer)==null?void 0:C.files)??null))}function Te(){!S.value&&pe===0||gn()}function Mt(y){var Et,$t;if(ne.value)return;const C=((Et=y.clipboardData)==null?void 0:Et.getData("text/plain"))??"";if(C.length>=xT){y.preventDefault();const kt=new File([C],Nn(),{type:"text/plain",lastModified:Date.now()});on([kt]);return}const H=Array.from((($t=y.clipboardData)==null?void 0:$t.items)??[]);if(H.length===0)return;const ve=C.length>0,Je=H.filter(kt=>kt.kind==="file"&&kt.type.startsWith("image/")).map(kt=>kt.getAsFile()).filter(kt=>kt instanceof File);Je.length!==0&&(ve||y.preventDefault(),on(Je))}function ir(){d.value&&(d.value="");const C=s.value.startsWith("/");C!==ie.value&&(ie.value=C),Ft()}function Qn(y){if(Re.value){if(y.key==="Escape"){y.preventDefault(),vn();return}if(y.key==="ArrowDown"){y.preventDefault(),Se.value.length>0&&(_e.value=(_e.value+1)%Se.value.length);return}if(y.key==="ArrowUp"){if(y.preventDefault(),Se.value.length>0){const H=Se.value.length;_e.value=(_e.value+H-1)%H}return}if(y.key==="Enter"||y.key==="Tab"){y.preventDefault();const H=Se.value[_e.value];H?zr(H):vn();return}}if(r.sendWithEnter!==!1?y.key==="Enter"&&!y.shiftKey:y.key==="Enter"&&(y.metaKey||y.ctrlKey)){y.preventDefault(),lt(r.isTurnInProgress?he.value:"steer");return}if(ie.value){if(y.key==="Escape"){y.preventDefault(),In();return}if(y.key==="ArrowDown"||y.key==="ArrowUp"){y.preventDefault();return}}}function In(){var y;ie.value=!1,(y=be.value)==null||y.focus()}function vn(){Re.value=!1,Le.value=null,Ce.value="",Se.value=[],_e.value=0}function Ft(){const y=be.value;if(!y){vn();return}const C=y.selectionStart??s.value.length,ve=s.value.slice(0,C).match(/(^|\s)(@[^\s@]*)$/);if(!ve){vn();return}const Je=ve[2]??"",Et=Je.length,$t=C-Et;Le.value=$t,Ce.value=Je.slice(1),Re.value=!0,wn()}async function wn(){if(!Re.value)return;const y=(r.cwd??"").trim();if(!y){Se.value=[];return}ee&&clearTimeout(ee);const C=++Ve;ee=setTimeout(async()=>{try{const H=await Rb(y,Ce.value,20);if(!Re.value||C!==Ve)return;Se.value=H,_e.value=0}catch{if(!Re.value||C!==Ve)return;Se.value=[]}},120)}function zr(y){const C=be.value,H=Le.value;if(H!==null&&C){const ve=C.selectionStart??s.value.length;s.value=`${s.value.slice(0,H)}${s.value.slice(ve)}`.trimEnd()}It(y.path),vn(),Bt(()=>C==null?void 0:C.focus())}function an(y){ae(),bt(y),Bt(()=>{var C;return(C=be.value)==null?void 0:C.focus()})}function Gr(y){const C=y.lastIndexOf("/");return C<0?y:y.slice(C+1)}function Xn(y){const C=y.lastIndexOf("/");return C<=0?"":y.slice(0,C)}function Zn(y){const C=Gr(y),H=C.lastIndexOf(".");return H<=0?"":C.slice(H+1).toLowerCase()}function er(y){const C=Zn(y);return C==="ts"?"TS":C==="tsx"?"TSX":C==="js"?"JS":C==="jsx"?"JSX":C==="json"?"{}":""}function Kr(y){const C=Zn(y);return C.startsWith("ts")?"ts":C.startsWith("js")?"js":C==="json"?"json":"default"}function T(y){const C=Zn(y);return C==="md"||C==="mdx"}function k(y){var C;i.value.some(H=>H.path===y.path)||(i.value=[...i.value,y]),s.value=s.value.startsWith("/")?"":s.value,ie.value=!1,(C=be.value)==null||C.focus()}function E(y,C){if(C){const H=(r.skills??[]).find(ve=>ve.path===y);H&&!i.value.some(ve=>ve.path===y)&&(i.value=[...i.value,H])}else i.value=i.value.filter(H=>H.path!==y)}function B(y){if(!V.value)return;const C=Y.value;if(!C)return;const H=y.target;!H||C.contains(H)||(V.value=!1)}return So(()=>{document.addEventListener("click",B),window.addEventListener("drop",Te),window.addEventListener("dragend",Te),window.addEventListener("blur",Te)}),t({hydrateDraft:an,hasUnsavedDraft:()=>Q.value}),xo(()=>{document.removeEventListener("click",B),window.removeEventListener("drop",Te),window.removeEventListener("dragend",Te),window.removeEventListener("blur",Te),window.removeEventListener("pointerup",Nt),window.removeEventListener("pointercancel",Nt),window.removeEventListener("blur",Nt),ee&&clearTimeout(ee)}),rt(()=>r.activeThreadId,y=>{ae(),je&&Wt(je,Lt()),zt();const C=Ke(y);C&&(bt(C),ir()),je=y.trim()},{immediate:!0}),rt([s,a,u,i],()=>{je&&Wt(je,Lt())},{deep:!0}),rt(()=>r.cwd,()=>{Re.value&&wn()}),rt(we,y=>{he.value=y}),(y,C)=>(A(),P("form",{class:"thread-composer",onSubmit:C[4]||(C[4]=at(H=>lt(e.isTurnInProgress?he.value:"steer"),["prevent"]))},[Qe.value?(A(),P("p",O0,ce(Qe.value),1)):ge("",!0),g("div",{class:tt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":S.value}])},[a.value.length>0?(A(),P("div",D0,[(A(!0),P(We,null,Dt(a.value,H=>(A(),P("div",{key:H.id,class:"thread-composer-attachment"},[g("img",{class:"thread-composer-attachment-image",src:H.url,alt:H.name||"Selected image"},null,8,L0),g("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${H.name||"image"}`,disabled:ne.value,onClick:ve=>Gt(H.id)}," x ",8,N0)]))),128))])):ge("",!0),f.value.length>0?(A(),P("div",j0,[(A(!0),P(We,null,Dt(f.value,H=>(A(),P("span",{key:H.id,class:"thread-composer-folder-chip"},[Ne(Gl,{class:"thread-composer-folder-chip-icon"}),g("span",{class:"thread-composer-folder-chip-name",title:H.name},ce(H.name),9,F0),g("span",B0,[H.isUploading?(A(),P(We,{key:0},[Ho(ce(Zt(H))+"% uploading ("+ce(H.processed)+"/"+ce(H.total)+") ",1)],64)):(A(),P(We,{key:1},[Ho(ce(H.filePaths.length)+" file"+ce(H.filePaths.length===1?"":"s"),1)],64))]),g("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${H.name}`,disabled:ne.value,onClick:ve=>mn(H.id)},"×",8,q0)]))),128))])):ge("",!0),K.value.length>0?(A(),P("div",U0,[(A(!0),P(We,null,Dt(K.value,H=>(A(),P("span",{key:H.fsPath,class:"thread-composer-file-chip"},[Ne(Ca,{class:"thread-composer-file-chip-icon"}),g("span",{class:"thread-composer-file-chip-name",title:H.fsPath},ce(H.label),9,H0),g("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${H.label}`,disabled:ne.value,onClick:ve=>pn(H.fsPath)},"×",8,W0)]))),128))])):ge("",!0),i.value.length>0?(A(),P("div",V0,[(A(!0),P(We,null,Dt(i.value,H=>(A(),P("span",{key:H.path,class:"thread-composer-skill-chip"},[g("span",z0,ce(H.name),1),g("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${H.name}`,onClick:ve=>nt(H.path)},"×",8,G0)]))),128))])):ge("",!0),g("div",{class:tt(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":S.value}]),onDragenter:An,onDragover:En,onDragleave:ar,onDrop:Pe},[S.value?(A(),P("div",K0,[...C[5]||(C[5]=[g("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):ge("",!0),Re.value?(A(),P("div",Y0,[Se.value.length>0?(A(!0),P(We,{key:0},Dt(Se.value,(H,ve)=>(A(),P("button",{key:H.path,class:tt(["thread-composer-file-mention-row",{"is-active":ve===_e.value}]),type:"button",onMousedown:at(Je=>zr(H),["prevent"])},[er(H.path)?(A(),P("span",{key:0,class:tt(["thread-composer-file-mention-icon-badge",`is-${Kr(H.path)}`])},ce(er(H.path)),3)):T(H.path)?(A(),P("span",Q0,"↓")):(A(),it(Ca,{key:2,class:"thread-composer-file-mention-icon-file"})),g("span",X0,[g("span",Z0,ce(Gr(H.path)),1),Xn(H.path)?(A(),P("span",eT,ce(Xn(H.path)),1)):ge("",!0)])],42,J0))),128)):(A(),P("div",tT,"No matching files"))])):ge("",!0),lr(g("textarea",{ref_key:"inputRef",ref:be,"onUpdate:modelValue":C[0]||(C[0]=H=>s.value=H),class:"thread-composer-input",placeholder:wt.value,disabled:ne.value,onInput:ir,onKeydown:Qn,onPaste:Mt},null,40,nT),[[Cr,s.value]]),Ne($0,{skills:_.value,visible:ie.value,"anchor-bottom":44,"anchor-left":0,onSelect:k,onClose:In},null,8,["skills","visible"])],34),g("div",{class:tt(["thread-composer-controls",{"thread-composer-controls--recording":ke.value}])},[g("div",{ref_key:"attachMenuRootRef",ref:Y,class:"thread-composer-attach"},[g("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:ne.value,onClick:Ar}," + ",8,rT),V.value?(A(),P("div",oT,[g("button",{class:"thread-composer-attach-item",type:"button",disabled:ne.value,onClick:Hn}," Add photos & files ",8,sT),g("button",{class:"thread-composer-attach-item",type:"button",disabled:ne.value,onClick:Vr}," Add folder ",8,aT),g("button",{class:"thread-composer-attach-item",type:"button",disabled:ne.value,onClick:Jn}," Take photo ",8,iT),C[9]||(C[9]=g("div",{class:"thread-composer-attach-separator"},null,-1)),g("div",lT,[C[6]||(C[6]=g("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),g("div",uT,[g("button",{class:tt(["thread-composer-attach-mode-button",{"is-active":he.value==="steer"}]),type:"button",disabled:ne.value,onClick:C[1]||(C[1]=H=>ut("steer"))}," Steer ",10,cT),g("button",{class:tt(["thread-composer-attach-mode-button",{"is-active":he.value==="queue"}]),type:"button",disabled:ne.value,onClick:C[2]||(C[2]=H=>ut("queue"))}," Queue ",10,dT)])]),C[10]||(C[10]=g("div",{class:"thread-composer-attach-separator"},null,-1)),fe.value?(A(),P("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:Z.value,onClick:nn},[g("span",hT,[C[7]||(C[7]=g("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),g("span",pT,ce(Oe.value),1)]),g("span",{class:tt(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":Z.value}])},null,2)],8,fT)):ge("",!0),g("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Ee.value,"aria-label":Ee.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:_n},[C[8]||(C[8]=g("span",{class:"thread-composer-attach-setting-copy"},[g("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),g("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),g("span",{class:tt(["thread-composer-attach-switch",{"is-on":Ee.value}])},null,2)],8,mT)])):ge("",!0)],512),ke.value?ge("",!0):(A(),P(We,{key:0},[Ne(Ts,{class:"thread-composer-control","model-value":e.selectedModel,options:J.value,"selected-prefix-icon":se.value?Kb:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":hn},null,8,["model-value","options","selected-prefix-icon","disabled"]),Ne(x0,{class:"thread-composer-control",options:$.value,"selected-values":x.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:E},null,8,["options","selected-values","disabled"]),Ne(Ts,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:z,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Yn},null,8,["model-value","disabled"])],64)),g("div",{class:tt(["thread-composer-actions",{"thread-composer-actions--recording":ke.value}])},[$e(j)==="recording"?(A(),P("div",gT,[g("canvas",{ref_key:"dictationWaveformCanvasRef",ref:M,class:"thread-composer-dictation-waveform"},null,512)])):ge("",!0),$e(j)==="recording"?(A(),P("span",vT,ce(Ze.value),1)):ge("",!0),$e(N)?(A(),P("button",{key:2,class:tt(["thread-composer-mic",{"thread-composer-mic--active":$e(j)==="recording"}]),type:"button","aria-label":qe.value,title:qe.value,disabled:ne.value,onClick:Sn,onPointerdown:Un,onPointerup:Nt,onPointercancel:Nt},[$e(j)==="recording"?(A(),it($c,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(A(),it(Xb,{key:1,class:"thread-composer-mic-icon"}))],42,wT)):ge("",!0),e.isTurnInProgress&&!yt.value?(A(),P("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Rt},[Ne($c,{class:"thread-composer-stop-icon"})],8,yT)):(A(),P("button",{key:4,class:tt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&he.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&he.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${he.value}`:"Send",disabled:!G.value,onClick:C[3]||(C[3]=H=>lt(e.isTurnInProgress?he.value:"steer"))},[Ne(Wb,{class:"thread-composer-submit-icon"})],10,bT))],2)],2)],2),g("input",{ref_key:"photoLibraryInputRef",ref:le,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:ne.value,onChange:sn},null,40,TT),g("input",{ref_key:"cameraCaptureInputRef",ref:De,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:ne.value,onChange:jn},null,40,_T),g("input",{ref_key:"folderPickerInputRef",ref:ye,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:ne.value,onChange:Er},null,40,ST)],32))}}),Oc=ht(CT,[["__scopeId","data-v-bbb98319"]]),AT={key:0,class:"thread-pending-request"},ET={class:"thread-pending-request-title"},IT=["title"],MT={class:"thread-pending-request-approval"},RT={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},PT=["aria-pressed","onClick"],$T={class:"thread-pending-request-option-index"},OT={class:"thread-pending-request-option-label"},DT={class:"thread-pending-request-footer thread-pending-request-footer--approval"},LT=["value"],NT={class:"thread-pending-request-header"},jT={class:"thread-pending-request-heading"},FT={class:"thread-pending-request-eyebrow"},BT={class:"thread-pending-request-title"},qT={key:0,class:"thread-pending-request-counter"},UT={key:0,class:"thread-pending-request-preview"},HT={class:"thread-pending-request-preview-code"},WT={key:1,class:"thread-pending-request-user-input"},VT={class:"thread-pending-request-question-title"},zT={key:0,class:"thread-pending-request-question-text"},GT={key:1,class:"thread-pending-request-question-options"},KT={class:"thread-pending-request-select-wrap"},YT=["value","onChange"],JT=["value"],QT={key:0,class:"thread-pending-request-question-description"},XT={key:2,class:"thread-pending-request-input-wrap"},ZT=["value","onInput"],e_={class:"thread-pending-request-footer"},t_={key:2,class:"thread-pending-request-actions"},n_={key:3,class:"thread-pending-request-actions"},r_=dn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=R("accept"),s=R(""),a=R({}),i=R({});function u(ee){return ee!==null&&typeof ee=="object"&&!Array.isArray(ee)?ee:null}function f(ee){return typeof ee=="string"?ee.trim():""}function d(ee){return ee.method==="item/commandExecution/requestApproval"||ee.method==="execCommandApproval"}function m(ee){return ee.method==="item/fileChange/requestApproval"||ee.method==="applyPatchApproval"}function v(ee){return d(ee)||m(ee)}function S(ee){const oe=u(ee.params);return f(oe==null?void 0:oe.reason)||f(oe==null?void 0:oe.prompt)}function j(ee){return v(ee)?"Awaiting approval":ee.method==="item/tool/requestUserInput"?"Awaiting response":ee.method==="item/tool/call"?"Tool call waiting for response":ee.method}function N(ee){const oe=S(ee);return oe||(d(ee)?"Do you want to run this command?":m(ee)?"Do you want to make these changes?":ee.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function X(ee){var je;const oe=ee.trim();if(!oe)return"";const pe=oe.match(/-Command\s+(.+)$/i),Ae=((je=pe==null?void 0:pe[1])==null?void 0:je.trim())??oe;return(Ae.startsWith('"')&&Ae.endsWith('"')?Ae.slice(1,-1):Ae).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function M(ee){const oe=u(ee.params);if(!oe)return"";if(d(ee)){const Ae=(Array.isArray(oe.commandActions)?oe.commandActions:[]).map(Ie=>u(Ie)).map(Ie=>f(Ie==null?void 0:Ie.command)).find(Ie=>Ie.length>0);return Ae?Ae.replace(/\s+/g," ").trim():X(f(oe.command))}return m(ee)?f(oe.grantRoot).replace(/\s+/g," ").trim():""}function L(ee){return!ee||!v(ee)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const q=te(()=>L(n.request));rt(()=>{var ee;return((ee=n.request)==null?void 0:ee.id)??0},()=>{var ee;s.value="",a.value={},i.value={},o.value=((ee=q.value[0])==null?void 0:ee.id)??"accept"},{immediate:!0}),rt(q,ee=>{var oe;o.value!=="decline"&&(ee.some(pe=>pe.id===o.value)||(o.value=((oe=ee[0])==null?void 0:oe.id)??"accept"))},{immediate:!0});function W(ee,oe){return`${String(ee)}:${oe}`}function ae(ee){const oe=u(ee.params),pe=Array.isArray(oe==null?void 0:oe.questions)?oe.questions:[],Ae=[];for(const Ie of pe){const je=u(Ie);if(!je)continue;const z=f(je.id);if(!z)continue;const ue=Array.isArray(je.options)?je.options.map(J=>u(J)).map(J=>({label:f(J==null?void 0:J.label),description:f(J==null?void 0:J.description)})).filter(J=>J.label.length>0):[];Ae.push({id:z,header:f(je.header),question:f(je.question),isOther:je.isOther===!0,options:ue})}return Ae}function Y(ee,oe,pe){const Ae=W(ee,oe),Ie=a.value[Ae];return typeof Ie=="string"&&Ie.length>0?Ie:pe}function le(ee,oe){return i.value[W(ee,oe)]??""}function De(ee,oe,pe){const Ae=pe.target;if(!(Ae instanceof HTMLSelectElement))return;const Ie=W(ee,oe);a.value={...a.value,[Ie]:Ae.value}}function ye(ee,oe,pe){const Ae=pe.target;if(!(Ae instanceof HTMLInputElement))return;const Ie=W(ee,oe);i.value={...i.value,[Ie]:Ae.value}}function be(ee,oe,pe){var Ie,je;const Ae=Y(ee,oe,((Ie=pe[0])==null?void 0:Ie.label)||"");return((je=pe.find(z=>z.label===Ae))==null?void 0:je.description)??""}function de(ee){o.value=ee}function V(){o.value="decline"}function ie(ee){const oe=ee.target;oe instanceof HTMLInputElement&&(s.value=oe.value,o.value="decline")}function Le(ee,oe){r("respondServerRequest",{id:ee.id,result:{decision:oe}})}function Ce(ee){const oe=s.value.trim(),pe=oe.length>0?"decline":o.value;r("respondServerRequest",{id:ee.id,result:{decision:pe},followUpMessageText:oe||void 0})}function Se(ee){var Ae;const oe=ae(ee),pe={};for(const Ie of oe){const je=Y(ee.id,Ie.id,((Ae=Ie.options[0])==null?void 0:Ae.label)||""),z=le(ee.id,Ie.id).trim(),ue=[je,z].map(J=>J.trim()).filter(J=>J.length>0);pe[Ie.id]={answers:ue}}r("respondServerRequest",{id:ee.id,result:{answers:pe}})}function Re(ee){r("respondServerRequest",{id:ee.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function _e(ee){r("respondServerRequest",{id:ee.id,result:{success:!0,contentItems:[]}})}function Fe(ee){r("respondServerRequest",{id:ee.id,result:{}})}function Ve(ee){r("respondServerRequest",{id:ee.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(ee,oe)=>e.request?(A(),P("section",AT,[g("article",{class:tt(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[v(e.request)?(A(),P(We,{key:0},[g("p",ET,ce(N(e.request)),1),M(e.request)?(A(),P("p",{key:0,class:"thread-pending-request-command-line",title:M(e.request)},ce(M(e.request)),9,IT)):ge("",!0),g("section",MT,[g("div",RT,[(A(!0),P(We,null,Dt(q.value,(pe,Ae)=>(A(),P("button",{key:pe.id,type:"button",class:tt(["thread-pending-request-option",{"is-selected":o.value===pe.id}]),"aria-pressed":o.value===pe.id,onClick:Ie=>de(pe.id)},[g("span",$T,ce(Ae+1)+".",1),g("span",OT,ce(pe.label),1)],10,PT))),128))]),g("footer",DT,[g("label",{class:tt(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[oe[8]||(oe[8]=g("span",{class:"thread-pending-request-option-index"},"3.",-1)),g("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:V,onInput:ie,onKeydown:oe[0]||(oe[0]=tn(at(pe=>Ce(e.request),["prevent"]),["enter"]))},null,40,LT)],2),g("button",{type:"button",class:"thread-pending-request-secondary",onClick:oe[1]||(oe[1]=pe=>Le(e.request,"cancel"))}," Skip "),g("button",{type:"button",class:"thread-pending-request-primary",onClick:oe[2]||(oe[2]=pe=>Ce(e.request))}," Send ")])])],64)):(A(),P(We,{key:1},[g("header",NT,[g("div",jT,[g("p",FT,ce(j(e.request)),1),g("p",BT,ce(N(e.request)),1)]),(e.requestCount??0)>1?(A(),P("span",qT,ce(e.requestCount??0)+" pending",1)):ge("",!0)]),M(e.request)?(A(),P("div",UT,[g("code",HT,ce(M(e.request)),1)])):ge("",!0),e.request.method==="item/tool/requestUserInput"?(A(),P("section",WT,[(A(!0),P(We,null,Dt(ae(e.request),pe=>{var Ae;return A(),P("div",{key:`${e.request.id}:${pe.id}`,class:"thread-pending-request-question"},[g("p",VT,ce(pe.header||pe.question),1),pe.question?(A(),P("p",zT,ce(pe.question),1)):ge("",!0),pe.options.length>0?(A(),P("div",GT,[g("label",KT,[oe[9]||(oe[9]=g("span",{class:"thread-pending-request-select-label"},"Choice",-1)),g("select",{class:"thread-pending-request-select",value:Y(e.request.id,pe.id,((Ae=pe.options[0])==null?void 0:Ae.label)||""),onChange:Ie=>De(e.request.id,pe.id,Ie)},[(A(!0),P(We,null,Dt(pe.options,Ie=>(A(),P("option",{key:`${e.request.id}:${pe.id}:${Ie.label}`,value:Ie.label},ce(Ie.label),9,JT))),128))],40,YT)]),be(e.request.id,pe.id,pe.options)?(A(),P("p",QT,ce(be(e.request.id,pe.id,pe.options)),1)):ge("",!0)])):ge("",!0),pe.isOther?(A(),P("label",XT,[oe[10]||(oe[10]=g("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),g("input",{class:"thread-pending-request-input",type:"text",value:le(e.request.id,pe.id),placeholder:"Other answer",onInput:Ie=>ye(e.request.id,pe.id,Ie)},null,40,ZT)])):ge("",!0)])}),128)),g("footer",e_,[g("button",{type:"button",class:"thread-pending-request-primary",onClick:oe[3]||(oe[3]=pe=>Se(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(A(),P("section",t_,[g("button",{type:"button",class:"thread-pending-request-primary",onClick:oe[4]||(oe[4]=pe=>Re(e.request))}," Fail Tool Call "),g("button",{type:"button",class:"thread-pending-request-secondary",onClick:oe[5]||(oe[5]=pe=>_e(e.request))}," Success (Empty) ")])):(A(),P("section",n_,[g("button",{type:"button",class:"thread-pending-request-primary",onClick:oe[6]||(oe[6]=pe=>Fe(e.request))}," Return Empty Result "),g("button",{type:"button",class:"thread-pending-request-secondary",onClick:oe[7]||(oe[7]=pe=>Ve(e.request))}," Reject Request ")]))],64))],2)])):ge("",!0)}}),o_=ht(r_,[["__scopeId","data-v-52572972"]]),s_={key:0,class:"queued-messages"},a_={class:"queued-messages-inner"},i_={class:"queued-row-text"},l_={class:"queued-row-actions"},u_=["onClick"],c_=["onClick"],d_=["onClick"],f_=dn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var u,f,d;const r=n.text.trim();if(r)return r;const o=[],s=((u=n.imageUrls)==null?void 0:u.length)??0,a=((f=n.fileAttachments)==null?void 0:f.length)??0,i=((d=n.skills)==null?void 0:d.length)??0;return s>0&&o.push(`${s} image${s===1?"":"s"}`),a>0&&o.push(`${a} file${a===1?"":"s"}`),i>0&&o.push(`${i} skill${i===1?"":"s"}`),o.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(A(),P("div",s_,[g("div",a_,[(A(!0),P(We,null,Dt(e.messages,o=>(A(),P("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=g("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[g("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)),g("span",i_,ce(t(o)),1),g("div",l_,[g("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,u_),g("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,c_),g("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>n.$emit("delete",o.id)},[...r[0]||(r[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[g("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,d_)])]))),128))])])):ge("",!0)}}),h_=ht(f_,[["__scopeId","data-v-835c6739"]]),p_={key:0,class:"rate-limit-status","aria-live":"polite"},m_=["title"],g_={class:"rate-limit-card-header"},v_={class:"rate-limit-card-title"},w_={key:0,class:"rate-limit-card-plan"},y_={class:"rate-limit-card-metrics"},b_={key:0,class:"rate-limit-card-footer"},T_=dn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(M){var L,q;return((L=M.limitId)==null?void 0:L.trim())||((q=M.limitName)==null?void 0:q.trim())||"__default__"}function n(M){var L,q;return((L=M.limitName)==null?void 0:L.trim())||((q=M.limitId)==null?void 0:q.trim())||"Rate limits"}function r(M){const L=M.trim();return L?L.replace(/[_-]+/g," ").replace(/\b\w/g,q=>q.toUpperCase()):""}function o(M){return!M||M<=0?"Window":M%1440===0?`${M/1440}d`:M%60===0?`${M/60}h`:M<60?`${M}m`:`${Math.round(M/60*10)/10}h`}function s(M){const L=Math.max(0,Math.min(100,100-M));return`${Math.round(L)}% left`}function a(M){return`${Math.round(M)}%`}function i(M,L){return{key:L,label:`${o(M.windowDurationMins)} ${s(M.usedPercent)}`}}function u(M){const L=[];return M.primary&&L.push(i(M.primary,"primary")),M.secondary&&L.push(i(M.secondary,"secondary")),L}function f(M){if(!M)return"";const L=new Date(M*1e3),q=L.getMonth()+1,W=String(L.getDate()).padStart(2,"0"),ae=String(L.getHours()).padStart(2,"0"),Y=String(L.getMinutes()).padStart(2,"0");return`${q}.${W} ${ae}:${Y}`}function d(M){if(!(M!=null&&M.resetsAt))return"";const L=M.resetsAt*1e3-Date.now();if(L<=0)return"Resetting now";const q=Math.round(L/6e4);if(q<60)return`Resets in ${q}m`;const W=Math.round(q/60);return W<24?`Resets in ${W}h`:`Resets in ${Math.round(W/24)}d`}function m(M){return[M.primary,M.secondary].filter(L=>L!==null)}function v(M){const L=m(M);return L.length===0?null:[...L].sort((q,W)=>{const ae=q.windowDurationMins??Number.MAX_SAFE_INTEGER,Y=W.windowDurationMins??Number.MAX_SAFE_INTEGER;return ae!==Y?ae-Y:(q.resetsAt??Number.MAX_SAFE_INTEGER)-(W.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function S(M){const L=m(M);if(L.length===0)return"";const q=[...L].sort((ae,Y)=>{const le=ae.windowDurationMins??-1,De=Y.windowDurationMins??-1;return le!==De?De-le:(Y.resetsAt??-1)-(ae.resetsAt??-1)})[0],W=f(q.resetsAt);return W||""}function j(M){const L=M.credits;return L?L.unlimited?"Unlimited credits":L.balance?`Credits ${L.balance}`:L.hasCredits?"Credits available":"":""}function N(M){return[d(v(M)),S(M),j(M)].filter(L=>L.length>0)}function X(M){const L=[n(M)];for(const q of u(M))L.push(q.label);for(const q of m(M))L.push(`${o(q.windowDurationMins)} used ${a(q.usedPercent)}`);for(const q of N(M))L.push(q);return L.join(`
51
- `)}return(M,L)=>e.snapshots.length>0?(A(),P("aside",p_,[(A(!0),P(We,null,Dt(e.snapshots,q=>(A(),P("div",{key:t(q),class:"rate-limit-card",title:X(q)},[g("div",g_,[g("span",v_,ce(n(q)),1),q.planType?(A(),P("span",w_,ce(r(q.planType)),1)):ge("",!0)]),g("div",y_,[(A(!0),P(We,null,Dt(u(q),W=>(A(),P("span",{key:W.key,class:"rate-limit-card-metric"},ce(W.label),1))),128))]),N(q).length>0?(A(),P("div",b_,ce(N(q).join(" | ")),1)):ge("",!0)],8,m_))),128))])):ge("",!0)}}),__=ht(T_,[["__scopeId","data-v-df88906b"]]),S_={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},x_=["aria-checked","onClick"],k_={class:"runtime-toggle-option-label"},C_=dn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:Gl},{value:"worktree",label:"New worktree",icon:wa}];function o(s){n("update:modelValue",s)}return(s,a)=>(A(),P("div",S_,[(A(),P(We,null,Dt(r,i=>g("button",{key:i.value,class:tt(["runtime-toggle-option",{"is-selected":e.modelValue===i.value}]),type:"button",role:"radio","aria-checked":e.modelValue===i.value,onClick:u=>o(i.value)},[(A(),it(Ll(i.icon),{class:"runtime-toggle-option-icon"})),g("span",k_,ce(i.label),1)],10,x_)),64))]))}}),A_=ht(C_,[["__scopeId","data-v-e8b0d0ac"]]),E_={},I_={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 M_(e,t){return A(),P("svg",I_,[...t[0]||(t[0]=[g("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),g("path",{d:"M9 4l0 16"},null,-1)])])}const R_=ht(E_,[["render",M_]]),P_={},$_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function O_(e,t){return A(),P("svg",$_,[...t[0]||(t[0]=[g("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 D_=ht(P_,[["render",O_]]),L_={class:"sidebar-thread-controls"},N_=["aria-label","title"],j_=dn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(A(),P("div",L_,[g("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?(A(),it(D_,{key:0,class:"sidebar-thread-controls-icon"})):(A(),it(R_,{key:1,class:"sidebar-thread-controls-icon"}))],8,N_),xr(t.$slots,"default",{},void 0),e.showNewThreadButton?(A(),P("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ne(Ca,{class:"sidebar-thread-controls-icon"})])):ge("",!0)]))}}),Dc=ht(j_,[["__scopeId","data-v-46a10052"]]),F_={},B_={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function q_(e,t){return A(),P("svg",B_,[...t[0]||(t[0]=[g("circle",{cx:"11",cy:"11",r:"8"},null,-1),g("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Lc=ht(F_,[["render",q_]]),U_={},H_={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function W_(e,t){return A(),P("svg",H_,[...t[0]||(t[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[g("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"}),g("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const V_=ht(U_,[["render",W_]]),z_={},G_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function K_(e,t){return A(),P("svg",G_,[...t[0]||(t[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Y_=ht(z_,[["render",K_]]);function yr(e){return e.flatMap(t=>t.threads)}const Of="codex-web-local.thread-read-state.v1",Df="codex-web-local.thread-scroll-state.v1",Lf="codex-web-local.thread-token-usage.v1",vl="codex-web-local.selected-thread-id.v1",wl="codex-web-local.selected-model-id.v1",Nf="codex-web-local.project-order.v1",jf="codex-web-local.project-display-name.v1",yl="codex-web-local.collaboration-mode-by-context.v1",Ff="codex-web-local.collaboration-mode.v1",Bf="__new-thread__",Vi=220,J_=500,Q_=3e3,Nc=["none","minimal","low","medium","high","xhigh"],Mo="__global__",rr="gpt-5.2-codex";function X_(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Of);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function jc(e){typeof window>"u"||window.localStorage.setItem(Of,JSON.stringify(e))}function bl(e){return e==="plan"?"plan":"default"}function qf(e){return e.trim()||Bf}function Z_(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem(yl);if(t){const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const r={};for(const[o,s]of Object.entries(n)){if(typeof o!="string"||o.length===0)continue;const a=bl(s);a==="plan"&&(r[o]=a)}return r}}catch{}return bl(window.localStorage.getItem(Ff))==="plan"?{[Bf]:"plan"}:{}}function zi(e,t){const n=qf(t);return bl(e[n])}function eS(e){typeof window>"u"||(Object.keys(e).length===0?window.localStorage.removeItem(yl):window.localStorage.setItem(yl,JSON.stringify(e)),window.localStorage.removeItem(Ff))}function _s(e,t,n){return Math.min(Math.max(e,t),n)}function tS(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=_s(t.scrollRatio,0,1)),n}function nS(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Df);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=tS(o);s&&(n[r]=s)}return n}catch{return{}}}function Fc(e){typeof window>"u"||window.localStorage.setItem(Df,JSON.stringify(e))}function Lo(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.trunc(e));if(typeof e=="string"&&e.trim().length>0){const t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.trunc(t))}return null}function Bc(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:Lo(t.totalTokens)??0,inputTokens:Lo(t.inputTokens)??0,cachedInputTokens:Lo(t.cachedInputTokens)??0,outputTokens:Lo(t.outputTokens)??0,reasoningOutputTokens:Lo(t.reasoningOutputTokens)??0}}function rS(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Bc(t.total),r=Bc(t.last);if(!n||!r)return null;const o=Lo(t.modelContextWindow),s=r.totalTokens,a=typeof o=="number"?Math.max(o-s,0):null,i=typeof o=="number"&&o>0?_s(Math.round((a??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:a,remainingContextPercent:i}}function oS(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Lf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=rS(o);s&&(n[r]=s)}return n}catch{return{}}}function qc(e){typeof window>"u"||window.localStorage.setItem(Lf,JSON.stringify(e))}function sS(){return typeof window>"u"?"":window.localStorage.getItem(vl)??""}function aS(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(vl);return}window.localStorage.setItem(vl,e)}}function iS(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(wl))==null?void 0:e.trim())??""}function Gi(e){if(typeof window>"u")return;const t=e.trim();if(!t){window.localStorage.removeItem(wl);return}window.localStorage.setItem(wl,t)}function lS(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Nf);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t){if(typeof r!="string"||r.length===0)continue;const o=Ns(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function Ro(e){typeof window>"u"||window.localStorage.setItem(Nf,JSON.stringify(e))}function uS(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(jf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){const s=typeof r=="string"?Ns(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function Ki(e){typeof window>"u"||window.localStorage.setItem(jf,JSON.stringify(e))}function ua(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 yo(e,n)?e:n}function Yi(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>n.get(o)??null).filter(o=>o!==null&&o.threads.length>0);for(const o of e)t.includes(o.projectName)||r.push(o);return r}function yo(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1)if(n[o]!==r[o])return!1;return!0}function cS(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[o]=r.splice(t,1);return r.splice(n,0,o),r}function dS(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function fS(e=[],t=[]){var n,r,o,s;if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1)if(((n=e[a])==null?void 0:n.step)!==((r=t[a])==null?void 0:r.step)||((o=e[a])==null?void 0:o.status)!==((s=t[a])==null?void 0:s.status))return!1;return!0}function hS(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&fS(e.steps,t.steps)}function ca(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 Tl(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&yo(e.images,t.images)&&mS(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&dS(e.commandExecution,t.commandExecution)&&hS(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function No(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 pS(e,t,n={}){const r=new Map(e.map(d=>[d.id,d])),o=new Map(t.map(d=>[d.id,d])),s=t.map(d=>{const m=r.get(d.id);return m&&Tl(m,d)?m:d});if(n.preserveMissing!==!0)return No(e,s)?e:s;const a=e.map(d=>{const m=o.get(d.id);return!m||Tl(d,m)?d:m}),i=new Set(e.map(d=>d.id)),u=s.filter(d=>!i.has(d.id)),f=[...a,...u];return No(e,f)?e:f}function mS(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],o=t[n];if(r.path!==o.path||r.operation!==o.operation||r.movedToPath!==o.movedToPath||r.diff!==o.diff||r.addedLineCount!==o.addedLineCount||r.removedLineCount!==o.removedLineCount)return!1}return!0}function _l(e){return e.replace(/\s+/gu," ").trim()}function gS(e,t){const n=new Set(t.filter(o=>o.role==="assistant").map(o=>_l(o.text)).filter(o=>o.length>0));if(n.size===0)return e;const r=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;const s=_l(o.text);return s.length===0?!1:!n.has(s)});return r.length===e.length?e:r}function da(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Tl(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const Uf="worked";function to(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function vS(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),o=t%60,s=[];n>0&&s.push(`${n}h`),(r>0||n>0)&&s.push(`${r}m`);const a=o>0||s.length===0?o:0;return s.push(`${a}s`),s.join(" ")}function wS(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function yS(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 bS(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${vS(e.durationMs)}`,messageType:Uf,turnId:e.turnId}}function TS(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function _S(e,t){const n=bS(t),r=e.filter(a=>a.messageType!==Uf),o=TS(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function _t(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function SS(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[o,s]of Object.entries(e)){if(t.has(o)){n=!0;continue}r[o]=s}return n?r:e}function xS(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&&e.pendingRequestState===t.pendingRequestState}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 CS(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 Yt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function fa(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>{const s=n.get(o.projectName),a=new Map((s==null?void 0:s.threads.map(u=>[u.id,u]))??[]),i=o.threads.map(u=>{const f=a.get(u.id);return f&&xS(f,u)?f:u});return s&&s.projectName===o.projectName&&kS(s.threads,i)?s:{projectName:o.projectName,threads:i}});return CS(e,r)?e:r}function AS(e,t,n){const r=new Set(yr(t).map(i=>i.id)),o=yr(e).filter(i=>n[i.id]===!0&&!r.has(i.id));if(o.length===0)return t;const s=new Map(t.map(i=>[i.projectName,i])),a=t.map(i=>({projectName:i.projectName,threads:[...i.threads]}));for(const i of o){if(s.get(i.projectName)){const f=a.findIndex(d=>d.projectName===i.projectName);f>=0&&(a[f]={projectName:a[f].projectName,threads:[i,...a[f].threads]});continue}a.push({projectName:i.projectName,threads:[i]})}return a}function Po(e){return Ns(e)}function ES(e){const t=e.split(`
52
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function IS(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function MS(){const e=R([]),t=R([]),n=R(sS()),r=R({}),o=R({}),s=R({}),a=R({}),i=R({}),u=R({}),f=R({}),d=R({}),m=R({}),v=R({}),S=R([]),j=R([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),N=R(Z_()),X=R(zi(N.value,n.value)),M=R(iS()),L=R("medium"),q=R("standard"),W=R(X_()),ae=R(nS()),Y=R(lS()),le=R(uS()),De=R({}),ye=R({}),be=R({}),de=R({}),V=R({}),ie=R({}),Le=R({}),Ce=R({}),Se=R({}),Re=R({}),_e=R(null),Fe=R(oS()),Ve=R({}),ee=R([]),oe=R([]),pe=R(!1),Ae=R(!1),Ie=R(!1),je=R(!1),z=R(!1),ue=R(!1),J=R(""),Ee=R(!1),ze=R(!1);let _=null,x=null,$=null;const G=new Map;let Q=null,K=!1;const ne=new Set;let fe=!1,se=!1;const Z=new Map,Oe=new Set,we=te(()=>yr(e.value)),he=te(()=>we.value.find(l=>l.id===n.value)??null),ke=te(()=>ae.value[n.value]??null),qe=te(()=>{const l=[],c=n.value;return c&&Array.isArray(Se.value[c])&&l.push(...Se.value[c]),Array.isArray(Se.value[Mo])&&l.push(...Se.value[Mo]),l.sort((p,b)=>p.receivedAtIso.localeCompare(b.receivedAtIso))}),Qe=te(()=>{var O;const l=n.value;if(!l)return null;const c=ie.value[l],p=(a.value[l]??"").trim(),b=(((O=Le.value[l])==null?void 0:O.message)??"").trim();return!c&&!p&&!b?null:{activityLabel:(c==null?void 0:c.label)||"Thinking",activityDetails:(c==null?void 0:c.details)??[],reasoningText:p,errorText:b}}),Ze=te(()=>_e.value),wt=te(()=>{const l=n.value;return l?Fe.value[l]??null:null}),yt=te(()=>{const l=n.value;if(!l)return[];const c=r.value[l]??[],p=o.value[l]??[],b=s.value[l]??[],O=i.value[l]??[],F=u.value[l]??[],D=[...c,...p,...O,...F,...b],U=V.value[l];return U?_S(D,U):D});function lt(l){n.value!==l&&(n.value=l,aS(l),X.value=zi(N.value,l),se=!1)}function ut(l){M.value=l.trim(),Gi(M.value)}function bt(l,c){const p=l.trim();if(!p)return;if(!c){if(!(p in Fe.value))return;Fe.value=_t(Fe.value,p),qc(Fe.value);return}const b=Fe.value[p];b&&JSON.stringify(b)===JSON.stringify(c)||(Fe.value={...Fe.value,[p]:c},qc(Fe.value))}function zt(l){const c=l==="plan"?"plan":"default",p=qf(n.value);zi(N.value,n.value)===c&&X.value===c||(X.value=c,N.value=c==="plan"?{...N.value,[p]:c}:_t(N.value,p),eS(N.value))}function Tt(l){_e.value=l}async function Ke(){M.value=rr,Gi(M.value),S.value.includes(rr)||(S.value=[...S.value,rr]);try{await _b(rr)}catch{}}function Wt(l,c){Re.value={...Re.value,[l]:c}}function fn(l){Re.value[l]&&(Re.value=_t(Re.value,l))}async function Lt(l){if(Oe.has(l))return;const c=Re.value[l];if(!(!c||c.fallbackRetried)){Oe.add(l),Wt(l,{...c,fallbackRetried:!0});try{await Ke();try{const p=await qi(l,1);Nn(l,p),St(l),en(l,[]),Cn(l),i.value[l]&&(i.value=_t(i.value,l))}catch{}ct(l,null),J.value="",It(l,null),ot(l,{label:"Thinking",details:Yn(rr,c.effort,c.collaborationMode)}),et(l,!0),be.value[l]!==!0&&await Bi(l),await Ui(l,c.text,c.imageUrls,rr,c.effort||void 0,c.skills.length>0?c.skills:void 0,c.fileAttachments,c.collaborationMode),be.value={...be.value,[l]:!0},Un(),ne.add(l),K=!0,await tr()}catch(p){const b=p instanceof Error?p.message:"Unknown application error";ct(l,b),J.value=b,et(l,!1),ot(l,null)}finally{Oe.delete(l)}}}function Rt(l){l&&!Nc.includes(l)||(L.value=l)}async function hn(l){const c=l==="fast"?"fast":"standard";if(z.value||q.value===c)return;const p=q.value;q.value=c,z.value=!0,J.value="";try{await Sb(c)}catch(b){q.value=p,J.value=b instanceof Error?b.message:"Failed to update Fast mode"}finally{z.value=!1}}async function _n(){try{const l=await kb();j.value=l,l.some(c=>c.value===X.value)||zt("default")}catch{}}function Yn(l,c,p=X.value){const b=l.trim()||"default",O=c||"default",F=p==="plan"?"Plan":"Default",D=q.value==="fast"?"Fast":"Standard";return[`Mode: ${F}`,`Model: ${b}`,`Thinking: ${O}`,`Speed: ${D}`]}async function nn(){try{const[l,c]=await Promise.all([Rf(),Pf()]);S.value=l,M.value.length>0&&l.includes(M.value)||(c.model&&l.includes(c.model)?M.value=c.model:l.length>0?M.value=l[0]:M.value="",Gi(M.value)),c.reasoningEffort&&Nc.includes(c.reasoningEffort)&&(L.value=c.reasoningEffort),q.value=c.speedMode}catch{}}async function Sn(){if(Q){await Q;return}Q=(async()=>{try{oe.value=vn(await Ac())}catch{}finally{Q=null}})(),await Q}function Un(){if(typeof window>"u"){Sn();return}$!==null&&window.clearTimeout($),$=window.setTimeout(()=>{$=null,Sn()},J_)}function Nt(l){if(!l||typeof window>"u")return;const c=G.get(l);c!==void 0&&(window.clearTimeout(c),G.delete(l))}function Ar(l){if(!l||typeof window>"u")return;Nt(l);const c=window.setTimeout(()=>{G.delete(l),ne.add(l),tr()},Q_);G.set(l,c)}function Hn(l){const c=Ve.value;return Object.keys(c).length===0?l:l.map(p=>({projectName:p.projectName,threads:p.threads.map(b=>{const O=c[b.id];return O?{...b,title:O}:b})}))}function Jn(l){return l?Array.isArray(Se.value[l])?Se.value[l]:[]:[]}function Vr(l){return l==="item/commandExecution/requestApproval"||l==="item/fileChange/requestApproval"||l==="execCommandApproval"||l==="applyPatchApproval"}function Gt(l){return l.some(c=>Vr(c.method))?"approval":l.length>0?"response":null}function nt(){const c=Hn(t.value).map(p=>({projectName:p.projectName,threads:p.threads.map(b=>{const O=f.value[b.id]===!0,F=Gt(Jn(b.id)),D=n.value===b.id,U=W.value[b.id],re=v.value[b.id]===!0,Ue=!D&&!O&&(re||U!==b.updatedAtIso);return{...b,inProgress:O,unread:Ue,pendingRequestState:F}})}));e.value=fa(e.value,c)}function pn(l,c,p){const b=new Date().toISOString(),O=qt(c),F=Ns(O),D={id:l,title:ES(p),projectName:F,cwd:O,hasWorktree:O.includes("/.codex/worktrees/")||O.includes("/.git/worktrees/"),createdAtIso:b,updatedAtIso:b,preview:p,unread:!1,inProgress:!1},U=t.value.findIndex(Ue=>Ue.projectName===F);if(U>=0){const Xe=t.value[U].threads.filter(Ir=>Ir.id!==l),st={projectName:F,threads:[D,...Xe]},Ct=[...t.value];Ct.splice(U,1,st),t.value=Ct}else t.value=[{projectName:F,threads:[D]},...t.value];const re=ua(Y.value,t.value);yo(Y.value,re)||(Y.value=re,Ro(Y.value)),nt()}function mn(l){const c=new Set(l.map(F=>F.id)),p=Yt(W.value,c);p!==W.value&&(W.value=p,jc(p));const b=Yt(ae.value,c);b!==ae.value&&(ae.value=b,Fc(b)),ye.value=Yt(ye.value,c),De.value=Yt(De.value,c),be.value=Yt(be.value,c),de.value=Yt(de.value,c),r.value=Yt(r.value,c),s.value=Yt(s.value,c),a.value=Yt(a.value,c),i.value=Yt(i.value,c),u.value=Yt(u.value,c),V.value=Yt(V.value,c),ie.value=Yt(ie.value,c),Le.value=Yt(Le.value,c),Ce.value=Yt(Ce.value,c),Fe.value=Yt(Fe.value,c),v.value=Yt(v.value,c),f.value=Yt(f.value,c);const O={};for(const[F,D]of Object.entries(Se.value))(F===Mo||c.has(F))&&(O[F]=D);Se.value=O}function Zt(l){const c=yr(t.value).find(p=>p.id===l);c&&(W.value={...W.value,[l]:c.updatedAtIso},jc(W.value),v.value[l]&&(v.value=_t(v.value,l)),nt())}function It(l,c){if(!l)return;const p=V.value[l];if(c){if(wS(p,c))return;V.value={...V.value,[l]:c}}else p&&(V.value=_t(V.value,l))}function et(l,c){!l||f.value[l]===!0===c||(c?f.value={...f.value,[l]:!0}:f.value=_t(f.value,l),nt())}function Wn(l){l&&l!==n.value&&v.value[l]!==!0&&(v.value={...v.value,[l]:!0},nt())}function ot(l,c){if(!l)return;const p=ie.value[l];if(!c){p&&(ie.value=_t(ie.value,l));return}const b=B(c.label)||"Thinking",O=c.details.map(U=>B(U)).filter(U=>U.length>0&&U!==b),F=Array.from(new Set([...(p==null?void 0:p.details)??[],...O])).slice(-3),D={label:b,details:F};yS(p,D)||(ie.value={...ie.value,[l]:D})}function ct(l,c,p={}){if(!l)return;const b=Le.value[l],O=c?_l(c):"";if(!O){b&&(Le.value=_t(Le.value,l));return}const F=p.transient===!0;(b==null?void 0:b.message)===O&&b.transient===F||(Le.value={...Le.value,[l]:{message:O,transient:F}})}function sr(l){var c;l&&(c=Le.value[l])!=null&&c.transient&&ct(l,null)}function rn(){const l=Object.entries(Le.value).filter(([,p])=>p==null?void 0:p.transient).map(([p])=>p);if(l.length===0)return;let c=Le.value;for(const p of l)c=_t(c,p);Le.value=c}function xn(l){const c=yr(t.value).find(p=>p.id===l);return(c==null?void 0:c.updatedAtIso)??""}function Ln(l,c){if(!l)return;const p={scrollTop:Math.max(0,c.scrollTop),isAtBottom:c.isAtBottom===!0};typeof c.scrollRatio=="number"&&Number.isFinite(c.scrollRatio)&&(p.scrollRatio=_s(c.scrollRatio,0,1));const b=ae.value[l];b&&b.scrollTop===p.scrollTop&&b.isAtBottom===p.isAtBottom&&b.scrollRatio===p.scrollRatio||(ae.value={...ae.value,[l]:p},Fc(ae.value))}function Nn(l,c){const p=r.value[l]??[];No(p,c)||(r.value={...r.value,[l]:c})}function en(l,c){const p=s.value[l]??[];No(p,c)||(s.value={...s.value,[l]:c})}function kn(l,c){const p=u.value[l]??[];No(p,c)||(u.value={...u.value,[l]:c})}function Vn(l,c){const p=o.value[l]??[];No(p,c)||(o.value={...o.value,[l]:c})}function Vt(l,c){const p=o.value[l]??[],b=da(p,c);Vn(l,b)}function on(l,c){const p=s.value[l]??[],b=da(p,c);en(l,b)}function gn(l,c){const p=u.value[l]??[],b=da(p,c);kn(l,b)}function jt(l,c){if(!l)return;const p=c.trim(),b=a.value[l]??"";if(p.length===0){if(!b)return;a.value=_t(a.value,l);return}b!==p&&(a.value={...a.value,[l]:p})}function zn(l,c){if(!l)return;const p=a.value[l]??"";jt(l,`${p}${c}`)}function Cn(l){l&&l in a.value&&(a.value=_t(a.value,l))}function St(l){l&&l in o.value&&(o.value=_t(o.value,l))}function sn(l){l&&l in u.value&&(u.value=_t(u.value,l))}function jn(l){l&&(St(l),Cn(l),ot(l,null),i.value[l]&&(i.value=_t(i.value,l)),Ce.value[l]&&(Ce.value=_t(Ce.value,l)),fn(l))}function Er(l){return l==="completed"?"completed":l==="inProgress"||l==="in_progress"?"inProgress":"pending"}function An(l){var p;const c=[];(p=l.explanation)!=null&&p.trim()&&c.push(l.explanation.trim());for(const b of l.steps){const O=b.status==="completed"?"x":b.status==="inProgress"?"~":" ";c.push(`- [${O}] ${b.step}`)}return c.join(`
53
- `).trim()}function En(l){if(l.method!=="turn/plan/updated")return null;const c=Pe(l.params),p=an(l),b=Te(c==null?void 0:c.turnId)||Te(c==null?void 0:c.turn_id),F=(Array.isArray(c==null?void 0:c.plan)?c==null?void 0:c.plan:[]).map(re=>Pe(re)).map(re=>({step:Te(re==null?void 0:re.step),status:Er(re==null?void 0:re.status)})).filter(re=>re.step.length>0);if(!p||!b)return null;const U={explanation:Te(c==null?void 0:c.explanation).trim()||void 0,steps:F,isStreaming:!0};return{threadId:p,message:{id:`${b}:plan`,role:"assistant",text:An(U),messageType:"plan.live",plan:U}}}function ar(l){if(l.method!=="item/plan/delta")return null;const c=Pe(l.params),p=an(l),b=Te(c==null?void 0:c.turnId)||Te(c==null?void 0:c.turn_id),O=Te(c==null?void 0:c.delta);if(!p||!b||!O)return null;const F=`${b}:plan`,D=(o.value[p]??[]).find(Ue=>Ue.id===F),U=`${(D==null?void 0:D.text)??""}${O}`,re=D!=null&&D.plan?{...D.plan,isStreaming:!0}:void 0;return{threadId:p,message:{id:F,role:"assistant",text:U,messageType:"plan.live",plan:re}}}function Pe(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)?l:null}function Te(l){return typeof l=="string"?l:""}function Mt(l){return typeof l=="number"&&Number.isFinite(l)?l:null}function ir(l){var c,p;return((c=l.limitId)==null?void 0:c.trim())||((p=l.limitName)==null?void 0:p.trim())||"__default__"}function Qn(l){const c=Pe(l);if(!c)return null;const p=Mt(c.windowDurationMins);return{usedPercent:_s(Mt(c.usedPercent)??0,0,100),windowDurationMins:p,windowMinutes:p,resetsAt:Mt(c.resetsAt)}}function In(l){const c=Pe(l);if(!c)return null;const p=Pe(c.credits);return{limitId:Te(c.limitId)||null,limitName:Te(c.limitName)||null,primary:Qn(c.primary),secondary:Qn(c.secondary),credits:p?{hasCredits:p.hasCredits===!0,unlimited:p.unlimited===!0,balance:Te(p.balance)||null}:null,planType:Te(c.planType)||null}}function vn(l){const c=Pe(l);if(!c)return[];const p=[],b=new Set,O=D=>{if(!D)return;const U=ir(D);b.has(U)||(b.add(U),p.push(D))};O(In(c.rateLimits));const F=Pe(c.rateLimitsByLimitId);if(F)for(const D of Object.values(F))O(In(D));return p}function Ft(l){const c=Pe(l);if(!c)return null;const p=Mt(c.totalTokens??c.total_tokens),b=Mt(c.inputTokens??c.input_tokens),O=Mt(c.cachedInputTokens??c.cached_input_tokens),F=Mt(c.outputTokens??c.output_tokens),D=Mt(c.reasoningOutputTokens??c.reasoning_output_tokens);return p===null||b===null||O===null||F===null||D===null?null:{totalTokens:p,inputTokens:b,cachedInputTokens:O,outputTokens:F,reasoningOutputTokens:D}}function wn(l){const c=Pe(l);if(!c)return null;const p=Ft(c.total),b=Ft(c.last);if(!p||!b)return null;const O=Mt(c.modelContextWindow??c.model_context_window),F=b.totalTokens,D=typeof O=="number"?Math.max(O-F,0):null,U=typeof O=="number"&&O>0?_s(Math.round((D??0)/O*100),0,100):null;return{total:p,last:b,modelContextWindow:O,currentContextTokens:F,remainingContextTokens:D,remainingContextPercent:U}}function zr(l){if(l.method!=="thread/tokenUsage/updated")return null;const c=Pe(l.params),p=an(l),b=wn((c==null?void 0:c.tokenUsage)??(c==null?void 0:c.token_usage));return!p||!b?null:{threadId:p,usage:b}}function an(l){const c=Pe(l.params);if(!c)return"";const p=Te(c.threadId);if(p)return p;const b=Te(c.thread_id);if(b)return b;const O=Te(c.conversationId);if(O)return O;const F=Te(c.conversation_id);if(F)return F;const D=Pe(c.thread),U=Te(D==null?void 0:D.id);if(U)return U;const re=Pe(c.turn),Ue=Te(re==null?void 0:re.threadId);if(Ue)return Ue;const Xe=Te(re==null?void 0:re.thread_id);return Xe||""}function Gr(l){if(l.method!=="turn/completed")return"";const c=Pe(l.params),p=Pe(c==null?void 0:c.turn);if(!p||p.status!=="failed")return"";const b=Pe(p.error);return Te(b==null?void 0:b.message)}function Xn(l){var b;if(l.method!=="error")return null;const c=Pe(l.params),p=Te(c==null?void 0:c.message)||Te((b=Pe(c==null?void 0:c.error))==null?void 0:b.message);return p?{message:p,transient:(c==null?void 0:c.willRetry)===!0}:null}function Zn(l){const c=Pe(l);if(!c)return null;const p=c.id,b=Te(c.method),O=c.params;if(typeof p!="number"||!Number.isInteger(p)||!b)return null;const F=Pe(O),D=Te(F==null?void 0:F.threadId)||Mo,U=Te(F==null?void 0:F.turnId),re=Te(F==null?void 0:F.itemId),Ue=Te(c.receivedAtIso)||new Date().toISOString();return{id:p,method:b,threadId:D,turnId:U,itemId:re,receivedAtIso:Ue,params:O??null}}function er(l){if(l.method!=="item/tool/requestUserInput")return[];const c=Pe(l.params),p=Array.isArray(c==null?void 0:c.questions)?c.questions:[],b=[];for(const O of p){const F=Pe(O),D=Te(F==null?void 0:F.id).trim();D&&b.push(D)}return b}function Kr(l){const c=l.threadId||Mo,p=Se.value[c]??[],b=p.findIndex(F=>F.id===l.id),O=[...p];b>=0?O.splice(b,1,l):O.push(l),Se.value={...Se.value,[c]:O.sort((F,D)=>F.receivedAtIso.localeCompare(D.receivedAtIso))},nt()}function T(l){const c={};for(const[p,b]of Object.entries(Se.value)){const O=b.filter(F=>F.id!==l);O.length>0&&(c[p]=O)}Se.value=c,nt()}function k(l){const c={};for(const p of l){const b=p.threadId||Mo,O=c[b]??[];O.push(p),c[b]=O}for(const p of Object.values(c))p.sort((b,O)=>b.receivedAtIso.localeCompare(O.receivedAtIso));Se.value=c}function E(l){if(l.method==="server/request"){const c=Zn(l.params);return c&&Kr(c),!0}if(l.method==="server/request/resolved"){const c=Pe(l.params),p=c==null?void 0:c.id;return typeof p=="number"&&Number.isInteger(p)&&T(p),!0}return!1}function B(l){return l.replace(/\s+/gu," ").trim()}function y(l){const c=an(l);if(!c)return null;if(l.method==="turn/started")return{threadId:c,activity:{label:"Thinking",details:[]}};if(l.method==="item/started"){const p=Pe(l.params),b=Pe(p==null?void 0:p.item),O=Te(b==null?void 0:b.type).toLowerCase();if(O==="reasoning")return{threadId:c,activity:{label:"Thinking",details:[]}};if(O==="agentmessage")return{threadId:c,activity:{label:"Writing response",details:[]}};if(O==="commandexecution"){const F=Te(b==null?void 0:b.command);return{threadId:c,activity:{label:"Running command",details:F?[F]:[]}}}if(O==="filechange"){const D=(Array.isArray(b==null?void 0:b.changes)?b.changes:[])[0],U=Te(D==null?void 0:D.path);return{threadId:c,activity:{label:"Applying changes",details:U?[U]:[]}}}}return l.method==="item/commandExecution/outputDelta"?{threadId:c,activity:{label:"Running command",details:[]}}:l.method==="item/fileChange/outputDelta"?{threadId:c,activity:{label:"Applying changes",details:[]}}:l.method==="item/reasoning/summaryTextDelta"||l.method==="item/reasoning/summaryPartAdded"?{threadId:c,activity:{label:"Thinking",details:[]}}:l.method==="item/agentMessage/delta"?{threadId:c,activity:{label:"Writing response",details:[]}}:null}function C(l){if(l.method!=="turn/started")return null;const c=Pe(l.params);if(!c)return null;const p=an(l);if(!p)return null;const b=Pe(c.turn),O=Te(b==null?void 0:b.id)||Te(c.turnId)||`${p}:unknown`;if(!O)return null;const F=to(Te(b==null?void 0:b.startedAt))??to(Te(c.startedAt))??to(l.atIso)??Date.now();return{threadId:p,turnId:O,startedAtMs:F}}function H(l){if(l.method!=="turn/completed")return null;const c=Pe(l.params);if(!c)return null;const p=an(l);if(!p)return null;const b=Pe(c.turn),O=Te(b==null?void 0:b.id)||Te(c.turnId)||`${p}:unknown`;if(!O)return null;const F=to(Te(b==null?void 0:b.completedAt))??to(Te(c.completedAt))??to(l.atIso)??Date.now(),D=to(Te(b==null?void 0:b.startedAt))??to(Te(c.startedAt))??void 0;return{threadId:p,turnId:O,completedAtMs:F,startedAtMs:D}}function ve(l){return`${l}:live-reasoning`}function Je(l){const c=r.value[l]??[];let p=-1;for(const b of c)typeof b.turnIndex=="number"&&Number.isFinite(b.turnIndex)&&(p=Math.max(p,b.turnIndex));return p+1}function Et(l,c,p){if(!l||!c||!Number.isInteger(p)||p<0)return;const b=de.value[l]??{};b[c]!==p&&(de.value={...de.value,[l]:{...b,[c]:p}})}function $t(l,c){const p=de.value[l]??{},b=Object.entries(p),O=Object.entries(c);b.length===O.length&&b.every(([F,D])=>c[F]===D)||(de.value={...de.value,[l]:{...c}})}function kt(l){const c=u.value[l];if(!c||c.length===0)return;const p=de.value[l]??{};let b=!1;const O=c.map(F=>{if(typeof F.turnIndex=="number"||!F.turnId)return F;const D=p[F.turnId];return typeof D!="number"?F:(b=!0,{...F,turnIndex:D})});b&&(u.value={...u.value,[l]:O})}function Kt(l){const c=Pe(l.params);if(!c)return"";if(l.method==="item/started"){const p=Pe(c.item);return!p||p.type!=="reasoning"?"":Te(p.id)}return""}function Yr(l){const c=Pe(l.params);if(!c)return null;if(l.method==="item/reasoning/summaryTextDelta"){const p=Te(c.itemId),b=Te(c.delta);return!p||!b?null:{messageId:ve(p),delta:b}}return null}function io(l){const c=Pe(l.params);if(!c)return"";if(l.method==="item/reasoning/summaryPartAdded"){const p=Te(c.itemId);return p?ve(p):""}return""}function Ha(l){const c=Pe(l.params);if(!c)return"";if(l.method==="item/completed"){const p=Pe(c.item);return!p||p.type!=="reasoning"?"":ve(Te(p.id))}return""}function js(l){const c=Pe(l.params);if(!c)return"";if(l.method==="item/started"){const p=Pe(c.item);return!p||p.type!=="agentMessage"?"":Te(p.id)}return""}function Qo(l){const c=Pe(l.params);if(!c)return null;if(l.method==="item/agentMessage/delta"){const p=Te(c.itemId),b=Te(c.delta);return!p||!b?null:{messageId:p,delta:b}}return null}function Jr(l){const c=Pe(l.params);if(!c)return null;if(l.method==="item/completed"){const p=Pe(c.item);if(!p||p.type!=="agentMessage")return null;const b=Te(p.id),O=Te(p.text);return!b||!O?null:{id:b,role:"assistant",text:O,messageType:"agentMessage.live"}}return null}function Wa(l){if(l.method!=="item/started")return null;const c=Pe(l.params),p=Pe(c==null?void 0:c.item);if(!p||p.type!=="commandExecution")return null;const b=Te(p.id),O=Te(p.command);if(!b)return null;const F=typeof p.cwd=="string"?p.cwd:null;return{id:b,role:"system",text:O,messageType:"commandExecution",commandExecution:{command:O,cwd:F,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Va(l){if(l.method!=="item/commandExecution/outputDelta")return null;const c=Pe(l.params);if(!c)return null;const p=Te(c.itemId),b=Te(c.delta);return!p||!b?null:{itemId:p,delta:b}}function za(l){if(l.method!=="item/completed")return null;const c=Pe(l.params),p=Pe(c==null?void 0:c.item);if(!p||p.type!=="commandExecution")return null;const b=Te(p.id),O=Te(p.command);if(!b)return null;const F=typeof p.cwd=="string"?p.cwd:null,D=Te(p.status),U=D==="failed"?"failed":D==="declined"?"declined":D==="interrupted"?"interrupted":"completed",re=typeof p.aggregatedOutput=="string"?p.aggregatedOutput:"",Ue=typeof p.exitCode=="number"?p.exitCode:null;return{id:b,role:"system",text:O,messageType:"commandExecution",commandExecution:{command:O,cwd:F,status:U,aggregatedOutput:re,exitCode:Ue}}}function Ga(l){var Ue;if(l.method!=="item/completed")return null;const c=Pe(l.params),p=Pe(c==null?void 0:c.item);if(!p||p.type!=="fileChange")return null;const b=Te(p.id);if(!b)return null;const O=Te(c==null?void 0:c.threadId),F=Te(c==null?void 0:c.turnId),D=O&&F?(Ue=de.value[O])==null?void 0:Ue[F]:void 0,U=Af(p.changes),re=Cf(p.status);return U.length===0||re!=="completed"?null:{id:b,role:"system",text:"",messageType:"fileChange",fileChangeStatus:re,fileChanges:U,turnId:F||void 0,turnIndex:typeof D=="number"?D:void 0}}function Xo(l,c){const p=i.value[l]??[],b=da(p,c);b!==p&&(i.value={...i.value,[l]:b})}function Zo(l,c){const p=i.value[l];if(!p||p.length===0)return;const b=new Set(c.map(F=>F.id)),O=p.filter(F=>!b.has(F.id));O.length!==p.length&&(O.length===0?i.value=_t(i.value,l):i.value={...i.value,[l]:O})}function Ka(l,c){const p=u.value[l];if(!p||p.length===0)return;const b=new Set(c.map(U=>U.id)),O=new Set(c.filter(U=>U.messageType==="fileChange"&&typeof U.turnId=="string"&&U.turnId.length>0).map(U=>U.turnId)),F=new Set(c.filter(U=>U.messageType==="fileChange"&&typeof U.turnIndex=="number").map(U=>U.turnIndex)),D=p.filter(U=>!b.has(U.id)&&!(U.turnId&&O.has(U.turnId))&&!(typeof U.turnIndex=="number"&&F.has(U.turnIndex)));D.length!==p.length&&(D.length===0?u.value=_t(u.value,l):u.value={...u.value,[l]:D})}function Ya(l){if(l.method==="item/agentMessage/delta")return!0;const c=Pe(l.params);if(!c)return!1;if(l.method==="item/completed"){const p=Pe(c.item);return(p==null?void 0:p.type)==="agentMessage"}return!1}function Ja(l){var rs,ea,Xr,os,ta;if(E(l))return;if(l.method==="account/rateLimits/updated"&&Un(),l.method==="thread/name/updated"){const He=Pe(l.params),ln=Te(He==null?void 0:He.threadId),mr=Te(He==null?void 0:He.threadName);ln&&mr&&(Ve.value={...Ve.value,[ln]:mr},nt(),Hi(ln,mr))}if(l.method==="account/rateLimits/updated"){Tt(If(l.params));return}const c=zr(l);if(c){bt(c.threadId,c.usage);return}const p=y(l);p&&ot(p.threadId,p.activity);const b=an(l),O=Xn(l);!O&&b&&sr(b);const F=C(l);F&&(Z.set(F.turnId,F),Et(F.threadId,F.turnId,Je(F.threadId)),Ce.value={...Ce.value,[F.threadId]:F.turnId},St(F.threadId),sn(F.threadId),It(F.threadId,null),ct(F.threadId,null),et(F.threadId,!0),v.value[F.threadId]&&(v.value=_t(v.value,F.threadId)));const D=H(l),U=Gr(l),Ue=!!((D==null?void 0:D.threadId)??an(l))&&!!U&&M.value!==rr&&ca(new Error(U));if(D){Re.value[D.threadId];const He=Z.get(D.turnId);He&&Z.delete(D.turnId);const ln=Mt((rs=Pe(l.params))==null?void 0:rs.durationMs)??Mt((Xr=Pe((ea=Pe(l.params))==null?void 0:ea.turn))==null?void 0:Xr.durationMs)??(typeof D.startedAtMs=="number"?D.completedAtMs-D.startedAtMs:null)??(He?D.completedAtMs-He.startedAtMs:null),mr=typeof ln=="number"?Math.max(0,ln):0;It(D.threadId,{turnId:D.turnId,durationMs:mr}),Ce.value[D.threadId]&&(Ce.value=_t(Ce.value,D.threadId)),et(D.threadId,!1),ot(D.threadId,null),Wn(D.threadId),Ue||(fn(D.threadId),Vs(D.threadId))}if(U){const He=(D==null?void 0:D.threadId)||an(l);He&&ct(He,U),J.value=U,He&&Ue&&Lt(He)}else D&&ct(D.threadId,null);if(O){const He=b;He&&ct(He,O.message,{transient:O.transient}),J.value=O.message,M.value!==rr&&ca(new Error(O.message))&&(He?Lt(He):Ke())}const Xe=En(l);Xe&&(Vt(Xe.threadId,Xe.message),ot(Xe.threadId,{label:"Planning",details:((os=Xe.message.plan)==null?void 0:os.steps.map(He=>He.step).slice(0,2))??[]}));const st=ar(l);if(st&&(Vt(st.threadId,st.message),ot(st.threadId,{label:"Planning",details:[]})),!b||b!==n.value)return;js(l);const Ct=Qo(l);if(Ct){const He=(s.value[b]??[]).find(mr=>mr.id===Ct.messageId),ln=`${(He==null?void 0:He.text)??""}${Ct.delta}`;on(b,{id:Ct.messageId,role:"assistant",text:ln,messageType:"agentMessage.live"})}const Ir=Jr(l);Ir&&on(b,Ir),Kt(l);const Qs=Yr(l);if(Qs&&zn(b,Qs.delta),io(l)){const He=a.value[b]??"";He.trim().length>0&&!He.endsWith(`
54
-
55
- `)&&jt(b,`${He}
56
-
57
- `)}Ha(l);const Ao=Wa(l);Ao&&(Xo(b,Ao),ot(b,{label:"Running command",details:[((ta=Ao.commandExecution)==null?void 0:ta.command)??""]}));const ns=Va(l);if(ns){const He=(i.value[b]??[]).find(ln=>ln.id===ns.itemId);He!=null&&He.commandExecution&&Xo(b,{...He,commandExecution:{...He.commandExecution,aggregatedOutput:`${He.commandExecution.aggregatedOutput}${ns.delta}`}})}const Xs=za(l);Xs&&Xo(b,Xs);const Zs=Ga(l);if(Zs&&gn(b,Zs),Ya(l)&&(se&&n.value&&Ln(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Cn(b)),l.method==="turn/completed"){se=!1,Cn(b),i.value[b]&&(i.value=_t(i.value,b));const He=an(l);He&&(et(He,!1),ot(He,null),Wn(He),Ue||(fn(He),Vs(He)))}}function Qa(l){if(l.method==="thread/tokenUsage/updated")return;const c=an(l);c&&ne.add(c);const p=l.method;(p.startsWith("thread/")||p.startsWith("turn/")||p.startsWith("item/"))&&(K=!0),!(x!==null||typeof window>"u")&&(x=window.setTimeout(()=>{x=null,tr()},Vi))}async function Xa(l){if(!fe){fe=!0;try{const c=await hs(),p=[];for(const b of c.order){const O=Po(b);p.includes(O)||p.push(O)}if(p.length>0){const b=ua(p,l);yo(Y.value,b)||(Y.value=b,Ro(Y.value))}if(Object.keys(c.labels).length>0){const b={...le.value};let O=!1;for(const[F,D]of Object.entries(c.labels)){const U=Po(F);b[U]!==D&&(b[U]=D,O=!0)}O&&(le.value=b,Ki(b))}}catch{}}}async function Za(){if(!(Object.keys(Ve.value).length>0))try{const l=await Nb();Object.keys(l.titles).length>0&&(Ve.value=l.titles)}catch{}}async function Fs(l,c,p){if(Ve.value[l])return;const b=c.trim();if(!b)return;const O=b.length>300?b.slice(0,300):b;try{const F=await jb(O,p);if(!F||Ve.value[l])return;Ve.value={...Ve.value,[l]:F},nt(),Hi(l,F)}catch{}}async function lo(){var l;ze.value||(pe.value=!0);try{const[c]=await Promise.all([rb(),Za()]);await Xa(c);const p=ua(Y.value,c);yo(Y.value,p)||(Y.value=p,Ro(Y.value));const b=Yi(c,Y.value),O=AS(t.value,b,f.value);t.value=fa(t.value,O),f.value=Yt(f.value,new Set(yr(t.value).map(U=>U.id))),nt(),ze.value=!0;const F=yr(e.value);mn(F),F.some(U=>U.id===n.value)||lt(((l=F[0])==null?void 0:l.id)??"")}finally{pe.value=!1}}async function Fn(l,c={}){if(!l)return;const p=ye.value[l]===!0,b=c.silent!==!0&&!p;b&&(Ae.value=!0);try{be.value[l]!==!0&&(await Bi(l),be.value={...be.value,[l]:!0});const{messages:O,inProgress:F,activeTurnId:D,turnIndexByTurnId:U}=await kc(l);$t(l,U),kt(l);const re=r.value[l]??[],Ue=pS(re,O,{preserveMissing:c.silent===!0});Nn(l,Ue);const Xe=s.value[l]??[],st=gS(Xe,O);en(l,st),Zo(l,O),Ka(l,O),ye.value={...ye.value,[l]:!0};const Ct=xn(l);Ct&&(De.value={...De.value,[l]:Ct}),et(l,F),D?Ce.value={...Ce.value,[l]:D}:Ce.value[l]&&(Ce.value=_t(Ce.value,l)),F||jn(l),Zt(l)}finally{b&&(Ae.value=!1)}}async function Bs(l,c={}){l&&ye.value[l]!==!0&&await Fn(l,c)}async function Qr(){var l,c;try{const p=((c=(l=he.value)==null?void 0:l.cwd)==null?void 0:c.trim())??"";ee.value=await Fb(p?[p]:void 0)}catch{}}async function qs(){try{Tt(await Ac())}catch{}}async function ei(l={}){J.value="";const c=l.includeSelectedThreadMessages!==!1,p=l.awaitAncillaryRefreshes===!0;try{await lo();const b=Promise.allSettled([nn(),Sn(),_n(),Qr(),qs()]).then(()=>{});c&&await Fn(n.value),p&&await b}catch(b){J.value=b instanceof Error?b.message:"Unknown application error"}}async function ti(l){lt(l);try{await Promise.all([Fn(l),Qr()])}catch(c){J.value=c instanceof Error?c.message:"Unknown application error"}}async function ni(l){try{await gb(l),await lo(),n.value===l&&await Fn(n.value)}catch(c){J.value=c instanceof Error?c.message:"Unknown application error"}}async function Us(l,c){const p=c.trim();if(!(!l||!p))try{await vb(l,p),Ve.value={...Ve.value,[l]:p},nt(),Hi(l,p)}catch(b){J.value=b instanceof Error?b.message:"Unknown application error"}}async function ri(l){var D,U;const c=l.trim();if(!c)return"";const p=yr(t.value).find(re=>re.id===c),b=((D=p==null?void 0:p.cwd)==null?void 0:D.trim())??"",O=((U=p==null?void 0:p.title)==null?void 0:U.trim())??"Forked chat",F=M.value.trim();J.value="";try{const re=await Ic(c,b||void 0,F||void 0);return typeof re!="string"||!re.trim()?"":(pn(re,b,O),be.value={...be.value,[re]:!0},lt(re),await lo(),await Fn(re),re)}catch(re){return J.value=re instanceof Error?re.message:"Unknown application error",""}}async function oi(l,c){var D;const p=l.trim();if(!p||!Number.isInteger(c)||c<0)return"";if(f.value[p]===!0)return J.value="Finish the current turn before forking from a response.","";if(ye.value[p]!==!0)try{await Fn(p)}catch(U){return J.value=U instanceof Error?U.message:"Unknown application error",""}const b=r.value[p]??[];let O=-1;for(const U of b)typeof U.turnIndex=="number"&&Number.isFinite(U.turnIndex)&&(O=Math.max(O,U.turnIndex));if(O>=0&&c>O)return"";const F=yr(t.value).find(U=>U.id===p)??null;try{J.value="";const U=await Ic(p),re=U.threadId.trim();if(!re)return"";const Ue=U.cwd.trim()||((D=F==null?void 0:F.cwd)==null?void 0:D.trim())||"",Xe=IS((F==null?void 0:F.title)||(F==null?void 0:F.preview)||"Untitled thread");pn(re,Ue,Xe),Nn(re,U.messages),ye.value={...ye.value,[re]:!0},be.value={...be.value,[re]:!0},St(re),en(re,[]),Cn(re),i.value[re]&&(i.value=_t(i.value,re)),It(re,null),ot(re,null),ct(re,null),et(re,!1);const st=O-c;if(st>0){const Ct=await qi(re,st);Nn(re,Ct)}return await Us(re,Xe),lt(re),lo().catch(()=>{}),re}catch(U){return J.value=U instanceof Error?U.message:"Unknown application error",""}}async function Hs(l,c,p=[],b=[],O=[]){if(!l||!c.trim()||p.length>0||b.length>0||O.length>0)return!1;const D=(Se.value[l]??[]).filter(Ue=>Ue.method==="item/tool/requestUserInput");if(D.length!==1)return!1;const[U]=D,re=er(U);return re.length!==1?!1:Ks({id:U.id,result:{answers:{[re[0]]:{answers:[c.trim()]}}}})}async function Ws(l,c=[],p=[],b="steer",O=[],F){if(z.value)return;const D=n.value,U=l.trim();if(!D||!U&&c.length===0&&O.length===0||await Hs(D,U,c,p,O))return;const re=f.value[D]===!0;if(re&&b==="queue"){const Ue=d.value[D]??[],Xe=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,st=[...Ue],Ct=typeof F=="number"?Math.max(0,Math.min(F,st.length)):st.length;st.splice(Ct,0,{id:Xe,text:U,imageUrls:c,skills:p,fileAttachments:O,collaborationMode:X.value}),d.value={...d.value,[D]:st};return}if(re){se=!0,Co(D,U,c,p,O).catch(Ue=>{const Xe=Ue instanceof Error?Ue.message:"Unknown application error";ct(D,Xe),J.value=Xe});return}J.value="",se=!0,It(D,null),ot(D,{label:"Thinking",details:Yn(M.value,L.value,X.value)}),ct(D,null),et(D,!0);try{await Co(D,U,c,p,O)}catch(Ue){se=!1,et(D,!1),ot(D,null);const Xe=Ue instanceof Error?Ue.message:"Unknown application error";throw ct(D,Xe),J.value=Xe,Ue}}async function ko(l,c,p=[],b=[],O=[]){if(z.value)return"";const F=l.trim(),D=c.trim(),U=M.value.trim();if(!F&&p.length===0&&O.length===0)return"";Ie.value=!0,J.value="";let re="";try{try{re=await Ec(D||void 0,U||void 0)}catch(Ct){if(U&&U!==rr&&ca(Ct))await Ke(),re=await Ec(D||void 0,rr);else throw Ct}if(!re)return"";pn(re,D,F||"[Image]"),be.value={...be.value,[re]:!0},lt(re),se=!0,It(re,null),ot(re,{label:"Thinking",details:Yn(M.value,L.value,X.value)}),ct(re,null),et(re,!0);const Ue=re,Xe=D||null,st=F;return Co(re,F,p,b,O).catch(Ct=>{se=!1,et(re,!1),ot(re,null);const Ir=Ct instanceof Error?Ct.message:"Unknown application error";ct(re,Ir),J.value=Ir}).finally(()=>{Ie.value=!1}),Fs(Ue,st,Xe),re}catch(Ue){se=!1,re&&(et(re,!1),ot(re,null));const Xe=Ue instanceof Error?Ue.message:"Unknown application error";throw re&&ct(re,Xe),J.value=Xe,Ie.value=!1,Ue}}async function Co(l,c,p=[],b=[],O=[]){const F=M.value.trim(),D=L.value,U=X.value,re=c.trim(),Ue=b.map(st=>({name:st.name,path:st.path})),Xe=O.map(st=>({...st}));Wt(l,{text:re,imageUrls:[...p],skills:Ue,fileAttachments:Xe,effort:D,collaborationMode:U,fallbackRetried:!1});try{be.value[l]!==!0&&await Bi(l);let st="";try{st=await Ui(l,c,p,F||void 0,D||void 0,b.length>0?b:void 0,O,U)}catch(Ct){if(F&&F!==rr&&ca(Ct))await Ke(),Wt(l,{text:re,imageUrls:[...p],skills:Ue,fileAttachments:Xe,effort:D,collaborationMode:U,fallbackRetried:!0}),st=await Ui(l,c,p,rr,D||void 0,b.length>0?b:void 0,O,U);else throw Ct}st&&(Ce.value={...Ce.value,[l]:st}),be.value={...be.value,[l]:!0},ne.add(l),K=!0,await tr(),Ar(l)}catch(st){throw st}}async function Vs(l){if(m.value[l]===!0)return;const c=d.value[l];if(!c||c.length===0)return;m.value={...m.value,[l]:!0};const[p,...b]=c;d.value=b.length>0?{...d.value,[l]:b}:_t(d.value,l),Ie.value=!0,J.value="",se=!0,It(l,null),ot(l,{label:"Thinking",details:Yn(M.value,L.value,p.collaborationMode)}),ct(l,null),et(l,!0);try{zt(p.collaborationMode),await Co(l,p.text,p.imageUrls,p.skills,p.fileAttachments)}catch{et(l,!1),ot(l,null)}finally{m.value=_t(m.value,l),Ie.value=!1}}async function si(){const l=n.value;if(!l||f.value[l]!==!0)return;let c=Ce.value[l];if(!c){const{activeTurnId:p}=await kc(l);c=p,c&&(Ce.value={...Ce.value,[l]:c})}if(!c)throw new Error("Could not determine active turn id for interrupt");je.value=!0,J.value="";try{await Tb(l,c),et(l,!1),ot(l,null),ct(l,null),Ce.value[l]&&(Ce.value=_t(Ce.value,l)),ne.add(l),K=!0,await tr()}catch(p){const b=p instanceof Error?p.message:"Failed to interrupt active turn";ct(l,b),J.value=b}finally{je.value=!1}}async function ai(l){const c=n.value;if(!c||ue.value||!l.trim())return;const p=r.value[c]??[],b=p.find(U=>U.turnId===l),O=typeof(b==null?void 0:b.turnIndex)=="number"?b.turnIndex:-1;if(O<0)return;const F=p.reduce((U,re)=>typeof re.turnIndex=="number"&&re.turnIndex>U?re.turnIndex:U,-1);if(F<0||O>F)return;const D=F-O+1;if(!(D<1)){ue.value=!0,J.value="";try{const U=await qi(c,D);Nn(c,U),en(c,[]),Cn(c),i.value[c]&&(i.value=_t(i.value,c)),It(c,null),ot(c,null),ct(c,null),K=!0,await tr()}catch(U){J.value=U instanceof Error?U.message:"Failed to rollback thread"}finally{ue.value=!1}}}function ii(l,c){l.length===0||(le.value[l]??"")===c||(le.value={...le.value,[l]:c},Ki(le.value))}async function zs(l){var F;if(l.length===0)return;const c=Y.value.filter(D=>D!==l);if(yo(Y.value,c)||(Y.value=c,Ro(Y.value)),t.value=t.value.filter(D=>D.projectName!==l),le.value[l]!==void 0){const D={...le.value};delete D[l],le.value=D,Ki(D)}nt();const p=yr(e.value);mn(p),p.some(D=>D.id===n.value)||lt(((F=p[0])==null?void 0:F.id)??"");const O=new Set;try{const D=await hs();for(const U of D.order)Po(U)===l&&O.add(U);for(const U of D.active)Po(U)===l&&O.add(U);for(const U of Object.keys(D.labels))Po(U)===l&&O.add(U)}catch{}if(O.size>0)try{const D=await hs(),U=D.order.filter(Xe=>!O.has(Xe)),re=D.active.filter(Xe=>!O.has(Xe)),Ue=re.length===0&&U.length>0?[U[0]]:re;await Rc({order:U,labels:SS(D.labels,O),active:Ue});return}catch{}await ts()}function es(l,c){if(l.length===0||t.value.length===0)return;const p=t.value.map(re=>re.projectName),b=p.indexOf(l);if(b===-1)return;const O=Math.max(0,Math.min(c,p.length-1)),F=cS(p,b,O);if(F===p)return;const D=ua(F,t.value);Y.value=D,Ro(Y.value);const U=Yi(t.value,Y.value);t.value=fa(t.value,U),nt(),ts()}function li(l){const c=l.trim();if(!c)return;const p=[c,...Y.value.filter(O=>O!==c)];if(yo(Y.value,p))return;Y.value=p,Ro(Y.value);const b=Yi(t.value,Y.value);t.value=fa(t.value,b),nt(),ts()}async function ts(){var l,c;try{const p=await hs(),b=new Map;for(const D of p.order){const U=Po(D);b.has(U)||b.set(U,D)}for(const D of t.value){const U=((c=(l=D.threads[0])==null?void 0:l.cwd)==null?void 0:c.trim())??"";U&&b.set(D.projectName,U)}const O=[];for(const D of Y.value){const U=b.get(D);U&&!O.includes(U)&&O.push(U)}for(const D of p.order)O.includes(D)||O.push(D);const F=p.active.filter(D=>O.includes(D));F.length===0&&O.length>0&&F.push(O[0]),await Rc({order:O,labels:p.labels,active:F})}catch{}}async function tr(){if(Ee.value){typeof window<"u"&&x===null&&(x=window.setTimeout(()=>{x=null,tr()},Vi));return}Ee.value=!0;const l=K,c=new Set(ne);K=!1,ne.clear();try{l&&await lo();const p=n.value;if(!p)return;const b=c.has(p),O=f.value[p]===!0,F=xn(p),D=De.value[p]??"",U=F.length>0&&F!==D;(b||O||U||l)&&await Fn(p,{silent:!0})}catch{}finally{Ee.value=!1,(K||ne.size>0)&&typeof window<"u"&&x===null&&(x=window.setTimeout(()=>{x=null,tr()},Vi))}}async function ui(){await Gs(),K=!0,n.value&&ne.add(n.value),await tr()}function ci(){typeof window>"u"||_||(Gs(),_=ub(l=>{if(l.method==="ready"){rn(),ui();return}Ja(l),Qa(l)}))}async function Gs(){try{const c=(await db()).map(p=>Zn(p)).filter(p=>p!==null);k(c)}catch{}}async function Ks(l){try{return await cb(l.id,{result:l.result,error:l.error}),T(l.id),!0}catch(c){return J.value=c instanceof Error?c.message:"Failed to reply to server request",!1}}function di(){if(_&&(_(),_=null),K=!1,ne.clear(),Z.clear(),x!==null&&typeof window<"u"&&(window.clearTimeout(x),x=null),$!==null&&typeof window<"u"&&(window.clearTimeout($),$=null),typeof window<"u")for(const l of G.values())window.clearTimeout(l);G.clear(),se=!1,r.value={},o.value={},s.value={},a.value={},i.value={},u.value={},de.value={},ie.value={},V.value={},Le.value={},Ce.value={},d.value={},m.value={},_e.value=null,Fe.value={}}const Ys=te(()=>{const l=n.value;return l?d.value[l]??[]:[]});function Js(l){const c=n.value;if(!c)return;const p=d.value[c];if(!p)return;const b=p.filter(O=>O.id!==l);d.value=b.length>0?{...d.value,[c]:b}:_t(d.value,c)}function fi(l){const c=n.value;if(!c)return;const p=d.value[c];if(!p)return;const b=p.find(O=>O.id===l);b&&(Js(l),zt(b.collaborationMode),Ws(b.text,b.imageUrls,b.skills,"steer",b.fileAttachments))}function Gn(l){lt(l)}return{projectGroups:e,projectDisplayNameById:le,selectedThread:he,selectedThreadTokenUsage:wt,selectedThreadScrollState:ke,selectedThreadServerRequests:qe,selectedLiveOverlay:Qe,codexQuota:Ze,selectedThreadId:n,availableCollaborationModes:j,availableModelIds:S,selectedCollaborationMode:X,selectedModelId:M,selectedReasoningEffort:L,selectedSpeedMode:q,installedSkills:ee,accountRateLimitSnapshots:oe,messages:yt,isLoadingThreads:pe,isLoadingMessages:Ae,isSendingMessage:Ie,isInterruptingTurn:je,isUpdatingSpeedMode:z,isRollingBack:ue,error:J,refreshAll:ei,refreshSkills:Qr,selectThread:ti,loadMessages:Fn,ensureThreadMessagesLoaded:Bs,setThreadScrollState:Ln,archiveThreadById:ni,renameThreadById:Us,forkThreadById:ri,forkThreadFromTurn:oi,rollbackSelectedThread:ai,sendMessageToSelectedThread:Ws,sendMessageToNewThread:ko,interruptSelectedThreadTurn:si,selectedThreadQueuedMessages:Ys,removeQueuedMessage:Js,steerQueuedMessage:fi,setSelectedCollaborationMode:zt,setSelectedModelId:ut,setSelectedReasoningEffort:Rt,updateSelectedSpeedMode:hn,respondToPendingServerRequest:Ks,renameProject:ii,removeProject:zs,reorderProject:es,pinProjectToTop:li,startPolling:ci,stopPolling:di,primeSelectedThread:Gn}}const RS={class:"sidebar-root"},PS={class:"sidebar-scrollable"},$S=["aria-pressed"],OS={key:1,class:"sidebar-search-bar"},DS={key:0,class:"sidebar-settings-area"},LS={key:0,class:"sidebar-settings-panel"},NS={class:"sidebar-settings-account-section"},jS={class:"sidebar-settings-account-header"},FS={class:"sidebar-settings-account-header-main"},BS=["aria-expanded","title"],qS={class:"sidebar-settings-account-collapse-icon"},US={class:"sidebar-settings-account-count"},HS=["disabled"],WS={key:0,class:"sidebar-settings-account-error"},VS={key:1,class:"sidebar-settings-account-empty"},zS={key:2,class:"sidebar-settings-account-list"},GS=["title","onMouseenter","onMouseleave"],KS={class:"sidebar-settings-account-main"},YS={class:"sidebar-settings-account-email"},JS={class:"sidebar-settings-account-meta"},QS={class:"sidebar-settings-account-quota"},XS={class:"sidebar-settings-account-id"},ZS={class:"sidebar-settings-account-actions"},ex=["disabled","onClick"],tx=["disabled","onClick"],nx=["title"],rx=["title"],ox={class:"sidebar-settings-value"},sx=["title"],ax={class:"sidebar-settings-value"},ix=["title"],lx={class:"sidebar-settings-value"},ux=["title"],cx=["title"],dx=["title"],fx=["title"],hx={class:"sidebar-settings-value"},px=["data-state","title"],mx=["data-state"],gx={class:"sidebar-settings-context-meta"},vx={class:"sidebar-settings-rate-limits"},wx={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},yx={class:"sidebar-settings-button-version"},bx=["data-active"],Tx={class:"content-body"},_x={key:1,class:"content-grid content-grid-home"},Sx={class:"new-thread-empty"},xx=["title"],kx={key:1,class:"new-thread-open-folder"},Cx={class:"new-thread-open-folder-current"},Ax=["title"],Ex=["disabled"],Ix={class:"new-thread-open-folder-actions"},Mx={class:"new-thread-open-folder-toggle"},Rx=["aria-pressed","disabled"],Px={key:0,class:"new-thread-open-folder-create"},$x={class:"new-thread-open-folder-create-composer"},Ox=["onKeydown"],Dx=["disabled"],Lx={key:0,class:"new-thread-open-folder-error"},Nx={key:1,class:"new-thread-open-folder-error-actions"},jx={class:"new-thread-open-folder-error"},Fx=["disabled"],Bx={key:2,class:"new-thread-open-folder-status"},qx={key:3,class:"new-thread-open-folder-status"},Ux={key:4,class:"new-thread-open-folder-list"},Hx=["title","disabled","onClick"],Wx={class:"new-thread-open-folder-item-name"},Vx=["disabled","onClick"],zx={class:"worktree-init-status-title"},Gx={class:"worktree-init-status-message"},Kx={key:3,class:"new-thread-trending"},Yx={class:"new-thread-trending-header"},Jx={key:0,class:"new-thread-trending-empty"},Qx={key:1,class:"new-thread-trending-empty"},Xx={key:2,class:"new-thread-trending-list"},Zx=["onClick"],ek=["title"],tk={class:"new-thread-trending-tip-name-owner"},nk={class:"new-thread-trending-tip-name-repo"},rk={key:1,class:"new-thread-trending-tip-name-repo"},ok={class:"new-thread-trending-tip-meta"},sk={class:"new-thread-trending-tip-description"},ak={class:"composer-with-queue"},ik={key:2,class:"content-grid"},lk={class:"content-thread"},uk={class:"composer-with-queue"},Uc="codex-web-local.sidebar-collapsed.v1",Hc="codex-web-local.accounts-section-collapsed.v1",Wc="codex-web-local.send-with-enter.v1",Vc="codex-web-local.in-progress-send-mode.v1",zc="codex-web-local.dark-mode.v1",Gc="codex-web-local.dictation-click-to-toggle.v1",Kc="codex-web-local.dictation-auto-send.v1",Yc="codex-web-local.dictation-language.v1",Jc="codex-web-local.github-trending-projects.v1",Qc="codex-web-local.chat-width.v1",ck=400,dk=dn({__name:"App",setup(e){const t=Si(()=>Mi(()=>import("./ThreadConversation-1LJi-Pk9.js"),__vite__mapDeps([0,1]))),n=Si(()=>Mi(()=>import("./ReviewPane-jxaR-1Q1.js"),__vite__mapDeps([2,3]))),r=Si(()=>Mi(()=>import("./SkillsHub-BkLIHbuN.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.72",a={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",chatWidth:"Choose how wide the conversation column and composer can grow on desktop screens.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",githubTrendingProjects:"Show or hide GitHub trending project cards on the new thread screen.",dictationLanguage:"Choose transcription language or keep auto-detect."},i={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},u={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:f,projectDisplayNameById:d,selectedThread:m,selectedThreadTokenUsage:v,selectedThreadScrollState:S,selectedThreadServerRequests:j,selectedLiveOverlay:N,codexQuota:X,selectedThreadId:M,availableCollaborationModes:L,availableModelIds:q,selectedCollaborationMode:W,selectedModelId:ae,selectedReasoningEffort:Y,selectedSpeedMode:le,installedSkills:De,accountRateLimitSnapshots:ye,messages:be,isLoadingThreads:de,isLoadingMessages:V,isSendingMessage:ie,isInterruptingTurn:Le,isUpdatingSpeedMode:Ce,refreshAll:Se,refreshSkills:Re,selectThread:_e,ensureThreadMessagesLoaded:Fe,setThreadScrollState:Ve,archiveThreadById:ee,forkThreadById:oe,renameThreadById:pe,forkThreadFromTurn:Ae,sendMessageToSelectedThread:Ie,sendMessageToNewThread:je,interruptSelectedThreadTurn:z,selectedThreadQueuedMessages:ue,removeQueuedMessage:J,steerQueuedMessage:Ee,setSelectedCollaborationMode:ze,setSelectedModelId:_,setSelectedReasoningEffort:x,updateSelectedSpeedMode:$,respondToPendingServerRequest:G,renameProject:Q,removeProject:K,reorderProject:ne,pinProjectToTop:fe,startPolling:se,stopPolling:Z,primeSelectedThread:Oe,rollbackSelectedThread:we}=MS(),he=av(),ke=sv(),{isMobile:qe}=Vl(),Qe=R(null),Ze=R(null),wt=R(null),yt=R([]),lt=R(!1),ut=R("trending-daily"),bt=R(null),zt=R(!1),Tt=R(!1),Ke=R(""),Wt=R("local"),fn=R({order:[],labels:{}}),Lt=R({phase:"idle",title:"",message:""}),Rt=R(dh()),hn=R(""),_n=R(!1),Yn=R(null),nn=R(null);let Sn=null;const Un=R("New Project (1)"),Nt=R(""),Ar=R(!1),Hn=R(hh()),Jn=R(!1),Vr=R(null),Gt=R([]),nt=R(!1),pn=R(!1),mn=R(""),Zt=R(""),It=R(""),et=R(""),Wn=R(na(Wc,!0)),ot=R(Zf()),ct=R(Xf()),sr=R(eh()),rn=R(na(Gc,!1)),xn=R(na(Kc,!0)),Ln=R(uh()),Nn=te(()=>ch()),en=R(na(Jc,!0)),kn=R(!1),Vn=R(""),Vt=R(""),on=R(!1),gn=R(!1),jt=R(""),zn=R(""),Cn=R([]),St=R(""),sn=R(!1),jn=R(!1),Er=R(!1),An=R(""),En=R({configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:""}),ar=R(null),Pe=R(!1),Te=R(!1);let Mt=null,ir=!1,Qn=0;const In=te(()=>{const h=he.params.threadId;return typeof h=="string"?h:""}),vn=te(()=>{const h=new Set;for(const w of f.value)for(const I of w.threads)h.add(I.id);return h}),Ft=te(()=>he.name==="home"),wn=te(()=>he.name==="skills"),zr=te(()=>{var h;return wn.value?"Skills":Ft.value?"New thread":((h=m.value)==null?void 0:h.title)??"Choose a thread"}),an=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",Gr=te(()=>{var w,I;return(((I=(w=m.value)==null?void 0:w.title)==null?void 0:I.trim())??"")||an}),Xn=te(()=>be.value.filter(h=>{const w=mh(h.messageType,h.role);return w==="worked"?!0:!(w==="turnActivity.live"||w==="turnError.live"||w==="agentReasoning.live")})),Zn=te(()=>N.value),er=te(()=>Ft.value?"__new-thread__":M.value),Kr=te(()=>{const h=j.value;return h.length>0?h[h.length-1]:null}),T=te(()=>{var h,w;return Ft.value?Ke.value.trim():((w=(h=m.value)==null?void 0:h.cwd)==null?void 0:w.trim())??""}),k=te(()=>{var h;return!Ft.value&&((h=m.value)==null?void 0:h.inProgress)===!0}),E=te(()=>!Ft.value&&!wn.value&&M.value.trim().length>0),B=te(()=>ie.value||Le.value||k.value||j.value.length>0);function y(h){return Number.isFinite(h)?new Intl.NumberFormat("en-US",{notation:h>=1e3?"compact":"standard",maximumFractionDigits:h>=1e5?0:1}).format(Math.max(0,Math.trunc(h))):"0"}function C(h){if(!h)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const w=[`Current context usage: ${h.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${h.total.totalTokens.toLocaleString()} tokens`];return typeof h.modelContextWindow=="number"?(w.unshift(`Model context window: ${h.modelContextWindow.toLocaleString()} tokens`),w.push(`Remaining context: ${(h.remainingContextTokens??0).toLocaleString()} tokens`)):w.push("Model context window is unavailable in the latest usage event."),w.join(`
58
- `)}const H=te(()=>{var w;const h=(w=v.value)==null?void 0:w.remainingContextPercent;return h===null||typeof h!="number"?"pending":h<=10?"danger":h<=25?"warning":"ok"}),ve=te(()=>{const h=v.value;return h?typeof h.remainingContextTokens=="number"?`${y(h.remainingContextTokens)} left`:`${y(h.currentContextTokens)} used`:"Awaiting data"}),Je=te(()=>{const h=v.value;return h?typeof h.modelContextWindow=="number"?`${y(h.currentContextTokens)} used / ${y(h.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),Et=te(()=>C(v.value)),$t=te(()=>{var me,Me;const h=[],w=new Set;for(const xe of fn.value.order){const dt=xe.trim();!dt||w.has(dt)||(w.add(dt),h.push({value:dt,label:fn.value.labels[dt]||Do(dt)}))}for(const xe of f.value){const dt=((Me=(me=xe.threads[0])==null?void 0:me.cwd)==null?void 0:Me.trim())??"";!dt||w.has(dt)||(w.add(dt),h.push({value:dt,label:d.value[xe.projectName]??xe.projectName}))}const I=Ke.value.trim();return I&&!w.has(I)&&h.unshift({value:I,label:Do(I)}),h}),kt=te(()=>jt.value.trim()),Kt=te(()=>{const h=Vn.value.trim();return!h||h==="."||h===".."?!1:!/[\\/]/u.test(h)}),Yr=te(()=>Kt.value&&kt.value.trim().length>0&&!St.value),io=te(()=>on.value?"Creating…":"Create"),Ha=te(()=>{const h=jt.value.trim(),w=zn.value.trim();return!!(h&&w&&h!==w)}),js=te(()=>{const h=[];Ha.value&&h.push({key:`parent:${zn.value}`,name:"..",path:zn.value,kind:"parent"});for(const w of Cn.value)h.push({key:`directory:${w.path}`,name:w.name,path:w.path,kind:"directory"});return h}),Qo=te(()=>{const h=An.value.trim().toLowerCase();return h?js.value.filter(w=>w.kind==="parent"||w.name.toLowerCase().includes(h)):js.value}),Jr=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,Wa=te(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]),Va=te(()=>i[sr.value].label),za=te(()=>{const h=i[sr.value];return{"--chat-column-max":h.columnMax,"--chat-card-max":h.cardMax}}),Ga=te(()=>{if(!En.value.configured)return"Not configured";const h=En.value.active?"Online":"Configured (offline)",w=`${En.value.mappedChats} chat(s), ${En.value.mappedThreads} thread(s)`,I=En.value.lastError?`, error: ${En.value.lastError}`:"";return`${h}, ${w}${I}`});So(()=>{window.addEventListener("keydown",l),document.addEventListener("visibilitychange",c),window.addEventListener("pageshow",p),window.addEventListener("focus",b),ra(),Jr==null||Jr.addEventListener("change",ra),gh(),Hf(),ss(),ln(),Zo(),en.value&&hi()}),Na(()=>{window.removeEventListener("keydown",l),document.removeEventListener("visibilitychange",c),window.removeEventListener("pageshow",p),window.removeEventListener("focus",b),Jr==null||Jr.removeEventListener("change",ra),Mt!==null&&(window.clearInterval(Mt),Mt=null),Sn&&(clearTimeout(Sn),Sn=null),Z()}),rt(hn,h=>{const w=h.trim();if(Sn&&(clearTimeout(Sn),Sn=null),!w){nn.value=null;return}Sn=setTimeout(()=>{Pb(w,1e3).then(I=>{hn.value.trim()===w&&(nn.value=I.threadIds)}).catch(()=>{hn.value.trim()===w&&(nn.value=null)})},220)}),rt(Gt,()=>{if(typeof window>"u")return;if(!Gt.value.some(w=>w.quotaStatus==="loading")){Mt!==null&&(window.clearInterval(Mt),Mt=null);return}Mt===null&&(Mt=window.setInterval(()=>{ir||(ir=!0,ko({silent:!0}).finally(()=>{ir=!1}))},1500))},{deep:!0});function Xo(){Re()}async function Zo(){try{En.value=await Ob()}catch(h){const w=h instanceof Error?h.message:"Failed to load Telegram status";En.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:w}}}function Ka(){_n.value=!_n.value,_n.value?Bt(()=>{var h;return(h=Yn.value)==null?void 0:h.focus()}):hn.value=""}function Ya(){var h;hn.value="",(h=Yn.value)==null||h.focus()}function Ja(h){h.key==="Escape"&&(_n.value=!1,hn.value="")}function Qa(h){h&&(he.name==="thread"&&In.value===h||(ke.push({name:"thread",params:{threadId:h}}),qe.value&&Gn(!0)))}async function Xa(h){h&&(M.value!==h&&(await _e(h),await ke.push({name:"thread",params:{threadId:h}})),await Bt(),Kf())}function Za(h){return h.length>8?h.slice(-8):h}function Fs(h){const w=[h.planType||"unknown"];return h.authMode&&w.unshift(h.authMode),w.join(" · ")}function lo(h){if(!h)return!1;const w=h.toLowerCase();return w.includes("payment required")||/\b402\b/.test(w)}function Fn(h){return h.unavailableReason==="payment_required"||lo(h.quotaError)}function Bs(h){return nt.value||pn.value||mn.value.length>0||h.isActive&&mn.value!==h.accountId&&B.value}function Qr(h){return Zt.value===h.accountId}function qs(h){return It.value===h.accountId||Qr(h)}function ei(h){return Fn(h)?"Unavailable":h.isActive?"Active":pn.value?"Switching…":"Switch"}function ti(h){return mn.value===h.accountId?"Removing…":Qr(h)?"Click again to remove":"Remove"}function ni(h){It.value=h}function Us(h){It.value===h&&(It.value=""),mn.value!==h&&Zt.value===h&&(Zt.value="")}function ri(h){const w=h.quotaSnapshot;if(!w)return null;const I=[w==null?void 0:w.primary,w==null?void 0:w.secondary].filter(xe=>xe!==null),me=I.find(xe=>xe.windowMinutes===10080);if(me)return me;const Me=I.filter(xe=>typeof xe.windowMinutes=="number"&&xe.windowMinutes>=10080).sort((xe,dt)=>(xe.windowMinutes??0)-(dt.windowMinutes??0))[0]??null;return Me||(w.secondary??null)}function oi(h){if(typeof h!="number"||!Number.isFinite(h))return"";const w=new Date(h*1e3);return`${w.getMonth()+1}月${w.getDate()}日`}function Hs(h){var xe,dt;if(Fn(h))return h.quotaError||"402 Payment Required";const w=h.quotaSnapshot,I=ri(h),me=(w==null?void 0:w.primary)??(w==null?void 0:w.secondary)??null,Me=I??me;if(Me){const Bn=Math.max(0,Math.min(100,100-Math.round(Me.usedPercent))),gr=oi(Me.resetsAt);return gr?`${Bn}% weekly remaining · ${gr}`:`${Bn}% weekly remaining`}return(xe=w==null?void 0:w.credits)!=null&&xe.unlimited?"Unlimited credits":(dt=w==null?void 0:w.credits)!=null&&dt.hasCredits&&w.credits.balance?`${w.credits.balance} credits`:h.quotaStatus==="loading"?"Loading quota…":h.quotaStatus==="error"?h.quotaError||"Quota unavailable":h.quotaStatus==="ready"||h.quotaStatus==="idle"?"Quota unavailable":"Fetching account details…"}function Ws(h){return[h.email||"Account",Fs(h),Fn(h)?"Unavailable account":null,Hs(h),`Workspace ${h.accountId}`].filter(Boolean).join(`
59
- `)}async function ko(h={}){try{const w=await fb();Gt.value=w.accounts,w.accounts.some(I=>I.accountId===It.value)||(It.value=""),w.accounts.some(I=>I.accountId===Zt.value)||(Zt.value="")}catch(w){if(h.silent===!0)return;et.value=w instanceof Error?w.message:"Failed to load accounts"}}async function Co(){if(!(nt.value||pn.value)){et.value="",It.value="",Zt.value="",nt.value=!0;try{const h=await hb();Gt.value=h.accounts,Z(),se(),Se({includeSelectedThreadMessages:!0})}catch(h){et.value=h instanceof Error?h.message:"Failed to refresh accounts"}finally{nt.value=!1}}}async function Vs(h){if(!(pn.value||nt.value)){if(B.value){et.value="Finish the current turn and pending requests before switching accounts.";return}et.value="",It.value="",Zt.value="",pn.value=!0;try{const w=await pb(h);Gt.value=Gt.value.map(I=>I.accountId===h?w:{...I,isActive:!1}),Z(),se(),Se({includeSelectedThreadMessages:!0}),ko({silent:!0})}catch(w){et.value=w instanceof Error?w.message:"Failed to switch account"}finally{pn.value=!1}}}async function si(h){if(nt.value||pn.value||mn.value.length>0)return;const w=Gt.value.find(me=>me.accountId===h)??null;if(!w)return;if(Zt.value!==h){Zt.value=h;return}if(w.isActive&&B.value){et.value="Finish the current turn and pending requests before removing the active account.";return}const I=w.isActive;et.value="",Zt.value="",mn.value=h;try{const me=await mb(h);Gt.value=me.accounts,Z(),se(),I&&Se({includeSelectedThreadMessages:!0}),ko({silent:!0})}catch(me){et.value=me instanceof Error?me.message:"Failed to remove account"}finally{mn.value=""}}function ai(h){ee(h)}async function ii(h){const w=await oe(h);w&&(Ft.value?await ke.replace({name:"thread",params:{threadId:w}}):await ke.push({name:"thread",params:{threadId:w}}),qe.value&&Gn(!0))}function zs(h){const w=h.trim().replace(/\\/gu,"/");return w?w.includes("/.codex/worktrees/")||w.includes("/.git/worktrees/"):!1}function es(h,w=""){var xe,dt,Bn;const I=f.value.find(gr=>gr.projectName===h);if(!I)return w.trim();const me=I.threads.find(gr=>!zs(gr.cwd));return(((xe=me==null?void 0:me.cwd)==null?void 0:xe.trim())??((Bn=(dt=I.threads[0])==null?void 0:dt.cwd)==null?void 0:Bn.trim())??"")||w.trim()}function li(h){var me,Me;const w=f.value.find(xe=>xe.projectName===h),I=es(h,((Me=(me=w==null?void 0:w.threads[0])==null?void 0:me.cwd)==null?void 0:Me.trim())??"");I&&(Ke.value=I),qe.value&&Gn(!0),!Ft.value&&ke.push({name:"home"})}function ts(h){var I;let w="";for(const me of f.value){const Me=me.threads.find(xe=>xe.id===h);if((I=Me==null?void 0:Me.cwd)!=null&&I.trim()){w=Me.cwd.trim();break}}!w||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(w)}`,"_blank","noopener,noreferrer")}function tr(){var I;const h=m.value,w=h?es(h.projectName,((I=h.cwd)==null?void 0:I.trim())??""):"";w&&(Ke.value=w),qe.value&&Gn(!0),!Ft.value&&ke.push({name:"home"})}function ui(h){Q(h.projectName,h.displayName)}function ci(h){pe(h.threadId,h.title)}async function Gs(h){await K(h),await ss(),ln()}function Ks(h){ne(h.projectName,h.toIndex)}function di(h){Ve(h.threadId,h.state)}function Ys(h){Js(h)}async function Js(h){var me;const w=await G(h),I=((me=h.followUpMessageText)==null?void 0:me.trim())??"";if(!(!w||!I||Ft.value))try{await Ie(I,[],[],"steer",[])}catch{}}async function fi(h){const w=await Ae(h.threadId,h.turnIndex);w&&(await ke.push({name:"thread",params:{threadId:w}}),M.value!==w&&await _e(w),qe.value&&Gn(!0))}function Gn(h){Rt.value!==h&&(Rt.value=h,fh(h))}function l(h){h.defaultPrevented||!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),Gn(!Rt.value))}function c(){if(!(typeof document>"u")&&qe.value){if(document.visibilityState==="hidden"){ar.value=Date.now(),Pe.value=!1;return}O()}}function p(h){h.persisted&&O()}function b(){he.name==="home"&&(ss(),ln()),O()}function O(){typeof window>"u"||typeof document>"u"||!qe.value||document.visibilityState!=="visible"||Pe.value||ar.value===null||Date.now()-ar.value<ck||(Pe.value=!0,ar.value=null,F())}async function F(){if(!Te.value){Te.value=!0;try{await Se({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await gi()}finally{Te.value=!1}}}function D(h){const w=h.text;Ct();const I=bt.value,me=h.mode==="queue"&&I&&I.threadId===M.value?I.queueIndex:void 0;if(bt.value=null,Ft.value){vh(w,h.imageUrls,h.skills,h.fileAttachments);return}Ie(w,h.imageUrls,h.skills,h.mode,h.fileAttachments,me)}function U(h){const w=new Intl.NumberFormat().format(h.stars);return h.language?`${h.language} · ★ ${w}`:`★ ${w}`}function re(h){const I=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(h)?h:"trending-daily";ut.value!==I&&(ut.value=I)}function Ue(){if(typeof window>"u")return;const h=window.prompt("Telegram bot token");!h||!h.trim()||$b(h.trim()).then(()=>{window.alert("Telegram bot configured. Open the bot DM and send /start."),Zo()}).catch(w=>{const I=w instanceof Error?w.message:"Failed to connect Telegram bot";window.alert(I),Zo()})}function Xe(h){const w=Qe.value;w&&w.hydrateDraft({text:`Clone this GitHub project and run it: ${h.url}
60
- Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function st(h){const w=ue.value.findIndex(xe=>xe.id===h),I=w>=0?ue.value[w]:void 0,me=Ze.value;if(!I||!me||me.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;bt.value=M.value?{threadId:M.value,queueIndex:w}:null;const Me={text:I.text,imageUrls:[...I.imageUrls],fileAttachments:I.fileAttachments.map(xe=>({...xe})),skills:I.skills.map(xe=>({...xe}))};me.hydrateDraft(Me),J(h)}function Ct(){if(!qe.value||Ft.value)return;const h=()=>{var w;(w=wt.value)==null||w.jumpToLatest()};h(),Bt(()=>{h(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{h(),window.requestAnimationFrame(h)})})}function Ir(h){Ke.value=h.trim(),Vt.value=""}async function Qs(){const w=await He()||Nt.value.trim()||"/",I=new URLSearchParams,me=Un.value.trim();me&&I.set("newProjectName",me);const Me=I.toString();window.location.assign(`/codex-local-browse${encodeURI(w)}${Me?`?${Me}`:""}`)}async function Xl(){const h=Ke.value.trim()||await He();h&&(kn.value=!1,gn.value=!0,An.value="",await Eo(h))}function Ao(){Qn+=1,gn.value=!1,sn.value=!1,St.value="",An.value="",Xr()}async function ns(h){!h||sn.value||(An.value="",await Eo(h))}function Xs(){const h=jt.value.trim();!gn.value||!h||Eo(h)}function Zs(){const h=jt.value.trim();!gn.value||!h||sn.value||Eo(h)}async function rs(h=jt.value){const w=h.trim();if(w){St.value="",jn.value=!0;try{const I=await Pc(w,{createIfMissing:!1,label:""});if(!I){St.value="Failed to open the selected folder.";return}Ke.value=I,fe(Do(I)),await ss(),await ln(),Ao()}catch(I){St.value=I instanceof Error?I.message:"Failed to open the selected folder."}finally{jn.value=!1}}}async function ea(){if(Vt.value="",kn.value){Xr();return}if(!gn.value){const h=Ke.value.trim()||await He();if(!h||(gn.value=!0,An.value="",await Eo(h),St.value))return}St.value||(Vn.value=Un.value,kn.value=!0,Bt(()=>{var h;return(h=Vr.value)==null?void 0:h.focus()}))}function Xr(){Vt.value="",Vn.value="",kn.value=!1}async function os(){const h=Vn.value.trim();if(!h)return;if(Vt.value="",St.value){Vt.value="Reload the current folder before creating a new one.";return}on.value=!0;const w=kt.value.trim(),I=Vf(Wf(w,h));if(!I){Vt.value="Unable to determine where the new folder should be created.",on.value=!1;return}if(!Kt.value){Vt.value="Enter a single folder name.",on.value=!1;return}try{const me=await Ib(I);if(!me){Vt.value="Failed to create the folder.";return}Vt.value="",An.value="",await Eo(me),Xr()}catch(me){Vt.value=me instanceof Error?me.message:"Failed to create folder."}finally{on.value=!1}}async function ta(){var w;if(typeof window>"u")return!1;const h=((w=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:w.trim())??"";if(!h)return!1;try{const I=await Pc(h,{createIfMissing:!1,label:""});if(!I)return!1;Ke.value=I,fe(Do(I)),await ke.replace({name:"home"}),await ss();const me=new URL(window.location.href);return me.searchParams.delete("openProjectPath"),window.history.replaceState({},"",me.toString()),!0}catch{return!1}}async function He(){const h=mr();if(h)return h;try{const w=await Mc();if(w)return Nt.value=w,w}catch{}return""}async function ln(){const h=mr();if(!h){Un.value="New Project (1)";return}try{const w=await Mb(h);Un.value=w.name||"New Project (1)"}catch{Un.value="New Project (1)"}}function mr(){var I,me;const h=Ke.value.trim();if(h)return Ni(h);const w=((me=(I=$t.value[0])==null?void 0:I.value)==null?void 0:me.trim())??"";return w?Ni(w):Nt.value.trim()}async function Hf(){try{Nt.value=await Mc()}catch{Nt.value=""}}async function ss(){try{const h=await hs();fn.value={order:[...h.order],labels:{...h.labels}}}catch{fn.value={order:[],labels:{}}}}async function Eo(h){const w=++Qn;jt.value=qt(h).trim(),St.value="",sn.value=!0;try{const I=await Eb(h,{showHidden:Er.value});if(w!==Qn)return;jt.value=I.path,zn.value=I.parentPath,Cn.value=I.entries}catch(I){if(w!==Qn)return;St.value=I instanceof Error?I.message:"Failed to load local folders.",zn.value=Ni(jt.value),Cn.value=[],Xr()}finally{w===Qn&&(sn.value=!1)}}async function hi(){lt.value=!0;try{yt.value=await Lb(ut.value,6)}catch{yt.value=[]}finally{lt.value=!1}}function Wf(h,w){const I=qt(h).trim(),me=qt(w).trim().replace(/^[\\/]+/u,"");if(!I||!me)return"";const Me=I.includes("\\")&&!I.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(I))return`${I.slice(0,2)}${Me}${me}`;if(/^\/+$/u.test(I))return`/${me}`;const xe=I.replace(/[\\/]+$/u,"");return xe?`${xe}${Me}${me}`:""}function Vf(h){const w=qt(h).trim();if(!w)return"";const I=w.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(I){const[,Me,xe,dt=""]=I,Bn=pi(dt.split(/[\\/]+/u));return Bn.length>0?`\\\\${Me}\\${xe}\\${Bn.join("\\")}`:`\\\\${Me}\\${xe}`}const me=w.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(me){const[,Me,xe=""]=me,dt=w.includes("\\")&&!w.includes("/")?"\\":"/",Bn=pi(xe.split(/[\\/]+/u));return Bn.length>0?`${Me}${dt}${Bn.join(dt)}`:`${Me}${dt}`}if(w.startsWith("/")){const Me=pi(w.split("/"));return Me.length>0?`/${Me.join("/")}`:"/"}return w}function pi(h){const w=[];for(const I of h){const me=I.trim();if(!(!me||me===".")){if(me===".."){w.length>0&&w.pop();continue}w.push(me)}}return w}function Zl(h){_(h)}function eu(h){x(h)}function tu(h){$(h)}function zf(){z()}function Gf(h){we(h.turnId)}function Kf(){if(Ft.value||wn.value||typeof document>"u"||!m.value||Xn.value.length===0)return;const h=Yf(),w=Jf(),I=new Blob([h],{type:"text/markdown;charset=utf-8"}),me=URL.createObjectURL(I),Me=document.createElement("a");Me.href=me,Me.download=w,document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),window.setTimeout(()=>URL.revokeObjectURL(me),0)}function Yf(){var I,me,Me;const h=[],w=((me=(I=m.value)==null?void 0:I.title)==null?void 0:me.trim())||"Untitled thread";h.push(`# ${Qf(w)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((Me=m.value)==null?void 0:Me.id)??""}`),h.push(""),h.push("---"),h.push("");for(const xe of Xn.value){const dt=xe.role?xe.role.toUpperCase():"MESSAGE";h.push(`## ${dt}`),h.push("");const Bn=xe.text.trim();if(Bn&&(h.push(Bn),h.push("")),xe.commandExecution&&(h.push("```text"),h.push(`command: ${xe.commandExecution.command}`),h.push(`status: ${xe.commandExecution.status}`),xe.commandExecution.cwd&&h.push(`cwd: ${xe.commandExecution.cwd}`),xe.commandExecution.exitCode!==null&&h.push(`exitCode: ${xe.commandExecution.exitCode}`),h.push(xe.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),xe.fileAttachments&&xe.fileAttachments.length>0){h.push("Attachments:");for(const gr of xe.fileAttachments)h.push(`- ${gr.path}`);h.push("")}if(xe.images&&xe.images.length>0){h.push("Images:");for(const gr of xe.images)h.push(`- ${gr}`);h.push("")}}return`${h.join(`
61
- `).trimEnd()}
62
- `}function Jf(){var Me,xe;const I=(((xe=(Me=m.value)==null?void 0:Me.title)==null?void 0:xe.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",me=new Date().toISOString().replace(/[:.]/g,"-");return`${I}-${me}.md`}function Qf(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function na(h,w){if(typeof window>"u")return w;const I=window.localStorage.getItem(h);return I===null?w:I==="1"}function Xf(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(zc);return h==="light"||h==="dark"?h:"system"}function Zf(){return typeof window>"u"?"steer":window.localStorage.getItem(Vc)==="queue"?"queue":"steer"}function eh(){if(typeof window>"u")return"standard";const h=window.localStorage.getItem(Qc);return h==="standard"||h==="wide"||h==="extra-wide"?h:"standard"}function th(){Wn.value=!Wn.value,window.localStorage.setItem(Wc,Wn.value?"1":"0")}function nh(){ot.value=ot.value==="steer"?"queue":"steer",window.localStorage.setItem(Vc,ot.value)}function rh(){const h=["system","light","dark"],w=h.indexOf(ct.value);ct.value=h[(w+1)%h.length],window.localStorage.setItem(zc,ct.value),ra()}function oh(){const h=["standard","wide","extra-wide"],w=h.indexOf(sr.value);sr.value=h[(w+1)%h.length],window.localStorage.setItem(Qc,sr.value)}function sh(){rn.value=!rn.value,window.localStorage.setItem(Gc,rn.value?"1":"0")}function ah(){xn.value=!xn.value,window.localStorage.setItem(Kc,xn.value?"1":"0")}function ih(){en.value=!en.value,window.localStorage.setItem(Jc,en.value?"1":"0")}function lh(h){const I=mi(h.trim())||"auto";Ln.value=I,window.localStorage.setItem(Yc,I)}function uh(){var I;if(typeof window>"u")return"auto";const h=((I=window.localStorage.getItem(Yc))==null?void 0:I.trim())||"auto";return mi(h)||"auto"}function ch(){const h=[{value:"auto",label:"Auto-detect"}],w=new Set(["auto"]);function I(Me){const xe=u[Me]||Me;return`${xe.charAt(0).toUpperCase()+xe.slice(1)} (${Me})`}for(const Me of typeof navigator<"u"?navigator.languages??[]:[]){const xe=mi(Me);!xe||w.has(xe)||(w.add(xe),h.push({value:xe,label:`Preferred: ${I(xe)}`}))}for(const Me of Object.keys(u))w.has(Me)||(w.add(Me),h.push({value:Me,label:I(Me)}));const me=Ln.value.trim();return me&&!w.has(me)&&h.push({value:me,label:I(me)}),h}function mi(h){const w=h.trim().toLowerCase();if(!w||w==="auto")return"";if(w in u)return w;const I=w.split("-")[0]??w;return I in u?I:""}function ra(){const h=document.documentElement;if(ct.value==="dark")h.classList.add("dark");else if(ct.value==="light")h.classList.remove("dark");else{const w=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",w)}}function dh(){return typeof window>"u"?!1:window.localStorage.getItem(Uc)==="1"}function fh(h){typeof window>"u"||window.localStorage.setItem(Uc,h?"1":"0")}function hh(){if(typeof window>"u")return!0;const h=window.localStorage.getItem(Hc);return h===null?!0:h==="1"}function ph(){Hn.value=!Hn.value,!(typeof window>"u")&&window.localStorage.setItem(Hc,Hn.value?"1":"0")}function mh(h,w){const I=(h??"").trim();return I.length>0?I:w.trim()||"message"}function nu(h){ze(h)}async function gh(){await ke.isReady(),he.name==="thread"&&In.value&&Oe(In.value),se(),await Se({includeSelectedThreadMessages:!0}),ko({silent:!0}),await ta(),Tt.value=!0,await gi()}async function gi(){if(!zt.value){zt.value=!0;try{if(he.name==="home"||he.name==="skills"){M.value!==""&&await _e("");return}if(he.name==="thread"){const h=In.value;if(!h)return;if(!vn.value.has(h)){await ke.replace({name:"home"});return}M.value!==h?await _e(h):Fe(h,{silent:!0});return}}finally{zt.value=!1}}}rt(()=>[he.name,In.value,de.value,vn.value.has(In.value),M.value],async()=>{Tt.value&&await gi()}),rt(()=>M.value,async h=>{if(Tt.value&&!zt.value&&!(Ft.value||wn.value)){if(!h){he.name!=="home"&&await ke.replace({name:"home"});return}he.name==="thread"&&In.value===h||await ke.replace({name:"thread",params:{threadId:h}})}}),rt(()=>ut.value,()=>{en.value&&hi()}),rt(()=>en.value,h=>{if(!h){yt.value=[];return}hi()}),rt(()=>[Tt.value,he.name,M.value],([h,w,I])=>{h&&w==="thread"&&I&&Fe(I,{silent:!0})}),rt(()=>$t.value,h=>{if(h.length===0){Ke.value="";return}h.some(I=>I.value===Ke.value)||(Ke.value=h[0].value),ln()},{immediate:!0}),rt(()=>Ke.value,()=>{Lt.value={phase:"idle",title:"",message:""},ln()}),rt(()=>Wt.value,h=>{var w;if(h==="local"){Lt.value={phase:"idle",title:"",message:""};const I=Ke.value.trim();if(I&&zs(I)){const me=((w=m.value)==null?void 0:w.projectName)??Do(I),Me=es(me,"");Me&&(Ke.value=Me)}}}),rt(()=>he.name,h=>{h!=="home"&&(Lt.value={phase:"idle",title:"",message:""}),h!=="thread"&&(Jn.value=!1)}),rt(()=>M.value,()=>{Lt.value={phase:"idle",title:"",message:""}}),rt(Gr,h=>{typeof document>"u"||(document.title=h)},{immediate:!0}),rt(qe,h=>{h&&!Rt.value&&Gn(!0)});async function vh(h,w=[],I=[],me=[]){try{Lt.value={phase:"idle",title:"",message:""};let Me=Ke.value;if(Wt.value==="worktree"){Lt.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const dt=await Ab(Ke.value);Me=dt.cwd,Ke.value=dt.cwd,Lt.value={phase:"idle",title:"",message:""}}catch{Lt.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const xe=await je(h,Me,w,I,me);if(!xe)return;await ke.replace({name:"thread",params:{threadId:xe}}),Ct()}catch{}}return(h,w)=>(A(),it(fv,{"is-sidebar-collapsed":Rt.value,onCloseSidebar:w[12]||(w[12]=I=>Gn(!0))},{sidebar:pt(()=>[g("section",RS,[g("div",PS,[Rt.value?ge("",!0):(A(),it(Dc,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Rt.value,"show-new-thread-button":!0,onToggleSidebar:w[0]||(w[0]=I=>Gn(!Rt.value)),onStartNewThread:tr},{default:pt(()=>[g("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":_n.value,"aria-label":"Search threads",title:"Search threads",onClick:Ka},[Ne(Lc,{class:"sidebar-search-toggle-icon"})],8,$S)]),_:1},8,["is-sidebar-collapsed"])),!Rt.value&&_n.value?(A(),P("div",OS,[Ne(Lc,{class:"sidebar-search-bar-icon"}),lr(g("input",{ref_key:"sidebarSearchInputRef",ref:Yn,"onUpdate:modelValue":w[1]||(w[1]=I=>hn.value=I),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ja},null,544),[[Cr,hn.value]]),hn.value.length>0?(A(),P("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Ya},[Ne(Y_,{class:"sidebar-search-clear-icon"})])):ge("",!0)])):ge("",!0),Rt.value?ge("",!0):(A(),P("button",{key:2,class:tt(["sidebar-skills-link",{"is-active":wn.value}]),type:"button",onClick:w[2]||(w[2]=I=>{$e(ke).push({name:"skills"}),$e(qe)&&Gn(!0)})}," Skills Hub ",2)),Rt.value?ge("",!0):(A(),it(ry,{key:3,groups:$e(f),"project-display-name-by-id":$e(d),"selected-thread-id":$e(M),"is-loading":$e(de),"search-query":hn.value,"search-matched-thread-ids":nn.value,onSelect:Qa,onArchive:ai,onStartNewThread:li,onRenameProject:ui,onBrowseThreadFiles:ts,onRenameThread:ci,onForkThread:ii,onRemoveProject:Gs,onReorderProject:Ks,onExportThread:Xa},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),Rt.value?ge("",!0):(A(),P("div",DS,[Ne(df,{name:"settings-panel"},{default:pt(()=>[Ar.value?(A(),P("div",LS,[g("div",NS,[g("div",jS,[g("div",FS,[g("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!Hn.value,title:Hn.value?"Expand accounts":"Collapse accounts",onClick:ph},[g("span",qS,ce(Hn.value?"▸":"▾"),1)],8,BS),w[13]||(w[13]=g("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),g("span",US,ce(Gt.value.length),1)]),g("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:nt.value||pn.value,onClick:Co},ce(nt.value?"Reloading…":"Reload"),9,HS)]),Hn.value?ge("",!0):(A(),P(We,{key:0},[et.value?(A(),P("p",WS,ce(et.value),1)):ge("",!0),Gt.value.length===0?(A(),P("p",VS," Run `codex login`, then click reload. ")):(A(),P("div",zS,[(A(!0),P(We,null,Dt(Gt.value,I=>(A(),P("article",{key:I.accountId,class:tt(["sidebar-settings-account-item",{"is-active":I.isActive,"is-unavailable":Fn(I),"is-confirming-remove":Qr(I),"is-remove-visible":qs(I)}]),title:Ws(I),onMouseenter:me=>ni(I.accountId),onMouseleave:me=>Us(I.accountId)},[g("div",KS,[g("p",YS,ce(I.email||"Account"),1),g("p",JS,ce(Fs(I)),1),g("p",QS,ce(Hs(I)),1),g("p",XS," Workspace "+ce(Za(I.accountId)),1)]),g("div",ZS,[g("button",{class:"sidebar-settings-account-switch",type:"button",disabled:Bs(I)||I.isActive||Fn(I),onClick:me=>Vs(I.accountId)},ce(ei(I)),9,ex),g("button",{class:tt(["sidebar-settings-account-remove",{"is-visible":qs(I),"is-confirming":Qr(I)}]),type:"button",disabled:Bs(I),onClick:me=>si(I.accountId)},ce(ti(I)),11,tx)])],42,GS))),128))]))],64))]),g("button",{class:"sidebar-settings-row",type:"button",title:a.sendWithEnter,onClick:th},[w[14]||(w[14]=g("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),g("span",{class:tt(["sidebar-settings-toggle",{"is-on":!Wn.value}])},null,2)],8,nx),g("button",{class:"sidebar-settings-row",type:"button",title:a.inProgressSendMode,onClick:nh},[w[15]||(w[15]=g("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),g("span",ox,ce(ot.value==="steer"?"Steer":"Queue"),1)],8,rx),g("button",{class:"sidebar-settings-row",type:"button",title:a.appearance,onClick:rh},[w[16]||(w[16]=g("span",{class:"sidebar-settings-label"},"Appearance",-1)),g("span",ax,ce(ct.value==="system"?"System":ct.value==="dark"?"Dark":"Light"),1)],8,sx),g("button",{class:"sidebar-settings-row",type:"button",title:a.chatWidth,onClick:oh},[w[17]||(w[17]=g("span",{class:"sidebar-settings-label"},"Chat width",-1)),g("span",lx,ce(Va.value),1)],8,ix),g("button",{class:"sidebar-settings-row",type:"button",title:a.dictationClickToToggle,onClick:sh},[w[18]||(w[18]=g("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),g("span",{class:tt(["sidebar-settings-toggle",{"is-on":rn.value}])},null,2)],8,ux),g("button",{class:"sidebar-settings-row",type:"button",title:a.dictationAutoSend,onClick:ah},[w[19]||(w[19]=g("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),g("span",{class:tt(["sidebar-settings-toggle",{"is-on":xn.value}])},null,2)],8,cx),g("button",{class:"sidebar-settings-row",type:"button",title:a.githubTrendingProjects,onClick:ih},[w[20]||(w[20]=g("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),g("span",{class:tt(["sidebar-settings-toggle",{"is-on":en.value}])},null,2)],8,dx),g("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:a.dictationLanguage},[w[21]||(w[21]=g("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Ne(Ts,{class:"sidebar-settings-language-dropdown","model-value":Ln.value,options:Nn.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":lh},null,8,["model-value","options"])],8,fx),g("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:Ue},[w[22]||(w[22]=g("span",{class:"sidebar-settings-label"},"Telegram",-1)),g("span",hx,ce(Ga.value),1)]),E.value?(A(),P("div",{key:0,class:"sidebar-settings-row sidebar-settings-context-row","data-state":H.value,title:Et.value},[w[23]||(w[23]=g("span",{class:"sidebar-settings-label"},"Context",-1)),g("span",{class:"sidebar-settings-context-value","data-state":H.value},[Ho(ce(ve.value)+" ",1),g("span",gx,ce(Je.value),1)],8,mx)],8,px)):ge("",!0),g("div",vx,[Ne(__,{snapshots:$e(ye)},null,8,["snapshots"])]),g("div",wx," WT "+ce($e(o))+" · v"+ce($e(s)),1)])):ge("",!0)]),_:1}),g("button",{class:"sidebar-settings-button",type:"button",onClick:w[3]||(w[3]=I=>Ar.value=!Ar.value)},[Ne(V_,{class:"sidebar-settings-icon"}),w[24]||(w[24]=g("span",null,"Settings",-1)),g("span",yx,ce($e(o))+" · v"+ce($e(s)),1)])]))])]),content:pt(()=>[g("section",{class:"content-root",style:Nr(za.value)},[Ne(uy,{title:zr.value},{leading:pt(()=>[Rt.value||$e(qe)?(A(),it(Dc,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Rt.value,"show-new-thread-button":!0,onToggleSidebar:w[4]||(w[4]=I=>Gn(!Rt.value)),onStartNewThread:tr},null,8,["is-sidebar-collapsed"])):ge("",!0)]),actions:pt(()=>[$e(he).name==="thread"&&$e(M)?(A(),P("button",{key:0,type:"button",class:"content-header-review-button","data-active":Jn.value,onClick:w[5]||(w[5]=I=>Jn.value=!Jn.value)}," Review ",8,bx)):ge("",!0)]),_:1},8,["title"]),g("section",Tx,[wn.value?(A(),it($e(r),{key:0,onSkillsChanged:Xo})):Ft.value?(A(),P("div",_x,[g("div",Sx,[w[30]||(w[30]=g("p",{class:"new-thread-hero"},"Let's build",-1)),Ne(Ts,{class:"new-thread-folder-dropdown","model-value":Ke.value,options:$t.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-mode":"event","add-action-label":"+ Add new project",disabled:!1,"onUpdate:modelValue":Ir,onAddAction:Qs},null,8,["model-value","options"]),Ke.value?(A(),P("p",{key:0,class:"new-thread-folder-selected",title:Ke.value}," Selected folder: "+ce(Ke.value),9,xx)):ge("",!0),g("div",{class:"new-thread-folder-actions"},[g("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Xl}," Select folder ")]),gn.value?(A(),P("div",kx,[g("div",{class:"new-thread-open-folder-header"},[w[25]||(w[25]=g("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),g("button",{class:"new-thread-open-folder-close",type:"button",onClick:Ao}," Cancel ")]),w[27]||(w[27]=g("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),g("div",Cx,[g("p",{class:"new-thread-open-folder-path",title:jt.value||"Unavailable"},ce(jt.value||"Unavailable"),9,Ax),g("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!jt.value||!!St.value||sn.value||jn.value,onClick:w[6]||(w[6]=I=>rs())},ce(jn.value?"Opening…":"Open"),9,Ex)]),g("div",Ix,[g("label",Mx,[lr(g("input",{"onUpdate:modelValue":w[7]||(w[7]=I=>Er.value=I),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:Xs},null,544),[[qm,Er.value]]),w[26]||(w[26]=g("span",null,"Show hidden folders",-1))]),g("button",{class:tt(["new-thread-folder-action",{"new-thread-folder-action-primary":kn.value}]),type:"button","aria-pressed":kn.value,disabled:!jt.value||sn.value||jn.value||on.value||!!St.value&&!kn.value,onClick:ea}," New folder ",10,Rx)]),kn.value?(A(),P("div",Px,[g("div",$x,[lr(g("input",{ref_key:"createFolderInputRef",ref:Vr,"onUpdate:modelValue":w[8]||(w[8]=I=>Vn.value=I),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[tn(at(os,["prevent"]),["enter"]),tn(at(Xr,["prevent"]),["esc"])]},null,40,Ox),[[Cr,Vn.value]]),g("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!Yr.value||on.value,onClick:os},ce(io.value),9,Dx)]),Vt.value?(A(),P("p",Lx,ce(Vt.value),1)):ge("",!0)])):ge("",!0),lr(g("input",{"onUpdate:modelValue":w[9]||(w[9]=I=>An.value=I),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders..."},null,512),[[Cr,An.value]]),St.value?(A(),P("div",Nx,[g("p",jx,ce(St.value),1),g("button",{class:"new-thread-folder-action",type:"button",disabled:sn.value||jn.value,onClick:Zs}," Retry ",8,Fx)])):ge("",!0),sn.value?(A(),P("p",Bx,"Loading folders…")):!St.value&&Qo.value.length===0?(A(),P("p",qx,ce(An.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Qo.value.length>0?(A(),P("ul",Ux,[(A(!0),P(We,null,Dt(Qo.value,I=>(A(),P("li",{key:I.key,class:"new-thread-open-folder-item"},[g("button",{class:"new-thread-open-folder-item-main",type:"button",title:I.path,disabled:sn.value||jn.value,onClick:me=>ns(I.path)},[g("span",Wx,ce(I.name),1)],8,Hx),I.kind==="directory"?(A(),P("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:sn.value||jn.value,onClick:me=>rs(I.path)}," Open ",8,Vx)):ge("",!0)]))),128))])):ge("",!0)])):ge("",!0),Ne(A_,{class:"new-thread-runtime-dropdown",modelValue:Wt.value,"onUpdate:modelValue":w[10]||(w[10]=I=>Wt.value=I)},null,8,["modelValue"]),w[31]||(w[31]=g("p",{class:"new-thread-runtime-help"},[g("code",null,"Local project"),Ho(" uses the selected folder directly. "),g("code",null,"New worktree"),Ho(" creates an isolated Git worktree before the first prompt. ")],-1)),Lt.value.phase!=="idle"?(A(),P("div",{key:2,class:tt(["worktree-init-status",{"is-running":Lt.value.phase==="running","is-error":Lt.value.phase==="error"}])},[g("strong",zx,ce(Lt.value.title),1),g("span",Gx,ce(Lt.value.message),1)],2)):ge("",!0),en.value?(A(),P("div",Kx,[g("div",Yx,[w[28]||(w[28]=g("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),Ne(Ts,{class:"new-thread-trending-scope-dropdown","model-value":ut.value,options:Wa.value,"onUpdate:modelValue":re},null,8,["model-value","options"])]),lt.value?(A(),P("p",Jx,"Loading trending projects...")):yt.value.length===0?(A(),P("p",Qx," Trending repos are unavailable right now. ")):(A(),P("div",Xx,[(A(!0),P(We,null,Dt(yt.value,I=>(A(),P("button",{key:I.id,type:"button",class:"new-thread-trending-tip",onClick:me=>Xe(I)},[g("span",{class:"new-thread-trending-tip-name",title:I.fullName},[I.owner&&I.repo?(A(),P(We,{key:0},[g("span",tk,ce(I.owner),1),w[29]||(w[29]=g("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),g("span",nk,ce(I.repo),1)],64)):(A(),P("span",rk,ce(I.fullName),1))],8,ek),g("span",ok,ce(U(I)),1),g("span",sk,ce(I.description||"No description available."),1)],8,Zx))),128))]))])):ge("",!0)]),g("div",ak,[Ne(Oc,{ref_key:"homeThreadComposerRef",ref:Qe,"active-thread-id":er.value,cwd:T.value,"collaboration-modes":$e(L),"selected-collaboration-mode":$e(W),models:$e(q),"selected-model":$e(ae),"selected-reasoning-effort":$e(Y),"selected-speed-mode":$e(le),"is-updating-speed-mode":$e(Ce),skills:$e(De),"thread-token-usage":$e(v),"codex-quota":$e(X),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Wn.value,"in-progress-submit-mode":ot.value,"dictation-click-to-toggle":rn.value,"dictation-auto-send":xn.value,"dictation-language":Ln.value,onSubmit:D,"onUpdate:selectedCollaborationMode":nu,"onUpdate:selectedModel":Zl,"onUpdate:selectedReasoningEffort":eu,"onUpdate:selectedSpeedMode":tu},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(A(),P("div",ik,[Jn.value&&$e(M)&&T.value?(A(),it($e(n),{key:0,"thread-id":$e(M),cwd:T.value,"is-thread-in-progress":k.value,onClose:w[11]||(w[11]=I=>Jn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(A(),P(We,{key:1},[g("div",lk,[Ne($e(t),{ref_key:"threadConversationRef",ref:wt,messages:Xn.value,"is-loading":$e(V),"active-thread-id":er.value,cwd:T.value,"scroll-state":$e(S),"live-overlay":Zn.value,"pending-requests":$e(j),onUpdateScrollState:di,onForkThread:fi,onRollback:Gf,onRespondServerRequest:Ys},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),g("div",uk,[Ne(h_,{messages:$e(ue),onEdit:st,onSteer:$e(Ee),onDelete:$e(J)},null,8,["messages","onSteer","onDelete"]),Kr.value?(A(),it(o_,{key:0,request:Kr.value,"request-count":$e(j).length,"has-queue-above":$e(ue).length>0,onRespondServerRequest:Ys},null,8,["request","request-count","has-queue-above"])):(A(),it(Oc,{key:1,ref_key:"threadComposerRef",ref:Ze,"active-thread-id":er.value,cwd:T.value,"collaboration-modes":$e(L),"selected-collaboration-mode":$e(W),models:$e(q),"selected-model":$e(ae),"selected-reasoning-effort":$e(Y),"selected-speed-mode":$e(le),"is-updating-speed-mode":$e(Ce),skills:$e(De),"thread-token-usage":$e(v),"codex-quota":$e(X),"is-turn-in-progress":k.value,"is-interrupting-turn":$e(Le),"has-queue-above":$e(ue).length>0,"send-with-enter":Wn.value,"in-progress-submit-mode":ot.value,"dictation-click-to-toggle":rn.value,"dictation-auto-send":xn.value,"dictation-language":Ln.value,"onUpdate:selectedCollaborationMode":nu,onSubmit:D,"onUpdate:selectedModel":Zl,"onUpdate:selectedReasoningEffort":eu,"onUpdate:selectedSpeedMode":tu,onInterrupt:zf},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"]))])],64))]))])],4)]),_:1},8,["is-sidebar-collapsed"]))}}),fk=ht(dk,[["__scopeId","data-v-2054f99a"]]),Ji={render:()=>null},hk=ov({history:Lg(),routes:[{path:"/",name:"home",component:Ji},{path:"/thread/:threadId",name:"thread",component:Ji},{path:"/skills",name:"skills",component:Ji},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. npm: https://www.npmjs.com/package/@nervmor/codexui");Gm(fk).use(hk).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{ub as A,lr as B,pk as C,gk as D,wk as E,We as F,yk as G,mk as H,wa as I,vk as J,Gl as K,ma as L,yv as M,Lc as N,Cr as O,tn as P,df as T,ht as _,g as a,So as b,P as c,dn as d,xo as e,Dt as f,tt as g,ge as h,it as i,pt as j,Ll as k,Nr as l,Ne as m,Bt as n,A as o,Wb as p,Y_ as q,R as r,at as s,ce as t,Vl as u,$e as v,rt as w,Ho as x,te as y,Mi as z};