codexapp 0.1.25 → 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 +274 -135
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-Bhfj4wvl.js +0 -48
- package/dist/assets/index-CBIbfWDP.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 ai(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ht={},Mr=[],gn=()=>{},ml=()=>!1,Ws=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),li=e=>e.startsWith("onUpdate:"),St=Object.assign,ci=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,st=(e,t)=>du.call(e,t),Le=Array.isArray,Pr=e=>vs(e)==="[object Map]",gl=e=>vs(e)==="[object Set]",Fi=e=>vs(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",vl=e=>(ot(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),yl=Object.prototype.toString,vs=e=>yl.call(e),fu=e=>vs(e).slice(8,-1),wl=e=>vs(e)==="[object Object]",ui=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,es=ai(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,Vt=qs(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,Jn=qs(e=>e.replace(pu,"-$1").toLowerCase()),Ks=qs(e=>e.charAt(0).toUpperCase()+e.slice(1)),co=qs(e=>e?`on${Ks(e)}`:""),pn=(e,t)=>!Object.is(e,t),As=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},bl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},di=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Hi;const Gs=()=>Hi||(Hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=bt(r)?wu(r):vr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(bt(e)||ot(e))return e}const gu=/;(?![^(]*\))/g,vu=/:([^]+)/,yu=/\/\*[^]*?\*\//g;function wu(e){const t={};return e.replace(yu,"").split(gu).forEach(n=>{if(n){const r=n.split(vu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ct(e){let t="";if(bt(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=ct(e[n]);r&&(t+=r+" ")}else if(ot(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=ai(bu);function _l(e){return!!e||e===""}function ku(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=fi(e[r],t[r]);return n}function fi(e,t){if(e===t)return!0;let n=Fi(e),r=Fi(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=Le(e),r=Le(t),n||r)return n&&r?ku(e,t):!1;if(n=ot(e),r=ot(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!fi(e[i],t[i]))return!1}}return String(e)===String(t)}const kl=e=>!!(e&&e.__v_isRef===!0),fe=e=>bt(e)?e:e==null?"":Le(e)||ot(e)&&(e.toString===yl||!Ve(e.toString))?kl(e)?fe(e.value):JSON.stringify(e,Tl,2):String(e),Tl=(e,t)=>kl(t)?Tl(e,t.value):Pr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[uo(r,o)+" =>"]=s,n),{})}:gl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>uo(n))}:nn(t)?uo(t):ot(t)&&!Le(t)&&!wl(t)?String(t):t,uo=(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 Tu{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=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 Su(){return Wt}let gt;const fo=new WeakSet;class Sl{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,fo.has(this)&&(fo.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Cl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ui(this),El(this);const t=gt,n=en;gt=this,en=!0;try{return this.fn()}finally{Al(this),gt=t,en=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mi(t);this.deps=this.depsTail=void 0,Ui(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fo.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){jo(this)&&this.run()}get dirty(){return jo(this)}}let xl=0,ts,ns;function Cl(e,t=!1){if(e.flags|=8,t){e.next=ns,ns=e;return}e.next=ts,ts=e}function hi(){xl++}function pi(){if(--xl>0)return;if(ns){let t=ns;for(ns=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ts;){let t=ts;for(ts=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 El(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Al(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),mi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function jo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Il(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Il(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ls)||(e.globalVersion=ls,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!jo(e))))return;e.flags|=2;const t=e.dep,n=gt,r=en;gt=e,en=!0;try{El(e);const s=e.fn(e._value);(t.version===0||pn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{gt=n,en=r,Al(e),e.flags&=-3}}function mi(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)mi(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let en=!0;const Rl=[];function An(){Rl.push(en),en=!1}function In(){const e=Rl.pop();en=e===void 0?!0:e}function Ui(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let ls=0;class Cu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!gt||!en||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Cu(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,$l(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,ls++,this.notify(t)}notify(t){hi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{pi()}}}function $l(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)$l(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Do=new WeakMap,mr=Symbol(""),Lo=Symbol(""),cs=Symbol("");function Ot(e,t,n){if(en&>){let r=Do.get(e);r||Do.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new gi),s.map=r,s.key=n),s.track()}}function xn(e,t,n,r,s,o){const i=Do.get(e);if(!i){ls++;return}const a=l=>{l&&l.trigger()};if(hi(),t==="clear")i.forEach(a);else{const l=Le(e),d=l&&ui(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===cs||!nn(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(cs)),t){case"add":l?d&&a(i.get("length")):(a(i.get(mr)),Pr(e)&&a(i.get(Lo)));break;case"delete":l||(a(i.get(mr)),Pr(e)&&a(i.get(Lo)));break;case"set":Pr(e)&&a(i.get(mr));break}}pi()}function Er(e){const t=nt(e);return t===e?t:(Ot(t,"iterate",cs),Zt(e)?t:t.map(rn))}function zs(e){return Ot(e=nt(e),"iterate",cs),e}function fn(e,t){return Rn(e)?Dr(gr(e)?rn(t):t):rn(t)}const Eu={__proto__:null,[Symbol.iterator](){return ho(this,Symbol.iterator,e=>fn(this,e))},concat(...e){return Er(this).concat(...e.map(t=>Le(t)?Er(t):t))},entries(){return ho(this,"entries",e=>(e[1]=fn(this,e[1]),e))},every(e,t){return bn(this,"every",e,t,void 0,arguments)},filter(e,t){return bn(this,"filter",e,t,n=>n.map(r=>fn(this,r)),arguments)},find(e,t){return bn(this,"find",e,t,n=>fn(this,n),arguments)},findIndex(e,t){return bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return bn(this,"findLast",e,t,n=>fn(this,n),arguments)},findLastIndex(e,t){return bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return po(this,"includes",e)},indexOf(...e){return po(this,"indexOf",e)},join(e){return Er(this).join(e)},lastIndexOf(...e){return po(this,"lastIndexOf",e)},map(e,t){return bn(this,"map",e,t,void 0,arguments)},pop(){return Kr(this,"pop")},push(...e){return Kr(this,"push",e)},reduce(e,...t){return Vi(this,"reduce",e,t)},reduceRight(e,...t){return Vi(this,"reduceRight",e,t)},shift(){return Kr(this,"shift")},some(e,t){return bn(this,"some",e,t,void 0,arguments)},splice(...e){return Kr(this,"splice",e)},toReversed(){return Er(this).toReversed()},toSorted(e){return Er(this).toSorted(e)},toSpliced(...e){return Er(this).toSpliced(...e)},unshift(...e){return Kr(this,"unshift",e)},values(){return ho(this,"values",e=>fn(this,e))}};function ho(e,t,n){const r=zs(e),s=r[t]();return r!==e&&!Zt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Au=Array.prototype;function bn(e,t,n,r,s,o){const i=zs(e),a=i!==e&&!Zt(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?rn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,fn(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 Vi(e,t,n,r){const s=zs(e),o=s!==e&&!Zt(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,u,f){return a&&(a=!1,d=fn(e,d)),n.call(this,d,fn(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?fn(e,l):l}function po(e,t,n){const r=nt(e);Ot(r,"iterate",cs);const s=r[t](...n);return(s===-1||s===!1)&&wi(n[0])?(n[0]=nt(n[0]),r[t](...n)):s}function Kr(e,t,n=[]){An(),hi();const r=nt(e)[t].apply(e,n);return pi(),In(),r}const Iu=ai("__proto__,__v_isRef,__isVue"),Ml=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nn));function Ru(e){nn(e)||(e=String(e));const t=nt(this);return Ot(t,"has",e),t.hasOwnProperty(e)}class Pl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Fu:Dl:o?jl:Nl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Dt(t)?t:r);if((nn(n)?Ml.has(n):Iu(n))||(s||Ot(t,"get",n),o))return a;if(Dt(a)){const l=i&&ui(n)?a:a.value;return s&&ot(l)?Fo(l):l}return ot(a)?s?Fo(a):Ys(a):a}}class Ol extends Pl{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&ui(n);if(!this._isShallow){const d=Rn(o);if(!Zt(r)&&!Rn(r)&&(o=nt(o),r=nt(r)),!i&&Dt(o)&&!Dt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:st(t,n),l=Reflect.set(t,n,r,Dt(t)?t:s);return t===nt(s)&&(a?pn(r,o)&&xn(t,"set",n,r):xn(t,"add",n,r)),l}deleteProperty(t,n){const r=st(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&xn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!nn(n)||!Ml.has(n))&&Ot(t,"has",n),r}ownKeys(t){return Ot(t,"iterate",Le(t)?"length":mr),Reflect.ownKeys(t)}}class $u extends Pl{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Ol,Pu=new $u,Ou=new Ol(!0);const Bo=e=>e,bs=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=nt(s),i=Pr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Bo:t?Dr:rn;return!t&&Ot(o,"iterate",l?Lo:mr),St(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 _s(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ju(e,t){const n={get(s){const o=this.__v_raw,i=nt(o),a=nt(s);e||(pn(s,a)&&Ot(i,"get",s),Ot(i,"get",a));const{has:l}=bs(i),d=t?Bo:e?Dr:rn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Ot(nt(s),"iterate",mr),s.size},has(s){const o=this.__v_raw,i=nt(o),a=nt(s);return e||(pn(s,a)&&Ot(i,"has",s),Ot(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=nt(a),d=t?Bo:e?Dr:rn;return!e&&Ot(l,"iterate",mr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return St(n,e?{add:_s("add"),set:_s("set"),delete:_s("delete"),clear:_s("clear")}:{add(s){const o=nt(this),i=bs(o),a=nt(s),l=!t&&!Zt(s)&&!Rn(s)?a:s;return i.has.call(o,l)||pn(s,l)&&i.has.call(o,s)||pn(a,l)&&i.has.call(o,a)||(o.add(l),xn(o,"add",l,l)),this},set(s,o){!t&&!Zt(o)&&!Rn(o)&&(o=nt(o));const i=nt(this),{has:a,get:l}=bs(i);let d=a.call(i,s);d||(s=nt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?pn(o,u)&&xn(i,"set",s,o):xn(i,"add",s,o),this},delete(s){const o=nt(this),{has:i,get:a}=bs(o);let l=i.call(o,s);l||(s=nt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&xn(o,"delete",s,void 0),d},clear(){const s=nt(this),o=s.size!==0,i=s.clear();return o&&xn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function vi(e,t){const n=ju(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(st(n,s)&&s in r?n:r,s,o)}const Du={get:vi(!1,!1)},Lu={get:vi(!1,!0)},Bu={get:vi(!0,!1)};const Nl=new WeakMap,jl=new WeakMap,Dl=new WeakMap,Fu=new WeakMap;function Hu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Hu(fu(e))}function Ys(e){return Rn(e)?e:yi(e,!1,Mu,Du,Nl)}function Ll(e){return yi(e,!1,Ou,Lu,jl)}function Fo(e){return yi(e,!0,Pu,Bu,Dl)}function yi(e,t,n,r,s){if(!ot(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Uu(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function gr(e){return Rn(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function Rn(e){return!!(e&&e.__v_isReadonly)}function Zt(e){return!!(e&&e.__v_isShallow)}function wi(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function Vu(e){return!st(e,"__v_skip")&&Object.isExtensible(e)&&bl(e,"__v_skip",!0),e}const rn=e=>ot(e)?Ys(e):e,Dr=e=>ot(e)?Fo(e):e;function Dt(e){return e?e.__v_isRef===!0:!1}function P(e){return Bl(e,!1)}function Wu(e){return Bl(e,!0)}function Bl(e,t){return Dt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new gi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:rn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Zt(t)||Rn(t);t=r?t:nt(t),pn(t,n)&&(this._rawValue=t,this._value=r?t:rn(t),this.dep.trigger())}}function je(e){return Dt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Dt(s)&&!Dt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Fl(e){return gr(e)?e:new Proxy(e,Ku)}class Gu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new gi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ls-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&>!==this)return Cl(this,!0),!0}get value(){const t=this.dep.track();return Il(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zu(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const ks={},Os=new WeakMap;let dr;function Yu(e,t=!1,n=dr){if(n){let r=Os.get(n);r||Os.set(n,r=[]),r.push(e)}}function Ju(e,t,n=ht){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=D=>s?D:Zt(D)||s===!1||s===0?Cn(D,1):Cn(D);let u,f,g,_,N=!1,I=!1;if(Dt(e)?(f=()=>e.value,N=Zt(e)):gr(e)?(f=()=>d(e),N=!0):Le(e)?(I=!0,N=e.some(D=>gr(D)||Zt(D)),f=()=>e.map(D=>{if(Dt(D))return D.value;if(gr(D))return d(D);if(Ve(D))return l?l(D,2):D()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){An();try{g()}finally{In()}}const D=dr;dr=u;try{return l?l(e,3,[_]):e(_)}finally{dr=D}}:f=gn,t&&s){const D=f,ae=s===!0?1/0:s;f=()=>Cn(D(),ae)}const F=Su(),z=()=>{u.stop(),F&&F.active&&ci(F.effects,u)};if(o&&t){const D=t;t=(...ae)=>{D(...ae),z()}}let j=I?new Array(e.length).fill(ks):ks;const U=D=>{if(!(!(u.flags&1)||!u.dirty&&!D))if(t){const ae=u.run();if(s||N||(I?ae.some((ue,de)=>pn(ue,j[de])):pn(ae,j))){g&&g();const ue=dr;dr=u;try{const de=[ae,j===ks?void 0:I&&j[0]===ks?[]:j,_];j=ae,l?l(t,3,de):t(...de)}finally{dr=ue}}}else u.run()};return a&&a(U),u=new Sl(f),u.scheduler=i?()=>i(U,!1):U,_=D=>Yu(D,!1,u),g=u.onStop=()=>{const D=Os.get(u);if(D){if(l)l(D,4);else for(const ae of D)ae();Os.delete(u)}},t?r?U(!0):j=u.run():i?i(U.bind(null,!0),!0):u.run(),z.pause=u.pause.bind(u),z.resume=u.resume.bind(u),z.stop=z,z}function Cn(e,t=1/0,n){if(t<=0||!ot(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Dt(e))Cn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Cn(e[r],t,n);else if(gl(e)||Pr(e))e.forEach(r=>{Cn(r,t,n)});else if(wl(e)){for(const r in e)Cn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Cn(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 ys(e,t,n,r){try{return r?e(...r):e()}catch(s){Js(s,t,n)}}function sn(e,t,n,r){if(Ve(e)){const s=ys(e,t,n,r);return s&&vl(s)&&s.catch(o=>{Js(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(sn(e[o],t,n,r));return s}}function Js(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ht;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){An(),ys(o,null,10,[e,l,d]),In();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ht=[];let un=-1;const Or=[];let Kn=null,Ir=0;const Hl=Promise.resolve();let Ns=null;function Yt(e){const t=Ns||Hl;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=un+1,n=Ht.length;for(;t<n;){const r=t+n>>>1,s=Ht[r],o=us(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function bi(e){if(!(e.flags&1)){const t=us(e),n=Ht[Ht.length-1];!n||!(e.flags&2)&&t>=us(n)?Ht.push(e):Ht.splice(Xu(t),0,e),e.flags|=1,Ul()}}function Ul(){Ns||(Ns=Hl.then(Wl))}function Zu(e){Le(e)?Or.push(...e):Kn&&e.id===-1?Kn.splice(Ir+1,0,e):e.flags&1||(Or.push(e),e.flags|=1),Ul()}function Wi(e,t,n=un+1){for(;n<Ht.length;n++){const r=Ht[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ht.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Vl(e){if(Or.length){const t=[...new Set(Or)].sort((n,r)=>us(n)-us(r));if(Or.length=0,Kn){Kn.push(...t);return}for(Kn=t,Ir=0;Ir<Kn.length;Ir++){const n=Kn[Ir];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Kn=null,Ir=0}}const us=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Wl(e){try{for(un=0;un<Ht.length;un++){const t=Ht[un];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ys(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;un<Ht.length;un++){const t=Ht[un];t&&(t.flags&=-2)}un=-1,Ht.length=0,Vl(),Ns=null,(Ht.length||Or.length)&&Wl()}}let It=null,ql=null;function js(e){const t=It;return It=e,ql=e&&e.type.__scopeId||null,t}function at(e,t=It,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Fs(-1);const o=js(t);let i;try{i=e(...s)}finally{js(o),r._d&&Fs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function $n(e,t){if(It===null)return e;const n=no(It),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=ht]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&Cn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function ir(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&&(An(),sn(l,n,8,[e.el,a,e,t]),In())}}function Is(e,t){if(jt){let n=jt.provides;const r=jt.parent&&jt.parent.provides;r===n&&(n=jt.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=xi();if(r||jr){let s=jr?jr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ve(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>tn(ed);function lt(e,t,n){return Kl(e,t,n)}function Kl(e,t,n=ht){const{immediate:r,deep:s,flush:o,once:i}=n,a=St({},n),l=t&&r||!t&&o!=="post";let d;if(ps){if(o==="sync"){const _=td();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=gn,_.resume=gn,_.pause=gn,_}}const u=jt;a.call=(_,N,I)=>sn(_,u,N,I);let f=!1;o==="post"?a.scheduler=_=>{Pt(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,N)=>{N?_():bi(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const g=Ju(e,t,a);return ps&&(d?d.push(g):l&&g()),g}function nd(e,t,n){const r=this.proxy,s=bt(e)?e.includes(".")?Gl(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=ws(this),a=Kl(s,o.bind(r),n);return i(),a}function Gl(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 zl=Symbol("_vte"),Yl=e=>e.__isTeleport,rs=e=>e&&(e.disabled||e.disabled===""),qi=e=>e&&(e.defer||e.defer===""),Ki=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Gi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ho=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},Jl={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:_,querySelector:N,createText:I,createComment:F}}=d,z=rs(t.props);let{shapeFlag:j,children:U,dynamicChildren:D}=t;if(e==null){const ae=t.el=I(""),ue=t.anchor=I("");_(ae,n,r),_(ue,n,r);const de=(oe,X)=>{j&16&&u(U,oe,X,s,o,i,a,l)},Te=()=>{const oe=t.target=Ho(t.props,N),X=Uo(oe,t,I,_);oe&&(i!=="svg"&&Ki(oe)?i="svg":i!=="mathml"&&Gi(oe)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(oe),z||(de(oe,X),Rs(t,!1)))};z&&(de(n,ue),Rs(t,!0)),qi(t.props)?(t.el.__isMounted=!1,Pt(()=>{Te(),delete t.el.__isMounted},o)):Te()}else{if(qi(t.props)&&e.el.__isMounted===!1){Pt(()=>{Jl.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,de=t.targetAnchor=e.targetAnchor,Te=rs(e.props),oe=Te?n:ue,X=Te?ae:de;if(i==="svg"||Ki(ue)?i="svg":(i==="mathml"||Gi(ue))&&(i="mathml"),D?(g(e.dynamicChildren,D,oe,s,o,i,a),Ti(e,t,!0)):l||f(e,t,oe,X,s,o,i,a,!1),z)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ts(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const me=t.target=Ho(t.props,N);me&&Ts(t,me,null,d,0)}else Te&&Ts(t,ue,de,d,1);Rs(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||!rs(g);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,_,!!I.dynamicChildren)}}},move:Ts,hydrate:rd};function Ts(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||rs(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function rd(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(F,z){let j=z;for(;j;){if(j&&j.nodeType===8){if(j.data==="teleport start anchor")t.targetStart=j;else if(j.data==="teleport anchor"){t.targetAnchor=j,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}j=i(j)}}function _(F,z){z.anchor=f(i(F),z,a(F),n,r,s,o)}const N=t.target=Ho(t.props,l),I=rs(t.props);if(N){const F=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(_(e,t),g(N,F),t.targetAnchor||Uo(N,t,u,d,a(e)===N?e:null)):(t.anchor=i(e),g(N,F),t.targetAnchor||Uo(N,t,u,d),f(F&&i(F),t,N,n,r,s,o))),Rs(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ds=Jl;function Rs(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 Uo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[zl]=i,e&&(r(o,e,s),r(i,e,s)),i}const dn=Symbol("_leaveCb"),Gr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return On(()=>{e.isMounted=!0}),Nn(()=>{e.isUnmounting=!0}),e}const Qt=[Function,Array],Ql={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Qt,onEnter:Qt,onAfterEnter:Qt,onEnterCancelled:Qt,onBeforeLeave:Qt,onLeave:Qt,onAfterLeave:Qt,onLeaveCancelled:Qt,onBeforeAppear:Qt,onAppear:Qt,onAfterAppear:Qt,onAppearCancelled:Qt},Xl=e=>{const t=e.subTree;return t.component?Xl(t.component):t},od={name:"BaseTransition",props:Ql,setup(e,{slots:t}){const n=xi(),r=sd();return()=>{const s=t.default&&tc(t.default(),!0);if(!s||!s.length)return;const o=Zl(s),i=nt(e),{mode:a}=i;if(r.isLeaving)return mo(o);const l=zi(o);if(!l)return mo(o);let d=Vo(l,i,r,n,f=>d=f);l.type!==Nt&&ds(l,d);let u=n.subTree&&zi(n.subTree);if(u&&u.type!==Nt&&!fr(u,l)&&Xl(n).type!==Nt){let f=Vo(u,i,r,n);if(ds(u,f),a==="out-in"&&l.type!==Nt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},mo(o);a==="in-out"&&l.type!==Nt?f.delayLeave=(g,_,N)=>{const I=ec(r,u);I[String(u.key)]=u,g[dn]=()=>{_(),g[dn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Zl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nt){t=n;break}}return t}const id=od;function ec(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 Vo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:_,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:F,onAppear:z,onAfterAppear:j,onAppearCancelled:U}=t,D=String(e.key),ae=ec(n,e),ue=(oe,X)=>{oe&&sn(oe,r,9,X)},de=(oe,X)=>{const me=X[1];ue(oe,X),Le(oe)?oe.every(ne=>ne.length<=1)&&me():oe.length<=1&&me()},Te={mode:i,persisted:a,beforeEnter(oe){let X=l;if(!n.isMounted)if(o)X=F||l;else return;oe[dn]&&oe[dn](!0);const me=ae[D];me&&fr(e,me)&&me.el[dn]&&me.el[dn](),ue(X,[oe])},enter(oe){if(ae[D]===e)return;let X=d,me=u,ne=f;if(!n.isMounted)if(o)X=z||d,me=j||u,ne=U||f;else return;let Be=!1;oe[Gr]=Ge=>{Be||(Be=!0,Ge?ue(ne,[oe]):ue(me,[oe]),Te.delayedLeave&&Te.delayedLeave(),oe[Gr]=void 0)};const He=oe[Gr].bind(null,!1);X?de(X,[oe,He]):He()},leave(oe,X){const me=String(e.key);if(oe[Gr]&&oe[Gr](!0),n.isUnmounting)return X();ue(g,[oe]);let ne=!1;oe[dn]=He=>{ne||(ne=!0,X(),He?ue(I,[oe]):ue(N,[oe]),oe[dn]=void 0,ae[me]===e&&delete ae[me])};const Be=oe[dn].bind(null,!1);ae[me]=e,_?de(_,[oe,Be]):Be()},clone(oe){const X=Vo(oe,t,n,r,s);return s&&s(X),X}};return Te}function mo(e){if(Qs(e))return e=Yn(e),e.children=null,e}function zi(e){if(!Qs(e))return Yl(e.type)&&e.children?Zl(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 ds(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ds(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 tc(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(tc(i.children,t,a))):(t||i.type!==Nt)&&r.push(a!=null?Yn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function xt(e,t){return Ve(e)?St({name:e.name},t,{setup:e}):e}function nc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Yi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ls=new WeakMap;function ss(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,F)=>ss(I,t&&(Le(t)?t[F]:t),n,r,s));return}if(Nr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ss(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?no(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===ht?a.refs={}:a.refs,f=a.setupState,g=nt(f),_=f===ht?ml:I=>Yi(u,I)?!1:st(g,I),N=(I,F)=>!(F&&Yi(u,F));if(d!=null&&d!==l){if(Ji(t),bt(d))u[d]=null,_(d)&&(f[d]=null);else if(Dt(d)){const I=t;N(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(Ve(l))ys(l,a,12,[i,u]);else{const I=bt(l),F=Dt(l);if(I||F){const z=()=>{if(e.f){const j=I?_(l)?f[l]:u[l]:N()||!e.k?l.value:u[e.k];if(s)Le(j)&&ci(j,o);else if(Le(j))j.includes(o)||j.push(o);else if(I)u[l]=[o],_(l)&&(f[l]=u[l]);else{const U=[o];N(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else I?(u[l]=i,_(l)&&(f[l]=i)):F&&(N(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const j=()=>{z(),Ls.delete(e)};j.id=-1,Ls.set(e,j),Pt(j,n)}else Ji(e),z()}}}function Ji(e){const t=Ls.get(e);t&&(t.flags|=8,Ls.delete(e))}Gs().requestIdleCallback;Gs().cancelIdleCallback;const Nr=e=>!!e.type.__asyncLoader,Qs=e=>e.type.__isKeepAlive;function ad(e,t){rc(e,"a",t)}function ld(e,t){rc(e,"da",t)}function rc(e,t,n=jt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Xs(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Qs(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=Xs(t,e,r,!0);Zs(()=>{ci(r[t],s)},n)}function Xs(e,t,n=jt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{An();const a=ws(n),l=sn(t,n,e,i);return a(),In(),l});return r?s.unshift(o):s.push(o),o}}const Pn=e=>(t,n=jt)=>{(!ps||e==="sp")&&Xs(e,(...r)=>t(...r),n)},ud=Pn("bm"),On=Pn("m"),dd=Pn("bu"),fd=Pn("u"),Nn=Pn("bum"),Zs=Pn("um"),hd=Pn("sp"),pd=Pn("rtg"),md=Pn("rtc");function gd(e,t=jt){Xs("ec",e,t)}const vd="components",sc=Symbol.for("v-ndc");function Wo(e){return bt(e)?yd(vd,e,!1)||e:e||sc}function yd(e,t,n=!0,r=!1){const s=It||jt;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===Vt(t)||a===Ks(Vt(t))))return o}const i=Qi(s[e]||o[e],t)||Qi(s.appContext[e],t);return!i&&r?o:i}}function Qi(e,t){return e&&(e[t]||e[Vt(t)]||e[Ks(Vt(t))])}function wt(e,t,n,r){let s;const o=n,i=Le(e);if(i||bt(e)){const a=i&&gr(e);let l=!1,d=!1;a&&(l=!Zt(e),d=Rn(e),e=zs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Dr(rn(e[u])):rn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(ot(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function mn(e,t,n={},r,s){if(It.ce||It.parent&&Nr(It.parent)&&It.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ft(Ue,null,[Ce("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&oc(o(n)),a=n.key||i&&i.key,l=ft(Ue,{key:(a&&!nn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function oc(e){return e.some(t=>hs(t)?!(t.type===Nt||t.type===Ue&&!oc(t.children)):!0)?e:null}const qo=e=>e?xc(e)?no(e):qo(e.parent):null,os=St(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=>qo(e.parent),$root:e=>qo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ac(e),$forceUpdate:e=>e.f||(e.f=()=>{bi(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>nd.bind(e)}),go=(e,t)=>e!==ht&&!e.__isScriptSetup&&st(e,t),wd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(go(r,t))return i[t]=1,r[t];if(s!==ht&&st(s,t))return i[t]=2,s[t];if(st(o,t))return i[t]=3,o[t];if(n!==ht&&st(n,t))return i[t]=4,n[t];Ko&&(i[t]=0)}}const d=os[t];let u,f;if(d)return t==="$attrs"&&Ot(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==ht&&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 go(s,t)?(s[t]=n,!0):r!==ht&&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!==ht&&a[0]!=="$"&&st(e,a)||go(t,a)||st(o,a)||st(r,a)||st(os,a)||st(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:st(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=xi();return t.setupContext||(t.setupContext=Ec(t))}function Xi(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ko=!0;function kd(e){const t=ac(e),n=e.proxy,r=e.ctx;Ko=!1,t.beforeCreate&&Zi(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:_,updated:N,activated:I,deactivated:F,beforeDestroy:z,beforeUnmount:j,destroyed:U,unmounted:D,render:ae,renderTracked:ue,renderTriggered:de,errorCaptured:Te,serverPrefetch:oe,expose:X,inheritAttrs:me,components:ne,directives:Be,filters:He}=t;if(d&&Td(d,r,null),i)for(const _e in i){const Me=i[_e];Ve(Me)&&(r[_e]=Me.bind(n))}if(s){const _e=s.call(n,n);ot(_e)&&(e.data=Ys(_e))}if(Ko=!0,o)for(const _e in o){const Me=o[_e],vt=Ve(Me)?Me.bind(n,n):Ve(Me.get)?Me.get.bind(n,n):gn,Ze=!Ve(Me)&&Ve(Me.set)?Me.set.bind(n):gn,ut=ce({get:vt,set:Ze});Object.defineProperty(r,_e,{enumerable:!0,configurable:!0,get:()=>ut.value,set:tt=>ut.value=tt})}if(a)for(const _e in a)ic(a[_e],r,n,_e);if(l){const _e=Ve(l)?l.call(n):l;Reflect.ownKeys(_e).forEach(Me=>{Is(Me,_e[Me])})}u&&Zi(u,e,"c");function Ae(_e,Me){Le(Me)?Me.forEach(vt=>_e(vt.bind(n))):Me&&_e(Me.bind(n))}if(Ae(ud,f),Ae(On,g),Ae(dd,_),Ae(fd,N),Ae(ad,I),Ae(ld,F),Ae(gd,Te),Ae(md,ue),Ae(pd,de),Ae(Nn,j),Ae(Zs,D),Ae(hd,oe),Le(X))if(X.length){const _e=e.exposed||(e.exposed={});X.forEach(Me=>{Object.defineProperty(_e,Me,{get:()=>n[Me],set:vt=>n[Me]=vt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===gn&&(e.render=ae),me!=null&&(e.inheritAttrs=me),ne&&(e.components=ne),Be&&(e.directives=Be),oe&&nc(e)}function Td(e,t,n=gn){Le(e)&&(e=Go(e));for(const r in e){const s=e[r];let o;ot(s)?"default"in s?o=tn(s.from||r,s.default,!0):o=tn(s.from||r):o=tn(s),Dt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Zi(e,t,n){sn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ic(e,t,n,r){let s=r.includes(".")?Gl(n,r):()=>n[r];if(bt(e)){const o=t[e];Ve(o)&<(s,o)}else if(Ve(e))lt(s,e.bind(n));else if(ot(e))if(Le(e))e.forEach(o=>ic(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&<(s,o,e)}}function ac(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=>Bs(l,d,i,!0)),Bs(l,t,i)),ot(t)&&o.set(t,l),l}function Bs(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Bs(e,o,n,!0),s&&s.forEach(i=>Bs(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Sd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Sd={data:ea,props:ta,emits:ta,methods:Zr,computed:Zr,beforeCreate:Bt,created:Bt,beforeMount:Bt,mounted:Bt,beforeUpdate:Bt,updated:Bt,beforeDestroy:Bt,beforeUnmount:Bt,destroyed:Bt,unmounted:Bt,activated:Bt,deactivated:Bt,errorCaptured:Bt,serverPrefetch:Bt,components:Zr,directives:Zr,watch:Cd,provide:ea,inject:xd};function ea(e,t){return t?e?function(){return St(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function xd(e,t){return Zr(Go(e),Go(t))}function Go(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Bt(e,t){return e?[...new Set([].concat(e,t))]:t}function Zr(e,t){return e?St(Object.create(null),e,t):t}function ta(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:St(Object.create(null),Xi(e),Xi(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=St(Object.create(null),e);for(const r in t)n[r]=Bt(e[r],t[r]);return n}function lc(){return{app:null,config:{isNativeTag:ml,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ed=0;function Ad(e,t){return function(r,s=null){Ve(r)||(r=St({},r)),s!=null&&!ot(s)&&(s=null);const o=lc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Ed++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:of,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ve(u.install)?(i.add(u),u.install(d,...f)):Ve(u)&&(i.add(u),u(d,...f))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,f){return f?(o.components[u]=f,d):o.components[u]},directive(u,f){return f?(o.directives[u]=f,d):o.directives[u]},mount(u,f,g){if(!l){const _=d._ceVNode||Ce(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,no(_.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=jr;jr=d;try{return u()}finally{jr=f}}};return d}}let jr=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Vt(t)}Modifiers`]||e[`${Jn(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ht;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>bt(u)?u.trim():u)),i.number&&(s=n.map(di)));let a,l=r[a=co(t)]||r[a=co(Vt(t))];!l&&o&&(l=r[a=co(Jn(t))]),l&&sn(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,sn(d,e,6,s)}}const $d=new WeakMap;function cc(e,t,n=!1){const r=n?$d:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=d=>{const u=cc(d,t,!0);u&&(a=!0,St(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):(Le(o)?o.forEach(l=>i[l]=null):St(i,o),ot(e)&&r.set(e,i),i)}function eo(e,t){return!e||!Ws(t)?!1:(t=t.slice(2).replace(/Once$/,""),st(e,t[0].toLowerCase()+t.slice(1))||st(e,Jn(t))||st(e,t))}function na(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:_,ctx:N,inheritAttrs:I}=e,F=js(e);let z,j;try{if(n.shapeFlag&4){const D=s||r,ae=D;z=hn(d.call(ae,D,u,f,_,g,N)),j=a}else{const D=t;z=hn(D.length>1?D(f,{attrs:a,slots:i,emit:l}):D(f,null)),j=t.props?a:Md(a)}}catch(D){is.length=0,Js(D,e,1),z=Ce(Nt)}let U=z;if(j&&I!==!1){const D=Object.keys(j),{shapeFlag:ae}=U;D.length&&ae&7&&(o&&D.some(li)&&(j=Pd(j,o)),U=Yn(U,j,!1,!0))}return n.dirs&&(U=Yn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&ds(U,n.transition),z=U,js(F),z}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ws(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!li(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Od(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?ra(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(uc(i,r,g)&&!eo(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?ra(r,i,d):!0:!!i;return!1}function ra(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(uc(t,e,o)&&!eo(n,o))return!0}return!1}function uc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ot(r)&&ot(s)?!fi(r,s):r!==s}function Nd({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const dc={},fc=()=>Object.create(dc),hc=e=>Object.getPrototypeOf(e)===dc;function jd(e,t,n,r=!1){const s={},o=fc();e.propsDefaults=Object.create(null),pc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Ll(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Dd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=nt(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let g=u[f];if(eo(e.emitsOptions,g))continue;const _=t[g];if(l)if(st(o,g))_!==o[g]&&(o[g]=_,d=!0);else{const N=Vt(g);s[N]=zo(l,a,N,_,e,!1)}else _!==o[g]&&(o[g]=_,d=!0)}}}else{pc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!st(t,f)&&((u=Jn(f))===f||!st(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=zo(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&&xn(e.attrs,"set","")}function pc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(es(l))continue;const d=t[l];let u;s&&st(s,u=Vt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:eo(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=nt(n),d=a||ht;for(let u=0;u<o.length;u++){const f=o[u];n[f]=zo(s,l,f,d[f],e,!st(d,f))}}return i}function zo(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=ws(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===Jn(n))&&(r=!0))}return r}const Ld=new WeakMap;function mc(e,t,n=!1){const r=n?Ld:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const u=f=>{l=!0;const[g,_]=mc(f,t,!0);St(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,Mr),Mr;if(Le(o))for(let u=0;u<o.length;u++){const f=Vt(o[u]);sa(f)&&(i[f]=ht)}else if(o)for(const u in o){const f=Vt(u);if(sa(f)){const g=o[u],_=i[f]=Le(g)||Ve(g)?{type:g}:St({},g),N=_.type;let I=!1,F=!0;if(Le(N))for(let z=0;z<N.length;++z){const j=N[z],U=Ve(j)&&j.name;if(U==="Boolean"){I=!0;break}else U==="String"&&(F=!1)}else I=Ve(N)&&N.name==="Boolean";_[0]=I,_[1]=F,(I||st(_,"default"))&&a.push(f)}}const d=[i,a];return ot(e)&&r.set(e,d),d}function sa(e){return e[0]!=="$"&&!es(e)}const _i=e=>e==="_"||e==="_ctx"||e==="$stable",ki=e=>Le(e)?e.map(hn):[hn(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=at((...s)=>ki(t(...s)),n);return r._c=!1,r},gc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(_i(s))continue;const o=e[s];if(Ve(o))t[s]=Bd(s,o,r);else if(o!=null){const i=ki(o);t[s]=()=>i}}},vc=(e,t)=>{const n=ki(t);e.slots.default=()=>n},yc=(e,t,n)=>{for(const r in t)(n||!_i(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=fc();if(e.vnode.shapeFlag&32){const s=t._;s?(yc(r,t,n),n&&bl(r,"_",s,!0)):gc(t,r)}else t&&vc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ht;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:yc(s,t,n):(o=!t.$stable,gc(t,s)),i=t}else t&&(vc(e,t),i={default:1});if(o)for(const a in s)!_i(a)&&i[a]==null&&delete s[a]},Pt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Gs();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:_=gn,insertStaticContent:N}=e,I=(p,y,x,O=null,B=null,L=null,ee=void 0,se=null,Q=!!y.dynamicChildren)=>{if(p===y)return;p&&!fr(p,y)&&(O=E(p),tt(p,B,L,!0),p=null),y.patchFlag===-2&&(Q=!1,y.dynamicChildren=null);const{type:V,ref:ye,shapeFlag:ie}=y;switch(V){case to:F(p,y,x,O);break;case Nt:z(p,y,x,O);break;case yo:p==null&&j(y,x,O,ee);break;case Ue:ne(p,y,x,O,B,L,ee,se,Q);break;default:ie&1?ae(p,y,x,O,B,L,ee,se,Q):ie&6?Be(p,y,x,O,B,L,ee,se,Q):(ie&64||ie&128)&&V.process(p,y,x,O,B,L,ee,se,Q,ve)}ye!=null&&B?ss(ye,p&&p.ref,L,y||p,!y):ye==null&&p&&p.ref!=null&&ss(p.ref,null,L,p,!0)},F=(p,y,x,O)=>{if(p==null)r(y.el=a(y.children),x,O);else{const B=y.el=p.el;y.children!==p.children&&d(B,y.children)}},z=(p,y,x,O)=>{p==null?r(y.el=l(y.children||""),x,O):y.el=p.el},j=(p,y,x,O)=>{[p.el,p.anchor]=N(p.children,y,x,O,p.el,p.anchor)},U=({el:p,anchor:y},x,O)=>{let B;for(;p&&p!==y;)B=g(p),r(p,x,O),p=B;r(y,x,O)},D=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=g(p),s(p),p=x;s(y)},ae=(p,y,x,O,B,L,ee,se,Q)=>{if(y.type==="svg"?ee="svg":y.type==="math"&&(ee="mathml"),p==null)ue(y,x,O,B,L,ee,se,Q);else{const V=p.el&&p.el._isVueCE?p.el:null;try{V&&V._beginPatch(),oe(p,y,B,L,ee,se,Q)}finally{V&&V._endPatch()}}},ue=(p,y,x,O,B,L,ee,se)=>{let Q,V;const{props:ye,shapeFlag:ie,transition:ge,dirs:ke}=p;if(Q=p.el=i(p.type,L,ye&&ye.is,ye),ie&8?u(Q,p.children):ie&16&&Te(p.children,Q,null,O,B,vo(p,L),ee,se),ke&&ir(p,null,O,"created"),de(Q,p,p.scopeId,ee,O),ye){for(const We in ye)We!=="value"&&!es(We)&&o(Q,We,null,ye[We],L,O);"value"in ye&&o(Q,"value",null,ye.value,L),(V=ye.onVnodeBeforeMount)&&cn(V,O,p)}ke&&ir(p,null,O,"beforeMount");const Pe=Wd(B,ge);Pe&&ge.beforeEnter(Q),r(Q,y,x),((V=ye&&ye.onVnodeMounted)||Pe||ke)&&Pt(()=>{V&&cn(V,O,p),Pe&&ge.enter(Q),ke&&ir(p,null,O,"mounted")},B)},de=(p,y,x,O,B)=>{if(x&&_(p,x),O)for(let L=0;L<O.length;L++)_(p,O[L]);if(B){let L=B.subTree;if(y===L||_c(L.type)&&(L.ssContent===y||L.ssFallback===y)){const ee=B.vnode;de(p,ee,ee.scopeId,ee.slotScopeIds,B.parent)}}},Te=(p,y,x,O,B,L,ee,se,Q=0)=>{for(let V=Q;V<p.length;V++){const ye=p[V]=se?Sn(p[V]):hn(p[V]);I(null,ye,y,x,O,B,L,ee,se)}},oe=(p,y,x,O,B,L,ee)=>{const se=y.el=p.el;let{patchFlag:Q,dynamicChildren:V,dirs:ye}=y;Q|=p.patchFlag&16;const ie=p.props||ht,ge=y.props||ht;let ke;if(x&&ar(x,!1),(ke=ge.onVnodeBeforeUpdate)&&cn(ke,x,y,p),ye&&ir(y,p,x,"beforeUpdate"),x&&ar(x,!0),(ie.innerHTML&&ge.innerHTML==null||ie.textContent&&ge.textContent==null)&&u(se,""),V?X(p.dynamicChildren,V,se,x,O,vo(y,B),L):ee||Me(p,y,se,null,x,O,vo(y,B),L,!1),Q>0){if(Q&16)me(se,ie,ge,x,B);else if(Q&2&&ie.class!==ge.class&&o(se,"class",null,ge.class,B),Q&4&&o(se,"style",ie.style,ge.style,B),Q&8){const Pe=y.dynamicProps;for(let We=0;We<Pe.length;We++){const Ie=Pe[We],pt=ie[Ie],Ke=ge[Ie];(Ke!==pt||Ie==="value")&&o(se,Ie,pt,Ke,B,x)}}Q&1&&p.children!==y.children&&u(se,y.children)}else!ee&&V==null&&me(se,ie,ge,x,B);((ke=ge.onVnodeUpdated)||ye)&&Pt(()=>{ke&&cn(ke,x,y,p),ye&&ir(y,p,x,"updated")},O)},X=(p,y,x,O,B,L,ee)=>{for(let se=0;se<y.length;se++){const Q=p[se],V=y[se],ye=Q.el&&(Q.type===Ue||!fr(Q,V)||Q.shapeFlag&198)?f(Q.el):x;I(Q,V,ye,null,O,B,L,ee,!0)}},me=(p,y,x,O,B)=>{if(y!==x){if(y!==ht)for(const L in y)!es(L)&&!(L in x)&&o(p,L,y[L],null,B,O);for(const L in x){if(es(L))continue;const ee=x[L],se=y[L];ee!==se&&L!=="value"&&o(p,L,se,ee,B,O)}"value"in x&&o(p,"value",y.value,x.value,B)}},ne=(p,y,x,O,B,L,ee,se,Q)=>{const V=y.el=p?p.el:a(""),ye=y.anchor=p?p.anchor:a("");let{patchFlag:ie,dynamicChildren:ge,slotScopeIds:ke}=y;ke&&(se=se?se.concat(ke):ke),p==null?(r(V,x,O),r(ye,x,O),Te(y.children||[],x,ye,B,L,ee,se,Q)):ie>0&&ie&64&&ge&&p.dynamicChildren&&p.dynamicChildren.length===ge.length?(X(p.dynamicChildren,ge,x,B,L,ee,se),(y.key!=null||B&&y===B.subTree)&&Ti(p,y,!0)):Me(p,y,x,ye,B,L,ee,se,Q)},Be=(p,y,x,O,B,L,ee,se,Q)=>{y.slotScopeIds=se,p==null?y.shapeFlag&512?B.ctx.activate(y,x,O,ee,Q):He(y,x,O,B,L,ee,Q):Ge(p,y,Q)},He=(p,y,x,O,B,L,ee)=>{const se=p.component=Zd(p,O,B);if(Qs(p)&&(se.ctx.renderer=ve),ef(se,!1,ee),se.asyncDep){if(B&&B.registerDep(se,Ae,ee),!p.el){const Q=se.subTree=Ce(Nt);z(null,Q,y,x),p.placeholder=Q.el}}else Ae(se,p,y,x,B,L,ee)},Ge=(p,y,x)=>{const O=y.component=p.component;if(Od(p,y,x))if(O.asyncDep&&!O.asyncResolved){_e(O,y,x);return}else O.next=y,O.update();else y.el=p.el,O.vnode=y},Ae=(p,y,x,O,B,L,ee)=>{const se=()=>{if(p.isMounted){let{next:ie,bu:ge,u:ke,parent:Pe,vnode:We}=p;{const W=wc(p);if(W){ie&&(ie.el=We.el,_e(p,ie,ee)),W.asyncDep.then(()=>{Pt(()=>{p.isUnmounted||V()},B)});return}}let Ie=ie,pt;ar(p,!1),ie?(ie.el=We.el,_e(p,ie,ee)):ie=We,ge&&As(ge),(pt=ie.props&&ie.props.onVnodeBeforeUpdate)&&cn(pt,Pe,ie,We),ar(p,!0);const Ke=na(p),H=p.subTree;p.subTree=Ke,I(H,Ke,f(H.el),E(H),p,B,L),ie.el=Ke.el,Ie===null&&Nd(p,Ke.el),ke&&Pt(ke,B),(pt=ie.props&&ie.props.onVnodeUpdated)&&Pt(()=>cn(pt,Pe,ie,We),B)}else{let ie;const{el:ge,props:ke}=y,{bm:Pe,m:We,parent:Ie,root:pt,type:Ke}=p,H=Nr(y);ar(p,!1),Pe&&As(Pe),!H&&(ie=ke&&ke.onVnodeBeforeMount)&&cn(ie,Ie,y),ar(p,!0);{pt.ce&&pt.ce._hasShadowRoot()&&pt.ce._injectChildStyle(Ke,p.parent?p.parent.type:void 0);const W=p.subTree=na(p);I(null,W,x,O,p,B,L),y.el=W.el}if(We&&Pt(We,B),!H&&(ie=ke&&ke.onVnodeMounted)){const W=y;Pt(()=>cn(ie,Ie,W),B)}(y.shapeFlag&256||Ie&&Nr(Ie.vnode)&&Ie.vnode.shapeFlag&256)&&p.a&&Pt(p.a,B),p.isMounted=!0,y=x=O=null}};p.scope.on();const Q=p.effect=new Sl(se);p.scope.off();const V=p.update=Q.run.bind(Q),ye=p.job=Q.runIfDirty.bind(Q);ye.i=p,ye.id=p.uid,Q.scheduler=()=>bi(ye),ar(p,!0),V()},_e=(p,y,x)=>{y.component=p;const O=p.vnode.props;p.vnode=y,p.next=null,Dd(p,y.props,O,x),Hd(p,y.children,x),An(),Wi(p),In()},Me=(p,y,x,O,B,L,ee,se,Q=!1)=>{const V=p&&p.children,ye=p?p.shapeFlag:0,ie=y.children,{patchFlag:ge,shapeFlag:ke}=y;if(ge>0){if(ge&128){Ze(V,ie,x,O,B,L,ee,se,Q);return}else if(ge&256){vt(V,ie,x,O,B,L,ee,se,Q);return}}ke&8?(ye&16&&Se(V,B,L),ie!==V&&u(x,ie)):ye&16?ke&16?Ze(V,ie,x,O,B,L,ee,se,Q):Se(V,B,L,!0):(ye&8&&u(x,""),ke&16&&Te(ie,x,O,B,L,ee,se,Q))},vt=(p,y,x,O,B,L,ee,se,Q)=>{p=p||Mr,y=y||Mr;const V=p.length,ye=y.length,ie=Math.min(V,ye);let ge;for(ge=0;ge<ie;ge++){const ke=y[ge]=Q?Sn(y[ge]):hn(y[ge]);I(p[ge],ke,x,null,B,L,ee,se,Q)}V>ye?Se(p,B,L,!0,!1,ie):Te(y,x,O,B,L,ee,se,Q,ie)},Ze=(p,y,x,O,B,L,ee,se,Q)=>{let V=0;const ye=y.length;let ie=p.length-1,ge=ye-1;for(;V<=ie&&V<=ge;){const ke=p[V],Pe=y[V]=Q?Sn(y[V]):hn(y[V]);if(fr(ke,Pe))I(ke,Pe,x,null,B,L,ee,se,Q);else break;V++}for(;V<=ie&&V<=ge;){const ke=p[ie],Pe=y[ge]=Q?Sn(y[ge]):hn(y[ge]);if(fr(ke,Pe))I(ke,Pe,x,null,B,L,ee,se,Q);else break;ie--,ge--}if(V>ie){if(V<=ge){const ke=ge+1,Pe=ke<ye?y[ke].el:O;for(;V<=ge;)I(null,y[V]=Q?Sn(y[V]):hn(y[V]),x,Pe,B,L,ee,se,Q),V++}}else if(V>ge)for(;V<=ie;)tt(p[V],B,L,!0),V++;else{const ke=V,Pe=V,We=new Map;for(V=Pe;V<=ge;V++){const b=y[V]=Q?Sn(y[V]):hn(y[V]);b.key!=null&&We.set(b.key,V)}let Ie,pt=0;const Ke=ge-Pe+1;let H=!1,W=0;const J=new Array(Ke);for(V=0;V<Ke;V++)J[V]=0;for(V=ke;V<=ie;V++){const b=p[V];if(pt>=Ke){tt(b,B,L,!0);continue}let A;if(b.key!=null)A=We.get(b.key);else for(Ie=Pe;Ie<=ge;Ie++)if(J[Ie-Pe]===0&&fr(b,y[Ie])){A=Ie;break}A===void 0?tt(b,B,L,!0):(J[A-Pe]=V+1,A>=W?W=A:H=!0,I(b,y[A],x,null,B,L,ee,se,Q),pt++)}const Ye=H?qd(J):Mr;for(Ie=Ye.length-1,V=Ke-1;V>=0;V--){const b=Pe+V,A=y[b],M=y[b+1],te=b+1<ye?M.el||bc(M):O;J[V]===0?I(null,A,x,te,B,L,ee,se,Q):H&&(Ie<0||V!==Ye[Ie]?ut(A,x,te,2):Ie--)}}},ut=(p,y,x,O,B=null)=>{const{el:L,type:ee,transition:se,children:Q,shapeFlag:V}=p;if(V&6){ut(p.component.subTree,y,x,O);return}if(V&128){p.suspense.move(y,x,O);return}if(V&64){ee.move(p,y,x,ve);return}if(ee===Ue){r(L,y,x);for(let ie=0;ie<Q.length;ie++)ut(Q[ie],y,x,O);r(p.anchor,y,x);return}if(ee===yo){U(p,y,x);return}if(O!==2&&V&1&&se)if(O===0)se.beforeEnter(L),r(L,y,x),Pt(()=>se.enter(L),B);else{const{leave:ie,delayLeave:ge,afterLeave:ke}=se,Pe=()=>{p.ctx.isUnmounted?s(L):r(L,y,x)},We=()=>{L._isLeaving&&L[dn](!0),ie(L,()=>{Pe(),ke&&ke()})};ge?ge(L,Pe,We):We()}else r(L,y,x)},tt=(p,y,x,O=!1,B=!1)=>{const{type:L,props:ee,ref:se,children:Q,dynamicChildren:V,shapeFlag:ye,patchFlag:ie,dirs:ge,cacheIndex:ke}=p;if(ie===-2&&(B=!1),se!=null&&(An(),ss(se,null,x,p,!0),In()),ke!=null&&(y.renderCache[ke]=void 0),ye&256){y.ctx.deactivate(p);return}const Pe=ye&1&&ge,We=!Nr(p);let Ie;if(We&&(Ie=ee&&ee.onVnodeBeforeUnmount)&&cn(Ie,y,p),ye&6)Ee(p.component,x,O);else{if(ye&128){p.suspense.unmount(x,O);return}Pe&&ir(p,null,y,"beforeUnmount"),ye&64?p.type.remove(p,y,x,ve,O):V&&!V.hasOnce&&(L!==Ue||ie>0&&ie&64)?Se(V,y,x,!1,!0):(L===Ue&&ie&384||!B&&ye&16)&&Se(Q,y,x),O&&ze(p)}(We&&(Ie=ee&&ee.onVnodeUnmounted)||Pe)&&Pt(()=>{Ie&&cn(Ie,y,p),Pe&&ir(p,null,y,"unmounted")},x)},ze=p=>{const{type:y,el:x,anchor:O,transition:B}=p;if(y===Ue){he(x,O);return}if(y===yo){D(p);return}const L=()=>{s(x),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(p.shapeFlag&1&&B&&!B.persisted){const{leave:ee,delayLeave:se}=B,Q=()=>ee(x,L);se?se(p.el,L,Q):Q()}else L()},he=(p,y)=>{let x;for(;p!==y;)x=g(p),s(p),p=x;s(y)},Ee=(p,y,x)=>{const{bum:O,scope:B,job:L,subTree:ee,um:se,m:Q,a:V}=p;oa(Q),oa(V),O&&As(O),B.stop(),L&&(L.flags|=8,tt(ee,p,y,x)),se&&Pt(se,y),Pt(()=>{p.isUnmounted=!0},y)},Se=(p,y,x,O=!1,B=!1,L=0)=>{for(let ee=L;ee<p.length;ee++)tt(p[ee],y,x,O,B)},E=p=>{if(p.shapeFlag&6)return E(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=g(p.anchor||p.el),x=y&&y[zl];return x?g(x):y};let Z=!1;const Y=(p,y,x)=>{let O;p==null?y._vnode&&(tt(y._vnode,null,null,!0),O=y._vnode.component):I(y._vnode||null,p,y,null,null,null,x),y._vnode=p,Z||(Z=!0,Wi(O),Vl(),Z=!1)},ve={p:I,um:tt,m:ut,r:ze,mt:He,mc:Te,pc:Me,pbc:X,n:E,o:e};return{render:Y,hydrate:void 0,createApp:Ad(Y)}}function vo({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 ar({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ti(e,t,n=!1){const r=e.children,s=t.children;if(Le(r)&&Le(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]=Sn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Ti(i,a)),a.type===to&&(a.patchFlag===-1&&(a=s[o]=Sn(a)),a.el=i.el),a.type===Nt&&!a.el&&(a.el=i.el)}}function qd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function wc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:wc(t)}function oa(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function bc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?bc(t.subTree):null}const _c=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const Ue=Symbol.for("v-fgt"),to=Symbol.for("v-txt"),Nt=Symbol.for("v-cmt"),yo=Symbol.for("v-stc"),is=[];let zt=null;function w(e=!1){is.push(zt=e?null:[])}function Gd(){is.pop(),zt=is[is.length-1]||null}let fs=1;function Fs(e,t=!1){fs+=e,e<0&&zt&&t&&(zt.hasOnce=!0)}function kc(e){return e.dynamicChildren=fs>0?zt||Mr:null,Gd(),fs>0&&zt&&zt.push(e),e}function S(e,t,n,r,s,o){return kc(m(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return kc(Ce(e,t,n,r,s,!0))}function hs(e){return e?e.__v_isVNode===!0:!1}function fr(e,t){return e.type===t.type&&e.key===t.key}const Tc=({key:e})=>e??null,$s=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Dt(e)||Ve(e)?{i:It,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===Ue?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Tc(t),ref:t&&$s(t),scopeId:ql,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:It};return a?(Si(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=bt(n)?8:16),fs>0&&!i&&zt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&zt.push(l),l}const Ce=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===sc)&&(e=Nt),hs(e)){const a=Yn(e,t,!0);return n&&Si(a,n),fs>0&&!o&&zt&&(a.shapeFlag&6?zt[zt.indexOf(e)]=a:zt.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!bt(a)&&(t.class=ct(a)),ot(l)&&(wi(l)&&!Le(l)&&(l=St({},l)),t.style=vr(l))}const i=bt(e)?1:_c(e)?128:Yl(e)?64:ot(e)?4:Ve(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Yd(e){return e?wi(e)||hc(e)?St({},e):e:null}function Yn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?Sc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Tc(d),ref:t&&t.ref?n&&o?Le(o)?o.concat($s(t)):[o,$s(t)]:$s(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&&Yn(e.ssContent),ssFallback:e.ssFallback&&Yn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&ds(u,l.clone(u)),u}function Jd(e=" ",t=0){return Ce(to,null,e,t)}function le(e="",t=!1){return t?(w(),ft(Nt,null,e)):Ce(Nt,null,e)}function hn(e){return e==null||typeof e=="boolean"?Ce(Nt):Le(e)?Ce(Ue,null,e.slice()):hs(e)?Sn(e):Ce(to,null,String(e))}function Sn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yn(e)}function Si(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Si(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!hc(t)?t._ctx=It:s===3&&It&&(It.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:It},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function Sc(...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=ct([t.class,r.class]));else if(s==="style")t.style=vr([t.style,r.style]);else if(Ws(s)){const o=t[s],i=r[s];i&&o!==i&&!(Le(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function cn(e,t,n,r=null){sn(e,t,7,[n,r])}const Qd=lc();let Xd=0;function Zd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Qd,o={uid:Xd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:mc(r,s),emitsOptions:cc(r,s),emit:null,emitted:null,propsDefaults:ht,inheritAttrs:r.inheritAttrs,ctx:ht,data:ht,props:ht,attrs:ht,slots:ht,refs:ht,setupState:ht,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Rd.bind(null,o),e.ce&&e.ce(o),o}let jt=null;const xi=()=>jt||It;let Hs,Yo;{const e=Gs(),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)}};Hs=t("__VUE_INSTANCE_SETTERS__",n=>jt=n),Yo=t("__VUE_SSR_SETTERS__",n=>ps=n)}const ws=e=>{const t=jt;return Hs(e),e.scope.on(),()=>{e.scope.off(),Hs(t)}},ia=()=>{jt&&jt.scope.off(),Hs(null)};function xc(e){return e.vnode.shapeFlag&4}let ps=!1;function ef(e,t=!1,n=!1){t&&Yo(t);const{props:r,children:s}=e.vnode,o=xc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Yo(!1),i}function tf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wd);const{setup:r}=n;if(r){An();const s=e.setupContext=r.length>1?Ec(e):null,o=ws(e),i=ys(r,e,0,[e.props,s]),a=vl(i);if(In(),o(),(a||e.sp)&&!Nr(e)&&nc(e),a){if(i.then(ia,ia),t)return i.then(l=>{aa(e,l)}).catch(l=>{Js(l,e,0)});e.asyncDep=i}else aa(e,i)}else Cc(e)}function aa(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ot(t)&&(e.setupState=Fl(t)),Cc(e)}function Cc(e,t,n){const r=e.type;e.render||(e.render=r.render||gn);{const s=ws(e);An();try{kd(e)}finally{In(),s()}}}const nf={get(e,t){return Ot(e,"get",""),e[t]}};function Ec(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function no(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Fl(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in os)return os[n](e)},has(t,n){return n in t||n in os}})):e.proxy}function rf(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return Ve(e)&&"__vccOpts"in e}const ce=(e,t)=>zu(e,t,ps);function Ci(e,t,n){try{Fs(-1);const r=arguments.length;return r===2?ot(t)&&!Le(t)?hs(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&hs(n)&&(n=[n]),Ce(e,t,n))}finally{Fs(1)}}const of="3.5.30";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.30
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let Jo;const la=typeof window<"u"&&window.trustedTypes;if(la)try{Jo=la.createPolicy("vue",{createHTML:e=>e})}catch{}const Ac=Jo?e=>Jo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",Tn=typeof document<"u"?document:null,ca=Tn&&Tn.createElement("template"),cf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Tn.createElementNS(af,e):t==="mathml"?Tn.createElementNS(lf,e):n?Tn.createElement(e,{is:n}):Tn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Tn.createTextNode(e),createComment:e=>Tn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Tn.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{ca.innerHTML=Ac(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ca.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]}},Vn="transition",zr="animation",ms=Symbol("_vtc"),Ic={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},uf=St({},Ql,Ic),df=e=>(e.displayName="Transition",e.props=uf,e),Rc=df((e,{slots:t})=>Ci(id,ff(e),t)),lr=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},ua=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const ne in e)ne in Ic||(t[ne]=e[ne]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,N=hf(s),I=N&&N[0],F=N&&N[1],{onBeforeEnter:z,onEnter:j,onEnterCancelled:U,onLeave:D,onLeaveCancelled:ae,onBeforeAppear:ue=z,onAppear:de=j,onAppearCancelled:Te=U}=t,oe=(ne,Be,He,Ge)=>{ne._enterCancelled=Ge,cr(ne,Be?u:a),cr(ne,Be?d:i),He&&He()},X=(ne,Be)=>{ne._isLeaving=!1,cr(ne,f),cr(ne,_),cr(ne,g),Be&&Be()},me=ne=>(Be,He)=>{const Ge=ne?de:j,Ae=()=>oe(Be,ne,He);lr(Ge,[Be,Ae]),da(()=>{cr(Be,ne?l:o),_n(Be,ne?u:a),ua(Ge)||fa(Be,r,I,Ae)})};return St(t,{onBeforeEnter(ne){lr(z,[ne]),_n(ne,o),_n(ne,i)},onBeforeAppear(ne){lr(ue,[ne]),_n(ne,l),_n(ne,d)},onEnter:me(!1),onAppear:me(!0),onLeave(ne,Be){ne._isLeaving=!0;const He=()=>X(ne,Be);_n(ne,f),ne._enterCancelled?(_n(ne,g),ma(ne)):(ma(ne),_n(ne,g)),da(()=>{ne._isLeaving&&(cr(ne,f),_n(ne,_),ua(D)||fa(ne,r,F,He))}),lr(D,[ne,He])},onEnterCancelled(ne){oe(ne,!1,void 0,!0),lr(U,[ne])},onAppearCancelled(ne){oe(ne,!0,void 0,!0),lr(Te,[ne])},onLeaveCancelled(ne){X(ne),lr(ae,[ne])}})}function hf(e){if(e==null)return null;if(ot(e))return[wo(e.enter),wo(e.leave)];{const t=wo(e);return[t,t]}}function wo(e){return mu(e)}function _n(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ms]||(e[ms]=new Set)).add(t)}function cr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[ms];n&&(n.delete(t),n.size||(e[ms]=void 0))}function da(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function fa(e,t,n,r){const s=e._endId=++pf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=mf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=_=>{_.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function mf(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${Vn}Delay`),o=r(`${Vn}Duration`),i=ha(s,o),a=r(`${zr}Delay`),l=r(`${zr}Duration`),d=ha(a,l);let u=null,f=0,g=0;t===Vn?i>0&&(u=Vn,f=i,g=o.length):t===zr?d>0&&(u=zr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Vn:zr:null,g=u?u===Vn?o.length:l.length:0);const _=u===Vn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Vn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:_}}function ha(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>pa(n)+pa(e[r])))}function pa(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ma(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[ms];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ga=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=bt(n);let o=!1;if(n&&!s){if(t)if(bt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ms(r,a,"")}else for(const i in t)n[i]==null&&Ms(r,i,"");for(const i in n)i==="display"&&(o=!0),Ms(r,i,n[i])}else if(s){if(t!==n){const i=r[yf];i&&(n+=";"+i),r.cssText=n,o=wf.test(n)}}else t&&e.removeAttribute("style");ga in e&&(e[ga]=o?r.display:"",e[vf]&&(r.display="none"))}const va=/\s*!important$/;function Ms(e,t,n){if(Le(n))n.forEach(r=>Ms(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);va.test(n)?e.setProperty(Jn(r),n.replace(va,""),"important"):e[r]=n}}const ya=["Webkit","Moz","ms"],bo={};function _f(e,t){const n=bo[t];if(n)return n;let r=Vt(t);if(r!=="filter"&&r in e)return bo[t]=r;r=Ks(r);for(let s=0;s<ya.length;s++){const o=ya[s]+r;if(o in e)return bo[t]=o}return t}const wa="http://www.w3.org/1999/xlink";function ba(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(wa,t.slice(6,t.length)):e.setAttributeNS(wa,t,n):n==null||o&&!_l(n)?e.removeAttribute(t):e.setAttribute(t,o?"":nn(n)?String(n):n)}function _a(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ac(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=_l(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 Rr(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const ka=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[ka]||(e[ka]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Rr(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const Ta=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(Ta.test(e)){t={};let r;for(;r=e.match(Ta);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Jn(e.slice(2)),t]}let _o=0;const xf=Promise.resolve(),Cf=()=>_o||(xf.then(()=>_o=0),_o=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;sn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(Le(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 Sa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,If=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?gf(e,r,i):t==="style"?bf(e,n,r):Ws(t)?li(t)||Tf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rf(e,t,r,i))?(_a(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ba(e,t,r,i,o,t!=="value")):e._isVueCE&&($f(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(r)))?_a(e,Vt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),ba(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sa(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 Sa(t)&&bt(n)?!1:t in e}function $f(e,t){const n=e._def.props;if(!n)return!1;const r=Vt(t);return Array.isArray(n)?n.some(s=>Vt(s)===r):Object.keys(n).some(s=>Vt(s)===r)}const xa=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>As(t,n):t};function Mf(e){e.target.composing=!0}function Ca(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ko=Symbol("_assign");function Ea(e,t,n){return t&&(e=e.trim()),n&&(e=di(e)),e}const Mn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[ko]=xa(s);const o=r||s.props&&s.props.type==="number";Rr(e,t?"change":"input",i=>{i.target.composing||e[ko](Ea(e.value,n,o))}),(n||o)&&Rr(e,"change",()=>{e.value=Ea(e.value,n,o)}),t||(Rr(e,"compositionstart",Mf),Rr(e,"compositionend",Ca),Rr(e,"change",Ca))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[ko]=xa(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?di(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Pf=["ctrl","shift","alt","meta"],Of={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Pf.some(n=>e[`${n}Key`]&&!t.includes(n))},Je=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Of[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Nf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ut=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Jn(s.key);if(t.some(i=>i===o||Nf[i]===o))return e(s)}))},jf=St({patchProp:If},cf);let Aa;function Df(){return Aa||(Aa=Ud(jf))}const Lf=((...e)=>{const t=Df().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Ff(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Bf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Bf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ff(e){return bt(e)?document.querySelector(e):e}/*!
|
|
18
|
-
* vue-router v4.6.4
|
|
19
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/const $r=typeof document<"u";function $c(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Hf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&$c(e.default)}const rt=Object.assign;function To(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 as=()=>{},on=Array.isArray;function Ia(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Mc=/#/g,Uf=/&/g,Vf=/\//g,Wf=/=/g,qf=/\?/g,Pc=/\+/g,Kf=/%5B/g,Gf=/%5D/g,Oc=/%5E/g,zf=/%60/g,Nc=/%7B/g,Yf=/%7C/g,jc=/%7D/g,Jf=/%20/g;function Ei(e){return e==null?"":encodeURI(""+e).replace(Yf,"|").replace(Kf,"[").replace(Gf,"]")}function Qf(e){return Ei(e).replace(Nc,"{").replace(jc,"}").replace(Oc,"^")}function Qo(e){return Ei(e).replace(Pc,"%2B").replace(Jf,"+").replace(Mc,"%23").replace(Uf,"%26").replace(zf,"`").replace(Nc,"{").replace(jc,"}").replace(Oc,"^")}function Xf(e){return Qo(e).replace(Wf,"%3D")}function Zf(e){return Ei(e).replace(Mc,"%23").replace(qf,"%3F")}function eh(e){return Zf(e).replace(Vf,"%2F")}function gs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const th=/\/$/,nh=e=>e.replace(th,"");function So(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=ih(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:gs(i)}}function rh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ra(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Lr(t.matched[r],n.matched[s])&&Dc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Lr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Dc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!oh(e[n],t[n]))return!1;return!0}function oh(e,t){return on(e)?$a(e,t):on(t)?$a(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function $a(e,t){return on(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ih(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Wn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Xo=(function(e){return e.pop="pop",e.push="push",e})({}),xo=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ah(e){if(!e)if($r){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),nh(e)}const lh=/^[^#]+#/;function ch(e,t){return e.replace(lh,"#")+t}function uh(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ro=()=>({left:window.scrollX,top:window.scrollY});function dh(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=uh(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ma(e,t){return(history.state?history.state.position-t:-1)+e}const Zo=new Map;function fh(e,t){Zo.set(e,t)}function hh(e){const t=Zo.get(e);return Zo.delete(e),t}function ph(e){return typeof e=="string"||e&&typeof e=="object"}function Lc(e){return typeof e=="string"||typeof e=="symbol"}let kt=(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 Bc=Symbol("");kt.MATCHER_NOT_FOUND+"",kt.NAVIGATION_GUARD_REDIRECT+"",kt.NAVIGATION_ABORTED+"",kt.NAVIGATION_CANCELLED+"",kt.NAVIGATION_DUPLICATED+"";function Br(e,t){return rt(new Error,{type:e,[Bc]:!0},t)}function kn(e,t){return e instanceof Error&&Bc in e&&(t==null||!!(e.type&t))}const mh=["params","query","hash"];function gh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of mh)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function vh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Pc," "),o=s.indexOf("="),i=gs(o<0?s:s.slice(0,o)),a=o<0?null:gs(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 Pa(e){let t="";for(let n in e){const r=e[n];if(n=Xf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(on(r)?r.map(s=>s&&Qo(s)):[r&&Qo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function yh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=on(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const wh=Symbol(""),Oa=Symbol(""),so=Symbol(""),Ai=Symbol(""),ei=Symbol("");function Yr(){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 Gn(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(Br(kt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):ph(g)?l(Br(kt.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 Co(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($c(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Gn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Hf(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Gn(g,n,r,i,a,s)()}))}}return o}function bh(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>Lr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Lr(d,l))||s.push(l))}return[n,r,s]}/*!
|
|
22
|
-
* vue-router v4.6.4
|
|
23
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
24
|
-
* @license MIT
|
|
25
|
-
*/let _h=()=>location.protocol+"//"+location.host;function Fc(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),Ra(a,"")}return Ra(n,e)+r+s}function kh(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const _=Fc(e,location),N=n.value,I=t.value;let F=0;if(g){if(n.value=_,t.value=g,i&&i===N){i=null;return}F=I?g.position-I.position:0}else r(_);s.forEach(z=>{z(n.value,N,{delta:F,type:Xo.pop,direction:F?F>0?xo.forward:xo.back:xo.unknown})})};function l(){i=n.value}function d(g){s.push(g);const _=()=>{const N=s.indexOf(g);N>-1&&s.splice(N,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(rt({},g.state,{scroll:ro()}),"")}}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 Na(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ro():null}}function Th(e){const{history:t,location:n}=window,r={value:Fc(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:_h()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(_){console.error(_),n[u?"replace":"assign"](g)}}function i(l,d){o(l,rt({},t.state,Na(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:ro()});o(u.current,u,!0),o(l,rt({},Na(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Sh(e){e=ah(e);const t=Th(e),n=kh(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=rt({location:"",base:e,go:r,createHref:ch.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function xh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Sh(e)}let pr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Tt=(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})(Tt||{});const Ch={type:pr.Static,value:""},Eh=/[a-zA-Z0-9_]/;function Ah(e){if(!e)return[[]];if(e==="/")return[[Ch]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=Tt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===Tt.Static?o.push({type:pr.Static,value:d}):n===Tt.Param||n===Tt.ParamRegExp||n===Tt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:pr.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!==Tt.ParamRegExp){r=n,n=Tt.EscapeNext;continue}switch(n){case Tt.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=Tt.Param):g();break;case Tt.EscapeNext:g(),n=r;break;case Tt.Param:l==="("?n=Tt.ParamRegExp:Eh.test(l)?g():(f(),n=Tt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Tt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Tt.ParamRegExpEnd:u+=l;break;case Tt.ParamRegExpEnd:f(),n=Tt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===Tt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const ja="[^/]+?",Ih={sensitive:!1,strict:!1,start:!0,end:!0};var Ft=(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})(Ft||{});const Rh=/[.+*?^${}()[\]/\\]/g;function $h(e,t){const n=rt({},Ih,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Ft.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let _=Ft.Segment+(n.sensitive?Ft.BonusCaseSensitive:0);if(g.type===pr.Static)f||(s+="/"),s+=g.value.replace(Rh,"\\$&"),_+=Ft.Static;else if(g.type===pr.Param){const{value:N,repeatable:I,optional:F,regexp:z}=g;o.push({name:N,repeatable:I,optional:F});const j=z||ja;if(j!==ja){_+=Ft.BonusCustomRegExp;try{`${j}`}catch(D){throw new Error(`Invalid custom RegExp for param "${N}" (${j}): `+D.message)}}let U=I?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;f||(U=F&&d.length<2?`(?:/${U})`:"/"+U),F&&(U+="?"),s+=U,_+=Ft.Dynamic,F&&(_+=Ft.BonusOptional),I&&(_+=Ft.BonusRepeatable),j===".*"&&(_+=Ft.BonusWildcard)}u.push(_)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Ft.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),f={};if(!u)return null;for(let g=1;g<u.length;g++){const _=u[g]||"",N=o[g-1];f[N.name]=_&&N.repeatable?_.split("/"):_}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of g)if(_.type===pr.Static)u+=_.value;else if(_.type===pr.Param){const{value:N,repeatable:I,optional:F}=_,z=N in d?d[N]:"";if(on(z)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const j=on(z)?z.join("/"):z;if(!j)if(F)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);u+=j}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Mh(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Ft.Static+Ft.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ft.Static+Ft.Segment?1:-1:0}function Hc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Mh(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Da(r))return 1;if(Da(s))return-1}return s.length-r.length}function Da(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Ph={strict:!1,end:!0,sensitive:!1};function Oh(e,t,n){const r=$h(Ah(e.path),n),s=rt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Nh(e,t){const n=[],r=new Map;t=Ia(Ph,t);function s(f){return r.get(f)}function o(f,g,_){const N=!_,I=Ba(f);I.aliasOf=_&&_.record;const F=Ia(t,f),z=[I];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of D)z.push(Ba(rt({},I,{components:_?_.record.components:I.components,path:ae,aliasOf:_?_.record:I})))}let j,U;for(const D of z){const{path:ae}=D;if(g&&ae[0]!=="/"){const ue=g.record.path,de=ue[ue.length-1]==="/"?"":"/";D.path=g.record.path+(ae&&de+ae)}if(j=Oh(D,g,F),_?_.alias.push(j):(U=U||j,U!==j&&U.alias.push(j),N&&f.name&&!Fa(j)&&i(f.name)),Uc(j)&&l(j),I.children){const ue=I.children;for(let de=0;de<ue.length;de++)o(ue[de],j,_&&_.children[de])}_=_||j}return U?()=>{i(U)}:as}function i(f){if(Lc(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Lh(f,n);n.splice(g,0,f),f.record.name&&!Fa(f)&&r.set(f.record.name,f)}function d(f,g){let _,N={},I,F;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw Br(kt.MATCHER_NOT_FOUND,{location:f});F=_.record.name,N=rt(La(g.params,_.keys.filter(U=>!U.optional).concat(_.parent?_.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&La(f.params,_.keys.map(U=>U.name))),I=_.stringify(N)}else if(f.path!=null)I=f.path,_=n.find(U=>U.re.test(I)),_&&(N=_.parse(I),F=_.record.name);else{if(_=g.name?r.get(g.name):n.find(U=>U.re.test(g.path)),!_)throw Br(kt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});F=_.record.name,N=rt({},g.params,f.params),I=_.stringify(N)}const z=[];let j=_;for(;j;)z.unshift(j.record),j=j.parent;return{name:F,path:I,params:N,matched:z,meta:Dh(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 La(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ba(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:jh(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function jh(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Fa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Dh(e){return e.reduce((t,n)=>rt(t,n.meta),{})}function Lh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Hc(e,t[o])<0?r=o:n=o+1}const s=Bh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Bh(e){let t=e;for(;t=t.parent;)if(Uc(t)&&Hc(e,t)===0)return t}function Uc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ha(e){const t=tn(so),n=tn(Ai),r=ce(()=>{const l=je(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(Lr.bind(null,u));if(g>-1)return g;const _=Ua(l[d-2]);return d>1&&Ua(u)===_&&f[f.length-1].path!==_?f.findIndex(Lr.bind(null,l[d-2])):g}),o=ce(()=>s.value>-1&&Wh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Dc(n.params,r.value.params));function a(l={}){if(Vh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(as);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Fh(e){return e.length===1?e[0]:e}const Hh=xt({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:Ha,setup(e,{slots:t}){const n=Ys(Ha(e)),{options:r}=tn(so),s=ce(()=>({[Va(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Va(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Fh(t.default(n));return e.custom?o:Ci("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Uh=Hh;function Vh(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Wh(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!on(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Ua(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Va=(e,t,n)=>e??t??n,qh=xt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=tn(ei),s=ce(()=>e.route||r.value),o=tn(Oa,0),i=ce(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);Is(Oa,ce(()=>i.value+1)),Is(wh,a),Is(ei,s);const l=P();return lt(()=>[l.value,a.value,e.name],([d,u,f],[g,_,N])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!Lr(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 Wa(n.default,{Component:g,route:d});const _=f.props[u],N=_?_===!0?d.params:typeof _=="function"?_(d):_:null,F=Ci(g,rt({},N,t,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Wa(n.default,{Component:F,route:d})||F}}});function Wa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Kh=qh;function Gh(e){const t=Nh(e.routes,e),n=e.parseQuery||vh,r=e.stringifyQuery||Pa,s=e.history,o=Yr(),i=Yr(),a=Yr(),l=Wu(Wn);let d=Wn;$r&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=To.bind(null,E=>""+E),f=To.bind(null,eh),g=To.bind(null,gs);function _(E,Z){let Y,ve;return Lc(E)?(Y=t.getRecordMatcher(E),ve=Z):ve=E,t.addRoute(ve,Y)}function N(E){const Z=t.getRecordMatcher(E);Z&&t.removeRoute(Z)}function I(){return t.getRoutes().map(E=>E.record)}function F(E){return!!t.getRecordMatcher(E)}function z(E,Z){if(Z=rt({},Z||l.value),typeof E=="string"){const x=So(n,E,Z.path),O=t.resolve({path:x.path},Z),B=s.createHref(x.fullPath);return rt(x,O,{params:g(O.params),hash:gs(x.hash),redirectedFrom:void 0,href:B})}let Y;if(E.path!=null)Y=rt({},E,{path:So(n,E.path,Z.path).path});else{const x=rt({},E.params);for(const O in x)x[O]==null&&delete x[O];Y=rt({},E,{params:f(x)}),Z.params=f(Z.params)}const ve=t.resolve(Y,Z),De=E.hash||"";ve.params=u(g(ve.params));const p=rh(r,rt({},E,{hash:Qf(De),path:ve.path})),y=s.createHref(p);return rt({fullPath:p,hash:De,query:r===Pa?yh(E.query):E.query||{}},ve,{redirectedFrom:void 0,href:y})}function j(E){return typeof E=="string"?So(n,E,l.value.path):rt({},E)}function U(E,Z){if(d!==E)return Br(kt.NAVIGATION_CANCELLED,{from:Z,to:E})}function D(E){return de(E)}function ae(E){return D(rt(j(E),{replace:!0}))}function ue(E,Z){const Y=E.matched[E.matched.length-1];if(Y&&Y.redirect){const{redirect:ve}=Y;let De=typeof ve=="function"?ve(E,Z):ve;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=j(De):{path:De},De.params={}),rt({query:E.query,hash:E.hash,params:De.path!=null?{}:E.params},De)}}function de(E,Z){const Y=d=z(E),ve=l.value,De=E.state,p=E.force,y=E.replace===!0,x=ue(Y,ve);if(x)return de(rt(j(x),{state:typeof x=="object"?rt({},De,x.state):De,force:p,replace:y}),Z||Y);const O=Y;O.redirectedFrom=Z;let B;return!p&&sh(r,ve,Y)&&(B=Br(kt.NAVIGATION_DUPLICATED,{to:O,from:ve}),ut(ve,ve,!0,!1)),(B?Promise.resolve(B):X(O,ve)).catch(L=>kn(L)?kn(L,kt.NAVIGATION_GUARD_REDIRECT)?L:Ze(L):Me(L,O,ve)).then(L=>{if(L){if(kn(L,kt.NAVIGATION_GUARD_REDIRECT))return de(rt({replace:y},j(L.to),{state:typeof L.to=="object"?rt({},De,L.to.state):De,force:p}),Z||O)}else L=ne(O,ve,!0,y,De);return me(O,ve,L),L})}function Te(E,Z){const Y=U(E,Z);return Y?Promise.reject(Y):Promise.resolve()}function oe(E){const Z=he.values().next().value;return Z&&typeof Z.runWithContext=="function"?Z.runWithContext(E):E()}function X(E,Z){let Y;const[ve,De,p]=bh(E,Z);Y=Co(ve.reverse(),"beforeRouteLeave",E,Z);for(const x of ve)x.leaveGuards.forEach(O=>{Y.push(Gn(O,E,Z))});const y=Te.bind(null,E,Z);return Y.push(y),Se(Y).then(()=>{Y=[];for(const x of o.list())Y.push(Gn(x,E,Z));return Y.push(y),Se(Y)}).then(()=>{Y=Co(De,"beforeRouteUpdate",E,Z);for(const x of De)x.updateGuards.forEach(O=>{Y.push(Gn(O,E,Z))});return Y.push(y),Se(Y)}).then(()=>{Y=[];for(const x of p)if(x.beforeEnter)if(on(x.beforeEnter))for(const O of x.beforeEnter)Y.push(Gn(O,E,Z));else Y.push(Gn(x.beforeEnter,E,Z));return Y.push(y),Se(Y)}).then(()=>(E.matched.forEach(x=>x.enterCallbacks={}),Y=Co(p,"beforeRouteEnter",E,Z,oe),Y.push(y),Se(Y))).then(()=>{Y=[];for(const x of i.list())Y.push(Gn(x,E,Z));return Y.push(y),Se(Y)}).catch(x=>kn(x,kt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function me(E,Z,Y){a.list().forEach(ve=>oe(()=>ve(E,Z,Y)))}function ne(E,Z,Y,ve,De){const p=U(E,Z);if(p)return p;const y=Z===Wn,x=$r?history.state:{};Y&&(ve||y?s.replace(E.fullPath,rt({scroll:y&&x&&x.scroll},De)):s.push(E.fullPath,De)),l.value=E,ut(E,Z,Y,y),Ze()}let Be;function He(){Be||(Be=s.listen((E,Z,Y)=>{if(!Ee.listening)return;const ve=z(E),De=ue(ve,Ee.currentRoute.value);if(De){de(rt(De,{replace:!0,force:!0}),ve).catch(as);return}d=ve;const p=l.value;$r&&fh(Ma(p.fullPath,Y.delta),ro()),X(ve,p).catch(y=>kn(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?y:kn(y,kt.NAVIGATION_GUARD_REDIRECT)?(de(rt(j(y.to),{force:!0}),ve).then(x=>{kn(x,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!Y.delta&&Y.type===Xo.pop&&s.go(-1,!1)}).catch(as),Promise.reject()):(Y.delta&&s.go(-Y.delta,!1),Me(y,ve,p))).then(y=>{y=y||ne(ve,p,!1),y&&(Y.delta&&!kn(y,kt.NAVIGATION_CANCELLED)?s.go(-Y.delta,!1):Y.type===Xo.pop&&kn(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),me(ve,p,y)}).catch(as)}))}let Ge=Yr(),Ae=Yr(),_e;function Me(E,Z,Y){Ze(E);const ve=Ae.list();return ve.length?ve.forEach(De=>De(E,Z,Y)):console.error(E),Promise.reject(E)}function vt(){return _e&&l.value!==Wn?Promise.resolve():new Promise((E,Z)=>{Ge.add([E,Z])})}function Ze(E){return _e||(_e=!E,He(),Ge.list().forEach(([Z,Y])=>E?Y(E):Z()),Ge.reset()),E}function ut(E,Z,Y,ve){const{scrollBehavior:De}=e;if(!$r||!De)return Promise.resolve();const p=!Y&&hh(Ma(E.fullPath,0))||(ve||!Y)&&history.state&&history.state.scroll||null;return Yt().then(()=>De(E,Z,p)).then(y=>y&&dh(y)).catch(y=>Me(y,E,Z))}const tt=E=>s.go(E);let ze;const he=new Set,Ee={currentRoute:l,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:I,resolve:z,options:e,push:D,replace:ae,go:tt,back:()=>tt(-1),forward:()=>tt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:vt,install(E){E.component("RouterLink",Uh),E.component("RouterView",Kh),E.config.globalProperties.$router=Ee,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),$r&&!ze&&l.value===Wn&&(ze=!0,D(s.location).catch(ve=>{}));const Z={};for(const ve in Wn)Object.defineProperty(Z,ve,{get:()=>l.value[ve],enumerable:!0});E.provide(so,Ee),E.provide(Ai,Ll(Z)),E.provide(ei,l);const Y=E.unmount;he.add(E),E.unmount=function(){he.delete(E),he.size<1&&(d=Wn,Be&&Be(),Be=null,l.value=Wn,ze=!1,_e=!1),Y()}}};function Se(E){return E.reduce((Z,Y)=>Z.then(()=>oe(Y)),Promise.resolve())}return Ee}function zh(){return tn(so)}function Yh(e){return tn(Ai)}const qa=768;function Vc(){const e=P(typeof window<"u"?window.innerWidth<qa:!1);let t=null;function n(r){e.value=r.matches}return On(()=>{t=window.matchMedia(`(max-width: ${qa-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Zs(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Jh={key:0,class:"desktop-sidebar"},Qh={class:"desktop-main"},Ka="codex-web-local.sidebar-width.v1",Xh=260,Zh=620,Ga=320,ep=xt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Vc();function r(d){return Math.min(Zh,Math.max(Xh,d))}function s(){if(typeof window>"u")return Ga;const d=window.localStorage.getItem(Ka),u=Number(d);return Number.isFinite(u)?r(u):Ga}const o=P(s()),i=ce(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(Ka,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=N=>{const I=N.clientX-u;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)}return(d,u)=>(w(),S("div",{class:ct(["desktop-layout",{"is-mobile":je(n)}]),style:vr(i.value)},[je(n)?(w(),ft(Ds,{key:0,to:"body"},[Ce(Rc,{name:"drawer"},{default:at(()=>[e.isSidebarCollapsed?le("",!0):(w(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=Je(()=>{},["stop"]))},[mn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),je(n)?le("",!0):(w(),S(Ue,{key:1},[e.isSidebarCollapsed?le("",!0):(w(),S("aside",Jh,[mn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(w(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Qh,[mn(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},tp=Xe(ep,[["__scopeId","data-v-df29c633"]]),np={},rp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sp(e,t){return w(),S("svg",rp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const oo=Xe(np,[["render",sp]]),op={},ip={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ap(e,t){return w(),S("svg",ip,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Wc=Xe(op,[["render",ap]]),lp={},cp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function up(e,t){return w(),S("svg",cp,[...t[0]||(t[0]=[m("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Jr=Xe(lp,[["render",up]]),dp={},fp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hp(e,t){return w(),S("svg",fp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Us=Xe(dp,[["render",hp]]),pp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gp(e,t){return w(),S("svg",mp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const qc=Xe(pp,[["render",gp]]),vp={},yp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wp(e,t){return w(),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 w(),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 Ps=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 w(),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 Eo=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=xt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(w(),ft(Wo(t.as),Sc({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?(w(),S("span",Ep,[mn(a.$slots,"left",{},void 0,!0)])):le("",!0),m("span",Ap,[mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),S("span",Ip,[s.value?(w(),S("span",Rp,[mn(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(w(),S("span",$p,[mn(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),ur=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,za=6,Ya="codex-web-local.thread-view-mode.v1",Ja="codex-web-local.collapsed-projects.v1",Bm=xt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=P({}),o=P({}),i=P([]),a=P(""),l=P(""),d=P("actions"),u=P(""),f=P(!1),g=P(""),_=P(""),N=P(null),I=P(!1),F=P(""),z=P(""),j=P(null),U=P(null),D=P(null);let ae=null,ue=null;const de=P(""),Te=P({}),oe=new Map,X=new Map,me=new Map,ne=new WeakMap,Be=P(null),He=P(!1),Ge=P(Me()),Ae=typeof window<"u"?new ResizeObserver(k=>{for(const C of k){const R=C.target,q=ne.get(R);q&&Xn(q,R)}}):null;function _e(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Ja);if(!k)return{};const C=JSON.parse(k);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function Me(){return typeof window>"u"?"project":window.localStorage.getItem(Ya)==="chronological"?"chronological":"project"}o.value=_e(),lt(o,k=>{typeof window>"u"||window.localStorage.setItem(Ja,JSON.stringify(k))},{deep:!0}),lt(Ge,k=>{typeof window>"u"||window.localStorage.setItem(Ya,k)});const vt=ce(()=>n.searchQuery.trim().toLowerCase()),Ze=ce(()=>vt.value.length>0),ut=ce(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function tt(k){if(!Ze.value)return!0;if(ut.value)return ut.value.has(k.id);const C=vt.value;return k.title.toLowerCase().includes(C)||k.preview.toLowerCase().includes(C)}const ze=ce(()=>Ze.value?n.groups.map(k=>({...k,threads:k.threads.filter(tt)})).filter(k=>k.threads.length>0):n.groups),he=ce(()=>Ge.value==="chronological"),Ee=ce(()=>{const k=ze.value,C=[];for(const R of k)for(const q of R.threads)y(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=ce(()=>{const k=new Map;for(const C of n.groups)for(const R of C.threads)k.set(R.id,R);return k}),E=ce(()=>i.value.map(k=>Se.value.get(k)??null).filter(k=>k!==null).filter(tt)),Z=ce(()=>{const k=D.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),R=C>k.fromIndex?C-1:C,q=Math.max(0,Math.min(R,n.groups.length-1));return q===k.fromIndex?null:q}),Y=ce(()=>{const C=(Ze.value?ze.value:n.groups).map(Ct=>Ct.projectName),R=D.value,q=Z.value;if(!R||q===null)return C;const Fe=[...C],[_t]=Fe.splice(R.fromIndex,1);return _t?(Fe.splice(q,0,_t),Fe):C}),ve=ce(()=>{const k={};let C=0;for(const R of Y.value)k[R]=C,C+=Qe(R);return k}),De=ce(()=>{let k=0;for(const C of Y.value)k+=Qe(C);return{height:`${Math.max(0,k)}px`}});function p(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 y(k){return i.value.includes(k)}function x(k){if(y(k)){i.value=i.value.filter(C=>C!==k);return}i.value=[k,...i.value]}function O(k){r("select",k)}function B(k){return`start new thread ${Ie(k)}`}function L(k){r("start-new-thread",k)}function ee(k){l.value===k&&Q()}function se(k){return l.value===k}function Q(){l.value=""}function V(k){if(l.value===k){Q();return}l.value=k}function ye(k,C){g.value=k,_.value=C,f.value=!0,Q(),Yt(()=>{var R,q;(R=N.value)==null||R.focus(),(q=N.value)==null||q.select()})}function ie(){f.value=!1,g.value="",_.value=""}function ge(){const k=g.value,C=_.value.trim();!k||!C||(r("rename-thread",{threadId:k,title:C}),ie())}function ke(k,C){F.value=k,z.value=C,I.value=!0,Q()}function Pe(){I.value=!1,F.value="",z.value=""}function We(){const k=F.value;k&&(i.value=i.value.filter(C=>C!==k),r("archive",k),Pe())}function Ie(k){return n.projectDisplayNameById[k]??k}function pt(k){return a.value===k}function Ke(){a.value="",d.value="actions",u.value=""}function H(){He.value=!He.value}function W(k){Ge.value=k,He.value=!1}function J(k){if(a.value===k){Ke();return}a.value=k,d.value="actions",u.value=Ie(k)}function Ye(k){a.value=k,d.value="rename",u.value=Ie(k)}function b(k){r("rename-project",{projectName:k,displayName:u.value})}function A(k){r("remove-project",k),Ke()}function M(k,C){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const R=n.groups.findIndex(_t=>_t.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 te(k){return s.value[k]===!0}function we(k){return o.value[k]===!0}function xe(k){s.value={...s.value,[k]:!te(k)}}function dt(k){if(de.value===k){de.value="";return}o.value={...o.value,[k]:!we(k)}}function Qe(k){const C=Te.value[k]??0,R=D.value,Fe=((R==null?void 0:R.projectName)===k?R.groupHeight:null)??C,_t=we(k)?0:za;return Math.max(0,Fe+_t)}function mt(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 Oe(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 $e(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 vn(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&&(Oe(k)||Ke(),l.value&&($e(k)||Q()))}function Lt(k){a.value&&!Oe(k)&&Ke(),l.value&&!$e(k)&&Q()}function yr(){He.value&&(He.value=!1),a.value&&Ke(),l.value&&Q()}function Hr(){window.addEventListener("pointerdown",vn,{capture:!0}),window.addEventListener("focusin",Lt,{capture:!0}),window.addEventListener("blur",yr)}function Qn(){window.removeEventListener("pointerdown",vn,{capture:!0}),window.removeEventListener("focusin",Lt,{capture:!0}),window.removeEventListener("blur",yr)}function Xn(k,C){const R=C.getBoundingClientRect().height;if(!Number.isFinite(R)||R<=0)return;const q=Te.value[k];q!==void 0&&Math.abs(q-R)<.5||(Te.value={...Te.value,[k]:R})}function wr(k,C){const R=oe.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){oe.set(k,q),ne.set(q,k),Xn(k,q),Ae==null||Ae.observe(q);return}R&&(Ae==null||Ae.unobserve(R)),oe.delete(k)}function Ur(k,C){if(k.button!==0||U.value||D.value)return;const R=n.groups.findIndex(Ct=>Ct.projectName===C),q=oe.get(C);if(R<0||!q)return;const Fe=q.getBoundingClientRect(),_t=we(C)?0:za;U.value={projectName:C,fromIndex:R,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+_t},k.preventDefault(),Zn()}function Zn(){window.addEventListener("mousemove",er),window.addEventListener("mouseup",tr),window.addEventListener("keydown",jn)}function Kt(){window.removeEventListener("mousemove",er),window.removeEventListener("mouseup",tr),window.removeEventListener("keydown",jn)}function er(k){ae={clientX:k.clientX,clientY:k.clientY},Vr()}function tr(k){br({clientX:k.clientX,clientY:k.clientY});const C=D.value;if(C&&Z.value!==null){const R=n.groups.findIndex(q=>q.projectName===C.projectName);if(R>=0){const q=Z.value;q!==R&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}Dn()}function jn(k){k.key==="Escape"&&(!U.value&&!D.value||(k.preventDefault(),Dn()))}function Dn(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,U.value=null,D.value=null,de.value="",Kt()}function Vr(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const k=ae;ae=null,br(k)}))}function br(k){const C=U.value;if(!D.value&&C){const R=k.clientX-C.startClientX,q=k.clientY-C.startClientY;if(Math.hypot(R,q)<Lm)return;Ke(),de.value=C.projectName,D.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:k.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}D.value&&Ln(k)}function Ln(k){const C=D.value;if(!C)return;if(C.ghostTop=k.clientY-C.pointerOffsetY,!_r(k)){C.dropTargetIndexFull=null;return}const R=k.clientY,q=j.value;if(!q){C.dropTargetIndexFull=null;return}const Fe=q.getBoundingClientRect(),_t=new Map(n.groups.map((Jt,Hn)=>[Jt.projectName,Hn])),Ct=n.groups.map(Jt=>Jt.projectName).filter(Jt=>Jt!==C.projectName);let an=0,Sr=n.groups.length;for(const Jt of Ct){const Hn=_t.get(Jt);if(Hn===void 0)continue;const xr=Qe(Jt),rr=Fe.top+an+xr/2;if(R<rr){Sr=Hn;break}an+=xr}C.dropTargetIndexFull=Sr}function _r(k){const C=j.value;if(!C)return!1;const R=C.getBoundingClientRect(),q=k.clientX>=R.left&&k.clientX<=R.right,Fe=k.clientY>=R.top-32&&k.clientY<=R.bottom+32;return q&&Fe}function kr(k){var C;return((C=D.value)==null?void 0:C.projectName)===k}function Tr(k){const C=D.value,R=ve.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 yn(k){return k.threads.filter(C=>!y(C.id))}function nr(k){if(Ze.value)return yn(k);if(we(k.projectName))return[];const C=yn(k);return te(k.projectName)?C:C.slice(0,10)}function Wr(k){return Ze.value?!1:!we(k.projectName)&&yn(k).length>10}function Bn(k){return yn(k).length>0}function Fn(k){return k.inProgress?"working":k.unread?"unread":"idle"}lt(()=>n.groups.map(k=>k.projectName),k=>{var Fe,_t;const C=((Fe=D.value)==null?void 0:Fe.projectName)??((_t=U.value)==null?void 0:_t.projectName)??"";C&&!n.groups.some(Ct=>Ct.projectName===C)&&Dn();const R=new Set(k),q=Object.fromEntries(Object.entries(Te.value).filter(([Ct])=>R.has(Ct)));Object.keys(q).length!==Object.keys(Te.value).length&&(Te.value=q)});const qr=ce(()=>He.value||a.value!=="");return lt(qr,k=>{if(k){Hr();return}Qn()}),Nn(()=>{for(const k of oe.values())Ae==null||Ae.unobserve(k);oe.clear(),X.clear(),Qn(),Dn()}),(k,C)=>(w(),S("section",Pp,[E.value.length>0?(w(),S("section",Op,[m("ul",Np,[(w(!0),S(Ue,null,wt(E.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>ee(R.id)},{left:at(()=>[m("span",jp,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Fn(R)},null,8,Dp)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Eo,{class:"thread-icon"})],8,Lp)])]),right:at(()=>[m("span",Up,fe(p(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:Je(q=>V(R.id),["stop"])},[Ce(Jr,{class:"thread-icon"})],8,Vp),se(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>ye(R.id,R.title)}," Rename thread ",8,Wp),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ke(R.id,R.title)}," Delete thread ",8,qp)])):le("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>O(R.id)},[m("span",Fp,[m("span",Hp,fe(R.title),1),R.hasWorktree?(w(),ft(Ps,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Bp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Ce(ur,{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:H},[Ce(Jr,{class:"thread-icon"})],8,Kp),He.value?(w(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=Je(()=>{},["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=>W("project"))},[C[9]||(C[9]=m("span",null,"By project",-1)),Ge.value==="project"?(w(),S("span",zp,"✓")):le("",!0)],8,Gp),m("button",{class:"organize-menu-item","data-active":Ge.value==="chronological",type:"button",onClick:C[2]||(C[2]=R=>W("chronological"))},[C[10]||(C[10]=m("span",null,"Chronological list",-1)),Ge.value==="chronological"?(w(),S("span",Jp,"✓")):le("",!0)],8,Yp)])):le("",!0)],512)]),default:at(()=>[C[12]||(C[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ze.value&&ze.value.length===0?(w(),S("p",Qp,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),S("p",Xp,"Loading threads...")):he.value?(w(),S("ul",Zp,[(w(!0),S(Ue,null,wt(Ee.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>ee(R.id)},{left:at(()=>[m("span",em,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Fn(R)},null,8,tm)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Eo,{class:"thread-icon"})],8,nm)])]),right:at(()=>[m("span",im,fe(p(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:Je(q=>V(R.id),["stop"])},[Ce(Jr,{class:"thread-icon"})],8,am),se(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>ye(R.id,R.title)}," Rename thread ",8,lm),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ke(R.id,R.title)}," Delete thread ",8,cm)])):le("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>O(R.id)},[m("span",sm,[m("span",om,fe(R.title),1),R.hasWorktree?(w(),ft(Ps,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,rm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),S("div",{key:4,ref_key:"groupsContainerRef",ref:j,class:"thread-tree-groups",style:vr(De.value)},[(w(!0),S(Ue,null,wt(ze.value,R=>(w(),S("article",{key:R.projectName,ref_for:!0,ref:q=>wr(R.projectName,q),class:"project-group","data-project-name":R.projectName,"data-expanded":!we(R.projectName),"data-dragging":kr(R.projectName),style:vr(Tr(R.projectName))},[Ce(ur,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>dt(R.projectName),onKeydown:[q=>M(q,R.projectName),Ut(Je(q=>dt(R.projectName),["prevent"]),["enter"]),Ut(Je(q=>dt(R.projectName),["prevent"]),["space"])]},{left:at(()=>[m("span",dm,[m("span",fm,[we(R.projectName)?(w(),ft(qc,{key:0,class:"thread-icon"})):(w(),ft(bp,{key:1,class:"thread-icon"}))]),m("span",hm,[we(R.projectName)?(w(),ft(Wc,{key:0,class:"thread-icon"})):(w(),ft(oo,{key:1,class:"thread-icon"}))])])]),right:at(()=>[m("div",gm,[m("div",{ref_for:!0,ref:q=>mt(R.projectName,q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Je(q=>J(R.projectName),["stop"])},[Ce(Jr,{class:"thread-icon"})],8,vm),pt(R.projectName)?(w(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=Je(()=>{},["stop"]))},[d.value==="actions"?(w(),S(Ue,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:q=>Ye(R.projectName)}," Edit name ",8,ym),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>A(R.projectName)}," Remove ",8,wm)],64)):(w(),S(Ue,{key:1},[C[13]||(C[13]=m("label",{class:"project-menu-label"},"Project name",-1)),$n(m("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>b(R.projectName)},null,40,bm),[[Mn,u.value]])],64))])):le("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":B(R.projectName),title:B(R.projectName),onClick:Je(q=>L(R.projectName),["stop"])},[Ce(Us,{class:"thread-icon"})],8,_m)])]),default:at(()=>[m("span",{class:"project-main-button","data-dragging-handle":kr(R.projectName),onMousedown:Je(q=>Ur(q,R.projectName),["left"])},[m("span",mm,fe(Ie(R.projectName)),1)],40,pm)]),_:2},1032,["onClick","onKeydown"]),Bn(R)?(w(),S("ul",km,[(w(!0),S(Ue,null,wt(nr(R),q=>(w(),S("li",{key:q.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":y(q.id),onMouseleave:Fe=>ee(q.id)},{left:at(()=>[m("span",Tm,[q.inProgress||q.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Fn(q)},null,8,Sm)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>x(q.id)},[Ce(Eo,{class:"thread-icon"})],8,xm)])]),right:at(()=>[m("span",Im,fe(p(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:Je(Fe=>V(q.id),["stop"])},[Ce(Jr,{class:"thread-icon"})],8,Rm),se(q.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Fe=>ye(q.id,q.title)}," Rename thread ",8,$m),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>ke(q.id,q.title)}," Delete thread ",8,Mm)])):le("",!0)],512)]),default:at(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Fe=>O(q.id)},[m("span",Em,[m("span",Am,fe(q.title),1),q.hasWorktree?(w(),ft(Ps,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Cm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ft(ur,{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})),Wr(R)?(w(),ft(ur,{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)},fe(te(R.projectName)?"Show less":"Show more"),9,Pm)]),_:2},1024)):le("",!0)],12,um))),128))],4)),(w(),ft(Ds,{to:"body"},[f.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Je(ie,["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)),$n(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":C[8]||(C[8]=R=>_.value=R),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ut(Je(ge,["prevent"]),["enter"]),Ut(Je(ie,["prevent"]),["esc"])]},null,40,Nm),[[Mn,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:ie},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ge},"Save")])])])):le("",!0)])),(w(),ft(Ds,{to:"body"},[I.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Je(Pe,["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 "'+fe(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:Pe},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:We},"Delete")])])])):le("",!0)]))]))}}),Fm=Xe(Bm,[["__scopeId","data-v-b15f2267"]]),Hm={class:"content-header"},Um={class:"content-leading"},Vm={class:"content-title"},Wm={class:"content-actions"},qm=xt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),S("header",Hm,[m("div",Um,[mn(t.$slots,"leading",{},void 0)]),m("h1",Vm,fe(e.title),1),m("div",Wm,[mn(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 w(),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 Ii=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 w(),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=xt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=P(new Set),r=P(new Set),s=P(new Set),o=P({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var A;return((A=b.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function d(b){var M;if(((M=b.commandExecution)==null?void 0:M.status)==="inProgress")return;const A=new Set(n.value);A.has(b.id)?A.delete(b.id):A.add(b.id),n.value=A}function u(b){const A=new Set(s.value);A.has(b.id)?A.delete(b.id):A.add(b.id),s.value=A}function f(b){return s.value.has(b.id)}function g(b){const A=b.commandExecution;if(!A)return"";switch(A.status){case"inProgress":return"⟳ Running";case"completed":return A.exitCode===0?"✓ Completed":`✗ Exit ${A.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(b){var M,te;const A=(M=b.commandExecution)==null?void 0:M.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((te=b.commandExecution)==null?void 0:te.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(b){const A=new Set(r.value);A.add(b),r.value=A,setTimeout(()=>{const M=new Set(r.value);M.delete(b),r.value=M},1e3)}function I(b,A){const M=[];for(let te=A-1;te>=0;te--){const we=b[te];if(we.messageType==="commandExecution")M.unshift(we);else if(we.role==="user"||we.messageType==="worked")break}return M}const F=e,z=t,j=P(null),U=P(null),D=P(null),ae=P(""),ue=P({}),de=P({});let Te=0,oe=0,X=0;const me=new WeakSet,ne=P(new Set);function Be(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const A=b.startsWith("/"),M=/^[A-Za-z]:[\\/]/u.test(b),te=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),we=b.includes("/")||b.includes("\\");return A||M||te||we}function He(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Ge(b){if(!b)return null;let A=b,M=null;const te=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(te)A=te[1],M=Number(te[2]);else{const we=A.match(/^(.*):(\d+)(?::\d+)?$/u);we&&(A=we[1],M=Number(we[2]))}return Be(A)?{path:A,line:M}:null}function Ae(b){if(!b.includes("`"))return[{kind:"text",value:b}];const A=[];let M=0,te=0;for(;M<b.length;){if(b[M]!=="`"){M+=1;continue}let we=1;for(;M+we<b.length&&b[M+we]==="`";)we+=1;const xe="`".repeat(we);let dt=M+we,Qe=-1;for(;dt<b.length;){const it=b.indexOf(xe,dt);if(it<0)break;const Oe=it>0&&b[it-1]==="`",$e=it+we<b.length&&b[it+we]==="`",vn=b.slice(M+we,it).includes(`
|
|
26
|
-
`);if(!Oe&&!$e&&!vn){Qe=it;break}dt=it+1}if(Qe<0){M+=we;continue}M>te&&A.push({kind:"text",value:b.slice(te,M)});const mt=b.slice(M+we,Qe);if(mt.length>0){const it=Ge(mt);if(it){const Oe=it.line?`${it.path}:${String(it.line)}`:it.path;A.push({kind:"file",value:mt,path:it.path,displayPath:Oe,downloadName:He(it.path)})}else A.push({kind:"code",value:mt})}else A.push({kind:"text",value:`${xe}${xe}`});M=Qe+we,te=M}return te<b.length&&A.push({kind:"text",value:b.slice(te)}),A}function _e(b){const A=b.trim();if(!A)return"";if(A.startsWith("data:")||A.startsWith("blob:")||A.startsWith("http://")||A.startsWith("https://")||A.startsWith("/codex-local-image?"))return A;if(A.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(A)}`;const M=A.startsWith("/"),te=/^[A-Za-z]:[\\/]/u.test(A);return M||te?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function Me(b){const A=b.trim();if(!A)return"#";const M=we=>we.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(we),te=Ge(A);return te!=null&&te.path&&M(te.path)?`/codex-local-browse${encodeURI(te.path)}`:M(A)?`/codex-local-browse${encodeURI(A)}`:"#"}function vt(b){if(!b.includes(")return[{kind:"text",value:b}];const A=[],M=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let te=0;for(const we of b.matchAll(M)){const[xe,dt,Qe]=we;if(typeof we.index!="number")continue;const mt=we.index,it=mt+xe.length,Oe=_e(Qe.trim());Oe&&(mt>te&&A.push({kind:"text",value:b.slice(te,mt)}),A.push({kind:"image",url:Oe,alt:dt.trim(),markdown:xe}),te=it)}return te<b.length&&A.push({kind:"text",value:b.slice(te)}),A.length>0?A:[{kind:"text",value:b}]}function Ze(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function ut(b){const A=new Date(b);return Number.isNaN(A.getTime())?b:A.toLocaleTimeString()}function tt(b){const A=Ze(b.params),M=A==null?void 0:A.reason;return typeof M=="string"?M.trim():""}function ze(b,A){return`${String(b)}:${A}`}function he(b){const A=Ze(b.params),M=Array.isArray(A==null?void 0:A.questions)?A.questions:[],te=[];for(const we of M){const xe=Ze(we);if(!xe)continue;const dt=typeof xe.id=="string"?xe.id:"";if(!dt)continue;const Qe=Array.isArray(xe.options)?xe.options.map(mt=>Ze(mt)).map(mt=>mt==null?void 0:mt.label).filter(mt=>typeof mt=="string"&&mt.length>0):[];te.push({id:dt,header:typeof xe.header=="string"?xe.header:"",question:typeof xe.question=="string"?xe.question:"",isOther:xe.isOther===!0,options:Qe})}return te}function Ee(b,A,M){const te=ze(b,A),we=ue.value[te];return typeof we=="string"&&we.length>0?we:M}function Se(b,A){const M=ze(b,A);return de.value[M]??""}function E(b,A,M){const te=M.target;if(!(te instanceof HTMLSelectElement))return;const we=ze(b,A);ue.value={...ue.value,[we]:te.value}}function Z(b,A,M){const te=M.target;if(!(te instanceof HTMLInputElement))return;const we=ze(b,A);de.value={...de.value,[we]:te.value}}function Y(b,A){z("respondServerRequest",{id:b,result:{decision:A}})}function ve(b){const A=he(b),M={};for(const te of A){const we=Ee(b.id,te.id,te.options[0]||""),xe=Se(b.id,te.id).trim(),dt=[we,xe].map(Qe=>Qe.trim()).filter(Qe=>Qe.length>0);M[te.id]={answers:dt}}z("respondServerRequest",{id:b.id,result:{answers:M}})}function De(b){z("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function p(b){z("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function y(b){z("respondServerRequest",{id:b,result:{}})}function x(b){z("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function O(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function B(b){O(b)&&z("rollback",{turnIndex:b.turnIndex})}function L(){const b=j.value,A=U.value;!b||!A||(b.scrollTop=b.scrollHeight,A.scrollIntoView({block:"end"}))}function ee(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=bv}function se(b){if(!F.activeThreadId)return;const A=Math.max(b.scrollHeight-b.clientHeight,0),M=A>0?Math.min(Math.max(b.scrollTop/A,0),1):1;z("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:ee(b),scrollRatio:M}})}function Q(){const b=j.value;if(!b)return;const A=F.scrollState;if(!A||A.isAtBottom){V();return}const M=Math.max(b.scrollHeight-b.clientHeight,0),te=typeof A.scrollRatio=="number"?A.scrollRatio*M:A.scrollTop;b.scrollTop=Math.min(Math.max(te,0),M),se(b)}function V(){const b=j.value;b&&(L(),se(b))}function ye(){const b=F.scrollState;return!b||b.isAtBottom===!0}function ie(){if(!ye()){X=0,oe=0;return}if(V(),X-=1,X<=0){oe=0;return}oe=requestAnimationFrame(ie)}function ge(b=6){ye()&&(oe&&(cancelAnimationFrame(oe),oe=0),X=Math.max(b,1),oe=requestAnimationFrame(ie))}function ke(){ge(3)}function Pe(){if(!ye())return;const b=j.value;if(!b)return;const A=b.querySelectorAll("img.message-image-preview");for(const M of A)M.complete||me.has(M)||(me.add(M),M.addEventListener("load",ke,{once:!0}),M.addEventListener("error",ke,{once:!0}))}async function We(){await Yt(),Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=0,Q(),Pe(),ge()})}lt(()=>F.messages,async b=>{if(!F.isLoading){for(const A of b){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const M=o.value[A.id],te=A.commandExecution.status;M==="inProgress"&&te!=="inProgress"&&N(A.id),o.value[A.id]=te}await We()}}),lt(()=>F.liveOverlay,async b=>{b&&(await Yt(),V(),ge(8))},{deep:!0}),lt(()=>F.isLoading,async b=>{b||await We()}),lt(()=>F.activeThreadId,()=>{ae.value="",ne.value=new Set},{flush:"post"});function Ie(){const b=j.value;!b||F.isLoading||se(b)}function pt(b){ae.value=_e(b)}function Ke(b,A){return`${b}:${String(A)}`}function H(b,A){const M=new Set(ne.value);M.add(Ke(b,A)),ne.value=M}function W(b,A){return ne.value.has(Ke(b,A))}function J(){ae.value=""}function Ye(){const b=D.value;b&&(b.scrollTop=b.scrollHeight)}return lt(()=>{var b;return(b=F.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await Yt(),Ye())}),Nn(()=>{Te&&cancelAnimationFrame(Te),oe&&cancelAnimationFrame(oe)}),(b,A)=>(w(),S("section",eg,[e.isLoading?(w(),S("p",tg,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),S("p",ng," No messages in this thread yet. ")):(w(),S("ul",{key:2,ref_key:"conversationListRef",ref:j,class:"conversation-list",onScroll:Ie},[(w(!0),S(Ue,null,wt(e.pendingRequests,M=>(w(),S("li",{key:`server-request:${M.id}`,class:"conversation-item conversation-item-request"},[m("div",rg,[m("div",sg,[m("article",og,[m("p",ig,fe(M.method),1),m("p",ag,"Request #"+fe(M.id)+" · "+fe(ut(M.receivedAtIso)),1),tt(M)?(w(),S("p",lg,fe(tt(M)),1)):le("",!0),M.method==="item/commandExecution/requestApproval"?(w(),S("section",cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:te=>Y(M.id,"accept")},"Accept",8,ug),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"acceptForSession")},"Accept for Session",8,dg),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"decline")},"Decline",8,fg),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"cancel")},"Cancel",8,hg)])):M.method==="item/fileChange/requestApproval"?(w(),S("section",pg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:te=>Y(M.id,"accept")},"Accept",8,mg),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"acceptForSession")},"Accept for Session",8,gg),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"decline")},"Decline",8,vg),m("button",{type:"button",class:"request-button",onClick:te=>Y(M.id,"cancel")},"Cancel",8,yg)])):M.method==="item/tool/requestUserInput"?(w(),S("section",wg,[(w(!0),S(Ue,null,wt(he(M),te=>(w(),S("div",{key:`${M.id}:${te.id}`,class:"request-question"},[m("p",bg,fe(te.header||te.question),1),te.header&&te.question?(w(),S("p",_g,fe(te.question),1)):le("",!0),m("select",{class:"request-select",value:Ee(M.id,te.id,te.options[0]||""),onChange:we=>E(M.id,te.id,we)},[(w(!0),S(Ue,null,wt(te.options,we=>(w(),S("option",{key:`${M.id}:${te.id}:${we}`,value:we},fe(we),9,Tg))),128))],40,kg),te.isOther?(w(),S("input",{key:1,class:"request-input",type:"text",value:Se(M.id,te.id),placeholder:"Other answer",onInput:we=>Z(M.id,te.id,we)},null,40,Sg)):le("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:te=>ve(M)}," Submit Answers ",8,xg)])):M.method==="item/tool/call"?(w(),S("section",Cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:te=>De(M.id)},"Fail Tool Call",8,Eg),m("button",{type:"button",class:"request-button",onClick:te=>p(M.id)},"Success (Empty)",8,Ag)])):(w(),S("section",Ig,[m("button",{type:"button",class:"request-button request-button-primary",onClick:te=>y(M.id)},"Return Empty Result",8,Rg),m("button",{type:"button",class:"request-button",onClick:te=>x(M.id)},"Reject Request",8,$g)]))])])])]))),128)),(w(!0),S(Ue,null,wt(e.messages,M=>{var te,we;return w(),S("li",{key:M.id,class:ct(["conversation-item",{"conversation-item-rollbackable":O(M)}]),"data-role":M.role,"data-message-type":M.messageType||""},[i(M)?(w(),S("div",Pg,[m("div",Og,[m("button",{type:"button",class:ct(["cmd-row",[_(M),{"cmd-expanded":a(M)}]]),onClick:xe=>d(M)},[m("span",{class:ct(["cmd-chevron",{"cmd-chevron-open":a(M)}])},"▶",2),m("code",jg,fe(((te=M.commandExecution)==null?void 0:te.command)||"(command)"),1),m("span",Dg,fe(g(M)),1)],10,Ng),m("div",{class:ct(["cmd-output-wrap",{"cmd-output-visible":a(M),"cmd-output-collapsing":l(M)}])},[m("div",Lg,[m("pre",Bg,fe(((we=M.commandExecution)==null?void 0:we.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),S("div",{key:1,class:"message-row","data-role":M.role,"data-message-type":M.messageType||""},[m("div",{class:"message-stack","data-role":M.role},[m("article",{class:"message-body","data-role":M.role},[M.images&&M.images.length>0?(w(),S("ul",{key:0,class:"message-image-list","data-role":M.role},[(w(!0),S(Ue,null,wt(M.images,xe=>(w(),S("li",{key:xe,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:dt=>pt(xe)},[m("img",{class:"message-image-preview",src:_e(xe),alt:"Message image preview",loading:"lazy"},null,8,qg)],8,Wg)]))),128))],8,Vg)):le("",!0),M.fileAttachments&&M.fileAttachments.length>0?(w(),S("div",Kg,[(w(!0),S(Ue,null,wt(M.fileAttachments,xe=>(w(),S("span",{key:xe.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:Me(xe.path),target:"_blank",rel:"noopener noreferrer",title:xe.path},fe(xe.path),9,Gg)]))),128))])):le("",!0),M.text.length>0?(w(),S("article",{key:2,class:"message-card","data-role":M.role},[M.messageType==="worked"?(w(),S("div",Yg,[m("button",{type:"button",class:"worked-separator",onClick:xe=>u(M)},[A[2]||(A[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:ct(["worked-chevron",{"worked-chevron-open":f(M)}])},"▶",2),m("p",Qg,fe(M.text),1),A[3]||(A[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Jg),f(M)?(w(),S("div",Xg,[(w(!0),S(Ue,null,wt(I(e.messages,e.messages.indexOf(M)),xe=>{var dt,Qe;return w(),S("div",{key:`worked-cmd-${xe.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:ct(["cmd-row",[_(xe),{"cmd-expanded":a(xe)}]]),onClick:mt=>d(xe)},[m("span",{class:ct(["cmd-chevron",{"cmd-chevron-open":a(xe)}])},"▶",2),m("code",ev,fe(((dt=xe.commandExecution)==null?void 0:dt.command)||"(command)"),1),m("span",tv,fe(g(xe)),1)],10,Zg),m("div",{class:ct(["cmd-output-wrap",{"cmd-output-visible":a(xe),"cmd-output-collapsing":l(xe)}])},[m("div",nv,[m("pre",rv,fe(((Qe=xe.commandExecution)==null?void 0:Qe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(w(),S("div",sv,[(w(!0),S(Ue,null,wt(vt(M.text),(xe,dt)=>(w(),S(Ue,{key:`block-${dt}`},[xe.kind==="text"?(w(),S("p",ov,[(w(!0),S(Ue,null,wt(Ae(xe.value),(Qe,mt)=>(w(),S(Ue,{key:`seg-${dt}-${mt}`},[Qe.kind==="text"?(w(),S("span",iv,fe(Qe.value),1)):Qe.kind==="file"?(w(),S("a",{key:1,class:"message-file-link",href:Me(Qe.path),target:"_blank",rel:"noopener noreferrer",title:Qe.path},fe(Qe.displayPath),9,av)):(w(),S("code",lv,fe(Qe.value),1))],64))),128))])):W(M.id,dt)?(w(),S("p",cv,fe(xe.markdown),1)):(w(),S("button",{key:2,class:"message-image-button",type:"button",onClick:Qe=>pt(xe.url)},[m("img",{class:"message-image-preview message-markdown-image",src:xe.url,alt:xe.alt||"Embedded message image",loading:"lazy",onError:Qe=>H(M.id,dt)},null,40,dv)],8,uv))],64))),128))]))],8,zg)):le("",!0)],8,Ug),O(M)?(w(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:xe=>B(M)},[Ce(Zm,{class:"rollback-icon"}),A[4]||(A[4]=m("span",{class:"rollback-label"},"Rollback",-1))],8,fv)):le("",!0)],8,Hg)],8,Fg))],10,Mg)}),128)),e.liveOverlay?(w(),S("li",hv,[m("div",pv,[m("div",mv,[m("article",gv,[m("p",vv,fe(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:D},fe(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(w(),S("p",yv,fe(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),m("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(w(),S("div",{key:3,class:"image-modal-backdrop",onClick:J},[m("div",{class:"image-modal-content",onClick:A[0]||(A[0]=Je(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:J},[Ce(Ii,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,wv)])])):le("",!0)]))}}),kv=Xe(_v,[["__scopeId","data-v-454a8117"]]);function Tv(e){var u;const t=P("idle"),n=P(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var N;const g=o,_=(r==null?void 0:r.mimeType)||((N=g[0])==null?void 0:N.type)||"audio/webm";d(),t.value="idle",l(g,_)},r.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,g){var N;if(f.length===0)return;const _=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",F=`----codex-transcribe-${crypto.randomUUID()}`,z=new Uint8Array(await _.arrayBuffer()),j=new TextEncoder,U=[];U.push(j.encode(`--${F}\r
|
|
27
|
-
`)),U.push(j.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
|
|
28
|
-
`)),U.push(j.encode(`Content-Type: ${g}\r
|
|
29
|
-
\r
|
|
30
|
-
`)),U.push(z),U.push(j.encode(`\r
|
|
31
|
-
--${F}--\r
|
|
32
|
-
`));let D=0;for(const X of U)D+=X.byteLength;const ae=new Uint8Array(D);let ue=0;for(const X of U)ae.set(X,ue),ue+=X.byteLength;const de=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${F}`},body:ae});if(!de.ok)throw new Error(`Transcription failed: ${de.status}`);const oe=((await de.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return Nn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Qa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class En extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Ri(e,t){const n=Qa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Qa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Fr(e,t,n){return e instanceof En?e:e instanceof Error?new En(e.message||t,{code:"unknown_error",method:n}):new En(t,{code:"unknown_error",method:n})}function Kc(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 En(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 En(Ri(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 En(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Xa(e){const t=Kc(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=Xa(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=Xa(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 En(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 En(Ri(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 En(Ri(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Kc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Za(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 Gc(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 Gc(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:Za(e.createdAt),updatedAtIso:Za(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 zc(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 Gc(t.at(-1))}async function qt(e,t){try{return await Sv(e,t)}catch(n){throw Fr(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:zc(t),inProgress:Vv(t)}}async function Gv(){try{return await qv()}catch(e){throw Fr(e,"Failed to load thread groups","thread/list")}}async function zv(e){try{return await Kv(e)}catch(t){throw Fr(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 Ao(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 el(e,t){const n=await qt("thread/rollback",{threadId:e,numTurns:t});return zc(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 tl(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 Fr(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 Io(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 Fr(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 Fr(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 ti(){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 ay(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function nl(){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 ly(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 cy(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=$i(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 uy(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=$i(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 dy(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=$i(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}async function fy(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function $i(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 hy(){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 Ro(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 py(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 my(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 gy(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 vy={},yy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wy(e,t){return w(),S("svg",yy,[...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 by=Xe(vy,[["render",wy]]),_y={},ky={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ty(e,t){return w(),S("svg",ky,[...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 Sy=Xe(_y,[["render",Ty]]),xy={},Cy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ey(e,t){return w(),S("svg",Cy,[...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 Ay=Xe(xy,[["render",Ey]]),Iy=["disabled"],Ry={class:"composer-dropdown-value"},$y={class:"composer-dropdown-menu"},My={key:0,class:"composer-dropdown-search-wrap"},Py=["placeholder","onKeydown"],Oy={class:"composer-dropdown-options",role:"listbox"},Ny=["onClick"],jy={key:0,class:"composer-dropdown-empty"},Dy={key:1,class:"composer-dropdown-add-wrap"},Ly=["placeholder","onKeydown"],By=xt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(null),a=P(!1),l=P(""),d=P(!1),u=P(""),f=ce(()=>{var me;const X=n.options.find(ne=>ne.value===n.modelValue);return X?X.label:((me=n.placeholder)==null?void 0:me.trim())||""}),g=ce(()=>n.openDirection??"down"),_=ce(()=>n.enableSearch===!0),N=ce(()=>n.showAddAction===!0),I=ce(()=>{var X;return((X=n.searchPlaceholder)==null?void 0:X.trim())||"Quick search projects"}),F=ce(()=>{var X;return((X=n.addActionLabel)==null?void 0:X.trim())||"Add new project"}),z=ce(()=>{var X;return((X=n.addPlaceholder)==null?void 0:X.trim())||"Project name or absolute path"}),j=ce(()=>{const X=l.value.trim().toLowerCase();return X?n.options.filter(me=>me.label.toLowerCase().includes(X)||me.value.toLowerCase().includes(X)):n.options});function U(){n.disabled||(a.value=!a.value)}function D(X){r("update:modelValue",X),a.value=!1,l.value=""}function ae(){var X;d.value=!0,u.value=((X=n.defaultAddValue)==null?void 0:X.trim())||"",Yt(()=>{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 de(){const X=u.value.trim();X&&(r("add",X),d.value=!1,u.value="",a.value=!1,l.value="")}function Te(){d.value=!1,u.value="",a.value=!1,l.value=""}function oe(X){if(!a.value)return;const me=s.value;if(!me)return;const ne=X.target;ne instanceof Node&&(me.contains(ne)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return lt(a,X=>{if(!X){d.value=!1,u.value="";return}_.value&&Yt(()=>{var me;return(me=o.value)==null?void 0:me.focus()})}),On(()=>{window.addEventListener("pointerdown",oe)}),Nn(()=>{window.removeEventListener("pointerdown",oe)}),(X,me)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[m("span",Ry,fe(f.value),1),Ce(oo,{class:"composer-dropdown-chevron"})],8,Iy),a.value?(w(),S("div",{key:0,class:ct(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[m("div",$y,[_.value?(w(),S("div",My,[$n(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":me[0]||(me[0]=ne=>l.value=ne),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Ut(Je(ue,["prevent"]),["esc"])},null,40,Py),[[Mn,l.value]])])):le("",!0),m("ul",Oy,[(w(!0),S(Ue,null,wt(j.value,ne=>(w(),S("li",{key:ne.value},[m("button",{class:ct(["composer-dropdown-option",{"is-selected":ne.value===e.modelValue}]),type:"button",onClick:Be=>D(ne.value)},fe(ne.label),11,Ny)]))),128)),j.value.length===0?(w(),S("li",jy," No matching projects ")):le("",!0)]),N.value?(w(),S("div",Dy,[d.value?(w(),S(Ue,{key:0},[$n(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":me[1]||(me[1]=ne=>u.value=ne),class:"composer-dropdown-add-input",type:"text",placeholder:z.value,onKeydown:[Ut(Je(de,["prevent"]),["enter"]),Ut(Je(Te,["prevent"]),["esc"])]},null,40,Ly),[[Mn,u.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:de},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Te},"Cancel")])],64)):(w(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},fe(F.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),ni=Xe(By,[["__scopeId","data-v-7cfa2012"]]),Fy=["disabled"],Hy={class:"search-dropdown-value"},Uy={class:"search-dropdown-search-wrap"},Vy=["placeholder","onKeydown"],Wy={key:0,class:"search-dropdown-list",role:"listbox"},qy=["onClick","onPointerenter"],Ky={class:"search-dropdown-option-check"},Gy={class:"search-dropdown-option-label"},zy={key:0,class:"search-dropdown-option-desc"},Yy={key:1,class:"search-dropdown-empty"},Jy=xt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(!1),a=P(""),l=P(0),d=ce(()=>n.openDirection??"down"),u=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const j=n.options.find(U=>U.value===n.selectedValues[0]);return(j==null?void 0:j.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const j=a.value.toLowerCase().trim();return j?n.options.filter(U=>{var D;return U.label.toLowerCase().includes(j)||(((D=U.description)==null?void 0:D.toLowerCase().includes(j))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Yt(()=>{var j;return(j=o.value)==null?void 0:j.focus()})))}function N(j){r("toggle",j.value,!u.value.has(j.value))}function I(j){g.value.length!==0&&(l.value=(l.value+j+g.value.length)%g.value.length)}function F(){const j=g.value[l.value];j&&N(j)}function z(j){if(!i.value)return;const U=s.value;if(!U)return;const D=j.target;D instanceof Node&&(U.contains(D)||(i.value=!1))}return lt(a,()=>{l.value=0}),On(()=>window.addEventListener("pointerdown",z)),Nn(()=>window.removeEventListener("pointerdown",z)),(j,U)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",Hy,fe(f.value),1),Ce(oo,{class:"search-dropdown-chevron"})],8,Fy),i.value?(w(),S("div",{key:0,class:ct(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[m("div",Uy,[$n(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=D=>a.value=D),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Ut(Je(D=>i.value=!1,["prevent"]),["escape"])),Ut(Je(F,["prevent"]),["enter"]),U[2]||(U[2]=Ut(Je(D=>I(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Ut(Je(D=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Vy),[[Mn,a.value]])]),g.value.length>0?(w(),S("ul",Wy,[(w(!0),S(Ue,null,wt(g.value,(D,ae)=>(w(),S("li",{key:D.value},[m("button",{class:ct(["search-dropdown-option",{"is-selected":u.value.has(D.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>N(D),onPointerenter:ue=>l.value=ae},[m("span",Ky,fe(u.value.has(D.value)?"✓":""),1),m("span",Gy,fe(D.label),1),D.description?(w(),S("span",zy,fe(D.description),1)):le("",!0)],42,qy)]))),128))])):(w(),S("div",Yy,"No results"))],2)):le("",!0)],512))}}),Qy=Xe(Jy,[["__scopeId","data-v-a0f2edd4"]]),Xy={class:"skill-picker-header"},Zy=["onKeydown"],ew={key:0,class:"skill-picker-list",role:"listbox"},tw=["onClick","onPointerenter"],nw={class:"skill-picker-name"},rw={key:0,class:"skill-picker-desc"},sw={key:1,class:"skill-picker-empty"},ow=xt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(""),a=P(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),d=ce(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return lt(()=>n.visible,g=>{g&&(i.value="",a.value=0,Yt(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),lt(i,()=>{a.value=0}),(g,_)=>e.visible?(w(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:vr(d.value)},[m("div",Xy,[$n(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Ut(Je(N=>g.$emit("close"),["prevent"]),["escape"])),Ut(Je(f,["prevent"]),["enter"]),_[2]||(_[2]=Ut(Je(N=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Ut(Je(N=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Zy),[[Mn,i.value]])]),l.value.length>0?(w(),S("ul",ew,[(w(!0),S(Ue,null,wt(l.value,(N,I)=>(w(),S("li",{key:N.path},[m("button",{class:ct(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:F=>g.$emit("select",N),onPointerenter:F=>a.value=I},[m("span",nw,fe(N.name),1),N.description?(w(),S("span",rw,fe(N.description),1)):le("",!0)],42,tw)]))),128))])):(w(),S("div",sw,"No skills found"))],4)):le("",!0)}}),iw=Xe(ow,[["__scopeId","data-v-d6a08788"]]),aw={key:0,class:"thread-composer-attachments"},lw=["src","alt"],cw=["aria-label","disabled","onClick"],uw={key:1,class:"thread-composer-file-chips"},dw=["title"],fw=["aria-label","disabled","onClick"],hw={key:2,class:"thread-composer-skill-chips"},pw={class:"thread-composer-skill-chip-name"},mw=["aria-label","onClick"],gw={class:"thread-composer-input-wrap"},vw={key:0,class:"thread-composer-file-mentions"},yw=["onMousedown"],ww={key:1,class:"thread-composer-file-mention-icon-markdown"},bw={class:"thread-composer-file-mention-text"},_w={class:"thread-composer-file-mention-name"},kw={key:0,class:"thread-composer-file-mention-dir"},Tw={key:1,class:"thread-composer-file-mention-empty"},Sw=["placeholder","disabled"],xw={class:"thread-composer-controls"},Cw=["disabled"],Ew={key:0,class:"thread-composer-attach-menu"},Aw=["disabled"],Iw=["disabled"],Rw={class:"thread-composer-actions"},$w=["aria-label","title","disabled"],Mw=["disabled"],Pw=["aria-label","title","disabled"],Ow=["disabled"],Nw=["disabled"],jw=xt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=P(""),o=P([]),i=P([]),a=P([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=Tv({onTranscript:H=>{s.value=s.value?`${s.value}
|
|
43
|
-
${H}`:H}}),g=P(null),_=P(null),N=P(null),I=P(null),F=P(!1),z=P(!1),j=P(null),U=P(""),D=P([]),ae=P(!1),ue=P(0);let de=0,Te=null;const oe=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=ce(()=>n.models.map(H=>({value:H,label:H}))),ne=ce(()=>n.skills??[]),Be=ce(()=>i.value.map(H=>H.path)),He=ce(()=>(n.skills??[]).map(H=>({value:H.path,label:H.name,description:H.description}))),Ge=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ae=ce(()=>n.disabled||!n.activeThreadId),_e=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Me=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function vt(H="steer"){var J;const W=s.value.trim();if(Ge.value){if(r("submit",{text:W,imageUrls:o.value.map(Ye=>Ye.url),fileAttachments:[...a.value],skills:i.value.map(Ye=>({name:Ye.name,path:Ye.path})),mode:H}),s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,ee(),oe){(J=I.value)==null||J.blur();return}Yt(()=>{var Ye;return(Ye=I.value)==null?void 0:Ye.focus()})}}function Ze(){r("interrupt")}function ut(H){r("update:selected-model",H)}function tt(H){r("update:selected-reasoning-effort",H)}function ze(){Ae.value||(F.value=!F.value)}function he(){var H;(H=_.value)==null||H.click()}function Ee(){var H;(H=N.value)==null||H.click()}function Se(H){o.value=o.value.filter(W=>W.id!==H)}function E(H){i.value=i.value.filter(W=>W.path!==H)}function Z(H){a.value=a.value.filter(W=>W.fsPath!==H)}function Y(H){const W=H.replace(/\\/g,"/");if(a.value.some(b=>b.fsPath===W))return;const J=W.split("/").filter(Boolean),Ye=J[J.length-1]??W;a.value=[...a.value,{label:Ye,path:W,fsPath:W}]}function ve(H){return H.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(H.name)}function De(H){if(!(!H||H.length===0))for(const W of Array.from(H))if(ve(W)){const J=new FileReader;J.onload=()=>{typeof J.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:W.name,url:J.result})},J.readAsDataURL(W)}else gy(W).then(J=>{J&&Y(J)}).catch(()=>{})}function p(H){H&&(H.value="")}function y(H){const W=H.target;De((W==null?void 0:W.files)??null),p(W),F.value=!1}function x(H){const W=H.target;De((W==null?void 0:W.files)??null),p(W),F.value=!1}function O(){const W=s.value.startsWith("/");W!==z.value&&(z.value=W),se()}function B(H){if(ae.value){if(H.key==="Escape"){H.preventDefault(),ee();return}if(H.key==="ArrowDown"){H.preventDefault(),D.value.length>0&&(ue.value=(ue.value+1)%D.value.length);return}if(H.key==="ArrowUp"){if(H.preventDefault(),D.value.length>0){const J=D.value.length;ue.value=(ue.value+J-1)%J}return}if(H.key==="Enter"||H.key==="Tab"){H.preventDefault();const J=D.value[ue.value];J?V(J):ee();return}}if(n.sendWithEnter!==!1?H.key==="Enter"&&!H.shiftKey:H.key==="Enter"&&(H.metaKey||H.ctrlKey)){H.preventDefault(),vt(n.isTurnInProgress?_e.value:"steer");return}if(z.value){if(H.key==="Escape"){H.preventDefault(),L();return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();return}}}function L(){var H;z.value=!1,(H=I.value)==null||H.focus()}function ee(){ae.value=!1,j.value=null,U.value="",D.value=[],ue.value=0}function se(){const H=I.value;if(!H){ee();return}const W=H.selectionStart??s.value.length,Ye=s.value.slice(0,W).match(/(^|\s)(@[^\s@]*)$/);if(!Ye){ee();return}const b=Ye[2]??"",A=b.length,M=W-A;j.value=M,U.value=b.slice(1),ae.value=!0,Q()}async function Q(){if(!ae.value)return;const H=(n.cwd??"").trim();if(!H){D.value=[];return}Te&&clearTimeout(Te);const W=++de;Te=setTimeout(async()=>{try{const J=await dy(H,U.value,20);if(!ae.value||W!==de)return;D.value=J,ue.value=0}catch{if(!ae.value||W!==de)return;D.value=[]}},120)}function V(H){const W=I.value,J=j.value;if(J!==null&&W){const Ye=W.selectionStart??s.value.length;s.value=`${s.value.slice(0,J)}${s.value.slice(Ye)}`.trimEnd()}Y(H.path),ee(),Yt(()=>W==null?void 0:W.focus())}function ye(H){const W=H.lastIndexOf("/");return W<0?H:H.slice(W+1)}function ie(H){const W=H.lastIndexOf("/");return W<=0?"":H.slice(0,W)}function ge(H){const W=ye(H),J=W.lastIndexOf(".");return J<=0?"":W.slice(J+1).toLowerCase()}function ke(H){const W=ge(H);return W==="ts"?"TS":W==="tsx"?"TSX":W==="js"?"JS":W==="jsx"?"JSX":W==="json"?"{}":""}function Pe(H){const W=ge(H);return W.startsWith("ts")?"ts":W.startsWith("js")?"js":W==="json"?"json":"default"}function We(H){const W=ge(H);return W==="md"||W==="mdx"}function Ie(H){var W;i.value.some(J=>J.path===H.path)||(i.value=[...i.value,H]),s.value=s.value.startsWith("/")?"":s.value,z.value=!1,(W=I.value)==null||W.focus()}function pt(H,W){if(W){const J=(n.skills??[]).find(Ye=>Ye.path===H);J&&!i.value.some(Ye=>Ye.path===H)&&(i.value=[...i.value,J])}else i.value=i.value.filter(J=>J.path!==H)}function Ke(H){if(!F.value)return;const W=g.value;if(!W)return;const J=H.target;!J||W.contains(J)||(F.value=!1)}return On(()=>{document.addEventListener("click",Ke)}),Nn(()=>{document.removeEventListener("click",Ke),Te&&clearTimeout(Te)}),lt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,ee()}),lt(()=>n.cwd,()=>{ae.value&&Q()}),(H,W)=>(w(),S("form",{class:"thread-composer",onSubmit:W[7]||(W[7]=Je(J=>vt("steer"),["prevent"]))},[m("div",{class:ct(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),S("div",aw,[(w(!0),S(Ue,null,wt(o.value,J=>(w(),S("div",{key:J.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:J.url,alt:J.name||"Selected image"},null,8,lw),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${J.name||"image"}`,disabled:Ae.value,onClick:Ye=>Se(J.id)}," x ",8,cw)]))),128))])):le("",!0),a.value.length>0?(w(),S("div",uw,[(w(!0),S(Ue,null,wt(a.value,J=>(w(),S("span",{key:J.fsPath,class:"thread-composer-file-chip"},[Ce(Us,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:J.fsPath},fe(J.label),9,dw),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${J.label}`,disabled:Ae.value,onClick:Ye=>Z(J.fsPath)},"×",8,fw)]))),128))])):le("",!0),i.value.length>0?(w(),S("div",hw,[(w(!0),S(Ue,null,wt(i.value,J=>(w(),S("span",{key:J.path,class:"thread-composer-skill-chip"},[m("span",pw,fe(J.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${J.name}`,onClick:Ye=>E(J.path)},"×",8,mw)]))),128))])):le("",!0),m("div",gw,[ae.value?(w(),S("div",vw,[D.value.length>0?(w(!0),S(Ue,{key:0},wt(D.value,(J,Ye)=>(w(),S("button",{key:J.path,class:ct(["thread-composer-file-mention-row",{"is-active":Ye===ue.value}]),type:"button",onMousedown:Je(b=>V(J),["prevent"])},[ke(J.path)?(w(),S("span",{key:0,class:ct(["thread-composer-file-mention-icon-badge",`is-${Pe(J.path)}`])},fe(ke(J.path)),3)):We(J.path)?(w(),S("span",ww,"↓")):(w(),ft(Us,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",bw,[m("span",_w,fe(ye(J.path)),1),ie(J.path)?(w(),S("span",kw,fe(ie(J.path)),1)):le("",!0)])],42,yw))),128)):(w(),S("div",Tw,"No matching files"))])):le("",!0),$n(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":W[0]||(W[0]=J=>s.value=J),class:"thread-composer-input",placeholder:Me.value,disabled:Ae.value,onInput:O,onKeydown:B},null,40,Sw),[[Mn,s.value]]),Ce(iw,{skills:ne.value,visible:z.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ie,onClose:L},null,8,["skills","visible"])]),m("div",xw,[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,Cw),F.value?(w(),S("div",Ew,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:he}," Add photos & files ",8,Aw),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:Ee}," Take photo ",8,Iw)])):le("",!0)],512),Ce(ni,{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":ut},null,8,["model-value","options","disabled"]),Ce(Qy,{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:pt},null,8,["options","selected-values","disabled"]),Ce(ni,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:X,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":tt},null,8,["model-value","disabled"]),m("div",Rw,[je(d)&&!e.isTurnInProgress?(w(),S("button",{key:0,class:ct(["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]=Je((...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]=Je((...J)=>je(u)&&je(u)(...J),["prevent"])),onTouchend:W[5]||(W[5]=(...J)=>je(f)&&je(f)(...J))},[Ce(Sy,{class:"thread-composer-mic-icon"})],42,$w)):le("",!0),e.isTurnInProgress?(w(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Ze},[Ce(Ay,{class:"thread-composer-stop-icon"})],8,Mw)):le("",!0),m("button",{class:ct(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&_e.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&_e.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${_e.value}`:"Send",disabled:!Ge.value,onClick:W[6]||(W[6]=J=>vt(e.isTurnInProgress?_e.value:"steer"))},[Ce(by,{class:"thread-composer-submit-icon"})],10,Pw)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ae.value,onChange:y},null,40,Ow),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ae.value,onChange:x},null,40,Nw)],32))}}),rl=Xe(jw,[["__scopeId","data-v-983e7906"]]),Dw={key:0,class:"queued-messages"},Lw={class:"queued-messages-inner"},Bw={class:"queued-row-text"},Fw={class:"queued-row-actions"},Hw=["onClick"],Uw=["onClick"],Vw=xt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),S("div",Dw,[m("div",Lw,[(w(!0),S(Ue,null,wt(e.messages,r=>(w(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),m("span",Bw,fe(r.text),1),m("div",Fw,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Hw),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,Uw)])]))),128))])])):le("",!0)}}),Ww=Xe(Vw,[["__scopeId","data-v-ea583733"]]),qw={class:"runtime-dropdown-trigger-label"},Kw={key:0,class:"runtime-dropdown-menu-wrap"},Gw={class:"runtime-dropdown-menu"},zw=["onClick"],Yw={class:"runtime-dropdown-option-label"},Jw={key:0,class:"runtime-dropdown-option-check"},Qw=xt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(!1),i=[{value:"local",label:"Local project",icon:qc},{value:"worktree",label:"New worktree",icon:Ps}],a=ce(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const f=s.value;if(!f)return;const g=u.target;g instanceof Node&&(f.contains(g)||(o.value=!1))}return On(()=>{window.addEventListener("pointerdown",d)}),Nn(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=g=>o.value=!o.value)},[(w(),ft(Wo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",qw,fe(a.value.label),1),Ce(oo,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),S("div",Kw,[m("div",Gw,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),S(Ue,null,wt(i,g=>m("button",{key:g.value,class:ct(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:_=>l(g.value)},[(w(),ft(Wo(g.icon),{class:"runtime-dropdown-option-icon"})),m("span",Yw,fe(g.label),1),e.modelValue===g.value?(w(),S("span",Jw,"✓")):le("",!0)],10,zw)),64))])])):le("",!0)],512))}}),Xw=Xe(Qw,[["__scopeId","data-v-9c9b71e5"]]),Zw={},eb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function tb(e,t){return w(),S("svg",eb,[...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 ri=Xe(Zw,[["render",tb]]),nb={class:"skill-card-top"},rb=["src","alt"],sb={key:1,class:"skill-card-avatar-fallback"},ob={class:"skill-card-info"},ib={class:"skill-card-header"},ab={class:"skill-card-name"},lb={key:0,class:"skill-card-badge-disabled"},cb={key:1,class:"skill-card-badge"},ub={class:"skill-card-owner"},db={key:0,class:"skill-card-desc"},fb={key:1,class:"skill-card-date"},hb=xt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),S("button",{class:ct(["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",nb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,rb)):(w(),S("div",sb,fe(e.skill.owner.charAt(0)),1)),m("div",ob,[m("div",ib,[m("span",ab,fe(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),S("span",lb,"Disabled")):e.skill.installed?(w(),S("span",cb,"Installed")):le("",!0)]),m("span",ub,fe(e.skill.owner),1)])]),e.skill.description?(w(),S("p",db,fe(e.skill.description),1)):le("",!0),n.value?(w(),S("span",fb,fe(n.value),1)):le("",!0)],2))}}),sl=Xe(hb,[["__scopeId","data-v-2a1e8196"]]),pb={class:"sdm-panel"},mb={class:"sdm-header"},gb={class:"sdm-title-area"},vb=["src","alt"],yb={class:"sdm-title-col"},wb={class:"sdm-title-row"},bb={class:"sdm-title"},_b={key:0,class:"sdm-badge-disabled"},kb={class:"sdm-owner"},Tb={class:"sdm-body"},Sb={key:0,class:"sdm-desc"},xb={key:1,class:"sdm-readme-loading"},Cb=["innerHTML"],Eb=["href"],Ab={class:"sdm-footer"},Ib={class:"sdm-footer-actions"},Rb=["disabled"],$b=["disabled"],Mb=["disabled"],Pb=xt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(""),i=P(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const I=o.value;if(!I)return"";const F=I.replace(/^---[\s\S]*?---\s*/,"");return u(F)});function u(I){return I.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),F=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!F.ok)return;const z=await F.json();o.value=z.content??""}catch{}finally{i.value=!1}}}lt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,F)=>(w(),ft(Ds,{to:"body"},[e.visible?(w(),S("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=Je(z=>I.$emit("close"),["self"]))},[m("div",pb,[m("div",mb,[m("div",gb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,vb)):le("",!0),m("div",yb,[m("div",wb,[m("h3",bb,fe(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),S("span",_b,"Disabled")):le("",!0)]),m("span",kb,fe(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=z=>I.$emit("close"))},[Ce(Ii,{class:"sdm-close-icon"})])]),m("div",Tb,[e.skill.description?(w(),S("p",Sb,fe(e.skill.description),1)):le("",!0),i.value?(w(),S("div",xb,"Loading skill contents...")):o.value?(w(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Cb)):le("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Eb)]),m("div",Ab,[m("div",Ib,[e.skill.installed?(w(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},fe(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Rb)):(w(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},fe(n.isInstalling?"Installing...":"Install"),9,$b)),e.skill.installed?(w(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},fe(a.value?"Disable":"Enable"),9,Mb)):le("",!0)])])])])):le("",!0)]))}}),Ob=Xe(Pb,[["__scopeId","data-v-19a385ca"]]),Nb={class:"skills-hub"},jb={class:"skills-hub-toolbar"},Db={class:"skills-hub-search-wrap"},Lb={key:0,class:"skills-hub-count"},Bb={key:1,class:"skills-hub-section"},Fb={class:"skills-hub-section-title"},Hb={key:0,class:"skills-hub-grid"},Ub={class:"skills-hub-section"},Vb={key:0,class:"skills-hub-loading"},Wb={key:1,class:"skills-hub-error"},qb={key:0,class:"skills-hub-grid"},Kb={key:1,class:"skills-hub-empty"},Ss="codex-web-local.skills-hub.cache.v1",Gb=xt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=P(null),s=P(""),o=P("date"),i=P([]),a=P([]),l=P(0),d=P(!1),u=P(""),f=P(!0),g=P(!1),_=P(n),N=P(null),I=P(""),F=P(!1),z=P(!1);let j=null,U=null;const D=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ue=ce(()=>{var he;return((he=N.value)==null?void 0:he.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),de=ce(()=>`${_.value.owner}/${_.value.name}`),Te=ce(()=>F.value&&I.value===de.value),oe=ce(()=>z.value&&I.value===de.value),X=ce(()=>{const he=s.value.toLowerCase().trim();return he?a.value.filter(Ee=>Ee.name.toLowerCase().includes(he)||Ee.owner.toLowerCase().includes(he)||(Ee.displayName??"").toLowerCase().includes(he)):a.value});function me(he,Ee="success"){N.value={text:he,type:Ee},U&&clearTimeout(U),U=setTimeout(()=>{N.value=null},3e3)}function ne(){o.value=o.value==="date"?"name":"date",Me(s.value)}function Be(he){return`${o.value}::${he.trim().toLowerCase()}`}function He(he){var Ee;if(typeof window>"u")return null;try{const Se=window.localStorage.getItem(Ss);return Se?((Ee=JSON.parse(Se).byKey)==null?void 0:Ee[he])??null:null}catch{return null}}function Ge(he,Ee){if(!(typeof window>"u"))try{const Se=window.localStorage.getItem(Ss),Z=(Se?JSON.parse(Se):{}).byKey??{};Z[he]=Ee,window.localStorage.setItem(Ss,JSON.stringify({byKey:Z}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Ss)}catch{}}function _e(he){const Ee=he.installed??[];a.value=Ee;const Se=new Set(Ee.map(E=>E.name));i.value=he.data.map(E=>{if(E.installed||Se.has(E.name)){const Z=Ee.find(Y=>Y.name===E.name);return{...E,installed:!0,path:(Z==null?void 0:Z.path)??E.path,enabled:(Z==null?void 0:Z.enabled)??E.enabled}}return E}).filter(E=>!E.installed),l.value=he.total}async function Me(he){const Ee=Be(he),Se=He(Ee);Se&&_e(Se),d.value=!Se,u.value="";try{const E=new URLSearchParams;he.trim()&&E.set("q",he.trim()),E.set("limit","100"),E.set("sort",o.value);const Z=await fetch(`/codex-api/skills-hub?${E}`);if(!Z.ok)throw new Error(`HTTP ${Z.status}`);const Y=await Z.json();_e(Y),Ge(Ee,Y)}catch(E){u.value=E instanceof Error?E.message:"Failed to load skills"}finally{d.value=!1}}function vt(){j&&clearTimeout(j),j=setTimeout(()=>Me(s.value),300)}function Ze(he){_.value=he,g.value=!0}async function ut(he){I.value=`${he.owner}/${he.name}`,F.value=!0;try{const Se=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(!Se.ok)throw new Error(Se.error||"Install failed");const E={...he,installed:!0,path:Se.path,enabled:!0};a.value=[...a.value,E],i.value=i.value.filter(Z=>Z.name!==he.name),_.value=E,me(`${he.displayName||he.name} skill installed`),g.value=!1,Ae(),D("skills-changed")}catch(Ee){me(Ee instanceof Error?Ee.message:"Failed to install skill","error")}finally{F.value=!1}}async function tt(he){I.value=`${he.owner}/${he.name}`,z.value=!0;try{const Se=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(!Se.ok)throw new Error(Se.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(),D("skills-changed")}catch(Ee){me(Ee instanceof Error?Ee.message:"Failed to uninstall skill","error")}finally{z.value=!1}}async function ze(he,Ee){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:Ee}})})).ok)throw new Error("Failed to update skill");me(`${he.displayName||he.name} skill ${Ee?"enabled":"disabled"}`),await Me(s.value)}catch(Se){me(Se instanceof Error?Se.message:"Failed to update skill","error")}}return On(()=>{Me("")}),(he,Ee)=>(w(),S("div",Nb,[Ee[3]||(Ee[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",jb,[m("div",Db,[Ce(ri,{class:"skills-hub-search-icon"}),$n(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Ee[0]||(Ee[0]=Se=>s.value=Se),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:vt},null,544),[[Mn,s.value]]),l.value>0?(w(),S("span",Lb,fe(l.value)+" skills",1)):le("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:ne},fe(ae.value),1)]),N.value?(w(),S("div",{key:0,class:ct(["skills-hub-toast",ue.value])},fe(N.value.text),3)):le("",!0),X.value.length>0?(w(),S("div",Bb,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:Ee[1]||(Ee[1]=Se=>f.value=!f.value)},[m("span",Fb,"Installed ("+fe(X.value.length)+")",1),Ce(Wc,{class:ct(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),S("div",Hb,[(w(!0),S(Ue,null,wt(X.value,Se=>(w(),ft(sl,{key:Se.name,skill:Se,onSelect:E=>Ze(E)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),m("div",Ub,[d.value?(w(),S("div",Vb,"Loading skills...")):u.value?(w(),S("div",Wb,fe(u.value),1)):(w(),S(Ue,{key:2},[i.value.length>0?(w(),S("div",qb,[(w(!0),S(Ue,null,wt(i.value,Se=>(w(),ft(sl,{key:Se.url,skill:Se,onSelect:E=>Ze(E)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),S("div",Kb,'No skills found for "'+fe(s.value)+'"',1)):le("",!0)],64))]),Ce(Ob,{skill:_.value,visible:g.value,"is-installing":Te.value,"is-uninstalling":oe.value,onClose:Ee[2]||(Ee[2]=Se=>g.value=!1),onInstall:ut,onUninstall:tt,onToggleEnabled:ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),zb=Xe(Gb,[["__scopeId","data-v-1967b404"]]),Yb={},Jb={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 Qb(e,t){return w(),S("svg",Jb,[...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 Xb=Xe(Yb,[["render",Qb]]),Zb={},e0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function t0(e,t){return w(),S("svg",e0,[...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 n0=Xe(Zb,[["render",t0]]),r0={},s0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function o0(e,t){return w(),S("svg",s0,[...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 i0=Xe(r0,[["render",o0]]),a0={class:"sidebar-thread-controls"},l0=["aria-label","title"],c0=["aria-pressed","aria-label","title"],u0=xt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(w(),S("div",a0,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),ft(n0,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ft(Xb,{key:1,class:"sidebar-thread-controls-icon"}))],8,l0),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"))},[Ce(i0,{class:"sidebar-thread-controls-icon"})],8,c0),mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ce(Us,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),ol=Xe(u0,[["__scopeId","data-v-57866500"]]),d0={},f0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function h0(e,t){return w(),S("svg",f0,[...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 p0=Xe(d0,[["render",h0]]);function zn(e){return e.flatMap(t=>t.threads)}const Yc="codex-web-local.thread-read-state.v1",Jc="codex-web-local.thread-scroll-state.v1",si="codex-web-local.selected-thread-id.v1",Qc="codex-web-local.project-order.v1",Xc="codex-web-local.project-display-name.v1",Zc="codex-web-local.auto-refresh-enabled.v1",$o=220,Qr=4e3,il=["none","minimal","low","medium","high","xhigh"],Xr="__global__",Xt="gpt-5.2-codex";function m0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Yc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function al(e){typeof window>"u"||window.localStorage.setItem(Yc,JSON.stringify(e))}function g0(){return typeof window>"u"?!1:window.localStorage.getItem(Zc)==="1"}function ll(e){typeof window>"u"||window.localStorage.setItem(Zc,e?"1":"0")}function eu(e,t,n){return Math.min(Math.max(e,t),n)}function v0(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=eu(t.scrollRatio,0,1)),n}function y0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=v0(s);o&&(n[r]=o)}return n}catch{return{}}}function cl(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function w0(){return typeof window>"u"?"":window.localStorage.getItem(si)??""}function b0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(si);return}window.localStorage.setItem(si,e)}}function _0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Qc);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 Ar(e){typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(e))}function k0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Xc);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 Mo(e){typeof window>"u"||window.localStorage.setItem(Xc,JSON.stringify(e))}function xs(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 hr(e,n)?e:n}function Po(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 hr(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 T0(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 S0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Cs(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 oi(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&hr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&S0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Vs(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,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&&oi(f,u)?f:u});if(n.preserveMissing!==!0)return Vs(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||oi(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Vs(e,d)?e:d}function ii(e){return e.replace(/\s+/gu," ").trim()}function C0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>ii(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=ii(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function ul(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(oi(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const tu="worked";function qn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function E0(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 A0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function I0(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 R0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${E0(e.durationMs)}`,messageType:tu}}function $0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function M0(e,t){const n=R0(t),r=e.filter(i=>i.messageType!==tu),s=$0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function At(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function P0(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function O0(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 N0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Mt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Es(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&&P0(d,l)?d:l});return o&&o.projectName===s.projectName&&O0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return N0(e,r)?e:r}function j0(e,t,n){const r=new Set(zn(t).map(a=>a.id)),s=zn(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 D0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Oo(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function L0(e){const t=e.split(`
|
|
44
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function B0(){const e=P([]),t=P([]),n=P(w0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),g=P("medium"),_=P(m0()),N=P(y0()),I=P(_0()),F=P(k0()),z=P({}),j=P({}),U=P({}),D=P({}),ae=P({}),ue=P({}),de=P({}),Te=P({}),oe=P({}),X=P({}),me=P([]),ne=P(!1),Be=P(!1),He=P(!1),Ge=P(!1),Ae=P(!1),_e=P(""),Me=P(!1),vt=P(!1),Ze=P(g0()),ut=P(Math.floor(Qr/1e3));let tt=null,ze=null,he=null,Ee=null,Se=!1;const E=new Set;let Z=!1,Y=!1;const ve=new Map,De=new Set,p=ce(()=>zn(e.value)),y=ce(()=>p.value.find(c=>c.id===n.value)??null),x=ce(()=>N.value[n.value]??null),O=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(Te.value[h])&&c.push(...Te.value[h]),Array.isArray(Te.value[Xr])&&c.push(...Te.value[Xr]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),B=ce(()=>{var G;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),T=(((G=ue.value[c])==null?void 0:G.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),L=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=D.value[c];return K?M0(G,K):G});function ee(c){n.value!==c&&(n.value=c,b0(c),Y=!1)}function se(c){f.value=c.trim()}async function Q(){f.value=Xt,u.value.includes(Xt)||(u.value=[...u.value,Xt]);try{await ry(Xt)}catch{}}function V(c,h){oe.value={...oe.value,[c]:h}}function ye(c){oe.value[c]&&(oe.value=At(oe.value,c))}async function ie(c){if(De.has(c))return;const h=oe.value[c];if(!(!h||h.fallbackRetried)){De.add(c),V(c,{...h,fallbackRetried:!0});try{await Q();try{const v=await el(c,1);we(c,v),xe(c,[]),it(c),i.value[c]&&(i.value=At(i.value,c))}catch{}A(c,null),_e.value="",W(c,null),b(c,{label:"Thinking",details:ke(Xt,h.effort)}),J(c,!0),U.value[c]!==!0&&await Ao(c),await Io(c,h.text,h.imageUrls,Xt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},E.add(c),Se=!0,await sr()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";A(c,T),_e.value=T,J(c,!1),b(c,null)}finally{De.delete(c)}}}function ge(c){c&&!il.includes(c)||(g.value=c)}function ke(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Pe(){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&&il.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function We(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 Ie(){const h=We(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,be=_.value[T.id],Re=d.value[T.id]===!0,pe=!K&&!G&&(Re||be!==T.updatedAtIso);return{...T,inProgress:G,unread:pe}})}));e.value=Es(e.value,h)}function pt(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=D0(G),be={id:c,title:L0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Re=t.value.findIndex(et=>et.projectName===K);if(Re>=0){const yt=t.value[Re].threads.filter(Un=>Un.id!==c),Cr={projectName:K,threads:[be,...yt]},wn=[...t.value];wn.splice(Re,1,Cr),t.value=wn}else t.value=[{projectName:K,threads:[be]},...t.value];const pe=xs(I.value,t.value);hr(I.value,pe)||(I.value=pe,Ar(I.value)),Ie()}function Ke(c){const h=new Set(c.map(K=>K.id)),v=Mt(_.value,h);v!==_.value&&(_.value=v,al(v));const T=Mt(N.value,h);T!==N.value&&(N.value=T,cl(T)),j.value=Mt(j.value,h),z.value=Mt(z.value,h),U.value=Mt(U.value,h),r.value=Mt(r.value,h),s.value=Mt(s.value,h),o.value=Mt(o.value,h),i.value=Mt(i.value,h),D.value=Mt(D.value,h),ae.value=Mt(ae.value,h),ue.value=Mt(ue.value,h),de.value=Mt(de.value,h),d.value=Mt(d.value,h),a.value=Mt(a.value,h);const G={};for(const[K,be]of Object.entries(Te.value))(K===Xr||h.has(K))&&(G[K]=be);Te.value=G}function H(c){const h=zn(t.value).find(v=>v.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},al(_.value),d.value[c]&&(d.value=At(d.value,c)),Ie())}function W(c,h){if(!c)return;const v=D.value[c];if(h){if(A0(v,h))return;D.value={...D.value,[c]:h}}else v&&(D.value=At(D.value,c))}function J(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=At(a.value,c),Ie())}function Ye(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Ie())}function b(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=At(ae.value,c));return}const T=Zn(h.label)||"Thinking",G=h.details.map(Re=>Zn(Re)).filter(Re=>Re.length>0&&Re!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),be={label:T,details:K};I0(v,be)||(ae.value={...ae.value,[c]:be})}function A(c,h){if(!c)return;const v=ue.value[c],T=h?ii(h):"";if(!T){v&&(ue.value=At(ue.value,c));return}(v==null?void 0:v.message)!==T&&(ue.value={...ue.value,[c]:{message:T}})}function M(c){const h=zn(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function te(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=eu(h.scrollRatio,0,1));const T=N.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(N.value={...N.value,[c]:v},cl(N.value))}function we(c,h){const v=r.value[c]??[];Vs(v,h)||(r.value={...r.value,[c]:h})}function xe(c,h){const v=s.value[c]??[];Vs(v,h)||(s.value={...s.value,[c]:h})}function dt(c,h){const v=s.value[c]??[],T=ul(v,h);xe(c,T)}function Qe(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=At(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function mt(c,h){if(!c)return;const v=o.value[c]??"";Qe(c,`${v}${h}`)}function it(c){c&&c in o.value&&(o.value=At(o.value,c))}function Oe(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function $e(c){return typeof c=="string"?c:""}function vn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Lt(c){const h=Oe(c.params);if(!h)return"";const v=$e(h.threadId);if(v)return v;const T=$e(h.thread_id);if(T)return T;const G=$e(h.conversationId);if(G)return G;const K=$e(h.conversation_id);if(K)return K;const be=Oe(h.thread),Re=$e(be==null?void 0:be.id);if(Re)return Re;const pe=Oe(h.turn),et=$e(pe==null?void 0:pe.threadId);if(et)return et;const yt=$e(pe==null?void 0:pe.thread_id);return yt||""}function yr(c){if(c.method!=="turn/completed")return"";const h=Oe(c.params),v=Oe(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Oe(v.error);return $e(T==null?void 0:T.message)}function Hr(c){var v;if(c.method!=="error")return"";const h=Oe(c.params);return $e(h==null?void 0:h.message)||$e((v=Oe(h==null?void 0:h.error))==null?void 0:v.message)}function Qn(c){const h=Oe(c);if(!h)return null;const v=h.id,T=$e(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Oe(G),be=$e(K==null?void 0:K.threadId)||Xr,Re=$e(K==null?void 0:K.turnId),pe=$e(K==null?void 0:K.itemId),et=$e(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:be,turnId:Re,itemId:pe,receivedAtIso:et,params:G??null}}function Xn(c){const h=c.threadId||Xr,v=Te.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),Te.value={...Te.value,[h]:G.sort((K,be)=>K.receivedAtIso.localeCompare(be.receivedAtIso))}}function wr(c){const h={};for(const[v,T]of Object.entries(Te.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}Te.value=h}function Ur(c){if(c.method==="server/request"){const h=Qn(c.params);return h&&Xn(h),!0}if(c.method==="server/request/resolved"){const h=Oe(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&wr(v),!0}return!1}function Zn(c){return c.replace(/\s+/gu," ").trim()}function Kt(c){const h=Lt(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Oe(c.params),T=Oe(v==null?void 0:v.item),G=$e(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=$e(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function er(c){if(c.method!=="turn/started")return null;const h=Oe(c.params);if(!h)return null;const v=Lt(c);if(!v)return null;const T=Oe(h.turn),G=$e(T==null?void 0:T.id)||$e(h.turnId)||`${v}:unknown`;if(!G)return null;const K=qn($e(T==null?void 0:T.startedAt))??qn($e(h.startedAt))??qn(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function tr(c){if(c.method!=="turn/completed")return null;const h=Oe(c.params);if(!h)return null;const v=Lt(c);if(!v)return null;const T=Oe(h.turn),G=$e(T==null?void 0:T.id)||$e(h.turnId)||`${v}:unknown`;if(!G)return null;const K=qn($e(T==null?void 0:T.completedAt))??qn($e(h.completedAt))??qn(c.atIso)??Date.now(),be=qn($e(T==null?void 0:T.startedAt))??qn($e(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:be}}function jn(c){return`${c}:live-reasoning`}function Dn(c){const h=Oe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Oe(h.item);return!v||v.type!=="reasoning"?"":$e(v.id)}return""}function Vr(c){const h=Oe(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{messageId:jn(v),delta:T}}return null}function br(c){const h=Oe(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=$e(h.itemId);return v?jn(v):""}return""}function Ln(c){const h=Oe(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Oe(h.item);return!v||v.type!=="reasoning"?"":jn($e(v.id))}return""}function _r(c){const h=Oe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Oe(h.item);return!v||v.type!=="agentMessage"?"":$e(v.id)}return""}function kr(c){const h=Oe(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function Tr(c){const h=Oe(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Oe(h.item);if(!v||v.type!=="agentMessage")return null;const T=$e(v.id),G=$e(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function yn(c){if(c.method!=="item/started")return null;const h=Oe(c.params),v=Oe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=$e(v.id),G=$e(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function nr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Oe(c.params);if(!h)return null;const v=$e(h.itemId),T=$e(h.delta);return!v||!T?null:{itemId:v,delta:T}}function Wr(c){if(c.method!=="item/completed")return null;const h=Oe(c.params),v=Oe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=$e(v.id),G=$e(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,be=$e(v.status),Re=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",pe=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",et=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Re,aggregatedOutput:pe,exitCode:et}}}function Bn(c,h){const v=i.value[c]??[],T=ul(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Fn(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=At(i.value,c):i.value={...i.value,[c]:G})}function qr(c){if(c.method==="item/agentMessage/delta")return!0;const h=Oe(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Oe(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function k(c){var ji,Di,Li,Bi;if(Ur(c))return;if(c.method==="thread/name/updated"){const qe=Oe(c.params),ln=$e(qe==null?void 0:qe.threadId),or=$e(qe==null?void 0:qe.threadName);ln&&or&&(X.value={...X.value,[ln]:or},Ie(),Ro(ln,or))}const h=Kt(c);h&&b(h.threadId,h.activity);const v=er(c);v&&(ve.set(v.turnId,v),de.value={...de.value,[v.threadId]:v.turnId},W(v.threadId,null),A(v.threadId,null),J(v.threadId,!0),d.value[v.threadId]&&(d.value=At(d.value,v.threadId)));const T=tr(c),G=yr(c),be=!!((T==null?void 0:T.threadId)??Lt(c))&&!!G&&f.value!==Xt&&Cs(new Error(G));if(T){const qe=ve.get(T.turnId);qe&&ve.delete(T.turnId);const ln=vn((ji=Oe(c.params))==null?void 0:ji.durationMs)??vn((Li=Oe((Di=Oe(c.params))==null?void 0:Di.turn))==null?void 0:Li.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(qe?T.completedAtMs-qe.startedAtMs:null),or=typeof ln=="number"?Math.max(0,ln):0;W(T.threadId,{turnId:T.turnId,durationMs:or}),de.value[T.threadId]&&(de.value=At(de.value,T.threadId)),J(T.threadId,!1),b(T.threadId,null),Ye(T.threadId),be||(ye(T.threadId),re(T.threadId))}if(G){const qe=(T==null?void 0:T.threadId)||Lt(c);qe&&A(qe,G),_e.value=G,qe&&be&&ie(qe)}else T&&A(T.threadId,null);const Re=Hr(c);if(Re){const qe=Lt(c);qe&&A(qe,Re),_e.value=Re,f.value!==Xt&&Cs(new Error(Re))&&(qe?ie(qe):Q())}const pe=Lt(c);if(!pe||pe!==n.value)return;_r(c);const et=kr(c);if(et){const qe=(s.value[pe]??[]).find(or=>or.id===et.messageId),ln=`${(qe==null?void 0:qe.text)??""}${et.delta}`;dt(pe,{id:et.messageId,role:"assistant",text:ln,messageType:"agentMessage.live"})}const yt=Tr(c);yt&&dt(pe,yt),Dn(c);const Cr=Vr(c);if(Cr&&mt(pe,Cr.delta),br(c)){const qe=o.value[pe]??"";qe.trim().length>0&&!qe.endsWith(`
|
|
45
|
-
|
|
46
|
-
`)&&Qe(pe,`${qe}
|
|
47
|
-
|
|
48
|
-
`)}Ln(c);const Un=yn(c);Un&&(Bn(pe,Un),b(pe,{label:"Running command",details:[((Bi=Un.commandExecution)==null?void 0:Bi.command)??""]}));const lo=nr(c);if(lo){const qe=(i.value[pe]??[]).find(ln=>ln.id===lo.itemId);qe!=null&&qe.commandExecution&&Bn(pe,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${lo.delta}`}})}const Ni=Wr(c);if(Ni&&Bn(pe,Ni),qr(c)&&(Y&&n.value&&te(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),it(pe)),c.method==="turn/completed"){Y=!1,it(pe),i.value[pe]&&(i.value=At(i.value,pe));const qe=Lt(c);qe&&(J(qe,!1),b(qe,null),Ye(qe),be||(ye(qe),re(qe)))}}function C(c){const h=Lt(c);h&&E.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Se=!0),!(ze!==null||typeof window>"u")&&(ze=window.setTimeout(()=>{ze=null,sr()},$o))}async function R(c){if(!Z){Z=!0;try{const h=await ti(),v=[];for(const T of h.order){const G=Oo(T);v.includes(G)||v.push(G)}if(v.length>0){const T=xs(v,c);hr(I.value,T)||(I.value=T,Ar(I.value))}if(Object.keys(h.labels).length>0){const T={...F.value};let G=!1;for(const[K,be]of Object.entries(h.labels)){const Re=Oo(K);T[Re]!==be&&(T[Re]=be,G=!0)}G&&(F.value=T,Mo(T))}}catch{}}}async function q(){if(!(Object.keys(X.value).length>0))try{const c=await hy();Object.keys(c.titles).length>0&&(X.value=c.titles)}catch{}}async function Fe(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 py(G,v);if(!K||X.value[c])return;X.value={...X.value,[c]:K},Ie(),Ro(c,K)}catch{}}async function _t(){var c;vt.value||(ne.value=!0);try{const[h]=await Promise.all([Gv(),q()]);await R(h);const v=xs(I.value,h);hr(I.value,v)||(I.value=v,Ar(I.value));const T=Po(h,I.value),G=j0(t.value,T,a.value);t.value=Es(t.value,G),a.value=Mt(a.value,new Set(zn(t.value).map(Re=>Re.id))),Ie(),vt.value=!0;const K=zn(e.value);Ke(K),K.some(Re=>Re.id===n.value)||ee(((c=K[0])==null?void 0:c.id)??"")}finally{ne.value=!1}}async function Ct(c,h={}){if(!c)return;const v=j.value[c]===!0,T=h.silent!==!0&&!v;T&&(Be.value=!0);try{U.value[c]!==!0&&(await Ao(c),U.value={...U.value,[c]:!0});const{messages:G,inProgress:K}=await zv(c),be=r.value[c]??[],Re=x0(be,G,{preserveMissing:h.silent===!0});we(c,Re);const pe=s.value[c]??[],et=C0(pe,G);xe(c,et),Fn(c,G),j.value={...j.value,[c]:!0};const yt=M(c);yt&&(z.value={...z.value,[c]:yt}),J(c,K),H(c)}finally{T&&(Be.value=!1)}}async function an(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);me.value=await my(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Sr(){_e.value="";try{await _t(),await Promise.all([Pe(),an()]),await Ct(n.value)}catch(c){_e.value=c instanceof Error?c.message:"Unknown application error"}}async function Jt(c){ee(c);try{await Ct(c)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function Hn(c){try{await Xv(c),await _t(),n.value===c&&await Ct(n.value)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function xr(c,h){const v=h.trim();if(!(!c||!v))try{await Zv(c,v),X.value={...X.value,[c]:v},Ie(),Ro(c,v)}catch(T){_e.value=T instanceof Error?T.message:"Unknown application error"}}async function rr(c,h=[],v=[],T="steer",G=[]){const K=n.value,be=c.trim();if(!K||!be&&h.length===0&&G.length===0)return;const Re=a.value[K]===!0;if(Re&&T==="queue"){const pe=l.value[K]??[],et=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...pe,{id:et,text:be,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Re){Y=!0,$(K,be,h,v,G).catch(pe=>{const et=pe instanceof Error?pe.message:"Unknown application error";A(K,et),_e.value=et});return}_e.value="",Y=!0,W(K,null),b(K,{label:"Thinking",details:ke(f.value,g.value)}),A(K,null),J(K,!0);try{await $(K,be,h,v,G)}catch(pe){Y=!1,J(K,!1),b(K,null);const et=pe instanceof Error?pe.message:"Unknown application error";throw A(K,et),_e.value=et,pe}}async function io(c,h,v=[],T=[],G=[]){const K=c.trim(),be=h.trim(),Re=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";He.value=!0,_e.value="";let pe="";try{try{pe=await tl(be||void 0,Re||void 0)}catch(wn){if(Re&&Re!==Xt&&Cs(wn))await Q(),pe=await tl(be||void 0,Xt);else throw wn}if(!pe)return"";pt(pe,be,K||"[Image]"),U.value={...U.value,[pe]:!0},ee(pe),Y=!0,W(pe,null),b(pe,{label:"Thinking",details:ke(f.value,g.value)}),A(pe,null),J(pe,!0);const et=pe,yt=be||null,Cr=K;return $(pe,K,v,T,G).catch(wn=>{Y=!1,J(pe,!1),b(pe,null);const Un=wn instanceof Error?wn.message:"Unknown application error";A(pe,Un),_e.value=Un}).finally(()=>{He.value=!1}),Fe(et,Cr,yt),pe}catch(et){Y=!1,pe&&(J(pe,!1),b(pe,null));const yt=et instanceof Error?et.message:"Unknown application error";throw pe&&A(pe,yt),_e.value=yt,He.value=!1,et}}async function $(c,h,v=[],T=[],G=[]){const K=f.value.trim(),be=g.value,Re=h.trim(),pe=T.map(yt=>({name:yt.name,path:yt.path})),et=G.map(yt=>({...yt}));V(c,{text:Re,imageUrls:[...v],skills:pe,fileAttachments:et,effort:be,fallbackRetried:!1});try{U.value[c]!==!0&&await Ao(c);try{await Io(c,h,v,K||void 0,be||void 0,T.length>0?T:void 0,G)}catch(yt){if(K&&K!==Xt&&Cs(yt))await Q(),V(c,{text:Re,imageUrls:[...v],skills:pe,fileAttachments:et,effort:be,fallbackRetried:!0}),await Io(c,h,v,Xt,be||void 0,T.length>0?T:void 0,G);else throw yt}U.value={...U.value,[c]:!0},E.add(c),Se=!0,await sr()}catch(yt){throw yt}}async function re(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:At(l.value,c),He.value=!0,_e.value="",Y=!0,W(c,null),b(c,{label:"Thinking",details:ke(f.value,g.value)}),A(c,null),J(c,!0);try{await $(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{J(c,!1),b(c,null)}finally{He.value=!1}}async function Ne(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=de.value[c];Ge.value=!0,_e.value="";try{await ny(c,h),J(c,!1),b(c,null),A(c,null),de.value[c]&&(de.value=At(de.value,c)),E.add(c),Se=!0,await sr()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";A(c,T),_e.value=T}finally{Ge.value=!1}}async function Et(c){const h=n.value;if(!h||Ae.value)return;const T=(r.value[h]??[]).reduce((K,be)=>typeof be.turnIndex=="number"&&be.turnIndex>K?be.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ae.value=!0,_e.value="";try{const K=await el(h,G);we(h,K),xe(h,[]),it(h),i.value[h]&&(i.value=At(i.value,h)),W(h,null),b(h,null),A(h,null),Se=!0,await sr()}catch(K){_e.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ae.value=!1}}}function Gt(c,h){c.length===0||(F.value[c]??"")===h||(F.value={...F.value,[c]:h},Mo(F.value))}function Rt(c){var G;if(c.length===0)return;const h=I.value.filter(K=>K!==c);if(hr(I.value,h)||(I.value=h,Ar(I.value)),t.value=t.value.filter(K=>K.projectName!==c),F.value[c]!==void 0){const K={...F.value};delete K[c],F.value=K,Mo(K)}Ie();const v=zn(e.value);Ke(v),v.some(K=>K.id===n.value)||ee(((G=v[0])==null?void 0:G.id)??""),ao()}function $t(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=T0(v,T,G);if(K===v)return;const be=xs(K,t.value);I.value=be,Ar(I.value);const Re=Po(t.value,I.value);t.value=Es(t.value,Re),Ie(),ao()}function nu(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(G=>G!==h)];if(hr(I.value,v))return;I.value=v,Ar(I.value);const T=Po(t.value,I.value);t.value=Es(t.value,T),Ie(),ao()}async function ao(){var c,h;try{const v=await ti(),T=new Map;for(const be of v.order){const Re=Oo(be);T.has(Re)||T.set(Re,be)}for(const be of t.value){const Re=((h=(c=be.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Re&&T.set(be.projectName,Re)}const G=[];for(const be of I.value){const Re=T.get(be);Re&&!G.includes(Re)&&G.push(Re)}for(const be of v.order)G.includes(be)||G.push(be);const K=v.active.filter(be=>G.includes(be));K.length===0&&G.length>0&&K.push(G[0]),await ly({order:G,labels:v.labels,active:K})}catch{}}async function ru(){if(!Me.value){Me.value=!0;try{if(await _t(),!n.value)return;const c=n.value,h=M(c),v=z.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await Ct(c,{silent:!0})}catch{}finally{Me.value=!1}}}async function sr(){if(Me.value){typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,sr()},$o));return}Me.value=!0;const c=Se,h=new Set(E);Se=!1,E.clear();try{c&&await _t();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=M(v),be=z.value[v]??"",Re=K.length>0&&K!==be;(T||G||Re||c)&&await Ct(v,{silent:!0})}catch{}finally{Me.value=!1,(Se||E.size>0)&&typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,sr()},$o))}}function su(){typeof window>"u"||tt||(Ze.value&&Pi(),ou(),tt=Yv(c=>{k(c),C(c)}))}async function ou(){try{const c=await Qv();for(const h of c){const v=Qn(h);v&&Xn(v)}}catch{}}async function iu(c){try{await Jv(c.id,{result:c.result,error:c.error}),wr(c.id)}catch(h){_e.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Mi(c={}){const h=c.updatePreference??!0;he!==null&&typeof window<"u"&&(window.clearInterval(he),he=null),Ee!==null&&typeof window<"u"&&(window.clearInterval(Ee),Ee=null),h&&(Ze.value=!1,ll(!1)),ut.value=Math.floor(Qr/1e3)}function Pi(){typeof window>"u"||he!==null||Ee!==null||(Ze.value=!0,ll(!0),ut.value=Math.floor(Qr/1e3),he=window.setInterval(()=>{ut.value=Math.floor(Qr/1e3),ru()},Qr),Ee=window.setInterval(()=>{ut.value=Math.max(0,ut.value-1)},1e3))}function au(){if(Ze.value){Mi();return}Pi()}function lu(){Mi({updatePreference:!1}),tt&&(tt(),tt=null),Se=!1,E.clear(),ve.clear(),ze!==null&&typeof window<"u"&&(window.clearTimeout(ze),ze=null),Y=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},D.value={},ue.value={},de.value={},l.value={}}const cu=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Oi(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:At(l.value,h)}function uu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Oi(c),rr(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:F,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:O,selectedLiveOverlay:B,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:me,messages:L,isLoadingThreads:ne,isLoadingMessages:Be,isSendingMessage:He,isInterruptingTurn:Ge,isAutoRefreshEnabled:Ze,autoRefreshSecondsLeft:ut,error:_e,refreshAll:Sr,refreshSkills:an,selectThread:Jt,setThreadScrollState:te,archiveThreadById:Hn,renameThreadById:xr,sendMessageToSelectedThread:rr,sendMessageToNewThread:io,interruptSelectedThreadTurn:Ne,rollbackSelectedThread:Et,isRollingBack:Ae,selectedThreadQueuedMessages:cu,removeQueuedMessage:Oi,steerQueuedMessage:uu,setSelectedModelId:se,setSelectedReasoningEffort:ge,respondToPendingServerRequest:iu,renameProject:Gt,removeProject:Rt,reorderProject:$t,pinProjectToTop:nu,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const F0={class:"sidebar-root"},H0={class:"sidebar-scrollable"},U0=["aria-pressed"],V0={key:1,class:"sidebar-search-bar"},W0={key:0,class:"sidebar-settings-area"},q0={key:0,class:"sidebar-settings-panel"},K0={class:"sidebar-settings-value"},G0={class:"sidebar-settings-value"},z0={class:"content-root"},Y0={class:"content-body"},J0={key:1,class:"content-grid"},Q0={class:"new-thread-empty"},X0={class:"worktree-init-status-title"},Z0={class:"worktree-init-status-message"},e_={key:2,class:"content-grid"},t_={class:"content-thread"},n_={class:"composer-with-queue"},r_={class:"build-badge","aria-label":"Worktree name"},dl="codex-web-local.sidebar-collapsed.v1",fl="codex-web-local.send-with-enter.v1",hl="codex-web-local.in-progress-send-mode.v1",pl="codex-web-local.dark-mode.v1",s_=xt({__name:"App",setup(e){const t="2107",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:_,isLoadingThreads:N,isLoadingMessages:I,isInterruptingTurn:F,isAutoRefreshEnabled:z,autoRefreshSecondsLeft:j,refreshAll:U,refreshSkills:D,selectThread:ae,setThreadScrollState:ue,archiveThreadById:de,renameThreadById:Te,sendMessageToSelectedThread:oe,sendMessageToNewThread:X,interruptSelectedThreadTurn:me,rollbackSelectedThread:ne,isRollingBack:Be,selectedThreadQueuedMessages:He,removeQueuedMessage:Ge,steerQueuedMessage:Ae,setSelectedModelId:_e,setSelectedReasoningEffort:Me,respondToPendingServerRequest:vt,renameProject:Ze,removeProject:ut,reorderProject:tt,pinProjectToTop:ze,toggleAutoRefreshTimer:he,startPolling:Ee,stopPolling:Se}=B0(),E=Yh(),Z=zh(),{isMobile:Y}=Vc(),ve=P(!1),De=P(!1),p=P(""),y=P("local"),x=P({order:[],labels:{}}),O=P({phase:"idle",title:"",message:""}),B=P(Sr()),L=P(""),ee=P(!1),se=P(null),Q=P(null);let V=null;const ye=P("New Project (1)"),ie=P(""),ge=P(!1),ke=P(C(fl,!0)),Pe=P(q()),We=P(R()),Ie=ce(()=>{const $=E.params.threadId;return typeof $=="string"?$:""}),pt=ce(()=>{const $=new Set;for(const re of n.value)for(const Ne of re.threads)$.add(Ne.id);return $}),Ke=ce(()=>E.name==="home"),H=ce(()=>E.name==="skills"),W=ce(()=>{var $;return H.value?"Skills":Ke.value?"New thread":(($=s.value)==null?void 0:$.title)??"Choose a thread"}),J=ce(()=>z.value?`Auto refresh in ${String(j.value)}s`:"Enable 4s refresh"),Ye=ce(()=>_.value.filter($=>{const re=Hn($.messageType,$.role);return re==="worked"?!0:!(re==="turnActivity.live"||re==="turnError.live"||re==="agentReasoning.live")})),b=ce(()=>a.value),A=ce(()=>Ke.value?"__new-thread__":l.value),M=ce(()=>{var $,re;return Ke.value?p.value.trim():((re=($=s.value)==null?void 0:$.cwd)==null?void 0:re.trim())??""}),te=ce(()=>{var $;return!Ke.value&&(($=s.value)==null?void 0:$.inProgress)===!0}),we=ce(()=>{var Et,Gt;const $=[],re=new Set;for(const Rt of x.value.order){const $t=Rt.trim();!$t||re.has($t)||(re.add($t),$.push({value:$t,label:x.value.labels[$t]||nr($t)}))}for(const Rt of n.value){const $t=((Gt=(Et=Rt.threads[0])==null?void 0:Et.cwd)==null?void 0:Gt.trim())??"";!$t||re.has($t)||(re.add($t),$.push({value:$t,label:r.value[Rt.projectName]??Rt.projectName}))}const Ne=p.value.trim();return Ne&&!re.has(Ne)&&$.unshift({value:Ne,label:nr(Ne)}),$}),xe=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;On(()=>{window.addEventListener("keydown",er),an(),xe==null||xe.addEventListener("change",an),xr(),kr(),Tr(),Ln()}),Zs(()=>{window.removeEventListener("keydown",er),xe==null||xe.removeEventListener("change",an),V&&(clearTimeout(V),V=null),Se()}),lt(L,$=>{const re=$.trim();if(V&&(clearTimeout(V),V=null),!re){Q.value=null;return}V=setTimeout(()=>{fy(re,1e3).then(Ne=>{L.value.trim()===re&&(Q.value=Ne.threadIds)}).catch(()=>{L.value.trim()===re&&(Q.value=null)})},220)});function dt(){D()}function Qe(){ee.value=!ee.value,ee.value?Yt(()=>{var $;return($=se.value)==null?void 0:$.focus()}):L.value=""}function mt(){var $;L.value="",($=se.value)==null||$.focus()}function it($){$.key==="Escape"&&(ee.value=!1,L.value="")}function Oe($){$&&(E.name==="thread"&&Ie.value===$||(Z.push({name:"thread",params:{threadId:$}}),Y.value&&Kt(!0)))}function $e($){de($)}function vn($){var Et,Gt;const re=n.value.find(Rt=>Rt.projectName===$),Ne=((Gt=(Et=re==null?void 0:re.threads[0])==null?void 0:Et.cwd)==null?void 0:Gt.trim())??"";Ne&&(p.value=Ne),Y.value&&Kt(!0),!Ke.value&&Z.push({name:"home"})}function Lt(){var re,Ne;const $=((Ne=(re=s.value)==null?void 0:re.cwd)==null?void 0:Ne.trim())??"";$&&(p.value=$),Y.value&&Kt(!0),!Ke.value&&Z.push({name:"home"})}function yr($){Ze($.projectName,$.displayName)}function Hr($){Te($.threadId,$.title)}function Qn($){ut($)}function Xn($){tt($.projectName,$.toIndex)}function wr($){ue($.threadId,$.state)}function Ur($){vt($)}function Zn(){he()}function Kt($){B.value!==$&&(B.value=$,Jt($))}function er($){$.defaultPrevented||!$.ctrlKey&&!$.metaKey||$.shiftKey||$.altKey||$.key.toLowerCase()==="b"&&($.preventDefault(),Kt(!B.value))}function tr($){const re=$.text;if(Ke.value){io(re,$.imageUrls,$.skills,$.fileAttachments);return}oe(re,$.imageUrls,$.skills,$.mode,$.fileAttachments)}function jn($){p.value=$.trim()}async function Dn($){const re=$.trim();if(!re)return;const Ne=br(re),Et=await Vr(),Gt=Ne?re:Wr(Et,re);if(Gt)try{const Rt=await cy(Gt,{createIfMissing:!Ne,label:Ne?"":re});Rt&&(p.value=Rt,ze(nr(Rt)),Tr(),Ln())}catch{}}async function Vr(){const $=_r();if($)return $;try{const re=await nl();if(re)return ie.value=re,re}catch{}return""}function br($){return $?$.startsWith("~/")||$.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test($):!1}async function Ln(){const $=_r();if(!$){ye.value="New Project (1)";return}try{const re=await uy($);ye.value=re.name||"New Project (1)"}catch{ye.value="New Project (1)"}}function _r(){var Ne,Et;const $=p.value.trim();if($)return yn($);const re=((Et=(Ne=we.value[0])==null?void 0:Ne.value)==null?void 0:Et.trim())??"";return re?yn(re):ie.value.trim()}async function kr(){try{ie.value=await nl()}catch{ie.value=""}}async function Tr(){try{const $=await ti();x.value={order:[...$.order],labels:{...$.labels}}}catch{x.value={order:[],labels:{}}}}function yn($){const re=$.trim().replace(/\/+$/,"");if(!re)return"";const Ne=re.lastIndexOf("/");return Ne<=0?"":re.slice(0,Ne)}function nr($){const re=$.trim().replace(/\/+$/,"");if(!re)return"";const Ne=re.lastIndexOf("/");return Ne<0?re:re.slice(Ne+1)}function Wr($,re){const Ne=$.trim().replace(/\/+$/,""),Et=re.trim().replace(/^\/+/,"");return!Ne||!Et?"":`${Ne}/${Et}`}function Bn($){_e($)}function Fn($){Me($)}function qr(){me()}function k($){ne($.turnIndex)}function C($,re){if(typeof window>"u")return re;const Ne=window.localStorage.getItem($);return Ne===null?re:Ne==="1"}function R(){if(typeof window>"u")return"system";const $=window.localStorage.getItem(pl);return $==="light"||$==="dark"?$:"system"}function q(){return typeof window>"u"?"queue":window.localStorage.getItem(hl)==="steer"?"steer":"queue"}function Fe(){ke.value=!ke.value,window.localStorage.setItem(fl,ke.value?"1":"0")}function _t(){Pe.value=Pe.value==="steer"?"queue":"steer",window.localStorage.setItem(hl,Pe.value)}function Ct(){const $=["system","light","dark"],re=$.indexOf(We.value);We.value=$[(re+1)%$.length],window.localStorage.setItem(pl,We.value),an()}function an(){const $=document.documentElement;if(We.value==="dark")$.classList.add("dark");else if(We.value==="light")$.classList.remove("dark");else{const re=window.matchMedia("(prefers-color-scheme: dark)").matches;$.classList.toggle("dark",re)}}function Sr(){return typeof window>"u"?!1:window.localStorage.getItem(dl)==="1"}function Jt($){typeof window>"u"||window.localStorage.setItem(dl,$?"1":"0")}function Hn($,re){const Ne=($??"").trim();return Ne.length>0?Ne:re.trim()||"message"}async function xr(){await U(),De.value=!0,await rr(),Ee()}async function rr(){if(!ve.value){ve.value=!0;try{if(E.name==="home"||E.name==="skills"){l.value!==""&&await ae("");return}if(E.name==="thread"){const $=Ie.value;if(!$)return;if(!pt.value.has($)){await Z.replace({name:"home"});return}l.value!==$&&await ae($);return}}finally{ve.value=!1}}}lt(()=>[E.name,Ie.value,N.value,pt.value.has(Ie.value),l.value],async()=>{De.value&&await rr()}),lt(()=>l.value,async $=>{if(De.value&&!ve.value&&!(Ke.value||H.value)){if(!$){E.name!=="home"&&await Z.replace({name:"home"});return}E.name==="thread"&&Ie.value===$||await Z.replace({name:"thread",params:{threadId:$}})}}),lt(()=>we.value,$=>{if($.length===0){p.value="";return}$.some(Ne=>Ne.value===p.value)||(p.value=$[0].value),Ln()},{immediate:!0}),lt(()=>p.value,()=>{O.value={phase:"idle",title:"",message:""},Ln()}),lt(()=>y.value,$=>{$==="local"&&(O.value={phase:"idle",title:"",message:""})}),lt(()=>E.name,$=>{$!=="home"&&(O.value={phase:"idle",title:"",message:""})}),lt(()=>l.value,()=>{O.value={phase:"idle",title:"",message:""}}),lt(Y,$=>{$&&!B.value&&Kt(!0)});async function io($,re=[],Ne=[],Et=[]){try{O.value={phase:"idle",title:"",message:""};let Gt=p.value;if(y.value==="worktree"){O.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const $t=await ay(p.value);Gt=$t.cwd,p.value=$t.cwd,O.value={phase:"idle",title:"",message:""}}catch{O.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Rt=await X($,Gt,re,Ne,Et);if(!Rt)return;await Z.replace({name:"thread",params:{threadId:Rt}})}catch{}}return($,re)=>(w(),S(Ue,null,[Ce(tp,{"is-sidebar-collapsed":B.value,onCloseSidebar:re[6]||(re[6]=Ne=>Kt(!0))},{sidebar:at(()=>[m("section",F0,[m("div",H0,[B.value?le("",!0):(w(),ft(ol,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":J.value,"show-new-thread-button":!0,onToggleSidebar:re[0]||(re[0]=Ne=>Kt(!B.value)),onToggleAutoRefresh:Zn,onStartNewThread:Lt},{default:at(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":ee.value,"aria-label":"Search threads",title:"Search threads",onClick:Qe},[Ce(ri,{class:"sidebar-search-toggle-icon"})],8,U0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!B.value&&ee.value?(w(),S("div",V0,[Ce(ri,{class:"sidebar-search-bar-icon"}),$n(m("input",{ref_key:"sidebarSearchInputRef",ref:se,"onUpdate:modelValue":re[1]||(re[1]=Ne=>L.value=Ne),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:it},null,544),[[Mn,L.value]]),L.value.length>0?(w(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:mt},[Ce(Ii,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),B.value?le("",!0):(w(),S("button",{key:2,class:ct(["sidebar-skills-link",{"is-active":H.value}]),type:"button",onClick:re[2]||(re[2]=Ne=>{je(Z).push({name:"skills"}),je(Y)&&Kt(!0)})}," Skills Hub ",2)),B.value?le("",!0):(w(),ft(Fm,{key:3,groups:je(n),"project-display-name-by-id":je(r),"selected-thread-id":je(l),"is-loading":je(N),"search-query":L.value,"search-matched-thread-ids":Q.value,onSelect:Oe,onArchive:$e,onStartNewThread:vn,onRenameProject:yr,onRenameThread:Hr,onRemoveProject:Qn,onReorderProject:Xn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),B.value?le("",!0):(w(),S("div",W0,[Ce(Rc,{name:"settings-panel"},{default:at(()=>[ge.value?(w(),S("div",q0,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Fe},[re[7]||(re[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:ct(["sidebar-settings-toggle",{"is-on":!ke.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:_t},[re[8]||(re[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",K0,fe(Pe.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Ct},[re[9]||(re[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",G0,fe(We.value==="system"?"System":We.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:re[3]||(re[3]=Ne=>ge.value=!ge.value)},[Ce(p0,{class:"sidebar-settings-icon"}),re[10]||(re[10]=m("span",null,"Settings",-1))])]))])]),content:at(()=>[m("section",z0,[Ce(Km,{title:W.value},{leading:at(()=>[B.value||je(Y)?(w(),ft(ol,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":J.value,"show-new-thread-button":!0,onToggleSidebar:re[4]||(re[4]=Ne=>Kt(!B.value)),onToggleAutoRefresh:Zn,onStartNewThread:Lt},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):le("",!0)]),_:1},8,["title"]),m("section",Y0,[H.value?(w(),ft(zb,{key:0,onSkillsChanged:dt})):Ke.value?(w(),S("div",J0,[m("div",Q0,[re[11]||(re[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ni,{class:"new-thread-folder-dropdown","model-value":p.value,options:we.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":ye.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":jn,onAdd:Dn},null,8,["model-value","options","default-add-value"]),Ce(Xw,{class:"new-thread-runtime-dropdown",modelValue:y.value,"onUpdate:modelValue":re[5]||(re[5]=Ne=>y.value=Ne)},null,8,["modelValue"]),O.value.phase!=="idle"?(w(),S("div",{key:0,class:ct(["worktree-init-status",{"is-running":O.value.phase==="running","is-error":O.value.phase==="error"}])},[m("strong",X0,fe(O.value.title),1),m("span",Z0,fe(O.value.message),1)],2)):le("",!0)]),Ce(rl,{"active-thread-id":A.value,cwd:M.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":ke.value,"in-progress-submit-mode":Pe.value,onSubmit:tr,"onUpdate:selectedModel":Bn,"onUpdate:selectedReasoningEffort":Fn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),S("div",e_,[m("div",t_,[Ce(kv,{messages:Ye.value,"is-loading":je(I),"active-thread-id":A.value,"scroll-state":je(o),"live-overlay":b.value,"pending-requests":je(i),"is-turn-in-progress":te.value,"is-rolling-back":je(Be),onUpdateScrollState:wr,onRespondServerRequest:Ur,onRollback:k},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",n_,[Ce(Ww,{messages:je(He),onSteer:je(Ae),onDelete:je(Ge)},null,8,["messages","onSteer","onDelete"]),Ce(rl,{"active-thread-id":A.value,cwd:M.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":te.value,"is-interrupting-turn":je(F),"has-queue-above":je(He).length>0,"send-with-enter":ke.value,"in-progress-submit-mode":Pe.value,onSubmit:tr,"onUpdate:selectedModel":Bn,"onUpdate:selectedReasoningEffort":Fn,onInterrupt:qr},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",r_," WT "+fe(je(t)),1)],64))}}),o_=Xe(s_,[["__scopeId","data-v-6121acf2"]]),No={render:()=>null},i_=Gh({history:xh(),routes:[{path:"/",name:"home",component:No},{path:"/thread/:threadId",name:"thread",component:No},{path:"/skills",name:"skills",component:No},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Lf(o_).use(i_).mount("#app");
|