codexapp 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-cSjdFqX4.js +48 -0
- package/dist/assets/index-sxLu4gFb.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +252 -3
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-Bmlv0aWl.js +0 -48
- package/dist/assets/index-lTEk-dqp.css +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
|
|
2
|
-
* @vue/shared v3.5.30
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function Xo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Sr=[],mn=()=>{},cl=()=>!1,Ls=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zo=e=>e.startsWith("onUpdate:"),xt=Object.assign,ei=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},cu=Object.prototype.hasOwnProperty,st=(e,t)=>cu.call(e,t),De=Array.isArray,xr=e=>fs(e)==="[object Map]",ul=e=>fs(e)==="[object Set]",Pi=e=>fs(e)==="[object Date]",Ve=e=>typeof e=="function",bt=e=>typeof e=="string",nn=e=>typeof e=="symbol",ot=e=>e!==null&&typeof e=="object",dl=e=>(ot(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),fl=Object.prototype.toString,fs=e=>fl.call(e),uu=e=>fs(e).slice(8,-1),hl=e=>fs(e)==="[object Object]",ti=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Yr=Xo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Bs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},du=/-\w/g,Ht=Bs(e=>e.replace(du,t=>t.slice(1).toUpperCase())),fu=/\B([A-Z])/g,Wn=Bs(e=>e.replace(fu,"-$1").toLowerCase()),Fs=Bs(e=>e.charAt(0).toUpperCase()+e.slice(1)),to=Bs(e=>e?`on${Fs(e)}`:""),hn=(e,t)=>!Object.is(e,t),Ts=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},pl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ni=e=>{const t=parseFloat(e);return isNaN(t)?e:t},hu=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Oi;const Hs=()=>Oi||(Oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function fr(e){if(De(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=bt(r)?vu(r):fr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(bt(e)||ot(e))return e}const pu=/;(?![^(]*\))/g,mu=/:([^]+)/,gu=/\/\*[^]*?\*\//g;function vu(e){const t={};return e.replace(gu,"").split(pu).forEach(n=>{if(n){const r=n.split(mu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ht(e){let t="";if(bt(e))t=e;else if(De(e))for(let n=0;n<e.length;n++){const r=ht(e[n]);r&&(t+=r+" ")}else if(ot(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const yu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",wu=Xo(yu);function ml(e){return!!e||e===""}function bu(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ri(e[r],t[r]);return n}function ri(e,t){if(e===t)return!0;let n=Pi(e),r=Pi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=nn(e),r=nn(t),n||r)return e===t;if(n=De(e),r=De(t),n||r)return n&&r?bu(e,t):!1;if(n=ot(e),r=ot(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!ri(e[i],t[i]))return!1}}return String(e)===String(t)}const gl=e=>!!(e&&e.__v_isRef===!0),_e=e=>bt(e)?e:e==null?"":De(e)||ot(e)&&(e.toString===fl||!Ve(e.toString))?gl(e)?_e(e.value):JSON.stringify(e,vl,2):String(e),vl=(e,t)=>gl(t)?vl(e,t.value):xr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[no(r,o)+" =>"]=s,n),{})}:ul(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>no(n))}:nn(t)?no(t):ot(t)&&!De(t)&&!hl(t)?String(t):t,no=(e,t="")=>{var n;return nn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
-
* @vue/reactivity v3.5.30
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let Wt;class _u{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=Wt,!t&&Wt&&(this.index=(Wt.scopes||(Wt.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=Wt;try{return Wt=this,t()}finally{Wt=n}}}on(){++this._on===1&&(this.prevScope=Wt,Wt=this)}off(){this._on>0&&--this._on===0&&(Wt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function ku(){return Wt}let pt;const ro=new WeakSet;class yl{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,Wt&&Wt.active&&Wt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ro.has(this)&&(ro.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||bl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ni(this),_l(this);const t=pt,n=en;pt=this,en=!0;try{return this.fn()}finally{kl(this),pt=t,en=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ii(t);this.deps=this.depsTail=void 0,Ni(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ro.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Io(this)&&this.run()}get dirty(){return Io(this)}}let wl=0,Jr,Qr;function bl(e,t=!1){if(e.flags|=8,t){e.next=Qr,Qr=e;return}e.next=Jr,Jr=e}function si(){wl++}function oi(){if(--wl>0)return;if(Qr){let t=Qr;for(Qr=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Jr;){let t=Jr;for(Jr=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 _l(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function kl(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),ii(r),Tu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Io(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Tl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===rs)||(e.globalVersion=rs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Io(e))))return;e.flags|=2;const t=e.dep,n=pt,r=en;pt=e,en=!0;try{_l(e);const s=e.fn(e._value);(t.version===0||hn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{pt=n,en=r,kl(e),e.flags&=-3}}function ii(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)ii(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Tu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let en=!0;const Sl=[];function In(){Sl.push(en),en=!1}function Rn(){const e=Sl.pop();en=e===void 0?!0:e}function Ni(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pt;pt=void 0;try{t()}finally{pt=n}}}let rs=0;class Su{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 ai{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(!pt||!en||pt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pt)n=this.activeLink=new Su(pt,this),pt.deps?(n.prevDep=pt.depsTail,pt.depsTail.nextDep=n,pt.depsTail=n):pt.deps=pt.depsTail=n,xl(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=pt.depsTail,n.nextDep=void 0,pt.depsTail.nextDep=n,pt.depsTail=n,pt.deps===n&&(pt.deps=r)}return n}trigger(t){this.version++,rs++,this.notify(t)}notify(t){si();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{oi()}}}function xl(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)xl(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ro=new WeakMap,ur=Symbol(""),$o=Symbol(""),ss=Symbol("");function Mt(e,t,n){if(en&&pt){let r=Ro.get(e);r||Ro.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ai),s.map=r,s.key=n),s.track()}}function Cn(e,t,n,r,s,o){const i=Ro.get(e);if(!i){rs++;return}const a=l=>{l&&l.trigger()};if(si(),t==="clear")i.forEach(a);else{const l=De(e),d=l&&ti(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===ss||!nn(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ss)),t){case"add":l?d&&a(i.get("length")):(a(i.get(ur)),xr(e)&&a(i.get($o)));break;case"delete":l||(a(i.get(ur)),xr(e)&&a(i.get($o)));break;case"set":xr(e)&&a(i.get(ur));break}}oi()}function wr(e){const t=tt(e);return t===e?t:(Mt(t,"iterate",ss),Jt(e)?t:t.map(rn))}function Us(e){return Mt(e=tt(e),"iterate",ss),e}function dn(e,t){return $n(e)?Ir(dr(e)?rn(t):t):rn(t)}const xu={__proto__:null,[Symbol.iterator](){return so(this,Symbol.iterator,e=>dn(this,e))},concat(...e){return wr(this).concat(...e.map(t=>De(t)?wr(t):t))},entries(){return so(this,"entries",e=>(e[1]=dn(this,e[1]),e))},every(e,t){return _n(this,"every",e,t,void 0,arguments)},filter(e,t){return _n(this,"filter",e,t,n=>n.map(r=>dn(this,r)),arguments)},find(e,t){return _n(this,"find",e,t,n=>dn(this,n),arguments)},findIndex(e,t){return _n(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _n(this,"findLast",e,t,n=>dn(this,n),arguments)},findLastIndex(e,t){return _n(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _n(this,"forEach",e,t,void 0,arguments)},includes(...e){return oo(this,"includes",e)},indexOf(...e){return oo(this,"indexOf",e)},join(e){return wr(this).join(e)},lastIndexOf(...e){return oo(this,"lastIndexOf",e)},map(e,t){return _n(this,"map",e,t,void 0,arguments)},pop(){return Hr(this,"pop")},push(...e){return Hr(this,"push",e)},reduce(e,...t){return ji(this,"reduce",e,t)},reduceRight(e,...t){return ji(this,"reduceRight",e,t)},shift(){return Hr(this,"shift")},some(e,t){return _n(this,"some",e,t,void 0,arguments)},splice(...e){return Hr(this,"splice",e)},toReversed(){return wr(this).toReversed()},toSorted(e){return wr(this).toSorted(e)},toSpliced(...e){return wr(this).toSpliced(...e)},unshift(...e){return Hr(this,"unshift",e)},values(){return so(this,"values",e=>dn(this,e))}};function so(e,t,n){const r=Us(e),s=r[t]();return r!==e&&!Jt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Cu=Array.prototype;function _n(e,t,n,r,s,o){const i=Us(e),a=i!==e&&!Jt(e),l=i[t];if(l!==Cu[t]){const f=l.apply(e,o);return a?rn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,dn(e,f),g,e)}:n.length>2&&(d=function(f,g){return n.call(this,f,g,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function ji(e,t,n,r){const s=Us(e),o=s!==e&&!Jt(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,u,f){return a&&(a=!1,d=dn(e,d)),n.call(this,d,dn(e,u),f,e)}):n.length>3&&(i=function(d,u,f){return n.call(this,d,u,f,e)}));const l=s[t](i,...r);return a?dn(e,l):l}function oo(e,t,n){const r=tt(e);Mt(r,"iterate",ss);const s=r[t](...n);return(s===-1||s===!1)&&ui(n[0])?(n[0]=tt(n[0]),r[t](...n)):s}function Hr(e,t,n=[]){In(),si();const r=tt(e)[t].apply(e,n);return oi(),Rn(),r}const Eu=Xo("__proto__,__v_isRef,__isVue"),Cl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nn));function Au(e){nn(e)||(e=String(e));const t=tt(this);return Mt(t,"has",e),t.hasOwnProperty(e)}class El{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Lu:$l:o?Rl:Il).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=De(t);if(!s){let l;if(i&&(l=xu[n]))return l;if(n==="hasOwnProperty")return Au}const a=Reflect.get(t,n,Nt(t)?t:r);if((nn(n)?Cl.has(n):Eu(n))||(s||Mt(t,"get",n),o))return a;if(Nt(a)){const l=i&&ti(n)?a:a.value;return s&&ot(l)?Po(l):l}return ot(a)?s?Po(a):Vs(a):a}}class Al extends El{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=De(t)&&ti(n);if(!this._isShallow){const d=$n(o);if(!Jt(r)&&!$n(r)&&(o=tt(o),r=tt(r)),!i&&Nt(o)&&!Nt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:st(t,n),l=Reflect.set(t,n,r,Nt(t)?t:s);return t===tt(s)&&(a?hn(r,o)&&Cn(t,"set",n,r):Cn(t,"add",n,r)),l}deleteProperty(t,n){const r=st(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Cn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!nn(n)||!Cl.has(n))&&Mt(t,"has",n),r}ownKeys(t){return Mt(t,"iterate",De(t)?"length":ur),Reflect.ownKeys(t)}}class Iu extends El{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Ru=new Al,$u=new Iu,Mu=new Al(!0);const Mo=e=>e,ms=e=>Reflect.getPrototypeOf(e);function Pu(e,t,n){return function(...r){const s=this.__v_raw,o=tt(s),i=xr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Mo:t?Ir:rn;return!t&&Mt(o,"iterate",l?$o:ur),xt(Object.create(d),{next(){const{value:f,done:g}=d.next();return g?{value:f,done:g}:{value:a?[u(f[0]),u(f[1])]:u(f),done:g}}})}}function gs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ou(e,t){const n={get(s){const o=this.__v_raw,i=tt(o),a=tt(s);e||(hn(s,a)&&Mt(i,"get",s),Mt(i,"get",a));const{has:l}=ms(i),d=t?Mo:e?Ir:rn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Mt(tt(s),"iterate",ur),s.size},has(s){const o=this.__v_raw,i=tt(o),a=tt(s);return e||(hn(s,a)&&Mt(i,"has",s),Mt(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=tt(a),d=t?Mo:e?Ir:rn;return!e&&Mt(l,"iterate",ur),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return xt(n,e?{add:gs("add"),set:gs("set"),delete:gs("delete"),clear:gs("clear")}:{add(s){const o=tt(this),i=ms(o),a=tt(s),l=!t&&!Jt(s)&&!$n(s)?a:s;return i.has.call(o,l)||hn(s,l)&&i.has.call(o,s)||hn(a,l)&&i.has.call(o,a)||(o.add(l),Cn(o,"add",l,l)),this},set(s,o){!t&&!Jt(o)&&!$n(o)&&(o=tt(o));const i=tt(this),{has:a,get:l}=ms(i);let d=a.call(i,s);d||(s=tt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?hn(o,u)&&Cn(i,"set",s,o):Cn(i,"add",s,o),this},delete(s){const o=tt(this),{has:i,get:a}=ms(o);let l=i.call(o,s);l||(s=tt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Cn(o,"delete",s,void 0),d},clear(){const s=tt(this),o=s.size!==0,i=s.clear();return o&&Cn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Pu(s,e,t)}),n}function li(e,t){const n=Ou(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(st(n,s)&&s in r?n:r,s,o)}const Nu={get:li(!1,!1)},ju={get:li(!1,!0)},Du={get:li(!0,!1)};const Il=new WeakMap,Rl=new WeakMap,$l=new WeakMap,Lu=new WeakMap;function Bu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fu(e){return e.__v_skip||!Object.isExtensible(e)?0:Bu(uu(e))}function Vs(e){return $n(e)?e:ci(e,!1,Ru,Nu,Il)}function Ml(e){return ci(e,!1,Mu,ju,Rl)}function Po(e){return ci(e,!0,$u,Du,$l)}function ci(e,t,n,r,s){if(!ot(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Fu(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function dr(e){return $n(e)?dr(e.__v_raw):!!(e&&e.__v_isReactive)}function $n(e){return!!(e&&e.__v_isReadonly)}function Jt(e){return!!(e&&e.__v_isShallow)}function ui(e){return e?!!e.__v_raw:!1}function tt(e){const t=e&&e.__v_raw;return t?tt(t):e}function Hu(e){return!st(e,"__v_skip")&&Object.isExtensible(e)&&pl(e,"__v_skip",!0),e}const rn=e=>ot(e)?Vs(e):e,Ir=e=>ot(e)?Po(e):e;function Nt(e){return e?e.__v_isRef===!0:!1}function N(e){return Pl(e,!1)}function Uu(e){return Pl(e,!0)}function Pl(e,t){return Nt(e)?e:new Vu(e,t)}class Vu{constructor(t,n){this.dep=new ai,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:tt(t),this._value=n?t:rn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Jt(t)||$n(t);t=r?t:tt(t),hn(t,n)&&(this._rawValue=t,this._value=r?t:rn(t),this.dep.trigger())}}function je(e){return Nt(e)?e.value:e}const Wu={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Nt(s)&&!Nt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Ol(e){return dr(e)?e:new Proxy(e,Wu)}class qu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ai(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=rs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pt!==this)return bl(this,!0),!0}get value(){const t=this.dep.track();return Tl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ku(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new qu(r,s,n)}const vs={},As=new WeakMap;let ir;function Gu(e,t=!1,n=ir){if(n){let r=As.get(n);r||As.set(n,r=[]),r.push(e)}}function zu(e,t,n=ft){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=j=>s?j:Jt(j)||s===!1||s===0?En(j,1):En(j);let u,f,g,_,P=!1,I=!1;if(Nt(e)?(f=()=>e.value,P=Jt(e)):dr(e)?(f=()=>d(e),P=!0):De(e)?(I=!0,P=e.some(j=>dr(j)||Jt(j)),f=()=>e.map(j=>{if(Nt(j))return j.value;if(dr(j))return d(j);if(Ve(j))return l?l(j,2):j()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){In();try{g()}finally{Rn()}}const j=ir;ir=u;try{return l?l(e,3,[_]):e(_)}finally{ir=j}}:f=mn,t&&s){const j=f,ae=s===!0?1/0:s;f=()=>En(j(),ae)}const B=ku(),z=()=>{u.stop(),B&&B.active&&ei(B.effects,u)};if(o&&t){const j=t;t=(...ae)=>{j(...ae),z()}}let O=I?new Array(e.length).fill(vs):vs;const H=j=>{if(!(!(u.flags&1)||!u.dirty&&!j))if(t){const ae=u.run();if(s||P||(I?ae.some((ue,fe)=>hn(ue,O[fe])):hn(ae,O))){g&&g();const ue=ir;ir=u;try{const fe=[ae,O===vs?void 0:I&&O[0]===vs?[]:O,_];O=ae,l?l(t,3,fe):t(...fe)}finally{ir=ue}}}else u.run()};return a&&a(H),u=new yl(f),u.scheduler=i?()=>i(H,!1):H,_=j=>Gu(j,!1,u),g=u.onStop=()=>{const j=As.get(u);if(j){if(l)l(j,4);else for(const ae of j)ae();As.delete(u)}},t?r?H(!0):O=u.run():i?i(H.bind(null,!0),!0):u.run(),z.pause=u.pause.bind(u),z.resume=u.resume.bind(u),z.stop=z,z}function En(e,t=1/0,n){if(t<=0||!ot(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Nt(e))En(e.value,t,n);else if(De(e))for(let r=0;r<e.length;r++)En(e[r],t,n);else if(ul(e)||xr(e))e.forEach(r=>{En(r,t,n)});else if(hl(e)){for(const r in e)En(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&En(e[r],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.30
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function hs(e,t,n,r){try{return r?e(...r):e()}catch(s){Ws(s,t,n)}}function sn(e,t,n,r){if(Ve(e)){const s=hs(e,t,n,r);return s&&dl(s)&&s.catch(o=>{Ws(o,t,n)}),s}if(De(e)){const s=[];for(let o=0;o<e.length;o++)s.push(sn(e[o],t,n,r));return s}}function Ws(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ft;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,l,d)===!1)return}a=a.parent}if(o){In(),hs(o,null,10,[e,l,d]),Rn();return}}Yu(e,n,s,r,i)}function Yu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Bt=[];let cn=-1;const Cr=[];let Fn=null,_r=0;const Nl=Promise.resolve();let Is=null;function Gt(e){const t=Is||Nl;return e?t.then(this?e.bind(this):e):t}function Ju(e){let t=cn+1,n=Bt.length;for(;t<n;){const r=t+n>>>1,s=Bt[r],o=os(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function di(e){if(!(e.flags&1)){const t=os(e),n=Bt[Bt.length-1];!n||!(e.flags&2)&&t>=os(n)?Bt.push(e):Bt.splice(Ju(t),0,e),e.flags|=1,jl()}}function jl(){Is||(Is=Nl.then(Ll))}function Qu(e){De(e)?Cr.push(...e):Fn&&e.id===-1?Fn.splice(_r+1,0,e):e.flags&1||(Cr.push(e),e.flags|=1),jl()}function Di(e,t,n=cn+1){for(;n<Bt.length;n++){const r=Bt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Bt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Dl(e){if(Cr.length){const t=[...new Set(Cr)].sort((n,r)=>os(n)-os(r));if(Cr.length=0,Fn){Fn.push(...t);return}for(Fn=t,_r=0;_r<Fn.length;_r++){const n=Fn[_r];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Fn=null,_r=0}}const os=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ll(e){try{for(cn=0;cn<Bt.length;cn++){const t=Bt[cn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),hs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;cn<Bt.length;cn++){const t=Bt[cn];t&&(t.flags&=-2)}cn=-1,Bt.length=0,Dl(),Is=null,(Bt.length||Cr.length)&&Ll()}}let Et=null,Bl=null;function Rs(e){const t=Et;return Et=e,Bl=e&&e.type.__scopeId||null,t}function at(e,t=Et,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Os(-1);const o=Rs(t);let i;try{i=e(...s)}finally{Rs(o),r._d&&Os(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Mn(e,t){if(Et===null)return e;const n=Js(Et),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=ft]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&En(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function tr(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(In(),sn(l,n,8,[e.el,a,e,t]),Rn())}}function Ss(e,t){if(Ot){let n=Ot.provides;const r=Ot.parent&&Ot.parent.provides;r===n&&(n=Ot.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=gi();if(r||Ar){let s=Ar?Ar._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ve(t)?t.call(r&&r.proxy):t}}const Xu=Symbol.for("v-scx"),Zu=()=>tn(Xu);function yt(e,t,n){return Fl(e,t,n)}function Fl(e,t,n=ft){const{immediate:r,deep:s,flush:o,once:i}=n,a=xt({},n),l=t&&r||!t&&o!=="post";let d;if(cs){if(o==="sync"){const _=Zu();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=mn,_.resume=mn,_.pause=mn,_}}const u=Ot;a.call=(_,P,I)=>sn(_,u,P,I);let f=!1;o==="post"?a.scheduler=_=>{$t(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,P)=>{P?_():di(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const g=zu(e,t,a);return cs&&(d?d.push(g):l&&g()),g}function ed(e,t,n){const r=this.proxy,s=bt(e)?e.includes(".")?Hl(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=ps(this),a=Fl(s,o.bind(r),n);return i(),a}function Hl(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Ul=Symbol("_vte"),Vl=e=>e.__isTeleport,Xr=e=>e&&(e.disabled||e.disabled===""),Li=e=>e&&(e.defer||e.defer===""),Bi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Oo=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},Wl={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:_,querySelector:P,createText:I,createComment:B}}=d,z=Xr(t.props);let{shapeFlag:O,children:H,dynamicChildren:j}=t;if(e==null){const ae=t.el=I(""),ue=t.anchor=I("");_(ae,n,r),_(ue,n,r);const fe=(se,X)=>{O&16&&u(H,se,X,s,o,i,a,l)},ke=()=>{const se=t.target=Oo(t.props,P),X=No(se,t,I,_);se&&(i!=="svg"&&Bi(se)?i="svg":i!=="mathml"&&Fi(se)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(se),z||(fe(se,X),xs(t,!1)))};z&&(fe(n,ue),xs(t,!0)),Li(t.props)?(t.el.__isMounted=!1,$t(()=>{ke(),delete t.el.__isMounted},o)):ke()}else{if(Li(t.props)&&e.el.__isMounted===!1){$t(()=>{Wl.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,ue=t.target=e.target,fe=t.targetAnchor=e.targetAnchor,ke=Xr(e.props),se=ke?n:ue,X=ke?ae:fe;if(i==="svg"||Bi(ue)?i="svg":(i==="mathml"||Fi(ue))&&(i="mathml"),j?(g(e.dynamicChildren,j,se,s,o,i,a),pi(e,t,!0)):l||f(e,t,se,X,s,o,i,a,!1),z)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ys(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const me=t.target=Oo(t.props,P);me&&ys(t,me,null,d,0)}else ke&&ys(t,ue,fe,d,1);xs(t,z)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:g}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const _=o||!Xr(g);for(let P=0;P<a.length;P++){const I=a[P];r(I,t,n,_,!!I.dynamicChildren)}}},move:ys,hydrate:td};function ys(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,f=o===2;if(f&&r(i,t,n),(!f||Xr(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function td(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(B,z){let O=z;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function _(B,z){z.anchor=f(i(B),z,a(B),n,r,s,o)}const P=t.target=Oo(t.props,l),I=Xr(t.props);if(P){const B=P._lpa||P.firstChild;t.shapeFlag&16&&(I?(_(e,t),g(P,B),t.targetAnchor||No(P,t,u,d,a(e)===P?e:null)):(t.anchor=i(e),g(P,B),t.targetAnchor||No(P,t,u,d),f(B&&i(B),t,P,n,r,s,o))),xs(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const $s=Wl;function xs(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function No(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Ul]=i,e&&(r(o,e,s),r(i,e,s)),i}const un=Symbol("_leaveCb"),Ur=Symbol("_enterCb");function nd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return qn(()=>{e.isMounted=!0}),Kn(()=>{e.isUnmounting=!0}),e}const zt=[Function,Array],ql={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:zt,onEnter:zt,onAfterEnter:zt,onEnterCancelled:zt,onBeforeLeave:zt,onLeave:zt,onAfterLeave:zt,onLeaveCancelled:zt,onBeforeAppear:zt,onAppear:zt,onAfterAppear:zt,onAppearCancelled:zt},Kl=e=>{const t=e.subTree;return t.component?Kl(t.component):t},rd={name:"BaseTransition",props:ql,setup(e,{slots:t}){const n=gi(),r=nd();return()=>{const s=t.default&&Yl(t.default(),!0);if(!s||!s.length)return;const o=Gl(s),i=tt(e),{mode:a}=i;if(r.isLeaving)return io(o);const l=Hi(o);if(!l)return io(o);let d=jo(l,i,r,n,f=>d=f);l.type!==Pt&&is(l,d);let u=n.subTree&&Hi(n.subTree);if(u&&u.type!==Pt&&!ar(u,l)&&Kl(n).type!==Pt){let f=jo(u,i,r,n);if(is(u,f),a==="out-in"&&l.type!==Pt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},io(o);a==="in-out"&&l.type!==Pt?f.delayLeave=(g,_,P)=>{const I=zl(r,u);I[String(u.key)]=u,g[un]=()=>{_(),g[un]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{P(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Gl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Pt){t=n;break}}return t}const sd=rd;function zl(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 jo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:_,onAfterLeave:P,onLeaveCancelled:I,onBeforeAppear:B,onAppear:z,onAfterAppear:O,onAppearCancelled:H}=t,j=String(e.key),ae=zl(n,e),ue=(se,X)=>{se&&sn(se,r,9,X)},fe=(se,X)=>{const me=X[1];ue(se,X),De(se)?se.every(re=>re.length<=1)&&me():se.length<=1&&me()},ke={mode:i,persisted:a,beforeEnter(se){let X=l;if(!n.isMounted)if(o)X=B||l;else return;se[un]&&se[un](!0);const me=ae[j];me&&ar(e,me)&&me.el[un]&&me.el[un](),ue(X,[se])},enter(se){if(ae[j]===e)return;let X=d,me=u,re=f;if(!n.isMounted)if(o)X=z||d,me=O||u,re=H||f;else return;let Be=!1;se[Ur]=Ge=>{Be||(Be=!0,Ge?ue(re,[se]):ue(me,[se]),ke.delayedLeave&&ke.delayedLeave(),se[Ur]=void 0)};const He=se[Ur].bind(null,!1);X?fe(X,[se,He]):He()},leave(se,X){const me=String(e.key);if(se[Ur]&&se[Ur](!0),n.isUnmounting)return X();ue(g,[se]);let re=!1;se[un]=He=>{re||(re=!0,X(),He?ue(I,[se]):ue(P,[se]),se[un]=void 0,ae[me]===e&&delete ae[me])};const Be=se[un].bind(null,!1);ae[me]=e,_?fe(_,[se,Be]):Be()},clone(se){const X=jo(se,t,n,r,s);return s&&s(X),X}};return ke}function io(e){if(qs(e))return e=Vn(e),e.children=null,e}function Hi(e){if(!qs(e))return Vl(e.type)&&e.children?Gl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ve(n.default))return n.default()}}function is(e,t){e.shapeFlag&6&&e.component?(e.transition=t,is(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Yl(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Ue?(i.patchFlag&128&&s++,r=r.concat(Yl(i.children,t,a))):(t||i.type!==Pt)&&r.push(a!=null?Vn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function At(e,t){return Ve(e)?xt({name:e.name},t,{setup:e}):e}function Jl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ui(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ms=new WeakMap;function Zr(e,t,n,r,s=!1){if(De(e)){e.forEach((I,B)=>Zr(I,t&&(De(t)?t[B]:t),n,r,s));return}if(Er(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Zr(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Js(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===ft?a.refs={}:a.refs,f=a.setupState,g=tt(f),_=f===ft?cl:I=>Ui(u,I)?!1:st(g,I),P=(I,B)=>!(B&&Ui(u,B));if(d!=null&&d!==l){if(Vi(t),bt(d))u[d]=null,_(d)&&(f[d]=null);else if(Nt(d)){const I=t;P(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(Ve(l))hs(l,a,12,[i,u]);else{const I=bt(l),B=Nt(l);if(I||B){const z=()=>{if(e.f){const O=I?_(l)?f[l]:u[l]:P()||!e.k?l.value:u[e.k];if(s)De(O)&&ei(O,o);else if(De(O))O.includes(o)||O.push(o);else if(I)u[l]=[o],_(l)&&(f[l]=u[l]);else{const H=[o];P(l,e.k)&&(l.value=H),e.k&&(u[e.k]=H)}}else I?(u[l]=i,_(l)&&(f[l]=i)):B&&(P(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const O=()=>{z(),Ms.delete(e)};O.id=-1,Ms.set(e,O),$t(O,n)}else Vi(e),z()}}}function Vi(e){const t=Ms.get(e);t&&(t.flags|=8,Ms.delete(e))}Hs().requestIdleCallback;Hs().cancelIdleCallback;const Er=e=>!!e.type.__asyncLoader,qs=e=>e.type.__isKeepAlive;function od(e,t){Ql(e,"a",t)}function id(e,t){Ql(e,"da",t)}function Ql(e,t,n=Ot){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Ks(t,r,n),n){let s=n.parent;for(;s&&s.parent;)qs(s.parent.vnode)&&ad(r,t,n,s),s=s.parent}}function ad(e,t,n,r){const s=Ks(t,e,r,!0);Gs(()=>{ei(r[t],s)},n)}function Ks(e,t,n=Ot,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{In();const a=ps(n),l=sn(t,n,e,i);return a(),Rn(),l});return r?s.unshift(o):s.push(o),o}}const On=e=>(t,n=Ot)=>{(!cs||e==="sp")&&Ks(e,(...r)=>t(...r),n)},ld=On("bm"),qn=On("m"),cd=On("bu"),ud=On("u"),Kn=On("bum"),Gs=On("um"),dd=On("sp"),fd=On("rtg"),hd=On("rtc");function pd(e,t=Ot){Ks("ec",e,t)}const md="components",Xl=Symbol.for("v-ndc");function gd(e){return bt(e)?vd(md,e,!1)||e:e||Xl}function vd(e,t,n=!0,r=!1){const s=Et||Ot;if(s){const o=s.type;{const a=nf(o,!1);if(a&&(a===t||a===Ht(t)||a===Fs(Ht(t))))return o}const i=Wi(s[e]||o[e],t)||Wi(s.appContext[e],t);return!i&&r?o:i}}function Wi(e,t){return e&&(e[t]||e[Ht(t)]||e[Fs(Ht(t))])}function wt(e,t,n,r){let s;const o=n,i=De(e);if(i||bt(e)){const a=i&&dr(e);let l=!1,d=!1;a&&(l=!Jt(e),d=$n(e),e=Us(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Ir(rn(e[u])):rn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(ot(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function pn(e,t,n={},r,s){if(Et.ce||Et.parent&&Er(Et.parent)&&Et.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),mt(Ue,null,[Ee("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),b();const i=o&&Zl(o(n)),a=n.key||i&&i.key,l=mt(Ue,{key:(a&&!nn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Zl(e){return e.some(t=>ls(t)?!(t.type===Pt||t.type===Ue&&!Zl(t.children)):!0)?e:null}const Do=e=>e?wc(e)?Js(e):Do(e.parent):null,es=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=>Do(e.parent),$root:e=>Do(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>tc(e),$forceUpdate:e=>e.f||(e.f=()=>{di(e.update)}),$nextTick:e=>e.n||(e.n=Gt.bind(e.proxy)),$watch:e=>ed.bind(e)}),ao=(e,t)=>e!==ft&&!e.__isScriptSetup&&st(e,t),yd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(ao(r,t))return i[t]=1,r[t];if(s!==ft&&st(s,t))return i[t]=2,s[t];if(st(o,t))return i[t]=3,o[t];if(n!==ft&&st(n,t))return i[t]=4,n[t];Lo&&(i[t]=0)}}const d=es[t];let u,f;if(d)return t==="$attrs"&&Mt(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==ft&&st(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,st(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return ao(s,t)?(s[t]=n,!0):r!==ft&&st(r,t)?(r[t]=n,!0):st(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==ft&&a[0]!=="$"&&st(e,a)||ao(t,a)||st(o,a)||st(r,a)||st(es,a)||st(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:st(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function wd(){return bd().slots}function bd(e){const t=gi();return t.setupContext||(t.setupContext=_c(t))}function qi(e){return De(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Lo=!0;function _d(e){const t=tc(e),n=e.proxy,r=e.ctx;Lo=!1,t.beforeCreate&&Ki(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:_,updated:P,activated:I,deactivated:B,beforeDestroy:z,beforeUnmount:O,destroyed:H,unmounted:j,render:ae,renderTracked:ue,renderTriggered:fe,errorCaptured:ke,serverPrefetch:se,expose:X,inheritAttrs:me,components:re,directives:Be,filters:He}=t;if(d&&kd(d,r,null),i)for(const be in i){const $e=i[be];Ve($e)&&(r[be]=$e.bind(n))}if(s){const be=s.call(n,n);ot(be)&&(e.data=Vs(be))}if(Lo=!0,o)for(const be in o){const $e=o[be],gt=Ve($e)?$e.bind(n,n):Ve($e.get)?$e.get.bind(n,n):mn,Je=!Ve($e)&&Ve($e.set)?$e.set.bind(n):mn,lt=le({get:gt,set:Je});Object.defineProperty(r,be,{enumerable:!0,configurable:!0,get:()=>lt.value,set:Ye=>lt.value=Ye})}if(a)for(const be in a)ec(a[be],r,n,be);if(l){const be=Ve(l)?l.call(n):l;Reflect.ownKeys(be).forEach($e=>{Ss($e,be[$e])})}u&&Ki(u,e,"c");function Ae(be,$e){De($e)?$e.forEach(gt=>be(gt.bind(n))):$e&&be($e.bind(n))}if(Ae(ld,f),Ae(qn,g),Ae(cd,_),Ae(ud,P),Ae(od,I),Ae(id,B),Ae(pd,ke),Ae(hd,ue),Ae(fd,fe),Ae(Kn,O),Ae(Gs,j),Ae(dd,se),De(X))if(X.length){const be=e.exposed||(e.exposed={});X.forEach($e=>{Object.defineProperty(be,$e,{get:()=>n[$e],set:gt=>n[$e]=gt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===mn&&(e.render=ae),me!=null&&(e.inheritAttrs=me),re&&(e.components=re),Be&&(e.directives=Be),se&&Jl(e)}function kd(e,t,n=mn){De(e)&&(e=Bo(e));for(const r in e){const s=e[r];let o;ot(s)?"default"in s?o=tn(s.from||r,s.default,!0):o=tn(s.from||r):o=tn(s),Nt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Ki(e,t,n){sn(De(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ec(e,t,n,r){let s=r.includes(".")?Hl(n,r):()=>n[r];if(bt(e)){const o=t[e];Ve(o)&&yt(s,o)}else if(Ve(e))yt(s,e.bind(n));else if(ot(e))if(De(e))e.forEach(o=>ec(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&&yt(s,o,e)}}function tc(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>Ps(l,d,i,!0)),Ps(l,t,i)),ot(t)&&o.set(t,l),l}function Ps(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Ps(e,o,n,!0),s&&s.forEach(i=>Ps(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Td[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Td={data:Gi,props:zi,emits:zi,methods:zr,computed:zr,beforeCreate:Dt,created:Dt,beforeMount:Dt,mounted:Dt,beforeUpdate:Dt,updated:Dt,beforeDestroy:Dt,beforeUnmount:Dt,destroyed:Dt,unmounted:Dt,activated:Dt,deactivated:Dt,errorCaptured:Dt,serverPrefetch:Dt,components:zr,directives:zr,watch:xd,provide:Gi,inject:Sd};function Gi(e,t){return t?e?function(){return xt(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function Sd(e,t){return zr(Bo(e),Bo(t))}function Bo(e){if(De(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Dt(e,t){return e?[...new Set([].concat(e,t))]:t}function zr(e,t){return e?xt(Object.create(null),e,t):t}function zi(e,t){return e?De(e)&&De(t)?[...new Set([...e,...t])]:xt(Object.create(null),qi(e),qi(t??{})):t}function xd(e,t){if(!e)return t;if(!t)return e;const n=xt(Object.create(null),e);for(const r in t)n[r]=Dt(e[r],t[r]);return n}function nc(){return{app:null,config:{isNativeTag:cl,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 Cd=0;function Ed(e,t){return function(r,s=null){Ve(r)||(r=xt({},r)),s!=null&&!ot(s)&&(s=null);const o=nc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Cd++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:sf,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ve(u.install)?(i.add(u),u.install(d,...f)):Ve(u)&&(i.add(u),u(d,...f))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,f){return f?(o.components[u]=f,d):o.components[u]},directive(u,f){return f?(o.directives[u]=f,d):o.directives[u]},mount(u,f,g){if(!l){const _=d._ceVNode||Ee(r,s);return _.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(_,u,g),l=!0,d._container=u,u.__vue_app__=d,Js(_.component)}},onUnmount(u){a.push(u)},unmount(){l&&(sn(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,f){return o.provides[u]=f,d},runWithContext(u){const f=Ar;Ar=d;try{return u()}finally{Ar=f}}};return d}}let Ar=null;const Ad=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ht(t)}Modifiers`]||e[`${Wn(t)}Modifiers`];function Id(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ft;let s=n;const o=t.startsWith("update:"),i=o&&Ad(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>bt(u)?u.trim():u)),i.number&&(s=n.map(ni)));let a,l=r[a=to(t)]||r[a=to(Ht(t))];!l&&o&&(l=r[a=to(Wn(t))]),l&&sn(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,sn(d,e,6,s)}}const Rd=new WeakMap;function rc(e,t,n=!1){const r=n?Rd:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=d=>{const u=rc(d,t,!0);u&&(a=!0,xt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ot(e)&&r.set(e,null),null):(De(o)?o.forEach(l=>i[l]=null):xt(i,o),ot(e)&&r.set(e,i),i)}function zs(e,t){return!e||!Ls(t)?!1:(t=t.slice(2).replace(/Once$/,""),st(e,t[0].toLowerCase()+t.slice(1))||st(e,Wn(t))||st(e,t))}function Yi(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:_,ctx:P,inheritAttrs:I}=e,B=Rs(e);let z,O;try{if(n.shapeFlag&4){const j=s||r,ae=j;z=fn(d.call(ae,j,u,f,_,g,P)),O=a}else{const j=t;z=fn(j.length>1?j(f,{attrs:a,slots:i,emit:l}):j(f,null)),O=t.props?a:$d(a)}}catch(j){ts.length=0,Ws(j,e,1),z=Ee(Pt)}let H=z;if(O&&I!==!1){const j=Object.keys(O),{shapeFlag:ae}=H;j.length&&ae&7&&(o&&j.some(Zo)&&(O=Md(O,o)),H=Vn(H,O,!1,!0))}return n.dirs&&(H=Vn(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(n.dirs):n.dirs),n.transition&&is(H,n.transition),z=H,Rs(B),z}const $d=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ls(n))&&((t||(t={}))[n]=e[n]);return t},Md=(e,t)=>{const n={};for(const r in e)(!Zo(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Pd(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Ji(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(sc(i,r,g)&&!zs(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Ji(r,i,d):!0:!!i;return!1}function Ji(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(sc(t,e,o)&&!zs(n,o))return!0}return!1}function sc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ot(r)&&ot(s)?!ri(r,s):r!==s}function Od({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const oc={},ic=()=>Object.create(oc),ac=e=>Object.getPrototypeOf(e)===oc;function Nd(e,t,n,r=!1){const s={},o=ic();e.propsDefaults=Object.create(null),lc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Ml(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function jd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=tt(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let g=u[f];if(zs(e.emitsOptions,g))continue;const _=t[g];if(l)if(st(o,g))_!==o[g]&&(o[g]=_,d=!0);else{const P=Ht(g);s[P]=Fo(l,a,P,_,e,!1)}else _!==o[g]&&(o[g]=_,d=!0)}}}else{lc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!st(t,f)&&((u=Wn(f))===f||!st(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Fo(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!st(t,f))&&(delete o[f],d=!0)}d&&Cn(e.attrs,"set","")}function lc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Yr(l))continue;const d=t[l];let u;s&&st(s,u=Ht(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:zs(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=tt(n),d=a||ft;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Fo(s,l,f,d[f],e,!st(d,f))}}return i}function Fo(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=st(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ve(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=ps(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Wn(n))&&(r=!0))}return r}const Dd=new WeakMap;function cc(e,t,n=!1){const r=n?Dd:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const u=f=>{l=!0;const[g,_]=cc(f,t,!0);xt(i,g),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return ot(e)&&r.set(e,Sr),Sr;if(De(o))for(let u=0;u<o.length;u++){const f=Ht(o[u]);Qi(f)&&(i[f]=ft)}else if(o)for(const u in o){const f=Ht(u);if(Qi(f)){const g=o[u],_=i[f]=De(g)||Ve(g)?{type:g}:xt({},g),P=_.type;let I=!1,B=!0;if(De(P))for(let z=0;z<P.length;++z){const O=P[z],H=Ve(O)&&O.name;if(H==="Boolean"){I=!0;break}else H==="String"&&(B=!1)}else I=Ve(P)&&P.name==="Boolean";_[0]=I,_[1]=B,(I||st(_,"default"))&&a.push(f)}}const d=[i,a];return ot(e)&&r.set(e,d),d}function Qi(e){return e[0]!=="$"&&!Yr(e)}const fi=e=>e==="_"||e==="_ctx"||e==="$stable",hi=e=>De(e)?e.map(fn):[fn(e)],Ld=(e,t,n)=>{if(t._n)return t;const r=at((...s)=>hi(t(...s)),n);return r._c=!1,r},uc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(fi(s))continue;const o=e[s];if(Ve(o))t[s]=Ld(s,o,r);else if(o!=null){const i=hi(o);t[s]=()=>i}}},dc=(e,t)=>{const n=hi(t);e.slots.default=()=>n},fc=(e,t,n)=>{for(const r in t)(n||!fi(r))&&(e[r]=t[r])},Bd=(e,t,n)=>{const r=e.slots=ic();if(e.vnode.shapeFlag&32){const s=t._;s?(fc(r,t,n),n&&pl(r,"_",s,!0)):uc(t,r)}else t&&dc(e,t)},Fd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ft;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:fc(s,t,n):(o=!t.$stable,uc(t,s)),i=t}else t&&(dc(e,t),i={default:1});if(o)for(const a in s)!fi(a)&&i[a]==null&&delete s[a]},$t=qd;function Hd(e){return Ud(e)}function Ud(e,t){const n=Hs();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:_=mn,insertStaticContent:P}=e,I=(p,y,x,D=null,V=null,L=null,te=void 0,ne=null,Q=!!y.dynamicChildren)=>{if(p===y)return;p&&!ar(p,y)&&(D=E(p),Ye(p,V,L,!0),p=null),y.patchFlag===-2&&(Q=!1,y.dynamicChildren=null);const{type:U,ref:de,shapeFlag:ie}=y;switch(U){case Ys:B(p,y,x,D);break;case Pt:z(p,y,x,D);break;case co:p==null&&O(y,x,D,te);break;case Ue:re(p,y,x,D,V,L,te,ne,Q);break;default:ie&1?ae(p,y,x,D,V,L,te,ne,Q):ie&6?Be(p,y,x,D,V,L,te,ne,Q):(ie&64||ie&128)&&U.process(p,y,x,D,V,L,te,ne,Q,ye)}de!=null&&V?Zr(de,p&&p.ref,L,y||p,!y):de==null&&p&&p.ref!=null&&Zr(p.ref,null,L,p,!0)},B=(p,y,x,D)=>{if(p==null)r(y.el=a(y.children),x,D);else{const V=y.el=p.el;y.children!==p.children&&d(V,y.children)}},z=(p,y,x,D)=>{p==null?r(y.el=l(y.children||""),x,D):y.el=p.el},O=(p,y,x,D)=>{[p.el,p.anchor]=P(p.children,y,x,D,p.el,p.anchor)},H=({el:p,anchor:y},x,D)=>{let V;for(;p&&p!==y;)V=g(p),r(p,x,D),p=V;r(y,x,D)},j=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=g(p),s(p),p=x;s(y)},ae=(p,y,x,D,V,L,te,ne,Q)=>{if(y.type==="svg"?te="svg":y.type==="math"&&(te="mathml"),p==null)ue(y,x,D,V,L,te,ne,Q);else{const U=p.el&&p.el._isVueCE?p.el:null;try{U&&U._beginPatch(),se(p,y,V,L,te,ne,Q)}finally{U&&U._endPatch()}}},ue=(p,y,x,D,V,L,te,ne)=>{let Q,U;const{props:de,shapeFlag:ie,transition:ge,dirs:ve}=p;if(Q=p.el=i(p.type,L,de&&de.is,de),ie&8?u(Q,p.children):ie&16&&ke(p.children,Q,null,D,V,lo(p,L),te,ne),ve&&tr(p,null,D,"created"),fe(Q,p,p.scopeId,te,D),de){for(const qe in de)qe!=="value"&&!Yr(qe)&&o(Q,qe,null,de[qe],L,D);"value"in de&&o(Q,"value",null,de.value,L),(U=de.onVnodeBeforeMount)&&ln(U,D,p)}ve&&tr(p,null,D,"beforeMount");const Le=Vd(V,ge);Le&&ge.beforeEnter(Q),r(Q,y,x),((U=de&&de.onVnodeMounted)||Le||ve)&&$t(()=>{U&&ln(U,D,p),Le&&ge.enter(Q),ve&&tr(p,null,D,"mounted")},V)},fe=(p,y,x,D,V)=>{if(x&&_(p,x),D)for(let L=0;L<D.length;L++)_(p,D[L]);if(V){let L=V.subTree;if(y===L||mc(L.type)&&(L.ssContent===y||L.ssFallback===y)){const te=V.vnode;fe(p,te,te.scopeId,te.slotScopeIds,V.parent)}}},ke=(p,y,x,D,V,L,te,ne,Q=0)=>{for(let U=Q;U<p.length;U++){const de=p[U]=ne?xn(p[U]):fn(p[U]);I(null,de,y,x,D,V,L,te,ne)}},se=(p,y,x,D,V,L,te)=>{const ne=y.el=p.el;let{patchFlag:Q,dynamicChildren:U,dirs:de}=y;Q|=p.patchFlag&16;const ie=p.props||ft,ge=y.props||ft;let ve;if(x&&nr(x,!1),(ve=ge.onVnodeBeforeUpdate)&&ln(ve,x,y,p),de&&tr(y,p,x,"beforeUpdate"),x&&nr(x,!0),(ie.innerHTML&&ge.innerHTML==null||ie.textContent&&ge.textContent==null)&&u(ne,""),U?X(p.dynamicChildren,U,ne,x,D,lo(y,V),L):te||$e(p,y,ne,null,x,D,lo(y,V),L,!1),Q>0){if(Q&16)me(ne,ie,ge,x,V);else if(Q&2&&ie.class!==ge.class&&o(ne,"class",null,ge.class,V),Q&4&&o(ne,"style",ie.style,ge.style,V),Q&8){const Le=y.dynamicProps;for(let qe=0;qe<Le.length;qe++){const Oe=Le[qe],nt=ie[Oe],dt=ge[Oe];(dt!==nt||Oe==="value")&&o(ne,Oe,nt,dt,V,x)}}Q&1&&p.children!==y.children&&u(ne,y.children)}else!te&&U==null&&me(ne,ie,ge,x,V);((ve=ge.onVnodeUpdated)||de)&&$t(()=>{ve&&ln(ve,x,y,p),de&&tr(y,p,x,"updated")},D)},X=(p,y,x,D,V,L,te)=>{for(let ne=0;ne<y.length;ne++){const Q=p[ne],U=y[ne],de=Q.el&&(Q.type===Ue||!ar(Q,U)||Q.shapeFlag&198)?f(Q.el):x;I(Q,U,de,null,D,V,L,te,!0)}},me=(p,y,x,D,V)=>{if(y!==x){if(y!==ft)for(const L in y)!Yr(L)&&!(L in x)&&o(p,L,y[L],null,V,D);for(const L in x){if(Yr(L))continue;const te=x[L],ne=y[L];te!==ne&&L!=="value"&&o(p,L,ne,te,V,D)}"value"in x&&o(p,"value",y.value,x.value,V)}},re=(p,y,x,D,V,L,te,ne,Q)=>{const U=y.el=p?p.el:a(""),de=y.anchor=p?p.anchor:a("");let{patchFlag:ie,dynamicChildren:ge,slotScopeIds:ve}=y;ve&&(ne=ne?ne.concat(ve):ve),p==null?(r(U,x,D),r(de,x,D),ke(y.children||[],x,de,V,L,te,ne,Q)):ie>0&&ie&64&&ge&&p.dynamicChildren&&p.dynamicChildren.length===ge.length?(X(p.dynamicChildren,ge,x,V,L,te,ne),(y.key!=null||V&&y===V.subTree)&&pi(p,y,!0)):$e(p,y,x,de,V,L,te,ne,Q)},Be=(p,y,x,D,V,L,te,ne,Q)=>{y.slotScopeIds=ne,p==null?y.shapeFlag&512?V.ctx.activate(y,x,D,te,Q):He(y,x,D,V,L,te,Q):Ge(p,y,Q)},He=(p,y,x,D,V,L,te)=>{const ne=p.component=Xd(p,D,V);if(qs(p)&&(ne.ctx.renderer=ye),Zd(ne,!1,te),ne.asyncDep){if(V&&V.registerDep(ne,Ae,te),!p.el){const Q=ne.subTree=Ee(Pt);z(null,Q,y,x),p.placeholder=Q.el}}else Ae(ne,p,y,x,V,L,te)},Ge=(p,y,x)=>{const D=y.component=p.component;if(Pd(p,y,x))if(D.asyncDep&&!D.asyncResolved){be(D,y,x);return}else D.next=y,D.update();else y.el=p.el,D.vnode=y},Ae=(p,y,x,D,V,L,te)=>{const ne=()=>{if(p.isMounted){let{next:ie,bu:ge,u:ve,parent:Le,vnode:qe}=p;{const W=hc(p);if(W){ie&&(ie.el=qe.el,be(p,ie,te)),W.asyncDep.then(()=>{$t(()=>{p.isUnmounted||U()},V)});return}}let Oe=ie,nt;nr(p,!1),ie?(ie.el=qe.el,be(p,ie,te)):ie=qe,ge&&Ts(ge),(nt=ie.props&&ie.props.onVnodeBeforeUpdate)&&ln(nt,Le,ie,qe),nr(p,!0);const dt=Yi(p),F=p.subTree;p.subTree=dt,I(F,dt,f(F.el),E(F),p,V,L),ie.el=dt.el,Oe===null&&Od(p,dt.el),ve&&$t(ve,V),(nt=ie.props&&ie.props.onVnodeUpdated)&&$t(()=>ln(nt,Le,ie,qe),V)}else{let ie;const{el:ge,props:ve}=y,{bm:Le,m:qe,parent:Oe,root:nt,type:dt}=p,F=Er(y);nr(p,!1),Le&&Ts(Le),!F&&(ie=ve&&ve.onVnodeBeforeMount)&&ln(ie,Oe,y),nr(p,!0);{nt.ce&&nt.ce._hasShadowRoot()&&nt.ce._injectChildStyle(dt,p.parent?p.parent.type:void 0);const W=p.subTree=Yi(p);I(null,W,x,D,p,V,L),y.el=W.el}if(qe&&$t(qe,V),!F&&(ie=ve&&ve.onVnodeMounted)){const W=y;$t(()=>ln(ie,Oe,W),V)}(y.shapeFlag&256||Oe&&Er(Oe.vnode)&&Oe.vnode.shapeFlag&256)&&p.a&&$t(p.a,V),p.isMounted=!0,y=x=D=null}};p.scope.on();const Q=p.effect=new yl(ne);p.scope.off();const U=p.update=Q.run.bind(Q),de=p.job=Q.runIfDirty.bind(Q);de.i=p,de.id=p.uid,Q.scheduler=()=>di(de),nr(p,!0),U()},be=(p,y,x)=>{y.component=p;const D=p.vnode.props;p.vnode=y,p.next=null,jd(p,y.props,D,x),Fd(p,y.children,x),In(),Di(p),Rn()},$e=(p,y,x,D,V,L,te,ne,Q=!1)=>{const U=p&&p.children,de=p?p.shapeFlag:0,ie=y.children,{patchFlag:ge,shapeFlag:ve}=y;if(ge>0){if(ge&128){Je(U,ie,x,D,V,L,te,ne,Q);return}else if(ge&256){gt(U,ie,x,D,V,L,te,ne,Q);return}}ve&8?(de&16&&Te(U,V,L),ie!==U&&u(x,ie)):de&16?ve&16?Je(U,ie,x,D,V,L,te,ne,Q):Te(U,V,L,!0):(de&8&&u(x,""),ve&16&&ke(ie,x,D,V,L,te,ne,Q))},gt=(p,y,x,D,V,L,te,ne,Q)=>{p=p||Sr,y=y||Sr;const U=p.length,de=y.length,ie=Math.min(U,de);let ge;for(ge=0;ge<ie;ge++){const ve=y[ge]=Q?xn(y[ge]):fn(y[ge]);I(p[ge],ve,x,null,V,L,te,ne,Q)}U>de?Te(p,V,L,!0,!1,ie):ke(y,x,D,V,L,te,ne,Q,ie)},Je=(p,y,x,D,V,L,te,ne,Q)=>{let U=0;const de=y.length;let ie=p.length-1,ge=de-1;for(;U<=ie&&U<=ge;){const ve=p[U],Le=y[U]=Q?xn(y[U]):fn(y[U]);if(ar(ve,Le))I(ve,Le,x,null,V,L,te,ne,Q);else break;U++}for(;U<=ie&&U<=ge;){const ve=p[ie],Le=y[ge]=Q?xn(y[ge]):fn(y[ge]);if(ar(ve,Le))I(ve,Le,x,null,V,L,te,ne,Q);else break;ie--,ge--}if(U>ie){if(U<=ge){const ve=ge+1,Le=ve<de?y[ve].el:D;for(;U<=ge;)I(null,y[U]=Q?xn(y[U]):fn(y[U]),x,Le,V,L,te,ne,Q),U++}}else if(U>ge)for(;U<=ie;)Ye(p[U],V,L,!0),U++;else{const ve=U,Le=U,qe=new Map;for(U=Le;U<=ge;U++){const w=y[U]=Q?xn(y[U]):fn(y[U]);w.key!=null&&qe.set(w.key,U)}let Oe,nt=0;const dt=ge-Le+1;let F=!1,W=0;const J=new Array(dt);for(U=0;U<dt;U++)J[U]=0;for(U=ve;U<=ie;U++){const w=p[U];if(nt>=dt){Ye(w,V,L,!0);continue}let A;if(w.key!=null)A=qe.get(w.key);else for(Oe=Le;Oe<=ge;Oe++)if(J[Oe-Le]===0&&ar(w,y[Oe])){A=Oe;break}A===void 0?Ye(w,V,L,!0):(J[A-Le]=U+1,A>=W?W=A:F=!0,I(w,y[A],x,null,V,L,te,ne,Q),nt++)}const Ke=F?Wd(J):Sr;for(Oe=Ke.length-1,U=dt-1;U>=0;U--){const w=Le+U,A=y[w],$=y[w+1],Z=w+1<de?$.el||pc($):D;J[U]===0?I(null,A,x,Z,V,L,te,ne,Q):F&&(Oe<0||U!==Ke[Oe]?lt(A,x,Z,2):Oe--)}}},lt=(p,y,x,D,V=null)=>{const{el:L,type:te,transition:ne,children:Q,shapeFlag:U}=p;if(U&6){lt(p.component.subTree,y,x,D);return}if(U&128){p.suspense.move(y,x,D);return}if(U&64){te.move(p,y,x,ye);return}if(te===Ue){r(L,y,x);for(let ie=0;ie<Q.length;ie++)lt(Q[ie],y,x,D);r(p.anchor,y,x);return}if(te===co){H(p,y,x);return}if(D!==2&&U&1&&ne)if(D===0)ne.beforeEnter(L),r(L,y,x),$t(()=>ne.enter(L),V);else{const{leave:ie,delayLeave:ge,afterLeave:ve}=ne,Le=()=>{p.ctx.isUnmounted?s(L):r(L,y,x)},qe=()=>{L._isLeaving&&L[un](!0),ie(L,()=>{Le(),ve&&ve()})};ge?ge(L,Le,qe):qe()}else r(L,y,x)},Ye=(p,y,x,D=!1,V=!1)=>{const{type:L,props:te,ref:ne,children:Q,dynamicChildren:U,shapeFlag:de,patchFlag:ie,dirs:ge,cacheIndex:ve}=p;if(ie===-2&&(V=!1),ne!=null&&(In(),Zr(ne,null,x,p,!0),Rn()),ve!=null&&(y.renderCache[ve]=void 0),de&256){y.ctx.deactivate(p);return}const Le=de&1&&ge,qe=!Er(p);let Oe;if(qe&&(Oe=te&&te.onVnodeBeforeUnmount)&&ln(Oe,y,p),de&6)Se(p.component,x,D);else{if(de&128){p.suspense.unmount(x,D);return}Le&&tr(p,null,y,"beforeUnmount"),de&64?p.type.remove(p,y,x,ye,D):U&&!U.hasOnce&&(L!==Ue||ie>0&&ie&64)?Te(U,y,x,!1,!0):(L===Ue&&ie&384||!V&&de&16)&&Te(Q,y,x),D&&Ze(p)}(qe&&(Oe=te&&te.onVnodeUnmounted)||Le)&&$t(()=>{Oe&&ln(Oe,y,p),Le&&tr(p,null,y,"unmounted")},x)},Ze=p=>{const{type:y,el:x,anchor:D,transition:V}=p;if(y===Ue){he(x,D);return}if(y===co){j(p);return}const L=()=>{s(x),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(p.shapeFlag&1&&V&&!V.persisted){const{leave:te,delayLeave:ne}=V,Q=()=>te(x,L);ne?ne(p.el,L,Q):Q()}else L()},he=(p,y)=>{let x;for(;p!==y;)x=g(p),s(p),p=x;s(y)},Se=(p,y,x)=>{const{bum:D,scope:V,job:L,subTree:te,um:ne,m:Q,a:U}=p;Xi(Q),Xi(U),D&&Ts(D),V.stop(),L&&(L.flags|=8,Ye(te,p,y,x)),ne&&$t(ne,y),$t(()=>{p.isUnmounted=!0},y)},Te=(p,y,x,D=!1,V=!1,L=0)=>{for(let te=L;te<p.length;te++)Ye(p[te],y,x,D,V)},E=p=>{if(p.shapeFlag&6)return E(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=g(p.anchor||p.el),x=y&&y[Ul];return x?g(x):y};let ee=!1;const Y=(p,y,x)=>{let D;p==null?y._vnode&&(Ye(y._vnode,null,null,!0),D=y._vnode.component):I(y._vnode||null,p,y,null,null,null,x),y._vnode=p,ee||(ee=!0,Di(D),Dl(),ee=!1)},ye={p:I,um:Ye,m:lt,r:Ze,mt:He,mc:ke,pc:$e,pbc:X,n:E,o:e};return{render:Y,hydrate:void 0,createApp:Ed(Y)}}function lo({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 nr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Vd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function pi(e,t,n=!1){const r=e.children,s=t.children;if(De(r)&&De(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=xn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&pi(i,a)),a.type===Ys&&(a.patchFlag===-1&&(a=s[o]=xn(a)),a.el=i.el),a.type===Pt&&!a.el&&(a.el=i.el)}}function Wd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hc(t)}function Xi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function pc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?pc(t.subTree):null}const mc=e=>e.__isSuspense;function qd(e,t){t&&t.pendingBranch?De(e)?t.effects.push(...e):t.effects.push(e):Qu(e)}const Ue=Symbol.for("v-fgt"),Ys=Symbol.for("v-txt"),Pt=Symbol.for("v-cmt"),co=Symbol.for("v-stc"),ts=[];let Kt=null;function b(e=!1){ts.push(Kt=e?null:[])}function Kd(){ts.pop(),Kt=ts[ts.length-1]||null}let as=1;function Os(e,t=!1){as+=e,e<0&&Kt&&t&&(Kt.hasOnce=!0)}function gc(e){return e.dynamicChildren=as>0?Kt||Sr:null,Kd(),as>0&&Kt&&Kt.push(e),e}function S(e,t,n,r,s,o){return gc(m(e,t,n,r,s,o,!0))}function mt(e,t,n,r,s){return gc(Ee(e,t,n,r,s,!0))}function ls(e){return e?e.__v_isVNode===!0:!1}function ar(e,t){return e.type===t.type&&e.key===t.key}const vc=({key:e})=>e??null,Cs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Nt(e)||Ve(e)?{i:Et,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===Ue?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vc(t),ref:t&&Cs(t),scopeId:Bl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Et};return a?(mi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=bt(n)?8:16),as>0&&!i&&Kt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Kt.push(l),l}const Ee=Gd;function Gd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Xl)&&(e=Pt),ls(e)){const a=Vn(e,t,!0);return n&&mi(a,n),as>0&&!o&&Kt&&(a.shapeFlag&6?Kt[Kt.indexOf(e)]=a:Kt.push(a)),a.patchFlag=-2,a}if(rf(e)&&(e=e.__vccOpts),t){t=zd(t);let{class:a,style:l}=t;a&&!bt(a)&&(t.class=ht(a)),ot(l)&&(ui(l)&&!De(l)&&(l=xt({},l)),t.style=fr(l))}const i=bt(e)?1:mc(e)?128:Vl(e)?64:ot(e)?4:Ve(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function zd(e){return e?ui(e)||ac(e)?xt({},e):e:null}function Vn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?yc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&vc(d),ref:t&&t.ref?n&&o?De(o)?o.concat(Cs(t)):[o,Cs(t)]:Cs(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ue?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vn(e.ssContent),ssFallback:e.ssFallback&&Vn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&is(u,l.clone(u)),u}function Yd(e=" ",t=0){return Ee(Ys,null,e,t)}function ce(e="",t=!1){return t?(b(),mt(Pt,null,e)):Ee(Pt,null,e)}function fn(e){return e==null||typeof e=="boolean"?Ee(Pt):De(e)?Ee(Ue,null,e.slice()):ls(e)?xn(e):Ee(Ys,null,String(e))}function xn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vn(e)}function mi(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(De(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),mi(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!ac(t)?t._ctx=Et:s===3&&Et&&(Et.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:Et},n=32):(t=String(t),r&64?(n=16,t=[Yd(t)]):n=8);e.children=t,e.shapeFlag|=n}function yc(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=ht([t.class,r.class]));else if(s==="style")t.style=fr([t.style,r.style]);else if(Ls(s)){const o=t[s],i=r[s];i&&o!==i&&!(De(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function ln(e,t,n,r=null){sn(e,t,7,[n,r])}const Jd=nc();let Qd=0;function Xd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Jd,o={uid:Qd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new _u(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:cc(r,s),emitsOptions:rc(r,s),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:r.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Id.bind(null,o),e.ce&&e.ce(o),o}let Ot=null;const gi=()=>Ot||Et;let Ns,Ho;{const e=Hs(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Ns=t("__VUE_INSTANCE_SETTERS__",n=>Ot=n),Ho=t("__VUE_SSR_SETTERS__",n=>cs=n)}const ps=e=>{const t=Ot;return Ns(e),e.scope.on(),()=>{e.scope.off(),Ns(t)}},Zi=()=>{Ot&&Ot.scope.off(),Ns(null)};function wc(e){return e.vnode.shapeFlag&4}let cs=!1;function Zd(e,t=!1,n=!1){t&&Ho(t);const{props:r,children:s}=e.vnode,o=wc(e);Nd(e,r,o,t),Bd(e,s,n||t);const i=o?ef(e,t):void 0;return t&&Ho(!1),i}function ef(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,yd);const{setup:r}=n;if(r){In();const s=e.setupContext=r.length>1?_c(e):null,o=ps(e),i=hs(r,e,0,[e.props,s]),a=dl(i);if(Rn(),o(),(a||e.sp)&&!Er(e)&&Jl(e),a){if(i.then(Zi,Zi),t)return i.then(l=>{ea(e,l)}).catch(l=>{Ws(l,e,0)});e.asyncDep=i}else ea(e,i)}else bc(e)}function ea(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ot(t)&&(e.setupState=Ol(t)),bc(e)}function bc(e,t,n){const r=e.type;e.render||(e.render=r.render||mn);{const s=ps(e);In();try{_d(e)}finally{Rn(),s()}}}const tf={get(e,t){return Mt(e,"get",""),e[t]}};function _c(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,tf),slots:e.slots,emit:e.emit,expose:t}}function Js(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ol(Hu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in es)return es[n](e)},has(t,n){return n in t||n in es}})):e.proxy}function nf(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function rf(e){return Ve(e)&&"__vccOpts"in e}const le=(e,t)=>Ku(e,t,cs);function vi(e,t,n){try{Os(-1);const r=arguments.length;return r===2?ot(t)&&!De(t)?ls(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ls(n)&&(n=[n]),Ee(e,t,n))}finally{Os(1)}}const sf="3.5.30";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.30
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let Uo;const ta=typeof window<"u"&&window.trustedTypes;if(ta)try{Uo=ta.createPolicy("vue",{createHTML:e=>e})}catch{}const kc=Uo?e=>Uo.createHTML(e):e=>e,of="http://www.w3.org/2000/svg",af="http://www.w3.org/1998/Math/MathML",Sn=typeof document<"u"?document:null,na=Sn&&Sn.createElement("template"),lf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Sn.createElementNS(of,e):t==="mathml"?Sn.createElementNS(af,e):n?Sn.createElement(e,{is:n}):Sn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Sn.createTextNode(e),createComment:e=>Sn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{na.innerHTML=kc(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=na.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Dn="transition",Vr="animation",us=Symbol("_vtc"),Tc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},cf=xt({},ql,Tc),uf=e=>(e.displayName="Transition",e.props=cf,e),Sc=uf((e,{slots:t})=>vi(sd,df(e),t)),rr=(e,t=[])=>{De(e)?e.forEach(n=>n(...t)):e&&e(...t)},ra=e=>e?De(e)?e.some(t=>t.length>1):e.length>1:!1;function df(e){const t={};for(const re in e)re in Tc||(t[re]=e[re]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,P=ff(s),I=P&&P[0],B=P&&P[1],{onBeforeEnter:z,onEnter:O,onEnterCancelled:H,onLeave:j,onLeaveCancelled:ae,onBeforeAppear:ue=z,onAppear:fe=O,onAppearCancelled:ke=H}=t,se=(re,Be,He,Ge)=>{re._enterCancelled=Ge,sr(re,Be?u:a),sr(re,Be?d:i),He&&He()},X=(re,Be)=>{re._isLeaving=!1,sr(re,f),sr(re,_),sr(re,g),Be&&Be()},me=re=>(Be,He)=>{const Ge=re?fe:O,Ae=()=>se(Be,re,He);rr(Ge,[Be,Ae]),sa(()=>{sr(Be,re?l:o),kn(Be,re?u:a),ra(Ge)||oa(Be,r,I,Ae)})};return xt(t,{onBeforeEnter(re){rr(z,[re]),kn(re,o),kn(re,i)},onBeforeAppear(re){rr(ue,[re]),kn(re,l),kn(re,d)},onEnter:me(!1),onAppear:me(!0),onLeave(re,Be){re._isLeaving=!0;const He=()=>X(re,Be);kn(re,f),re._enterCancelled?(kn(re,g),la(re)):(la(re),kn(re,g)),sa(()=>{re._isLeaving&&(sr(re,f),kn(re,_),ra(j)||oa(re,r,B,He))}),rr(j,[re,He])},onEnterCancelled(re){se(re,!1,void 0,!0),rr(H,[re])},onAppearCancelled(re){se(re,!0,void 0,!0),rr(ke,[re])},onLeaveCancelled(re){X(re),rr(ae,[re])}})}function ff(e){if(e==null)return null;if(ot(e))return[uo(e.enter),uo(e.leave)];{const t=uo(e);return[t,t]}}function uo(e){return hu(e)}function kn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[us]||(e[us]=new Set)).add(t)}function sr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[us];n&&(n.delete(t),n.size||(e[us]=void 0))}function sa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hf=0;function oa(e,t,n,r){const s=e._endId=++hf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=pf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=_=>{_.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function pf(e,t){const n=window.getComputedStyle(e),r=P=>(n[P]||"").split(", "),s=r(`${Dn}Delay`),o=r(`${Dn}Duration`),i=ia(s,o),a=r(`${Vr}Delay`),l=r(`${Vr}Duration`),d=ia(a,l);let u=null,f=0,g=0;t===Dn?i>0&&(u=Dn,f=i,g=o.length):t===Vr?d>0&&(u=Vr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Dn:Vr:null,g=u?u===Dn?o.length:l.length:0);const _=u===Dn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Dn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:_}}function ia(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>aa(n)+aa(e[r])))}function aa(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function la(e){return(e?e.ownerDocument:document).body.offsetHeight}function mf(e,t,n){const r=e[us];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ca=Symbol("_vod"),gf=Symbol("_vsh"),vf=Symbol(""),yf=/(?:^|;)\s*display\s*:/;function wf(e,t,n){const r=e.style,s=bt(n);let o=!1;if(n&&!s){if(t)if(bt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Es(r,a,"")}else for(const i in t)n[i]==null&&Es(r,i,"");for(const i in n)i==="display"&&(o=!0),Es(r,i,n[i])}else if(s){if(t!==n){const i=r[vf];i&&(n+=";"+i),r.cssText=n,o=yf.test(n)}}else t&&e.removeAttribute("style");ca in e&&(e[ca]=o?r.display:"",e[gf]&&(r.display="none"))}const ua=/\s*!important$/;function Es(e,t,n){if(De(n))n.forEach(r=>Es(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=bf(e,t);ua.test(n)?e.setProperty(Wn(r),n.replace(ua,""),"important"):e[r]=n}}const da=["Webkit","Moz","ms"],fo={};function bf(e,t){const n=fo[t];if(n)return n;let r=Ht(t);if(r!=="filter"&&r in e)return fo[t]=r;r=Fs(r);for(let s=0;s<da.length;s++){const o=da[s]+r;if(o in e)return fo[t]=o}return t}const fa="http://www.w3.org/1999/xlink";function ha(e,t,n,r,s,o=wu(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(fa,t.slice(6,t.length)):e.setAttributeNS(fa,t,n):n==null||o&&!ml(n)?e.removeAttribute(t):e.setAttribute(t,o?"":nn(n)?String(n):n)}function pa(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?kc(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=ml(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function kr(e,t,n,r){e.addEventListener(t,n,r)}function _f(e,t,n,r){e.removeEventListener(t,n,r)}const ma=Symbol("_vei");function kf(e,t,n,r,s=null){const o=e[ma]||(e[ma]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Tf(t);if(r){const d=o[t]=Cf(r,s);kr(e,a,d,l)}else i&&(_f(e,a,i,l),o[t]=void 0)}}const ga=/(?:Once|Passive|Capture)$/;function Tf(e){let t;if(ga.test(e)){t={};let r;for(;r=e.match(ga);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Wn(e.slice(2)),t]}let ho=0;const Sf=Promise.resolve(),xf=()=>ho||(Sf.then(()=>ho=0),ho=Date.now());function Cf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;sn(Ef(r,n.value),t,5,[r])};return n.value=e,n.attached=xf(),n}function Ef(e,t){if(De(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const va=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Af=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?mf(e,r,i):t==="style"?wf(e,n,r):Ls(t)?Zo(t)||kf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):If(e,t,r,i))?(pa(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ha(e,t,r,i,o,t!=="value")):e._isVueCE&&(Rf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(r)))?pa(e,Ht(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),ha(e,t,r,i))};function If(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&va(t)&&Ve(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return va(t)&&bt(n)?!1:t in e}function Rf(e,t){const n=e._def.props;if(!n)return!1;const r=Ht(t);return Array.isArray(n)?n.some(s=>Ht(s)===r):Object.keys(n).some(s=>Ht(s)===r)}const ya=e=>{const t=e.props["onUpdate:modelValue"]||!1;return De(t)?n=>Ts(t,n):t};function $f(e){e.target.composing=!0}function wa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const po=Symbol("_assign");function ba(e,t,n){return t&&(e=e.trim()),n&&(e=ni(e)),e}const Pn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[po]=ya(s);const o=r||s.props&&s.props.type==="number";kr(e,t?"change":"input",i=>{i.target.composing||e[po](ba(e.value,n,o))}),(n||o)&&kr(e,"change",()=>{e.value=ba(e.value,n,o)}),t||(kr(e,"compositionstart",$f),kr(e,"compositionend",wa),kr(e,"change",wa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[po]=ya(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?ni(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Mf=["ctrl","shift","alt","meta"],Pf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Mf.some(n=>e[`${n}Key`]&&!t.includes(n))},ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Pf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Of={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ft=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Wn(s.key);if(t.some(i=>i===o||Of[i]===o))return e(s)}))},Nf=xt({patchProp:Af},lf);let _a;function jf(){return _a||(_a=Hd(Nf))}const Df=((...e)=>{const t=jf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Bf(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Lf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Lf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bf(e){return bt(e)?document.querySelector(e):e}/*!
|
|
18
|
-
* vue-router v4.6.4
|
|
19
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/const Tr=typeof document<"u";function xc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ff(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&xc(e.default)}const rt=Object.assign;function mo(e,t){const n={};for(const r in t){const s=t[r];n[r]=on(s)?s.map(e):e(s)}return n}const ns=()=>{},on=Array.isArray;function ka(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Cc=/#/g,Hf=/&/g,Uf=/\//g,Vf=/=/g,Wf=/\?/g,Ec=/\+/g,qf=/%5B/g,Kf=/%5D/g,Ac=/%5E/g,Gf=/%60/g,Ic=/%7B/g,zf=/%7C/g,Rc=/%7D/g,Yf=/%20/g;function yi(e){return e==null?"":encodeURI(""+e).replace(zf,"|").replace(qf,"[").replace(Kf,"]")}function Jf(e){return yi(e).replace(Ic,"{").replace(Rc,"}").replace(Ac,"^")}function Vo(e){return yi(e).replace(Ec,"%2B").replace(Yf,"+").replace(Cc,"%23").replace(Hf,"%26").replace(Gf,"`").replace(Ic,"{").replace(Rc,"}").replace(Ac,"^")}function Qf(e){return Vo(e).replace(Vf,"%3D")}function Xf(e){return yi(e).replace(Cc,"%23").replace(Wf,"%3F")}function Zf(e){return Xf(e).replace(Uf,"%2F")}function ds(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const eh=/\/$/,th=e=>e.replace(eh,"");function go(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=oh(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ds(i)}}function nh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ta(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function rh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Rr(t.matched[r],n.matched[s])&&$c(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Rr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function $c(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!sh(e[n],t[n]))return!1;return!0}function sh(e,t){return on(e)?Sa(e,t):on(t)?Sa(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Sa(e,t){return on(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function oh(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Ln={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Wo=(function(e){return e.pop="pop",e.push="push",e})({}),vo=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ih(e){if(!e)if(Tr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),th(e)}const ah=/^[^#]+#/;function lh(e,t){return e.replace(ah,"#")+t}function ch(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Qs=()=>({left:window.scrollX,top:window.scrollY});function uh(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=ch(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function xa(e,t){return(history.state?history.state.position-t:-1)+e}const qo=new Map;function dh(e,t){qo.set(e,t)}function fh(e){const t=qo.get(e);return qo.delete(e),t}function hh(e){return typeof e=="string"||e&&typeof e=="object"}function Mc(e){return typeof e=="string"||typeof e=="symbol"}let _t=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Pc=Symbol("");_t.MATCHER_NOT_FOUND+"",_t.NAVIGATION_GUARD_REDIRECT+"",_t.NAVIGATION_ABORTED+"",_t.NAVIGATION_CANCELLED+"",_t.NAVIGATION_DUPLICATED+"";function $r(e,t){return rt(new Error,{type:e,[Pc]:!0},t)}function Tn(e,t){return e instanceof Error&&Pc in e&&(t==null||!!(e.type&t))}const ph=["params","query","hash"];function mh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ph)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function gh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Ec," "),o=s.indexOf("="),i=ds(o<0?s:s.slice(0,o)),a=o<0?null:ds(s.slice(o+1));if(i in t){let l=t[i];on(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Ca(e){let t="";for(let n in e){const r=e[n];if(n=Qf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(on(r)?r.map(s=>s&&Vo(s)):[r&&Vo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=on(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const yh=Symbol(""),Ea=Symbol(""),Xs=Symbol(""),wi=Symbol(""),Ko=Symbol("");function Wr(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Hn(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=g=>{g===!1?l($r(_t.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):hh(g)?l($r(_t.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(u);e.length<3&&(f=f.then(d)),f.catch(g=>l(g))})}function yo(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(xc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Hn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Ff(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Hn(g,n,r,i,a,s)()}))}}return o}function wh(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>Rr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Rr(d,l))||s.push(l))}return[n,r,s]}/*!
|
|
22
|
-
* vue-router v4.6.4
|
|
23
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
24
|
-
* @license MIT
|
|
25
|
-
*/let bh=()=>location.protocol+"//"+location.host;function Oc(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),Ta(a,"")}return Ta(n,e)+r+s}function _h(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const _=Oc(e,location),P=n.value,I=t.value;let B=0;if(g){if(n.value=_,t.value=g,i&&i===P){i=null;return}B=I?g.position-I.position:0}else r(_);s.forEach(z=>{z(n.value,P,{delta:B,type:Wo.pop,direction:B?B>0?vo.forward:vo.back:vo.unknown})})};function l(){i=n.value}function d(g){s.push(g);const _=()=>{const P=s.indexOf(g);P>-1&&s.splice(P,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(rt({},g.state,{scroll:Qs()}),"")}}function f(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:f}}function Aa(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Qs():null}}function kh(e){const{history:t,location:n}=window,r={value:Oc(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:bh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(_){console.error(_),n[u?"replace":"assign"](g)}}function i(l,d){o(l,rt({},t.state,Aa(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=rt({},s.value,t.state,{forward:l,scroll:Qs()});o(u.current,u,!0),o(l,rt({},Aa(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Th(e){e=ih(e);const t=kh(e),n=_h(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=rt({location:"",base:e,go:r,createHref:lh.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Sh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Th(e)}let cr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var St=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(St||{});const xh={type:cr.Static,value:""},Ch=/[a-zA-Z0-9_]/;function Eh(e){if(!e)return[[]];if(e==="/")return[[xh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=St.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===St.Static?o.push({type:cr.Static,value:d}):n===St.Param||n===St.ParamRegExp||n===St.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:cr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==St.ParamRegExp){r=n,n=St.EscapeNext;continue}switch(n){case St.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=St.Param):g();break;case St.EscapeNext:g(),n=r;break;case St.Param:l==="("?n=St.ParamRegExp:Ch.test(l)?g():(f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case St.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=St.ParamRegExpEnd:u+=l;break;case St.ParamRegExpEnd:f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===St.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Ia="[^/]+?",Ah={sensitive:!1,strict:!1,start:!0,end:!0};var Lt=(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})(Lt||{});const Ih=/[.+*?^${}()[\]/\\]/g;function Rh(e,t){const n=rt({},Ah,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Lt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let _=Lt.Segment+(n.sensitive?Lt.BonusCaseSensitive:0);if(g.type===cr.Static)f||(s+="/"),s+=g.value.replace(Ih,"\\$&"),_+=Lt.Static;else if(g.type===cr.Param){const{value:P,repeatable:I,optional:B,regexp:z}=g;o.push({name:P,repeatable:I,optional:B});const O=z||Ia;if(O!==Ia){_+=Lt.BonusCustomRegExp;try{`${O}`}catch(j){throw new Error(`Invalid custom RegExp for param "${P}" (${O}): `+j.message)}}let H=I?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(H=B&&d.length<2?`(?:/${H})`:"/"+H),B&&(H+="?"),s+=H,_+=Lt.Dynamic,B&&(_+=Lt.BonusOptional),I&&(_+=Lt.BonusRepeatable),O===".*"&&(_+=Lt.BonusWildcard)}u.push(_)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Lt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),f={};if(!u)return null;for(let g=1;g<u.length;g++){const _=u[g]||"",P=o[g-1];f[P.name]=_&&P.repeatable?_.split("/"):_}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of g)if(_.type===cr.Static)u+=_.value;else if(_.type===cr.Param){const{value:P,repeatable:I,optional:B}=_,z=P in d?d[P]:"";if(on(z)&&!I)throw new Error(`Provided param "${P}" is an array but it is not repeatable (* or + modifiers)`);const O=on(z)?z.join("/"):z;if(!O)if(B)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${P}"`);u+=O}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function $h(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Lt.Static+Lt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Lt.Static+Lt.Segment?1:-1:0}function Nc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=$h(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Ra(r))return 1;if(Ra(s))return-1}return s.length-r.length}function Ra(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Mh={strict:!1,end:!0,sensitive:!1};function Ph(e,t,n){const r=Rh(Eh(e.path),n),s=rt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Oh(e,t){const n=[],r=new Map;t=ka(Mh,t);function s(f){return r.get(f)}function o(f,g,_){const P=!_,I=Ma(f);I.aliasOf=_&&_.record;const B=ka(t,f),z=[I];if("alias"in f){const j=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of j)z.push(Ma(rt({},I,{components:_?_.record.components:I.components,path:ae,aliasOf:_?_.record:I})))}let O,H;for(const j of z){const{path:ae}=j;if(g&&ae[0]!=="/"){const ue=g.record.path,fe=ue[ue.length-1]==="/"?"":"/";j.path=g.record.path+(ae&&fe+ae)}if(O=Ph(j,g,B),_?_.alias.push(O):(H=H||O,H!==O&&H.alias.push(O),P&&f.name&&!Pa(O)&&i(f.name)),jc(O)&&l(O),I.children){const ue=I.children;for(let fe=0;fe<ue.length;fe++)o(ue[fe],O,_&&_.children[fe])}_=_||O}return H?()=>{i(H)}:ns}function i(f){if(Mc(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Dh(f,n);n.splice(g,0,f),f.record.name&&!Pa(f)&&r.set(f.record.name,f)}function d(f,g){let _,P={},I,B;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw $r(_t.MATCHER_NOT_FOUND,{location:f});B=_.record.name,P=rt($a(g.params,_.keys.filter(H=>!H.optional).concat(_.parent?_.parent.keys.filter(H=>H.optional):[]).map(H=>H.name)),f.params&&$a(f.params,_.keys.map(H=>H.name))),I=_.stringify(P)}else if(f.path!=null)I=f.path,_=n.find(H=>H.re.test(I)),_&&(P=_.parse(I),B=_.record.name);else{if(_=g.name?r.get(g.name):n.find(H=>H.re.test(g.path)),!_)throw $r(_t.MATCHER_NOT_FOUND,{location:f,currentLocation:g});B=_.record.name,P=rt({},g.params,f.params),I=_.stringify(P)}const z=[];let O=_;for(;O;)z.unshift(O.record),O=O.parent;return{name:B,path:I,params:P,matched:z,meta:jh(z)}}e.forEach(f=>o(f));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function $a(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ma(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Nh(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Nh(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Pa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jh(e){return e.reduce((t,n)=>rt(t,n.meta),{})}function Dh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Nc(e,t[o])<0?r=o:n=o+1}const s=Lh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Lh(e){let t=e;for(;t=t.parent;)if(jc(t)&&Nc(e,t)===0)return t}function jc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Oa(e){const t=tn(Xs),n=tn(wi),r=le(()=>{const l=je(e.to);return t.resolve(l)}),s=le(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(Rr.bind(null,u));if(g>-1)return g;const _=Na(l[d-2]);return d>1&&Na(u)===_&&f[f.length-1].path!==_?f.findIndex(Rr.bind(null,l[d-2])):g}),o=le(()=>s.value>-1&&Vh(n.params,r.value.params)),i=le(()=>s.value>-1&&s.value===n.matched.length-1&&$c(n.params,r.value.params));function a(l={}){if(Uh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(ns);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:le(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Bh(e){return e.length===1?e[0]:e}const Fh=At({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:Oa,setup(e,{slots:t}){const n=Vs(Oa(e)),{options:r}=tn(Xs),s=le(()=>({[ja(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[ja(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Bh(t.default(n));return e.custom?o:vi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Hh=Fh;function Uh(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Vh(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!on(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Na(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ja=(e,t,n)=>e??t??n,Wh=At({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=tn(Ko),s=le(()=>e.route||r.value),o=tn(Ea,0),i=le(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=le(()=>s.value.matched[i.value]);Ss(Ea,le(()=>i.value+1)),Ss(yh,a),Ss(Ko,s);const l=N();return yt(()=>[l.value,a.value,e.name],([d,u,f],[g,_,P])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!Rr(u,_)||!g)&&(u.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return Da(n.default,{Component:g,route:d});const _=f.props[u],P=_?_===!0?d.params:typeof _=="function"?_(d):_:null,B=vi(g,rt({},P,t,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Da(n.default,{Component:B,route:d})||B}}});function Da(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const qh=Wh;function Kh(e){const t=Oh(e.routes,e),n=e.parseQuery||gh,r=e.stringifyQuery||Ca,s=e.history,o=Wr(),i=Wr(),a=Wr(),l=Uu(Ln);let d=Ln;Tr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=mo.bind(null,E=>""+E),f=mo.bind(null,Zf),g=mo.bind(null,ds);function _(E,ee){let Y,ye;return Mc(E)?(Y=t.getRecordMatcher(E),ye=ee):ye=E,t.addRoute(ye,Y)}function P(E){const ee=t.getRecordMatcher(E);ee&&t.removeRoute(ee)}function I(){return t.getRoutes().map(E=>E.record)}function B(E){return!!t.getRecordMatcher(E)}function z(E,ee){if(ee=rt({},ee||l.value),typeof E=="string"){const x=go(n,E,ee.path),D=t.resolve({path:x.path},ee),V=s.createHref(x.fullPath);return rt(x,D,{params:g(D.params),hash:ds(x.hash),redirectedFrom:void 0,href:V})}let Y;if(E.path!=null)Y=rt({},E,{path:go(n,E.path,ee.path).path});else{const x=rt({},E.params);for(const D in x)x[D]==null&&delete x[D];Y=rt({},E,{params:f(x)}),ee.params=f(ee.params)}const ye=t.resolve(Y,ee),Me=E.hash||"";ye.params=u(g(ye.params));const p=nh(r,rt({},E,{hash:Jf(Me),path:ye.path})),y=s.createHref(p);return rt({fullPath:p,hash:Me,query:r===Ca?vh(E.query):E.query||{}},ye,{redirectedFrom:void 0,href:y})}function O(E){return typeof E=="string"?go(n,E,l.value.path):rt({},E)}function H(E,ee){if(d!==E)return $r(_t.NAVIGATION_CANCELLED,{from:ee,to:E})}function j(E){return fe(E)}function ae(E){return j(rt(O(E),{replace:!0}))}function ue(E,ee){const Y=E.matched[E.matched.length-1];if(Y&&Y.redirect){const{redirect:ye}=Y;let Me=typeof ye=="function"?ye(E,ee):ye;return typeof Me=="string"&&(Me=Me.includes("?")||Me.includes("#")?Me=O(Me):{path:Me},Me.params={}),rt({query:E.query,hash:E.hash,params:Me.path!=null?{}:E.params},Me)}}function fe(E,ee){const Y=d=z(E),ye=l.value,Me=E.state,p=E.force,y=E.replace===!0,x=ue(Y,ye);if(x)return fe(rt(O(x),{state:typeof x=="object"?rt({},Me,x.state):Me,force:p,replace:y}),ee||Y);const D=Y;D.redirectedFrom=ee;let V;return!p&&rh(r,ye,Y)&&(V=$r(_t.NAVIGATION_DUPLICATED,{to:D,from:ye}),lt(ye,ye,!0,!1)),(V?Promise.resolve(V):X(D,ye)).catch(L=>Tn(L)?Tn(L,_t.NAVIGATION_GUARD_REDIRECT)?L:Je(L):$e(L,D,ye)).then(L=>{if(L){if(Tn(L,_t.NAVIGATION_GUARD_REDIRECT))return fe(rt({replace:y},O(L.to),{state:typeof L.to=="object"?rt({},Me,L.to.state):Me,force:p}),ee||D)}else L=re(D,ye,!0,y,Me);return me(D,ye,L),L})}function ke(E,ee){const Y=H(E,ee);return Y?Promise.reject(Y):Promise.resolve()}function se(E){const ee=he.values().next().value;return ee&&typeof ee.runWithContext=="function"?ee.runWithContext(E):E()}function X(E,ee){let Y;const[ye,Me,p]=wh(E,ee);Y=yo(ye.reverse(),"beforeRouteLeave",E,ee);for(const x of ye)x.leaveGuards.forEach(D=>{Y.push(Hn(D,E,ee))});const y=ke.bind(null,E,ee);return Y.push(y),Te(Y).then(()=>{Y=[];for(const x of o.list())Y.push(Hn(x,E,ee));return Y.push(y),Te(Y)}).then(()=>{Y=yo(Me,"beforeRouteUpdate",E,ee);for(const x of Me)x.updateGuards.forEach(D=>{Y.push(Hn(D,E,ee))});return Y.push(y),Te(Y)}).then(()=>{Y=[];for(const x of p)if(x.beforeEnter)if(on(x.beforeEnter))for(const D of x.beforeEnter)Y.push(Hn(D,E,ee));else Y.push(Hn(x.beforeEnter,E,ee));return Y.push(y),Te(Y)}).then(()=>(E.matched.forEach(x=>x.enterCallbacks={}),Y=yo(p,"beforeRouteEnter",E,ee,se),Y.push(y),Te(Y))).then(()=>{Y=[];for(const x of i.list())Y.push(Hn(x,E,ee));return Y.push(y),Te(Y)}).catch(x=>Tn(x,_t.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function me(E,ee,Y){a.list().forEach(ye=>se(()=>ye(E,ee,Y)))}function re(E,ee,Y,ye,Me){const p=H(E,ee);if(p)return p;const y=ee===Ln,x=Tr?history.state:{};Y&&(ye||y?s.replace(E.fullPath,rt({scroll:y&&x&&x.scroll},Me)):s.push(E.fullPath,Me)),l.value=E,lt(E,ee,Y,y),Je()}let Be;function He(){Be||(Be=s.listen((E,ee,Y)=>{if(!Se.listening)return;const ye=z(E),Me=ue(ye,Se.currentRoute.value);if(Me){fe(rt(Me,{replace:!0,force:!0}),ye).catch(ns);return}d=ye;const p=l.value;Tr&&dh(xa(p.fullPath,Y.delta),Qs()),X(ye,p).catch(y=>Tn(y,_t.NAVIGATION_ABORTED|_t.NAVIGATION_CANCELLED)?y:Tn(y,_t.NAVIGATION_GUARD_REDIRECT)?(fe(rt(O(y.to),{force:!0}),ye).then(x=>{Tn(x,_t.NAVIGATION_ABORTED|_t.NAVIGATION_DUPLICATED)&&!Y.delta&&Y.type===Wo.pop&&s.go(-1,!1)}).catch(ns),Promise.reject()):(Y.delta&&s.go(-Y.delta,!1),$e(y,ye,p))).then(y=>{y=y||re(ye,p,!1),y&&(Y.delta&&!Tn(y,_t.NAVIGATION_CANCELLED)?s.go(-Y.delta,!1):Y.type===Wo.pop&&Tn(y,_t.NAVIGATION_ABORTED|_t.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),me(ye,p,y)}).catch(ns)}))}let Ge=Wr(),Ae=Wr(),be;function $e(E,ee,Y){Je(E);const ye=Ae.list();return ye.length?ye.forEach(Me=>Me(E,ee,Y)):console.error(E),Promise.reject(E)}function gt(){return be&&l.value!==Ln?Promise.resolve():new Promise((E,ee)=>{Ge.add([E,ee])})}function Je(E){return be||(be=!E,He(),Ge.list().forEach(([ee,Y])=>E?Y(E):ee()),Ge.reset()),E}function lt(E,ee,Y,ye){const{scrollBehavior:Me}=e;if(!Tr||!Me)return Promise.resolve();const p=!Y&&fh(xa(E.fullPath,0))||(ye||!Y)&&history.state&&history.state.scroll||null;return Gt().then(()=>Me(E,ee,p)).then(y=>y&&uh(y)).catch(y=>$e(y,E,ee))}const Ye=E=>s.go(E);let Ze;const he=new Set,Se={currentRoute:l,listening:!0,addRoute:_,removeRoute:P,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:I,resolve:z,options:e,push:j,replace:ae,go:Ye,back:()=>Ye(-1),forward:()=>Ye(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:gt,install(E){E.component("RouterLink",Hh),E.component("RouterView",qh),E.config.globalProperties.$router=Se,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),Tr&&!Ze&&l.value===Ln&&(Ze=!0,j(s.location).catch(ye=>{}));const ee={};for(const ye in Ln)Object.defineProperty(ee,ye,{get:()=>l.value[ye],enumerable:!0});E.provide(Xs,Se),E.provide(wi,Ml(ee)),E.provide(Ko,l);const Y=E.unmount;he.add(E),E.unmount=function(){he.delete(E),he.size<1&&(d=Ln,Be&&Be(),Be=null,l.value=Ln,Ze=!1,be=!1),Y()}}};function Te(E){return E.reduce((ee,Y)=>ee.then(()=>se(Y)),Promise.resolve())}return Se}function Gh(){return tn(Xs)}function zh(e){return tn(wi)}const La=768;function Dc(){const e=N(typeof window<"u"?window.innerWidth<La:!1);let t=null;function n(r){e.value=r.matches}return qn(()=>{t=window.matchMedia(`(max-width: ${La-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Gs(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Yh={key:0,class:"desktop-sidebar"},Jh={class:"desktop-main"},Ba="codex-web-local.sidebar-width.v1",Qh=260,Xh=620,Fa=320,Zh=At({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Dc();function r(d){return Math.min(Xh,Math.max(Qh,d))}function s(){if(typeof window>"u")return Fa;const d=window.localStorage.getItem(Ba),u=Number(d);return Number.isFinite(u)?r(u):Fa}const o=N(s()),i=le(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(Ba,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=P=>{const I=P.clientX-u;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)}return(d,u)=>(b(),S("div",{class:ht(["desktop-layout",{"is-mobile":je(n)}]),style:fr(i.value)},[je(n)?(b(),mt($s,{key:0,to:"body"},[Ee(Sc,{name:"drawer"},{default:at(()=>[e.isSidebarCollapsed?ce("",!0):(b(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=ze(()=>{},["stop"]))},[pn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ce("",!0),je(n)?ce("",!0):(b(),S(Ue,{key:1},[e.isSidebarCollapsed?ce("",!0):(b(),S("aside",Yh,[pn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ce("",!0):(b(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Jh,[pn(d.$slots,"content",{},void 0)])],6))}}),Xe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ep=Xe(Zh,[["__scopeId","data-v-df29c633"]]),tp={},np={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rp(e,t){return b(),S("svg",np,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const bi=Xe(tp,[["render",rp]]),sp={},op={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ip(e,t){return b(),S("svg",op,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Lc=Xe(sp,[["render",ip]]),ap={},lp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cp(e,t){return b(),S("svg",lp,[...t[0]||(t[0]=[m("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const qr=Xe(ap,[["render",cp]]),up={},dp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function fp(e,t){return b(),S("svg",dp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const js=Xe(up,[["render",fp]]),hp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mp(e,t){return b(),S("svg",pp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const gp=Xe(hp,[["render",mp]]),vp={},yp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wp(e,t){return b(),S("svg",yp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const bp=Xe(vp,[["render",wp]]),_p={},kp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tp(e,t){return b(),S("svg",kp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const wo=Xe(_p,[["render",Tp]]),Sp={},xp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cp(e,t){return b(),S("svg",xp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const bo=Xe(Sp,[["render",Cp]]),Ep={key:0,class:"sidebar-menu-row-left"},Ap={class:"sidebar-menu-row-main"},Ip={key:1,class:"sidebar-menu-row-right"},Rp={key:0,class:"sidebar-menu-row-right-default"},$p={key:1,class:"sidebar-menu-row-right-hover"},Mp=At({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=wd(),r=le(()=>!!n.left),s=le(()=>!!n.right),o=le(()=>!!n["right-hover"]),i=le(()=>s.value||o.value);return(a,l)=>(b(),mt(gd(t.as),yc({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:at(()=>[r.value?(b(),S("span",Ep,[pn(a.$slots,"left",{},void 0,!0)])):ce("",!0),m("span",Ap,[pn(a.$slots,"default",{},void 0,!0)]),i.value?(b(),S("span",Ip,[s.value?(b(),S("span",Rp,[pn(a.$slots,"right",{},void 0,!0)])):ce("",!0),o.value?(b(),S("span",$p,[pn(a.$slots,"right-hover",{},void 0,!0)])):ce("",!0)])):ce("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),or=Xe(Mp,[["__scopeId","data-v-daeca4df"]]),Pp={class:"thread-tree-root"},Op={key:0,class:"pinned-section"},Np={class:"thread-list"},jp={class:"thread-left-stack"},Dp=["data-state"],Lp=["onClick"],Bp=["onClick"],Fp={class:"thread-row-title-wrap"},Hp={class:"thread-row-title"},Up={class:"thread-row-time"},Vp=["onClick"],Wp=["onClick"],qp=["onClick"],Kp=["aria-expanded"],Gp=["data-active"],zp={key:0},Yp=["data-active"],Jp={key:0},Qp={key:1,class:"thread-tree-no-results"},Xp={key:2,class:"thread-tree-loading"},Zp={key:3,class:"thread-list thread-list-global"},em={class:"thread-left-stack"},tm=["data-state"],nm=["onClick"],rm=["onClick"],sm={class:"thread-row-title-wrap"},om={class:"thread-row-title"},im={class:"thread-row-time"},am=["onClick"],lm=["onClick"],cm=["onClick"],um=["data-project-name","data-expanded","data-dragging"],dm={class:"project-icon-stack"},fm={class:"project-icon-folder"},hm={class:"project-icon-chevron"},pm=["data-dragging-handle","onMousedown"],mm={class:"project-title"},gm={class:"project-hover-controls"},vm=["onClick"],ym=["onClick"],wm=["onClick"],bm=["onInput"],_m=["aria-label","title","onClick"],km={key:0,class:"thread-list"},Tm={class:"thread-left-stack"},Sm=["data-state"],xm=["onClick"],Cm=["onClick"],Em={class:"thread-row-title-wrap"},Am={class:"thread-row-title"},Im={class:"thread-row-time"},Rm=["onClick"],$m=["onClick"],Mm=["onClick"],Pm=["onClick"],Om={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Nm=["onKeydown"],jm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Dm={class:"rename-thread-subtitle"},Lm=4,Ha=6,Ua="codex-web-local.thread-view-mode.v1",Va="codex-web-local.collapsed-projects.v1",Bm=At({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=N({}),o=N({}),i=N([]),a=N(""),l=N(""),d=N("actions"),u=N(""),f=N(!1),g=N(""),_=N(""),P=N(null),I=N(!1),B=N(""),z=N(""),O=N(null),H=N(null),j=N(null);let ae=null,ue=null;const fe=N(""),ke=N({}),se=new Map,X=new Map,me=new Map,re=new WeakMap,Be=N(null),He=N(!1),Ge=N($e()),Ae=typeof window<"u"?new ResizeObserver(k=>{for(const C of k){const R=C.target,q=re.get(R);q&&jt(q,R)}}):null;function be(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Va);if(!k)return{};const C=JSON.parse(k);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Ua)==="chronological"?"chronological":"project"}o.value=be(),yt(o,k=>{typeof window>"u"||window.localStorage.setItem(Va,JSON.stringify(k))},{deep:!0}),yt(Ge,k=>{typeof window>"u"||window.localStorage.setItem(Ua,k)});const gt=le(()=>n.searchQuery.trim().toLowerCase()),Je=le(()=>gt.value.length>0);function lt(k){if(!Je.value)return!0;const C=gt.value;return k.title.toLowerCase().includes(C)||k.preview.toLowerCase().includes(C)}const Ye=le(()=>Je.value?n.groups.map(k=>({...k,threads:k.threads.filter(lt)})).filter(k=>k.threads.length>0):n.groups),Ze=le(()=>Ge.value==="chronological"),he=le(()=>{const k=Ye.value,C=[];for(const R of k)for(const q of R.threads)p(q.id)||C.push(q);return C.sort((R,q)=>{const Fe=new Date(R.updatedAtIso||R.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-Fe})}),Se=le(()=>{const k=new Map;for(const C of n.groups)for(const R of C.threads)k.set(R.id,R);return k}),Te=le(()=>i.value.map(k=>Se.value.get(k)??null).filter(k=>k!==null).filter(lt)),E=le(()=>{const k=j.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),R=C>k.fromIndex?C-1:C,q=Math.max(0,Math.min(R,n.groups.length-1));return q===k.fromIndex?null:q}),ee=le(()=>{const C=(Je.value?Ye.value:n.groups).map(It=>It.projectName),R=j.value,q=E.value;if(!R||q===null)return C;const Fe=[...C],[kt]=Fe.splice(R.fromIndex,1);return kt?(Fe.splice(q,0,kt),Fe):C}),Y=le(()=>{const k={};let C=0;for(const R of ee.value)k[R]=C,C+=ct(R);return k}),ye=le(()=>{let k=0;for(const C of ee.value)k+=ct(C);return{height:`${Math.max(0,k)}px`}});function Me(k){const C=new Date(k).getTime();if(Number.isNaN(C))return"n/a";const R=Math.abs(Date.now()-C);if(R<6e4)return"now";const q=Math.floor(R/6e4);if(q<60)return`${q}m`;const Fe=Math.floor(q/60);return Fe<24?`${Fe}h`:`${Math.floor(Fe/24)}d`}function p(k){return i.value.includes(k)}function y(k){if(p(k)){i.value=i.value.filter(C=>C!==k);return}i.value=[k,...i.value]}function x(k){r("select",k)}function D(k){return`start new thread ${qe(k)}`}function V(k){r("start-new-thread",k)}function L(k){l.value===k&&ne()}function te(k){return l.value===k}function ne(){l.value=""}function Q(k){if(l.value===k){ne();return}l.value=k}function U(k,C){g.value=k,_.value=C,f.value=!0,ne(),Gt(()=>{var R,q;(R=P.value)==null||R.focus(),(q=P.value)==null||q.select()})}function de(){f.value=!1,g.value="",_.value=""}function ie(){const k=g.value,C=_.value.trim();!k||!C||(r("rename-thread",{threadId:k,title:C}),de())}function ge(k,C){B.value=k,z.value=C,I.value=!0,ne()}function ve(){I.value=!1,B.value="",z.value=""}function Le(){const k=B.value;k&&(i.value=i.value.filter(C=>C!==k),r("archive",k),ve())}function qe(k){return n.projectDisplayNameById[k]??k}function Oe(k){return a.value===k}function nt(){a.value="",d.value="actions",u.value=""}function dt(){He.value=!He.value}function F(k){Ge.value=k,He.value=!1}function W(k){if(a.value===k){nt();return}a.value=k,d.value="actions",u.value=qe(k)}function J(k){a.value=k,d.value="rename",u.value=qe(k)}function Ke(k){r("rename-project",{projectName:k,displayName:u.value})}function w(k){r("remove-project",k),nt()}function A(k,C){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const R=n.groups.findIndex(kt=>kt.projectName===C);if(R<0)return;const q=k.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(R+q,n.groups.length-1));Fe!==R&&(k.preventDefault(),r("reorder-project",{projectName:C,toIndex:Fe}))}function $(k){return s.value[k]===!0}function Z(k){return o.value[k]===!0}function xe(k){s.value={...s.value,[k]:!$(k)}}function Ce(k){if(fe.value===k){fe.value="";return}o.value={...o.value,[k]:!Z(k)}}function ct(k){const C=ke.value[k]??0,R=j.value,Fe=((R==null?void 0:R.projectName)===k?R.groupHeight:null)??C,kt=Z(k)?0:Ha;return Math.max(0,Fe+kt)}function et(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){X.set(k,R);return}X.delete(k)}function it(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){me.set(k,R);return}me.delete(k)}function ut(k){const C=a.value;if(!C)return!1;const R=X.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Fe=k.target;return Fe instanceof Node?R.contains(Fe):!1}function Pe(k){const C=l.value;if(!C)return!1;const R=me.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Fe=k.target;return Fe instanceof Node?R.contains(Fe):!1}function Re(k){if(He.value){const C=Be.value,R=typeof k.composedPath=="function"?k.composedPath():[];!!C&&(R.includes(C)||k.target instanceof Node&&C.contains(k.target))||(He.value=!1)}a.value&&(ut(k)||nt(),l.value&&(Pe(k)||ne()))}function gn(k){a.value&&!ut(k)&&nt(),l.value&&!Pe(k)&&ne()}function Ut(){He.value&&(He.value=!1),a.value&&nt(),l.value&&ne()}function Pr(){window.addEventListener("pointerdown",Re,{capture:!0}),window.addEventListener("focusin",gn,{capture:!0}),window.addEventListener("blur",Ut)}function Gn(){window.removeEventListener("pointerdown",Re,{capture:!0}),window.removeEventListener("focusin",gn,{capture:!0}),window.removeEventListener("blur",Ut)}function jt(k,C){const R=C.getBoundingClientRect().height;if(!Number.isFinite(R)||R<=0)return;const q=ke.value[k];q!==void 0&&Math.abs(q-R)<.5||(ke.value={...ke.value,[k]:R})}function zn(k,C){const R=se.get(k);R&&R!==C&&Ae&&Ae.unobserve(R);const q=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(q){se.set(k,q),re.set(q,k),jt(k,q),Ae==null||Ae.observe(q);return}R&&(Ae==null||Ae.unobserve(R)),se.delete(k)}function Yn(k,C){if(k.button!==0||H.value||j.value)return;const R=n.groups.findIndex(It=>It.projectName===C),q=se.get(C);if(R<0||!q)return;const Fe=q.getBoundingClientRect(),kt=Z(C)?0:Ha;H.value={projectName:C,fromIndex:R,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+kt},k.preventDefault(),Or()}function Or(){window.addEventListener("mousemove",pr),window.addEventListener("mouseup",mr),window.addEventListener("keydown",vn)}function hr(){window.removeEventListener("mousemove",pr),window.removeEventListener("mouseup",mr),window.removeEventListener("keydown",vn)}function pr(k){ae={clientX:k.clientX,clientY:k.clientY},Nr()}function mr(k){Jn({clientX:k.clientX,clientY:k.clientY});const C=j.value;if(C&&E.value!==null){const R=n.groups.findIndex(q=>q.projectName===C.projectName);if(R>=0){const q=E.value;q!==R&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}Qt()}function vn(k){k.key==="Escape"&&(!H.value&&!j.value||(k.preventDefault(),Qt()))}function Qt(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,H.value=null,j.value=null,fe.value="",hr()}function Nr(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const k=ae;ae=null,Jn(k)}))}function Jn(k){const C=H.value;if(!j.value&&C){const R=k.clientX-C.startClientX,q=k.clientY-C.startClientY;if(Math.hypot(R,q)<Lm)return;nt(),fe.value=C.projectName,j.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:k.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}j.value&&gr(k)}function gr(k){const C=j.value;if(!C)return;if(C.ghostTop=k.clientY-C.pointerOffsetY,!jr(k)){C.dropTargetIndexFull=null;return}const R=k.clientY,q=O.value;if(!q){C.dropTargetIndexFull=null;return}const Fe=q.getBoundingClientRect(),kt=new Map(n.groups.map((M,oe)=>[M.projectName,oe])),It=n.groups.map(M=>M.projectName).filter(M=>M!==C.projectName);let Xt=0,Xn=n.groups.length;for(const M of It){const oe=kt.get(M);if(oe===void 0)continue;const Ne=ct(M),Tt=Fe.top+Xt+Ne/2;if(R<Tt){Xn=oe;break}Xt+=Ne}C.dropTargetIndexFull=Xn}function jr(k){const C=O.value;if(!C)return!1;const R=C.getBoundingClientRect(),q=k.clientX>=R.left&&k.clientX<=R.right,Fe=k.clientY>=R.top-32&&k.clientY<=R.bottom+32;return q&&Fe}function Qn(k){var C;return((C=j.value)==null?void 0:C.projectName)===k}function vr(k){const C=j.value,R=Y.value[k]??0,q=a.value===k;return!C||C.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${R}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Nn(k){return k.threads.filter(C=>!p(C.id))}function Dr(k){if(Je.value)return Nn(k);if(Z(k.projectName))return[];const C=Nn(k);return $(k.projectName)?C:C.slice(0,10)}function Lr(k){return Je.value?!1:!Z(k.projectName)&&Nn(k).length>10}function Br(k){return Nn(k).length>0}function yn(k){return k.inProgress?"working":k.unread?"unread":"idle"}yt(()=>n.groups.map(k=>k.projectName),k=>{var Fe,kt;const C=((Fe=j.value)==null?void 0:Fe.projectName)??((kt=H.value)==null?void 0:kt.projectName)??"";C&&!n.groups.some(It=>It.projectName===C)&&Qt();const R=new Set(k),q=Object.fromEntries(Object.entries(ke.value).filter(([It])=>R.has(It)));Object.keys(q).length!==Object.keys(ke.value).length&&(ke.value=q)});const Fr=le(()=>He.value||a.value!=="");return yt(Fr,k=>{if(k){Pr();return}Gn()}),Kn(()=>{for(const k of se.values())Ae==null||Ae.unobserve(k);se.clear(),X.clear(),Gn(),Qt()}),(k,C)=>(b(),S("section",Pp,[Te.value.length>0?(b(),S("section",Op,[m("ul",Np,[(b(!0),S(Ue,null,wt(Te.value,R=>(b(),S("li",{key:R.id,class:"thread-row-item"},[Ee(or,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":p(R.id),onMouseleave:q=>L(R.id)},{left:at(()=>[m("span",jp,[R.inProgress||R.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":yn(R)},null,8,Dp)):ce("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>y(R.id)},[Ee(bo,{class:"thread-icon"})],8,Lp)])]),right:at(()=>[m("span",Up,_e(Me(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":at(()=>[m("div",{ref_for:!0,ref:q=>it(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(q=>Q(R.id),["stop"])},[Ee(qr,{class:"thread-icon"})],8,Vp),te(R.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>U(R.id,R.title)}," Rename thread ",8,Wp),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ge(R.id,R.title)}," Delete thread ",8,qp)])):ce("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>x(R.id)},[m("span",Fp,[m("span",Hp,_e(R.title),1),R.hasWorktree?(b(),mt(wo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ce("",!0)])],8,Bp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ce("",!0),Ee(or,{as:"header",class:"thread-tree-header-row"},{right:at(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Be,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":He.value,"aria-label":"Organize threads",title:"Organize threads",onClick:dt},[Ee(qr,{class:"thread-icon"})],8,Kp),He.value?(b(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=ze(()=>{},["stop"]))},[C[11]||(C[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Ge.value==="project",type:"button",onClick:C[1]||(C[1]=R=>F("project"))},[C[9]||(C[9]=m("span",null,"By project",-1)),Ge.value==="project"?(b(),S("span",zp,"✓")):ce("",!0)],8,Gp),m("button",{class:"organize-menu-item","data-active":Ge.value==="chronological",type:"button",onClick:C[2]||(C[2]=R=>F("chronological"))},[C[10]||(C[10]=m("span",null,"Chronological list",-1)),Ge.value==="chronological"?(b(),S("span",Jp,"✓")):ce("",!0)],8,Yp)])):ce("",!0)],512)]),default:at(()=>[C[12]||(C[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Je.value&&Ye.value.length===0?(b(),S("p",Qp,"No matching threads")):e.isLoading&&e.groups.length===0?(b(),S("p",Xp,"Loading threads...")):Ze.value?(b(),S("ul",Zp,[(b(!0),S(Ue,null,wt(he.value,R=>(b(),S("li",{key:R.id,class:"thread-row-item"},[Ee(or,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":p(R.id),onMouseleave:q=>L(R.id)},{left:at(()=>[m("span",em,[R.inProgress||R.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":yn(R)},null,8,tm)):ce("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>y(R.id)},[Ee(bo,{class:"thread-icon"})],8,nm)])]),right:at(()=>[m("span",im,_e(Me(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":at(()=>[m("div",{ref_for:!0,ref:q=>it(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(q=>Q(R.id),["stop"])},[Ee(qr,{class:"thread-icon"})],8,am),te(R.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>U(R.id,R.title)}," Rename thread ",8,lm),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ge(R.id,R.title)}," Delete thread ",8,cm)])):ce("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>x(R.id)},[m("span",sm,[m("span",om,_e(R.title),1),R.hasWorktree?(b(),mt(wo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ce("",!0)])],8,rm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),S("div",{key:4,ref_key:"groupsContainerRef",ref:O,class:"thread-tree-groups",style:fr(ye.value)},[(b(!0),S(Ue,null,wt(Ye.value,R=>(b(),S("article",{key:R.projectName,ref_for:!0,ref:q=>zn(R.projectName,q),class:"project-group","data-project-name":R.projectName,"data-expanded":!Z(R.projectName),"data-dragging":Qn(R.projectName),style:fr(vr(R.projectName))},[Ee(or,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>Ce(R.projectName),onKeydown:[q=>A(q,R.projectName),Ft(ze(q=>Ce(R.projectName),["prevent"]),["enter"]),Ft(ze(q=>Ce(R.projectName),["prevent"]),["space"])]},{left:at(()=>[m("span",dm,[m("span",fm,[Z(R.projectName)?(b(),mt(gp,{key:0,class:"thread-icon"})):(b(),mt(bp,{key:1,class:"thread-icon"}))]),m("span",hm,[Z(R.projectName)?(b(),mt(Lc,{key:0,class:"thread-icon"})):(b(),mt(bi,{key:1,class:"thread-icon"}))])])]),right:at(()=>[m("div",gm,[m("div",{ref_for:!0,ref:q=>et(R.projectName,q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ze(q=>W(R.projectName),["stop"])},[Ee(qr,{class:"thread-icon"})],8,vm),Oe(R.projectName)?(b(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=ze(()=>{},["stop"]))},[d.value==="actions"?(b(),S(Ue,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:q=>J(R.projectName)}," Edit name ",8,ym),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>w(R.projectName)}," Remove ",8,wm)],64)):(b(),S(Ue,{key:1},[C[13]||(C[13]=m("label",{class:"project-menu-label"},"Project name",-1)),Mn(m("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>Ke(R.projectName)},null,40,bm),[[Pn,u.value]])],64))])):ce("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":D(R.projectName),title:D(R.projectName),onClick:ze(q=>V(R.projectName),["stop"])},[Ee(js,{class:"thread-icon"})],8,_m)])]),default:at(()=>[m("span",{class:"project-main-button","data-dragging-handle":Qn(R.projectName),onMousedown:ze(q=>Yn(q,R.projectName),["left"])},[m("span",mm,_e(qe(R.projectName)),1)],40,pm)]),_:2},1032,["onClick","onKeydown"]),Br(R)?(b(),S("ul",km,[(b(!0),S(Ue,null,wt(Dr(R),q=>(b(),S("li",{key:q.id,class:"thread-row-item"},[Ee(or,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":p(q.id),onMouseleave:Fe=>L(q.id)},{left:at(()=>[m("span",Tm,[q.inProgress||q.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":yn(q)},null,8,Sm)):ce("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>y(q.id)},[Ee(bo,{class:"thread-icon"})],8,xm)])]),right:at(()=>[m("span",Im,_e(Me(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":at(()=>[m("div",{ref_for:!0,ref:Fe=>it(q.id,Fe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ze(Fe=>Q(q.id),["stop"])},[Ee(qr,{class:"thread-icon"})],8,Rm),te(q.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Fe=>U(q.id,q.title)}," Rename thread ",8,$m),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>ge(q.id,q.title)}," Delete thread ",8,Mm)])):ce("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Fe=>x(q.id)},[m("span",Em,[m("span",Am,_e(q.title),1),q.hasWorktree?(b(),mt(wo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ce("",!0)])],8,Cm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),mt(or,{key:1,as:"p",class:"project-empty-row"},{left:at(()=>[...C[14]||(C[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:at(()=>[C[15]||(C[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Lr(R)?(b(),mt(or,{key:2,class:"thread-show-more-row"},{left:at(()=>[...C[16]||(C[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:at(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:q=>xe(R.projectName)},_e($(R.projectName)?"Show less":"Show more"),9,Pm)]),_:2},1024)):ce("",!0)],12,um))),128))],4)),(b(),mt($s,{to:"body"},[f.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:ze(de,["self"])},[m("div",Om,[C[17]||(C[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[18]||(C[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Mn(m("input",{ref_key:"renameThreadInputRef",ref:P,"onUpdate:modelValue":C[8]||(C[8]=R=>_.value=R),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ft(ze(ie,["prevent"]),["enter"]),Ft(ze(de,["prevent"]),["esc"])]},null,40,Nm),[[Pn,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:de},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ie},"Save")])])])):ce("",!0)])),(b(),mt($s,{to:"body"},[I.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:ze(ve,["self"])},[m("div",jm,[C[19]||(C[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Dm,' This will archive the thread "'+_e(z.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:ve},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Le},"Delete")])])])):ce("",!0)]))]))}}),Fm=Xe(Bm,[["__scopeId","data-v-1257b57b"]]),Hm={class:"content-header"},Um={class:"content-leading"},Vm={class:"content-title"},Wm={class:"content-actions"},qm=At({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(b(),S("header",Hm,[m("div",Um,[pn(t.$slots,"leading",{},void 0)]),m("h1",Vm,_e(e.title),1),m("div",Wm,[pn(t.$slots,"actions",{},void 0)])]))}}),Km=Xe(qm,[["__scopeId","data-v-66ee223c"]]),Gm={},zm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ym(e,t){return b(),S("svg",zm,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const _i=Xe(Gm,[["render",Ym]]),Jm={},Qm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xm(e,t){return b(),S("svg",Qm,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Zm=Xe(Jm,[["render",Xm]]),eg={class:"conversation-root"},tg={key:0,class:"conversation-loading"},ng={key:1,class:"conversation-empty"},rg={class:"message-row"},sg={class:"message-stack"},og={class:"request-card"},ig={class:"request-title"},ag={class:"request-meta"},lg={key:0,class:"request-reason"},cg={key:1,class:"request-actions"},ug=["onClick"],dg=["onClick"],fg=["onClick"],hg=["onClick"],pg={key:2,class:"request-actions"},mg=["onClick"],gg=["onClick"],vg=["onClick"],yg=["onClick"],wg={key:3,class:"request-user-input"},bg={class:"request-question-title"},_g={key:0,class:"request-question-text"},kg=["value","onChange"],Tg=["value"],Sg=["value","onInput"],xg=["onClick"],Cg={key:4,class:"request-actions"},Eg=["onClick"],Ag=["onClick"],Ig={key:5,class:"request-actions"},Rg=["onClick"],$g=["onClick"],Mg=["data-role","data-message-type"],Pg={key:0,class:"message-row","data-role":"system"},Og={class:"message-stack","data-role":"system"},Ng=["onClick"],jg={class:"cmd-label"},Dg={class:"cmd-status"},Lg={class:"cmd-output-inner"},Bg={class:"cmd-output"},Fg=["data-role","data-message-type"],Hg=["data-role"],Ug=["data-role"],Vg=["data-role"],Wg=["onClick"],qg=["src"],Kg={key:1,class:"message-file-attachments"},Gg=["href","title"],zg=["data-role"],Yg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Jg=["onClick"],Qg={class:"worked-separator-text"},Xg={key:0,class:"worked-details"},Zg=["onClick"],ev={class:"cmd-label"},tv={class:"cmd-status"},nv={class:"cmd-output-inner"},rv={class:"cmd-output"},sv={key:1,class:"message-text-flow"},ov={key:0,class:"message-text"},iv={key:0},av=["href","title"],lv={key:2,class:"message-inline-code"},cv={key:1,class:"message-text"},uv=["onClick"],dv=["src","alt","onError"],fv=["onClick"],hv={key:0,class:"conversation-item conversation-item-overlay"},pv={class:"message-row"},mv={class:"message-stack"},gv={class:"live-overlay-inline","aria-live":"polite"},vv={class:"live-overlay-label"},yv={key:1,class:"live-overlay-error"},wv=["src"],bv=16,_v=At({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=N(new Set),r=N(new Set),s=N(new Set),o=N({});function i(w){return w.messageType==="commandExecution"&&!!w.commandExecution}function a(w){var A;return((A=w.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(w.id)?!0:n.value.has(w.id)}function l(w){return r.value.has(w.id)}function d(w){var $;if((($=w.commandExecution)==null?void 0:$.status)==="inProgress")return;const A=new Set(n.value);A.has(w.id)?A.delete(w.id):A.add(w.id),n.value=A}function u(w){const A=new Set(s.value);A.has(w.id)?A.delete(w.id):A.add(w.id),s.value=A}function f(w){return s.value.has(w.id)}function g(w){const A=w.commandExecution;if(!A)return"";switch(A.status){case"inProgress":return"⟳ Running";case"completed":return A.exitCode===0?"✓ Completed":`✗ Exit ${A.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(w){var $,Z;const A=($=w.commandExecution)==null?void 0:$.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((Z=w.commandExecution)==null?void 0:Z.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function P(w){const A=new Set(r.value);A.add(w),r.value=A,setTimeout(()=>{const $=new Set(r.value);$.delete(w),r.value=$},1e3)}function I(w,A){const $=[];for(let Z=A-1;Z>=0;Z--){const xe=w[Z];if(xe.messageType==="commandExecution")$.unshift(xe);else if(xe.role==="user"||xe.messageType==="worked")break}return $}const B=e,z=t,O=N(null),H=N(null),j=N(null),ae=N(""),ue=N({}),fe=N({});let ke=0,se=0,X=0;const me=new WeakSet,re=N(new Set);function Be(w){if(!w||/\s/u.test(w)||w.endsWith("/")||w.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(w))return!1;const A=w.startsWith("/"),$=/^[A-Za-z]:[\\/]/u.test(w),Z=w.startsWith("./")||w.startsWith("../")||w.startsWith("~/"),xe=w.includes("/")||w.includes("\\");return A||$||Z||xe}function He(w){return w.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||w}function Ge(w){if(!w)return null;let A=w,$=null;const Z=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(Z)A=Z[1],$=Number(Z[2]);else{const xe=A.match(/^(.*):(\d+)(?::\d+)?$/u);xe&&(A=xe[1],$=Number(xe[2]))}return Be(A)?{path:A,line:$}:null}function Ae(w){if(!w.includes("`"))return[{kind:"text",value:w}];const A=[];let $=0,Z=0;for(;$<w.length;){if(w[$]!=="`"){$+=1;continue}let xe=1;for(;$+xe<w.length&&w[$+xe]==="`";)xe+=1;const Ce="`".repeat(xe);let ct=$+xe,et=-1;for(;ct<w.length;){const ut=w.indexOf(Ce,ct);if(ut<0)break;const Pe=ut>0&&w[ut-1]==="`",Re=ut+xe<w.length&&w[ut+xe]==="`",gn=w.slice($+xe,ut).includes(`
|
|
26
|
-
`);if(!Pe&&!Re&&!gn){et=ut;break}ct=ut+1}if(et<0){$+=xe;continue}$>Z&&A.push({kind:"text",value:w.slice(Z,$)});const it=w.slice($+xe,et);if(it.length>0){const ut=Ge(it);if(ut){const Pe=ut.line?`${ut.path}:${String(ut.line)}`:ut.path;A.push({kind:"file",value:it,path:ut.path,displayPath:Pe,downloadName:He(ut.path)})}else A.push({kind:"code",value:it})}else A.push({kind:"text",value:`${Ce}${Ce}`});$=et+xe,Z=$}return Z<w.length&&A.push({kind:"text",value:w.slice(Z)}),A}function be(w){const A=w.trim();if(!A)return"";if(A.startsWith("data:")||A.startsWith("blob:")||A.startsWith("http://")||A.startsWith("https://")||A.startsWith("/codex-local-image?"))return A;if(A.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(A)}`;const $=A.startsWith("/"),Z=/^[A-Za-z]:[\\/]/u.test(A);return $||Z?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function $e(w){const A=w.trim();if(!A)return"#";const $=xe=>xe.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(xe),Z=Ge(A);return Z!=null&&Z.path&&$(Z.path)?`/codex-local-browse${encodeURI(Z.path)}`:$(A)?`/codex-local-browse${encodeURI(A)}`:"#"}function gt(w){if(!w.includes(")return[{kind:"text",value:w}];const A=[],$=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let Z=0;for(const xe of w.matchAll($)){const[Ce,ct,et]=xe;if(typeof xe.index!="number")continue;const it=xe.index,ut=it+Ce.length,Pe=be(et.trim());Pe&&(it>Z&&A.push({kind:"text",value:w.slice(Z,it)}),A.push({kind:"image",url:Pe,alt:ct.trim(),markdown:Ce}),Z=ut)}return Z<w.length&&A.push({kind:"text",value:w.slice(Z)}),A.length>0?A:[{kind:"text",value:w}]}function Je(w){return w!==null&&typeof w=="object"&&!Array.isArray(w)?w:null}function lt(w){const A=new Date(w);return Number.isNaN(A.getTime())?w:A.toLocaleTimeString()}function Ye(w){const A=Je(w.params),$=A==null?void 0:A.reason;return typeof $=="string"?$.trim():""}function Ze(w,A){return`${String(w)}:${A}`}function he(w){const A=Je(w.params),$=Array.isArray(A==null?void 0:A.questions)?A.questions:[],Z=[];for(const xe of $){const Ce=Je(xe);if(!Ce)continue;const ct=typeof Ce.id=="string"?Ce.id:"";if(!ct)continue;const et=Array.isArray(Ce.options)?Ce.options.map(it=>Je(it)).map(it=>it==null?void 0:it.label).filter(it=>typeof it=="string"&&it.length>0):[];Z.push({id:ct,header:typeof Ce.header=="string"?Ce.header:"",question:typeof Ce.question=="string"?Ce.question:"",isOther:Ce.isOther===!0,options:et})}return Z}function Se(w,A,$){const Z=Ze(w,A),xe=ue.value[Z];return typeof xe=="string"&&xe.length>0?xe:$}function Te(w,A){const $=Ze(w,A);return fe.value[$]??""}function E(w,A,$){const Z=$.target;if(!(Z instanceof HTMLSelectElement))return;const xe=Ze(w,A);ue.value={...ue.value,[xe]:Z.value}}function ee(w,A,$){const Z=$.target;if(!(Z instanceof HTMLInputElement))return;const xe=Ze(w,A);fe.value={...fe.value,[xe]:Z.value}}function Y(w,A){z("respondServerRequest",{id:w,result:{decision:A}})}function ye(w){const A=he(w),$={};for(const Z of A){const xe=Se(w.id,Z.id,Z.options[0]||""),Ce=Te(w.id,Z.id).trim(),ct=[xe,Ce].map(et=>et.trim()).filter(et=>et.length>0);$[Z.id]={answers:ct}}z("respondServerRequest",{id:w.id,result:{answers:$}})}function Me(w){z("respondServerRequest",{id:w,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function p(w){z("respondServerRequest",{id:w,result:{success:!0,contentItems:[]}})}function y(w){z("respondServerRequest",{id:w,result:{}})}function x(w){z("respondServerRequest",{id:w,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function D(w){return!(w.role!=="user"&&w.role!=="assistant"||typeof w.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function V(w){D(w)&&z("rollback",{turnIndex:w.turnIndex})}function L(){const w=O.value,A=H.value;!w||!A||(w.scrollTop=w.scrollHeight,A.scrollIntoView({block:"end"}))}function te(w){return w.scrollHeight-(w.scrollTop+w.clientHeight)<=bv}function ne(w){if(!B.activeThreadId)return;const A=Math.max(w.scrollHeight-w.clientHeight,0),$=A>0?Math.min(Math.max(w.scrollTop/A,0),1):1;z("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:w.scrollTop,isAtBottom:te(w),scrollRatio:$}})}function Q(){const w=O.value;if(!w)return;const A=B.scrollState;if(!A||A.isAtBottom){U();return}const $=Math.max(w.scrollHeight-w.clientHeight,0),Z=typeof A.scrollRatio=="number"?A.scrollRatio*$:A.scrollTop;w.scrollTop=Math.min(Math.max(Z,0),$),ne(w)}function U(){const w=O.value;w&&(L(),ne(w))}function de(){const w=B.scrollState;return!w||w.isAtBottom===!0}function ie(){if(!de()){X=0,se=0;return}if(U(),X-=1,X<=0){se=0;return}se=requestAnimationFrame(ie)}function ge(w=6){de()&&(se&&(cancelAnimationFrame(se),se=0),X=Math.max(w,1),se=requestAnimationFrame(ie))}function ve(){ge(3)}function Le(){if(!de())return;const w=O.value;if(!w)return;const A=w.querySelectorAll("img.message-image-preview");for(const $ of A)$.complete||me.has($)||(me.add($),$.addEventListener("load",ve,{once:!0}),$.addEventListener("error",ve,{once:!0}))}async function qe(){await Gt(),ke&&cancelAnimationFrame(ke),ke=requestAnimationFrame(()=>{ke=0,Q(),Le(),ge()})}yt(()=>B.messages,async w=>{if(!B.isLoading){for(const A of w){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const $=o.value[A.id],Z=A.commandExecution.status;$==="inProgress"&&Z!=="inProgress"&&P(A.id),o.value[A.id]=Z}await qe()}}),yt(()=>B.liveOverlay,async w=>{w&&(await Gt(),U(),ge(8))},{deep:!0}),yt(()=>B.isLoading,async w=>{w||await qe()}),yt(()=>B.activeThreadId,()=>{ae.value="",re.value=new Set},{flush:"post"});function Oe(){const w=O.value;!w||B.isLoading||ne(w)}function nt(w){ae.value=be(w)}function dt(w,A){return`${w}:${String(A)}`}function F(w,A){const $=new Set(re.value);$.add(dt(w,A)),re.value=$}function W(w,A){return re.value.has(dt(w,A))}function J(){ae.value=""}function Ke(){const w=j.value;w&&(w.scrollTop=w.scrollHeight)}return yt(()=>{var w;return(w=B.liveOverlay)==null?void 0:w.reasoningText},async w=>{w&&(await Gt(),Ke())}),Kn(()=>{ke&&cancelAnimationFrame(ke),se&&cancelAnimationFrame(se)}),(w,A)=>(b(),S("section",eg,[e.isLoading?(b(),S("p",tg,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(b(),S("p",ng," No messages in this thread yet. ")):(b(),S("ul",{key:2,ref_key:"conversationListRef",ref:O,class:"conversation-list",onScroll:Oe},[(b(!0),S(Ue,null,wt(e.pendingRequests,$=>(b(),S("li",{key:`server-request:${$.id}`,class:"conversation-item conversation-item-request"},[m("div",rg,[m("div",sg,[m("article",og,[m("p",ig,_e($.method),1),m("p",ag,"Request #"+_e($.id)+" · "+_e(lt($.receivedAtIso)),1),Ye($)?(b(),S("p",lg,_e(Ye($)),1)):ce("",!0),$.method==="item/commandExecution/requestApproval"?(b(),S("section",cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Z=>Y($.id,"accept")},"Accept",8,ug),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"acceptForSession")},"Accept for Session",8,dg),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"decline")},"Decline",8,fg),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"cancel")},"Cancel",8,hg)])):$.method==="item/fileChange/requestApproval"?(b(),S("section",pg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Z=>Y($.id,"accept")},"Accept",8,mg),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"acceptForSession")},"Accept for Session",8,gg),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"decline")},"Decline",8,vg),m("button",{type:"button",class:"request-button",onClick:Z=>Y($.id,"cancel")},"Cancel",8,yg)])):$.method==="item/tool/requestUserInput"?(b(),S("section",wg,[(b(!0),S(Ue,null,wt(he($),Z=>(b(),S("div",{key:`${$.id}:${Z.id}`,class:"request-question"},[m("p",bg,_e(Z.header||Z.question),1),Z.header&&Z.question?(b(),S("p",_g,_e(Z.question),1)):ce("",!0),m("select",{class:"request-select",value:Se($.id,Z.id,Z.options[0]||""),onChange:xe=>E($.id,Z.id,xe)},[(b(!0),S(Ue,null,wt(Z.options,xe=>(b(),S("option",{key:`${$.id}:${Z.id}:${xe}`,value:xe},_e(xe),9,Tg))),128))],40,kg),Z.isOther?(b(),S("input",{key:1,class:"request-input",type:"text",value:Te($.id,Z.id),placeholder:"Other answer",onInput:xe=>ee($.id,Z.id,xe)},null,40,Sg)):ce("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:Z=>ye($)}," Submit Answers ",8,xg)])):$.method==="item/tool/call"?(b(),S("section",Cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Z=>Me($.id)},"Fail Tool Call",8,Eg),m("button",{type:"button",class:"request-button",onClick:Z=>p($.id)},"Success (Empty)",8,Ag)])):(b(),S("section",Ig,[m("button",{type:"button",class:"request-button request-button-primary",onClick:Z=>y($.id)},"Return Empty Result",8,Rg),m("button",{type:"button",class:"request-button",onClick:Z=>x($.id)},"Reject Request",8,$g)]))])])])]))),128)),(b(!0),S(Ue,null,wt(e.messages,$=>{var Z,xe;return b(),S("li",{key:$.id,class:ht(["conversation-item",{"conversation-item-rollbackable":D($)}]),"data-role":$.role,"data-message-type":$.messageType||""},[i($)?(b(),S("div",Pg,[m("div",Og,[m("button",{type:"button",class:ht(["cmd-row",[_($),{"cmd-expanded":a($)}]]),onClick:Ce=>d($)},[m("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a($)}])},"▶",2),m("code",jg,_e(((Z=$.commandExecution)==null?void 0:Z.command)||"(command)"),1),m("span",Dg,_e(g($)),1)],10,Ng),m("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a($),"cmd-output-collapsing":l($)}])},[m("div",Lg,[m("pre",Bg,_e(((xe=$.commandExecution)==null?void 0:xe.aggregatedOutput)||"(no output)"),1)])],2)])])):(b(),S("div",{key:1,class:"message-row","data-role":$.role,"data-message-type":$.messageType||""},[m("div",{class:"message-stack","data-role":$.role},[m("article",{class:"message-body","data-role":$.role},[$.images&&$.images.length>0?(b(),S("ul",{key:0,class:"message-image-list","data-role":$.role},[(b(!0),S(Ue,null,wt($.images,Ce=>(b(),S("li",{key:Ce,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:ct=>nt(Ce)},[m("img",{class:"message-image-preview",src:be(Ce),alt:"Message image preview",loading:"lazy"},null,8,qg)],8,Wg)]))),128))],8,Vg)):ce("",!0),$.fileAttachments&&$.fileAttachments.length>0?(b(),S("div",Kg,[(b(!0),S(Ue,null,wt($.fileAttachments,Ce=>(b(),S("span",{key:Ce.path,class:"message-file-chip"},[A[1]||(A[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:$e(Ce.path),target:"_blank",rel:"noopener noreferrer",title:Ce.path},_e(Ce.path),9,Gg)]))),128))])):ce("",!0),$.text.length>0?(b(),S("article",{key:2,class:"message-card","data-role":$.role},[$.messageType==="worked"?(b(),S("div",Yg,[m("button",{type:"button",class:"worked-separator",onClick:Ce=>u($)},[A[2]||(A[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:ht(["worked-chevron",{"worked-chevron-open":f($)}])},"▶",2),m("p",Qg,_e($.text),1),A[3]||(A[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Jg),f($)?(b(),S("div",Xg,[(b(!0),S(Ue,null,wt(I(e.messages,e.messages.indexOf($)),Ce=>{var ct,et;return b(),S("div",{key:`worked-cmd-${Ce.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:ht(["cmd-row",[_(Ce),{"cmd-expanded":a(Ce)}]]),onClick:it=>d(Ce)},[m("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a(Ce)}])},"▶",2),m("code",ev,_e(((ct=Ce.commandExecution)==null?void 0:ct.command)||"(command)"),1),m("span",tv,_e(g(Ce)),1)],10,Zg),m("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a(Ce),"cmd-output-collapsing":l(Ce)}])},[m("div",nv,[m("pre",rv,_e(((et=Ce.commandExecution)==null?void 0:et.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ce("",!0)])):(b(),S("div",sv,[(b(!0),S(Ue,null,wt(gt($.text),(Ce,ct)=>(b(),S(Ue,{key:`block-${ct}`},[Ce.kind==="text"?(b(),S("p",ov,[(b(!0),S(Ue,null,wt(Ae(Ce.value),(et,it)=>(b(),S(Ue,{key:`seg-${ct}-${it}`},[et.kind==="text"?(b(),S("span",iv,_e(et.value),1)):et.kind==="file"?(b(),S("a",{key:1,class:"message-file-link",href:$e(et.path),target:"_blank",rel:"noopener noreferrer",title:et.path},_e(et.displayPath),9,av)):(b(),S("code",lv,_e(et.value),1))],64))),128))])):W($.id,ct)?(b(),S("p",cv,_e(Ce.markdown),1)):(b(),S("button",{key:2,class:"message-image-button",type:"button",onClick:et=>nt(Ce.url)},[m("img",{class:"message-image-preview message-markdown-image",src:Ce.url,alt:Ce.alt||"Embedded message image",loading:"lazy",onError:et=>F($.id,ct)},null,40,dv)],8,uv))],64))),128))]))],8,zg)):ce("",!0)],8,Ug),D($)?(b(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:Ce=>V($)},[Ee(Zm,{class:"rollback-icon"}),A[4]||(A[4]=m("span",{class:"rollback-label"},"Rollback",-1))],8,fv)):ce("",!0)],8,Hg)],8,Fg))],10,Mg)}),128)),e.liveOverlay?(b(),S("li",hv,[m("div",pv,[m("div",mv,[m("article",gv,[m("p",vv,_e(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(b(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:j},_e(e.liveOverlay.reasoningText),513)):ce("",!0),e.liveOverlay.errorText?(b(),S("p",yv,_e(e.liveOverlay.errorText),1)):ce("",!0)])])])])):ce("",!0),m("li",{ref_key:"bottomAnchorRef",ref:H,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(b(),S("div",{key:3,class:"image-modal-backdrop",onClick:J},[m("div",{class:"image-modal-content",onClick:A[0]||(A[0]=ze(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:J},[Ee(_i,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,wv)])])):ce("",!0)]))}}),kv=Xe(_v,[["__scopeId","data-v-454a8117"]]);function Tv(e){var u;const t=N("idle"),n=N(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var P;const g=o,_=(r==null?void 0:r.mimeType)||((P=g[0])==null?void 0:P.type)||"audio/webm";d(),t.value="idle",l(g,_)},r.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,g){var P;if(f.length===0)return;const _=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",B=`----codex-transcribe-${crypto.randomUUID()}`,z=new Uint8Array(await _.arrayBuffer()),O=new TextEncoder,H=[];H.push(O.encode(`--${B}\r
|
|
27
|
-
`)),H.push(O.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
|
|
28
|
-
`)),H.push(O.encode(`Content-Type: ${g}\r
|
|
29
|
-
\r
|
|
30
|
-
`)),H.push(z),H.push(O.encode(`\r
|
|
31
|
-
--${B}--\r
|
|
32
|
-
`));let j=0;for(const X of H)j+=X.byteLength;const ae=new Uint8Array(j);let ue=0;for(const X of H)ae.set(X,ue),ue+=X.byteLength;const fe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${B}`},body:ae});if(!fe.ok)throw new Error(`Transcription failed: ${fe.status}`);const se=((await fe.json()).text??"").trim();se.length>0&&e.onTranscript(se)}catch(I){(P=e.onError)==null||P.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return Kn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Wa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class An extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function ki(e,t){const n=Wa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Wa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Mr(e,t,n){return e instanceof An?e:e instanceof Error?new An(e.message||t,{code:"unknown_error",method:n}):new An(t,{code:"unknown_error",method:n})}function Bc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Sv(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new An(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new An(ki(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new An(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function qa(e){const t=Bc(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function xv(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=qa(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=qa(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function Cv(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new An(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new An(ki(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Ev(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new An(ki(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Bc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Ka(e){return new Date(e*1e3).toISOString()}function Av(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Iv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Rv=/^##\s+(.+?):\s+(.+?)\s*$/,$v=/^#\s*files mentioned by the user\s*:?\s*$/i;function Mv(e){var s,o;const t=e.split(`
|
|
33
|
-
`).findIndex(i=>$v.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
34
|
-
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Rv);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function Pv(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const s=r.index+r[0].length;return e.slice(s).trim()}function Ov(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],s=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&s.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:Iv(l),isUnhandled:!0});const o=n.join(`
|
|
35
|
-
`),i=Mv(o);return{text:Pv(o),images:r,fileAttachments:i,rawBlocks:s}}function Nv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Ov(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="commandExecution"){const t=e,n=jv(t.status),r=typeof t.command=="string"?t.command:"",s=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:s,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function jv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Dv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Lv(e){const t=Dv(e);return t.length>0?t:"Untitled thread"}function Fc(e){return(e==null?void 0:e.status)==="inProgress"}function Bv(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 Fc(r)}function Fv(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,r=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:e.id,title:Lv(e),projectName:Av(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Ka(e.createdAt),updatedAtIso:Ka(e.updatedAt),preview:e.preview,unread:!1,inProgress:Bv(e)}}function Hv(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((s,o)=>new Date(o.updatedAtIso).getTime()-new Date(s.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const s=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-s})}function Uv(e){const t=e.data.map(Fv);return Hv(t)}function Hc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Nv(i))n.push({...a,turnIndex:r})}return n}function Vv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Fc(t.at(-1))}async function qt(e,t){try{return await Sv(e,t)}catch(n){throw Mr(n,`RPC ${e} failed`,e)}}function Wv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function qv(){const e=await qt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Uv(e)}async function Kv(e){const t=await qt("thread/read",{threadId:e,includeTurns:!0});return{messages:Hc(t),inProgress:Vv(t)}}async function Gv(){try{return await qv()}catch(e){throw Mr(e,"Failed to load thread groups","thread/list")}}async function zv(e){try{return await Kv(e)}catch(t){throw Mr(t,`Failed to load thread ${e}`,"thread/read")}}function Yv(e){return xv(e)}async function Jv(e,t){await Cv({id:e,...t})}async function Qv(){return Ev()}async function _o(e){await qt("thread/resume",{threadId:e})}async function Xv(e){await qt("thread/archive",{threadId:e})}async function Zv(e,t){await qt("thread/name/set",{threadId:e,name:t})}async function Ga(e,t){const n=await qt("thread/rollback",{threadId:e,numTurns:t});return Hc(n)}function ey(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function za(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await qt("thread/start",n),s=ey(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Mr(n,"Failed to start a new thread","thread/start")}}function ty(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
36
|
-
`;for(const r of t)n+=`
|
|
37
|
-
## ${r.label}: ${r.path}
|
|
38
|
-
`;return`${n}
|
|
39
|
-
## My request for Codex:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
`}async function ko(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:ty(t,i)}];for(const f of n){const g=f.trim();g&&l.push({type:"image",url:g,image_url:g})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const d=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await qt("turn/start",u)}catch(a){throw Mr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function ny(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 qt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Mr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function ry(e){await qt("setDefaultModel",{model:e})}async function sy(){const e=await qt("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function oy(){const e=await qt("config/read",{}),t=e.config.model??"",n=Wv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function iy(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Ya(){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 iy(n.data)}async function Ja(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function ay(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function ly(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Ti(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function cy(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Ti(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function uy(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=Ti(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}function Ti(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function dy(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function To(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function fy(e,t){var n;try{return((n=(await qt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function hy(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await qt("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function py(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const my={},gy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vy(e,t){return b(),S("svg",gy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const yy=Xe(my,[["render",vy]]),wy={},by={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _y(e,t){return b(),S("svg",by,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const ky=Xe(wy,[["render",_y]]),Ty={},Sy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xy(e,t){return b(),S("svg",Sy,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const Cy=Xe(Ty,[["render",xy]]),Ey=["disabled"],Ay={class:"composer-dropdown-value"},Iy={class:"composer-dropdown-menu"},Ry={key:0,class:"composer-dropdown-search-wrap"},$y=["placeholder","onKeydown"],My={class:"composer-dropdown-options",role:"listbox"},Py=["onClick"],Oy={key:0,class:"composer-dropdown-empty"},Ny={key:1,class:"composer-dropdown-add-wrap"},jy=["placeholder","onKeydown"],Dy=At({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(null),a=N(!1),l=N(""),d=N(!1),u=N(""),f=le(()=>{var me;const X=n.options.find(re=>re.value===n.modelValue);return X?X.label:((me=n.placeholder)==null?void 0:me.trim())||""}),g=le(()=>n.openDirection??"down"),_=le(()=>n.enableSearch===!0),P=le(()=>n.showAddAction===!0),I=le(()=>{var X;return((X=n.searchPlaceholder)==null?void 0:X.trim())||"Quick search projects"}),B=le(()=>{var X;return((X=n.addActionLabel)==null?void 0:X.trim())||"Add new project"}),z=le(()=>{var X;return((X=n.addPlaceholder)==null?void 0:X.trim())||"Project name or absolute path"}),O=le(()=>{const X=l.value.trim().toLowerCase();return X?n.options.filter(me=>me.label.toLowerCase().includes(X)||me.value.toLowerCase().includes(X)):n.options});function H(){n.disabled||(a.value=!a.value)}function j(X){r("update:modelValue",X),a.value=!1,l.value=""}function ae(){var X;d.value=!0,u.value=((X=n.defaultAddValue)==null?void 0:X.trim())||"",Gt(()=>{var me;return(me=i.value)==null?void 0:me.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function fe(){const X=u.value.trim();X&&(r("add",X),d.value=!1,u.value="",a.value=!1,l.value="")}function ke(){d.value=!1,u.value="",a.value=!1,l.value=""}function se(X){if(!a.value)return;const me=s.value;if(!me)return;const re=X.target;re instanceof Node&&(me.contains(re)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return yt(a,X=>{if(!X){d.value=!1,u.value="";return}_.value&&Gt(()=>{var me;return(me=o.value)==null?void 0:me.focus()})}),qn(()=>{window.addEventListener("pointerdown",se)}),Kn(()=>{window.removeEventListener("pointerdown",se)}),(X,me)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:H},[m("span",Ay,_e(f.value),1),Ee(bi,{class:"composer-dropdown-chevron"})],8,Ey),a.value?(b(),S("div",{key:0,class:ht(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[m("div",Iy,[_.value?(b(),S("div",Ry,[Mn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":me[0]||(me[0]=re=>l.value=re),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Ft(ze(ue,["prevent"]),["esc"])},null,40,$y),[[Pn,l.value]])])):ce("",!0),m("ul",My,[(b(!0),S(Ue,null,wt(O.value,re=>(b(),S("li",{key:re.value},[m("button",{class:ht(["composer-dropdown-option",{"is-selected":re.value===e.modelValue}]),type:"button",onClick:Be=>j(re.value)},_e(re.label),11,Py)]))),128)),O.value.length===0?(b(),S("li",Oy," No matching projects ")):ce("",!0)]),P.value?(b(),S("div",Ny,[d.value?(b(),S(Ue,{key:0},[Mn(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":me[1]||(me[1]=re=>u.value=re),class:"composer-dropdown-add-input",type:"text",placeholder:z.value,onKeydown:[Ft(ze(fe,["prevent"]),["enter"]),Ft(ze(ke,["prevent"]),["esc"])]},null,40,jy),[[Pn,u.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:fe},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ke},"Cancel")])],64)):(b(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},_e(B.value),1))])):ce("",!0)])],2)):ce("",!0)],512))}}),Go=Xe(Dy,[["__scopeId","data-v-7cfa2012"]]),Ly=["disabled"],By={class:"search-dropdown-value"},Fy={class:"search-dropdown-search-wrap"},Hy=["placeholder","onKeydown"],Uy={key:0,class:"search-dropdown-list",role:"listbox"},Vy=["onClick","onPointerenter"],Wy={class:"search-dropdown-option-check"},qy={class:"search-dropdown-option-label"},Ky={key:0,class:"search-dropdown-option-desc"},Gy={key:1,class:"search-dropdown-empty"},zy=At({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(!1),a=N(""),l=N(0),d=le(()=>n.openDirection??"down"),u=le(()=>new Set(n.selectedValues)),f=le(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const O=n.options.find(H=>H.value===n.selectedValues[0]);return(O==null?void 0:O.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=le(()=>{const O=a.value.toLowerCase().trim();return O?n.options.filter(H=>{var j;return H.label.toLowerCase().includes(O)||(((j=H.description)==null?void 0:j.toLowerCase().includes(O))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Gt(()=>{var O;return(O=o.value)==null?void 0:O.focus()})))}function P(O){r("toggle",O.value,!u.value.has(O.value))}function I(O){g.value.length!==0&&(l.value=(l.value+O+g.value.length)%g.value.length)}function B(){const O=g.value[l.value];O&&P(O)}function z(O){if(!i.value)return;const H=s.value;if(!H)return;const j=O.target;j instanceof Node&&(H.contains(j)||(i.value=!1))}return yt(a,()=>{l.value=0}),qn(()=>window.addEventListener("pointerdown",z)),Kn(()=>window.removeEventListener("pointerdown",z)),(O,H)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",By,_e(f.value),1),Ee(bi,{class:"search-dropdown-chevron"})],8,Ly),i.value?(b(),S("div",{key:0,class:ht(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[m("div",Fy,[Mn(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":H[0]||(H[0]=j=>a.value=j),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[H[1]||(H[1]=Ft(ze(j=>i.value=!1,["prevent"]),["escape"])),Ft(ze(B,["prevent"]),["enter"]),H[2]||(H[2]=Ft(ze(j=>I(1),["prevent"]),["arrow-down"])),H[3]||(H[3]=Ft(ze(j=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Hy),[[Pn,a.value]])]),g.value.length>0?(b(),S("ul",Uy,[(b(!0),S(Ue,null,wt(g.value,(j,ae)=>(b(),S("li",{key:j.value},[m("button",{class:ht(["search-dropdown-option",{"is-selected":u.value.has(j.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>P(j),onPointerenter:ue=>l.value=ae},[m("span",Wy,_e(u.value.has(j.value)?"✓":""),1),m("span",qy,_e(j.label),1),j.description?(b(),S("span",Ky,_e(j.description),1)):ce("",!0)],42,Vy)]))),128))])):(b(),S("div",Gy,"No results"))],2)):ce("",!0)],512))}}),Yy=Xe(zy,[["__scopeId","data-v-a0f2edd4"]]),Jy={class:"skill-picker-header"},Qy=["onKeydown"],Xy={key:0,class:"skill-picker-list",role:"listbox"},Zy=["onClick","onPointerenter"],ew={class:"skill-picker-name"},tw={key:0,class:"skill-picker-desc"},nw={key:1,class:"skill-picker-empty"},rw=At({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(""),a=N(0),l=le(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),d=le(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return yt(()=>n.visible,g=>{g&&(i.value="",a.value=0,Gt(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),yt(i,()=>{a.value=0}),(g,_)=>e.visible?(b(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:fr(d.value)},[m("div",Jy,[Mn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=P=>i.value=P),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Ft(ze(P=>g.$emit("close"),["prevent"]),["escape"])),Ft(ze(f,["prevent"]),["enter"]),_[2]||(_[2]=Ft(ze(P=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Ft(ze(P=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Qy),[[Pn,i.value]])]),l.value.length>0?(b(),S("ul",Xy,[(b(!0),S(Ue,null,wt(l.value,(P,I)=>(b(),S("li",{key:P.path},[m("button",{class:ht(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:B=>g.$emit("select",P),onPointerenter:B=>a.value=I},[m("span",ew,_e(P.name),1),P.description?(b(),S("span",tw,_e(P.description),1)):ce("",!0)],42,Zy)]))),128))])):(b(),S("div",nw,"No skills found"))],4)):ce("",!0)}}),sw=Xe(rw,[["__scopeId","data-v-d6a08788"]]),ow={key:0,class:"thread-composer-attachments"},iw=["src","alt"],aw=["aria-label","disabled","onClick"],lw={key:1,class:"thread-composer-file-chips"},cw=["title"],uw=["aria-label","disabled","onClick"],dw={key:2,class:"thread-composer-skill-chips"},fw={class:"thread-composer-skill-chip-name"},hw=["aria-label","onClick"],pw={class:"thread-composer-input-wrap"},mw={key:0,class:"thread-composer-file-mentions"},gw=["onMousedown"],vw={key:1,class:"thread-composer-file-mention-icon-markdown"},yw={class:"thread-composer-file-mention-text"},ww={class:"thread-composer-file-mention-name"},bw={key:0,class:"thread-composer-file-mention-dir"},_w={key:1,class:"thread-composer-file-mention-empty"},kw=["placeholder","disabled"],Tw={class:"thread-composer-controls"},Sw=["disabled"],xw={key:0,class:"thread-composer-attach-menu"},Cw=["disabled"],Ew=["disabled"],Aw={class:"thread-composer-actions"},Iw=["aria-label","title","disabled"],Rw=["disabled"],$w=["aria-label","title","disabled"],Mw=["disabled"],Pw=["disabled"],Ow=At({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=N(""),o=N([]),i=N([]),a=N([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=Tv({onTranscript:F=>{s.value=s.value?`${s.value}
|
|
43
|
-
${F}`:F}}),g=N(null),_=N(null),P=N(null),I=N(null),B=N(!1),z=N(!1),O=N(null),H=N(""),j=N([]),ae=N(!1),ue=N(0);let fe=0,ke=null;const se=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),X=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],me=le(()=>n.models.map(F=>({value:F,label:F}))),re=le(()=>n.skills??[]),Be=le(()=>i.value.map(F=>F.path)),He=le(()=>(n.skills??[]).map(F=>({value:F.path,label:F.name,description:F.description}))),Ge=le(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ae=le(()=>n.disabled||!n.activeThreadId),be=le(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=le(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function gt(F="steer"){var J;const W=s.value.trim();if(Ge.value){if(r("submit",{text:W,imageUrls:o.value.map(Ke=>Ke.url),fileAttachments:[...a.value],skills:i.value.map(Ke=>({name:Ke.name,path:Ke.path})),mode:F}),s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,z.value=!1,te(),se){(J=I.value)==null||J.blur();return}Gt(()=>{var Ke;return(Ke=I.value)==null?void 0:Ke.focus()})}}function Je(){r("interrupt")}function lt(F){r("update:selected-model",F)}function Ye(F){r("update:selected-reasoning-effort",F)}function Ze(){Ae.value||(B.value=!B.value)}function he(){var F;(F=_.value)==null||F.click()}function Se(){var F;(F=P.value)==null||F.click()}function Te(F){o.value=o.value.filter(W=>W.id!==F)}function E(F){i.value=i.value.filter(W=>W.path!==F)}function ee(F){a.value=a.value.filter(W=>W.fsPath!==F)}function Y(F){const W=F.replace(/\\/g,"/");if(a.value.some(w=>w.fsPath===W))return;const J=W.split("/").filter(Boolean),Ke=J[J.length-1]??W;a.value=[...a.value,{label:Ke,path:W,fsPath:W}]}function ye(F){return F.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(F.name)}function Me(F){if(!(!F||F.length===0))for(const W of Array.from(F))if(ye(W)){const J=new FileReader;J.onload=()=>{typeof J.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:W.name,url:J.result})},J.readAsDataURL(W)}else py(W).then(J=>{J&&Y(J)}).catch(()=>{})}function p(F){F&&(F.value="")}function y(F){const W=F.target;Me((W==null?void 0:W.files)??null),p(W),B.value=!1}function x(F){const W=F.target;Me((W==null?void 0:W.files)??null),p(W),B.value=!1}function D(){const W=s.value.startsWith("/");W!==z.value&&(z.value=W),ne()}function V(F){if(ae.value){if(F.key==="Escape"){F.preventDefault(),te();return}if(F.key==="ArrowDown"){F.preventDefault(),j.value.length>0&&(ue.value=(ue.value+1)%j.value.length);return}if(F.key==="ArrowUp"){if(F.preventDefault(),j.value.length>0){const J=j.value.length;ue.value=(ue.value+J-1)%J}return}if(F.key==="Enter"||F.key==="Tab"){F.preventDefault();const J=j.value[ue.value];J?U(J):te();return}}if(n.sendWithEnter!==!1?F.key==="Enter"&&!F.shiftKey:F.key==="Enter"&&(F.metaKey||F.ctrlKey)){F.preventDefault(),gt(n.isTurnInProgress?be.value:"steer");return}if(z.value){if(F.key==="Escape"){F.preventDefault(),L();return}if(F.key==="ArrowDown"||F.key==="ArrowUp"){F.preventDefault();return}}}function L(){var F;z.value=!1,(F=I.value)==null||F.focus()}function te(){ae.value=!1,O.value=null,H.value="",j.value=[],ue.value=0}function ne(){const F=I.value;if(!F){te();return}const W=F.selectionStart??s.value.length,Ke=s.value.slice(0,W).match(/(^|\s)(@[^\s@]*)$/);if(!Ke){te();return}const w=Ke[2]??"",A=w.length,$=W-A;O.value=$,H.value=w.slice(1),ae.value=!0,Q()}async function Q(){if(!ae.value)return;const F=(n.cwd??"").trim();if(!F){j.value=[];return}ke&&clearTimeout(ke);const W=++fe;ke=setTimeout(async()=>{try{const J=await uy(F,H.value,20);if(!ae.value||W!==fe)return;j.value=J,ue.value=0}catch{if(!ae.value||W!==fe)return;j.value=[]}},120)}function U(F){const W=I.value,J=O.value;if(J!==null&&W){const Ke=W.selectionStart??s.value.length;s.value=`${s.value.slice(0,J)}${s.value.slice(Ke)}`.trimEnd()}Y(F.path),te(),Gt(()=>W==null?void 0:W.focus())}function de(F){const W=F.lastIndexOf("/");return W<0?F:F.slice(W+1)}function ie(F){const W=F.lastIndexOf("/");return W<=0?"":F.slice(0,W)}function ge(F){const W=de(F),J=W.lastIndexOf(".");return J<=0?"":W.slice(J+1).toLowerCase()}function ve(F){const W=ge(F);return W==="ts"?"TS":W==="tsx"?"TSX":W==="js"?"JS":W==="jsx"?"JSX":W==="json"?"{}":""}function Le(F){const W=ge(F);return W.startsWith("ts")?"ts":W.startsWith("js")?"js":W==="json"?"json":"default"}function qe(F){const W=ge(F);return W==="md"||W==="mdx"}function Oe(F){var W;i.value.some(J=>J.path===F.path)||(i.value=[...i.value,F]),s.value=s.value.startsWith("/")?"":s.value,z.value=!1,(W=I.value)==null||W.focus()}function nt(F,W){if(W){const J=(n.skills??[]).find(Ke=>Ke.path===F);J&&!i.value.some(Ke=>Ke.path===F)&&(i.value=[...i.value,J])}else i.value=i.value.filter(J=>J.path!==F)}function dt(F){if(!B.value)return;const W=g.value;if(!W)return;const J=F.target;!J||W.contains(J)||(B.value=!1)}return qn(()=>{document.addEventListener("click",dt)}),Kn(()=>{document.removeEventListener("click",dt),ke&&clearTimeout(ke)}),yt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,z.value=!1,te()}),yt(()=>n.cwd,()=>{ae.value&&Q()}),(F,W)=>(b(),S("form",{class:"thread-composer",onSubmit:W[7]||(W[7]=ze(J=>gt("steer"),["prevent"]))},[m("div",{class:ht(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(b(),S("div",ow,[(b(!0),S(Ue,null,wt(o.value,J=>(b(),S("div",{key:J.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:J.url,alt:J.name||"Selected image"},null,8,iw),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${J.name||"image"}`,disabled:Ae.value,onClick:Ke=>Te(J.id)}," x ",8,aw)]))),128))])):ce("",!0),a.value.length>0?(b(),S("div",lw,[(b(!0),S(Ue,null,wt(a.value,J=>(b(),S("span",{key:J.fsPath,class:"thread-composer-file-chip"},[Ee(js,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:J.fsPath},_e(J.label),9,cw),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${J.label}`,disabled:Ae.value,onClick:Ke=>ee(J.fsPath)},"×",8,uw)]))),128))])):ce("",!0),i.value.length>0?(b(),S("div",dw,[(b(!0),S(Ue,null,wt(i.value,J=>(b(),S("span",{key:J.path,class:"thread-composer-skill-chip"},[m("span",fw,_e(J.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${J.name}`,onClick:Ke=>E(J.path)},"×",8,hw)]))),128))])):ce("",!0),m("div",pw,[ae.value?(b(),S("div",mw,[j.value.length>0?(b(!0),S(Ue,{key:0},wt(j.value,(J,Ke)=>(b(),S("button",{key:J.path,class:ht(["thread-composer-file-mention-row",{"is-active":Ke===ue.value}]),type:"button",onMousedown:ze(w=>U(J),["prevent"])},[ve(J.path)?(b(),S("span",{key:0,class:ht(["thread-composer-file-mention-icon-badge",`is-${Le(J.path)}`])},_e(ve(J.path)),3)):qe(J.path)?(b(),S("span",vw,"↓")):(b(),mt(js,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",yw,[m("span",ww,_e(de(J.path)),1),ie(J.path)?(b(),S("span",bw,_e(ie(J.path)),1)):ce("",!0)])],42,gw))),128)):(b(),S("div",_w,"No matching files"))])):ce("",!0),Mn(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":W[0]||(W[0]=J=>s.value=J),class:"thread-composer-input",placeholder:$e.value,disabled:Ae.value,onInput:D,onKeydown:V},null,40,kw),[[Pn,s.value]]),Ee(sw,{skills:re.value,visible:z.value,"anchor-bottom":44,"anchor-left":0,onSelect:Oe,onClose:L},null,8,["skills","visible"])]),m("div",Tw,[m("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ae.value,onClick:Ze}," + ",8,Sw),B.value?(b(),S("div",xw,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:he}," Add photos & files ",8,Cw),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:Se}," Take photo ",8,Ew)])):ce("",!0)],512),Ee(Go,{class:"thread-composer-control","model-value":e.selectedModel,options:me.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":lt},null,8,["model-value","options","disabled"]),Ee(Yy,{class:"thread-composer-control",options:He.value,"selected-values":Be.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:nt},null,8,["options","selected-values","disabled"]),Ee(Go,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:X,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ye},null,8,["model-value","disabled"]),m("div",Aw,[je(d)&&!e.isTurnInProgress?(b(),S("button",{key:0,class:ht(["thread-composer-mic",{"thread-composer-mic--active":je(l)!=="idle"}]),type:"button","aria-label":je(l)==="recording"?"Stop dictation":"Hold to dictate",title:je(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ae.value,onMousedown:W[1]||(W[1]=ze((...J)=>je(u)&&je(u)(...J),["prevent"])),onMouseup:W[2]||(W[2]=(...J)=>je(f)&&je(f)(...J)),onMouseleave:W[3]||(W[3]=J=>je(l)==="recording"&&je(f)()),onTouchstart:W[4]||(W[4]=ze((...J)=>je(u)&&je(u)(...J),["prevent"])),onTouchend:W[5]||(W[5]=(...J)=>je(f)&&je(f)(...J))},[Ee(ky,{class:"thread-composer-mic-icon"})],42,Iw)):ce("",!0),e.isTurnInProgress?(b(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Je},[Ee(Cy,{class:"thread-composer-stop-icon"})],8,Rw)):ce("",!0),m("button",{class:ht(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&be.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&be.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${be.value}`:"Send",disabled:!Ge.value,onClick:W[6]||(W[6]=J=>gt(e.isTurnInProgress?be.value:"steer"))},[Ee(yy,{class:"thread-composer-submit-icon"})],10,$w)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ae.value,onChange:y},null,40,Mw),m("input",{ref_key:"cameraCaptureInputRef",ref:P,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ae.value,onChange:x},null,40,Pw)],32))}}),Qa=Xe(Ow,[["__scopeId","data-v-983e7906"]]),Nw={key:0,class:"queued-messages"},jw={class:"queued-messages-inner"},Dw={class:"queued-row-text"},Lw={class:"queued-row-actions"},Bw=["onClick"],Fw=["onClick"],Hw=At({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(b(),S("div",Nw,[m("div",jw,[(b(!0),S(Ue,null,wt(e.messages,r=>(b(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),m("span",Dw,_e(r.text),1),m("div",Lw,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Bw),m("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,Fw)])]))),128))])])):ce("",!0)}}),Uw=Xe(Hw,[["__scopeId","data-v-ea583733"]]),Vw={},Ww={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function qw(e,t){return b(),S("svg",Ww,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const zo=Xe(Vw,[["render",qw]]),Kw={class:"skill-card-top"},Gw=["src","alt"],zw={key:1,class:"skill-card-avatar-fallback"},Yw={class:"skill-card-info"},Jw={class:"skill-card-header"},Qw={class:"skill-card-name"},Xw={key:0,class:"skill-card-badge-disabled"},Zw={key:1,class:"skill-card-badge"},eb={class:"skill-card-owner"},tb={key:0,class:"skill-card-desc"},nb={key:1,class:"skill-card-date"},rb=At({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=le(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(b(),S("button",{class:ht(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",Kw,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,Gw)):(b(),S("div",zw,_e(e.skill.owner.charAt(0)),1)),m("div",Yw,[m("div",Jw,[m("span",Qw,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(b(),S("span",Xw,"Disabled")):e.skill.installed?(b(),S("span",Zw,"Installed")):ce("",!0)]),m("span",eb,_e(e.skill.owner),1)])]),e.skill.description?(b(),S("p",tb,_e(e.skill.description),1)):ce("",!0),n.value?(b(),S("span",nb,_e(n.value),1)):ce("",!0)],2))}}),Xa=Xe(rb,[["__scopeId","data-v-2a1e8196"]]),sb={class:"sdm-panel"},ob={class:"sdm-header"},ib={class:"sdm-title-area"},ab=["src","alt"],lb={class:"sdm-title-col"},cb={class:"sdm-title-row"},ub={class:"sdm-title"},db={key:0,class:"sdm-badge-disabled"},fb={class:"sdm-owner"},hb={class:"sdm-body"},pb={key:0,class:"sdm-desc"},mb={key:1,class:"sdm-readme-loading"},gb=["innerHTML"],vb=["href"],yb={class:"sdm-footer"},wb={class:"sdm-footer-actions"},bb=["disabled"],_b=["disabled"],kb=["disabled"],Tb=At({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(""),i=N(!1),a=le(()=>s.value??n.skill.enabled??!0),l=le(()=>n.isInstalling===!0||n.isUninstalling===!0),d=le(()=>{const I=o.value;if(!I)return"";const B=I.replace(/^---[\s\S]*?---\s*/,"");return u(B)});function u(I){return I.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),B=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!B.ok)return;const z=await B.json();o.value=z.content??""}catch{}finally{i.value=!1}}}yt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function P(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,B)=>(b(),mt($s,{to:"body"},[e.visible?(b(),S("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=ze(z=>I.$emit("close"),["self"]))},[m("div",sb,[m("div",ob,[m("div",ib,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,ab)):ce("",!0),m("div",lb,[m("div",cb,[m("h3",ub,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(b(),S("span",db,"Disabled")):ce("",!0)]),m("span",fb,_e(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=z=>I.$emit("close"))},[Ee(_i,{class:"sdm-close-icon"})])]),m("div",hb,[e.skill.description?(b(),S("p",pb,_e(e.skill.description),1)):ce("",!0),i.value?(b(),S("div",mb,"Loading skill contents...")):o.value?(b(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,gb)):ce("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,vb)]),m("div",yb,[m("div",wb,[e.skill.installed?(b(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},_e(n.isUninstalling?"Uninstalling...":"Uninstall"),9,bb)):(b(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},_e(n.isInstalling?"Installing...":"Install"),9,_b)),e.skill.installed?(b(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:P},_e(a.value?"Disable":"Enable"),9,kb)):ce("",!0)])])])])):ce("",!0)]))}}),Sb=Xe(Tb,[["__scopeId","data-v-19a385ca"]]),xb={class:"skills-hub"},Cb={class:"skills-hub-toolbar"},Eb={class:"skills-hub-search-wrap"},Ab={key:0,class:"skills-hub-count"},Ib={key:1,class:"skills-hub-section"},Rb={class:"skills-hub-section-title"},$b={key:0,class:"skills-hub-grid"},Mb={class:"skills-hub-section"},Pb={key:0,class:"skills-hub-loading"},Ob={key:1,class:"skills-hub-error"},Nb={key:0,class:"skills-hub-grid"},jb={key:1,class:"skills-hub-empty"},ws="codex-web-local.skills-hub.cache.v1",Db=At({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=N(null),s=N(""),o=N("date"),i=N([]),a=N([]),l=N(0),d=N(!1),u=N(""),f=N(!0),g=N(!1),_=N(n),P=N(null),I=N(""),B=N(!1),z=N(!1);let O=null,H=null;const j=t,ae=le(()=>o.value==="date"?"Newest":"A-Z"),ue=le(()=>{var he;return((he=P.value)==null?void 0:he.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),fe=le(()=>`${_.value.owner}/${_.value.name}`),ke=le(()=>B.value&&I.value===fe.value),se=le(()=>z.value&&I.value===fe.value),X=le(()=>{const he=s.value.toLowerCase().trim();return he?a.value.filter(Se=>Se.name.toLowerCase().includes(he)||Se.owner.toLowerCase().includes(he)||(Se.displayName??"").toLowerCase().includes(he)):a.value});function me(he,Se="success"){P.value={text:he,type:Se},H&&clearTimeout(H),H=setTimeout(()=>{P.value=null},3e3)}function re(){o.value=o.value==="date"?"name":"date",$e(s.value)}function Be(he){return`${o.value}::${he.trim().toLowerCase()}`}function He(he){var Se;if(typeof window>"u")return null;try{const Te=window.localStorage.getItem(ws);return Te?((Se=JSON.parse(Te).byKey)==null?void 0:Se[he])??null:null}catch{return null}}function Ge(he,Se){if(!(typeof window>"u"))try{const Te=window.localStorage.getItem(ws),ee=(Te?JSON.parse(Te):{}).byKey??{};ee[he]=Se,window.localStorage.setItem(ws,JSON.stringify({byKey:ee}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(ws)}catch{}}function be(he){const Se=he.installed??[];a.value=Se;const Te=new Set(Se.map(E=>E.name));i.value=he.data.map(E=>{if(E.installed||Te.has(E.name)){const ee=Se.find(Y=>Y.name===E.name);return{...E,installed:!0,path:(ee==null?void 0:ee.path)??E.path,enabled:(ee==null?void 0:ee.enabled)??E.enabled}}return E}).filter(E=>!E.installed),l.value=he.total}async function $e(he){const Se=Be(he),Te=He(Se);Te&&be(Te),d.value=!Te,u.value="";try{const E=new URLSearchParams;he.trim()&&E.set("q",he.trim()),E.set("limit","100"),E.set("sort",o.value);const ee=await fetch(`/codex-api/skills-hub?${E}`);if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const Y=await ee.json();be(Y),Ge(Se,Y)}catch(E){u.value=E instanceof Error?E.message:"Failed to load skills"}finally{d.value=!1}}function gt(){O&&clearTimeout(O),O=setTimeout(()=>$e(s.value),300)}function Je(he){_.value=he,g.value=!0}async function lt(he){I.value=`${he.owner}/${he.name}`,B.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:he.owner,name:he.name})})).json();if(!Te.ok)throw new Error(Te.error||"Install failed");const E={...he,installed:!0,path:Te.path,enabled:!0};a.value=[...a.value,E],i.value=i.value.filter(ee=>ee.name!==he.name),_.value=E,me(`${he.displayName||he.name} skill installed`),g.value=!1,Ae(),j("skills-changed")}catch(Se){me(Se instanceof Error?Se.message:"Failed to install skill","error")}finally{B.value=!1}}async function Ye(he){I.value=`${he.owner}/${he.name}`,z.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:he.name,path:he.path})})).json();if(!Te.ok)throw new Error(Te.error||"Uninstall failed");a.value=a.value.filter(E=>E.name!==he.name),he.owner!=="local"&&(i.value=[...i.value,{...he,installed:!1,path:void 0,enabled:void 0}]),me(`${he.displayName||he.name} skill uninstalled`),g.value=!1,Ae(),j("skills-changed")}catch(Se){me(Se instanceof Error?Se.message:"Failed to uninstall skill","error")}finally{z.value=!1}}async function Ze(he,Se){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:he.path,enabled:Se}})})).ok)throw new Error("Failed to update skill");me(`${he.displayName||he.name} skill ${Se?"enabled":"disabled"}`),await $e(s.value)}catch(Te){me(Te instanceof Error?Te.message:"Failed to update skill","error")}}return qn(()=>{$e("")}),(he,Se)=>(b(),S("div",xb,[Se[3]||(Se[3]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",Cb,[m("div",Eb,[Ee(zo,{class:"skills-hub-search-icon"}),Mn(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Se[0]||(Se[0]=Te=>s.value=Te),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:gt},null,544),[[Pn,s.value]]),l.value>0?(b(),S("span",Ab,_e(l.value)+" skills",1)):ce("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:re},_e(ae.value),1)]),P.value?(b(),S("div",{key:0,class:ht(["skills-hub-toast",ue.value])},_e(P.value.text),3)):ce("",!0),X.value.length>0?(b(),S("div",Ib,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:Se[1]||(Se[1]=Te=>f.value=!f.value)},[m("span",Rb,"Installed ("+_e(X.value.length)+")",1),Ee(Lc,{class:ht(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(b(),S("div",$b,[(b(!0),S(Ue,null,wt(X.value,Te=>(b(),mt(Xa,{key:Te.name,skill:Te,onSelect:E=>Je(E)},null,8,["skill","onSelect"]))),128))])):ce("",!0)])):ce("",!0),m("div",Mb,[d.value?(b(),S("div",Pb,"Loading skills...")):u.value?(b(),S("div",Ob,_e(u.value),1)):(b(),S(Ue,{key:2},[i.value.length>0?(b(),S("div",Nb,[(b(!0),S(Ue,null,wt(i.value,Te=>(b(),mt(Xa,{key:Te.url,skill:Te,onSelect:E=>Je(E)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(b(),S("div",jb,'No skills found for "'+_e(s.value)+'"',1)):ce("",!0)],64))]),Ee(Sb,{skill:_.value,visible:g.value,"is-installing":ke.value,"is-uninstalling":se.value,onClose:Se[2]||(Se[2]=Te=>g.value=!1),onInstall:lt,onUninstall:Ye,onToggleEnabled:Ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Lb=Xe(Db,[["__scopeId","data-v-1967b404"]]),Bb={},Fb={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 Hb(e,t){return b(),S("svg",Fb,[...t[0]||(t[0]=[m("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),m("path",{d:"M9 4l0 16"},null,-1)])])}const Ub=Xe(Bb,[["render",Hb]]),Vb={},Wb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function qb(e,t){return b(),S("svg",Wb,[...t[0]||(t[0]=[m("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const Kb=Xe(Vb,[["render",qb]]),Gb={},zb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Yb(e,t){return b(),S("svg",zb,[...t[0]||(t[0]=[m("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),m("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Jb=Xe(Gb,[["render",Yb]]),Qb={class:"sidebar-thread-controls"},Xb=["aria-label","title"],Zb=["aria-pressed","aria-label","title"],e0=At({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(b(),S("div",Qb,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(b(),mt(Kb,{key:0,class:"sidebar-thread-controls-icon"})):(b(),mt(Ub,{key:1,class:"sidebar-thread-controls-icon"}))],8,Xb),m("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Ee(Jb,{class:"sidebar-thread-controls-icon"})],8,Zb),pn(t.$slots,"default",{},void 0),e.showNewThreadButton?(b(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ee(js,{class:"sidebar-thread-controls-icon"})])):ce("",!0)]))}}),Za=Xe(e0,[["__scopeId","data-v-57866500"]]),t0={},n0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function r0(e,t){return b(),S("svg",n0,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const s0=Xe(t0,[["render",r0]]);function Un(e){return e.flatMap(t=>t.threads)}const Uc="codex-web-local.thread-read-state.v1",Vc="codex-web-local.thread-scroll-state.v1",Yo="codex-web-local.selected-thread-id.v1",Wc="codex-web-local.project-order.v1",qc="codex-web-local.project-display-name.v1",Kc="codex-web-local.auto-refresh-enabled.v1",So=220,Kr=4e3,el=["none","minimal","low","medium","high","xhigh"],Gr="__global__",Yt="gpt-5.2-codex";function o0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Uc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function tl(e){typeof window>"u"||window.localStorage.setItem(Uc,JSON.stringify(e))}function i0(){return typeof window>"u"?!1:window.localStorage.getItem(Kc)==="1"}function nl(e){typeof window>"u"||window.localStorage.setItem(Kc,e?"1":"0")}function Gc(e,t,n){return Math.min(Math.max(e,t),n)}function a0(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=Gc(t.scrollRatio,0,1)),n}function l0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Vc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=a0(s);o&&(n[r]=o)}return n}catch{return{}}}function rl(e){typeof window>"u"||window.localStorage.setItem(Vc,JSON.stringify(e))}function c0(){return typeof window>"u"?"":window.localStorage.getItem(Yo)??""}function u0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Yo);return}window.localStorage.setItem(Yo,e)}}function d0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Wc);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function br(e){typeof window>"u"||window.localStorage.setItem(Wc,JSON.stringify(e))}function f0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function xo(e){typeof window>"u"||window.localStorage.setItem(qc,JSON.stringify(e))}function bs(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 lr(e,n)?e:n}function Co(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function lr(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function h0(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function p0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function _s(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 Jo(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&lr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&p0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ds(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 m0(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=r.get(u.id);return f&&Jo(f,u)?f:u});if(n.preserveMissing!==!0)return Ds(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||Jo(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Ds(e,d)?e:d}function Qo(e){return e.replace(/\s+/gu," ").trim()}function g0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Qo(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=Qo(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function sl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Jo(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const zc="worked";function Bn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function v0(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s:0;return o.push(`${i}s`),o.join(" ")}function y0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function w0(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 b0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${v0(e.durationMs)}`,messageType:zc}}function _0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function k0(e,t){const n=b0(t),r=e.filter(i=>i.messageType!==zc),s=_0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Ct(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function T0(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function S0(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 x0(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 Rt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function ks(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&T0(d,l)?d:l});return o&&o.projectName===s.projectName&&S0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return x0(e,r)?e:r}function C0(e,t,n){const r=new Set(Un(t).map(a=>a.id)),s=Un(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function E0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Eo(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function A0(e){const t=e.split(`
|
|
44
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function I0(){const e=N([]),t=N([]),n=N(c0()),r=N({}),s=N({}),o=N({}),i=N({}),a=N({}),l=N({}),d=N({}),u=N([]),f=N(""),g=N("medium"),_=N(o0()),P=N(l0()),I=N(d0()),B=N(f0()),z=N({}),O=N({}),H=N({}),j=N({}),ae=N({}),ue=N({}),fe=N({}),ke=N({}),se=N({}),X=N({}),me=N([]),re=N(!1),Be=N(!1),He=N(!1),Ge=N(!1),Ae=N(!1),be=N(""),$e=N(!1),gt=N(!1),Je=N(i0()),lt=N(Math.floor(Kr/1e3));let Ye=null,Ze=null,he=null,Se=null,Te=!1;const E=new Set;let ee=!1,Y=!1;const ye=new Map,Me=new Set,p=le(()=>Un(e.value)),y=le(()=>p.value.find(c=>c.id===n.value)??null),x=le(()=>P.value[n.value]??null),D=le(()=>{const c=[],h=n.value;return h&&Array.isArray(ke.value[h])&&c.push(...ke.value[h]),Array.isArray(ke.value[Gr])&&c.push(...ke.value[Gr]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),V=le(()=>{var G;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),T=(((G=ue.value[c])==null?void 0:G.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),L=le(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=j.value[c];return K?k0(G,K):G});function te(c){n.value!==c&&(n.value=c,u0(c),Y=!1)}function ne(c){f.value=c.trim()}async function Q(){f.value=Yt,u.value.includes(Yt)||(u.value=[...u.value,Yt]);try{await ry(Yt)}catch{}}function U(c,h){se.value={...se.value,[c]:h}}function de(c){se.value[c]&&(se.value=Ct(se.value,c))}async function ie(c){if(Me.has(c))return;const h=se.value[c];if(!(!h||h.fallbackRetried)){Me.add(c),U(c,{...h,fallbackRetried:!0});try{await Q();try{const v=await Ga(c,1);xe(c,v),Ce(c,[]),ut(c),i.value[c]&&(i.value=Ct(i.value,c))}catch{}A(c,null),be.value="",W(c,null),w(c,{label:"Thinking",details:ve(Yt,h.effort)}),J(c,!0),H.value[c]!==!0&&await _o(c),await ko(c,h.text,h.imageUrls,Yt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),H.value={...H.value,[c]:!0},E.add(c),Te=!0,await Zn()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";A(c,T),be.value=T,J(c,!1),w(c,null)}finally{Me.delete(c)}}}function ge(c){c&&!el.includes(c)||(g.value=c)}function ve(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Le(){try{const[c,h]=await Promise.all([sy(),oy()]);u.value=c,f.value.length>0&&c.includes(f.value)||(h.model&&c.includes(h.model)?f.value=h.model:c.length>0?f.value=c[0]:f.value=""),h.reasoningEffort&&el.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function qe(c){const h=X.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=h[T.id];return G?{...T,title:G}:T})}))}function Oe(){const h=qe(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,we=_.value[T.id],Ie=d.value[T.id]===!0,pe=!K&&!G&&(Ie||we!==T.updatedAtIso);return{...T,inProgress:G,unread:pe}})}));e.value=ks(e.value,h)}function nt(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=E0(G),we={id:c,title:A0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Ie=t.value.findIndex(Qe=>Qe.projectName===K);if(Ie>=0){const vt=t.value[Ie].threads.filter(jn=>jn.id!==c),yr={projectName:K,threads:[we,...vt]},bn=[...t.value];bn.splice(Ie,1,yr),t.value=bn}else t.value=[{projectName:K,threads:[we]},...t.value];const pe=bs(I.value,t.value);lr(I.value,pe)||(I.value=pe,br(I.value)),Oe()}function dt(c){const h=new Set(c.map(K=>K.id)),v=Rt(_.value,h);v!==_.value&&(_.value=v,tl(v));const T=Rt(P.value,h);T!==P.value&&(P.value=T,rl(T)),O.value=Rt(O.value,h),z.value=Rt(z.value,h),H.value=Rt(H.value,h),r.value=Rt(r.value,h),s.value=Rt(s.value,h),o.value=Rt(o.value,h),i.value=Rt(i.value,h),j.value=Rt(j.value,h),ae.value=Rt(ae.value,h),ue.value=Rt(ue.value,h),fe.value=Rt(fe.value,h),d.value=Rt(d.value,h),a.value=Rt(a.value,h);const G={};for(const[K,we]of Object.entries(ke.value))(K===Gr||h.has(K))&&(G[K]=we);ke.value=G}function F(c){const h=Un(t.value).find(v=>v.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},tl(_.value),d.value[c]&&(d.value=Ct(d.value,c)),Oe())}function W(c,h){if(!c)return;const v=j.value[c];if(h){if(y0(v,h))return;j.value={...j.value,[c]:h}}else v&&(j.value=Ct(j.value,c))}function J(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Ct(a.value,c),Oe())}function Ke(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Oe())}function w(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=Ct(ae.value,c));return}const T=hr(h.label)||"Thinking",G=h.details.map(Ie=>hr(Ie)).filter(Ie=>Ie.length>0&&Ie!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),we={label:T,details:K};w0(v,we)||(ae.value={...ae.value,[c]:we})}function A(c,h){if(!c)return;const v=ue.value[c],T=h?Qo(h):"";if(!T){v&&(ue.value=Ct(ue.value,c));return}(v==null?void 0:v.message)!==T&&(ue.value={...ue.value,[c]:{message:T}})}function $(c){const h=Un(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Z(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Gc(h.scrollRatio,0,1));const T=P.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(P.value={...P.value,[c]:v},rl(P.value))}function xe(c,h){const v=r.value[c]??[];Ds(v,h)||(r.value={...r.value,[c]:h})}function Ce(c,h){const v=s.value[c]??[];Ds(v,h)||(s.value={...s.value,[c]:h})}function ct(c,h){const v=s.value[c]??[],T=sl(v,h);Ce(c,T)}function et(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=Ct(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function it(c,h){if(!c)return;const v=o.value[c]??"";et(c,`${v}${h}`)}function ut(c){c&&c in o.value&&(o.value=Ct(o.value,c))}function Pe(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Re(c){return typeof c=="string"?c:""}function gn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Ut(c){const h=Pe(c.params);if(!h)return"";const v=Re(h.threadId);if(v)return v;const T=Re(h.thread_id);if(T)return T;const G=Re(h.conversationId);if(G)return G;const K=Re(h.conversation_id);if(K)return K;const we=Pe(h.thread),Ie=Re(we==null?void 0:we.id);if(Ie)return Ie;const pe=Pe(h.turn),Qe=Re(pe==null?void 0:pe.threadId);if(Qe)return Qe;const vt=Re(pe==null?void 0:pe.thread_id);return vt||""}function Pr(c){if(c.method!=="turn/completed")return"";const h=Pe(c.params),v=Pe(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Pe(v.error);return Re(T==null?void 0:T.message)}function Gn(c){var v;if(c.method!=="error")return"";const h=Pe(c.params);return Re(h==null?void 0:h.message)||Re((v=Pe(h==null?void 0:h.error))==null?void 0:v.message)}function jt(c){const h=Pe(c);if(!h)return null;const v=h.id,T=Re(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Pe(G),we=Re(K==null?void 0:K.threadId)||Gr,Ie=Re(K==null?void 0:K.turnId),pe=Re(K==null?void 0:K.itemId),Qe=Re(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:we,turnId:Ie,itemId:pe,receivedAtIso:Qe,params:G??null}}function zn(c){const h=c.threadId||Gr,v=ke.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),ke.value={...ke.value,[h]:G.sort((K,we)=>K.receivedAtIso.localeCompare(we.receivedAtIso))}}function Yn(c){const h={};for(const[v,T]of Object.entries(ke.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}ke.value=h}function Or(c){if(c.method==="server/request"){const h=jt(c.params);return h&&zn(h),!0}if(c.method==="server/request/resolved"){const h=Pe(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&Yn(v),!0}return!1}function hr(c){return c.replace(/\s+/gu," ").trim()}function pr(c){const h=Ut(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Pe(c.params),T=Pe(v==null?void 0:v.item),G=Re(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=Re(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function mr(c){if(c.method!=="turn/started")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Re(T==null?void 0:T.id)||Re(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Bn(Re(T==null?void 0:T.startedAt))??Bn(Re(h.startedAt))??Bn(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function vn(c){if(c.method!=="turn/completed")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Re(T==null?void 0:T.id)||Re(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Bn(Re(T==null?void 0:T.completedAt))??Bn(Re(h.completedAt))??Bn(c.atIso)??Date.now(),we=Bn(Re(T==null?void 0:T.startedAt))??Bn(Re(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:we}}function Qt(c){return`${c}:live-reasoning`}function Nr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":Re(v.id)}return""}function Jn(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Re(h.itemId),T=Re(h.delta);return!v||!T?null:{messageId:Qt(v),delta:T}}return null}function gr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Re(h.itemId);return v?Qt(v):""}return""}function jr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":Qt(Re(v.id))}return""}function Qn(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="agentMessage"?"":Re(v.id)}return""}function vr(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Re(h.itemId),T=Re(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function Nn(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Pe(h.item);if(!v||v.type!=="agentMessage")return null;const T=Re(v.id),G=Re(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function Dr(c){if(c.method!=="item/started")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Re(v.id),G=Re(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Lr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Pe(c.params);if(!h)return null;const v=Re(h.itemId),T=Re(h.delta);return!v||!T?null:{itemId:v,delta:T}}function Br(c){if(c.method!=="item/completed")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Re(v.id),G=Re(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,we=Re(v.status),Ie=we==="failed"?"failed":we==="declined"?"declined":we==="interrupted"?"interrupted":"completed",pe=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",Qe=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Ie,aggregatedOutput:pe,exitCode:Qe}}}function yn(c,h){const v=i.value[c]??[],T=sl(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Fr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=Ct(i.value,c):i.value={...i.value,[c]:G})}function k(c){if(c.method==="item/agentMessage/delta")return!0;const h=Pe(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Pe(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function C(c){var Ii,Ri,$i,Mi;if(Or(c))return;if(c.method==="thread/name/updated"){const We=Pe(c.params),an=Re(We==null?void 0:We.threadId),er=Re(We==null?void 0:We.threadName);an&&er&&(X.value={...X.value,[an]:er},Oe(),To(an,er))}const h=pr(c);h&&w(h.threadId,h.activity);const v=mr(c);v&&(ye.set(v.turnId,v),fe.value={...fe.value,[v.threadId]:v.turnId},W(v.threadId,null),A(v.threadId,null),J(v.threadId,!0),d.value[v.threadId]&&(d.value=Ct(d.value,v.threadId)));const T=vn(c),G=Pr(c),we=!!((T==null?void 0:T.threadId)??Ut(c))&&!!G&&f.value!==Yt&&_s(new Error(G));if(T){const We=ye.get(T.turnId);We&&ye.delete(T.turnId);const an=gn((Ii=Pe(c.params))==null?void 0:Ii.durationMs)??gn(($i=Pe((Ri=Pe(c.params))==null?void 0:Ri.turn))==null?void 0:$i.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(We?T.completedAtMs-We.startedAtMs:null),er=typeof an=="number"?Math.max(0,an):0;W(T.threadId,{turnId:T.turnId,durationMs:er}),fe.value[T.threadId]&&(fe.value=Ct(fe.value,T.threadId)),J(T.threadId,!1),w(T.threadId,null),Ke(T.threadId),we||(de(T.threadId),Si(T.threadId))}if(G){const We=(T==null?void 0:T.threadId)||Ut(c);We&&A(We,G),be.value=G,We&&we&&ie(We)}else T&&A(T.threadId,null);const Ie=Gn(c);if(Ie){const We=Ut(c);We&&A(We,Ie),be.value=Ie,f.value!==Yt&&_s(new Error(Ie))&&(We?ie(We):Q())}const pe=Ut(c);if(!pe||pe!==n.value)return;Qn(c);const Qe=vr(c);if(Qe){const We=(s.value[pe]??[]).find(er=>er.id===Qe.messageId),an=`${(We==null?void 0:We.text)??""}${Qe.delta}`;ct(pe,{id:Qe.messageId,role:"assistant",text:an,messageType:"agentMessage.live"})}const vt=Nn(c);vt&&ct(pe,vt),Nr(c);const yr=Jn(c);if(yr&&it(pe,yr.delta),gr(c)){const We=o.value[pe]??"";We.trim().length>0&&!We.endsWith(`
|
|
45
|
-
|
|
46
|
-
`)&&et(pe,`${We}
|
|
47
|
-
|
|
48
|
-
`)}jr(c);const jn=Dr(c);jn&&(yn(pe,jn),w(pe,{label:"Running command",details:[((Mi=jn.commandExecution)==null?void 0:Mi.command)??""]}));const eo=Lr(c);if(eo){const We=(i.value[pe]??[]).find(an=>an.id===eo.itemId);We!=null&&We.commandExecution&&yn(pe,{...We,commandExecution:{...We.commandExecution,aggregatedOutput:`${We.commandExecution.aggregatedOutput}${eo.delta}`}})}const Ai=Br(c);if(Ai&&yn(pe,Ai),k(c)&&(Y&&n.value&&Z(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),ut(pe)),c.method==="turn/completed"){Y=!1,ut(pe),i.value[pe]&&(i.value=Ct(i.value,pe));const We=Ut(c);We&&(J(We,!1),w(We,null),Ke(We),we||(de(We),Si(We)))}}function R(c){const h=Ut(c);h&&E.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Te=!0),!(Ze!==null||typeof window>"u")&&(Ze=window.setTimeout(()=>{Ze=null,Zn()},So))}async function q(c){if(!ee){ee=!0;try{const h=await Ya(),v=[];for(const T of h.order){const G=Eo(T);v.includes(G)||v.push(G)}if(v.length>0){const T=bs(v,c);lr(I.value,T)||(I.value=T,br(I.value))}if(Object.keys(h.labels).length>0){const T={...B.value};let G=!1;for(const[K,we]of Object.entries(h.labels)){const Ie=Eo(K);T[Ie]!==we&&(T[Ie]=we,G=!0)}G&&(B.value=T,xo(T))}}catch{}}}async function Fe(){if(!(Object.keys(X.value).length>0))try{const c=await dy();Object.keys(c.titles).length>0&&(X.value=c.titles)}catch{}}async function kt(c,h,v){if(X.value[c])return;const T=h.trim();if(!T)return;const G=T.length>300?T.slice(0,300):T;try{const K=await fy(G,v);if(!K||X.value[c])return;X.value={...X.value,[c]:K},Oe(),To(c,K)}catch{}}async function It(){var c;gt.value||(re.value=!0);try{const[h]=await Promise.all([Gv(),Fe()]);await q(h);const v=bs(I.value,h);lr(I.value,v)||(I.value=v,br(I.value));const T=Co(h,I.value),G=C0(t.value,T,a.value);t.value=ks(t.value,G),a.value=Rt(a.value,new Set(Un(t.value).map(Ie=>Ie.id))),Oe(),gt.value=!0;const K=Un(e.value);dt(K),K.some(Ie=>Ie.id===n.value)||te(((c=K[0])==null?void 0:c.id)??"")}finally{re.value=!1}}async function Xt(c,h={}){if(!c)return;const v=O.value[c]===!0,T=h.silent!==!0&&!v;T&&(Be.value=!0);try{H.value[c]!==!0&&(await _o(c),H.value={...H.value,[c]:!0});const{messages:G,inProgress:K}=await zv(c),we=r.value[c]??[],Ie=m0(we,G,{preserveMissing:h.silent===!0});xe(c,Ie);const pe=s.value[c]??[],Qe=g0(pe,G);Ce(c,Qe),Fr(c,G),O.value={...O.value,[c]:!0};const vt=$(c);vt&&(z.value={...z.value,[c]:vt}),J(c,K),F(c)}finally{T&&(Be.value=!1)}}async function Xn(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);me.value=await hy(c.length>0?[...new Set(c)]:void 0)}catch{}}async function M(){be.value="";try{await It(),await Promise.all([Le(),Xn()]),await Xt(n.value)}catch(c){be.value=c instanceof Error?c.message:"Unknown application error"}}async function oe(c){te(c);try{await Xt(c)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function Ne(c){try{await Xv(c),await It(),n.value===c&&await Xt(n.value)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function Tt(c,h){const v=h.trim();if(!(!c||!v))try{await Zv(c,v),X.value={...X.value,[c]:v},Oe(),To(c,v)}catch(T){be.value=T instanceof Error?T.message:"Unknown application error"}}async function Vt(c,h=[],v=[],T="steer",G=[]){const K=n.value,we=c.trim();if(!K||!we&&h.length===0&&G.length===0)return;const Ie=a.value[K]===!0;if(Ie&&T==="queue"){const pe=l.value[K]??[],Qe=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...pe,{id:Qe,text:we,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Ie){Y=!0,wn(K,we,h,v,G).catch(pe=>{const Qe=pe instanceof Error?pe.message:"Unknown application error";A(K,Qe),be.value=Qe});return}be.value="",Y=!0,W(K,null),w(K,{label:"Thinking",details:ve(f.value,g.value)}),A(K,null),J(K,!0);try{await wn(K,we,h,v,G)}catch(pe){Y=!1,J(K,!1),w(K,null);const Qe=pe instanceof Error?pe.message:"Unknown application error";throw A(K,Qe),be.value=Qe,pe}}async function Zt(c,h,v=[],T=[],G=[]){const K=c.trim(),we=h.trim(),Ie=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";He.value=!0,be.value="";let pe="";try{try{pe=await za(we||void 0,Ie||void 0)}catch(bn){if(Ie&&Ie!==Yt&&_s(bn))await Q(),pe=await za(we||void 0,Yt);else throw bn}if(!pe)return"";nt(pe,we,K||"[Image]"),H.value={...H.value,[pe]:!0},te(pe),Y=!0,W(pe,null),w(pe,{label:"Thinking",details:ve(f.value,g.value)}),A(pe,null),J(pe,!0);const Qe=pe,vt=we||null,yr=K;return wn(pe,K,v,T,G).catch(bn=>{Y=!1,J(pe,!1),w(pe,null);const jn=bn instanceof Error?bn.message:"Unknown application error";A(pe,jn),be.value=jn}).finally(()=>{He.value=!1}),kt(Qe,yr,vt),pe}catch(Qe){Y=!1,pe&&(J(pe,!1),w(pe,null));const vt=Qe instanceof Error?Qe.message:"Unknown application error";throw pe&&A(pe,vt),be.value=vt,He.value=!1,Qe}}async function wn(c,h,v=[],T=[],G=[]){const K=f.value.trim(),we=g.value,Ie=h.trim(),pe=T.map(vt=>({name:vt.name,path:vt.path})),Qe=G.map(vt=>({...vt}));U(c,{text:Ie,imageUrls:[...v],skills:pe,fileAttachments:Qe,effort:we,fallbackRetried:!1});try{H.value[c]!==!0&&await _o(c);try{await ko(c,h,v,K||void 0,we||void 0,T.length>0?T:void 0,G)}catch(vt){if(K&&K!==Yt&&_s(vt))await Q(),U(c,{text:Ie,imageUrls:[...v],skills:pe,fileAttachments:Qe,effort:we,fallbackRetried:!0}),await ko(c,h,v,Yt,we||void 0,T.length>0?T:void 0,G);else throw vt}H.value={...H.value,[c]:!0},E.add(c),Te=!0,await Zn()}catch(vt){throw vt}}async function Si(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:Ct(l.value,c),He.value=!0,be.value="",Y=!0,W(c,null),w(c,{label:"Thinking",details:ve(f.value,g.value)}),A(c,null),J(c,!0);try{await wn(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{J(c,!1),w(c,null)}finally{He.value=!1}}async function Yc(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=fe.value[c];Ge.value=!0,be.value="";try{await ny(c,h),J(c,!1),w(c,null),A(c,null),fe.value[c]&&(fe.value=Ct(fe.value,c)),E.add(c),Te=!0,await Zn()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";A(c,T),be.value=T}finally{Ge.value=!1}}async function Jc(c){const h=n.value;if(!h||Ae.value)return;const T=(r.value[h]??[]).reduce((K,we)=>typeof we.turnIndex=="number"&&we.turnIndex>K?we.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ae.value=!0,be.value="";try{const K=await Ga(h,G);xe(h,K),Ce(h,[]),ut(h),i.value[h]&&(i.value=Ct(i.value,h)),W(h,null),w(h,null),A(h,null),Te=!0,await Zn()}catch(K){be.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ae.value=!1}}}function Qc(c,h){c.length===0||(B.value[c]??"")===h||(B.value={...B.value,[c]:h},xo(B.value))}function Xc(c){var G;if(c.length===0)return;const h=I.value.filter(K=>K!==c);if(lr(I.value,h)||(I.value=h,br(I.value)),t.value=t.value.filter(K=>K.projectName!==c),B.value[c]!==void 0){const K={...B.value};delete K[c],B.value=K,xo(K)}Oe();const v=Un(e.value);dt(v),v.some(K=>K.id===n.value)||te(((G=v[0])==null?void 0:G.id)??""),Zs()}function Zc(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(pe=>pe.projectName),T=v.indexOf(c);if(T===-1)return;const G=Math.max(0,Math.min(h,v.length-1)),K=h0(v,T,G);if(K===v)return;const we=bs(K,t.value);I.value=we,br(I.value);const Ie=Co(t.value,I.value);t.value=ks(t.value,Ie),Oe(),Zs()}function eu(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(G=>G!==h)];if(lr(I.value,v))return;I.value=v,br(I.value);const T=Co(t.value,I.value);t.value=ks(t.value,T),Oe(),Zs()}async function Zs(){var c,h;try{const v=await Ya(),T=new Map;for(const we of v.order){const Ie=Eo(we);T.has(Ie)||T.set(Ie,we)}for(const we of t.value){const Ie=((h=(c=we.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Ie&&T.set(we.projectName,Ie)}const G=[];for(const we of I.value){const Ie=T.get(we);Ie&&!G.includes(Ie)&&G.push(Ie)}for(const we of v.order)G.includes(we)||G.push(we);const K=v.active.filter(we=>G.includes(we));K.length===0&&G.length>0&&K.push(G[0]),await ay({order:G,labels:v.labels,active:K})}catch{}}async function tu(){if(!$e.value){$e.value=!0;try{if(await It(),!n.value)return;const c=n.value,h=$(c),v=z.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await Xt(c,{silent:!0})}catch{}finally{$e.value=!1}}}async function Zn(){if($e.value){typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,Zn()},So));return}$e.value=!0;const c=Te,h=new Set(E);Te=!1,E.clear();try{c&&await It();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=$(v),we=z.value[v]??"",Ie=K.length>0&&K!==we;(T||G||Ie||c)&&await Xt(v,{silent:!0})}catch{}finally{$e.value=!1,(Te||E.size>0)&&typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,Zn()},So))}}function nu(){typeof window>"u"||Ye||(Je.value&&Ci(),ru(),Ye=Yv(c=>{C(c),R(c)}))}async function ru(){try{const c=await Qv();for(const h of c){const v=jt(h);v&&zn(v)}}catch{}}async function su(c){try{await Jv(c.id,{result:c.result,error:c.error}),Yn(c.id)}catch(h){be.value=h instanceof Error?h.message:"Failed to reply to server request"}}function xi(c={}){const h=c.updatePreference??!0;he!==null&&typeof window<"u"&&(window.clearInterval(he),he=null),Se!==null&&typeof window<"u"&&(window.clearInterval(Se),Se=null),h&&(Je.value=!1,nl(!1)),lt.value=Math.floor(Kr/1e3)}function Ci(){typeof window>"u"||he!==null||Se!==null||(Je.value=!0,nl(!0),lt.value=Math.floor(Kr/1e3),he=window.setInterval(()=>{lt.value=Math.floor(Kr/1e3),tu()},Kr),Se=window.setInterval(()=>{lt.value=Math.max(0,lt.value-1)},1e3))}function ou(){if(Je.value){xi();return}Ci()}function iu(){xi({updatePreference:!1}),Ye&&(Ye(),Ye=null),Te=!1,E.clear(),ye.clear(),Ze!==null&&typeof window<"u"&&(window.clearTimeout(Ze),Ze=null),Y=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},j.value={},ue.value={},fe.value={},l.value={}}const au=le(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Ei(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:Ct(l.value,h)}function lu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Ei(c),Vt(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:D,selectedLiveOverlay:V,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:me,messages:L,isLoadingThreads:re,isLoadingMessages:Be,isSendingMessage:He,isInterruptingTurn:Ge,isAutoRefreshEnabled:Je,autoRefreshSecondsLeft:lt,error:be,refreshAll:M,refreshSkills:Xn,selectThread:oe,setThreadScrollState:Z,archiveThreadById:Ne,renameThreadById:Tt,sendMessageToSelectedThread:Vt,sendMessageToNewThread:Zt,interruptSelectedThreadTurn:Yc,rollbackSelectedThread:Jc,isRollingBack:Ae,selectedThreadQueuedMessages:au,removeQueuedMessage:Ei,steerQueuedMessage:lu,setSelectedModelId:ne,setSelectedReasoningEffort:ge,respondToPendingServerRequest:su,renameProject:Qc,removeProject:Xc,reorderProject:Zc,pinProjectToTop:eu,toggleAutoRefreshTimer:ou,startPolling:nu,stopPolling:iu}}const R0={class:"sidebar-root"},$0={class:"sidebar-scrollable"},M0=["aria-pressed"],P0={key:1,class:"sidebar-search-bar"},O0={key:0,class:"sidebar-settings-area"},N0={key:0,class:"sidebar-settings-panel"},j0={class:"sidebar-settings-value"},D0={class:"sidebar-settings-value"},L0={class:"content-root"},B0={class:"content-body"},F0={key:1,class:"content-grid"},H0={class:"new-thread-empty"},U0={key:2,class:"content-grid"},V0={class:"content-thread"},W0={class:"composer-with-queue"},q0={class:"build-badge","aria-label":"Worktree name"},ol="codex-web-local.sidebar-collapsed.v1",il="codex-web-local.send-with-enter.v1",al="codex-web-local.in-progress-send-mode.v1",ll="codex-web-local.dark-mode.v1",K0=At({__name:"App",setup(e){const t="faa0",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:_,isLoadingThreads:P,isLoadingMessages:I,isInterruptingTurn:B,isAutoRefreshEnabled:z,autoRefreshSecondsLeft:O,refreshAll:H,refreshSkills:j,selectThread:ae,setThreadScrollState:ue,archiveThreadById:fe,renameThreadById:ke,sendMessageToSelectedThread:se,sendMessageToNewThread:X,interruptSelectedThreadTurn:me,rollbackSelectedThread:re,isRollingBack:Be,selectedThreadQueuedMessages:He,removeQueuedMessage:Ge,steerQueuedMessage:Ae,setSelectedModelId:be,setSelectedReasoningEffort:$e,respondToPendingServerRequest:gt,renameProject:Je,removeProject:lt,reorderProject:Ye,pinProjectToTop:Ze,toggleAutoRefreshTimer:he,startPolling:Se,stopPolling:Te}=I0(),E=zh(),ee=Gh(),{isMobile:Y}=Dc(),ye=N(!1),Me=N(!1),p=N(""),y=N(q()),x=N(""),D=N(!1),V=N(null),L=N("New Project (1)"),te=N(""),ne=N(!1),Q=N(Lr(il,!0)),U=N(yn()),de=N(Br()),ie=le(()=>{const M=E.params.threadId;return typeof M=="string"?M:""}),ge=le(()=>{const M=new Set;for(const oe of n.value)for(const Ne of oe.threads)M.add(Ne.id);return M}),ve=le(()=>E.name==="home"),Le=le(()=>E.name==="skills"),qe=le(()=>{var M;return Le.value?"Skills":ve.value?"New thread":((M=s.value)==null?void 0:M.title)??"Choose a thread"}),Oe=le(()=>z.value?`Auto refresh in ${String(O.value)}s`:"Enable 4s refresh"),nt=le(()=>_.value.filter(M=>{const oe=kt(M.messageType,M.role);return oe==="worked"?!0:!(oe==="turnActivity.live"||oe==="turnError.live"||oe==="agentReasoning.live")})),dt=le(()=>a.value),F=le(()=>ve.value?"__new-thread__":l.value),W=le(()=>{var M,oe;return ve.value?p.value.trim():((oe=(M=s.value)==null?void 0:M.cwd)==null?void 0:oe.trim())??""}),J=le(()=>{var M;return!ve.value&&((M=s.value)==null?void 0:M.inProgress)===!0}),Ke=le(()=>{var Tt,Vt;const M=[],oe=new Set;for(const Zt of n.value){const wn=((Vt=(Tt=Zt.threads[0])==null?void 0:Tt.cwd)==null?void 0:Vt.trim())??"";!wn||oe.has(wn)||(oe.add(wn),M.push({value:wn,label:r.value[Zt.projectName]??Zt.projectName}))}const Ne=p.value.trim();return Ne&&!oe.has(Ne)&&M.unshift({value:Ne,label:gr(Ne)}),M}),w=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;qn(()=>{window.addEventListener("keydown",zn),R(),w==null||w.addEventListener("change",R),It(),Nr(),vn()}),Gs(()=>{window.removeEventListener("keydown",zn),w==null||w.removeEventListener("change",R),Te()});function A(){j()}function $(){D.value=!D.value,D.value?Gt(()=>{var M;return(M=V.value)==null?void 0:M.focus()}):x.value=""}function Z(){var M;x.value="",(M=V.value)==null||M.focus()}function xe(M){M.key==="Escape"&&(D.value=!1,x.value="")}function Ce(M){M&&(E.name==="thread"&&ie.value===M||(ee.push({name:"thread",params:{threadId:M}}),Y.value&&jt(!0)))}function ct(M){fe(M)}function et(M){var Tt,Vt;const oe=n.value.find(Zt=>Zt.projectName===M),Ne=((Vt=(Tt=oe==null?void 0:oe.threads[0])==null?void 0:Tt.cwd)==null?void 0:Vt.trim())??"";Ne&&(p.value=Ne),Y.value&&jt(!0),!ve.value&&ee.push({name:"home"})}function it(){var oe,Ne;const M=((Ne=(oe=s.value)==null?void 0:oe.cwd)==null?void 0:Ne.trim())??"";M&&(p.value=M),Y.value&&jt(!0),!ve.value&&ee.push({name:"home"})}function ut(M){Je(M.projectName,M.displayName)}function Pe(M){ke(M.threadId,M.title)}function Re(M){lt(M)}function gn(M){Ye(M.projectName,M.toIndex)}function Ut(M){ue(M.threadId,M.state)}function Pr(M){gt(M)}function Gn(){he()}function jt(M){y.value!==M&&(y.value=M,Fe(M))}function zn(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),jt(!y.value))}function Yn(M){const oe=M.text;if(ve.value){Xn(oe,M.imageUrls,M.skills,M.fileAttachments);return}se(oe,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function Or(M){p.value=M.trim()}async function hr(M){const oe=M.trim();if(!oe)return;const Ne=mr(oe),Tt=await pr(),Vt=Ne?oe:jr(Tt,oe);if(Vt)try{const Zt=await ly(Vt,{createIfMissing:!Ne,label:Ne?"":oe});Zt&&(p.value=Zt,Ze(gr(Zt)),vn())}catch{}}async function pr(){const M=Qt();if(M)return M;try{const oe=await Ja();if(oe)return te.value=oe,oe}catch{}return""}function mr(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function vn(){const M=Qt();if(!M){L.value="New Project (1)";return}try{const oe=await cy(M);L.value=oe.name||"New Project (1)"}catch{L.value="New Project (1)"}}function Qt(){var Ne,Tt;const M=p.value.trim();if(M)return Jn(M);const oe=((Tt=(Ne=Ke.value[0])==null?void 0:Ne.value)==null?void 0:Tt.trim())??"";return oe?Jn(oe):te.value.trim()}async function Nr(){try{te.value=await Ja()}catch{te.value=""}}function Jn(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const Ne=oe.lastIndexOf("/");return Ne<=0?"":oe.slice(0,Ne)}function gr(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const Ne=oe.lastIndexOf("/");return Ne<0?oe:oe.slice(Ne+1)}function jr(M,oe){const Ne=M.trim().replace(/\/+$/,""),Tt=oe.trim().replace(/^\/+/,"");return!Ne||!Tt?"":`${Ne}/${Tt}`}function Qn(M){be(M)}function vr(M){$e(M)}function Nn(){me()}function Dr(M){re(M.turnIndex)}function Lr(M,oe){if(typeof window>"u")return oe;const Ne=window.localStorage.getItem(M);return Ne===null?oe:Ne==="1"}function Br(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(ll);return M==="light"||M==="dark"?M:"system"}function yn(){return typeof window>"u"?"queue":window.localStorage.getItem(al)==="steer"?"steer":"queue"}function Fr(){Q.value=!Q.value,window.localStorage.setItem(il,Q.value?"1":"0")}function k(){U.value=U.value==="steer"?"queue":"steer",window.localStorage.setItem(al,U.value)}function C(){const M=["system","light","dark"],oe=M.indexOf(de.value);de.value=M[(oe+1)%M.length],window.localStorage.setItem(ll,de.value),R()}function R(){const M=document.documentElement;if(de.value==="dark")M.classList.add("dark");else if(de.value==="light")M.classList.remove("dark");else{const oe=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",oe)}}function q(){return typeof window>"u"?!1:window.localStorage.getItem(ol)==="1"}function Fe(M){typeof window>"u"||window.localStorage.setItem(ol,M?"1":"0")}function kt(M,oe){const Ne=(M??"").trim();return Ne.length>0?Ne:oe.trim()||"message"}async function It(){await H(),Me.value=!0,await Xt(),Se()}async function Xt(){if(!ye.value){ye.value=!0;try{if(E.name==="home"||E.name==="skills"){l.value!==""&&await ae("");return}if(E.name==="thread"){const M=ie.value;if(!M)return;if(!ge.value.has(M)){await ee.replace({name:"home"});return}l.value!==M&&await ae(M);return}}finally{ye.value=!1}}}yt(()=>[E.name,ie.value,P.value,ge.value.has(ie.value),l.value],async()=>{Me.value&&await Xt()}),yt(()=>l.value,async M=>{if(Me.value&&!ye.value&&!(ve.value||Le.value)){if(!M){E.name!=="home"&&await ee.replace({name:"home"});return}E.name==="thread"&&ie.value===M||await ee.replace({name:"thread",params:{threadId:M}})}}),yt(()=>Ke.value,M=>{if(M.length===0){p.value="";return}M.some(Ne=>Ne.value===p.value)||(p.value=M[0].value),vn()},{immediate:!0}),yt(()=>p.value,()=>{vn()}),yt(Y,M=>{M&&!y.value&&jt(!0)});async function Xn(M,oe=[],Ne=[],Tt=[]){try{const Vt=await X(M,p.value,oe,Ne,Tt);if(!Vt)return;await ee.replace({name:"thread",params:{threadId:Vt}})}catch{}}return(M,oe)=>(b(),S(Ue,null,[Ee(ep,{"is-sidebar-collapsed":y.value,onCloseSidebar:oe[5]||(oe[5]=Ne=>jt(!0))},{sidebar:at(()=>[m("section",R0,[m("div",$0,[y.value?ce("",!0):(b(),mt(Za,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":y.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":Oe.value,"show-new-thread-button":!0,onToggleSidebar:oe[0]||(oe[0]=Ne=>jt(!y.value)),onToggleAutoRefresh:Gn,onStartNewThread:it},{default:at(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":D.value,"aria-label":"Search threads",title:"Search threads",onClick:$},[Ee(zo,{class:"sidebar-search-toggle-icon"})],8,M0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!y.value&&D.value?(b(),S("div",P0,[Ee(zo,{class:"sidebar-search-bar-icon"}),Mn(m("input",{ref_key:"sidebarSearchInputRef",ref:V,"onUpdate:modelValue":oe[1]||(oe[1]=Ne=>x.value=Ne),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:xe},null,544),[[Pn,x.value]]),x.value.length>0?(b(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Z},[Ee(_i,{class:"sidebar-search-clear-icon"})])):ce("",!0)])):ce("",!0),y.value?ce("",!0):(b(),S("button",{key:2,class:ht(["sidebar-skills-link",{"is-active":Le.value}]),type:"button",onClick:oe[2]||(oe[2]=Ne=>{je(ee).push({name:"skills"}),je(Y)&&jt(!0)})}," Skills Hub ",2)),y.value?ce("",!0):(b(),mt(Fm,{key:3,groups:je(n),"project-display-name-by-id":je(r),"selected-thread-id":je(l),"is-loading":je(P),"search-query":x.value,onSelect:Ce,onArchive:ct,onStartNewThread:et,onRenameProject:ut,onRenameThread:Pe,onRemoveProject:Re,onReorderProject:gn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))]),y.value?ce("",!0):(b(),S("div",O0,[Ee(Sc,{name:"settings-panel"},{default:at(()=>[ne.value?(b(),S("div",N0,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Fr},[oe[6]||(oe[6]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:ht(["sidebar-settings-toggle",{"is-on":!Q.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:k},[oe[7]||(oe[7]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",j0,_e(U.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:C},[oe[8]||(oe[8]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",D0,_e(de.value==="system"?"System":de.value==="dark"?"Dark":"Light"),1)])])):ce("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:oe[3]||(oe[3]=Ne=>ne.value=!ne.value)},[Ee(s0,{class:"sidebar-settings-icon"}),oe[9]||(oe[9]=m("span",null,"Settings",-1))])]))])]),content:at(()=>[m("section",L0,[Ee(Km,{title:qe.value},{leading:at(()=>[y.value||je(Y)?(b(),mt(Za,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":y.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":Oe.value,"show-new-thread-button":!0,onToggleSidebar:oe[4]||(oe[4]=Ne=>jt(!y.value)),onToggleAutoRefresh:Gn,onStartNewThread:it},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ce("",!0)]),_:1},8,["title"]),m("section",B0,[Le.value?(b(),mt(Lb,{key:0,onSkillsChanged:A})):ve.value?(b(),S("div",F0,[m("div",H0,[oe[10]||(oe[10]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ee(Go,{class:"new-thread-folder-dropdown","model-value":p.value,options:Ke.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":L.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Or,onAdd:hr},null,8,["model-value","options","default-add-value"])]),Ee(Qa,{"active-thread-id":F.value,cwd:W.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Q.value,"in-progress-submit-mode":U.value,onSubmit:Yn,"onUpdate:selectedModel":Qn,"onUpdate:selectedReasoningEffort":vr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(b(),S("div",U0,[m("div",V0,[Ee(kv,{messages:nt.value,"is-loading":je(I),"active-thread-id":F.value,"scroll-state":je(o),"live-overlay":dt.value,"pending-requests":je(i),"is-turn-in-progress":J.value,"is-rolling-back":je(Be),onUpdateScrollState:Ut,onRespondServerRequest:Pr,onRollback:Dr},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",W0,[Ee(Uw,{messages:je(He),onSteer:je(Ae),onDelete:je(Ge)},null,8,["messages","onSteer","onDelete"]),Ee(Qa,{"active-thread-id":F.value,cwd:W.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":J.value,"is-interrupting-turn":je(B),"has-queue-above":je(He).length>0,"send-with-enter":Q.value,"in-progress-submit-mode":U.value,onSubmit:Yn,"onUpdate:selectedModel":Qn,"onUpdate:selectedReasoningEffort":vr,onInterrupt:Nn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",q0," WT "+_e(je(t)),1)],64))}}),G0=Xe(K0,[["__scopeId","data-v-f5dc91ef"]]),Ao={render:()=>null},z0=Kh({history:Sh(),routes:[{path:"/",name:"home",component:Ao},{path:"/thread/:threadId",name:"thread",component:Ao},{path:"/skills",name:"skills",component:Ao},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Df(G0).use(z0).mount("#app");
|