codexapp 0.1.35 → 0.1.37

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.
@@ -2,45 +2,45 @@
2
2
  * @vue/shared v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function xa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},ss=[],On=()=>{},_u=()=>!1,Jo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pa=e=>e.startsWith("onUpdate:"),$t=Object.assign,Ma=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Zf=Object.prototype.hasOwnProperty,dt=(e,t)=>Zf.call(e,t),Le=Array.isArray,os=e=>ro(e)==="[object Map]",ku=e=>ro(e)==="[object Set]",wl=e=>ro(e)==="[object Date]",ze=e=>typeof e=="function",Ct=e=>typeof e=="string",vn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",Tu=e=>(ft(e)||ze(e))&&ze(e.then)&&ze(e.catch),Iu=Object.prototype.toString,ro=e=>Iu.call(e),eh=e=>ro(e).slice(8,-1),Su=e=>ro(e)==="[object Object]",Oa=e=>Ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=xa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},th=/-\w/g,Qt=Yo(e=>e.replace(th,t=>t.slice(1).toUpperCase())),nh=/\B([A-Z])/g,Tr=Yo(e=>e.replace(nh,"-$1").toLowerCase()),Qo=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1)),vi=Yo(e=>e?`on${Qo(e)}`:""),Rn=(e,t)=>!Object.is(e,t),To=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Eu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Na=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rh=e=>{const t=Ct(e)?Number(e):NaN;return isNaN(t)?e:t};let bl;const Xo=()=>bl||(bl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Ct(r)?ah(r):zr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Ct(e)||ft(e))return e}const sh=/;(?![^(]*\))/g,oh=/:([^]+)/,ih=/\/\*[^]*?\*\//g;function ah(e){const t={};return e.replace(ih,"").split(sh).forEach(n=>{if(n){const r=n.split(oh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function gt(e){let t="";if(Ct(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=gt(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const lh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ch=xa(lh);function Cu(e){return!!e||e===""}function uh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=$a(e[r],t[r]);return n}function $a(e,t){if(e===t)return!0;let n=wl(e),r=wl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vn(e),r=vn(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?uh(e,t):!1;if(n=ft(e),r=ft(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||!$a(e[i],t[i]))return!1}}return String(e)===String(t)}const Au=e=>!!(e&&e.__v_isRef===!0),ce=e=>Ct(e)?e:e==null?"":Le(e)||ft(e)&&(e.toString===Iu||!ze(e.toString))?Au(e)?ce(e.value):JSON.stringify(e,Ru,2):String(e),Ru=(e,t)=>Au(t)?Ru(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[yi(r,o)+" =>"]=s,n),{})}:ku(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>yi(n))}:vn(t)?yi(t):ft(t)&&!Le(t)&&!Su(t)?String(t):t,yi=(e,t="")=>{var n;return vn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function Aa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},ss=[],Mn=()=>{},wu=()=>!1,Ko=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ra=e=>e.startsWith("onUpdate:"),$t=Object.assign,Pa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qf=Object.prototype.hasOwnProperty,dt=(e,t)=>Qf.call(e,t),Le=Array.isArray,os=e=>no(e)==="[object Map]",bu=e=>no(e)==="[object Set]",yl=e=>no(e)==="[object Date]",ze=e=>typeof e=="function",Ct=e=>typeof e=="string",vn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",_u=e=>(ft(e)||ze(e))&&ze(e.then)&&ze(e.catch),ku=Object.prototype.toString,no=e=>ku.call(e),Xf=e=>no(e).slice(8,-1),Tu=e=>no(e)==="[object Object]",xa=e=>Ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=Aa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Zf=/-\w/g,Qt=Jo(e=>e.replace(Zf,t=>t.slice(1).toUpperCase())),eh=/\B([A-Z])/g,Tr=Jo(e=>e.replace(eh,"-$1").toLowerCase()),Yo=Jo(e=>e.charAt(0).toUpperCase()+e.slice(1)),mi=Jo(e=>e?`on${Yo(e)}`:""),Rn=(e,t)=>!Object.is(e,t),ko=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Iu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Oa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},th=e=>{const t=Ct(e)?Number(e):NaN;return isNaN(t)?e:t};let wl;const Qo=()=>wl||(wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Ct(r)?oh(r):zr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Ct(e)||ft(e))return e}const nh=/;(?![^(]*\))/g,rh=/:([^]+)/,sh=/\/\*[^]*?\*\//g;function oh(e){const t={};return e.replace(sh,"").split(nh).forEach(n=>{if(n){const r=n.split(rh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function gt(e){let t="";if(Ct(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=gt(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ih="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ah=Aa(ih);function Su(e){return!!e||e===""}function lh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ma(e[r],t[r]);return n}function Ma(e,t){if(e===t)return!0;let n=yl(e),r=yl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vn(e),r=vn(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?lh(e,t):!1;if(n=ft(e),r=ft(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||!Ma(e[i],t[i]))return!1}}return String(e)===String(t)}const Eu=e=>!!(e&&e.__v_isRef===!0),ce=e=>Ct(e)?e:e==null?"":Le(e)||ft(e)&&(e.toString===ku||!ze(e.toString))?Eu(e)?ce(e.value):JSON.stringify(e,Cu,2):String(e),Cu=(e,t)=>Eu(t)?Cu(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[gi(r,o)+" =>"]=s,n),{})}:bu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>gi(n))}:vn(t)?gi(t):ft(t)&&!Le(t)&&!Tu(t)?String(t):t,gi=(e,t="")=>{var n;return vn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
6
  * @vue/reactivity v3.5.30
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/let en;class dh{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=en,!t&&en&&(this.index=(en.scopes||(en.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=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=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 fh(){return en}let Tt;const wi=new WeakSet;class xu{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,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,wi.has(this)&&(wi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Mu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_l(this),Ou(this);const t=Tt,n=pn;Tt=this,pn=!0;try{return this.fn()}finally{Nu(this),Tt=t,pn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ja(t);this.deps=this.depsTail=void 0,_l(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Yi(this)&&this.run()}get dirty(){return Yi(this)}}let Pu=0,$s,Ds;function Mu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Da(){Pu++}function La(){if(--Pu>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=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 Ou(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Nu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),ja(r),hh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Yi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($u(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $u(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ws)||(e.globalVersion=Ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Yi(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=pn;Tt=e,pn=!0;try{Ou(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,pn=r,Nu(e),e.flags&=-3}}function ja(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)ja(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pn=!0;const Du=[];function Xn(){Du.push(pn),pn=!1}function Zn(){const e=Du.pop();pn=e===void 0?!0:e}function _l(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Ws=0;class ph{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 Ba{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(!Tt||!pn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new ph(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,Lu(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=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Ws++,this.notify(t)}notify(t){Da();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{La()}}}function Lu(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)Lu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Qi=new WeakMap,Hr=Symbol(""),Xi=Symbol(""),zs=Symbol("");function Vt(e,t,n){if(pn&&Tt){let r=Qi.get(e);r||Qi.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Ba),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=Qi.get(e);if(!i){Ws++;return}const a=l=>{l&&l.trigger()};if(Da(),t==="clear")i.forEach(a);else{const l=Le(e),u=l&&Oa(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,h)=>{(h==="length"||h===zs||!vn(h)&&h>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(zs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Hr)),os(e)&&a(i.get(Xi)));break;case"delete":l||(a(i.get(Hr)),os(e)&&a(i.get(Xi)));break;case"set":os(e)&&a(i.get(Hr));break}}La()}function Zr(e){const t=ct(e);return t===e?t:(Vt(t,"iterate",zs),dn(e)?t:t.map(yn))}function Zo(e){return Vt(e=ct(e),"iterate",zs),e}function Cn(e,t){return er(e)?hs(Vr(e)?yn(t):t):yn(t)}const mh={__proto__:null,[Symbol.iterator](){return bi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Zr(this).concat(...e.map(t=>Le(t)?Zr(t):t))},entries(){return bi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Hn(this,"every",e,t,void 0,arguments)},filter(e,t){return Hn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Hn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Hn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Hn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Hn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Hn(this,"forEach",e,t,void 0,arguments)},includes(...e){return _i(this,"includes",e)},indexOf(...e){return _i(this,"indexOf",e)},join(e){return Zr(this).join(e)},lastIndexOf(...e){return _i(this,"lastIndexOf",e)},map(e,t){return Hn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return kl(this,"reduce",e,t)},reduceRight(e,...t){return kl(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Hn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Zr(this).toReversed()},toSorted(e){return Zr(this).toSorted(e)},toSpliced(...e){return Zr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return bi(this,"values",e=>Cn(this,e))}};function bi(e,t,n){const r=Zo(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const gh=Array.prototype;function Hn(e,t,n,r,s,o){const i=Zo(e),a=i!==e&&!dn(e),l=i[t];if(l!==gh[t]){const f=l.apply(e,o);return a?yn(f):f}let u=n;i!==e&&(a?u=function(f,h){return n.call(this,Cn(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function kl(e,t,n,r){const s=Zo(e),o=s!==e&&!dn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Cn(e,u)),n.call(this,u,Cn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function _i(e,t,n){const r=ct(e);Vt(r,"iterate",zs);const s=r[t](...n);return(s===-1||s===!1)&&Ha(n[0])?(n[0]=ct(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Xn(),Da();const r=ct(e)[t].apply(e,n);return La(),Zn(),r}const vh=xa("__proto__,__v_isRef,__isVue"),ju=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(vn));function yh(e){vn(e)||(e=String(e));const t=ct(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Bu{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?Ah:Vu:o?Hu:Fu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=mh[n]))return l;if(n==="hasOwnProperty")return yh}const a=Reflect.get(t,n,qt(t)?t:r);if((vn(n)?ju.has(n):vh(n))||(s||Vt(t,"get",n),o))return a;if(qt(a)){const l=i&&Oa(n)?a:a.value;return s&&ft(l)?ea(l):l}return ft(a)?s?ea(a):ei(a):a}}class Uu extends Bu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&Oa(n);if(!this._isShallow){const u=er(o);if(!dn(r)&&!er(r)&&(o=ct(o),r=ct(r)),!i&&qt(o)&&!qt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,qt(t)?t:s);return t===ct(s)&&(a?Rn(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Gn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!vn(n)||!ju.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Le(t)?"length":Hr),Reflect.ownKeys(t)}}class wh extends Bu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bh=new Uu,_h=new wh,kh=new Uu(!0);const Zi=e=>e,po=e=>Reflect.getPrototypeOf(e);function Th(e,t,n){return function(...r){const s=this.__v_raw,o=ct(s),i=os(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Zi:t?hs:yn;return!t&&Vt(o,"iterate",l?Xi:Hr),$t(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:a?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function mo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ih(e,t){const n={get(s){const o=this.__v_raw,i=ct(o),a=ct(s);e||(Rn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=po(i),u=t?Zi:e?hs:yn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(ct(s),"iterate",Hr),s.size},has(s){const o=this.__v_raw,i=ct(o),a=ct(s);return e||(Rn(s,a)&&Vt(i,"has",s),Vt(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=ct(a),u=t?Zi:e?hs:yn;return!e&&Vt(l,"iterate",Hr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return $t(n,e?{add:mo("add"),set:mo("set"),delete:mo("delete"),clear:mo("clear")}:{add(s){const o=ct(this),i=po(o),a=ct(s),l=!t&&!dn(s)&&!er(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),Gn(o,"add",l,l)),this},set(s,o){!t&&!dn(o)&&!er(o)&&(o=ct(o));const i=ct(this),{has:a,get:l}=po(i);let u=a.call(i,s);u||(s=ct(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Rn(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=ct(this),{has:i,get:a}=po(o);let l=i.call(o,s);l||(s=ct(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Gn(o,"delete",s,void 0),u},clear(){const s=ct(this),o=s.size!==0,i=s.clear();return o&&Gn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Th(s,e,t)}),n}function Ua(e,t){const n=Ih(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const Sh={get:Ua(!1,!1)},Eh={get:Ua(!1,!0)},Ch={get:Ua(!0,!1)};const Fu=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,Ah=new WeakMap;function Rh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xh(e){return e.__v_skip||!Object.isExtensible(e)?0:Rh(eh(e))}function ei(e){return er(e)?e:Fa(e,!1,bh,Sh,Fu)}function Wu(e){return Fa(e,!1,kh,Eh,Hu)}function ea(e){return Fa(e,!0,_h,Ch,Vu)}function Fa(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=xh(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 Vr(e){return er(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function er(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Ha(e){return e?!!e.__v_raw:!1}function ct(e){const t=e&&e.__v_raw;return t?ct(t):e}function Ph(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Eu(e,"__v_skip",!0),e}const yn=e=>ft(e)?ei(e):e,hs=e=>ft(e)?ea(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function L(e){return zu(e,!1)}function Mh(e){return zu(e,!0)}function zu(e,t){return qt(e)?e:new Oh(e,t)}class Oh{constructor(t,n){this.dep=new Ba,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ct(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||er(t);t=r?t:ct(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),this.dep.trigger())}}function ue(e){return qt(e)?e.value:e}const Nh={get:(e,t,n)=>t==="__v_raw"?e:ue(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return qt(s)&&!qt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function qu(e){return Vr(e)?e:new Proxy(e,Nh)}class $h{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ba(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Mu(this,!0),!0}get value(){const t=this.dep.track();return $u(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dh(e,t,n=!1){let r,s;return ze(e)?r=e:(r=e.get,s=e.set),new $h(r,s,n)}const go={},Oo=new WeakMap;let Dr;function Lh(e,t=!1,n=Dr){if(n){let r=Oo.get(n);r||Oo.set(n,r=[]),r.push(e)}}function jh(e,t,n=bt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=j=>s?j:dn(j)||s===!1||s===0?Kn(j,1):Kn(j);let c,f,h,b,N=!1,I=!1;if(qt(e)?(f=()=>e.value,N=dn(e)):Vr(e)?(f=()=>u(e),N=!0):Le(e)?(I=!0,N=e.some(j=>Vr(j)||dn(j)),f=()=>e.map(j=>{if(qt(j))return j.value;if(Vr(j))return u(j);if(ze(j))return l?l(j,2):j()})):ze(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Xn();try{h()}finally{Zn()}}const j=Dr;Dr=c;try{return l?l(e,3,[b]):e(b)}finally{Dr=j}}:f=On,t&&s){const j=f,oe=s===!0?1/0:s;f=()=>Kn(j(),oe)}const O=fh(),Y=()=>{c.stop(),O&&O.active&&Ma(O.effects,c)};if(o&&t){const j=t;t=(...oe)=>{j(...oe),Y()}}let $=I?new Array(e.length).fill(go):go;const z=j=>{if(!(!(c.flags&1)||!c.dirty&&!j))if(t){const oe=c.run();if(s||N||(I?oe.some((de,ve)=>Rn(de,$[ve])):Rn(oe,$))){h&&h();const de=Dr;Dr=c;try{const ve=[oe,$===go?void 0:I&&$[0]===go?[]:$,b];$=oe,l?l(t,3,ve):t(...ve)}finally{Dr=de}}}else c.run()};return a&&a(z),c=new xu(f),c.scheduler=i?()=>i(z,!1):z,b=j=>Lh(j,!1,c),h=c.onStop=()=>{const j=Oo.get(c);if(j){if(l)l(j,4);else for(const oe of j)oe();Oo.delete(c)}},t?r?z(!0):$=c.run():i?i(z.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Kn(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qt(e))Kn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(ku(e)||os(e))e.forEach(r=>{Kn(r,t,n)});else if(Su(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}/**
9
+ **/let en;class ch{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=en,!t&&en&&(this.index=(en.scopes||(en.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=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=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 uh(){return en}let Tt;const vi=new WeakSet;class Au{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,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,vi.has(this)&&(vi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,bl(this),xu(this);const t=Tt,n=pn;Tt=this,pn=!0;try{return this.fn()}finally{Ou(this),Tt=t,pn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Da(t);this.deps=this.depsTail=void 0,bl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?vi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ki(this)&&this.run()}get dirty(){return Ki(this)}}let Ru=0,$s,Ds;function Pu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Na(){Ru++}function $a(){if(--Ru>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=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 xu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ou(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Da(r),dh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Ki(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Mu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Mu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vs)||(e.globalVersion=Vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ki(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=pn;Tt=e,pn=!0;try{xu(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,pn=r,Ou(e),e.flags&=-3}}function Da(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)Da(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function dh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pn=!0;const Nu=[];function Xn(){Nu.push(pn),pn=!1}function Zn(){const e=Nu.pop();pn=e===void 0?!0:e}function bl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Vs=0;class fh{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 La{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(!Tt||!pn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new fh(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,$u(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=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Vs++,this.notify(t)}notify(t){Na();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$a()}}}function $u(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)$u(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ji=new WeakMap,Hr=Symbol(""),Yi=Symbol(""),Ws=Symbol("");function Vt(e,t,n){if(pn&&Tt){let r=Ji.get(e);r||Ji.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new La),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=Ji.get(e);if(!i){Vs++;return}const a=l=>{l&&l.trigger()};if(Na(),t==="clear")i.forEach(a);else{const l=Le(e),u=l&&xa(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,p)=>{(p==="length"||p===Ws||!vn(p)&&p>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Ws)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Hr)),os(e)&&a(i.get(Yi)));break;case"delete":l||(a(i.get(Hr)),os(e)&&a(i.get(Yi)));break;case"set":os(e)&&a(i.get(Hr));break}}$a()}function Zr(e){const t=ct(e);return t===e?t:(Vt(t,"iterate",Ws),dn(e)?t:t.map(yn))}function Xo(e){return Vt(e=ct(e),"iterate",Ws),e}function Cn(e,t){return er(e)?hs(Vr(e)?yn(t):t):yn(t)}const hh={__proto__:null,[Symbol.iterator](){return yi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Zr(this).concat(...e.map(t=>Le(t)?Zr(t):t))},entries(){return yi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Hn(this,"every",e,t,void 0,arguments)},filter(e,t){return Hn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Hn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Hn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Hn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Hn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Hn(this,"forEach",e,t,void 0,arguments)},includes(...e){return wi(this,"includes",e)},indexOf(...e){return wi(this,"indexOf",e)},join(e){return Zr(this).join(e)},lastIndexOf(...e){return wi(this,"lastIndexOf",e)},map(e,t){return Hn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return _l(this,"reduce",e,t)},reduceRight(e,...t){return _l(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Hn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Zr(this).toReversed()},toSorted(e){return Zr(this).toSorted(e)},toSpliced(...e){return Zr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return yi(this,"values",e=>Cn(this,e))}};function yi(e,t,n){const r=Xo(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const ph=Array.prototype;function Hn(e,t,n,r,s,o){const i=Xo(e),a=i!==e&&!dn(e),l=i[t];if(l!==ph[t]){const f=l.apply(e,o);return a?yn(f):f}let u=n;i!==e&&(a?u=function(f,p){return n.call(this,Cn(e,f),p,e)}:n.length>2&&(u=function(f,p){return n.call(this,f,p,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function _l(e,t,n,r){const s=Xo(e),o=s!==e&&!dn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Cn(e,u)),n.call(this,u,Cn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function wi(e,t,n){const r=ct(e);Vt(r,"iterate",Ws);const s=r[t](...n);return(s===-1||s===!1)&&Ua(n[0])?(n[0]=ct(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Xn(),Na();const r=ct(e)[t].apply(e,n);return $a(),Zn(),r}const mh=Aa("__proto__,__v_isRef,__isVue"),Du=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(vn));function gh(e){vn(e)||(e=String(e));const t=ct(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Lu{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?Eh:Fu:o?Uu:Bu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=hh[n]))return l;if(n==="hasOwnProperty")return gh}const a=Reflect.get(t,n,qt(t)?t:r);if((vn(n)?Du.has(n):mh(n))||(s||Vt(t,"get",n),o))return a;if(qt(a)){const l=i&&xa(n)?a:a.value;return s&&ft(l)?Xi(l):l}return ft(a)?s?Xi(a):Zo(a):a}}class ju extends Lu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&xa(n);if(!this._isShallow){const u=er(o);if(!dn(r)&&!er(r)&&(o=ct(o),r=ct(r)),!i&&qt(o)&&!qt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,qt(t)?t:s);return t===ct(s)&&(a?Rn(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Gn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!vn(n)||!Du.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Le(t)?"length":Hr),Reflect.ownKeys(t)}}class vh extends Lu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const yh=new ju,wh=new vh,bh=new ju(!0);const Qi=e=>e,ho=e=>Reflect.getPrototypeOf(e);function _h(e,t,n){return function(...r){const s=this.__v_raw,o=ct(s),i=os(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Qi:t?hs:yn;return!t&&Vt(o,"iterate",l?Yi:Hr),$t(Object.create(u),{next(){const{value:f,done:p}=u.next();return p?{value:f,done:p}:{value:a?[c(f[0]),c(f[1])]:c(f),done:p}}})}}function po(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function kh(e,t){const n={get(s){const o=this.__v_raw,i=ct(o),a=ct(s);e||(Rn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=ho(i),u=t?Qi:e?hs:yn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(ct(s),"iterate",Hr),s.size},has(s){const o=this.__v_raw,i=ct(o),a=ct(s);return e||(Rn(s,a)&&Vt(i,"has",s),Vt(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=ct(a),u=t?Qi:e?hs:yn;return!e&&Vt(l,"iterate",Hr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return $t(n,e?{add:po("add"),set:po("set"),delete:po("delete"),clear:po("clear")}:{add(s){const o=ct(this),i=ho(o),a=ct(s),l=!t&&!dn(s)&&!er(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),Gn(o,"add",l,l)),this},set(s,o){!t&&!dn(o)&&!er(o)&&(o=ct(o));const i=ct(this),{has:a,get:l}=ho(i);let u=a.call(i,s);u||(s=ct(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Rn(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=ct(this),{has:i,get:a}=ho(o);let l=i.call(o,s);l||(s=ct(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Gn(o,"delete",s,void 0),u},clear(){const s=ct(this),o=s.size!==0,i=s.clear();return o&&Gn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=_h(s,e,t)}),n}function ja(e,t){const n=kh(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const Th={get:ja(!1,!1)},Ih={get:ja(!1,!0)},Sh={get:ja(!0,!1)};const Bu=new WeakMap,Uu=new WeakMap,Fu=new WeakMap,Eh=new WeakMap;function Ch(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ah(e){return e.__v_skip||!Object.isExtensible(e)?0:Ch(Xf(e))}function Zo(e){return er(e)?e:Ba(e,!1,yh,Th,Bu)}function Hu(e){return Ba(e,!1,bh,Ih,Uu)}function Xi(e){return Ba(e,!0,wh,Sh,Fu)}function Ba(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ah(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 Vr(e){return er(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function er(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Ua(e){return e?!!e.__v_raw:!1}function ct(e){const t=e&&e.__v_raw;return t?ct(t):e}function Rh(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Iu(e,"__v_skip",!0),e}const yn=e=>ft(e)?Zo(e):e,hs=e=>ft(e)?Xi(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function D(e){return Vu(e,!1)}function Ph(e){return Vu(e,!0)}function Vu(e,t){return qt(e)?e:new xh(e,t)}class xh{constructor(t,n){this.dep=new La,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ct(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||er(t);t=r?t:ct(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),this.dep.trigger())}}function ue(e){return qt(e)?e.value:e}const Oh={get:(e,t,n)=>t==="__v_raw"?e:ue(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return qt(s)&&!qt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Wu(e){return Vr(e)?e:new Proxy(e,Oh)}class Mh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new La(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Pu(this,!0),!0}get value(){const t=this.dep.track();return Mu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Nh(e,t,n=!1){let r,s;return ze(e)?r=e:(r=e.get,s=e.set),new Mh(r,s,n)}const mo={},Oo=new WeakMap;let Dr;function $h(e,t=!1,n=Dr){if(n){let r=Oo.get(n);r||Oo.set(n,r=[]),r.push(e)}}function Dh(e,t,n=bt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=B=>s?B:dn(B)||s===!1||s===0?Kn(B,1):Kn(B);let c,f,p,_,N=!1,I=!1;if(qt(e)?(f=()=>e.value,N=dn(e)):Vr(e)?(f=()=>u(e),N=!0):Le(e)?(I=!0,N=e.some(B=>Vr(B)||dn(B)),f=()=>e.map(B=>{if(qt(B))return B.value;if(Vr(B))return u(B);if(ze(B))return l?l(B,2):B()})):ze(e)?t?f=l?()=>l(e,2):e:f=()=>{if(p){Xn();try{p()}finally{Zn()}}const B=Dr;Dr=c;try{return l?l(e,3,[_]):e(_)}finally{Dr=B}}:f=Mn,t&&s){const B=f,oe=s===!0?1/0:s;f=()=>Kn(B(),oe)}const M=uh(),Y=()=>{c.stop(),M&&M.active&&Pa(M.effects,c)};if(o&&t){const B=t;t=(...oe)=>{B(...oe),Y()}}let j=I?new Array(e.length).fill(mo):mo;const q=B=>{if(!(!(c.flags&1)||!c.dirty&&!B))if(t){const oe=c.run();if(s||N||(I?oe.some((de,ve)=>Rn(de,j[ve])):Rn(oe,j))){p&&p();const de=Dr;Dr=c;try{const ve=[oe,j===mo?void 0:I&&j[0]===mo?[]:j,_];j=oe,l?l(t,3,ve):t(...ve)}finally{Dr=de}}}else c.run()};return a&&a(q),c=new Au(f),c.scheduler=i?()=>i(q,!1):q,_=B=>$h(B,!1,c),p=c.onStop=()=>{const B=Oo.get(c);if(B){if(l)l(B,4);else for(const oe of B)oe();Oo.delete(c)}},t?r?q(!0):j=c.run():i?i(q.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Kn(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qt(e))Kn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(bu(e)||os(e))e.forEach(r=>{Kn(r,t,n)});else if(Tu(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}/**
10
10
  * @vue/runtime-core v3.5.30
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/function so(e,t,n,r){try{return r?e(...r):e()}catch(s){ti(s,t,n)}}function wn(e,t,n,r){if(ze(e)){const s=so(e,t,n,r);return s&&Tu(s)&&s.catch(o=>{ti(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(wn(e[o],t,n,r));return s}}function ti(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||bt;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,u)===!1)return}a=a.parent}if(o){Xn(),so(o,null,10,[e,l,u]),Zn();return}}Bh(e,n,s,r,i)}function Bh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let Sn=-1;const is=[];let pr=null,ts=0;const Gu=Promise.resolve();let No=null;function tn(e){const t=No||Gu;return e?t.then(this?e.bind(this):e):t}function Uh(e){let t=Sn+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Va(e){if(!(e.flags&1)){const t=qs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=qs(n)?Jt.push(e):Jt.splice(Uh(t),0,e),e.flags|=1,Ku()}}function Ku(){No||(No=Gu.then(Yu))}function Fh(e){Le(e)?is.push(...e):pr&&e.id===-1?pr.splice(ts+1,0,e):e.flags&1||(is.push(e),e.flags|=1),Ku()}function Tl(e,t,n=Sn+1){for(;n<Jt.length;n++){const r=Jt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Jt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ju(e){if(is.length){const t=[...new Set(is)].sort((n,r)=>qs(n)-qs(r));if(is.length=0,pr){pr.push(...t);return}for(pr=t,ts=0;ts<pr.length;ts++){const n=pr[ts];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pr=null,ts=0}}const qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Yu(e){try{for(Sn=0;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),so(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&(t.flags&=-2)}Sn=-1,Jt.length=0,Ju(),No=null,(Jt.length||is.length)&&Yu()}}let Ut=null,Qu=null;function $o(e){const t=Ut;return Ut=e,Qu=e&&e.type.__scopeId||null,t}function pt(e,t=Ut,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Bo(-1);const o=$o(t);let i;try{i=e(...s)}finally{$o(o),r._d&&Bo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Ut===null)return e;const n=ai(Ut),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=bt]=t[s];o&&(ze(o)&&(o={mounted:o,updated:o}),o.deep&&Kn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Pr(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&&(Xn(),wn(l,n,8,[e.el,a,e,t]),Zn())}}function Io(e,t){if(zt){let n=zt.provides;const r=zt.parent&&zt.parent.provides;r===n&&(n=zt.provides=Object.create(r)),n[e]=t}}function mn(e,t,n=!1){const r=Ka();if(r||ls){let s=ls?ls._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&&ze(t)?t.call(r&&r.proxy):t}}const Hh=Symbol.for("v-scx"),Vh=()=>mn(Hh);function mt(e,t,n){return Xu(e,t,n)}function Xu(e,t,n=bt){const{immediate:r,deep:s,flush:o,once:i}=n,a=$t({},n),l=t&&r||!t&&o!=="post";let u;if(Ys){if(o==="sync"){const b=Vh();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=On,b.resume=On,b.pause=On,b}}const c=zt;a.call=(b,N,I)=>wn(b,c,N,I);let f=!1;o==="post"?a.scheduler=b=>{Ht(b,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,N)=>{N?b():Va(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const h=jh(e,t,a);return Ys&&(u?u.push(h):l&&h()),h}function Wh(e,t,n){const r=this.proxy,s=Ct(e)?e.includes(".")?Zu(r,e):()=>r[e]:e.bind(r,r);let o;ze(t)?o=t:(o=t.handler,n=t);const i=oo(this),a=Xu(s,o.bind(r),n);return i(),a}function Zu(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 ed=Symbol("_vte"),td=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Il=e=>e&&(e.defer||e.defer===""),Sl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,El=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ta=(e,t)=>{const n=e&&e.to;return Ct(n)?t?t(n):null:n},nd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:h,o:{insert:b,querySelector:N,createText:I,createComment:O}}=u,Y=Ls(t.props);let{shapeFlag:$,children:z,dynamicChildren:j}=t;if(e==null){const oe=t.el=I(""),de=t.anchor=I("");b(oe,n,r),b(de,n,r);const ve=(re,ee)=>{$&16&&c(z,re,ee,s,o,i,a,l)},Ie=()=>{const re=t.target=ta(t.props,N),ee=na(re,t,I,b);re&&(i!=="svg"&&Sl(re)?i="svg":i!=="mathml"&&El(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),Y||(ve(re,ee),So(t,!1)))};Y&&(ve(n,de),So(t,!0)),Il(t.props)?(t.el.__isMounted=!1,Ht(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(Il(t.props)&&e.el.__isMounted===!1){Ht(()=>{nd.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ls(e.props),re=Ie?n:de,ee=Ie?oe:ve;if(i==="svg"||Sl(de)?i="svg":(i==="mathml"||El(de))&&(i="mathml"),j?(h(e.dynamicChildren,j,re,s,o,i,a),qa(e,t,!0)):l||f(e,t,re,ee,s,o,i,a,!1),Y)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):vo(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=ta(t.props,N);ye&&vo(t,ye,null,u,0)}else Ie&&vo(t,de,ve,u,1);So(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:h}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const b=o||!Ls(h);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,b,!!I.dynamicChildren)}}},move:vo,hydrate:zh};function vo(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:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ls(c))&&l&16)for(let h=0;h<u.length;h++)s(u[h],t,n,2);f&&r(a,t,n)}function zh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function h(O,Y){let $=Y;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,O._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function b(O,Y){Y.anchor=f(i(O),Y,a(O),n,r,s,o)}const N=t.target=ta(t.props,l),I=Ls(t.props);if(N){const O=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(b(e,t),h(N,O),t.targetAnchor||na(N,t,c,u,a(e)===N?e:null)):(t.anchor=i(e),h(N,O),t.targetAnchor||na(N,t,c,u),f(O&&i(O),t,N,n,r,s,o))),So(t,I)}else I&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Do=nd;function So(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 na(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[ed]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function qh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ir(()=>{e.isMounted=!0}),ar(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],rd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},sd=e=>{const t=e.subTree;return t.component?sd(t.component):t},Gh={name:"BaseTransition",props:rd,setup(e,{slots:t}){const n=Ka(),r=qh();return()=>{const s=t.default&&ad(t.default(),!0);if(!s||!s.length)return;const o=od(s),i=ct(e),{mode:a}=i;if(r.isLeaving)return ki(o);const l=Cl(o);if(!l)return ki(o);let u=ra(l,i,r,n,f=>u=f);l.type!==Wt&&Gs(l,u);let c=n.subTree&&Cl(n.subTree);if(c&&c.type!==Wt&&!jr(c,l)&&sd(n).type!==Wt){let f=ra(c,i,r,n);if(Gs(c,f),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},ki(o);a==="in-out"&&l.type!==Wt?f.delayLeave=(h,b,N)=>{const I=id(r,c);I[String(c.key)]=c,h[En]=()=>{b(),h[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{N(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function od(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const Kh=Gh;function id(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 ra(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:b,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:O,onAppear:Y,onAfterAppear:$,onAppearCancelled:z}=t,j=String(e.key),oe=id(n,e),de=(re,ee)=>{re&&wn(re,r,9,ee)},ve=(re,ee)=>{const ye=ee[1];de(re,ee),Le(re)?re.every(te=>te.length<=1)&&ye():re.length<=1&&ye()},Ie={mode:i,persisted:a,beforeEnter(re){let ee=l;if(!n.isMounted)if(o)ee=O||l;else return;re[En]&&re[En](!0);const ye=oe[j];ye&&jr(e,ye)&&ye.el[En]&&ye.el[En](),de(ee,[re])},enter(re){if(oe[j]===e)return;let ee=u,ye=c,te=f;if(!n.isMounted)if(o)ee=Y||u,ye=$||c,te=z||f;else return;let je=!1;re[As]=Qe=>{je||(je=!0,Qe?de(te,[re]):de(ye,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[As]=void 0)};const Be=re[As].bind(null,!1);ee?ve(ee,[re,Be]):Be()},leave(re,ee){const ye=String(e.key);if(re[As]&&re[As](!0),n.isUnmounting)return ee();de(h,[re]);let te=!1;re[En]=Be=>{te||(te=!0,ee(),Be?de(I,[re]):de(N,[re]),re[En]=void 0,oe[ye]===e&&delete oe[ye])};const je=re[En].bind(null,!1);oe[ye]=e,b?ve(b,[re,je]):je()},clone(re){const ee=ra(re,t,n,r,s);return s&&s(ee),ee}};return Ie}function ki(e){if(ni(e))return e=kr(e),e.children=null,e}function Cl(e){if(!ni(e))return td(e.type)&&e.children?od(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ze(n.default))return n.default()}}function Gs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gs(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 ad(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===He?(i.patchFlag&128&&s++,r=r.concat(ad(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?kr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return ze(e)?$t({name:e.name},t,{setup:e}):e}function ld(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Al(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Lo=new WeakMap;function js(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,O)=>js(I,t&&(Le(t)?t[O]:t),n,r,s));return}if(as(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ai(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===bt?a.refs={}:a.refs,f=a.setupState,h=ct(f),b=f===bt?_u:I=>Al(c,I)?!1:dt(h,I),N=(I,O)=>!(O&&Al(c,O));if(u!=null&&u!==l){if(Rl(t),Ct(u))c[u]=null,b(u)&&(f[u]=null);else if(qt(u)){const I=t;N(u,I.k)&&(u.value=null),I.k&&(c[I.k]=null)}}if(ze(l))so(l,a,12,[i,c]);else{const I=Ct(l),O=qt(l);if(I||O){const Y=()=>{if(e.f){const $=I?b(l)?f[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Le($)&&Ma($,o);else if(Le($))$.includes(o)||$.push(o);else if(I)c[l]=[o],b(l)&&(f[l]=c[l]);else{const z=[o];N(l,e.k)&&(l.value=z),e.k&&(c[e.k]=z)}}else I?(c[l]=i,b(l)&&(f[l]=i)):O&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{Y(),Lo.delete(e)};$.id=-1,Lo.set(e,$),Ht($,n)}else Rl(e),Y()}}}function Rl(e){const t=Lo.get(e);t&&(t.flags|=8,Lo.delete(e))}Xo().requestIdleCallback;Xo().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,ni=e=>e.type.__isKeepAlive;function Jh(e,t){cd(e,"a",t)}function Yh(e,t){cd(e,"da",t)}function cd(e,t,n=zt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ri(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ni(s.parent.vnode)&&Qh(r,t,n,s),s=s.parent}}function Qh(e,t,n,r){const s=ri(t,e,r,!0);si(()=>{Ma(r[t],s)},n)}function ri(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Xn();const a=oo(n),l=wn(t,n,e,i);return a(),Zn(),l});return r?s.unshift(o):s.push(o),o}}const or=e=>(t,n=zt)=>{(!Ys||e==="sp")&&ri(e,(...r)=>t(...r),n)},Xh=or("bm"),ir=or("m"),Zh=or("bu"),ep=or("u"),ar=or("bum"),si=or("um"),tp=or("sp"),np=or("rtg"),rp=or("rtc");function sp(e,t=zt){ri("ec",e,t)}const op="components",ud=Symbol.for("v-ndc");function sa(e){return Ct(e)?ip(op,e,!1)||e:e||ud}function ip(e,t,n=!0,r=!1){const s=Ut||zt;if(s){const o=s.type;{const a=Wp(o,!1);if(a&&(a===t||a===Qt(t)||a===Qo(Qt(t))))return o}const i=xl(s[e]||o[e],t)||xl(s.appContext[e],t);return!i&&r?o:i}}function xl(e,t){return e&&(e[t]||e[Qt(t)]||e[Qo(Qt(t))])}function Et(e,t,n,r){let s;const o=n,i=Le(e);if(i||Ct(e)){const a=i&&Vr(e);let l=!1,u=!1;a&&(l=!dn(e),u=er(e),e=Zo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?hs(yn(e[c])):yn(e[c]):e[c],c,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(ft(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,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Mn(e,t,n={},r,s){if(Ut.ce||Ut.parent&&as(Ut.parent)&&Ut.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),yt(He,null,[Ce("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&dd(o(n)),a=n.key||i&&i.key,l=yt(He,{key:(a&&!vn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function dd(e){return e.some(t=>Js(t)?!(t.type===Wt||t.type===He&&!dd(t.children)):!0)?e:null}const oa=e=>e?Pd(e)?ai(e):oa(e.parent):null,Bs=$t(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=>oa(e.parent),$root:e=>oa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>hd(e),$forceUpdate:e=>e.f||(e.f=()=>{Va(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Wh.bind(e)}),Ti=(e,t)=>e!==bt&&!e.__isScriptSetup&&dt(e,t),ap={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 h=i[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ti(r,t))return i[t]=1,r[t];if(s!==bt&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==bt&&dt(n,t))return i[t]=4,n[t];ia&&(i[t]=0)}}const u=Bs[t];let c,f;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==bt&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ti(s,t)?(s[t]=n,!0):r!==bt&&dt(r,t)?(r[t]=n,!0):dt(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!==bt&&a[0]!=="$"&&dt(e,a)||Ti(t,a)||dt(o,a)||dt(r,a)||dt(Bs,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function lp(){return cp().slots}function cp(e){const t=Ka();return t.setupContext||(t.setupContext=Od(t))}function Pl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ia=!0;function up(e){const t=hd(e),n=e.proxy,r=e.ctx;ia=!1,t.beforeCreate&&Ml(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:b,updated:N,activated:I,deactivated:O,beforeDestroy:Y,beforeUnmount:$,destroyed:z,unmounted:j,render:oe,renderTracked:de,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:ee,inheritAttrs:ye,components:te,directives:je,filters:Be}=t;if(u&&dp(u,r,null),i)for(const Te in i){const $e=i[Te];ze($e)&&(r[Te]=$e.bind(n))}if(s){const Te=s.call(n,n);ft(Te)&&(e.data=ei(Te))}if(ia=!0,o)for(const Te in o){const $e=o[Te],It=ze($e)?$e.bind(n,n):ze($e.get)?$e.get.bind(n,n):On,nt=!ze($e)&&ze($e.set)?$e.set.bind(n):On,Xe=pe({get:It,set:nt});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:Ze=>Xe.value=Ze})}if(a)for(const Te in a)fd(a[Te],r,n,Te);if(l){const Te=ze(l)?l.call(n):l;Reflect.ownKeys(Te).forEach($e=>{Io($e,Te[$e])})}c&&Ml(c,e,"c");function Re(Te,$e){Le($e)?$e.forEach(It=>Te(It.bind(n))):$e&&Te($e.bind(n))}if(Re(Xh,f),Re(ir,h),Re(Zh,b),Re(ep,N),Re(Jh,I),Re(Yh,O),Re(sp,Ie),Re(rp,de),Re(np,ve),Re(ar,$),Re(si,j),Re(tp,re),Le(ee))if(ee.length){const Te=e.exposed||(e.exposed={});ee.forEach($e=>{Object.defineProperty(Te,$e,{get:()=>n[$e],set:It=>n[$e]=It,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===On&&(e.render=oe),ye!=null&&(e.inheritAttrs=ye),te&&(e.components=te),je&&(e.directives=je),re&&ld(e)}function dp(e,t,n=On){Le(e)&&(e=aa(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=mn(s.from||r,s.default,!0):o=mn(s.from||r):o=mn(s),qt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Ml(e,t,n){wn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function fd(e,t,n,r){let s=r.includes(".")?Zu(n,r):()=>n[r];if(Ct(e)){const o=t[e];ze(o)&&mt(s,o)}else if(ze(e))mt(s,e.bind(n));else if(ft(e))if(Le(e))e.forEach(o=>fd(o,t,n,r));else{const o=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(o)&&mt(s,o,e)}}function hd(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(u=>jo(l,u,i,!0)),jo(l,t,i)),ft(t)&&o.set(t,l),l}function jo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&jo(e,o,n,!0),s&&s.forEach(i=>jo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=fp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const fp={data:Ol,props:Nl,emits:Nl,methods:Os,computed:Os,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:Os,directives:Os,watch:pp,provide:Ol,inject:hp};function Ol(e,t){return t?e?function(){return $t(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function hp(e,t){return Os(aa(e),aa(t))}function aa(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gt(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?$t(Object.create(null),e,t):t}function Nl(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:$t(Object.create(null),Pl(e),Pl(t??{})):t}function pp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function pd(){return{app:null,config:{isNativeTag:_u,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 mp=0;function gp(e,t){return function(r,s=null){ze(r)||(r=$t({},r)),s!=null&&!ft(s)&&(s=null);const o=pd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:mp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:qp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&ze(c.install)?(i.add(c),c.install(u,...f)):ze(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,h){if(!l){const b=u._ceVNode||Ce(r,s);return b.appContext=o,h===!0?h="svg":h===!1&&(h=void 0),e(b,c,h),l=!0,u._container=c,c.__vue_app__=u,ai(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(wn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=ls;ls=u;try{return c()}finally{ls=f}}};return u}}let ls=null;const vp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Qt(t)}Modifiers`]||e[`${Tr(t)}Modifiers`];function yp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||bt;let s=n;const o=t.startsWith("update:"),i=o&&vp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Ct(c)?c.trim():c)),i.number&&(s=n.map(Na)));let a,l=r[a=vi(t)]||r[a=vi(Qt(t))];!l&&o&&(l=r[a=vi(Tr(t))]),l&&wn(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wn(u,e,6,s)}}const wp=new WeakMap;function md(e,t,n=!1){const r=n?wp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!ze(e)){const l=u=>{const c=md(u,t,!0);c&&(a=!0,$t(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ft(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):$t(i,o),ft(e)&&r.set(e,i),i)}function oi(e,t){return!e||!Jo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Tr(t))||dt(e,t))}function $l(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:h,setupState:b,ctx:N,inheritAttrs:I}=e,O=$o(e);let Y,$;try{if(n.shapeFlag&4){const j=s||r,oe=j;Y=An(u.call(oe,j,c,f,b,h,N)),$=a}else{const j=t;Y=An(j.length>1?j(f,{attrs:a,slots:i,emit:l}):j(f,null)),$=t.props?a:bp(a)}}catch(j){Us.length=0,ti(j,e,1),Y=Ce(Wt)}let z=Y;if($&&I!==!1){const j=Object.keys($),{shapeFlag:oe}=z;j.length&&oe&7&&(o&&j.some(Pa)&&($=_p($,o)),z=kr(z,$,!1,!0))}return n.dirs&&(z=kr(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(n.dirs):n.dirs),n.transition&&Gs(z,n.transition),Y=z,$o(O),Y}const bp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Jo(n))&&((t||(t={}))[n]=e[n]);return t},_p=(e,t)=>{const n={};for(const r in e)(!Pa(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function kp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Dl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(gd(i,r,h)&&!oi(u,h))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Dl(r,i,u):!0:!!i;return!1}function Dl(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(gd(t,e,o)&&!oi(n,o))return!0}return!1}function gd(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!$a(r,s):r!==s}function Tp({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 vd={},yd=()=>Object.create(vd),wd=e=>Object.getPrototypeOf(e)===vd;function Ip(e,t,n,r=!1){const s={},o=yd();e.propsDefaults=Object.create(null),bd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Wu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Sp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ct(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let h=c[f];if(oi(e.emitsOptions,h))continue;const b=t[h];if(l)if(dt(o,h))b!==o[h]&&(o[h]=b,u=!0);else{const N=Qt(h);s[N]=la(l,a,N,b,e,!1)}else b!==o[h]&&(o[h]=b,u=!0)}}}else{bd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=Tr(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=la(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Gn(e.attrs,"set","")}function bd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const u=t[l];let c;s&&dt(s,c=Qt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:oi(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=ct(n),u=a||bt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=la(s,l,f,u[f],e,!dt(u,f))}}return i}function la(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&ze(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=oo(s);r=u[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Tr(n))&&(r=!0))}return r}const Ep=new WeakMap;function _d(e,t,n=!1){const r=n?Ep:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!ze(e)){const c=f=>{l=!0;const[h,b]=_d(f,t,!0);$t(i,h),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ft(e)&&r.set(e,ss),ss;if(Le(o))for(let c=0;c<o.length;c++){const f=Qt(o[c]);Ll(f)&&(i[f]=bt)}else if(o)for(const c in o){const f=Qt(c);if(Ll(f)){const h=o[c],b=i[f]=Le(h)||ze(h)?{type:h}:$t({},h),N=b.type;let I=!1,O=!0;if(Le(N))for(let Y=0;Y<N.length;++Y){const $=N[Y],z=ze($)&&$.name;if(z==="Boolean"){I=!0;break}else z==="String"&&(O=!1)}else I=ze(N)&&N.name==="Boolean";b[0]=I,b[1]=O,(I||dt(b,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Ll(e){return e[0]!=="$"&&!Ns(e)}const Wa=e=>e==="_"||e==="_ctx"||e==="$stable",za=e=>Le(e)?e.map(An):[An(e)],Cp=(e,t,n)=>{if(t._n)return t;const r=pt((...s)=>za(t(...s)),n);return r._c=!1,r},kd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Wa(s))continue;const o=e[s];if(ze(o))t[s]=Cp(s,o,r);else if(o!=null){const i=za(o);t[s]=()=>i}}},Td=(e,t)=>{const n=za(t);e.slots.default=()=>n},Id=(e,t,n)=>{for(const r in t)(n||!Wa(r))&&(e[r]=t[r])},Ap=(e,t,n)=>{const r=e.slots=yd();if(e.vnode.shapeFlag&32){const s=t._;s?(Id(r,t,n),n&&Eu(r,"_",s,!0)):kd(t,r)}else t&&Td(e,t)},Rp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=bt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Id(s,t,n):(o=!t.$stable,kd(t,s)),i=t}else t&&(Td(e,t),i={default:1});if(o)for(const a in s)!Wa(a)&&i[a]==null&&delete s[a]},Ht=Np;function xp(e){return Pp(e)}function Pp(e,t){const n=Xo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:b=On,insertStaticContent:N}=e,I=(g,v,A,H=null,F=null,x=null,D=void 0,B=null,G=!!v.dynamicChildren)=>{if(g===v)return;g&&!jr(g,v)&&(H=W(g),Ze(g,F,x,!0),g=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null);const{type:V,ref:be,shapeFlag:ae}=v;switch(V){case ii:O(g,v,A,H);break;case Wt:Y(g,v,A,H);break;case Si:g==null&&$(v,A,H,D);break;case He:te(g,v,A,H,F,x,D,B,G);break;default:ae&1?oe(g,v,A,H,F,x,D,B,G):ae&6?je(g,v,A,H,F,x,D,B,G):(ae&64||ae&128)&&V.process(g,v,A,H,F,x,D,B,G,fe)}be!=null&&F?js(be,g&&g.ref,x,v||g,!v):be==null&&g&&g.ref!=null&&js(g.ref,null,x,g,!0)},O=(g,v,A,H)=>{if(g==null)r(v.el=a(v.children),A,H);else{const F=v.el=g.el;v.children!==g.children&&u(F,v.children)}},Y=(g,v,A,H)=>{g==null?r(v.el=l(v.children||""),A,H):v.el=g.el},$=(g,v,A,H)=>{[g.el,g.anchor]=N(g.children,v,A,H,g.el,g.anchor)},z=({el:g,anchor:v},A,H)=>{let F;for(;g&&g!==v;)F=h(g),r(g,A,H),g=F;r(v,A,H)},j=({el:g,anchor:v})=>{let A;for(;g&&g!==v;)A=h(g),s(g),g=A;s(v)},oe=(g,v,A,H,F,x,D,B,G)=>{if(v.type==="svg"?D="svg":v.type==="math"&&(D="mathml"),g==null)de(v,A,H,F,x,D,B,G);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,v,F,x,D,B,G)}finally{V&&V._endPatch()}}},de=(g,v,A,H,F,x,D,B)=>{let G,V;const{props:be,shapeFlag:ae,transition:he,dirs:Se}=g;if(G=g.el=i(g.type,x,be&&be.is,be),ae&8?c(G,g.children):ae&16&&Ie(g.children,G,null,H,F,Ii(g,x),D,B),Se&&Pr(g,null,H,"created"),ve(G,g,g.scopeId,D,H),be){for(const Ke in be)Ke!=="value"&&!Ns(Ke)&&o(G,Ke,null,be[Ke],x,H);"value"in be&&o(G,"value",null,be.value,x),(V=be.onVnodeBeforeMount)&&In(V,H,g)}Se&&Pr(g,null,H,"beforeMount");const Me=Mp(F,he);Me&&he.beforeEnter(G),r(G,v,A),((V=be&&be.onVnodeMounted)||Me||Se)&&Ht(()=>{V&&In(V,H,g),Me&&he.enter(G),Se&&Pr(g,null,H,"mounted")},F)},ve=(g,v,A,H,F)=>{if(A&&b(g,A),H)for(let x=0;x<H.length;x++)b(g,H[x]);if(F){let x=F.subTree;if(v===x||Cd(x.type)&&(x.ssContent===v||x.ssFallback===v)){const D=F.vnode;ve(g,D,D.scopeId,D.slotScopeIds,F.parent)}}},Ie=(g,v,A,H,F,x,D,B,G=0)=>{for(let V=G;V<g.length;V++){const be=g[V]=B?qn(g[V]):An(g[V]);I(null,be,v,A,H,F,x,D,B)}},re=(g,v,A,H,F,x,D)=>{const B=v.el=g.el;let{patchFlag:G,dynamicChildren:V,dirs:be}=v;G|=g.patchFlag&16;const ae=g.props||bt,he=v.props||bt;let Se;if(A&&Mr(A,!1),(Se=he.onVnodeBeforeUpdate)&&In(Se,A,v,g),be&&Pr(v,g,A,"beforeUpdate"),A&&Mr(A,!0),(ae.innerHTML&&he.innerHTML==null||ae.textContent&&he.textContent==null)&&c(B,""),V?ee(g.dynamicChildren,V,B,A,H,Ii(v,F),x):D||$e(g,v,B,null,A,H,Ii(v,F),x,!1),G>0){if(G&16)ye(B,ae,he,A,F);else if(G&2&&ae.class!==he.class&&o(B,"class",null,he.class,F),G&4&&o(B,"style",ae.style,he.style,F),G&8){const Me=v.dynamicProps;for(let Ke=0;Ke<Me.length;Ke++){const Pe=Me[Ke],Ve=ae[Pe],_t=he[Pe];(_t!==Ve||Pe==="value")&&o(B,Pe,Ve,_t,F,A)}}G&1&&g.children!==v.children&&c(B,v.children)}else!D&&V==null&&ye(B,ae,he,A,F);((Se=he.onVnodeUpdated)||be)&&Ht(()=>{Se&&In(Se,A,v,g),be&&Pr(v,g,A,"updated")},H)},ee=(g,v,A,H,F,x,D)=>{for(let B=0;B<v.length;B++){const G=g[B],V=v[B],be=G.el&&(G.type===He||!jr(G,V)||G.shapeFlag&198)?f(G.el):A;I(G,V,be,null,H,F,x,D,!0)}},ye=(g,v,A,H,F)=>{if(v!==A){if(v!==bt)for(const x in v)!Ns(x)&&!(x in A)&&o(g,x,v[x],null,F,H);for(const x in A){if(Ns(x))continue;const D=A[x],B=v[x];D!==B&&x!=="value"&&o(g,x,B,D,F,H)}"value"in A&&o(g,"value",v.value,A.value,F)}},te=(g,v,A,H,F,x,D,B,G)=>{const V=v.el=g?g.el:a(""),be=v.anchor=g?g.anchor:a("");let{patchFlag:ae,dynamicChildren:he,slotScopeIds:Se}=v;Se&&(B=B?B.concat(Se):Se),g==null?(r(V,A,H),r(be,A,H),Ie(v.children||[],A,be,F,x,D,B,G)):ae>0&&ae&64&&he&&g.dynamicChildren&&g.dynamicChildren.length===he.length?(ee(g.dynamicChildren,he,A,F,x,D,B),(v.key!=null||F&&v===F.subTree)&&qa(g,v,!0)):$e(g,v,A,be,F,x,D,B,G)},je=(g,v,A,H,F,x,D,B,G)=>{v.slotScopeIds=B,g==null?v.shapeFlag&512?F.ctx.activate(v,A,H,D,G):Be(v,A,H,F,x,D,G):Qe(g,v,G)},Be=(g,v,A,H,F,x,D)=>{const B=g.component=Up(g,H,F);if(ni(g)&&(B.ctx.renderer=fe),Fp(B,!1,D),B.asyncDep){if(F&&F.registerDep(B,Re,D),!g.el){const G=B.subTree=Ce(Wt);Y(null,G,v,A),g.placeholder=G.el}}else Re(B,g,v,A,F,x,D)},Qe=(g,v,A)=>{const H=v.component=g.component;if(kp(g,v,A))if(H.asyncDep&&!H.asyncResolved){Te(H,v,A);return}else H.next=v,H.update();else v.el=g.el,H.vnode=v},Re=(g,v,A,H,F,x,D)=>{const B=()=>{if(g.isMounted){let{next:ae,bu:he,u:Se,parent:Me,vnode:Ke}=g;{const K=Sd(g);if(K){ae&&(ae.el=Ke.el,Te(g,ae,D)),K.asyncDep.then(()=>{Ht(()=>{g.isUnmounted||V()},F)});return}}let Pe=ae,Ve;Mr(g,!1),ae?(ae.el=Ke.el,Te(g,ae,D)):ae=Ke,he&&To(he),(Ve=ae.props&&ae.props.onVnodeBeforeUpdate)&&In(Ve,Me,ae,Ke),Mr(g,!0);const _t=$l(g),U=g.subTree;g.subTree=_t,I(U,_t,f(U.el),W(U),g,F,x),ae.el=_t.el,Pe===null&&Tp(g,_t.el),Se&&Ht(Se,F),(Ve=ae.props&&ae.props.onVnodeUpdated)&&Ht(()=>In(Ve,Me,ae,Ke),F)}else{let ae;const{el:he,props:Se}=v,{bm:Me,m:Ke,parent:Pe,root:Ve,type:_t}=g,U=as(v);Mr(g,!1),Me&&To(Me),!U&&(ae=Se&&Se.onVnodeBeforeMount)&&In(ae,Pe,v),Mr(g,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(_t,g.parent?g.parent.type:void 0);const K=g.subTree=$l(g);I(null,K,A,H,g,F,x),v.el=K.el}if(Ke&&Ht(Ke,F),!U&&(ae=Se&&Se.onVnodeMounted)){const K=v;Ht(()=>In(ae,Pe,K),F)}(v.shapeFlag&256||Pe&&as(Pe.vnode)&&Pe.vnode.shapeFlag&256)&&g.a&&Ht(g.a,F),g.isMounted=!0,v=A=H=null}};g.scope.on();const G=g.effect=new xu(B);g.scope.off();const V=g.update=G.run.bind(G),be=g.job=G.runIfDirty.bind(G);be.i=g,be.id=g.uid,G.scheduler=()=>Va(be),Mr(g,!0),V()},Te=(g,v,A)=>{v.component=g;const H=g.vnode.props;g.vnode=v,g.next=null,Sp(g,v.props,H,A),Rp(g,v.children,A),Xn(),Tl(g),Zn()},$e=(g,v,A,H,F,x,D,B,G=!1)=>{const V=g&&g.children,be=g?g.shapeFlag:0,ae=v.children,{patchFlag:he,shapeFlag:Se}=v;if(he>0){if(he&128){nt(V,ae,A,H,F,x,D,B,G);return}else if(he&256){It(V,ae,A,H,F,x,D,B,G);return}}Se&8?(be&16&&et(V,F,x),ae!==V&&c(A,ae)):be&16?Se&16?nt(V,ae,A,H,F,x,D,B,G):et(V,F,x,!0):(be&8&&c(A,""),Se&16&&Ie(ae,A,H,F,x,D,B,G))},It=(g,v,A,H,F,x,D,B,G)=>{g=g||ss,v=v||ss;const V=g.length,be=v.length,ae=Math.min(V,be);let he;for(he=0;he<ae;he++){const Se=v[he]=G?qn(v[he]):An(v[he]);I(g[he],Se,A,null,F,x,D,B,G)}V>be?et(g,F,x,!0,!1,ae):Ie(v,A,H,F,x,D,B,G,ae)},nt=(g,v,A,H,F,x,D,B,G)=>{let V=0;const be=v.length;let ae=g.length-1,he=be-1;for(;V<=ae&&V<=he;){const Se=g[V],Me=v[V]=G?qn(v[V]):An(v[V]);if(jr(Se,Me))I(Se,Me,A,null,F,x,D,B,G);else break;V++}for(;V<=ae&&V<=he;){const Se=g[ae],Me=v[he]=G?qn(v[he]):An(v[he]);if(jr(Se,Me))I(Se,Me,A,null,F,x,D,B,G);else break;ae--,he--}if(V>ae){if(V<=he){const Se=he+1,Me=Se<be?v[Se].el:H;for(;V<=he;)I(null,v[V]=G?qn(v[V]):An(v[V]),A,Me,F,x,D,B,G),V++}}else if(V>he)for(;V<=ae;)Ze(g[V],F,x,!0),V++;else{const Se=V,Me=V,Ke=new Map;for(V=Me;V<=he;V++){const it=v[V]=G?qn(v[V]):An(v[V]);it.key!=null&&Ke.set(it.key,V)}let Pe,Ve=0;const _t=he-Me+1;let U=!1,K=0;const ne=new Array(_t);for(V=0;V<_t;V++)ne[V]=0;for(V=Se;V<=ae;V++){const it=g[V];if(Ve>=_t){Ze(it,F,x,!0);continue}let kt;if(it.key!=null)kt=Ke.get(it.key);else for(Pe=Me;Pe<=he;Pe++)if(ne[Pe-Me]===0&&jr(it,v[Pe])){kt=Pe;break}kt===void 0?Ze(it,F,x,!0):(ne[kt-Me]=V+1,kt>=K?K=kt:U=!0,I(it,v[kt],A,null,F,x,D,B,G),Ve++)}const Je=U?Op(ne):ss;for(Pe=Je.length-1,V=_t-1;V>=0;V--){const it=Me+V,kt=v[it],xt=v[it+1],ln=it+1<be?xt.el||Ed(xt):H;ne[V]===0?I(null,kt,A,ln,F,x,D,B,G):U&&(Pe<0||V!==Je[Pe]?Xe(kt,A,ln,2):Pe--)}}},Xe=(g,v,A,H,F=null)=>{const{el:x,type:D,transition:B,children:G,shapeFlag:V}=g;if(V&6){Xe(g.component.subTree,v,A,H);return}if(V&128){g.suspense.move(v,A,H);return}if(V&64){D.move(g,v,A,fe);return}if(D===He){r(x,v,A);for(let ae=0;ae<G.length;ae++)Xe(G[ae],v,A,H);r(g.anchor,v,A);return}if(D===Si){z(g,v,A);return}if(H!==2&&V&1&&B)if(H===0)B.beforeEnter(x),r(x,v,A),Ht(()=>B.enter(x),F);else{const{leave:ae,delayLeave:he,afterLeave:Se}=B,Me=()=>{g.ctx.isUnmounted?s(x):r(x,v,A)},Ke=()=>{x._isLeaving&&x[En](!0),ae(x,()=>{Me(),Se&&Se()})};he?he(x,Me,Ke):Ke()}else r(x,v,A)},Ze=(g,v,A,H=!1,F=!1)=>{const{type:x,props:D,ref:B,children:G,dynamicChildren:V,shapeFlag:be,patchFlag:ae,dirs:he,cacheIndex:Se}=g;if(ae===-2&&(F=!1),B!=null&&(Xn(),js(B,null,A,g,!0),Zn()),Se!=null&&(v.renderCache[Se]=void 0),be&256){v.ctx.deactivate(g);return}const Me=be&1&&he,Ke=!as(g);let Pe;if(Ke&&(Pe=D&&D.onVnodeBeforeUnmount)&&In(Pe,v,g),be&6)Ge(g.component,A,H);else{if(be&128){g.suspense.unmount(A,H);return}Me&&Pr(g,null,v,"beforeUnmount"),be&64?g.type.remove(g,v,A,fe,H):V&&!V.hasOnce&&(x!==He||ae>0&&ae&64)?et(V,v,A,!1,!0):(x===He&&ae&384||!F&&be&16)&&et(G,v,A),H&&ht(g)}(Ke&&(Pe=D&&D.onVnodeUnmounted)||Me)&&Ht(()=>{Pe&&In(Pe,v,g),Me&&Pr(g,null,v,"unmounted")},A)},ht=g=>{const{type:v,el:A,anchor:H,transition:F}=g;if(v===He){Rt(A,H);return}if(v===Si){j(g);return}const x=()=>{s(A),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:D,delayLeave:B}=F,G=()=>D(A,x);B?B(g.el,x,G):G()}else x()},Rt=(g,v)=>{let A;for(;g!==v;)A=h(g),s(g),g=A;s(v)},Ge=(g,v,A)=>{const{bum:H,scope:F,job:x,subTree:D,um:B,m:G,a:V}=g;jl(G),jl(V),H&&To(H),F.stop(),x&&(x.flags|=8,Ze(D,g,v,A)),B&&Ht(B,v),Ht(()=>{g.isUnmounted=!0},v)},et=(g,v,A,H=!1,F=!1,x=0)=>{for(let D=x;D<g.length;D++)Ze(g[D],v,A,H,F)},W=g=>{if(g.shapeFlag&6)return W(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=h(g.anchor||g.el),A=v&&v[ed];return A?h(A):v};let me=!1;const ie=(g,v,A)=>{let H;g==null?v._vnode&&(Ze(v._vnode,null,null,!0),H=v._vnode.component):I(v._vnode||null,g,v,null,null,null,A),v._vnode=g,me||(me=!0,Tl(H),Ju(),me=!1)},fe={p:I,um:Ze,m:Xe,r:ht,mt:Be,mc:Ie,pc:$e,pbc:ee,n:W,o:e};return{render:ie,hydrate:void 0,createApp:gp(ie)}}function Ii({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 Mr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function qa(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]=qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&qa(i,a)),a.type===ii&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Op(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<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 Sd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Sd(t)}function jl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ed(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ed(t.subTree):null}const Cd=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Fh(e)}const He=Symbol.for("v-fgt"),ii=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Si=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function $p(){Us.pop(),an=Us[Us.length-1]||null}let Ks=1;function Bo(e,t=!1){Ks+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Ad(e){return e.dynamicChildren=Ks>0?an||ss:null,$p(),Ks>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Ad(m(e,t,n,r,s,o,!0))}function yt(e,t,n,r,s){return Ad(Ce(e,t,n,r,s,!0))}function Js(e){return e?e.__v_isVNode===!0:!1}function jr(e,t){return e.type===t.type&&e.key===t.key}const Rd=({key:e})=>e??null,Eo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ct(e)||qt(e)||ze(e)?{i:Ut,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Rd(t),ref:t&&Eo(t),scopeId:Qu,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:Ut};return a?(Ga(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Ct(n)?8:16),Ks>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ce=Dp;function Dp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===ud)&&(e=Wt),Js(e)){const a=kr(e,t,!0);return n&&Ga(a,n),Ks>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(zp(e)&&(e=e.__vccOpts),t){t=Lp(t);let{class:a,style:l}=t;a&&!Ct(a)&&(t.class=gt(a)),ft(l)&&(Ha(l)&&!Le(l)&&(l=$t({},l)),t.style=zr(l))}const i=Ct(e)?1:Cd(e)?128:td(e)?64:ft(e)?4:ze(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Lp(e){return e?Ha(e)||wd(e)?$t({},e):e:null}function kr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?xd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Rd(u),ref:t&&t.ref?n&&o?Le(o)?o.concat(Eo(t)):[o,Eo(t)]:Eo(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!==He?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&&kr(e.ssContent),ssFallback:e.ssFallback&&kr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Gs(c,l.clone(c)),c}function ca(e=" ",t=0){return Ce(ii,null,e,t)}function se(e="",t=!1){return t?(w(),yt(Wt,null,e)):Ce(Wt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ce(Wt):Le(e)?Ce(He,null,e.slice()):Js(e)?qn(e):Ce(ii,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:kr(e)}function Ga(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),Ga(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!wd(t)?t._ctx=Ut:s===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ze(t)?(t={default:t,_ctx:Ut},n=32):(t=String(t),r&64?(n=16,t=[ca(t)]):n=8);e.children=t,e.shapeFlag|=n}function xd(...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=gt([t.class,r.class]));else if(s==="style")t.style=zr([t.style,r.style]);else if(Jo(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 In(e,t,n,r=null){wn(e,t,7,[n,r])}const jp=pd();let Bp=0;function Up(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||jp,o={uid:Bp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dh(!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:_d(r,s),emitsOptions:md(r,s),emit:null,emitted:null,propsDefaults:bt,inheritAttrs:r.inheritAttrs,ctx:bt,data:bt,props:bt,attrs:bt,slots:bt,refs:bt,setupState:bt,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=yp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const Ka=()=>zt||Ut;let Uo,ua;{const e=Xo(),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)}};Uo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),ua=t("__VUE_SSR_SETTERS__",n=>Ys=n)}const oo=e=>{const t=zt;return Uo(e),e.scope.on(),()=>{e.scope.off(),Uo(t)}},Bl=()=>{zt&&zt.scope.off(),Uo(null)};function Pd(e){return e.vnode.shapeFlag&4}let Ys=!1;function Fp(e,t=!1,n=!1){t&&ua(t);const{props:r,children:s}=e.vnode,o=Pd(e);Ip(e,r,o,t),Ap(e,s,n||t);const i=o?Hp(e,t):void 0;return t&&ua(!1),i}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ap);const{setup:r}=n;if(r){Xn();const s=e.setupContext=r.length>1?Od(e):null,o=oo(e),i=so(r,e,0,[e.props,s]),a=Tu(i);if(Zn(),o(),(a||e.sp)&&!as(e)&&ld(e),a){if(i.then(Bl,Bl),t)return i.then(l=>{Ul(e,l)}).catch(l=>{ti(l,e,0)});e.asyncDep=i}else Ul(e,i)}else Md(e)}function Ul(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=qu(t)),Md(e)}function Md(e,t,n){const r=e.type;e.render||(e.render=r.render||On);{const s=oo(e);Xn();try{up(e)}finally{Zn(),s()}}}const Vp={get(e,t){return Vt(e,"get",""),e[t]}};function Od(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Vp),slots:e.slots,emit:e.emit,expose:t}}function ai(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(qu(Ph(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function Wp(e,t=!0){return ze(e)?e.displayName||e.name:e.name||t&&e.__name}function zp(e){return ze(e)&&"__vccOpts"in e}const pe=(e,t)=>Dh(e,t,Ys);function Ja(e,t,n){try{Bo(-1);const r=arguments.length;return r===2?ft(t)&&!Le(t)?Js(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Js(n)&&(n=[n]),Ce(e,t,n))}finally{Bo(1)}}const qp="3.5.30";/**
13
+ **/function ro(e,t,n,r){try{return r?e(...r):e()}catch(s){ei(s,t,n)}}function wn(e,t,n,r){if(ze(e)){const s=ro(e,t,n,r);return s&&_u(s)&&s.catch(o=>{ei(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(wn(e[o],t,n,r));return s}}function ei(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||bt;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,u)===!1)return}a=a.parent}if(o){Xn(),ro(o,null,10,[e,l,u]),Zn();return}}Lh(e,n,s,r,i)}function Lh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let Sn=-1;const is=[];let pr=null,ts=0;const zu=Promise.resolve();let Mo=null;function tn(e){const t=Mo||zu;return e?t.then(this?e.bind(this):e):t}function jh(e){let t=Sn+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=zs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Fa(e){if(!(e.flags&1)){const t=zs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=zs(n)?Jt.push(e):Jt.splice(jh(t),0,e),e.flags|=1,qu()}}function qu(){Mo||(Mo=zu.then(Ku))}function Bh(e){Le(e)?is.push(...e):pr&&e.id===-1?pr.splice(ts+1,0,e):e.flags&1||(is.push(e),e.flags|=1),qu()}function kl(e,t,n=Sn+1){for(;n<Jt.length;n++){const r=Jt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Jt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Gu(e){if(is.length){const t=[...new Set(is)].sort((n,r)=>zs(n)-zs(r));if(is.length=0,pr){pr.push(...t);return}for(pr=t,ts=0;ts<pr.length;ts++){const n=pr[ts];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pr=null,ts=0}}const zs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ku(e){try{for(Sn=0;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ro(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&(t.flags&=-2)}Sn=-1,Jt.length=0,Gu(),Mo=null,(Jt.length||is.length)&&Ku()}}let Ut=null,Ju=null;function No(e){const t=Ut;return Ut=e,Ju=e&&e.type.__scopeId||null,t}function pt(e,t=Ut,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&jo(-1);const o=No(t);let i;try{i=e(...s)}finally{No(o),r._d&&jo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Ut===null)return e;const n=ii(Ut),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=bt]=t[s];o&&(ze(o)&&(o={mounted:o,updated:o}),o.deep&&Kn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function xr(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&&(Xn(),wn(l,n,8,[e.el,a,e,t]),Zn())}}function To(e,t){if(zt){let n=zt.provides;const r=zt.parent&&zt.parent.provides;r===n&&(n=zt.provides=Object.create(r)),n[e]=t}}function mn(e,t,n=!1){const r=qa();if(r||ls){let s=ls?ls._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&&ze(t)?t.call(r&&r.proxy):t}}const Uh=Symbol.for("v-scx"),Fh=()=>mn(Uh);function mt(e,t,n){return Yu(e,t,n)}function Yu(e,t,n=bt){const{immediate:r,deep:s,flush:o,once:i}=n,a=$t({},n),l=t&&r||!t&&o!=="post";let u;if(Js){if(o==="sync"){const _=Fh();u=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=Mn,_.resume=Mn,_.pause=Mn,_}}const c=zt;a.call=(_,N,I)=>wn(_,c,N,I);let f=!1;o==="post"?a.scheduler=_=>{Ht(_,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,N)=>{N?_():Fa(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const p=Dh(e,t,a);return Js&&(u?u.push(p):l&&p()),p}function Hh(e,t,n){const r=this.proxy,s=Ct(e)?e.includes(".")?Qu(r,e):()=>r[e]:e.bind(r,r);let o;ze(t)?o=t:(o=t.handler,n=t);const i=so(this),a=Yu(s,o.bind(r),n);return i(),a}function Qu(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 Xu=Symbol("_vte"),Zu=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Tl=e=>e&&(e.defer||e.defer===""),Il=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Sl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Zi=(e,t)=>{const n=e&&e.to;return Ct(n)?t?t(n):null:n},ed={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:p,o:{insert:_,querySelector:N,createText:I,createComment:M}}=u,Y=Ls(t.props);let{shapeFlag:j,children:q,dynamicChildren:B}=t;if(e==null){const oe=t.el=I(""),de=t.anchor=I("");_(oe,n,r),_(de,n,r);const ve=(re,ee)=>{j&16&&c(q,re,ee,s,o,i,a,l)},Ie=()=>{const re=t.target=Zi(t.props,N),ee=ea(re,t,I,_);re&&(i!=="svg"&&Il(re)?i="svg":i!=="mathml"&&Sl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),Y||(ve(re,ee),Io(t,!1)))};Y&&(ve(n,de),Io(t,!0)),Tl(t.props)?(t.el.__isMounted=!1,Ht(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(Tl(t.props)&&e.el.__isMounted===!1){Ht(()=>{ed.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ls(e.props),re=Ie?n:de,ee=Ie?oe:ve;if(i==="svg"||Il(de)?i="svg":(i==="mathml"||Sl(de))&&(i="mathml"),B?(p(e.dynamicChildren,B,re,s,o,i,a),Wa(e,t,!0)):l||f(e,t,re,ee,s,o,i,a,!1),Y)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):go(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=Zi(t.props,N);ye&&go(t,ye,null,u,0)}else Ie&&go(t,de,ve,u,1);Io(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const _=o||!Ls(p);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,_,!!I.dynamicChildren)}}},move:go,hydrate:Vh};function go(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:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ls(c))&&l&16)for(let p=0;p<u.length;p++)s(u[p],t,n,2);f&&r(a,t,n)}function Vh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function p(M,Y){let j=Y;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,M._lpa=t.targetAnchor&&i(t.targetAnchor);break}}j=i(j)}}function _(M,Y){Y.anchor=f(i(M),Y,a(M),n,r,s,o)}const N=t.target=Zi(t.props,l),I=Ls(t.props);if(N){const M=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(_(e,t),p(N,M),t.targetAnchor||ea(N,t,c,u,a(e)===N?e:null)):(t.anchor=i(e),p(N,M),t.targetAnchor||ea(N,t,c,u),f(M&&i(M),t,N,n,r,s,o))),Io(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const $o=ed;function Io(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 ea(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Xu]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function Wh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ir(()=>{e.isMounted=!0}),ar(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],td={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},nd=e=>{const t=e.subTree;return t.component?nd(t.component):t},zh={name:"BaseTransition",props:td,setup(e,{slots:t}){const n=qa(),r=Wh();return()=>{const s=t.default&&od(t.default(),!0);if(!s||!s.length)return;const o=rd(s),i=ct(e),{mode:a}=i;if(r.isLeaving)return bi(o);const l=El(o);if(!l)return bi(o);let u=ta(l,i,r,n,f=>u=f);l.type!==Wt&&qs(l,u);let c=n.subTree&&El(n.subTree);if(c&&c.type!==Wt&&!jr(c,l)&&nd(n).type!==Wt){let f=ta(c,i,r,n);if(qs(c,f),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},bi(o);a==="in-out"&&l.type!==Wt?f.delayLeave=(p,_,N)=>{const I=sd(r,c);I[String(c.key)]=c,p[En]=()=>{_(),p[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{N(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function rd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const qh=zh;function sd(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 ta(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:_,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:M,onAppear:Y,onAfterAppear:j,onAppearCancelled:q}=t,B=String(e.key),oe=sd(n,e),de=(re,ee)=>{re&&wn(re,r,9,ee)},ve=(re,ee)=>{const ye=ee[1];de(re,ee),Le(re)?re.every(te=>te.length<=1)&&ye():re.length<=1&&ye()},Ie={mode:i,persisted:a,beforeEnter(re){let ee=l;if(!n.isMounted)if(o)ee=M||l;else return;re[En]&&re[En](!0);const ye=oe[B];ye&&jr(e,ye)&&ye.el[En]&&ye.el[En](),de(ee,[re])},enter(re){if(oe[B]===e)return;let ee=u,ye=c,te=f;if(!n.isMounted)if(o)ee=Y||u,ye=j||c,te=q||f;else return;let je=!1;re[As]=Qe=>{je||(je=!0,Qe?de(te,[re]):de(ye,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[As]=void 0)};const Be=re[As].bind(null,!1);ee?ve(ee,[re,Be]):Be()},leave(re,ee){const ye=String(e.key);if(re[As]&&re[As](!0),n.isUnmounting)return ee();de(p,[re]);let te=!1;re[En]=Be=>{te||(te=!0,ee(),Be?de(I,[re]):de(N,[re]),re[En]=void 0,oe[ye]===e&&delete oe[ye])};const je=re[En].bind(null,!1);oe[ye]=e,_?ve(_,[re,je]):je()},clone(re){const ee=ta(re,t,n,r,s);return s&&s(ee),ee}};return Ie}function bi(e){if(ti(e))return e=kr(e),e.children=null,e}function El(e){if(!ti(e))return Zu(e.type)&&e.children?rd(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&&ze(n.default))return n.default()}}function qs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qs(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 od(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===He?(i.patchFlag&128&&s++,r=r.concat(od(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?kr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return ze(e)?$t({name:e.name},t,{setup:e}):e}function id(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Cl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Do=new WeakMap;function js(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,M)=>js(I,t&&(Le(t)?t[M]:t),n,r,s));return}if(as(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ii(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===bt?a.refs={}:a.refs,f=a.setupState,p=ct(f),_=f===bt?wu:I=>Cl(c,I)?!1:dt(p,I),N=(I,M)=>!(M&&Cl(c,M));if(u!=null&&u!==l){if(Al(t),Ct(u))c[u]=null,_(u)&&(f[u]=null);else if(qt(u)){const I=t;N(u,I.k)&&(u.value=null),I.k&&(c[I.k]=null)}}if(ze(l))ro(l,a,12,[i,c]);else{const I=Ct(l),M=qt(l);if(I||M){const Y=()=>{if(e.f){const j=I?_(l)?f[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Le(j)&&Pa(j,o);else if(Le(j))j.includes(o)||j.push(o);else if(I)c[l]=[o],_(l)&&(f[l]=c[l]);else{const q=[o];N(l,e.k)&&(l.value=q),e.k&&(c[e.k]=q)}}else I?(c[l]=i,_(l)&&(f[l]=i)):M&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const j=()=>{Y(),Do.delete(e)};j.id=-1,Do.set(e,j),Ht(j,n)}else Al(e),Y()}}}function Al(e){const t=Do.get(e);t&&(t.flags|=8,Do.delete(e))}Qo().requestIdleCallback;Qo().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,ti=e=>e.type.__isKeepAlive;function Gh(e,t){ad(e,"a",t)}function Kh(e,t){ad(e,"da",t)}function ad(e,t,n=zt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ni(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ti(s.parent.vnode)&&Jh(r,t,n,s),s=s.parent}}function Jh(e,t,n,r){const s=ni(t,e,r,!0);ri(()=>{Pa(r[t],s)},n)}function ni(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Xn();const a=so(n),l=wn(t,n,e,i);return a(),Zn(),l});return r?s.unshift(o):s.push(o),o}}const or=e=>(t,n=zt)=>{(!Js||e==="sp")&&ni(e,(...r)=>t(...r),n)},Yh=or("bm"),ir=or("m"),Qh=or("bu"),Xh=or("u"),ar=or("bum"),ri=or("um"),Zh=or("sp"),ep=or("rtg"),tp=or("rtc");function np(e,t=zt){ni("ec",e,t)}const rp="components",ld=Symbol.for("v-ndc");function na(e){return Ct(e)?sp(rp,e,!1)||e:e||ld}function sp(e,t,n=!0,r=!1){const s=Ut||zt;if(s){const o=s.type;{const a=Hp(o,!1);if(a&&(a===t||a===Qt(t)||a===Yo(Qt(t))))return o}const i=Rl(s[e]||o[e],t)||Rl(s.appContext[e],t);return!i&&r?o:i}}function Rl(e,t){return e&&(e[t]||e[Qt(t)]||e[Yo(Qt(t))])}function Et(e,t,n,r){let s;const o=n,i=Le(e);if(i||Ct(e)){const a=i&&Vr(e);let l=!1,u=!1;a&&(l=!dn(e),u=er(e),e=Xo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?hs(yn(e[c])):yn(e[c]):e[c],c,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(ft(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,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function On(e,t,n={},r,s){if(Ut.ce||Ut.parent&&as(Ut.parent)&&Ut.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),yt(He,null,[Ce("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&cd(o(n)),a=n.key||i&&i.key,l=yt(He,{key:(a&&!vn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function cd(e){return e.some(t=>Ks(t)?!(t.type===Wt||t.type===He&&!cd(t.children)):!0)?e:null}const ra=e=>e?Rd(e)?ii(e):ra(e.parent):null,Bs=$t(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=>ra(e.parent),$root:e=>ra(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>dd(e),$forceUpdate:e=>e.f||(e.f=()=>{Fa(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Hh.bind(e)}),_i=(e,t)=>e!==bt&&!e.__isScriptSetup&&dt(e,t),op={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 p=i[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(_i(r,t))return i[t]=1,r[t];if(s!==bt&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==bt&&dt(n,t))return i[t]=4,n[t];sa&&(i[t]=0)}}const u=Bs[t];let c,f;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==bt&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return _i(s,t)?(s[t]=n,!0):r!==bt&&dt(r,t)?(r[t]=n,!0):dt(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!==bt&&a[0]!=="$"&&dt(e,a)||_i(t,a)||dt(o,a)||dt(r,a)||dt(Bs,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ip(){return ap().slots}function ap(e){const t=qa();return t.setupContext||(t.setupContext=xd(t))}function Pl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let sa=!0;function lp(e){const t=dd(e),n=e.proxy,r=e.ctx;sa=!1,t.beforeCreate&&xl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:_,updated:N,activated:I,deactivated:M,beforeDestroy:Y,beforeUnmount:j,destroyed:q,unmounted:B,render:oe,renderTracked:de,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:ee,inheritAttrs:ye,components:te,directives:je,filters:Be}=t;if(u&&cp(u,r,null),i)for(const Te in i){const $e=i[Te];ze($e)&&(r[Te]=$e.bind(n))}if(s){const Te=s.call(n,n);ft(Te)&&(e.data=Zo(Te))}if(sa=!0,o)for(const Te in o){const $e=o[Te],It=ze($e)?$e.bind(n,n):ze($e.get)?$e.get.bind(n,n):Mn,nt=!ze($e)&&ze($e.set)?$e.set.bind(n):Mn,Xe=pe({get:It,set:nt});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:Ze=>Xe.value=Ze})}if(a)for(const Te in a)ud(a[Te],r,n,Te);if(l){const Te=ze(l)?l.call(n):l;Reflect.ownKeys(Te).forEach($e=>{To($e,Te[$e])})}c&&xl(c,e,"c");function Re(Te,$e){Le($e)?$e.forEach(It=>Te(It.bind(n))):$e&&Te($e.bind(n))}if(Re(Yh,f),Re(ir,p),Re(Qh,_),Re(Xh,N),Re(Gh,I),Re(Kh,M),Re(np,Ie),Re(tp,de),Re(ep,ve),Re(ar,j),Re(ri,B),Re(Zh,re),Le(ee))if(ee.length){const Te=e.exposed||(e.exposed={});ee.forEach($e=>{Object.defineProperty(Te,$e,{get:()=>n[$e],set:It=>n[$e]=It,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===Mn&&(e.render=oe),ye!=null&&(e.inheritAttrs=ye),te&&(e.components=te),je&&(e.directives=je),re&&id(e)}function cp(e,t,n=Mn){Le(e)&&(e=oa(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=mn(s.from||r,s.default,!0):o=mn(s.from||r):o=mn(s),qt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function xl(e,t,n){wn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ud(e,t,n,r){let s=r.includes(".")?Qu(n,r):()=>n[r];if(Ct(e)){const o=t[e];ze(o)&&mt(s,o)}else if(ze(e))mt(s,e.bind(n));else if(ft(e))if(Le(e))e.forEach(o=>ud(o,t,n,r));else{const o=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(o)&&mt(s,o,e)}}function dd(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(u=>Lo(l,u,i,!0)),Lo(l,t,i)),ft(t)&&o.set(t,l),l}function Lo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Lo(e,o,n,!0),s&&s.forEach(i=>Lo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=up[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const up={data:Ol,props:Ml,emits:Ml,methods:Ms,computed:Ms,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:Ms,directives:Ms,watch:fp,provide:Ol,inject:dp};function Ol(e,t){return t?e?function(){return $t(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function dp(e,t){return Ms(oa(e),oa(t))}function oa(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gt(e,t){return e?[...new Set([].concat(e,t))]:t}function Ms(e,t){return e?$t(Object.create(null),e,t):t}function Ml(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:$t(Object.create(null),Pl(e),Pl(t??{})):t}function fp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function fd(){return{app:null,config:{isNativeTag:wu,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 hp=0;function pp(e,t){return function(r,s=null){ze(r)||(r=$t({},r)),s!=null&&!ft(s)&&(s=null);const o=fd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:hp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Wp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&ze(c.install)?(i.add(c),c.install(u,...f)):ze(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,p){if(!l){const _=u._ceVNode||Ce(r,s);return _.appContext=o,p===!0?p="svg":p===!1&&(p=void 0),e(_,c,p),l=!0,u._container=c,c.__vue_app__=u,ii(_.component)}},onUnmount(c){a.push(c)},unmount(){l&&(wn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=ls;ls=u;try{return c()}finally{ls=f}}};return u}}let ls=null;const mp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Qt(t)}Modifiers`]||e[`${Tr(t)}Modifiers`];function gp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||bt;let s=n;const o=t.startsWith("update:"),i=o&&mp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Ct(c)?c.trim():c)),i.number&&(s=n.map(Oa)));let a,l=r[a=mi(t)]||r[a=mi(Qt(t))];!l&&o&&(l=r[a=mi(Tr(t))]),l&&wn(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wn(u,e,6,s)}}const vp=new WeakMap;function hd(e,t,n=!1){const r=n?vp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!ze(e)){const l=u=>{const c=hd(u,t,!0);c&&(a=!0,$t(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ft(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):$t(i,o),ft(e)&&r.set(e,i),i)}function si(e,t){return!e||!Ko(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Tr(t))||dt(e,t))}function Nl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:p,setupState:_,ctx:N,inheritAttrs:I}=e,M=No(e);let Y,j;try{if(n.shapeFlag&4){const B=s||r,oe=B;Y=An(u.call(oe,B,c,f,_,p,N)),j=a}else{const B=t;Y=An(B.length>1?B(f,{attrs:a,slots:i,emit:l}):B(f,null)),j=t.props?a:yp(a)}}catch(B){Us.length=0,ei(B,e,1),Y=Ce(Wt)}let q=Y;if(j&&I!==!1){const B=Object.keys(j),{shapeFlag:oe}=q;B.length&&oe&7&&(o&&B.some(Ra)&&(j=wp(j,o)),q=kr(q,j,!1,!0))}return n.dirs&&(q=kr(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&qs(q,n.transition),Y=q,No(M),Y}const yp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ko(n))&&((t||(t={}))[n]=e[n]);return t},wp=(e,t)=>{const n={};for(const r in e)(!Ra(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function bp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?$l(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const p=c[f];if(pd(i,r,p)&&!si(u,p))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?$l(r,i,u):!0:!!i;return!1}function $l(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(pd(t,e,o)&&!si(n,o))return!0}return!1}function pd(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!Ma(r,s):r!==s}function _p({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 md={},gd=()=>Object.create(md),vd=e=>Object.getPrototypeOf(e)===md;function kp(e,t,n,r=!1){const s={},o=gd();e.propsDefaults=Object.create(null),yd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Hu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Tp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ct(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let p=c[f];if(si(e.emitsOptions,p))continue;const _=t[p];if(l)if(dt(o,p))_!==o[p]&&(o[p]=_,u=!0);else{const N=Qt(p);s[N]=ia(l,a,N,_,e,!1)}else _!==o[p]&&(o[p]=_,u=!0)}}}else{yd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=Tr(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=ia(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Gn(e.attrs,"set","")}function yd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const u=t[l];let c;s&&dt(s,c=Qt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:si(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=ct(n),u=a||bt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=ia(s,l,f,u[f],e,!dt(u,f))}}return i}function ia(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&ze(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=so(s);r=u[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Tr(n))&&(r=!0))}return r}const Ip=new WeakMap;function wd(e,t,n=!1){const r=n?Ip:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!ze(e)){const c=f=>{l=!0;const[p,_]=wd(f,t,!0);$t(i,p),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ft(e)&&r.set(e,ss),ss;if(Le(o))for(let c=0;c<o.length;c++){const f=Qt(o[c]);Dl(f)&&(i[f]=bt)}else if(o)for(const c in o){const f=Qt(c);if(Dl(f)){const p=o[c],_=i[f]=Le(p)||ze(p)?{type:p}:$t({},p),N=_.type;let I=!1,M=!0;if(Le(N))for(let Y=0;Y<N.length;++Y){const j=N[Y],q=ze(j)&&j.name;if(q==="Boolean"){I=!0;break}else q==="String"&&(M=!1)}else I=ze(N)&&N.name==="Boolean";_[0]=I,_[1]=M,(I||dt(_,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Dl(e){return e[0]!=="$"&&!Ns(e)}const Ha=e=>e==="_"||e==="_ctx"||e==="$stable",Va=e=>Le(e)?e.map(An):[An(e)],Sp=(e,t,n)=>{if(t._n)return t;const r=pt((...s)=>Va(t(...s)),n);return r._c=!1,r},bd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Ha(s))continue;const o=e[s];if(ze(o))t[s]=Sp(s,o,r);else if(o!=null){const i=Va(o);t[s]=()=>i}}},_d=(e,t)=>{const n=Va(t);e.slots.default=()=>n},kd=(e,t,n)=>{for(const r in t)(n||!Ha(r))&&(e[r]=t[r])},Ep=(e,t,n)=>{const r=e.slots=gd();if(e.vnode.shapeFlag&32){const s=t._;s?(kd(r,t,n),n&&Iu(r,"_",s,!0)):bd(t,r)}else t&&_d(e,t)},Cp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=bt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:kd(s,t,n):(o=!t.$stable,bd(t,s)),i=t}else t&&(_d(e,t),i={default:1});if(o)for(const a in s)!Ha(a)&&i[a]==null&&delete s[a]},Ht=Op;function Ap(e){return Rp(e)}function Rp(e,t){const n=Qo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:p,setScopeId:_=Mn,insertStaticContent:N}=e,I=(g,v,A,H=null,F=null,P=null,$=void 0,L=null,G=!!v.dynamicChildren)=>{if(g===v)return;g&&!jr(g,v)&&(H=W(g),Ze(g,F,P,!0),g=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null);const{type:V,ref:be,shapeFlag:ae}=v;switch(V){case oi:M(g,v,A,H);break;case Wt:Y(g,v,A,H);break;case Ti:g==null&&j(v,A,H,$);break;case He:te(g,v,A,H,F,P,$,L,G);break;default:ae&1?oe(g,v,A,H,F,P,$,L,G):ae&6?je(g,v,A,H,F,P,$,L,G):(ae&64||ae&128)&&V.process(g,v,A,H,F,P,$,L,G,fe)}be!=null&&F?js(be,g&&g.ref,P,v||g,!v):be==null&&g&&g.ref!=null&&js(g.ref,null,P,g,!0)},M=(g,v,A,H)=>{if(g==null)r(v.el=a(v.children),A,H);else{const F=v.el=g.el;v.children!==g.children&&u(F,v.children)}},Y=(g,v,A,H)=>{g==null?r(v.el=l(v.children||""),A,H):v.el=g.el},j=(g,v,A,H)=>{[g.el,g.anchor]=N(g.children,v,A,H,g.el,g.anchor)},q=({el:g,anchor:v},A,H)=>{let F;for(;g&&g!==v;)F=p(g),r(g,A,H),g=F;r(v,A,H)},B=({el:g,anchor:v})=>{let A;for(;g&&g!==v;)A=p(g),s(g),g=A;s(v)},oe=(g,v,A,H,F,P,$,L,G)=>{if(v.type==="svg"?$="svg":v.type==="math"&&($="mathml"),g==null)de(v,A,H,F,P,$,L,G);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,v,F,P,$,L,G)}finally{V&&V._endPatch()}}},de=(g,v,A,H,F,P,$,L)=>{let G,V;const{props:be,shapeFlag:ae,transition:he,dirs:Se}=g;if(G=g.el=i(g.type,P,be&&be.is,be),ae&8?c(G,g.children):ae&16&&Ie(g.children,G,null,H,F,ki(g,P),$,L),Se&&xr(g,null,H,"created"),ve(G,g,g.scopeId,$,H),be){for(const Ke in be)Ke!=="value"&&!Ns(Ke)&&o(G,Ke,null,be[Ke],P,H);"value"in be&&o(G,"value",null,be.value,P),(V=be.onVnodeBeforeMount)&&In(V,H,g)}Se&&xr(g,null,H,"beforeMount");const Oe=Pp(F,he);Oe&&he.beforeEnter(G),r(G,v,A),((V=be&&be.onVnodeMounted)||Oe||Se)&&Ht(()=>{V&&In(V,H,g),Oe&&he.enter(G),Se&&xr(g,null,H,"mounted")},F)},ve=(g,v,A,H,F)=>{if(A&&_(g,A),H)for(let P=0;P<H.length;P++)_(g,H[P]);if(F){let P=F.subTree;if(v===P||Sd(P.type)&&(P.ssContent===v||P.ssFallback===v)){const $=F.vnode;ve(g,$,$.scopeId,$.slotScopeIds,F.parent)}}},Ie=(g,v,A,H,F,P,$,L,G=0)=>{for(let V=G;V<g.length;V++){const be=g[V]=L?qn(g[V]):An(g[V]);I(null,be,v,A,H,F,P,$,L)}},re=(g,v,A,H,F,P,$)=>{const L=v.el=g.el;let{patchFlag:G,dynamicChildren:V,dirs:be}=v;G|=g.patchFlag&16;const ae=g.props||bt,he=v.props||bt;let Se;if(A&&Or(A,!1),(Se=he.onVnodeBeforeUpdate)&&In(Se,A,v,g),be&&xr(v,g,A,"beforeUpdate"),A&&Or(A,!0),(ae.innerHTML&&he.innerHTML==null||ae.textContent&&he.textContent==null)&&c(L,""),V?ee(g.dynamicChildren,V,L,A,H,ki(v,F),P):$||$e(g,v,L,null,A,H,ki(v,F),P,!1),G>0){if(G&16)ye(L,ae,he,A,F);else if(G&2&&ae.class!==he.class&&o(L,"class",null,he.class,F),G&4&&o(L,"style",ae.style,he.style,F),G&8){const Oe=v.dynamicProps;for(let Ke=0;Ke<Oe.length;Ke++){const xe=Oe[Ke],Ve=ae[xe],_t=he[xe];(_t!==Ve||xe==="value")&&o(L,xe,Ve,_t,F,A)}}G&1&&g.children!==v.children&&c(L,v.children)}else!$&&V==null&&ye(L,ae,he,A,F);((Se=he.onVnodeUpdated)||be)&&Ht(()=>{Se&&In(Se,A,v,g),be&&xr(v,g,A,"updated")},H)},ee=(g,v,A,H,F,P,$)=>{for(let L=0;L<v.length;L++){const G=g[L],V=v[L],be=G.el&&(G.type===He||!jr(G,V)||G.shapeFlag&198)?f(G.el):A;I(G,V,be,null,H,F,P,$,!0)}},ye=(g,v,A,H,F)=>{if(v!==A){if(v!==bt)for(const P in v)!Ns(P)&&!(P in A)&&o(g,P,v[P],null,F,H);for(const P in A){if(Ns(P))continue;const $=A[P],L=v[P];$!==L&&P!=="value"&&o(g,P,L,$,F,H)}"value"in A&&o(g,"value",v.value,A.value,F)}},te=(g,v,A,H,F,P,$,L,G)=>{const V=v.el=g?g.el:a(""),be=v.anchor=g?g.anchor:a("");let{patchFlag:ae,dynamicChildren:he,slotScopeIds:Se}=v;Se&&(L=L?L.concat(Se):Se),g==null?(r(V,A,H),r(be,A,H),Ie(v.children||[],A,be,F,P,$,L,G)):ae>0&&ae&64&&he&&g.dynamicChildren&&g.dynamicChildren.length===he.length?(ee(g.dynamicChildren,he,A,F,P,$,L),(v.key!=null||F&&v===F.subTree)&&Wa(g,v,!0)):$e(g,v,A,be,F,P,$,L,G)},je=(g,v,A,H,F,P,$,L,G)=>{v.slotScopeIds=L,g==null?v.shapeFlag&512?F.ctx.activate(v,A,H,$,G):Be(v,A,H,F,P,$,G):Qe(g,v,G)},Be=(g,v,A,H,F,P,$)=>{const L=g.component=jp(g,H,F);if(ti(g)&&(L.ctx.renderer=fe),Bp(L,!1,$),L.asyncDep){if(F&&F.registerDep(L,Re,$),!g.el){const G=L.subTree=Ce(Wt);Y(null,G,v,A),g.placeholder=G.el}}else Re(L,g,v,A,F,P,$)},Qe=(g,v,A)=>{const H=v.component=g.component;if(bp(g,v,A))if(H.asyncDep&&!H.asyncResolved){Te(H,v,A);return}else H.next=v,H.update();else v.el=g.el,H.vnode=v},Re=(g,v,A,H,F,P,$)=>{const L=()=>{if(g.isMounted){let{next:ae,bu:he,u:Se,parent:Oe,vnode:Ke}=g;{const K=Td(g);if(K){ae&&(ae.el=Ke.el,Te(g,ae,$)),K.asyncDep.then(()=>{Ht(()=>{g.isUnmounted||V()},F)});return}}let xe=ae,Ve;Or(g,!1),ae?(ae.el=Ke.el,Te(g,ae,$)):ae=Ke,he&&ko(he),(Ve=ae.props&&ae.props.onVnodeBeforeUpdate)&&In(Ve,Oe,ae,Ke),Or(g,!0);const _t=Nl(g),U=g.subTree;g.subTree=_t,I(U,_t,f(U.el),W(U),g,F,P),ae.el=_t.el,xe===null&&_p(g,_t.el),Se&&Ht(Se,F),(Ve=ae.props&&ae.props.onVnodeUpdated)&&Ht(()=>In(Ve,Oe,ae,Ke),F)}else{let ae;const{el:he,props:Se}=v,{bm:Oe,m:Ke,parent:xe,root:Ve,type:_t}=g,U=as(v);Or(g,!1),Oe&&ko(Oe),!U&&(ae=Se&&Se.onVnodeBeforeMount)&&In(ae,xe,v),Or(g,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(_t,g.parent?g.parent.type:void 0);const K=g.subTree=Nl(g);I(null,K,A,H,g,F,P),v.el=K.el}if(Ke&&Ht(Ke,F),!U&&(ae=Se&&Se.onVnodeMounted)){const K=v;Ht(()=>In(ae,xe,K),F)}(v.shapeFlag&256||xe&&as(xe.vnode)&&xe.vnode.shapeFlag&256)&&g.a&&Ht(g.a,F),g.isMounted=!0,v=A=H=null}};g.scope.on();const G=g.effect=new Au(L);g.scope.off();const V=g.update=G.run.bind(G),be=g.job=G.runIfDirty.bind(G);be.i=g,be.id=g.uid,G.scheduler=()=>Fa(be),Or(g,!0),V()},Te=(g,v,A)=>{v.component=g;const H=g.vnode.props;g.vnode=v,g.next=null,Tp(g,v.props,H,A),Cp(g,v.children,A),Xn(),kl(g),Zn()},$e=(g,v,A,H,F,P,$,L,G=!1)=>{const V=g&&g.children,be=g?g.shapeFlag:0,ae=v.children,{patchFlag:he,shapeFlag:Se}=v;if(he>0){if(he&128){nt(V,ae,A,H,F,P,$,L,G);return}else if(he&256){It(V,ae,A,H,F,P,$,L,G);return}}Se&8?(be&16&&et(V,F,P),ae!==V&&c(A,ae)):be&16?Se&16?nt(V,ae,A,H,F,P,$,L,G):et(V,F,P,!0):(be&8&&c(A,""),Se&16&&Ie(ae,A,H,F,P,$,L,G))},It=(g,v,A,H,F,P,$,L,G)=>{g=g||ss,v=v||ss;const V=g.length,be=v.length,ae=Math.min(V,be);let he;for(he=0;he<ae;he++){const Se=v[he]=G?qn(v[he]):An(v[he]);I(g[he],Se,A,null,F,P,$,L,G)}V>be?et(g,F,P,!0,!1,ae):Ie(v,A,H,F,P,$,L,G,ae)},nt=(g,v,A,H,F,P,$,L,G)=>{let V=0;const be=v.length;let ae=g.length-1,he=be-1;for(;V<=ae&&V<=he;){const Se=g[V],Oe=v[V]=G?qn(v[V]):An(v[V]);if(jr(Se,Oe))I(Se,Oe,A,null,F,P,$,L,G);else break;V++}for(;V<=ae&&V<=he;){const Se=g[ae],Oe=v[he]=G?qn(v[he]):An(v[he]);if(jr(Se,Oe))I(Se,Oe,A,null,F,P,$,L,G);else break;ae--,he--}if(V>ae){if(V<=he){const Se=he+1,Oe=Se<be?v[Se].el:H;for(;V<=he;)I(null,v[V]=G?qn(v[V]):An(v[V]),A,Oe,F,P,$,L,G),V++}}else if(V>he)for(;V<=ae;)Ze(g[V],F,P,!0),V++;else{const Se=V,Oe=V,Ke=new Map;for(V=Oe;V<=he;V++){const it=v[V]=G?qn(v[V]):An(v[V]);it.key!=null&&Ke.set(it.key,V)}let xe,Ve=0;const _t=he-Oe+1;let U=!1,K=0;const ne=new Array(_t);for(V=0;V<_t;V++)ne[V]=0;for(V=Se;V<=ae;V++){const it=g[V];if(Ve>=_t){Ze(it,F,P,!0);continue}let kt;if(it.key!=null)kt=Ke.get(it.key);else for(xe=Oe;xe<=he;xe++)if(ne[xe-Oe]===0&&jr(it,v[xe])){kt=xe;break}kt===void 0?Ze(it,F,P,!0):(ne[kt-Oe]=V+1,kt>=K?K=kt:U=!0,I(it,v[kt],A,null,F,P,$,L,G),Ve++)}const Je=U?xp(ne):ss;for(xe=Je.length-1,V=_t-1;V>=0;V--){const it=Oe+V,kt=v[it],Pt=v[it+1],ln=it+1<be?Pt.el||Id(Pt):H;ne[V]===0?I(null,kt,A,ln,F,P,$,L,G):U&&(xe<0||V!==Je[xe]?Xe(kt,A,ln,2):xe--)}}},Xe=(g,v,A,H,F=null)=>{const{el:P,type:$,transition:L,children:G,shapeFlag:V}=g;if(V&6){Xe(g.component.subTree,v,A,H);return}if(V&128){g.suspense.move(v,A,H);return}if(V&64){$.move(g,v,A,fe);return}if($===He){r(P,v,A);for(let ae=0;ae<G.length;ae++)Xe(G[ae],v,A,H);r(g.anchor,v,A);return}if($===Ti){q(g,v,A);return}if(H!==2&&V&1&&L)if(H===0)L.beforeEnter(P),r(P,v,A),Ht(()=>L.enter(P),F);else{const{leave:ae,delayLeave:he,afterLeave:Se}=L,Oe=()=>{g.ctx.isUnmounted?s(P):r(P,v,A)},Ke=()=>{P._isLeaving&&P[En](!0),ae(P,()=>{Oe(),Se&&Se()})};he?he(P,Oe,Ke):Ke()}else r(P,v,A)},Ze=(g,v,A,H=!1,F=!1)=>{const{type:P,props:$,ref:L,children:G,dynamicChildren:V,shapeFlag:be,patchFlag:ae,dirs:he,cacheIndex:Se}=g;if(ae===-2&&(F=!1),L!=null&&(Xn(),js(L,null,A,g,!0),Zn()),Se!=null&&(v.renderCache[Se]=void 0),be&256){v.ctx.deactivate(g);return}const Oe=be&1&&he,Ke=!as(g);let xe;if(Ke&&(xe=$&&$.onVnodeBeforeUnmount)&&In(xe,v,g),be&6)Ge(g.component,A,H);else{if(be&128){g.suspense.unmount(A,H);return}Oe&&xr(g,null,v,"beforeUnmount"),be&64?g.type.remove(g,v,A,fe,H):V&&!V.hasOnce&&(P!==He||ae>0&&ae&64)?et(V,v,A,!1,!0):(P===He&&ae&384||!F&&be&16)&&et(G,v,A),H&&ht(g)}(Ke&&(xe=$&&$.onVnodeUnmounted)||Oe)&&Ht(()=>{xe&&In(xe,v,g),Oe&&xr(g,null,v,"unmounted")},A)},ht=g=>{const{type:v,el:A,anchor:H,transition:F}=g;if(v===He){Rt(A,H);return}if(v===Ti){B(g);return}const P=()=>{s(A),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:$,delayLeave:L}=F,G=()=>$(A,P);L?L(g.el,P,G):G()}else P()},Rt=(g,v)=>{let A;for(;g!==v;)A=p(g),s(g),g=A;s(v)},Ge=(g,v,A)=>{const{bum:H,scope:F,job:P,subTree:$,um:L,m:G,a:V}=g;Ll(G),Ll(V),H&&ko(H),F.stop(),P&&(P.flags|=8,Ze($,g,v,A)),L&&Ht(L,v),Ht(()=>{g.isUnmounted=!0},v)},et=(g,v,A,H=!1,F=!1,P=0)=>{for(let $=P;$<g.length;$++)Ze(g[$],v,A,H,F)},W=g=>{if(g.shapeFlag&6)return W(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=p(g.anchor||g.el),A=v&&v[Xu];return A?p(A):v};let me=!1;const ie=(g,v,A)=>{let H;g==null?v._vnode&&(Ze(v._vnode,null,null,!0),H=v._vnode.component):I(v._vnode||null,g,v,null,null,null,A),v._vnode=g,me||(me=!0,kl(H),Gu(),me=!1)},fe={p:I,um:Ze,m:Xe,r:ht,mt:Be,mc:Ie,pc:$e,pbc:ee,n:W,o:e};return{render:ie,hydrate:void 0,createApp:pp(ie)}}function ki({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Or({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Pp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wa(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]=qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Wa(i,a)),a.type===oi&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function xp(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<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 Td(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Td(t)}function Ll(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Id(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Id(t.subTree):null}const Sd=e=>e.__isSuspense;function Op(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Bh(e)}const He=Symbol.for("v-fgt"),oi=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Ti=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function Mp(){Us.pop(),an=Us[Us.length-1]||null}let Gs=1;function jo(e,t=!1){Gs+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Ed(e){return e.dynamicChildren=Gs>0?an||ss:null,Mp(),Gs>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Ed(m(e,t,n,r,s,o,!0))}function yt(e,t,n,r,s){return Ed(Ce(e,t,n,r,s,!0))}function Ks(e){return e?e.__v_isVNode===!0:!1}function jr(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,So=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ct(e)||qt(e)||ze(e)?{i:Ut,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&So(t),scopeId:Ju,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:Ut};return a?(za(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Ct(n)?8:16),Gs>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ce=Np;function Np(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===ld)&&(e=Wt),Ks(e)){const a=kr(e,t,!0);return n&&za(a,n),Gs>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(Vp(e)&&(e=e.__vccOpts),t){t=$p(t);let{class:a,style:l}=t;a&&!Ct(a)&&(t.class=gt(a)),ft(l)&&(Ua(l)&&!Le(l)&&(l=$t({},l)),t.style=zr(l))}const i=Ct(e)?1:Sd(e)?128:Zu(e)?64:ft(e)?4:ze(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function $p(e){return e?Ua(e)||vd(e)?$t({},e):e:null}function kr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?Ad(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Cd(u),ref:t&&t.ref?n&&o?Le(o)?o.concat(So(t)):[o,So(t)]:So(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!==He?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&&kr(e.ssContent),ssFallback:e.ssFallback&&kr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&qs(c,l.clone(c)),c}function aa(e=" ",t=0){return Ce(oi,null,e,t)}function se(e="",t=!1){return t?(w(),yt(Wt,null,e)):Ce(Wt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ce(Wt):Le(e)?Ce(He,null,e.slice()):Ks(e)?qn(e):Ce(oi,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:kr(e)}function za(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),za(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!vd(t)?t._ctx=Ut:s===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ze(t)?(t={default:t,_ctx:Ut},n=32):(t=String(t),r&64?(n=16,t=[aa(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ad(...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=gt([t.class,r.class]));else if(s==="style")t.style=zr([t.style,r.style]);else if(Ko(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 In(e,t,n,r=null){wn(e,t,7,[n,r])}const Dp=fd();let Lp=0;function jp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Dp,o={uid:Lp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ch(!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:wd(r,s),emitsOptions:hd(r,s),emit:null,emitted:null,propsDefaults:bt,inheritAttrs:r.inheritAttrs,ctx:bt,data:bt,props:bt,attrs:bt,slots:bt,refs:bt,setupState:bt,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=gp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const qa=()=>zt||Ut;let Bo,la;{const e=Qo(),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)}};Bo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),la=t("__VUE_SSR_SETTERS__",n=>Js=n)}const so=e=>{const t=zt;return Bo(e),e.scope.on(),()=>{e.scope.off(),Bo(t)}},jl=()=>{zt&&zt.scope.off(),Bo(null)};function Rd(e){return e.vnode.shapeFlag&4}let Js=!1;function Bp(e,t=!1,n=!1){t&&la(t);const{props:r,children:s}=e.vnode,o=Rd(e);kp(e,r,o,t),Ep(e,s,n||t);const i=o?Up(e,t):void 0;return t&&la(!1),i}function Up(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,op);const{setup:r}=n;if(r){Xn();const s=e.setupContext=r.length>1?xd(e):null,o=so(e),i=ro(r,e,0,[e.props,s]),a=_u(i);if(Zn(),o(),(a||e.sp)&&!as(e)&&id(e),a){if(i.then(jl,jl),t)return i.then(l=>{Bl(e,l)}).catch(l=>{ei(l,e,0)});e.asyncDep=i}else Bl(e,i)}else Pd(e)}function Bl(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=Wu(t)),Pd(e)}function Pd(e,t,n){const r=e.type;e.render||(e.render=r.render||Mn);{const s=so(e);Xn();try{lp(e)}finally{Zn(),s()}}}const Fp={get(e,t){return Vt(e,"get",""),e[t]}};function xd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fp),slots:e.slots,emit:e.emit,expose:t}}function ii(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Wu(Rh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function Hp(e,t=!0){return ze(e)?e.displayName||e.name:e.name||t&&e.__name}function Vp(e){return ze(e)&&"__vccOpts"in e}const pe=(e,t)=>Nh(e,t,Js);function Ga(e,t,n){try{jo(-1);const r=arguments.length;return r===2?ft(t)&&!Le(t)?Ks(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ks(n)&&(n=[n]),Ce(e,t,n))}finally{jo(1)}}const Wp="3.5.30";/**
14
14
  * @vue/runtime-dom v3.5.30
15
15
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
16
  * @license MIT
17
- **/let da;const Fl=typeof window<"u"&&window.trustedTypes;if(Fl)try{da=Fl.createPolicy("vue",{createHTML:e=>e})}catch{}const Nd=da?e=>da.createHTML(e):e=>e,Gp="http://www.w3.org/2000/svg",Kp="http://www.w3.org/1998/Math/MathML",zn=typeof document<"u"?document:null,Hl=zn&&zn.createElement("template"),Jp={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"?zn.createElementNS(Gp,e):t==="mathml"?zn.createElementNS(Kp,e):n?zn.createElement(e,{is:n}):zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>zn.createTextNode(e),createComment:e=>zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zn.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{Hl.innerHTML=Nd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Hl.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]}},ur="transition",Rs="animation",Qs=Symbol("_vtc"),$d={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},Yp=$t({},rd,$d),Qp=e=>(e.displayName="Transition",e.props=Yp,e),Dd=Qp((e,{slots:t})=>Ja(Kh,Xp(e),t)),Or=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},Vl=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Xp(e){const t={};for(const te in e)te in $d||(t[te]=e[te]);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:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,N=Zp(s),I=N&&N[0],O=N&&N[1],{onBeforeEnter:Y,onEnter:$,onEnterCancelled:z,onLeave:j,onLeaveCancelled:oe,onBeforeAppear:de=Y,onAppear:ve=$,onAppearCancelled:Ie=z}=t,re=(te,je,Be,Qe)=>{te._enterCancelled=Qe,Nr(te,je?c:a),Nr(te,je?u:i),Be&&Be()},ee=(te,je)=>{te._isLeaving=!1,Nr(te,f),Nr(te,b),Nr(te,h),je&&je()},ye=te=>(je,Be)=>{const Qe=te?ve:$,Re=()=>re(je,te,Be);Or(Qe,[je,Re]),Wl(()=>{Nr(je,te?l:o),Vn(je,te?c:a),Vl(Qe)||zl(je,r,I,Re)})};return $t(t,{onBeforeEnter(te){Or(Y,[te]),Vn(te,o),Vn(te,i)},onBeforeAppear(te){Or(de,[te]),Vn(te,l),Vn(te,u)},onEnter:ye(!1),onAppear:ye(!0),onLeave(te,je){te._isLeaving=!0;const Be=()=>ee(te,je);Vn(te,f),te._enterCancelled?(Vn(te,h),Kl(te)):(Kl(te),Vn(te,h)),Wl(()=>{te._isLeaving&&(Nr(te,f),Vn(te,b),Vl(j)||zl(te,r,O,Be))}),Or(j,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Or(z,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Or(Ie,[te])},onLeaveCancelled(te){ee(te),Or(oe,[te])}})}function Zp(e){if(e==null)return null;if(ft(e))return[Ei(e.enter),Ei(e.leave)];{const t=Ei(e);return[t,t]}}function Ei(e){return rh(e)}function Vn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Qs]||(e[Qs]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Qs];n&&(n.delete(t),n.size||(e[Qs]=void 0))}function Wl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let em=0;function zl(e,t,n,r){const s=e._endId=++em,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=tm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=b=>{b.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,h)}function tm(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${ur}Delay`),o=r(`${ur}Duration`),i=ql(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),u=ql(a,l);let c=null,f=0,h=0;t===ur?i>0&&(c=ur,f=i,h=o.length):t===Rs?u>0&&(c=Rs,f=u,h=l.length):(f=Math.max(i,u),c=f>0?i>u?ur:Rs:null,h=c?c===ur?o.length:l.length:0);const b=c===ur&&/\b(?:transform|all)(?:,|$)/.test(r(`${ur}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:b}}function ql(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Gl(n)+Gl(e[r])))}function Gl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Kl(e){return(e?e.ownerDocument:document).body.offsetHeight}function nm(e,t,n){const r=e[Qs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jl=Symbol("_vod"),rm=Symbol("_vsh"),sm=Symbol(""),om=/(?:^|;)\s*display\s*:/;function im(e,t,n){const r=e.style,s=Ct(n);let o=!1;if(n&&!s){if(t)if(Ct(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Co(r,a,"")}else for(const i in t)n[i]==null&&Co(r,i,"");for(const i in n)i==="display"&&(o=!0),Co(r,i,n[i])}else if(s){if(t!==n){const i=r[sm];i&&(n+=";"+i),r.cssText=n,o=om.test(n)}}else t&&e.removeAttribute("style");Jl in e&&(e[Jl]=o?r.display:"",e[rm]&&(r.display="none"))}const Yl=/\s*!important$/;function Co(e,t,n){if(Le(n))n.forEach(r=>Co(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=am(e,t);Yl.test(n)?e.setProperty(Tr(r),n.replace(Yl,""),"important"):e[r]=n}}const Ql=["Webkit","Moz","ms"],Ci={};function am(e,t){const n=Ci[t];if(n)return n;let r=Qt(t);if(r!=="filter"&&r in e)return Ci[t]=r;r=Qo(r);for(let s=0;s<Ql.length;s++){const o=Ql[s]+r;if(o in e)return Ci[t]=o}return t}const Xl="http://www.w3.org/1999/xlink";function Zl(e,t,n,r,s,o=ch(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Xl,t.slice(6,t.length)):e.setAttributeNS(Xl,t,n):n==null||o&&!Cu(n)?e.removeAttribute(t):e.setAttribute(t,o?"":vn(n)?String(n):n)}function ec(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Nd(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=Cu(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 ns(e,t,n,r){e.addEventListener(t,n,r)}function lm(e,t,n,r){e.removeEventListener(t,n,r)}const tc=Symbol("_vei");function cm(e,t,n,r,s=null){const o=e[tc]||(e[tc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=um(t);if(r){const u=o[t]=hm(r,s);ns(e,a,u,l)}else i&&(lm(e,a,i,l),o[t]=void 0)}}const nc=/(?:Once|Passive|Capture)$/;function um(e){let t;if(nc.test(e)){t={};let r;for(;r=e.match(nc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Tr(e.slice(2)),t]}let Ai=0;const dm=Promise.resolve(),fm=()=>Ai||(dm.then(()=>Ai=0),Ai=Date.now());function hm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wn(pm(r,n.value),t,5,[r])};return n.value=e,n.attached=fm(),n}function pm(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 rc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,mm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?nm(e,r,i):t==="style"?im(e,n,r):Jo(t)?Pa(t)||cm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gm(e,t,r,i))?(ec(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Zl(e,t,r,i,o,t!=="value")):e._isVueCE&&(vm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ct(r)))?ec(e,Qt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Zl(e,t,r,i))};function gm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&rc(t)&&ze(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 rc(t)&&Ct(n)?!1:t in e}function vm(e,t){const n=e._def.props;if(!n)return!1;const r=Qt(t);return Array.isArray(n)?n.some(s=>Qt(s)===r):Object.keys(n).some(s=>Qt(s)===r)}const sc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>To(t,n):t};function ym(e){e.target.composing=!0}function oc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ri=Symbol("_assign");function ic(e,t,n){return t&&(e=e.trim()),n&&(e=Na(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ri]=sc(s);const o=r||s.props&&s.props.type==="number";ns(e,t?"change":"input",i=>{i.target.composing||e[Ri](ic(e.value,n,o))}),(n||o)&&ns(e,"change",()=>{e.value=ic(e.value,n,o)}),t||(ns(e,"compositionstart",ym),ns(e,"compositionend",oc),ns(e,"change",oc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ri]=sc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Na(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))}},wm=["ctrl","shift","alt","meta"],bm={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)=>wm.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(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=bm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},_m={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Tr(s.key);if(t.some(i=>i===o||_m[i]===o))return e(s)}))},km=$t({patchProp:mm},Jp);let ac;function Tm(){return ac||(ac=xp(km))}const Im=((...e)=>{const t=Tm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Em(r);if(!s)return;const o=t._component;!ze(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Sm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Sm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Em(e){return Ct(e)?document.querySelector(e):e}/*!
17
+ **/let ca;const Ul=typeof window<"u"&&window.trustedTypes;if(Ul)try{ca=Ul.createPolicy("vue",{createHTML:e=>e})}catch{}const Od=ca?e=>ca.createHTML(e):e=>e,zp="http://www.w3.org/2000/svg",qp="http://www.w3.org/1998/Math/MathML",zn=typeof document<"u"?document:null,Fl=zn&&zn.createElement("template"),Gp={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"?zn.createElementNS(zp,e):t==="mathml"?zn.createElementNS(qp,e):n?zn.createElement(e,{is:n}):zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>zn.createTextNode(e),createComment:e=>zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zn.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{Fl.innerHTML=Od(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Fl.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]}},ur="transition",Rs="animation",Ys=Symbol("_vtc"),Md={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},Kp=$t({},td,Md),Jp=e=>(e.displayName="Transition",e.props=Kp,e),Nd=Jp((e,{slots:t})=>Ga(qh,Yp(e),t)),Mr=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},Hl=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Yp(e){const t={};for(const te in e)te in Md||(t[te]=e[te]);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:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,N=Qp(s),I=N&&N[0],M=N&&N[1],{onBeforeEnter:Y,onEnter:j,onEnterCancelled:q,onLeave:B,onLeaveCancelled:oe,onBeforeAppear:de=Y,onAppear:ve=j,onAppearCancelled:Ie=q}=t,re=(te,je,Be,Qe)=>{te._enterCancelled=Qe,Nr(te,je?c:a),Nr(te,je?u:i),Be&&Be()},ee=(te,je)=>{te._isLeaving=!1,Nr(te,f),Nr(te,_),Nr(te,p),je&&je()},ye=te=>(je,Be)=>{const Qe=te?ve:j,Re=()=>re(je,te,Be);Mr(Qe,[je,Re]),Vl(()=>{Nr(je,te?l:o),Vn(je,te?c:a),Hl(Qe)||Wl(je,r,I,Re)})};return $t(t,{onBeforeEnter(te){Mr(Y,[te]),Vn(te,o),Vn(te,i)},onBeforeAppear(te){Mr(de,[te]),Vn(te,l),Vn(te,u)},onEnter:ye(!1),onAppear:ye(!0),onLeave(te,je){te._isLeaving=!0;const Be=()=>ee(te,je);Vn(te,f),te._enterCancelled?(Vn(te,p),Gl(te)):(Gl(te),Vn(te,p)),Vl(()=>{te._isLeaving&&(Nr(te,f),Vn(te,_),Hl(B)||Wl(te,r,M,Be))}),Mr(B,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Mr(q,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Mr(Ie,[te])},onLeaveCancelled(te){ee(te),Mr(oe,[te])}})}function Qp(e){if(e==null)return null;if(ft(e))return[Ii(e.enter),Ii(e.leave)];{const t=Ii(e);return[t,t]}}function Ii(e){return th(e)}function Vn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ys]||(e[Ys]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ys];n&&(n.delete(t),n.size||(e[Ys]=void 0))}function Vl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Xp=0;function Wl(e,t,n,r){const s=e._endId=++Xp,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Zp(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,p),o()},p=_=>{_.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,p)}function Zp(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${ur}Delay`),o=r(`${ur}Duration`),i=zl(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),u=zl(a,l);let c=null,f=0,p=0;t===ur?i>0&&(c=ur,f=i,p=o.length):t===Rs?u>0&&(c=Rs,f=u,p=l.length):(f=Math.max(i,u),c=f>0?i>u?ur:Rs:null,p=c?c===ur?o.length:l.length:0);const _=c===ur&&/\b(?:transform|all)(?:,|$)/.test(r(`${ur}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:_}}function zl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ql(n)+ql(e[r])))}function ql(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Gl(e){return(e?e.ownerDocument:document).body.offsetHeight}function em(e,t,n){const r=e[Ys];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kl=Symbol("_vod"),tm=Symbol("_vsh"),nm=Symbol(""),rm=/(?:^|;)\s*display\s*:/;function sm(e,t,n){const r=e.style,s=Ct(n);let o=!1;if(n&&!s){if(t)if(Ct(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Eo(r,a,"")}else for(const i in t)n[i]==null&&Eo(r,i,"");for(const i in n)i==="display"&&(o=!0),Eo(r,i,n[i])}else if(s){if(t!==n){const i=r[nm];i&&(n+=";"+i),r.cssText=n,o=rm.test(n)}}else t&&e.removeAttribute("style");Kl in e&&(e[Kl]=o?r.display:"",e[tm]&&(r.display="none"))}const Jl=/\s*!important$/;function Eo(e,t,n){if(Le(n))n.forEach(r=>Eo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=om(e,t);Jl.test(n)?e.setProperty(Tr(r),n.replace(Jl,""),"important"):e[r]=n}}const Yl=["Webkit","Moz","ms"],Si={};function om(e,t){const n=Si[t];if(n)return n;let r=Qt(t);if(r!=="filter"&&r in e)return Si[t]=r;r=Yo(r);for(let s=0;s<Yl.length;s++){const o=Yl[s]+r;if(o in e)return Si[t]=o}return t}const Ql="http://www.w3.org/1999/xlink";function Xl(e,t,n,r,s,o=ah(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ql,t.slice(6,t.length)):e.setAttributeNS(Ql,t,n):n==null||o&&!Su(n)?e.removeAttribute(t):e.setAttribute(t,o?"":vn(n)?String(n):n)}function Zl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Od(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=Su(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 ns(e,t,n,r){e.addEventListener(t,n,r)}function im(e,t,n,r){e.removeEventListener(t,n,r)}const ec=Symbol("_vei");function am(e,t,n,r,s=null){const o=e[ec]||(e[ec]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=lm(t);if(r){const u=o[t]=dm(r,s);ns(e,a,u,l)}else i&&(im(e,a,i,l),o[t]=void 0)}}const tc=/(?:Once|Passive|Capture)$/;function lm(e){let t;if(tc.test(e)){t={};let r;for(;r=e.match(tc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Tr(e.slice(2)),t]}let Ei=0;const cm=Promise.resolve(),um=()=>Ei||(cm.then(()=>Ei=0),Ei=Date.now());function dm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wn(fm(r,n.value),t,5,[r])};return n.value=e,n.attached=um(),n}function fm(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 nc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,hm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?em(e,r,i):t==="style"?sm(e,n,r):Ko(t)?Ra(t)||am(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pm(e,t,r,i))?(Zl(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Xl(e,t,r,i,o,t!=="value")):e._isVueCE&&(mm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ct(r)))?Zl(e,Qt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Xl(e,t,r,i))};function pm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&nc(t)&&ze(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 nc(t)&&Ct(n)?!1:t in e}function mm(e,t){const n=e._def.props;if(!n)return!1;const r=Qt(t);return Array.isArray(n)?n.some(s=>Qt(s)===r):Object.keys(n).some(s=>Qt(s)===r)}const rc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>ko(t,n):t};function gm(e){e.target.composing=!0}function sc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ci=Symbol("_assign");function oc(e,t,n){return t&&(e=e.trim()),n&&(e=Oa(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ci]=rc(s);const o=r||s.props&&s.props.type==="number";ns(e,t?"change":"input",i=>{i.target.composing||e[Ci](oc(e.value,n,o))}),(n||o)&&ns(e,"change",()=>{e.value=oc(e.value,n,o)}),t||(ns(e,"compositionstart",gm),ns(e,"compositionend",sc),ns(e,"change",sc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ci]=rc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Oa(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))}},vm=["ctrl","shift","alt","meta"],ym={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)=>vm.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(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=ym[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},wm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Tr(s.key);if(t.some(i=>i===o||wm[i]===o))return e(s)}))},bm=$t({patchProp:hm},Gp);let ic;function _m(){return ic||(ic=Ap(bm))}const km=((...e)=>{const t=_m().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Im(r);if(!s)return;const o=t._component;!ze(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Tm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Tm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Im(e){return Ct(e)?document.querySelector(e):e}/*!
18
18
  * vue-router v4.6.4
19
19
  * (c) 2025 Eduardo San Martin Morote
20
20
  * @license MIT
21
- */const rs=typeof document<"u";function Ld(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Cm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ld(e.default)}const ut=Object.assign;function xi(e,t){const n={};for(const r in t){const s=t[r];n[r]=bn(s)?s.map(e):e(s)}return n}const Fs=()=>{},bn=Array.isArray;function lc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const jd=/#/g,Am=/&/g,Rm=/\//g,xm=/=/g,Pm=/\?/g,Bd=/\+/g,Mm=/%5B/g,Om=/%5D/g,Ud=/%5E/g,Nm=/%60/g,Fd=/%7B/g,$m=/%7C/g,Hd=/%7D/g,Dm=/%20/g;function Ya(e){return e==null?"":encodeURI(""+e).replace($m,"|").replace(Mm,"[").replace(Om,"]")}function Lm(e){return Ya(e).replace(Fd,"{").replace(Hd,"}").replace(Ud,"^")}function fa(e){return Ya(e).replace(Bd,"%2B").replace(Dm,"+").replace(jd,"%23").replace(Am,"%26").replace(Nm,"`").replace(Fd,"{").replace(Hd,"}").replace(Ud,"^")}function jm(e){return fa(e).replace(xm,"%3D")}function Bm(e){return Ya(e).replace(jd,"%23").replace(Pm,"%3F")}function Um(e){return Bm(e).replace(Rm,"%2F")}function Xs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fm=/\/$/,Hm=e=>e.replace(Fm,"");function Pi(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=qm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Xs(i)}}function Vm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function cc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Wm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ps(t.matched[r],n.matched[s])&&Vd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ps(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Vd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!zm(e[n],t[n]))return!1;return!0}function zm(e,t){return bn(e)?uc(e,t):bn(t)?uc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function uc(e,t){return bn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qm(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 dr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ha=(function(e){return e.pop="pop",e.push="push",e})({}),Mi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Gm(e){if(!e)if(rs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Hm(e)}const Km=/^[^#]+#/;function Jm(e,t){return e.replace(Km,"#")+t}function Ym(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 li=()=>({left:window.scrollX,top:window.scrollY});function Qm(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=Ym(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 dc(e,t){return(history.state?history.state.position-t:-1)+e}const pa=new Map;function Xm(e,t){pa.set(e,t)}function Zm(e){const t=pa.get(e);return pa.delete(e),t}function eg(e){return typeof e=="string"||e&&typeof e=="object"}function Wd(e){return typeof e=="string"||typeof e=="symbol"}let At=(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 zd=Symbol("");At.MATCHER_NOT_FOUND+"",At.NAVIGATION_GUARD_REDIRECT+"",At.NAVIGATION_ABORTED+"",At.NAVIGATION_CANCELLED+"",At.NAVIGATION_DUPLICATED+"";function ms(e,t){return ut(new Error,{type:e,[zd]:!0},t)}function Wn(e,t){return e instanceof Error&&zd in e&&(t==null||!!(e.type&t))}const tg=["params","query","hash"];function ng(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of tg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function rg(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(Bd," "),o=s.indexOf("="),i=Xs(o<0?s:s.slice(0,o)),a=o<0?null:Xs(s.slice(o+1));if(i in t){let l=t[i];bn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function fc(e){let t="";for(let n in e){const r=e[n];if(n=jm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(bn(r)?r.map(s=>s&&fa(s)):[r&&fa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function sg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=bn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const og=Symbol(""),hc=Symbol(""),ci=Symbol(""),Qa=Symbol(""),ma=Symbol("");function xs(){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 mr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=h=>{h===!1?l(ms(At.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):eg(h)?l(ms(At.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&r.enterCallbacks[s]===i&&typeof h=="function"&&i.push(h),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function Oi(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(Ld(l)){const u=(l.__vccOpts||l)[t];u&&o.push(mr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Cm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&mr(h,n,r,i,a,s)()}))}}return o}function ig(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(u=>ps(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>ps(u,l))||s.push(l))}return[n,r,s]}/*!
21
+ */const rs=typeof document<"u";function $d(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Sm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&$d(e.default)}const ut=Object.assign;function Ai(e,t){const n={};for(const r in t){const s=t[r];n[r]=bn(s)?s.map(e):e(s)}return n}const Fs=()=>{},bn=Array.isArray;function ac(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Dd=/#/g,Em=/&/g,Cm=/\//g,Am=/=/g,Rm=/\?/g,Ld=/\+/g,Pm=/%5B/g,xm=/%5D/g,jd=/%5E/g,Om=/%60/g,Bd=/%7B/g,Mm=/%7C/g,Ud=/%7D/g,Nm=/%20/g;function Ka(e){return e==null?"":encodeURI(""+e).replace(Mm,"|").replace(Pm,"[").replace(xm,"]")}function $m(e){return Ka(e).replace(Bd,"{").replace(Ud,"}").replace(jd,"^")}function ua(e){return Ka(e).replace(Ld,"%2B").replace(Nm,"+").replace(Dd,"%23").replace(Em,"%26").replace(Om,"`").replace(Bd,"{").replace(Ud,"}").replace(jd,"^")}function Dm(e){return ua(e).replace(Am,"%3D")}function Lm(e){return Ka(e).replace(Dd,"%23").replace(Rm,"%3F")}function jm(e){return Lm(e).replace(Cm,"%2F")}function Qs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Bm=/\/$/,Um=e=>e.replace(Bm,"");function Ri(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=Wm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Qs(i)}}function Fm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function lc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Hm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ps(t.matched[r],n.matched[s])&&Fd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ps(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Fd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vm(e[n],t[n]))return!1;return!0}function Vm(e,t){return bn(e)?cc(e,t):bn(t)?cc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function cc(e,t){return bn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Wm(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 dr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let da=(function(e){return e.pop="pop",e.push="push",e})({}),Pi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function zm(e){if(!e)if(rs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Um(e)}const qm=/^[^#]+#/;function Gm(e,t){return e.replace(qm,"#")+t}function Km(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 ai=()=>({left:window.scrollX,top:window.scrollY});function Jm(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=Km(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 uc(e,t){return(history.state?history.state.position-t:-1)+e}const fa=new Map;function Ym(e,t){fa.set(e,t)}function Qm(e){const t=fa.get(e);return fa.delete(e),t}function Xm(e){return typeof e=="string"||e&&typeof e=="object"}function Hd(e){return typeof e=="string"||typeof e=="symbol"}let At=(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 Vd=Symbol("");At.MATCHER_NOT_FOUND+"",At.NAVIGATION_GUARD_REDIRECT+"",At.NAVIGATION_ABORTED+"",At.NAVIGATION_CANCELLED+"",At.NAVIGATION_DUPLICATED+"";function ms(e,t){return ut(new Error,{type:e,[Vd]:!0},t)}function Wn(e,t){return e instanceof Error&&Vd in e&&(t==null||!!(e.type&t))}const Zm=["params","query","hash"];function eg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Zm)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function tg(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(Ld," "),o=s.indexOf("="),i=Qs(o<0?s:s.slice(0,o)),a=o<0?null:Qs(s.slice(o+1));if(i in t){let l=t[i];bn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function dc(e){let t="";for(let n in e){const r=e[n];if(n=Dm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(bn(r)?r.map(s=>s&&ua(s)):[r&&ua(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ng(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=bn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const rg=Symbol(""),fc=Symbol(""),li=Symbol(""),Ja=Symbol(""),ha=Symbol("");function Ps(){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 mr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=p=>{p===!1?l(ms(At.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?l(p):Xm(p)?l(ms(At.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(i&&r.enterCallbacks[s]===i&&typeof p=="function"&&i.push(p),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(p=>l(p))})}function xi(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($d(l)){const u=(l.__vccOpts||l)[t];u&&o.push(mr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Sm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const p=(f.__vccOpts||f)[t];return p&&mr(p,n,r,i,a,s)()}))}}return o}function sg(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(u=>ps(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>ps(u,l))||s.push(l))}return[n,r,s]}/*!
22
22
  * vue-router v4.6.4
23
23
  * (c) 2025 Eduardo San Martin Morote
24
24
  * @license MIT
25
- */let ag=()=>location.protocol+"//"+location.host;function qd(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),cc(a,"")}return cc(n,e)+r+s}function lg(e,t,n,r){let s=[],o=[],i=null;const a=({state:h})=>{const b=qd(e,location),N=n.value,I=t.value;let O=0;if(h){if(n.value=b,t.value=h,i&&i===N){i=null;return}O=I?h.position-I.position:0}else r(b);s.forEach(Y=>{Y(n.value,N,{delta:O,type:ha.pop,direction:O?O>0?Mi.forward:Mi.back:Mi.unknown})})};function l(){i=n.value}function u(h){s.push(h);const b=()=>{const N=s.indexOf(h);N>-1&&s.splice(N,1)};return o.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ut({},h.state,{scroll:li()}),"")}}function f(){for(const h of o)h();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function pc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?li():null}}function cg(e){const{history:t,location:n}=window,r={value:qd(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,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:ag()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),s.value=u}catch(b){console.error(b),n[c?"replace":"assign"](h)}}function i(l,u){o(l,ut({},t.state,pc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ut({},s.value,t.state,{forward:l,scroll:li()});o(c.current,c,!0),o(l,ut({},pc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function ug(e){e=Gm(e);const t=cg(e),n=lg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:Jm.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 dg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),ug(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Nt=(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})(Nt||{});const fg={type:Ur.Static,value:""},hg=/[a-zA-Z0-9_]/;function pg(e){if(!e)return[[]];if(e==="/")return[[fg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${u}": ${b}`)}let n=Nt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Nt.Static?o.push({type:Ur.Static,value:u}):n===Nt.Param||n===Nt.ParamRegExp||n===Nt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Ur.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Nt.ParamRegExp){r=n,n=Nt.EscapeNext;continue}switch(n){case Nt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Nt.Param):h();break;case Nt.EscapeNext:h(),n=r;break;case Nt.Param:l==="("?n=Nt.ParamRegExp:hg.test(l)?h():(f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Nt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Nt.ParamRegExpEnd:c+=l;break;case Nt.ParamRegExpEnd:f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Nt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const mc="[^/]+?",mg={sensitive:!1,strict:!1,start:!0,end:!0};var Kt=(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})(Kt||{});const gg=/[.+*?^${}()[\]/\\]/g;function vg(e,t){const n=ut({},mg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Kt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const h=u[f];let b=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(h.type===Ur.Static)f||(s+="/"),s+=h.value.replace(gg,"\\$&"),b+=Kt.Static;else if(h.type===Ur.Param){const{value:N,repeatable:I,optional:O,regexp:Y}=h;o.push({name:N,repeatable:I,optional:O});const $=Y||mc;if($!==mc){b+=Kt.BonusCustomRegExp;try{`${$}`}catch(j){throw new Error(`Invalid custom RegExp for param "${N}" (${$}): `+j.message)}}let z=I?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(z=O&&u.length<2?`(?:/${z})`:"/"+z),O&&(z+="?"),s+=z,b+=Kt.Dynamic,O&&(b+=Kt.BonusOptional),I&&(b+=Kt.BonusRepeatable),$===".*"&&(b+=Kt.BonusWildcard)}c.push(b)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Kt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let h=1;h<c.length;h++){const b=c[h]||"",N=o[h-1];f[N.name]=b&&N.repeatable?b.split("/"):b}return f}function l(u){let c="",f=!1;for(const h of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const b of h)if(b.type===Ur.Static)c+=b.value;else if(b.type===Ur.Param){const{value:N,repeatable:I,optional:O}=b,Y=N in u?u[N]:"";if(bn(Y)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const $=bn(Y)?Y.join("/"):Y;if(!$)if(O)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);c+=$}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function yg(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]===Kt.Static+Kt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Kt.Static+Kt.Segment?1:-1:0}function Gd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=yg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(gc(r))return 1;if(gc(s))return-1}return s.length-r.length}function gc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const wg={strict:!1,end:!0,sensitive:!1};function bg(e,t,n){const r=vg(pg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function _g(e,t){const n=[],r=new Map;t=lc(wg,t);function s(f){return r.get(f)}function o(f,h,b){const N=!b,I=yc(f);I.aliasOf=b&&b.record;const O=lc(t,f),Y=[I];if("alias"in f){const j=typeof f.alias=="string"?[f.alias]:f.alias;for(const oe of j)Y.push(yc(ut({},I,{components:b?b.record.components:I.components,path:oe,aliasOf:b?b.record:I})))}let $,z;for(const j of Y){const{path:oe}=j;if(h&&oe[0]!=="/"){const de=h.record.path,ve=de[de.length-1]==="/"?"":"/";j.path=h.record.path+(oe&&ve+oe)}if($=bg(j,h,O),b?b.alias.push($):(z=z||$,z!==$&&z.alias.push($),N&&f.name&&!wc($)&&i(f.name)),Kd($)&&l($),I.children){const de=I.children;for(let ve=0;ve<de.length;ve++)o(de[ve],$,b&&b.children[ve])}b=b||$}return z?()=>{i(z)}:Fs}function i(f){if(Wd(f)){const h=r.get(f);h&&(r.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,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 h=Ig(f,n);n.splice(h,0,f),f.record.name&&!wc(f)&&r.set(f.record.name,f)}function u(f,h){let b,N={},I,O;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw ms(At.MATCHER_NOT_FOUND,{location:f});O=b.record.name,N=ut(vc(h.params,b.keys.filter(z=>!z.optional).concat(b.parent?b.parent.keys.filter(z=>z.optional):[]).map(z=>z.name)),f.params&&vc(f.params,b.keys.map(z=>z.name))),I=b.stringify(N)}else if(f.path!=null)I=f.path,b=n.find(z=>z.re.test(I)),b&&(N=b.parse(I),O=b.record.name);else{if(b=h.name?r.get(h.name):n.find(z=>z.re.test(h.path)),!b)throw ms(At.MATCHER_NOT_FOUND,{location:f,currentLocation:h});O=b.record.name,N=ut({},h.params,f.params),I=b.stringify(N)}const Y=[];let $=b;for(;$;)Y.unshift($.record),$=$.parent;return{name:O,path:I,params:N,matched:Y,meta:Tg(Y)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function vc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function yc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:kg(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 kg(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 wc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tg(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Ig(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Gd(e,t[o])<0?r=o:n=o+1}const s=Sg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Sg(e){let t=e;for(;t=t.parent;)if(Kd(t)&&Gd(e,t)===0)return t}function Kd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function bc(e){const t=mn(ci),n=mn(Qa),r=pe(()=>{const l=ue(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(ps.bind(null,c));if(h>-1)return h;const b=_c(l[u-2]);return u>1&&_c(c)===b&&f[f.length-1].path!==b?f.findIndex(ps.bind(null,l[u-2])):h}),o=pe(()=>s.value>-1&&xg(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Vd(n.params,r.value.params));function a(l={}){if(Rg(l)){const u=t[ue(e.replace)?"replace":"push"](ue(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Eg(e){return e.length===1?e[0]:e}const Cg=Lt({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:bc,setup(e,{slots:t}){const n=ei(bc(e)),{options:r}=mn(ci),s=pe(()=>({[kc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[kc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Eg(t.default(n));return e.custom?o:Ja("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Ag=Cg;function Rg(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 xg(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(!bn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function _c(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const kc=(e,t,n)=>e??t??n,Pg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=mn(ma),s=pe(()=>e.route||r.value),o=mn(hc,0),i=pe(()=>{let u=ue(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=pe(()=>s.value.matched[i.value]);Io(hc,pe(()=>i.value+1)),Io(og,a),Io(ma,s);const l=L();return mt(()=>[l.value,a.value,e.name],([u,c,f],[h,b,N])=>{c&&(c.instances[f]=u,b&&b!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),u&&c&&(!b||!ps(c,b)||!h)&&(c.enterCallbacks[f]||[]).forEach(I=>I(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return Tc(n.default,{Component:h,route:u});const b=f.props[c],N=b?b===!0?u.params:typeof b=="function"?b(u):b:null,O=Ja(h,ut({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Tc(n.default,{Component:O,route:u})||O}}});function Tc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Mg=Pg;function Og(e){const t=_g(e.routes,e),n=e.parseQuery||rg,r=e.stringifyQuery||fc,s=e.history,o=xs(),i=xs(),a=xs(),l=Mh(dr);let u=dr;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=xi.bind(null,W=>""+W),f=xi.bind(null,Um),h=xi.bind(null,Xs);function b(W,me){let ie,fe;return Wd(W)?(ie=t.getRecordMatcher(W),fe=me):fe=W,t.addRoute(fe,ie)}function N(W){const me=t.getRecordMatcher(W);me&&t.removeRoute(me)}function I(){return t.getRoutes().map(W=>W.record)}function O(W){return!!t.getRecordMatcher(W)}function Y(W,me){if(me=ut({},me||l.value),typeof W=="string"){const A=Pi(n,W,me.path),H=t.resolve({path:A.path},me),F=s.createHref(A.fullPath);return ut(A,H,{params:h(H.params),hash:Xs(A.hash),redirectedFrom:void 0,href:F})}let ie;if(W.path!=null)ie=ut({},W,{path:Pi(n,W.path,me.path).path});else{const A=ut({},W.params);for(const H in A)A[H]==null&&delete A[H];ie=ut({},W,{params:f(A)}),me.params=f(me.params)}const fe=t.resolve(ie,me),De=W.hash||"";fe.params=c(h(fe.params));const g=Vm(r,ut({},W,{hash:Lm(De),path:fe.path})),v=s.createHref(g);return ut({fullPath:g,hash:De,query:r===fc?sg(W.query):W.query||{}},fe,{redirectedFrom:void 0,href:v})}function $(W){return typeof W=="string"?Pi(n,W,l.value.path):ut({},W)}function z(W,me){if(u!==W)return ms(At.NAVIGATION_CANCELLED,{from:me,to:W})}function j(W){return ve(W)}function oe(W){return j(ut($(W),{replace:!0}))}function de(W,me){const ie=W.matched[W.matched.length-1];if(ie&&ie.redirect){const{redirect:fe}=ie;let De=typeof fe=="function"?fe(W,me):fe;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=$(De):{path:De},De.params={}),ut({query:W.query,hash:W.hash,params:De.path!=null?{}:W.params},De)}}function ve(W,me){const ie=u=Y(W),fe=l.value,De=W.state,g=W.force,v=W.replace===!0,A=de(ie,fe);if(A)return ve(ut($(A),{state:typeof A=="object"?ut({},De,A.state):De,force:g,replace:v}),me||ie);const H=ie;H.redirectedFrom=me;let F;return!g&&Wm(r,fe,ie)&&(F=ms(At.NAVIGATION_DUPLICATED,{to:H,from:fe}),Xe(fe,fe,!0,!1)),(F?Promise.resolve(F):ee(H,fe)).catch(x=>Wn(x)?Wn(x,At.NAVIGATION_GUARD_REDIRECT)?x:nt(x):$e(x,H,fe)).then(x=>{if(x){if(Wn(x,At.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:v},$(x.to),{state:typeof x.to=="object"?ut({},De,x.to.state):De,force:g}),me||H)}else x=te(H,fe,!0,v,De);return ye(H,fe,x),x})}function Ie(W,me){const ie=z(W,me);return ie?Promise.reject(ie):Promise.resolve()}function re(W){const me=Rt.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(W):W()}function ee(W,me){let ie;const[fe,De,g]=ig(W,me);ie=Oi(fe.reverse(),"beforeRouteLeave",W,me);for(const A of fe)A.leaveGuards.forEach(H=>{ie.push(mr(H,W,me))});const v=Ie.bind(null,W,me);return ie.push(v),et(ie).then(()=>{ie=[];for(const A of o.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).then(()=>{ie=Oi(De,"beforeRouteUpdate",W,me);for(const A of De)A.updateGuards.forEach(H=>{ie.push(mr(H,W,me))});return ie.push(v),et(ie)}).then(()=>{ie=[];for(const A of g)if(A.beforeEnter)if(bn(A.beforeEnter))for(const H of A.beforeEnter)ie.push(mr(H,W,me));else ie.push(mr(A.beforeEnter,W,me));return ie.push(v),et(ie)}).then(()=>(W.matched.forEach(A=>A.enterCallbacks={}),ie=Oi(g,"beforeRouteEnter",W,me,re),ie.push(v),et(ie))).then(()=>{ie=[];for(const A of i.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).catch(A=>Wn(A,At.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ye(W,me,ie){a.list().forEach(fe=>re(()=>fe(W,me,ie)))}function te(W,me,ie,fe,De){const g=z(W,me);if(g)return g;const v=me===dr,A=rs?history.state:{};ie&&(fe||v?s.replace(W.fullPath,ut({scroll:v&&A&&A.scroll},De)):s.push(W.fullPath,De)),l.value=W,Xe(W,me,ie,v),nt()}let je;function Be(){je||(je=s.listen((W,me,ie)=>{if(!Ge.listening)return;const fe=Y(W),De=de(fe,Ge.currentRoute.value);if(De){ve(ut(De,{replace:!0,force:!0}),fe).catch(Fs);return}u=fe;const g=l.value;rs&&Xm(dc(g.fullPath,ie.delta),li()),ee(fe,g).catch(v=>Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_CANCELLED)?v:Wn(v,At.NAVIGATION_GUARD_REDIRECT)?(ve(ut($(v.to),{force:!0}),fe).then(A=>{Wn(A,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&!ie.delta&&ie.type===ha.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(ie.delta&&s.go(-ie.delta,!1),$e(v,fe,g))).then(v=>{v=v||te(fe,g,!1),v&&(ie.delta&&!Wn(v,At.NAVIGATION_CANCELLED)?s.go(-ie.delta,!1):ie.type===ha.pop&&Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(fe,g,v)}).catch(Fs)}))}let Qe=xs(),Re=xs(),Te;function $e(W,me,ie){nt(W);const fe=Re.list();return fe.length?fe.forEach(De=>De(W,me,ie)):console.error(W),Promise.reject(W)}function It(){return Te&&l.value!==dr?Promise.resolve():new Promise((W,me)=>{Qe.add([W,me])})}function nt(W){return Te||(Te=!W,Be(),Qe.list().forEach(([me,ie])=>W?ie(W):me()),Qe.reset()),W}function Xe(W,me,ie,fe){const{scrollBehavior:De}=e;if(!rs||!De)return Promise.resolve();const g=!ie&&Zm(dc(W.fullPath,0))||(fe||!ie)&&history.state&&history.state.scroll||null;return tn().then(()=>De(W,me,g)).then(v=>v&&Qm(v)).catch(v=>$e(v,W,me))}const Ze=W=>s.go(W);let ht;const Rt=new Set,Ge={currentRoute:l,listening:!0,addRoute:b,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:O,getRoutes:I,resolve:Y,options:e,push:j,replace:oe,go:Ze,back:()=>Ze(-1),forward:()=>Ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:It,install(W){W.component("RouterLink",Ag),W.component("RouterView",Mg),W.config.globalProperties.$router=Ge,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ue(l)}),rs&&!ht&&l.value===dr&&(ht=!0,j(s.location).catch(fe=>{}));const me={};for(const fe in dr)Object.defineProperty(me,fe,{get:()=>l.value[fe],enumerable:!0});W.provide(ci,Ge),W.provide(Qa,Wu(me)),W.provide(ma,l);const ie=W.unmount;Rt.add(W),W.unmount=function(){Rt.delete(W),Rt.size<1&&(u=dr,je&&je(),je=null,l.value=dr,ht=!1,Te=!1),ie()}}};function et(W){return W.reduce((me,ie)=>me.then(()=>re(ie)),Promise.resolve())}return Ge}function Ng(){return mn(ci)}function $g(e){return mn(Qa)}const Ic=768;function Jd(){const e=L(typeof window<"u"?window.innerWidth<Ic:!1);let t=null;function n(r){e.value=r.matches}return ir(()=>{t=window.matchMedia(`(max-width: ${Ic-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),si(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Dg={key:0,class:"desktop-sidebar"},Lg={class:"desktop-main"},Sc="codex-web-local.sidebar-width.v1",jg=260,Bg=620,Ec=320,Ug=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Jd();function r(u){return Math.min(Bg,Math.max(jg,u))}function s(){if(typeof window>"u")return Ec;const u=window.localStorage.getItem(Sc),c=Number(u);return Number.isFinite(c)?r(c):Ec}const o=L(s()),i=pe(()=>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(u){typeof window>"u"||window.localStorage.setItem(Sc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,h=N=>{const I=N.clientX-c;o.value=r(f+I)},b=()=>{a(o.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",b)}return(u,c)=>(w(),T("div",{class:gt(["desktop-layout",{"is-mobile":ue(n)}]),style:zr(i.value)},[ue(n)?(w(),yt(Do,{key:0,to:"body"},[Ce(Dd,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?se("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[Mn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):se("",!0),ue(n)?se("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?se("",!0):(w(),T("aside",Dg,[Mn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?se("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Lg,[Mn(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Fg=st(Ug,[["__scopeId","data-v-df29c633"]]),Hg={},Vg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wg(e,t){return w(),T("svg",Vg,[...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 ui=st(Hg,[["render",Wg]]),zg={},qg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gg(e,t){return w(),T("svg",qg,[...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 Yd=st(zg,[["render",Gg]]),Kg={},Jg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Yg(e,t){return w(),T("svg",Jg,[...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 Ps=st(Kg,[["render",Yg]]),Qg={},Xg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Zg(e,t){return w(),T("svg",Xg,[...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 Fo=st(Qg,[["render",Zg]]),ev={},tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nv(e,t){return w(),T("svg",tv,[...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 Qd=st(ev,[["render",nv]]),rv={},sv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ov(e,t){return w(),T("svg",sv,[...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 iv=st(rv,[["render",ov]]),av={},lv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cv(e,t){return w(),T("svg",lv,[...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 Ao=st(av,[["render",cv]]),uv={},dv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fv(e,t){return w(),T("svg",dv,[...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 Ni=st(uv,[["render",fv]]),hv={key:0,class:"sidebar-menu-row-left"},pv={class:"sidebar-menu-row-main"},mv={key:1,class:"sidebar-menu-row-right"},gv={key:0,class:"sidebar-menu-row-right-default"},vv={key:1,class:"sidebar-menu-row-right-hover"},yv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=lp(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(w(),yt(sa(t.as),xd({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:pt(()=>[r.value?(w(),T("span",hv,[Mn(a.$slots,"left",{},void 0,!0)])):se("",!0),m("span",pv,[Mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",mv,[s.value?(w(),T("span",gv,[Mn(a.$slots,"right",{},void 0,!0)])):se("",!0),o.value?(w(),T("span",vv,[Mn(a.$slots,"right-hover",{},void 0,!0)])):se("",!0)])):se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$r=st(yv,[["__scopeId","data-v-daeca4df"]]),wv={class:"thread-tree-root"},bv={key:0,class:"pinned-section"},_v={class:"thread-list"},kv={class:"thread-left-stack"},Tv=["data-state"],Iv=["onClick"],Sv=["onClick"],Ev={class:"thread-row-title-wrap"},Cv={class:"thread-row-title"},Av={class:"thread-row-time"},Rv=["onClick"],xv=["onClick"],Pv=["onClick"],Mv=["onClick"],Ov=["aria-expanded"],Nv=["data-active"],$v={key:0},Dv=["data-active"],Lv={key:0},jv={key:1,class:"thread-tree-no-results"},Bv={key:2,class:"thread-tree-loading"},Uv={key:3,class:"thread-list thread-list-global"},Fv={class:"thread-left-stack"},Hv=["data-state"],Vv=["onClick"],Wv=["onClick"],zv={class:"thread-row-title-wrap"},qv={class:"thread-row-title"},Gv={class:"thread-row-time"},Kv=["onClick"],Jv=["onClick"],Yv=["onClick"],Qv=["onClick"],Xv=["data-project-name","data-expanded","data-dragging"],Zv={class:"project-icon-stack"},ey={class:"project-icon-folder"},ty={class:"project-icon-chevron"},ny=["data-dragging-handle","onMousedown"],ry={class:"project-title"},sy={class:"project-hover-controls"},oy=["onClick"],iy=["onClick"],ay=["onClick"],ly=["onClick"],cy=["onInput"],uy=["aria-label","title","onClick"],dy={key:0,class:"thread-list"},fy={class:"thread-left-stack"},hy=["data-state"],py=["onClick"],my=["onClick"],gy={class:"thread-row-title-wrap"},vy={class:"thread-row-title"},yy={class:"thread-row-time"},wy=["onClick"],by=["onClick"],_y=["onClick"],ky=["onClick"],Ty=["onClick"],Iy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Sy=["onKeydown"],Ey={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Cy={class:"rename-thread-subtitle"},Ay=4,Cc=6,Ac="codex-web-local.thread-view-mode.v1",Rc="codex-web-local.collapsed-projects.v1",Ry=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),u=L("actions"),c=L(""),f=L(!1),h=L(""),b=L(""),N=L(null),I=L(!1),O=L(""),Y=L(""),$=L(null),z=L(null),j=L(null);let oe=null,de=null;const ve=L(""),Ie=L({}),re=new Map,ee=new Map,ye=new Map,te=new WeakMap,je=L(null),Be=L(!1),Qe=L($e()),Re=typeof window<"u"?new ResizeObserver(k=>{for(const P of k){const M=P.target,J=te.get(M);J&&Ae(J,M)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Rc);if(!k)return{};const P=JSON.parse(k);return!P||typeof P!="object"||Array.isArray(P)?{}:P}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Ac)==="chronological"?"chronological":"project"}o.value=Te(),mt(o,k=>{typeof window>"u"||window.localStorage.setItem(Rc,JSON.stringify(k))},{deep:!0}),mt(Qe,k=>{typeof window>"u"||window.localStorage.setItem(Ac,k)});const It=pe(()=>n.searchQuery.trim().toLowerCase()),nt=pe(()=>It.value.length>0),Xe=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ze(k){if(!nt.value)return!0;if(Xe.value)return Xe.value.has(k.id);const P=It.value;return k.title.toLowerCase().includes(P)||k.preview.toLowerCase().includes(P)}const ht=pe(()=>nt.value?n.groups.map(k=>({...k,threads:k.threads.filter(Ze)})).filter(k=>k.threads.length>0):n.groups),Rt=pe(()=>Qe.value==="chronological"),Ge=pe(()=>{const k=ht.value,P=[];for(const M of k)for(const J of M.threads)v(J.id)||P.push(J);return P.sort((M,J)=>{const Ue=new Date(M.updatedAtIso||M.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),et=pe(()=>{const k=new Map;for(const P of n.groups)for(const M of P.threads)k.set(M.id,M);return k}),W=pe(()=>i.value.map(k=>et.value.get(k)??null).filter(k=>k!==null).filter(Ze)),me=pe(()=>{const k=j.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const P=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),M=P>k.fromIndex?P-1:P,J=Math.max(0,Math.min(M,n.groups.length-1));return J===k.fromIndex?null:J}),ie=pe(()=>{const P=(nt.value?ht.value:n.groups).map(Zt=>Zt.projectName),M=j.value,J=me.value;if(!M||J===null)return P;const Ue=[...P],[Ot]=Ue.splice(M.fromIndex,1);return Ot?(Ue.splice(J,0,Ot),Ue):P}),fe=pe(()=>{const k={};let P=0;for(const M of ie.value)k[M]=P,P+=jt(M);return k}),De=pe(()=>{let k=0;for(const P of ie.value)k+=jt(P);return{height:`${Math.max(0,k)}px`}});function g(k){const P=new Date(k).getTime();if(Number.isNaN(P))return"n/a";const M=Math.abs(Date.now()-P);if(M<6e4)return"now";const J=Math.floor(M/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function A(k){if(v(k)){i.value=i.value.filter(P=>P!==k);return}i.value=[k,...i.value]}function H(k){r("select",k)}function F(k){r("export-thread",k),V()}function x(k){return`start new thread ${Ve(k)}`}function D(k){r("start-new-thread",k)}function B(k){l.value===k&&V()}function G(k){return l.value===k}function V(){l.value=""}function be(k){if(l.value===k){V();return}l.value=k}function ae(k,P){h.value=k,b.value=P,f.value=!0,V(),tn(()=>{var M,J;(M=N.value)==null||M.focus(),(J=N.value)==null||J.select()})}function he(){f.value=!1,h.value="",b.value=""}function Se(){const k=h.value,P=b.value.trim();!k||!P||(r("rename-thread",{threadId:k,title:P}),he())}function Me(k,P){O.value=k,Y.value=P,I.value=!0,V()}function Ke(){I.value=!1,O.value="",Y.value=""}function Pe(){const k=O.value;k&&(i.value=i.value.filter(P=>P!==k),r("archive",k),Ke())}function Ve(k){return n.projectDisplayNameById[k]??k}function _t(k){return a.value===k}function U(){a.value="",u.value="actions",c.value=""}function K(){Be.value=!Be.value}function ne(k){Qe.value=k,Be.value=!1}function Je(k){if(a.value===k){U();return}a.value=k,u.value="actions",c.value=Ve(k)}function it(k){a.value=k,u.value="rename",c.value=Ve(k)}function kt(k){r("rename-project",{projectName:k,displayName:c.value})}function xt(k){r("remove-project",k),U()}function ln(k){r("browse-project-files",k),U()}function Sr(k,P){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const M=n.groups.findIndex(Ot=>Ot.projectName===P);if(M<0)return;const J=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(M+J,n.groups.length-1));Ue!==M&&(k.preventDefault(),r("reorder-project",{projectName:P,toIndex:Ue}))}function rn(k){return s.value[k]===!0}function Ne(k){return o.value[k]===!0}function Oe(k){s.value={...s.value,[k]:!rn(k)}}function fn(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Ne(k)}}function jt(k){const P=Ie.value[k]??0,M=j.value,Ue=((M==null?void 0:M.projectName)===k?M.groupHeight:null)??P,Ot=Ne(k)?0:Cc;return Math.max(0,Ue+Ot)}function Er(k,P){const M=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(M){ee.set(k,M);return}ee.delete(k)}function _n(k,P){const M=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(M){ye.set(k,M);return}ye.delete(k)}function kn(k){const P=a.value;if(!P)return!1;const M=ee.get(P);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function _(k){const P=l.value;if(!P)return!1;const M=ye.get(P);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function S(k){if(Be.value){const P=je.value,M=typeof k.composedPath=="function"?k.composedPath():[];!!P&&(M.includes(P)||k.target instanceof Node&&P.contains(k.target))||(Be.value=!1)}a.value&&(kn(k)||U(),l.value&&(_(k)||V()))}function E(k){a.value&&!kn(k)&&U(),l.value&&!_(k)&&V()}function q(){Be.value&&(Be.value=!1),a.value&&U(),l.value&&V()}function ge(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",q)}function le(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",q)}function Ae(k,P){const M=P.getBoundingClientRect().height;if(!Number.isFinite(M)||M<=0)return;const J=Ie.value[k];J!==void 0&&Math.abs(J-M)<.5||(Ie.value={...Ie.value,[k]:M})}function ke(k,P){const M=re.get(k);M&&M!==P&&Re&&Re.unobserve(M);const J=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(J){re.set(k,J),te.set(J,k),Ae(k,J),Re==null||Re.observe(J);return}M&&(Re==null||Re.unobserve(M)),re.delete(k)}function We(k,P){if(k.button!==0||z.value||j.value)return;const M=n.groups.findIndex(Zt=>Zt.projectName===P),J=re.get(P);if(M<0||!J)return;const Ue=J.getBoundingClientRect(),Ot=Ne(P)?0:Cc;z.value={projectName:P,fromIndex:M,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Ot},k.preventDefault(),at()}function at(){window.addEventListener("mousemove",Pt),window.addEventListener("mouseup",Mt),window.addEventListener("keydown",sn)}function lt(){window.removeEventListener("mousemove",Pt),window.removeEventListener("mouseup",Mt),window.removeEventListener("keydown",sn)}function Pt(k){oe={clientX:k.clientX,clientY:k.clientY},ks()}function Mt(k){Cr({clientX:k.clientX,clientY:k.clientY});const P=j.value;if(P&&me.value!==null){const M=n.groups.findIndex(J=>J.projectName===P.projectName);if(M>=0){const J=me.value;J!==M&&r("reorder-project",{projectName:P.projectName,toIndex:J})}}Dn()}function sn(k){k.key==="Escape"&&(!z.value&&!j.value||(k.preventDefault(),Dn()))}function Dn(){de!==null&&(window.cancelAnimationFrame(de),de=null),oe=null,z.value=null,j.value=null,ve.value="",lt()}function ks(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!oe)return;const k=oe;oe=null,Cr(k)}))}function Cr(k){const P=z.value;if(!j.value&&P){const M=k.clientX-P.startClientX,J=k.clientY-P.startClientY;if(Math.hypot(M,J)<Ay)return;U(),ve.value=P.projectName,j.value={projectName:P.projectName,fromIndex:P.fromIndex,pointerOffsetY:P.pointerOffsetY,groupLeft:P.groupLeft,groupWidth:P.groupWidth,groupHeight:P.groupHeight,groupOuterHeight:P.groupOuterHeight,ghostTop:k.clientY-P.pointerOffsetY,dropTargetIndexFull:null}}j.value&&Gr(k)}function Gr(k){const P=j.value;if(!P)return;if(P.ghostTop=k.clientY-P.pointerOffsetY,!Ln(k)){P.dropTargetIndexFull=null;return}const M=k.clientY,J=$.value;if(!J){P.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),Ot=new Map(n.groups.map((on,lr)=>[on.projectName,lr])),Zt=n.groups.map(on=>on.projectName).filter(on=>on!==P.projectName);let Bn=0,Un=n.groups.length;for(const on of Zt){const lr=Ot.get(on);if(lr===void 0)continue;const Yr=jt(on),Qr=Ue.top+Bn+Yr/2;if(M<Qr){Un=lr;break}Bn+=Yr}P.dropTargetIndexFull=Un}function Ln(k){const P=$.value;if(!P)return!1;const M=P.getBoundingClientRect(),J=k.clientX>=M.left&&k.clientX<=M.right,Ue=k.clientY>=M.top-32&&k.clientY<=M.bottom+32;return J&&Ue}function Kr(k){var P;return((P=j.value)==null?void 0:P.projectName)===k}function Jr(k){const P=j.value,M=fe.value[k]??0,J=a.value===k;return!P||P.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${M}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${P.groupLeft}px`,width:`${P.groupWidth}px`,height:`${P.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${P.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(k){return k.threads.filter(P=>!v(P.id))}function Ts(k){if(nt.value)return jn(k);if(Ne(k.projectName))return[];const P=jn(k);return rn(k.projectName)?P:P.slice(0,10)}function Is(k){return nt.value?!1:!Ne(k.projectName)&&jn(k).length>10}function Ss(k){return jn(k).length>0}function Ar(k){return k.inProgress?"working":k.unread?"unread":"idle"}mt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Ot;const P=((Ue=j.value)==null?void 0:Ue.projectName)??((Ot=z.value)==null?void 0:Ot.projectName)??"";P&&!n.groups.some(Zt=>Zt.projectName===P)&&Dn();const M=new Set(k),J=Object.fromEntries(Object.entries(Ie.value).filter(([Zt])=>M.has(Zt)));Object.keys(J).length!==Object.keys(Ie.value).length&&(Ie.value=J)});const Rr=pe(()=>Be.value||a.value!=="");return mt(Rr,k=>{if(k){ge();return}le()}),ar(()=>{for(const k of re.values())Re==null||Re.unobserve(k);re.clear(),ee.clear(),le(),Dn()}),(k,P)=>(w(),T("section",wv,[W.value.length>0?(w(),T("section",bv,[m("ul",_v,[(w(!0),T(He,null,Et(W.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:pt(()=>[m("span",kv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(M)},null,8,Tv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Ni,{class:"thread-icon"})],8,Iv)])]),right:pt(()=>[m("span",Av,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,Rv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[0]||(P[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,xv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,Pv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Mv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",Ev,[m("span",Cv,ce(M.title),1),M.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Sv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):se("",!0),Ce($r,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:je,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:K},[Ce(Ps,{class:"thread-icon"})],8,Ov),Be.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:P[3]||(P[3]=tt(()=>{},["stop"]))},[P[11]||(P[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Qe.value==="project",type:"button",onClick:P[1]||(P[1]=M=>ne("project"))},[P[9]||(P[9]=m("span",null,"By project",-1)),Qe.value==="project"?(w(),T("span",$v,"✓")):se("",!0)],8,Nv),m("button",{class:"organize-menu-item","data-active":Qe.value==="chronological",type:"button",onClick:P[2]||(P[2]=M=>ne("chronological"))},[P[10]||(P[10]=m("span",null,"Chronological list",-1)),Qe.value==="chronological"?(w(),T("span",Lv,"✓")):se("",!0)],8,Dv)])):se("",!0)],512)]),default:pt(()=>[P[12]||(P[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&ht.value.length===0?(w(),T("p",jv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Bv,"Loading threads...")):Rt.value?(w(),T("ul",Uv,[(w(!0),T(He,null,Et(Ge.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:pt(()=>[m("span",Fv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(M)},null,8,Hv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Ni,{class:"thread-icon"})],8,Vv)])]),right:pt(()=>[m("span",Gv,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,Kv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[4]||(P[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,Jv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,Yv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Qv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",zv,[m("span",qv,ce(M.title),1),M.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Wv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:$,class:"thread-tree-groups",style:zr(De.value)},[(w(!0),T(He,null,Et(ht.value,M=>(w(),T("article",{key:M.projectName,ref_for:!0,ref:J=>ke(M.projectName,J),class:"project-group","data-project-name":M.projectName,"data-expanded":!Ne(M.projectName),"data-dragging":Kr(M.projectName),style:zr(Jr(M.projectName))},[Ce($r,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>fn(M.projectName),onKeydown:[J=>Sr(J,M.projectName),Yt(tt(J=>fn(M.projectName),["prevent"]),["enter"]),Yt(tt(J=>fn(M.projectName),["prevent"]),["space"])]},{left:pt(()=>[m("span",Zv,[m("span",ey,[Ne(M.projectName)?(w(),yt(Qd,{key:0,class:"thread-icon"})):(w(),yt(iv,{key:1,class:"thread-icon"}))]),m("span",ty,[Ne(M.projectName)?(w(),yt(Yd,{key:0,class:"thread-icon"})):(w(),yt(ui,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[m("div",sy,[m("div",{ref_for:!0,ref:J=>Er(M.projectName,J),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(J=>Je(M.projectName),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,oy),_t(M.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:P[6]||(P[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:J=>ln(M.projectName)}," Browse files ",8,iy),m("button",{class:"project-menu-item",type:"button",onClick:J=>it(M.projectName)}," Edit name ",8,ay),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>xt(M.projectName)}," Remove ",8,ly)],64)):(w(),T(He,{key:1},[P[13]||(P[13]=m("label",{class:"project-menu-label"},"Project name",-1)),tr(m("input",{"onUpdate:modelValue":P[5]||(P[5]=J=>c.value=J),class:"project-menu-input",type:"text",onInput:J=>kt(M.projectName)},null,40,cy),[[nr,c.value]])],64))])):se("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":x(M.projectName),title:x(M.projectName),onClick:tt(J=>D(M.projectName),["stop"])},[Ce(Fo,{class:"thread-icon"})],8,uy)])]),default:pt(()=>[m("span",{class:"project-main-button","data-dragging-handle":Kr(M.projectName),onMousedown:tt(J=>We(J,M.projectName),["left"])},[m("span",ry,ce(Ve(M.projectName)),1)],40,ny)]),_:2},1032,["onClick","onKeydown"]),Ss(M)?(w(),T("ul",dy,[(w(!0),T(He,null,Et(Ts(M),J=>(w(),T("li",{key:J.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":v(J.id),onMouseleave:Ue=>B(J.id)},{left:pt(()=>[m("span",fy,[J.inProgress||J.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(J)},null,8,hy)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>A(J.id)},[Ce(Ni,{class:"thread-icon"})],8,py)])]),right:pt(()=>[m("span",yy,ce(g(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:Ue=>_n(J.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>be(J.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,wy),G(J.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[7]||(P[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>F(J.id)}," Export chat ",8,by),m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ae(J.id,J.title)}," Rename thread ",8,_y),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Me(J.id,J.title)}," Delete thread ",8,ky)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(J.id)},[m("span",gy,[m("span",vy,ce(J.title),1),J.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,my)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),yt($r,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...P[14]||(P[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[P[15]||(P[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Is(M)?(w(),yt($r,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...P[16]||(P[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:J=>Oe(M.projectName)},ce(rn(M.projectName)?"Show less":"Show more"),9,Ty)]),_:2},1024)):se("",!0)],12,Xv))),128))],4)),(w(),yt(Do,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(he,["self"])},[m("div",Iy,[P[17]||(P[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),P[18]||(P[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),tr(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":P[8]||(P[8]=M=>b.value=M),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(tt(Se,["prevent"]),["enter"]),Yt(tt(he,["prevent"]),["esc"])]},null,40,Sy),[[nr,b.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:he},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Se},"Save")])])])):se("",!0)])),(w(),yt(Do,{to:"body"},[I.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Ke,["self"])},[m("div",Ey,[P[19]||(P[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Cy,' This will archive the thread "'+ce(Y.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:Ke},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Pe},"Delete")])])])):se("",!0)]))]))}}),xy=st(Ry,[["__scopeId","data-v-e2f8a8e1"]]),Py={class:"content-header"},My={class:"content-leading"},Oy={class:"content-title"},Ny={class:"content-actions"},$y=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Py,[m("div",My,[Mn(t.$slots,"leading",{},void 0)]),m("h1",Oy,ce(e.title),1),m("div",Ny,[Mn(t.$slots,"actions",{},void 0)])]))}}),Dy=st($y,[["__scopeId","data-v-66ee223c"]]),Ly={},jy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function By(e,t){return w(),T("svg",jy,[...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 Xa=st(Ly,[["render",By]]),Uy={},Fy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hy(e,t){return w(),T("svg",Fy,[...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 Vy=st(Uy,[["render",Hy]]),Wy={},zy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function qy(e,t){return w(),T("svg",zy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Gy=st(Wy,[["render",qy]]),Ky={class:"conversation-root"},Jy={key:0,class:"conversation-loading"},Yy={key:1,class:"conversation-empty"},Qy={class:"message-row"},Xy={class:"message-stack"},Zy={class:"request-card"},ew={class:"request-title"},tw={class:"request-meta"},nw={key:0,class:"request-reason"},rw={key:1,class:"request-actions"},sw=["onClick"],ow=["onClick"],iw=["onClick"],aw=["onClick"],lw={key:2,class:"request-actions"},cw=["onClick"],uw=["onClick"],dw=["onClick"],fw=["onClick"],hw={key:3,class:"request-user-input"},pw={class:"request-question-title"},mw={key:0,class:"request-question-text"},gw=["value","onChange"],vw=["value"],yw=["value","onInput"],ww=["onClick"],bw={key:4,class:"request-actions"},_w=["onClick"],kw=["onClick"],Tw={key:5,class:"request-actions"},Iw=["onClick"],Sw=["onClick"],Ew=["data-role","data-message-type"],Cw={key:0,class:"message-row","data-role":"system"},Aw={class:"message-stack","data-role":"system"},Rw=["onClick"],xw={class:"cmd-label"},Pw={class:"cmd-status"},Mw={class:"cmd-output-inner"},Ow={class:"cmd-output"},Nw=["data-role","data-message-type"],$w=["data-role"],Dw=["data-role"],Lw=["data-role"],jw=["onClick"],Bw=["src"],Uw={key:1,class:"message-file-attachments"},Fw=["href","title"],Hw=["data-role"],Vw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Ww=["onClick"],zw={class:"worked-separator-text"},qw={key:0,class:"worked-details"},Gw=["onClick"],Kw={class:"cmd-label"},Jw={class:"cmd-status"},Yw={class:"cmd-output-inner"},Qw={class:"cmd-output"},Xw={key:1,class:"message-text-flow"},Zw={key:0,class:"message-text"},eb={key:0},tb={key:1,class:"message-bold-text"},nb=["href","title"],rb=["href","title"],sb={key:4,class:"message-inline-code"},ob={key:1,class:"message-text"},ib=["onClick"],ab=["src","alt","onError"],lb={key:0,class:"message-actions"},cb=["onClick"],ub=["onClick"],db={key:0,class:"conversation-item conversation-item-overlay"},fb={class:"message-row"},hb={class:"message-stack"},pb={class:"live-overlay-inline","aria-live":"polite"},mb={class:"live-overlay-label"},gb={key:1,class:"live-overlay-error"},vb=["src"],yb=16,wb=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var S;return((S=_.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var E;if(((E=_.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(_.id)?S.delete(_.id):S.add(_.id),n.value=S}function c(_){const S=new Set(s.value);S.has(_.id)?S.delete(_.id):S.add(_.id),s.value=S}function f(_){return s.value.has(_.id)}function h(_){const S=_.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(_){var E,q;const S=(E=_.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((q=_.commandExecution)==null?void 0:q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(_){const S=new Set(r.value);S.add(_),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(_),r.value=E},1e3)}function I(_,S){const E=[];for(let q=S-1;q>=0;q--){const ge=_[q];if(ge.messageType==="commandExecution")E.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return E}const O=e,Y=t,$=L(null),z=L(null),j=L(null),oe=L(""),de=L({}),ve=L({});let Ie=0,re=0,ee=0;const ye=new WeakSet,te=L(new Set);function je(_){if(!_||/\s/u.test(_)||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const S=_.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(_),q=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),ge=_.includes("/")||_.includes("\\");return S||E||q||ge}function Be(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Qe(_){return _.replace(/\\/gu,"/")}function Re(_){if(!_.startsWith("file://"))return _;let S=_.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Te(_){const S=Qe(_),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const q=S.match(/^\/home\/([^/]+)/u);return q?`/home/${q[1]}`:""}function $e(_){const S=Qe(_);if(!S)return S;let E="",q=S;const ge=q.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(E=`${ge[1]}/`,q=(ge[2]??"").replace(/^\/+/u,"")):q.startsWith("/")&&(E="/",q=q.slice(1));const le=q.split("/").filter(Boolean),Ae=[];for(const We of le)if(We!=="."){if(We===".."){Ae.length>0&&Ae.pop();continue}Ae.push(We)}const ke=Ae.join("/");return E?`${E}${ke}`.replace(/\/+$/u,"")||E:ke||S}function It(_,S){const E=Qe(Re(_.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return $e(E);if(E.startsWith("~/")){const le=Te(S);if(le)return $e(`${le}/${E.slice(2)}`)}const ge=Qe(S.trim());return $e(ge?`${ge.replace(/\/+$/u,"")}/${E}`:E)}function nt(_){if(!_)return null;let S=_.trim();S=Xe(S).core.trim();let q=null;const ge=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)S=ge[1],q=Number(ge[2]);else{const le=S.match(/^(.*):(\d+)(?::\d+)?$/u);le&&(S=le[1],q=Number(le[2]))}return S=Re(S),je(S)?{path:S,line:q}:null}function Xe(_){let S=_,E="",q="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)q=S.slice(-1)+q,S=S.slice(0,-1);return{core:S,leading:E,trailing:q}}function Ze(_){const E=_.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const q=(E[1]??"").trim(),ge=(E[2]??"").trim(),le=Xe(q).core.trim()||q,Ae=Xe(ge).core.trim();return Ae?{label:le,target:Ae}:null}function ht(_){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let q=0;for(const ge of _.matchAll(E)){if(typeof ge.index!="number")continue;const le=ge.index,Ae=le+ge[0].length;le>q&&S.push({kind:"text",value:_.slice(q,le)});let ke=ge[0],We="";for(;/[.,;:]$/u.test(ke);)We=ke.slice(-1)+We,ke=ke.slice(0,-1);const at=Xe(ke);ke=at.core;const lt=at.leading,Pt=at.trailing+We;if(lt&&S.push({kind:"text",value:lt}),ke.startsWith("**")&&ke.endsWith("**")&&ke.length>4)S.push({kind:"bold",value:ke.slice(2,-2)}),Pt&&S.push({kind:"text",value:Pt});else if(/^https?:\/\//u.test(ke))S.push({kind:"url",value:ke,href:ke}),Pt&&S.push({kind:"text",value:Pt});else{const Mt=nt(ke);Mt?(S.push({kind:"file",value:ke,path:Mt.path,displayPath:ke,downloadName:Be(Mt.path)}),Pt&&S.push({kind:"text",value:Pt})):S.push({kind:"text",value:ge[0]})}q=Ae}return q<_.length&&S.push({kind:"text",value:_.slice(q)}),Rt(S)}function Rt(_){const S=[];let E=!1,q="";const ge=le=>{le&&S.push({kind:"text",value:le})};for(const le of _){if(le.kind!=="text"){E&&(ge(`**${q}`),E=!1,q=""),S.push(le);continue}let Ae=le.value;for(;Ae.length>0;){const ke=Ae.indexOf("**");if(ke<0){E?q+=Ae:ge(Ae);break}const We=Ae.slice(0,ke);E?q+=We:ge(We),Ae=Ae.slice(ke+2),E?(q.length>0?S.push({kind:"bold",value:q}):ge("****"),q="",E=!1):E=!0}}return E&&ge(`**${q}`),S}function Ge(_){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let q=0;for(const ge of _.matchAll(S)){if(typeof ge.index!="number")continue;const[le,Ae,ke]=ge,We=ge.index,at=We+le.length;We>q&&E.push(...ht(_.slice(q,We)));const lt=Ze(`[${Ae??""}](${ke??""})`),Pt=(lt==null?void 0:lt.label)??(Ae??"").trim(),Mt=(lt==null?void 0:lt.target)??(ke??"").trim();if(/^https?:\/\//u.test(Mt))E.push({kind:"url",value:Pt||Mt,href:Mt});else{const sn=nt(Mt);sn?E.push({kind:"file",value:Mt,path:sn.path,displayPath:Pt||Mt,downloadName:Be(sn.path)}):E.push({kind:"text",value:le})}q=at}return q<_.length&&E.push(...ht(_.slice(q))),E}function et(_){if(!_.includes("`"))return Ge(_);const S=[];let E=0,q=0;for(;E<_.length;){if(_[E]!=="`"){E+=1;continue}let ge=1;for(;E+ge<_.length&&_[E+ge]==="`";)ge+=1;const le="`".repeat(ge);let Ae=E+ge,ke=-1;for(;Ae<_.length;){const at=_.indexOf(le,Ae);if(at<0)break;const lt=at>0&&_[at-1]==="`",Pt=at+ge<_.length&&_[at+ge]==="`",Mt=_.slice(E+ge,at).includes(`
26
- `);if(!lt&&!Pt&&!Mt){ke=at;break}Ae=at+1}if(ke<0){E+=ge;continue}E>q&&S.push(...Ge(_.slice(q,E)));const We=_.slice(E+ge,ke);if(We.length>0){const at=Ze(We);if(at)if(/^https?:\/\//u.test(at.target))S.push({kind:"url",value:at.label||at.target,href:at.target});else{const lt=nt(at.target);lt?S.push({kind:"file",value:at.target,path:lt.path,displayPath:at.label||at.target,downloadName:Be(lt.path)}):S.push({kind:"code",value:We})}else{const lt=nt(We);if(lt){const Pt=lt.line?`${lt.path}:${String(lt.line)}`:lt.path;S.push({kind:"file",value:We,path:lt.path,displayPath:Pt,downloadName:Be(lt.path)})}else S.push({kind:"code",value:We})}}else S.push({kind:"text",value:`${le}${le}`});E=ke+ge,q=E}return q<_.length&&S.push(...Ge(_.slice(q))),S}function W(_){const S=_.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),q=/^[A-Za-z]:[\\/]/u.test(S);return E||q?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function me(_){const S=_.trim();if(!S)return"#";const E=Ae=>Ae.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ae),q=nt(S),ge=(q==null?void 0:q.path)??S,le=It(ge,O.cwd);if(E(le)){const Ae=le.startsWith("/")?le:`/${le}`;return`/codex-local-browse${encodeURI(Ae)}`}return"#"}function ie(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let q=0;for(const ge of _.matchAll(E)){const[le,Ae,ke]=ge;if(typeof ge.index!="number")continue;const We=ge.index,at=We+le.length,lt=W(ke.trim());lt&&(We>q&&S.push({kind:"text",value:_.slice(q,We)}),S.push({kind:"image",url:lt,alt:Ae.trim(),markdown:le}),q=at)}return q<_.length&&S.push({kind:"text",value:_.slice(q)}),S.length>0?S:[{kind:"text",value:_}]}function fe(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function De(_){const S=new Date(_);return Number.isNaN(S.getTime())?_:S.toLocaleTimeString()}function g(_){const S=fe(_.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function v(_,S){return`${String(_)}:${S}`}function A(_){const S=fe(_.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],q=[];for(const ge of E){const le=fe(ge);if(!le)continue;const Ae=typeof le.id=="string"?le.id:"";if(!Ae)continue;const ke=Array.isArray(le.options)?le.options.map(We=>fe(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];q.push({id:Ae,header:typeof le.header=="string"?le.header:"",question:typeof le.question=="string"?le.question:"",isOther:le.isOther===!0,options:ke})}return q}function H(_,S,E){const q=v(_,S),ge=de.value[q];return typeof ge=="string"&&ge.length>0?ge:E}function F(_,S){const E=v(_,S);return ve.value[E]??""}function x(_,S,E){const q=E.target;if(!(q instanceof HTMLSelectElement))return;const ge=v(_,S);de.value={...de.value,[ge]:q.value}}function D(_,S,E){const q=E.target;if(!(q instanceof HTMLInputElement))return;const ge=v(_,S);ve.value={...ve.value,[ge]:q.value}}function B(_,S){Y("respondServerRequest",{id:_,result:{decision:S}})}function G(_){const S=A(_),E={};for(const q of S){const ge=H(_.id,q.id,q.options[0]||""),le=F(_.id,q.id).trim(),Ae=[ge,le].map(ke=>ke.trim()).filter(ke=>ke.length>0);E[q.id]={answers:Ae}}Y("respondServerRequest",{id:_.id,result:{answers:E}})}function V(_){Y("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function be(_){Y("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function ae(_){Y("respondServerRequest",{id:_,result:{}})}function he(_){Y("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Se(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||O.isTurnInProgress||O.isRollingBack)}function Me(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function Ke(_){return Me(_)||Se(_)}async function Pe(_){if(!Me(_))return;const S=_.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function Ve(_){Se(_)&&Y("rollback",{turnIndex:_.turnIndex})}function _t(){const _=$.value,S=z.value;!_||!S||(_.scrollTop=_.scrollHeight,S.scrollIntoView({block:"end"}))}function U(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=yb}function K(_){if(!O.activeThreadId)return;const S=Math.max(_.scrollHeight-_.clientHeight,0),E=S>0?Math.min(Math.max(_.scrollTop/S,0),1):1;Y("updateScrollState",{threadId:O.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:U(_),scrollRatio:E}})}function ne(){const _=$.value;if(!_)return;const S=O.scrollState;if(!S||S.isAtBottom){Je();return}const E=Math.max(_.scrollHeight-_.clientHeight,0),q=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;_.scrollTop=Math.min(Math.max(q,0),E),K(_)}function Je(){const _=$.value;_&&(_t(),K(_))}function it(){const _=O.scrollState;return!_||_.isAtBottom===!0}function kt(){if(!it()){ee=0,re=0;return}if(Je(),ee-=1,ee<=0){re=0;return}re=requestAnimationFrame(kt)}function xt(_=6){it()&&(re&&(cancelAnimationFrame(re),re=0),ee=Math.max(_,1),re=requestAnimationFrame(kt))}function ln(){xt(3)}function Sr(){if(!it())return;const _=$.value;if(!_)return;const S=_.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",ln,{once:!0}),E.addEventListener("error",ln,{once:!0}))}async function rn(){await tn(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,ne(),Sr(),xt()})}mt(()=>O.messages,async _=>{if(!O.isLoading){for(const S of _){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],q=S.commandExecution.status;E==="inProgress"&&q!=="inProgress"&&N(S.id),o.value[S.id]=q}await rn()}}),mt(()=>O.liveOverlay,async _=>{_&&(await tn(),Je(),xt(8))},{deep:!0}),mt(()=>O.isLoading,async _=>{_||await rn()}),mt(()=>O.activeThreadId,()=>{oe.value="",te.value=new Set},{flush:"post"});function Ne(){const _=$.value;!_||O.isLoading||K(_)}function Oe(_){oe.value=W(_)}function fn(_,S){return`${_}:${String(S)}`}function jt(_,S){const E=new Set(te.value);E.add(fn(_,S)),te.value=E}function Er(_,S){return te.value.has(fn(_,S))}function _n(){oe.value=""}function kn(){const _=j.value;_&&(_.scrollTop=_.scrollHeight)}return mt(()=>{var _;return(_=O.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await tn(),kn())}),ar(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(_,S)=>(w(),T("section",Ky,[e.isLoading?(w(),T("p",Jy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Yy," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Ne},[(w(!0),T(He,null,Et(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[m("div",Qy,[m("div",Xy,[m("article",Zy,[m("p",ew,ce(E.method),1),m("p",tw,"Request #"+ce(E.id)+" · "+ce(De(E.receivedAtIso)),1),g(E)?(w(),T("p",nw,ce(g(E)),1)):se("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",rw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>B(E.id,"accept")},"Accept",8,sw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"acceptForSession")},"Accept for Session",8,ow),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"decline")},"Decline",8,iw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"cancel")},"Cancel",8,aw)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",lw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>B(E.id,"accept")},"Accept",8,cw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"acceptForSession")},"Accept for Session",8,uw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"decline")},"Decline",8,dw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"cancel")},"Cancel",8,fw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",hw,[(w(!0),T(He,null,Et(A(E),q=>(w(),T("div",{key:`${E.id}:${q.id}`,class:"request-question"},[m("p",pw,ce(q.header||q.question),1),q.header&&q.question?(w(),T("p",mw,ce(q.question),1)):se("",!0),m("select",{class:"request-select",value:H(E.id,q.id,q.options[0]||""),onChange:ge=>x(E.id,q.id,ge)},[(w(!0),T(He,null,Et(q.options,ge=>(w(),T("option",{key:`${E.id}:${q.id}:${ge}`,value:ge},ce(ge),9,vw))),128))],40,gw),q.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:F(E.id,q.id),placeholder:"Other answer",onInput:ge=>D(E.id,q.id,ge)},null,40,yw)):se("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>G(E)}," Submit Answers ",8,ww)])):E.method==="item/tool/call"?(w(),T("section",bw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>V(E.id)},"Fail Tool Call",8,_w),m("button",{type:"button",class:"request-button",onClick:q=>be(E.id)},"Success (Empty)",8,kw)])):(w(),T("section",Tw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>ae(E.id)},"Return Empty Result",8,Iw),m("button",{type:"button",class:"request-button",onClick:q=>he(E.id)},"Reject Request",8,Sw)]))])])])]))),128)),(w(!0),T(He,null,Et(e.messages,E=>{var q,ge;return w(),T("li",{key:E.id,class:gt(["conversation-item",{"conversation-item-actionable":Ke(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Cw,[m("div",Aw,[m("button",{type:"button",class:gt(["cmd-row",[b(E),{"cmd-expanded":a(E)}]]),onClick:le=>u(E)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),m("code",xw,ce(((q=E.commandExecution)==null?void 0:q.command)||"(command)"),1),m("span",Pw,ce(h(E)),1)],10,Rw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[m("div",Mw,[m("pre",Ow,ce(((ge=E.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[m("div",{class:"message-stack","data-role":E.role},[m("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(He,null,Et(E.images,le=>(w(),T("li",{key:le,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ae=>Oe(le)},[m("img",{class:"message-image-preview",src:W(le),alt:"Message image preview",loading:"lazy"},null,8,Bw)],8,jw)]))),128))],8,Lw)):se("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",Uw,[(w(!0),T(He,null,Et(E.fileAttachments,le=>(w(),T("span",{key:le.path,class:"message-file-chip"},[S[1]||(S[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:me(le.path),target:"_blank",rel:"noopener noreferrer",title:le.path},ce(le.path),9,Fw)]))),128))])):se("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Vw,[m("button",{type:"button",class:"worked-separator",onClick:le=>c(E)},[S[2]||(S[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:gt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),m("p",zw,ce(E.text),1),S[3]||(S[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Ww),f(E)?(w(),T("div",qw,[(w(!0),T(He,null,Et(I(e.messages,e.messages.indexOf(E)),le=>{var Ae,ke;return w(),T("div",{key:`worked-cmd-${le.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:gt(["cmd-row",[b(le),{"cmd-expanded":a(le)}]]),onClick:We=>u(le)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(le)}])},"▶",2),m("code",Kw,ce(((Ae=le.commandExecution)==null?void 0:Ae.command)||"(command)"),1),m("span",Jw,ce(h(le)),1)],10,Gw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(le),"cmd-output-collapsing":l(le)}])},[m("div",Yw,[m("pre",Qw,ce(((ke=le.commandExecution)==null?void 0:ke.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):se("",!0)])):(w(),T("div",Xw,[(w(!0),T(He,null,Et(ie(E.text),(le,Ae)=>(w(),T(He,{key:`block-${Ae}`},[le.kind==="text"?(w(),T("p",Zw,[(w(!0),T(He,null,Et(et(le.value),(ke,We)=>(w(),T(He,{key:`seg-${Ae}-${We}`},[ke.kind==="text"?(w(),T("span",eb,ce(ke.value),1)):ke.kind==="bold"?(w(),T("strong",tb,ce(ke.value),1)):ke.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:me(ke.path),target:"_blank",rel:"noopener noreferrer",title:ke.path},ce(ke.displayPath),9,nb)):ke.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ke.href,target:"_blank",rel:"noopener noreferrer",title:ke.href},ce(ke.value),9,rb)):(w(),T("code",sb,ce(ke.value),1))],64))),128))])):Er(E.id,Ae)?(w(),T("p",ob,ce(le.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ke=>Oe(le.url)},[m("img",{class:"message-image-preview message-markdown-image",src:le.url,alt:le.alt||"Embedded message image",loading:"lazy",onError:ke=>jt(E.id,Ae)},null,40,ab)],8,ib))],64))),128))]))],8,Hw)):se("",!0)],8,Dw),Ke(E)?(w(),T("div",lb,[Me(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:le=>Pe(E)},[Ce(Gy,{class:"message-action-icon"}),S[4]||(S[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,cb)):se("",!0),Se(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:le=>Ve(E)},[Ce(Vy,{class:"message-action-icon"}),S[5]||(S[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,ub)):se("",!0)])):se("",!0)],8,$w)],8,Nw))],10,Ew)}),128)),e.liveOverlay?(w(),T("li",db,[m("div",fb,[m("div",hb,[m("article",pb,[m("p",mb,ce(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:j},ce(e.liveOverlay.reasoningText),513)):se("",!0),e.liveOverlay.errorText?(w(),T("p",gb,ce(e.liveOverlay.errorText),1)):se("",!0)])])])])):se("",!0),m("li",{ref_key:"bottomAnchorRef",ref:z,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:_n},[m("div",{class:"image-modal-content",onClick:S[0]||(S[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:_n},[Ce(Xa,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,vb)])])):se("",!0)]))}}),bb=st(wb,[["__scopeId","data-v-b2208f01"]]);function _b(e){var c;const t=L("idle"),n=L(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.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=h=>{h.data.size>0&&o.push(h.data)},r.onstop=()=>{var N;const h=o,b=(r==null?void 0:r.mimeType)||((N=h[0])==null?void 0:N.type)||"audio/webm";u(),t.value="idle",l(h,b)},r.start(),t.value="recording"}catch(h){u(),(f=e.onError)==null||f.call(e,h)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,h){var N;if(f.length===0)return;const b=new Blob(f,{type:h});try{const I=h.split(/[/;]/)[1]??"webm",O=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await b.arrayBuffer()),$=new TextEncoder,z=[];z.push($.encode(`--${O}\r
27
- `)),z.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
- `)),z.push($.encode(`Content-Type: ${h}\r
25
+ */let og=()=>location.protocol+"//"+location.host;function Wd(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),lc(a,"")}return lc(n,e)+r+s}function ig(e,t,n,r){let s=[],o=[],i=null;const a=({state:p})=>{const _=Wd(e,location),N=n.value,I=t.value;let M=0;if(p){if(n.value=_,t.value=p,i&&i===N){i=null;return}M=I?p.position-I.position:0}else r(_);s.forEach(Y=>{Y(n.value,N,{delta:M,type:da.pop,direction:M?M>0?Pi.forward:Pi.back:Pi.unknown})})};function l(){i=n.value}function u(p){s.push(p);const _=()=>{const N=s.indexOf(p);N>-1&&s.splice(N,1)};return o.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(ut({},p.state,{scroll:ai()}),"")}}function f(){for(const p of o)p();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function hc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ai():null}}function ag(e){const{history:t,location:n}=window,r={value:Wd(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,u,c){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:og()+e+l;try{t[c?"replaceState":"pushState"](u,"",p),s.value=u}catch(_){console.error(_),n[c?"replace":"assign"](p)}}function i(l,u){o(l,ut({},t.state,hc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ut({},s.value,t.state,{forward:l,scroll:ai()});o(c.current,c,!0),o(l,ut({},hc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function lg(e){e=zm(e);const t=ag(e),n=ig(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:Gm.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 cg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),lg(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Nt=(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})(Nt||{});const ug={type:Ur.Static,value:""},dg=/[a-zA-Z0-9_]/;function fg(e){if(!e)return[[]];if(e==="/")return[[ug]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${u}": ${_}`)}let n=Nt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Nt.Static?o.push({type:Ur.Static,value:u}):n===Nt.Param||n===Nt.ParamRegExp||n===Nt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Ur.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function p(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Nt.ParamRegExp){r=n,n=Nt.EscapeNext;continue}switch(n){case Nt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Nt.Param):p();break;case Nt.EscapeNext:p(),n=r;break;case Nt.Param:l==="("?n=Nt.ParamRegExp:dg.test(l)?p():(f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Nt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Nt.ParamRegExpEnd:c+=l;break;case Nt.ParamRegExpEnd:f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Nt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const pc="[^/]+?",hg={sensitive:!1,strict:!1,start:!0,end:!0};var Kt=(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})(Kt||{});const pg=/[.+*?^${}()[\]/\\]/g;function mg(e,t){const n=ut({},hg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Kt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const p=u[f];let _=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(p.type===Ur.Static)f||(s+="/"),s+=p.value.replace(pg,"\\$&"),_+=Kt.Static;else if(p.type===Ur.Param){const{value:N,repeatable:I,optional:M,regexp:Y}=p;o.push({name:N,repeatable:I,optional:M});const j=Y||pc;if(j!==pc){_+=Kt.BonusCustomRegExp;try{`${j}`}catch(B){throw new Error(`Invalid custom RegExp for param "${N}" (${j}): `+B.message)}}let q=I?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;f||(q=M&&u.length<2?`(?:/${q})`:"/"+q),M&&(q+="?"),s+=q,_+=Kt.Dynamic,M&&(_+=Kt.BonusOptional),I&&(_+=Kt.BonusRepeatable),j===".*"&&(_+=Kt.BonusWildcard)}c.push(_)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Kt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let p=1;p<c.length;p++){const _=c[p]||"",N=o[p-1];f[N.name]=_&&N.repeatable?_.split("/"):_}return f}function l(u){let c="",f=!1;for(const p of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const _ of p)if(_.type===Ur.Static)c+=_.value;else if(_.type===Ur.Param){const{value:N,repeatable:I,optional:M}=_,Y=N in u?u[N]:"";if(bn(Y)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const j=bn(Y)?Y.join("/"):Y;if(!j)if(M)p.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);c+=j}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function gg(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]===Kt.Static+Kt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Kt.Static+Kt.Segment?1:-1:0}function zd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=gg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(mc(r))return 1;if(mc(s))return-1}return s.length-r.length}function mc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const vg={strict:!1,end:!0,sensitive:!1};function yg(e,t,n){const r=mg(fg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function wg(e,t){const n=[],r=new Map;t=ac(vg,t);function s(f){return r.get(f)}function o(f,p,_){const N=!_,I=vc(f);I.aliasOf=_&&_.record;const M=ac(t,f),Y=[I];if("alias"in f){const B=typeof f.alias=="string"?[f.alias]:f.alias;for(const oe of B)Y.push(vc(ut({},I,{components:_?_.record.components:I.components,path:oe,aliasOf:_?_.record:I})))}let j,q;for(const B of Y){const{path:oe}=B;if(p&&oe[0]!=="/"){const de=p.record.path,ve=de[de.length-1]==="/"?"":"/";B.path=p.record.path+(oe&&ve+oe)}if(j=yg(B,p,M),_?_.alias.push(j):(q=q||j,q!==j&&q.alias.push(j),N&&f.name&&!yc(j)&&i(f.name)),qd(j)&&l(j),I.children){const de=I.children;for(let ve=0;ve<de.length;ve++)o(de[ve],j,_&&_.children[ve])}_=_||j}return q?()=>{i(q)}:Fs}function i(f){if(Hd(f)){const p=r.get(f);p&&(r.delete(f),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(f);p>-1&&(n.splice(p,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 p=kg(f,n);n.splice(p,0,f),f.record.name&&!yc(f)&&r.set(f.record.name,f)}function u(f,p){let _,N={},I,M;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw ms(At.MATCHER_NOT_FOUND,{location:f});M=_.record.name,N=ut(gc(p.params,_.keys.filter(q=>!q.optional).concat(_.parent?_.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),f.params&&gc(f.params,_.keys.map(q=>q.name))),I=_.stringify(N)}else if(f.path!=null)I=f.path,_=n.find(q=>q.re.test(I)),_&&(N=_.parse(I),M=_.record.name);else{if(_=p.name?r.get(p.name):n.find(q=>q.re.test(p.path)),!_)throw ms(At.MATCHER_NOT_FOUND,{location:f,currentLocation:p});M=_.record.name,N=ut({},p.params,f.params),I=_.stringify(N)}const Y=[];let j=_;for(;j;)Y.unshift(j.record),j=j.parent;return{name:M,path:I,params:N,matched:Y,meta:_g(Y)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function gc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function vc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bg(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 bg(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 yc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _g(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function kg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;zd(e,t[o])<0?r=o:n=o+1}const s=Tg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Tg(e){let t=e;for(;t=t.parent;)if(qd(t)&&zd(e,t)===0)return t}function qd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wc(e){const t=mn(li),n=mn(Ja),r=pe(()=>{const l=ue(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const p=f.findIndex(ps.bind(null,c));if(p>-1)return p;const _=bc(l[u-2]);return u>1&&bc(c)===_&&f[f.length-1].path!==_?f.findIndex(ps.bind(null,l[u-2])):p}),o=pe(()=>s.value>-1&&Ag(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Fd(n.params,r.value.params));function a(l={}){if(Cg(l)){const u=t[ue(e.replace)?"replace":"push"](ue(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Ig(e){return e.length===1?e[0]:e}const Sg=Lt({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:wc,setup(e,{slots:t}){const n=Zo(wc(e)),{options:r}=mn(li),s=pe(()=>({[_c(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[_c(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Ig(t.default(n));return e.custom?o:Ga("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Eg=Sg;function Cg(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 Ag(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(!bn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function bc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const _c=(e,t,n)=>e??t??n,Rg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=mn(ha),s=pe(()=>e.route||r.value),o=mn(fc,0),i=pe(()=>{let u=ue(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=pe(()=>s.value.matched[i.value]);To(fc,pe(()=>i.value+1)),To(rg,a),To(ha,s);const l=D();return mt(()=>[l.value,a.value,e.name],([u,c,f],[p,_,N])=>{c&&(c.instances[f]=u,_&&_!==c&&u&&u===p&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),u&&c&&(!_||!ps(c,_)||!p)&&(c.enterCallbacks[f]||[]).forEach(I=>I(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,p=f&&f.components[c];if(!p)return kc(n.default,{Component:p,route:u});const _=f.props[c],N=_?_===!0?u.params:typeof _=="function"?_(u):_:null,M=Ga(p,ut({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return kc(n.default,{Component:M,route:u})||M}}});function kc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Pg=Rg;function xg(e){const t=wg(e.routes,e),n=e.parseQuery||tg,r=e.stringifyQuery||dc,s=e.history,o=Ps(),i=Ps(),a=Ps(),l=Ph(dr);let u=dr;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ai.bind(null,W=>""+W),f=Ai.bind(null,jm),p=Ai.bind(null,Qs);function _(W,me){let ie,fe;return Hd(W)?(ie=t.getRecordMatcher(W),fe=me):fe=W,t.addRoute(fe,ie)}function N(W){const me=t.getRecordMatcher(W);me&&t.removeRoute(me)}function I(){return t.getRoutes().map(W=>W.record)}function M(W){return!!t.getRecordMatcher(W)}function Y(W,me){if(me=ut({},me||l.value),typeof W=="string"){const A=Ri(n,W,me.path),H=t.resolve({path:A.path},me),F=s.createHref(A.fullPath);return ut(A,H,{params:p(H.params),hash:Qs(A.hash),redirectedFrom:void 0,href:F})}let ie;if(W.path!=null)ie=ut({},W,{path:Ri(n,W.path,me.path).path});else{const A=ut({},W.params);for(const H in A)A[H]==null&&delete A[H];ie=ut({},W,{params:f(A)}),me.params=f(me.params)}const fe=t.resolve(ie,me),De=W.hash||"";fe.params=c(p(fe.params));const g=Fm(r,ut({},W,{hash:$m(De),path:fe.path})),v=s.createHref(g);return ut({fullPath:g,hash:De,query:r===dc?ng(W.query):W.query||{}},fe,{redirectedFrom:void 0,href:v})}function j(W){return typeof W=="string"?Ri(n,W,l.value.path):ut({},W)}function q(W,me){if(u!==W)return ms(At.NAVIGATION_CANCELLED,{from:me,to:W})}function B(W){return ve(W)}function oe(W){return B(ut(j(W),{replace:!0}))}function de(W,me){const ie=W.matched[W.matched.length-1];if(ie&&ie.redirect){const{redirect:fe}=ie;let De=typeof fe=="function"?fe(W,me):fe;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=j(De):{path:De},De.params={}),ut({query:W.query,hash:W.hash,params:De.path!=null?{}:W.params},De)}}function ve(W,me){const ie=u=Y(W),fe=l.value,De=W.state,g=W.force,v=W.replace===!0,A=de(ie,fe);if(A)return ve(ut(j(A),{state:typeof A=="object"?ut({},De,A.state):De,force:g,replace:v}),me||ie);const H=ie;H.redirectedFrom=me;let F;return!g&&Hm(r,fe,ie)&&(F=ms(At.NAVIGATION_DUPLICATED,{to:H,from:fe}),Xe(fe,fe,!0,!1)),(F?Promise.resolve(F):ee(H,fe)).catch(P=>Wn(P)?Wn(P,At.NAVIGATION_GUARD_REDIRECT)?P:nt(P):$e(P,H,fe)).then(P=>{if(P){if(Wn(P,At.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:v},j(P.to),{state:typeof P.to=="object"?ut({},De,P.to.state):De,force:g}),me||H)}else P=te(H,fe,!0,v,De);return ye(H,fe,P),P})}function Ie(W,me){const ie=q(W,me);return ie?Promise.reject(ie):Promise.resolve()}function re(W){const me=Rt.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(W):W()}function ee(W,me){let ie;const[fe,De,g]=sg(W,me);ie=xi(fe.reverse(),"beforeRouteLeave",W,me);for(const A of fe)A.leaveGuards.forEach(H=>{ie.push(mr(H,W,me))});const v=Ie.bind(null,W,me);return ie.push(v),et(ie).then(()=>{ie=[];for(const A of o.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).then(()=>{ie=xi(De,"beforeRouteUpdate",W,me);for(const A of De)A.updateGuards.forEach(H=>{ie.push(mr(H,W,me))});return ie.push(v),et(ie)}).then(()=>{ie=[];for(const A of g)if(A.beforeEnter)if(bn(A.beforeEnter))for(const H of A.beforeEnter)ie.push(mr(H,W,me));else ie.push(mr(A.beforeEnter,W,me));return ie.push(v),et(ie)}).then(()=>(W.matched.forEach(A=>A.enterCallbacks={}),ie=xi(g,"beforeRouteEnter",W,me,re),ie.push(v),et(ie))).then(()=>{ie=[];for(const A of i.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).catch(A=>Wn(A,At.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ye(W,me,ie){a.list().forEach(fe=>re(()=>fe(W,me,ie)))}function te(W,me,ie,fe,De){const g=q(W,me);if(g)return g;const v=me===dr,A=rs?history.state:{};ie&&(fe||v?s.replace(W.fullPath,ut({scroll:v&&A&&A.scroll},De)):s.push(W.fullPath,De)),l.value=W,Xe(W,me,ie,v),nt()}let je;function Be(){je||(je=s.listen((W,me,ie)=>{if(!Ge.listening)return;const fe=Y(W),De=de(fe,Ge.currentRoute.value);if(De){ve(ut(De,{replace:!0,force:!0}),fe).catch(Fs);return}u=fe;const g=l.value;rs&&Ym(uc(g.fullPath,ie.delta),ai()),ee(fe,g).catch(v=>Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_CANCELLED)?v:Wn(v,At.NAVIGATION_GUARD_REDIRECT)?(ve(ut(j(v.to),{force:!0}),fe).then(A=>{Wn(A,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&!ie.delta&&ie.type===da.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(ie.delta&&s.go(-ie.delta,!1),$e(v,fe,g))).then(v=>{v=v||te(fe,g,!1),v&&(ie.delta&&!Wn(v,At.NAVIGATION_CANCELLED)?s.go(-ie.delta,!1):ie.type===da.pop&&Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(fe,g,v)}).catch(Fs)}))}let Qe=Ps(),Re=Ps(),Te;function $e(W,me,ie){nt(W);const fe=Re.list();return fe.length?fe.forEach(De=>De(W,me,ie)):console.error(W),Promise.reject(W)}function It(){return Te&&l.value!==dr?Promise.resolve():new Promise((W,me)=>{Qe.add([W,me])})}function nt(W){return Te||(Te=!W,Be(),Qe.list().forEach(([me,ie])=>W?ie(W):me()),Qe.reset()),W}function Xe(W,me,ie,fe){const{scrollBehavior:De}=e;if(!rs||!De)return Promise.resolve();const g=!ie&&Qm(uc(W.fullPath,0))||(fe||!ie)&&history.state&&history.state.scroll||null;return tn().then(()=>De(W,me,g)).then(v=>v&&Jm(v)).catch(v=>$e(v,W,me))}const Ze=W=>s.go(W);let ht;const Rt=new Set,Ge={currentRoute:l,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:M,getRoutes:I,resolve:Y,options:e,push:B,replace:oe,go:Ze,back:()=>Ze(-1),forward:()=>Ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:It,install(W){W.component("RouterLink",Eg),W.component("RouterView",Pg),W.config.globalProperties.$router=Ge,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ue(l)}),rs&&!ht&&l.value===dr&&(ht=!0,B(s.location).catch(fe=>{}));const me={};for(const fe in dr)Object.defineProperty(me,fe,{get:()=>l.value[fe],enumerable:!0});W.provide(li,Ge),W.provide(Ja,Hu(me)),W.provide(ha,l);const ie=W.unmount;Rt.add(W),W.unmount=function(){Rt.delete(W),Rt.size<1&&(u=dr,je&&je(),je=null,l.value=dr,ht=!1,Te=!1),ie()}}};function et(W){return W.reduce((me,ie)=>me.then(()=>re(ie)),Promise.resolve())}return Ge}function Og(){return mn(li)}function Mg(e){return mn(Ja)}const Tc=768;function Gd(){const e=D(typeof window<"u"?window.innerWidth<Tc:!1);let t=null;function n(r){e.value=r.matches}return ir(()=>{t=window.matchMedia(`(max-width: ${Tc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ri(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Ng={key:0,class:"desktop-sidebar"},$g={class:"desktop-main"},Ic="codex-web-local.sidebar-width.v1",Dg=260,Lg=620,Sc=320,jg=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Gd();function r(u){return Math.min(Lg,Math.max(Dg,u))}function s(){if(typeof window>"u")return Sc;const u=window.localStorage.getItem(Ic),c=Number(u);return Number.isFinite(c)?r(c):Sc}const o=D(s()),i=pe(()=>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(u){typeof window>"u"||window.localStorage.setItem(Ic,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,p=N=>{const I=N.clientX-c;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",_)}return(u,c)=>(w(),T("div",{class:gt(["desktop-layout",{"is-mobile":ue(n)}]),style:zr(i.value)},[ue(n)?(w(),yt($o,{key:0,to:"body"},[Ce(Nd,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?se("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[On(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):se("",!0),ue(n)?se("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?se("",!0):(w(),T("aside",Ng,[On(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?se("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",$g,[On(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Bg=st(jg,[["__scopeId","data-v-df29c633"]]),Ug={},Fg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hg(e,t){return w(),T("svg",Fg,[...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 ci=st(Ug,[["render",Hg]]),Vg={},Wg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zg(e,t){return w(),T("svg",Wg,[...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 Kd=st(Vg,[["render",zg]]),qg={},Gg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Kg(e,t){return w(),T("svg",Gg,[...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 xs=st(qg,[["render",Kg]]),Jg={},Yg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Qg(e,t){return w(),T("svg",Yg,[...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 Uo=st(Jg,[["render",Qg]]),Xg={},Zg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ev(e,t){return w(),T("svg",Zg,[...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 Jd=st(Xg,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rv(e,t){return w(),T("svg",nv,[...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 sv=st(tv,[["render",rv]]),ov={},iv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function av(e,t){return w(),T("svg",iv,[...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 Co=st(ov,[["render",av]]),lv={},cv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function uv(e,t){return w(),T("svg",cv,[...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 Oi=st(lv,[["render",uv]]),dv={key:0,class:"sidebar-menu-row-left"},fv={class:"sidebar-menu-row-main"},hv={key:1,class:"sidebar-menu-row-right"},pv={key:0,class:"sidebar-menu-row-right-default"},mv={key:1,class:"sidebar-menu-row-right-hover"},gv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=ip(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(w(),yt(na(t.as),Ad({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:pt(()=>[r.value?(w(),T("span",dv,[On(a.$slots,"left",{},void 0,!0)])):se("",!0),m("span",fv,[On(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",hv,[s.value?(w(),T("span",pv,[On(a.$slots,"right",{},void 0,!0)])):se("",!0),o.value?(w(),T("span",mv,[On(a.$slots,"right-hover",{},void 0,!0)])):se("",!0)])):se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$r=st(gv,[["__scopeId","data-v-daeca4df"]]),vv={class:"thread-tree-root"},yv={key:0,class:"pinned-section"},wv={class:"thread-list"},bv={class:"thread-left-stack"},_v=["data-state"],kv=["onClick"],Tv=["onClick"],Iv={class:"thread-row-title-wrap"},Sv={class:"thread-row-title"},Ev={class:"thread-row-time"},Cv=["onClick"],Av=["onClick"],Rv=["onClick"],Pv=["onClick"],xv=["aria-expanded"],Ov=["data-active"],Mv={key:0},Nv=["data-active"],$v={key:0},Dv={key:1,class:"thread-tree-no-results"},Lv={key:2,class:"thread-tree-loading"},jv={key:3,class:"thread-list thread-list-global"},Bv={class:"thread-left-stack"},Uv=["data-state"],Fv=["onClick"],Hv=["onClick"],Vv={class:"thread-row-title-wrap"},Wv={class:"thread-row-title"},zv={class:"thread-row-time"},qv=["onClick"],Gv=["onClick"],Kv=["onClick"],Jv=["onClick"],Yv=["data-project-name","data-expanded","data-dragging"],Qv={class:"project-icon-stack"},Xv={class:"project-icon-folder"},Zv={class:"project-icon-chevron"},ey=["data-dragging-handle","onMousedown"],ty={class:"project-title"},ny={class:"project-hover-controls"},ry=["onClick"],sy=["onClick"],oy=["onClick"],iy=["onClick"],ay=["onInput"],ly=["aria-label","title","onClick"],cy={key:0,class:"thread-list"},uy={class:"thread-left-stack"},dy=["data-state"],fy=["onClick"],hy=["onClick"],py={class:"thread-row-title-wrap"},my={class:"thread-row-title"},gy={class:"thread-row-time"},vy=["onClick"],yy=["onClick"],wy=["onClick"],by=["onClick"],_y=["onClick"],ky={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Ty=["onKeydown"],Iy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Sy={class:"rename-thread-subtitle"},Ey=4,Ec=6,Cc="codex-web-local.thread-view-mode.v1",Ac="codex-web-local.collapsed-projects.v1",Cy=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),p=D(""),_=D(""),N=D(null),I=D(!1),M=D(""),Y=D(""),j=D(null),q=D(null),B=D(null);let oe=null,de=null;const ve=D(""),Ie=D({}),re=new Map,ee=new Map,ye=new Map,te=new WeakMap,je=D(null),Be=D(!1),Qe=D($e()),Re=typeof window<"u"?new ResizeObserver(k=>{for(const x of k){const O=x.target,J=te.get(O);J&&Ae(J,O)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Ac);if(!k)return{};const x=JSON.parse(k);return!x||typeof x!="object"||Array.isArray(x)?{}:x}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Cc)==="chronological"?"chronological":"project"}o.value=Te(),mt(o,k=>{typeof window>"u"||window.localStorage.setItem(Ac,JSON.stringify(k))},{deep:!0}),mt(Qe,k=>{typeof window>"u"||window.localStorage.setItem(Cc,k)});const It=pe(()=>n.searchQuery.trim().toLowerCase()),nt=pe(()=>It.value.length>0),Xe=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ze(k){if(!nt.value)return!0;if(Xe.value)return Xe.value.has(k.id);const x=It.value;return k.title.toLowerCase().includes(x)||k.preview.toLowerCase().includes(x)}const ht=pe(()=>nt.value?n.groups.map(k=>({...k,threads:k.threads.filter(Ze)})).filter(k=>k.threads.length>0):n.groups),Rt=pe(()=>Qe.value==="chronological"),Ge=pe(()=>{const k=ht.value,x=[];for(const O of k)for(const J of O.threads)v(J.id)||x.push(J);return x.sort((O,J)=>{const Ue=new Date(O.updatedAtIso||O.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),et=pe(()=>{const k=new Map;for(const x of n.groups)for(const O of x.threads)k.set(O.id,O);return k}),W=pe(()=>i.value.map(k=>et.value.get(k)??null).filter(k=>k!==null).filter(Ze)),me=pe(()=>{const k=B.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const x=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),O=x>k.fromIndex?x-1:x,J=Math.max(0,Math.min(O,n.groups.length-1));return J===k.fromIndex?null:J}),ie=pe(()=>{const x=(nt.value?ht.value:n.groups).map(Zt=>Zt.projectName),O=B.value,J=me.value;if(!O||J===null)return x;const Ue=[...x],[Mt]=Ue.splice(O.fromIndex,1);return Mt?(Ue.splice(J,0,Mt),Ue):x}),fe=pe(()=>{const k={};let x=0;for(const O of ie.value)k[O]=x,x+=jt(O);return k}),De=pe(()=>{let k=0;for(const x of ie.value)k+=jt(x);return{height:`${Math.max(0,k)}px`}});function g(k){const x=new Date(k).getTime();if(Number.isNaN(x))return"n/a";const O=Math.abs(Date.now()-x);if(O<6e4)return"now";const J=Math.floor(O/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function A(k){if(v(k)){i.value=i.value.filter(x=>x!==k);return}i.value=[k,...i.value]}function H(k){r("select",k)}function F(k){r("export-thread",k),V()}function P(k){return`start new thread ${Ve(k)}`}function $(k){r("start-new-thread",k)}function L(k){l.value===k&&V()}function G(k){return l.value===k}function V(){l.value=""}function be(k){if(l.value===k){V();return}l.value=k}function ae(k,x){p.value=k,_.value=x,f.value=!0,V(),tn(()=>{var O,J;(O=N.value)==null||O.focus(),(J=N.value)==null||J.select()})}function he(){f.value=!1,p.value="",_.value=""}function Se(){const k=p.value,x=_.value.trim();!k||!x||(r("rename-thread",{threadId:k,title:x}),he())}function Oe(k,x){M.value=k,Y.value=x,I.value=!0,V()}function Ke(){I.value=!1,M.value="",Y.value=""}function xe(){const k=M.value;k&&(i.value=i.value.filter(x=>x!==k),r("archive",k),Ke())}function Ve(k){return n.projectDisplayNameById[k]??k}function _t(k){return a.value===k}function U(){a.value="",u.value="actions",c.value=""}function K(){Be.value=!Be.value}function ne(k){Qe.value=k,Be.value=!1}function Je(k){if(a.value===k){U();return}a.value=k,u.value="actions",c.value=Ve(k)}function it(k){a.value=k,u.value="rename",c.value=Ve(k)}function kt(k){r("rename-project",{projectName:k,displayName:c.value})}function Pt(k){r("remove-project",k),U()}function ln(k){r("browse-project-files",k),U()}function Sr(k,x){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const O=n.groups.findIndex(Mt=>Mt.projectName===x);if(O<0)return;const J=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(O+J,n.groups.length-1));Ue!==O&&(k.preventDefault(),r("reorder-project",{projectName:x,toIndex:Ue}))}function rn(k){return s.value[k]===!0}function Ne(k){return o.value[k]===!0}function Me(k){s.value={...s.value,[k]:!rn(k)}}function fn(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Ne(k)}}function jt(k){const x=Ie.value[k]??0,O=B.value,Ue=((O==null?void 0:O.projectName)===k?O.groupHeight:null)??x,Mt=Ne(k)?0:Ec;return Math.max(0,Ue+Mt)}function Er(k,x){const O=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(O){ee.set(k,O);return}ee.delete(k)}function _n(k,x){const O=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(O){ye.set(k,O);return}ye.delete(k)}function kn(k){const x=a.value;if(!x)return!1;const O=ee.get(x);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function b(k){const x=l.value;if(!x)return!1;const O=ye.get(x);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function S(k){if(Be.value){const x=je.value,O=typeof k.composedPath=="function"?k.composedPath():[];!!x&&(O.includes(x)||k.target instanceof Node&&x.contains(k.target))||(Be.value=!1)}a.value&&(kn(k)||U(),l.value&&(b(k)||V()))}function E(k){a.value&&!kn(k)&&U(),l.value&&!b(k)&&V()}function z(){Be.value&&(Be.value=!1),a.value&&U(),l.value&&V()}function ge(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",z)}function le(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",z)}function Ae(k,x){const O=x.getBoundingClientRect().height;if(!Number.isFinite(O)||O<=0)return;const J=Ie.value[k];J!==void 0&&Math.abs(J-O)<.5||(Ie.value={...Ie.value,[k]:O})}function ke(k,x){const O=re.get(k);O&&O!==x&&Re&&Re.unobserve(O);const J=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(J){re.set(k,J),te.set(J,k),Ae(k,J),Re==null||Re.observe(J);return}O&&(Re==null||Re.unobserve(O)),re.delete(k)}function We(k,x){if(k.button!==0||q.value||B.value)return;const O=n.groups.findIndex(Zt=>Zt.projectName===x),J=re.get(x);if(O<0||!J)return;const Ue=J.getBoundingClientRect(),Mt=Ne(x)?0:Ec;q.value={projectName:x,fromIndex:O,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Mt},k.preventDefault(),at()}function at(){window.addEventListener("mousemove",xt),window.addEventListener("mouseup",Ot),window.addEventListener("keydown",sn)}function lt(){window.removeEventListener("mousemove",xt),window.removeEventListener("mouseup",Ot),window.removeEventListener("keydown",sn)}function xt(k){oe={clientX:k.clientX,clientY:k.clientY},ks()}function Ot(k){Cr({clientX:k.clientX,clientY:k.clientY});const x=B.value;if(x&&me.value!==null){const O=n.groups.findIndex(J=>J.projectName===x.projectName);if(O>=0){const J=me.value;J!==O&&r("reorder-project",{projectName:x.projectName,toIndex:J})}}Dn()}function sn(k){k.key==="Escape"&&(!q.value&&!B.value||(k.preventDefault(),Dn()))}function Dn(){de!==null&&(window.cancelAnimationFrame(de),de=null),oe=null,q.value=null,B.value=null,ve.value="",lt()}function ks(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!oe)return;const k=oe;oe=null,Cr(k)}))}function Cr(k){const x=q.value;if(!B.value&&x){const O=k.clientX-x.startClientX,J=k.clientY-x.startClientY;if(Math.hypot(O,J)<Ey)return;U(),ve.value=x.projectName,B.value={projectName:x.projectName,fromIndex:x.fromIndex,pointerOffsetY:x.pointerOffsetY,groupLeft:x.groupLeft,groupWidth:x.groupWidth,groupHeight:x.groupHeight,groupOuterHeight:x.groupOuterHeight,ghostTop:k.clientY-x.pointerOffsetY,dropTargetIndexFull:null}}B.value&&Gr(k)}function Gr(k){const x=B.value;if(!x)return;if(x.ghostTop=k.clientY-x.pointerOffsetY,!Ln(k)){x.dropTargetIndexFull=null;return}const O=k.clientY,J=j.value;if(!J){x.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),Mt=new Map(n.groups.map((on,lr)=>[on.projectName,lr])),Zt=n.groups.map(on=>on.projectName).filter(on=>on!==x.projectName);let Bn=0,Un=n.groups.length;for(const on of Zt){const lr=Mt.get(on);if(lr===void 0)continue;const Yr=jt(on),Qr=Ue.top+Bn+Yr/2;if(O<Qr){Un=lr;break}Bn+=Yr}x.dropTargetIndexFull=Un}function Ln(k){const x=j.value;if(!x)return!1;const O=x.getBoundingClientRect(),J=k.clientX>=O.left&&k.clientX<=O.right,Ue=k.clientY>=O.top-32&&k.clientY<=O.bottom+32;return J&&Ue}function Kr(k){var x;return((x=B.value)==null?void 0:x.projectName)===k}function Jr(k){const x=B.value,O=fe.value[k]??0,J=a.value===k;return!x||x.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${O}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${x.groupLeft}px`,width:`${x.groupWidth}px`,height:`${x.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${x.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(k){return k.threads.filter(x=>!v(x.id))}function Ts(k){if(nt.value)return jn(k);if(Ne(k.projectName))return[];const x=jn(k);return rn(k.projectName)?x:x.slice(0,10)}function Is(k){return nt.value?!1:!Ne(k.projectName)&&jn(k).length>10}function Ss(k){return jn(k).length>0}function Ar(k){return k.inProgress?"working":k.unread?"unread":"idle"}mt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Mt;const x=((Ue=B.value)==null?void 0:Ue.projectName)??((Mt=q.value)==null?void 0:Mt.projectName)??"";x&&!n.groups.some(Zt=>Zt.projectName===x)&&Dn();const O=new Set(k),J=Object.fromEntries(Object.entries(Ie.value).filter(([Zt])=>O.has(Zt)));Object.keys(J).length!==Object.keys(Ie.value).length&&(Ie.value=J)});const Rr=pe(()=>Be.value||a.value!=="");return mt(Rr,k=>{if(k){ge();return}le()}),ar(()=>{for(const k of re.values())Re==null||Re.unobserve(k);re.clear(),ee.clear(),le(),Dn()}),(k,x)=>(w(),T("section",vv,[W.value.length>0?(w(),T("section",yv,[m("ul",wv,[(w(!0),T(He,null,Et(W.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:J=>L(O.id)},{left:pt(()=>[m("span",bv,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(O)},null,8,_v)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(O.id)},[Ce(Oi,{class:"thread-icon"})],8,kv)])]),right:pt(()=>[m("span",Ev,ce(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(O.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(O.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,Cv),G(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[0]||(x[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(O.id)}," Export chat ",8,Av),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(O.id,O.title)}," Rename thread ",8,Rv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Oe(O.id,O.title)}," Delete thread ",8,Pv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(O.id)},[m("span",Iv,[m("span",Sv,ce(O.title),1),O.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Tv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):se("",!0),Ce($r,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:je,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:K},[Ce(xs,{class:"thread-icon"})],8,xv),Be.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:x[3]||(x[3]=tt(()=>{},["stop"]))},[x[11]||(x[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Qe.value==="project",type:"button",onClick:x[1]||(x[1]=O=>ne("project"))},[x[9]||(x[9]=m("span",null,"By project",-1)),Qe.value==="project"?(w(),T("span",Mv,"✓")):se("",!0)],8,Ov),m("button",{class:"organize-menu-item","data-active":Qe.value==="chronological",type:"button",onClick:x[2]||(x[2]=O=>ne("chronological"))},[x[10]||(x[10]=m("span",null,"Chronological list",-1)),Qe.value==="chronological"?(w(),T("span",$v,"✓")):se("",!0)],8,Nv)])):se("",!0)],512)]),default:pt(()=>[x[12]||(x[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&ht.value.length===0?(w(),T("p",Dv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Lv,"Loading threads...")):Rt.value?(w(),T("ul",jv,[(w(!0),T(He,null,Et(Ge.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:J=>L(O.id)},{left:pt(()=>[m("span",Bv,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(O)},null,8,Uv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(O.id)},[Ce(Oi,{class:"thread-icon"})],8,Fv)])]),right:pt(()=>[m("span",zv,ce(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(O.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(O.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,qv),G(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[4]||(x[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(O.id)}," Export chat ",8,Gv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(O.id,O.title)}," Rename thread ",8,Kv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Oe(O.id,O.title)}," Delete thread ",8,Jv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(O.id)},[m("span",Vv,[m("span",Wv,ce(O.title),1),O.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Hv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:j,class:"thread-tree-groups",style:zr(De.value)},[(w(!0),T(He,null,Et(ht.value,O=>(w(),T("article",{key:O.projectName,ref_for:!0,ref:J=>ke(O.projectName,J),class:"project-group","data-project-name":O.projectName,"data-expanded":!Ne(O.projectName),"data-dragging":Kr(O.projectName),style:zr(Jr(O.projectName))},[Ce($r,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>fn(O.projectName),onKeydown:[J=>Sr(J,O.projectName),Yt(tt(J=>fn(O.projectName),["prevent"]),["enter"]),Yt(tt(J=>fn(O.projectName),["prevent"]),["space"])]},{left:pt(()=>[m("span",Qv,[m("span",Xv,[Ne(O.projectName)?(w(),yt(Jd,{key:0,class:"thread-icon"})):(w(),yt(sv,{key:1,class:"thread-icon"}))]),m("span",Zv,[Ne(O.projectName)?(w(),yt(Kd,{key:0,class:"thread-icon"})):(w(),yt(ci,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[m("div",ny,[m("div",{ref_for:!0,ref:J=>Er(O.projectName,J),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(J=>Je(O.projectName),["stop"])},[Ce(xs,{class:"thread-icon"})],8,ry),_t(O.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:x[6]||(x[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:J=>ln(O.projectName)}," Browse files ",8,sy),m("button",{class:"project-menu-item",type:"button",onClick:J=>it(O.projectName)}," Edit name ",8,oy),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>Pt(O.projectName)}," Remove ",8,iy)],64)):(w(),T(He,{key:1},[x[13]||(x[13]=m("label",{class:"project-menu-label"},"Project name",-1)),tr(m("input",{"onUpdate:modelValue":x[5]||(x[5]=J=>c.value=J),class:"project-menu-input",type:"text",onInput:J=>kt(O.projectName)},null,40,ay),[[nr,c.value]])],64))])):se("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":P(O.projectName),title:P(O.projectName),onClick:tt(J=>$(O.projectName),["stop"])},[Ce(Uo,{class:"thread-icon"})],8,ly)])]),default:pt(()=>[m("span",{class:"project-main-button","data-dragging-handle":Kr(O.projectName),onMousedown:tt(J=>We(J,O.projectName),["left"])},[m("span",ty,ce(Ve(O.projectName)),1)],40,ey)]),_:2},1032,["onClick","onKeydown"]),Ss(O)?(w(),T("ul",cy,[(w(!0),T(He,null,Et(Ts(O),J=>(w(),T("li",{key:J.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":v(J.id),onMouseleave:Ue=>L(J.id)},{left:pt(()=>[m("span",uy,[J.inProgress||J.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(J)},null,8,dy)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>A(J.id)},[Ce(Oi,{class:"thread-icon"})],8,fy)])]),right:pt(()=>[m("span",gy,ce(g(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:Ue=>_n(J.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>be(J.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,vy),G(J.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[7]||(x[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>F(J.id)}," Export chat ",8,yy),m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ae(J.id,J.title)}," Rename thread ",8,wy),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Oe(J.id,J.title)}," Delete thread ",8,by)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(J.id)},[m("span",py,[m("span",my,ce(J.title),1),J.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,hy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),yt($r,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...x[14]||(x[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[x[15]||(x[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Is(O)?(w(),yt($r,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...x[16]||(x[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:J=>Me(O.projectName)},ce(rn(O.projectName)?"Show less":"Show more"),9,_y)]),_:2},1024)):se("",!0)],12,Yv))),128))],4)),(w(),yt($o,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(he,["self"])},[m("div",ky,[x[17]||(x[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),x[18]||(x[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),tr(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":x[8]||(x[8]=O=>_.value=O),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(tt(Se,["prevent"]),["enter"]),Yt(tt(he,["prevent"]),["esc"])]},null,40,Ty),[[nr,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:he},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Se},"Save")])])])):se("",!0)])),(w(),yt($o,{to:"body"},[I.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Ke,["self"])},[m("div",Iy,[x[19]||(x[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Sy,' This will archive the thread "'+ce(Y.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:Ke},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:xe},"Delete")])])])):se("",!0)]))]))}}),Ay=st(Cy,[["__scopeId","data-v-e2f8a8e1"]]),Ry={class:"content-header"},Py={class:"content-leading"},xy={class:"content-title"},Oy={class:"content-actions"},My=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Ry,[m("div",Py,[On(t.$slots,"leading",{},void 0)]),m("h1",xy,ce(e.title),1),m("div",Oy,[On(t.$slots,"actions",{},void 0)])]))}}),Ny=st(My,[["__scopeId","data-v-66ee223c"]]),$y={},Dy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ly(e,t){return w(),T("svg",Dy,[...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 Ya=st($y,[["render",Ly]]),jy={},By={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Uy(e,t){return w(),T("svg",By,[...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 Fy=st(jy,[["render",Uy]]),Hy={},Vy={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(),T("svg",Vy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const zy=st(Hy,[["render",Wy]]),qy={class:"conversation-root"},Gy={key:0,class:"conversation-loading"},Ky={key:1,class:"conversation-empty"},Jy={class:"message-row"},Yy={class:"message-stack"},Qy={class:"request-card"},Xy={class:"request-title"},Zy={class:"request-meta"},ew={key:0,class:"request-reason"},tw={key:1,class:"request-actions"},nw=["onClick"],rw=["onClick"],sw=["onClick"],ow=["onClick"],iw={key:2,class:"request-actions"},aw=["onClick"],lw=["onClick"],cw=["onClick"],uw=["onClick"],dw={key:3,class:"request-user-input"},fw={class:"request-question-title"},hw={key:0,class:"request-question-text"},pw=["value","onChange"],mw=["value"],gw=["value","onInput"],vw=["onClick"],yw={key:4,class:"request-actions"},ww=["onClick"],bw=["onClick"],_w={key:5,class:"request-actions"},kw=["onClick"],Tw=["onClick"],Iw=["data-role","data-message-type"],Sw={key:0,class:"message-row","data-role":"system"},Ew={class:"message-stack","data-role":"system"},Cw=["onClick"],Aw={class:"cmd-label"},Rw={class:"cmd-status"},Pw={class:"cmd-output-inner"},xw={class:"cmd-output"},Ow=["data-role","data-message-type"],Mw=["data-role"],Nw=["data-role"],$w=["data-role"],Dw=["onClick"],Lw=["src"],jw={key:1,class:"message-file-attachments"},Bw=["href","title"],Uw=["data-role"],Fw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Hw=["onClick"],Vw={class:"worked-separator-text"},Ww={key:0,class:"worked-details"},zw=["onClick"],qw={class:"cmd-label"},Gw={class:"cmd-status"},Kw={class:"cmd-output-inner"},Jw={class:"cmd-output"},Yw={key:1,class:"message-text-flow"},Qw={key:0,class:"message-text"},Xw={key:0},Zw={key:1,class:"message-bold-text"},eb=["href","title"],tb=["href","title"],nb={key:4,class:"message-inline-code"},rb={key:1,class:"message-text"},sb=["onClick"],ob=["src","alt","onError"],ib={key:0,class:"message-actions"},ab=["onClick"],lb=["onClick"],cb={key:0,class:"conversation-item conversation-item-overlay"},ub={class:"message-row"},db={class:"message-stack"},fb={class:"live-overlay-inline","aria-live":"polite"},hb={class:"live-overlay-label"},pb={key:1,class:"live-overlay-error"},mb=["src"],gb=16,vb=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var S;return((S=b.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function u(b){var E;if(((E=b.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(b.id)?S.delete(b.id):S.add(b.id),n.value=S}function c(b){const S=new Set(s.value);S.has(b.id)?S.delete(b.id):S.add(b.id),s.value=S}function f(b){return s.value.has(b.id)}function p(b){const S=b.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(b){var E,z;const S=(E=b.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((z=b.commandExecution)==null?void 0:z.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(b){const S=new Set(r.value);S.add(b),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(b),r.value=E},1e3)}function I(b,S){const E=[];for(let z=S-1;z>=0;z--){const ge=b[z];if(ge.messageType==="commandExecution")E.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return E}const M=e,Y=t,j=D(null),q=D(null),B=D(null),oe=D(""),de=D({}),ve=D({});let Ie=0,re=0,ee=0;const ye=new WeakSet,te=D(new Set);function je(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\"))return!1;if(b.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const S=b.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(b),z=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),ge=b.includes("/")||b.includes("\\");return S||E||z||ge}function Be(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Qe(b){return b.replace(/\\/gu,"/")}function Re(b){if(!b.startsWith("file://"))return b;let S=b.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Te(b){const S=Qe(b),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const z=S.match(/^\/home\/([^/]+)/u);return z?`/home/${z[1]}`:""}function $e(b){const S=Qe(b);if(!S)return S;let E="",z=S;const ge=z.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(E=`${ge[1]}/`,z=(ge[2]??"").replace(/^\/+/u,"")):z.startsWith("/")&&(E="/",z=z.slice(1));const le=z.split("/").filter(Boolean),Ae=[];for(const We of le)if(We!=="."){if(We===".."){Ae.length>0&&Ae.pop();continue}Ae.push(We)}const ke=Ae.join("/");return E?`${E}${ke}`.replace(/\/+$/u,"")||E:ke||S}function It(b,S){const E=Qe(Re(b.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return $e(E);if(E.startsWith("~/")){const le=Te(S);if(le)return $e(`${le}/${E.slice(2)}`)}const ge=Qe(S.trim());return $e(ge?`${ge.replace(/\/+$/u,"")}/${E}`:E)}function nt(b){if(!b)return null;let S=b.trim();S=Xe(S).core.trim();let z=null;const ge=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)S=ge[1],z=Number(ge[2]);else{const le=S.match(/^(.*):(\d+)(?::\d+)?$/u);le&&(S=le[1],z=Number(le[2]))}return S=Re(S),je(S)?{path:S,line:z}:null}function Xe(b){let S=b,E="",z="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)z=S.slice(-1)+z,S=S.slice(0,-1);return{core:S,leading:E,trailing:z}}function Ze(b){const E=b.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const z=(E[1]??"").trim(),ge=(E[2]??"").trim(),le=Xe(z).core.trim()||z,Ae=Xe(ge).core.trim();return Ae?{label:le,target:Ae}:null}function ht(b){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let z=0;for(const ge of b.matchAll(E)){if(typeof ge.index!="number")continue;const le=ge.index,Ae=le+ge[0].length;le>z&&S.push({kind:"text",value:b.slice(z,le)});let ke=ge[0],We="";for(;/[.,;:]$/u.test(ke);)We=ke.slice(-1)+We,ke=ke.slice(0,-1);const at=Xe(ke);ke=at.core;const lt=at.leading,xt=at.trailing+We;if(lt&&S.push({kind:"text",value:lt}),ke.startsWith("**")&&ke.endsWith("**")&&ke.length>4)S.push({kind:"bold",value:ke.slice(2,-2)}),xt&&S.push({kind:"text",value:xt});else if(/^https?:\/\//u.test(ke))S.push({kind:"url",value:ke,href:ke}),xt&&S.push({kind:"text",value:xt});else{const Ot=nt(ke);Ot?(S.push({kind:"file",value:ke,path:Ot.path,displayPath:ke,downloadName:Be(Ot.path)}),xt&&S.push({kind:"text",value:xt})):S.push({kind:"text",value:ge[0]})}z=Ae}return z<b.length&&S.push({kind:"text",value:b.slice(z)}),Rt(S)}function Rt(b){const S=[];let E=!1,z="";const ge=le=>{le&&S.push({kind:"text",value:le})};for(const le of b){if(le.kind!=="text"){E&&(ge(`**${z}`),E=!1,z=""),S.push(le);continue}let Ae=le.value;for(;Ae.length>0;){const ke=Ae.indexOf("**");if(ke<0){E?z+=Ae:ge(Ae);break}const We=Ae.slice(0,ke);E?z+=We:ge(We),Ae=Ae.slice(ke+2),E?(z.length>0?S.push({kind:"bold",value:z}):ge("****"),z="",E=!1):E=!0}}return E&&ge(`**${z}`),S}function Ge(b){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let z=0;for(const ge of b.matchAll(S)){if(typeof ge.index!="number")continue;const[le,Ae,ke]=ge,We=ge.index,at=We+le.length;We>z&&E.push(...ht(b.slice(z,We)));const lt=Ze(`[${Ae??""}](${ke??""})`),xt=(lt==null?void 0:lt.label)??(Ae??"").trim(),Ot=(lt==null?void 0:lt.target)??(ke??"").trim();if(/^https?:\/\//u.test(Ot))E.push({kind:"url",value:xt||Ot,href:Ot});else{const sn=nt(Ot);sn?E.push({kind:"file",value:Ot,path:sn.path,displayPath:xt||Ot,downloadName:Be(sn.path)}):E.push({kind:"text",value:le})}z=at}return z<b.length&&E.push(...ht(b.slice(z))),E}function et(b){if(!b.includes("`"))return Ge(b);const S=[];let E=0,z=0;for(;E<b.length;){if(b[E]!=="`"){E+=1;continue}let ge=1;for(;E+ge<b.length&&b[E+ge]==="`";)ge+=1;const le="`".repeat(ge);let Ae=E+ge,ke=-1;for(;Ae<b.length;){const at=b.indexOf(le,Ae);if(at<0)break;const lt=at>0&&b[at-1]==="`",xt=at+ge<b.length&&b[at+ge]==="`",Ot=b.slice(E+ge,at).includes(`
26
+ `);if(!lt&&!xt&&!Ot){ke=at;break}Ae=at+1}if(ke<0){E+=ge;continue}E>z&&S.push(...Ge(b.slice(z,E)));const We=b.slice(E+ge,ke);if(We.length>0){const at=Ze(We);if(at)if(/^https?:\/\//u.test(at.target))S.push({kind:"url",value:at.label||at.target,href:at.target});else{const lt=nt(at.target);lt?S.push({kind:"file",value:at.target,path:lt.path,displayPath:at.label||at.target,downloadName:Be(lt.path)}):S.push({kind:"code",value:We})}else{const lt=nt(We);if(lt){const xt=lt.line?`${lt.path}:${String(lt.line)}`:lt.path;S.push({kind:"file",value:We,path:lt.path,displayPath:xt,downloadName:Be(lt.path)})}else S.push({kind:"code",value:We})}}else S.push({kind:"text",value:`${le}${le}`});E=ke+ge,z=E}return z<b.length&&S.push(...Ge(b.slice(z))),S}function W(b){const S=b.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),z=/^[A-Za-z]:[\\/]/u.test(S);return E||z?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function me(b){const S=b.trim();if(!S)return"#";const E=Ae=>Ae.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ae),z=nt(S),ge=(z==null?void 0:z.path)??S,le=It(ge,M.cwd);if(E(le)){const Ae=le.startsWith("/")?le:`/${le}`;return`/codex-local-browse${encodeURI(Ae)}`}return"#"}function ie(b){if(!b.includes("![")||!b.includes("]("))return[{kind:"text",value:b}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let z=0;for(const ge of b.matchAll(E)){const[le,Ae,ke]=ge;if(typeof ge.index!="number")continue;const We=ge.index,at=We+le.length,lt=W(ke.trim());lt&&(We>z&&S.push({kind:"text",value:b.slice(z,We)}),S.push({kind:"image",url:lt,alt:Ae.trim(),markdown:le}),z=at)}return z<b.length&&S.push({kind:"text",value:b.slice(z)}),S.length>0?S:[{kind:"text",value:b}]}function fe(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function De(b){const S=new Date(b);return Number.isNaN(S.getTime())?b:S.toLocaleTimeString()}function g(b){const S=fe(b.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function v(b,S){return`${String(b)}:${S}`}function A(b){const S=fe(b.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],z=[];for(const ge of E){const le=fe(ge);if(!le)continue;const Ae=typeof le.id=="string"?le.id:"";if(!Ae)continue;const ke=Array.isArray(le.options)?le.options.map(We=>fe(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];z.push({id:Ae,header:typeof le.header=="string"?le.header:"",question:typeof le.question=="string"?le.question:"",isOther:le.isOther===!0,options:ke})}return z}function H(b,S,E){const z=v(b,S),ge=de.value[z];return typeof ge=="string"&&ge.length>0?ge:E}function F(b,S){const E=v(b,S);return ve.value[E]??""}function P(b,S,E){const z=E.target;if(!(z instanceof HTMLSelectElement))return;const ge=v(b,S);de.value={...de.value,[ge]:z.value}}function $(b,S,E){const z=E.target;if(!(z instanceof HTMLInputElement))return;const ge=v(b,S);ve.value={...ve.value,[ge]:z.value}}function L(b,S){Y("respondServerRequest",{id:b,result:{decision:S}})}function G(b){const S=A(b),E={};for(const z of S){const ge=H(b.id,z.id,z.options[0]||""),le=F(b.id,z.id).trim(),Ae=[ge,le].map(ke=>ke.trim()).filter(ke=>ke.length>0);E[z.id]={answers:Ae}}Y("respondServerRequest",{id:b.id,result:{answers:E}})}function V(b){Y("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function be(b){Y("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function ae(b){Y("respondServerRequest",{id:b,result:{}})}function he(b){Y("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Se(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||M.isTurnInProgress||M.isRollingBack)}function Oe(b){return b.role!=="user"&&b.role!=="assistant"?!1:b.text.trim().length>0}function Ke(b){return Oe(b)||Se(b)}async function xe(b){if(!Oe(b))return;const S=b.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function Ve(b){Se(b)&&Y("rollback",{turnIndex:b.turnIndex})}function _t(){const b=j.value,S=q.value;!b||!S||(b.scrollTop=b.scrollHeight,S.scrollIntoView({block:"end"}))}function U(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=gb}function K(b){if(!M.activeThreadId)return;const S=Math.max(b.scrollHeight-b.clientHeight,0),E=S>0?Math.min(Math.max(b.scrollTop/S,0),1):1;Y("updateScrollState",{threadId:M.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:U(b),scrollRatio:E}})}function ne(){const b=j.value;if(!b)return;const S=M.scrollState;if(!S||S.isAtBottom){Je();return}const E=Math.max(b.scrollHeight-b.clientHeight,0),z=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;b.scrollTop=Math.min(Math.max(z,0),E),K(b)}function Je(){const b=j.value;b&&(_t(),K(b))}function it(){const b=M.scrollState;return!b||b.isAtBottom===!0}function kt(){if(!it()){ee=0,re=0;return}if(Je(),ee-=1,ee<=0){re=0;return}re=requestAnimationFrame(kt)}function Pt(b=6){it()&&(re&&(cancelAnimationFrame(re),re=0),ee=Math.max(b,1),re=requestAnimationFrame(kt))}function ln(){Pt(3)}function Sr(){if(!it())return;const b=j.value;if(!b)return;const S=b.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",ln,{once:!0}),E.addEventListener("error",ln,{once:!0}))}async function rn(){await tn(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,ne(),Sr(),Pt()})}mt(()=>M.messages,async b=>{if(!M.isLoading){for(const S of b){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],z=S.commandExecution.status;E==="inProgress"&&z!=="inProgress"&&N(S.id),o.value[S.id]=z}await rn()}}),mt(()=>M.liveOverlay,async b=>{b&&(await tn(),Je(),Pt(8))},{deep:!0}),mt(()=>M.isLoading,async b=>{b||await rn()}),mt(()=>M.activeThreadId,()=>{oe.value="",te.value=new Set},{flush:"post"});function Ne(){const b=j.value;!b||M.isLoading||K(b)}function Me(b){oe.value=W(b)}function fn(b,S){return`${b}:${String(S)}`}function jt(b,S){const E=new Set(te.value);E.add(fn(b,S)),te.value=E}function Er(b,S){return te.value.has(fn(b,S))}function _n(){oe.value=""}function kn(){const b=B.value;b&&(b.scrollTop=b.scrollHeight)}return mt(()=>{var b;return(b=M.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await tn(),kn())}),ar(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(b,S)=>(w(),T("section",qy,[e.isLoading?(w(),T("p",Gy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Ky," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:j,class:"conversation-list",onScroll:Ne},[(w(!0),T(He,null,Et(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[m("div",Jy,[m("div",Yy,[m("article",Qy,[m("p",Xy,ce(E.method),1),m("p",Zy,"Request #"+ce(E.id)+" · "+ce(De(E.receivedAtIso)),1),g(E)?(w(),T("p",ew,ce(g(E)),1)):se("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",tw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>L(E.id,"accept")},"Accept",8,nw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"acceptForSession")},"Accept for Session",8,rw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"decline")},"Decline",8,sw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"cancel")},"Cancel",8,ow)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",iw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>L(E.id,"accept")},"Accept",8,aw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"acceptForSession")},"Accept for Session",8,lw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"decline")},"Decline",8,cw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"cancel")},"Cancel",8,uw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",dw,[(w(!0),T(He,null,Et(A(E),z=>(w(),T("div",{key:`${E.id}:${z.id}`,class:"request-question"},[m("p",fw,ce(z.header||z.question),1),z.header&&z.question?(w(),T("p",hw,ce(z.question),1)):se("",!0),m("select",{class:"request-select",value:H(E.id,z.id,z.options[0]||""),onChange:ge=>P(E.id,z.id,ge)},[(w(!0),T(He,null,Et(z.options,ge=>(w(),T("option",{key:`${E.id}:${z.id}:${ge}`,value:ge},ce(ge),9,mw))),128))],40,pw),z.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:F(E.id,z.id),placeholder:"Other answer",onInput:ge=>$(E.id,z.id,ge)},null,40,gw)):se("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>G(E)}," Submit Answers ",8,vw)])):E.method==="item/tool/call"?(w(),T("section",yw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>V(E.id)},"Fail Tool Call",8,ww),m("button",{type:"button",class:"request-button",onClick:z=>be(E.id)},"Success (Empty)",8,bw)])):(w(),T("section",_w,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>ae(E.id)},"Return Empty Result",8,kw),m("button",{type:"button",class:"request-button",onClick:z=>he(E.id)},"Reject Request",8,Tw)]))])])])]))),128)),(w(!0),T(He,null,Et(e.messages,E=>{var z,ge;return w(),T("li",{key:E.id,class:gt(["conversation-item",{"conversation-item-actionable":Ke(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Sw,[m("div",Ew,[m("button",{type:"button",class:gt(["cmd-row",[_(E),{"cmd-expanded":a(E)}]]),onClick:le=>u(E)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),m("code",Aw,ce(((z=E.commandExecution)==null?void 0:z.command)||"(command)"),1),m("span",Rw,ce(p(E)),1)],10,Cw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[m("div",Pw,[m("pre",xw,ce(((ge=E.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[m("div",{class:"message-stack","data-role":E.role},[m("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(He,null,Et(E.images,le=>(w(),T("li",{key:le,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ae=>Me(le)},[m("img",{class:"message-image-preview",src:W(le),alt:"Message image preview",loading:"lazy"},null,8,Lw)],8,Dw)]))),128))],8,$w)):se("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",jw,[(w(!0),T(He,null,Et(E.fileAttachments,le=>(w(),T("span",{key:le.path,class:"message-file-chip"},[S[1]||(S[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:me(le.path),target:"_blank",rel:"noopener noreferrer",title:le.path},ce(le.path),9,Bw)]))),128))])):se("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Fw,[m("button",{type:"button",class:"worked-separator",onClick:le=>c(E)},[S[2]||(S[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:gt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),m("p",Vw,ce(E.text),1),S[3]||(S[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Hw),f(E)?(w(),T("div",Ww,[(w(!0),T(He,null,Et(I(e.messages,e.messages.indexOf(E)),le=>{var Ae,ke;return w(),T("div",{key:`worked-cmd-${le.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:gt(["cmd-row",[_(le),{"cmd-expanded":a(le)}]]),onClick:We=>u(le)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(le)}])},"▶",2),m("code",qw,ce(((Ae=le.commandExecution)==null?void 0:Ae.command)||"(command)"),1),m("span",Gw,ce(p(le)),1)],10,zw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(le),"cmd-output-collapsing":l(le)}])},[m("div",Kw,[m("pre",Jw,ce(((ke=le.commandExecution)==null?void 0:ke.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):se("",!0)])):(w(),T("div",Yw,[(w(!0),T(He,null,Et(ie(E.text),(le,Ae)=>(w(),T(He,{key:`block-${Ae}`},[le.kind==="text"?(w(),T("p",Qw,[(w(!0),T(He,null,Et(et(le.value),(ke,We)=>(w(),T(He,{key:`seg-${Ae}-${We}`},[ke.kind==="text"?(w(),T("span",Xw,ce(ke.value),1)):ke.kind==="bold"?(w(),T("strong",Zw,ce(ke.value),1)):ke.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:me(ke.path),target:"_blank",rel:"noopener noreferrer",title:ke.path},ce(ke.displayPath),9,eb)):ke.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ke.href,target:"_blank",rel:"noopener noreferrer",title:ke.href},ce(ke.value),9,tb)):(w(),T("code",nb,ce(ke.value),1))],64))),128))])):Er(E.id,Ae)?(w(),T("p",rb,ce(le.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ke=>Me(le.url)},[m("img",{class:"message-image-preview message-markdown-image",src:le.url,alt:le.alt||"Embedded message image",loading:"lazy",onError:ke=>jt(E.id,Ae)},null,40,ob)],8,sb))],64))),128))]))],8,Uw)):se("",!0)],8,Nw),Ke(E)?(w(),T("div",ib,[Oe(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:le=>xe(E)},[Ce(zy,{class:"message-action-icon"}),S[4]||(S[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,ab)):se("",!0),Se(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:le=>Ve(E)},[Ce(Fy,{class:"message-action-icon"}),S[5]||(S[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,lb)):se("",!0)])):se("",!0)],8,Mw)],8,Ow))],10,Iw)}),128)),e.liveOverlay?(w(),T("li",cb,[m("div",ub,[m("div",db,[m("article",fb,[m("p",hb,ce(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:B},ce(e.liveOverlay.reasoningText),513)):se("",!0),e.liveOverlay.errorText?(w(),T("p",pb,ce(e.liveOverlay.errorText),1)):se("",!0)])])])])):se("",!0),m("li",{ref_key:"bottomAnchorRef",ref:q,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:_n},[m("div",{class:"image-modal-content",onClick:S[0]||(S[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:_n},[Ce(Ya,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,mb)])])):se("",!0)]))}}),yb=st(vb,[["__scopeId","data-v-b2208f01"]]);function wb(e){var c;const t=D("idle"),n=D(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.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=p=>{p.data.size>0&&o.push(p.data)},r.onstop=()=>{var N;const p=o,_=(r==null?void 0:r.mimeType)||((N=p[0])==null?void 0:N.type)||"audio/webm";u(),t.value="idle",l(p,_)},r.start(),t.value="recording"}catch(p){u(),(f=e.onError)==null||f.call(e,p)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,p){var N;if(f.length===0)return;const _=new Blob(f,{type:p});try{const I=p.split(/[/;]/)[1]??"webm",M=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await _.arrayBuffer()),j=new TextEncoder,q=[];q.push(j.encode(`--${M}\r
27
+ `)),q.push(j.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
+ `)),q.push(j.encode(`Content-Type: ${p}\r
29
29
  \r
30
- `)),z.push(Y),z.push($.encode(`\r
31
- --${O}--\r
32
- `));let j=0;for(const ee of z)j+=ee.byteLength;const oe=new Uint8Array(j);let de=0;for(const ee of z)oe.set(ee,de),de+=ee.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${O}`},body:oe});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const re=((await ve.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ar(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function xc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Qn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Za(e,t){const n=xc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=xc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ws(e,t,n){return e instanceof Qn?e:e instanceof Error?new Qn(e.message||t,{code:"unknown_error",method:n}):new Qn(t,{code:"unknown_error",method:n})}function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function kb(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 Qn(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 Qn(Za(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 Qn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Pc(e){const t=Xd(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 Tb(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=Pc(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 u=JSON.parse(String(l.data)),c=Pc(u);c&&e(c)}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 Ib(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 Qn(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 Qn(Za(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Sb(){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 Qn(Za(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Xd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Mc(e){return new Date(e*1e3).toISOString()}function Eb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Cb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Ab=/^##\s+(.+?):\s+(.+?)\s*$/,Rb=/^#\s*files mentioned by the user\s*:?\s*$/i;function xb(e){var s,o;const t=e.split(`
33
- `).findIndex(i=>Rb.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(Ab);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function Pb(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 Mb(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:Cb(l),isUnhandled:!0});const o=n.join(`
35
- `),i=xb(o);return{text:Pb(o),images:r,fileAttachments:i,rawBlocks:s}}function Ob(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Mb(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=Nb(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 Nb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function $b(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Db(e){const t=$b(e);return t.length>0?t:"Untitled thread"}function Zd(e){return(e==null?void 0:e.status)==="inProgress"}function Lb(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 Zd(r)}function jb(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:Db(e),projectName:Eb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Mc(e.createdAt),updatedAtIso:Mc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Lb(e)}}function Bb(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 Ub(e){const t=e.data.map(jb);return Bb(t)}function ef(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 Ob(i))n.push({...a,turnIndex:r})}return n}function Fb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Zd(t.at(-1))}async function nn(e,t){try{return await kb(e,t)}catch(n){throw ws(n,`RPC ${e} failed`,e)}}function Hb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Vb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Ub(e)}async function Wb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:ef(t),inProgress:Fb(t)}}async function zb(){try{return await Vb()}catch(e){throw ws(e,"Failed to load thread groups","thread/list")}}async function qb(e){try{return await Wb(e)}catch(t){throw ws(t,`Failed to load thread ${e}`,"thread/read")}}function Gb(e){return Tb(e)}async function Kb(e,t){await Ib({id:e,...t})}async function Jb(){return Sb()}async function $i(e){await nn("thread/resume",{threadId:e})}async function Yb(e){await nn("thread/archive",{threadId:e})}async function Qb(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Oc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return ef(n)}function Xb(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 Nc(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 nn("thread/start",n),s=Xb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ws(n,"Failed to start a new thread","thread/start")}}function Zb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
30
+ `)),q.push(Y),q.push(j.encode(`\r
31
+ --${M}--\r
32
+ `));let B=0;for(const ee of q)B+=ee.byteLength;const oe=new Uint8Array(B);let de=0;for(const ee of q)oe.set(ee,de),de+=ee.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${M}`},body:oe});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const re=((await ve.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ar(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Rc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Qn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Qa(e,t){const n=Rc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Rc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ws(e,t,n){return e instanceof Qn?e:e instanceof Error?new Qn(e.message||t,{code:"unknown_error",method:n}):new Qn(t,{code:"unknown_error",method:n})}function Yd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function bb(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 Qn(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 Qn(Qa(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 Qn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Pc(e){const t=Yd(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 _b(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=Pc(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 u=JSON.parse(String(l.data)),c=Pc(u);c&&e(c)}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 kb(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 Qn(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 Qn(Qa(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Tb(){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 Qn(Qa(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Yd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function xc(e){return new Date(e*1e3).toISOString()}function Ib(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Sb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Eb=/^##\s+(.+?):\s+(.+?)\s*$/,Cb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Ab(e){var s,o;const t=e.split(`
33
+ `).findIndex(i=>Cb.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(Eb);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function Rb(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 Pb(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:Sb(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Ab(o);return{text:Rb(o),images:r,fileAttachments:i,rawBlocks:s}}function xb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Pb(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=Ob(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 Ob(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Mb(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Nb(e){const t=Mb(e);return t.length>0?t:"Untitled thread"}function Qd(e){return(e==null?void 0:e.status)==="inProgress"}function $b(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 Qd(r)}function Db(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:Nb(e),projectName:Ib(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:xc(e.createdAt),updatedAtIso:xc(e.updatedAt),preview:e.preview,unread:!1,inProgress:$b(e)}}function Lb(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 jb(e){const t=e.data.map(Db);return Lb(t)}function Xd(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 xb(i))n.push({...a,turnIndex:r})}return n}function Bb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Qd(t.at(-1))}async function nn(e,t){try{return await bb(e,t)}catch(n){throw ws(n,`RPC ${e} failed`,e)}}function Ub(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Fb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return jb(e)}async function Hb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:Xd(t),inProgress:Bb(t)}}async function Vb(){try{return await Fb()}catch(e){throw ws(e,"Failed to load thread groups","thread/list")}}async function Wb(e){try{return await Hb(e)}catch(t){throw ws(t,`Failed to load thread ${e}`,"thread/read")}}function zb(e){return _b(e)}async function qb(e,t){await kb({id:e,...t})}async function Gb(){return Tb()}async function Mi(e){await nn("thread/resume",{threadId:e})}async function Kb(e){await nn("thread/archive",{threadId:e})}async function Jb(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Oc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return Xd(n)}function Yb(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 Mc(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 nn("thread/start",n),s=Yb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ws(n,"Failed to start a new thread","thread/start")}}function Qb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
36
  `;for(const r of t)n+=`
37
37
  ## ${r.label}: ${r.path}
38
38
  `;return`${n}
39
39
  ## My request for Codex:
40
40
 
41
41
  ${e}
42
- `}async function Di(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Zb(t,i)}];for(const f of n){const h=f.trim();h&&l.push({type:"image",url:h,image_url:h})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await nn("turn/start",c)}catch(a){throw ws(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function e_(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 nn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ws(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function t_(e){await nn("setDefaultModel",{model:e})}async function n_(){const e=await nn("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 r_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Hb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function s_(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 ga(){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 s_(n.data)}async function o_(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 $c(){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 i_(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 a_(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=el(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 l_(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=el(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 c_(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 u=el(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,h=typeof f=="string"?f.trim():"";h&&l.push({path:h})}return l}async function u_(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 el(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 d_(){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 Li(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 f_(e,t){var n;try{return((n=(await nn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function h_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await nn("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 p_(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 m_={},g_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v_(e,t){return w(),T("svg",g_,[...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 y_=st(m_,[["render",v_]]),w_={},b_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function __(e,t){return w(),T("svg",b_,[...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 k_=st(w_,[["render",__]]),T_={},I_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function S_(e,t){return w(),T("svg",I_,[...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 E_=st(T_,[["render",S_]]),C_=["disabled"],A_={class:"composer-dropdown-value"},R_={class:"composer-dropdown-menu"},x_={key:0,class:"composer-dropdown-search-wrap"},P_=["placeholder","onKeydown"],M_={class:"composer-dropdown-options",role:"listbox"},O_=["onClick"],N_={key:0,class:"composer-dropdown-empty"},$_={key:1,class:"composer-dropdown-add-wrap"},D_=["placeholder","onKeydown"],L_=Lt({__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=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),u=L(!1),c=L(""),f=pe(()=>{var ye;const ee=n.options.find(te=>te.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),h=pe(()=>n.openDirection??"down"),b=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),I=pe(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),O=pe(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=pe(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),$=pe(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function z(){n.disabled||(a.value=!a.value)}function j(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function oe(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const te=ee.target;te instanceof Node&&(ye.contains(te)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return mt(a,ee=>{if(!ee){u.value=!1,c.value="";return}b.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),ir(()=>{window.addEventListener("pointerdown",re)}),ar(()=>{window.removeEventListener("pointerdown",re)}),(ee,ye)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:z},[m("span",A_,ce(f.value),1),Ce(ui,{class:"composer-dropdown-chevron"})],8,C_),a.value?(w(),T("div",{key:0,class:gt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[m("div",R_,[b.value?(w(),T("div",x_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Yt(tt(de,["prevent"]),["esc"])},null,40,P_),[[nr,l.value]])])):se("",!0),m("ul",M_,[(w(!0),T(He,null,Et($.value,te=>(w(),T("li",{key:te.value},[m("button",{class:gt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:je=>j(te.value)},ce(te.label),11,O_)]))),128)),$.value.length===0?(w(),T("li",N_," No matching projects ")):se("",!0)]),N.value?(w(),T("div",$_,[u.value?(w(),T(He,{key:0},[tr(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Yt(tt(ve,["prevent"]),["enter"]),Yt(tt(Ie,["prevent"]),["esc"])]},null,40,D_),[[nr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},ce(O.value),1))])):se("",!0)])],2)):se("",!0)],512))}}),va=st(L_,[["__scopeId","data-v-7cfa2012"]]),j_=["disabled"],B_={class:"search-dropdown-value"},U_={class:"search-dropdown-search-wrap"},F_=["placeholder","onKeydown"],H_={key:0,class:"search-dropdown-list",role:"listbox"},V_=["onClick","onPointerenter"],W_={class:"search-dropdown-option-check"},z_={class:"search-dropdown-option-label"},q_={key:0,class:"search-dropdown-option-desc"},G_={key:1,class:"search-dropdown-empty"},K_=Lt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),u=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),f=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(z=>z.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),h=pe(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(z=>{var j;return z.label.toLowerCase().includes($)||(((j=z.description)==null?void 0:j.toLowerCase().includes($))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function N($){r("toggle",$.value,!c.value.has($.value))}function I($){h.value.length!==0&&(l.value=(l.value+$+h.value.length)%h.value.length)}function O(){const $=h.value[l.value];$&&N($)}function Y($){if(!i.value)return;const z=s.value;if(!z)return;const j=$.target;j instanceof Node&&(z.contains(j)||(i.value=!1))}return mt(a,()=>{l.value=0}),ir(()=>window.addEventListener("pointerdown",Y)),ar(()=>window.removeEventListener("pointerdown",Y)),($,z)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[m("span",B_,ce(f.value),1),Ce(ui,{class:"search-dropdown-chevron"})],8,j_),i.value?(w(),T("div",{key:0,class:gt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",U_,[tr(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":z[0]||(z[0]=j=>a.value=j),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[z[1]||(z[1]=Yt(tt(j=>i.value=!1,["prevent"]),["escape"])),Yt(tt(O,["prevent"]),["enter"]),z[2]||(z[2]=Yt(tt(j=>I(1),["prevent"]),["arrow-down"])),z[3]||(z[3]=Yt(tt(j=>I(-1),["prevent"]),["arrow-up"]))]},null,40,F_),[[nr,a.value]])]),h.value.length>0?(w(),T("ul",H_,[(w(!0),T(He,null,Et(h.value,(j,oe)=>(w(),T("li",{key:j.value},[m("button",{class:gt(["search-dropdown-option",{"is-selected":c.value.has(j.value),"is-highlighted":oe===l.value}]),type:"button",onClick:de=>N(j),onPointerenter:de=>l.value=oe},[m("span",W_,ce(c.value.has(j.value)?"✓":""),1),m("span",z_,ce(j.label),1),j.description?(w(),T("span",q_,ce(j.description),1)):se("",!0)],42,V_)]))),128))])):(w(),T("div",G_,"No results"))],2)):se("",!0)],512))}}),J_=st(K_,[["__scopeId","data-v-a0f2edd4"]]),Y_={class:"skill-picker-header"},Q_=["onKeydown"],X_={key:0,class:"skill-picker-list",role:"listbox"},Z_=["onClick","onPointerenter"],ek={class:"skill-picker-name"},tk={key:0,class:"skill-picker-desc"},nk={key:1,class:"skill-picker-empty"},rk=Lt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=pe(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(b=>b.name.toLowerCase().includes(h)||b.description.toLowerCase().includes(h)):n.skills}),u=pe(()=>{const h={};return n.anchorBottom!=null&&(h.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(h.left=`${n.anchorLeft}px`),h});function c(h){l.value.length!==0&&(a.value=(a.value+h+l.value.length)%l.value.length)}function f(){const h=l.value[a.value];h&&r("select",h)}return mt(()=>n.visible,h=>{h&&(i.value="",a.value=0,tn(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),mt(i,()=>{a.value=0}),(h,b)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:zr(u.value)},[m("div",Y_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Yt(tt(N=>h.$emit("close"),["prevent"]),["escape"])),Yt(tt(f,["prevent"]),["enter"]),b[2]||(b[2]=Yt(tt(N=>c(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Yt(tt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Q_),[[nr,i.value]])]),l.value.length>0?(w(),T("ul",X_,[(w(!0),T(He,null,Et(l.value,(N,I)=>(w(),T("li",{key:N.path},[m("button",{class:gt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:O=>h.$emit("select",N),onPointerenter:O=>a.value=I},[m("span",ek,ce(N.name),1),N.description?(w(),T("span",tk,ce(N.description),1)):se("",!0)],42,Z_)]))),128))])):(w(),T("div",nk,"No skills found"))],4)):se("",!0)}}),sk=st(rk,[["__scopeId","data-v-ff3fb7dc"]]),ok={key:0,class:"thread-composer-attachments"},ik=["src","alt"],ak=["aria-label","disabled","onClick"],lk={key:1,class:"thread-composer-file-chips"},ck=["title"],uk=["aria-label","disabled","onClick"],dk={key:2,class:"thread-composer-skill-chips"},fk={class:"thread-composer-skill-chip-name"},hk=["aria-label","onClick"],pk={class:"thread-composer-input-wrap"},mk={key:0,class:"thread-composer-file-mentions"},gk=["onMousedown"],vk={key:1,class:"thread-composer-file-mention-icon-markdown"},yk={class:"thread-composer-file-mention-text"},wk={class:"thread-composer-file-mention-name"},bk={key:0,class:"thread-composer-file-mention-dir"},_k={key:1,class:"thread-composer-file-mention-empty"},kk=["placeholder","disabled"],Tk={class:"thread-composer-controls"},Ik=["disabled"],Sk={key:0,class:"thread-composer-attach-menu"},Ek=["disabled"],Ck=["disabled"],Ak={class:"thread-composer-actions"},Rk=["aria-label","title","disabled"],xk=["disabled"],Pk=["aria-label","title","disabled"],Mk=["disabled"],Ok=["disabled"],Nk=Lt({__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=L(""),o=L([]),i=L([]),a=L([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=_b({onTranscript:U=>{s.value=s.value?`${s.value}
43
- ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L(""),j=L([]),oe=L(!1),de=L(0);let ve=0,Ie=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ye=pe(()=>n.models.map(U=>({value:U,label:U}))),te=pe(()=>n.skills??[]),je=pe(()=>i.value.map(U=>U.path)),Be=pe(()=>(n.skills??[]).map(U=>({value:U.path,label:U.name,description:U.description}))),Qe=pe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Re=pe(()=>n.disabled||!n.activeThreadId),Te=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=pe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function It(U="steer"){var ne;const K=s.value.trim();if(Qe.value){if(r("submit",{text:K,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:U}),s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D(),re){(ne=I.value)==null||ne.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function nt(){r("interrupt")}function Xe(U){r("update:selected-model",U)}function Ze(U){r("update:selected-reasoning-effort",U)}function ht(){Re.value||(O.value=!O.value)}function Rt(){var U;(U=b.value)==null||U.click()}function Ge(){var U;(U=N.value)==null||U.click()}function et(U){o.value=o.value.filter(K=>K.id!==U)}function W(U){i.value=i.value.filter(K=>K.path!==U)}function me(U){a.value=a.value.filter(K=>K.fsPath!==U)}function ie(U){const K=U.replace(/\\/g,"/");if(a.value.some(it=>it.fsPath===K))return;const ne=K.split("/").filter(Boolean),Je=ne[ne.length-1]??K;a.value=[...a.value,{label:Je,path:K,fsPath:K}]}function fe(U){return U.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(U.name)}function De(U){if(!(!U||U.length===0))for(const K of Array.from(U))if(fe(K)){const ne=new FileReader;ne.onload=()=>{typeof ne.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:ne.result})},ne.readAsDataURL(K)}else p_(K).then(ne=>{ne&&ie(ne)}).catch(()=>{})}function g(U){U&&(U.value="")}function v(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function A(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function H(){const K=s.value.startsWith("/");K!==Y.value&&(Y.value=K),B()}function F(U){if(oe.value){if(U.key==="Escape"){U.preventDefault(),D();return}if(U.key==="ArrowDown"){U.preventDefault(),j.value.length>0&&(de.value=(de.value+1)%j.value.length);return}if(U.key==="ArrowUp"){if(U.preventDefault(),j.value.length>0){const ne=j.value.length;de.value=(de.value+ne-1)%ne}return}if(U.key==="Enter"||U.key==="Tab"){U.preventDefault();const ne=j.value[de.value];ne?V(ne):D();return}}if(n.sendWithEnter!==!1?U.key==="Enter"&&!U.shiftKey:U.key==="Enter"&&(U.metaKey||U.ctrlKey)){U.preventDefault(),It(n.isTurnInProgress?Te.value:"steer");return}if(Y.value){if(U.key==="Escape"){U.preventDefault(),x();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();return}}}function x(){var U;Y.value=!1,(U=I.value)==null||U.focus()}function D(){oe.value=!1,$.value=null,z.value="",j.value=[],de.value=0}function B(){const U=I.value;if(!U){D();return}const K=U.selectionStart??s.value.length,Je=s.value.slice(0,K).match(/(^|\s)(@[^\s@]*)$/);if(!Je){D();return}const it=Je[2]??"",kt=it.length,xt=K-kt;$.value=xt,z.value=it.slice(1),oe.value=!0,G()}async function G(){if(!oe.value)return;const U=(n.cwd??"").trim();if(!U){j.value=[];return}Ie&&clearTimeout(Ie);const K=++ve;Ie=setTimeout(async()=>{try{const ne=await c_(U,z.value,20);if(!oe.value||K!==ve)return;j.value=ne,de.value=0}catch{if(!oe.value||K!==ve)return;j.value=[]}},120)}function V(U){const K=I.value,ne=$.value;if(ne!==null&&K){const Je=K.selectionStart??s.value.length;s.value=`${s.value.slice(0,ne)}${s.value.slice(Je)}`.trimEnd()}ie(U.path),D(),tn(()=>K==null?void 0:K.focus())}function be(U){const K=U.lastIndexOf("/");return K<0?U:U.slice(K+1)}function ae(U){const K=U.lastIndexOf("/");return K<=0?"":U.slice(0,K)}function he(U){const K=be(U),ne=K.lastIndexOf(".");return ne<=0?"":K.slice(ne+1).toLowerCase()}function Se(U){const K=he(U);return K==="ts"?"TS":K==="tsx"?"TSX":K==="js"?"JS":K==="jsx"?"JSX":K==="json"?"{}":""}function Me(U){const K=he(U);return K.startsWith("ts")?"ts":K.startsWith("js")?"js":K==="json"?"json":"default"}function Ke(U){const K=he(U);return K==="md"||K==="mdx"}function Pe(U){var K;i.value.some(ne=>ne.path===U.path)||(i.value=[...i.value,U]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(K=I.value)==null||K.focus()}function Ve(U,K){if(K){const ne=(n.skills??[]).find(Je=>Je.path===U);ne&&!i.value.some(Je=>Je.path===U)&&(i.value=[...i.value,ne])}else i.value=i.value.filter(ne=>ne.path!==U)}function _t(U){if(!O.value)return;const K=h.value;if(!K)return;const ne=U.target;!ne||K.contains(ne)||(O.value=!1)}return ir(()=>{document.addEventListener("click",_t)}),ar(()=>{document.removeEventListener("click",_t),Ie&&clearTimeout(Ie)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D()}),mt(()=>n.cwd,()=>{oe.value&&G()}),(U,K)=>(w(),T("form",{class:"thread-composer",onSubmit:K[7]||(K[7]=tt(ne=>It("steer"),["prevent"]))},[m("div",{class:gt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",ok,[(w(!0),T(He,null,Et(o.value,ne=>(w(),T("div",{key:ne.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:ne.url,alt:ne.name||"Selected image"},null,8,ik),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${ne.name||"image"}`,disabled:Re.value,onClick:Je=>et(ne.id)}," x ",8,ak)]))),128))])):se("",!0),a.value.length>0?(w(),T("div",lk,[(w(!0),T(He,null,Et(a.value,ne=>(w(),T("span",{key:ne.fsPath,class:"thread-composer-file-chip"},[Ce(Fo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:ne.fsPath},ce(ne.label),9,ck),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${ne.label}`,disabled:Re.value,onClick:Je=>me(ne.fsPath)},"×",8,uk)]))),128))])):se("",!0),i.value.length>0?(w(),T("div",dk,[(w(!0),T(He,null,Et(i.value,ne=>(w(),T("span",{key:ne.path,class:"thread-composer-skill-chip"},[m("span",fk,ce(ne.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${ne.name}`,onClick:Je=>W(ne.path)},"×",8,hk)]))),128))])):se("",!0),m("div",pk,[oe.value?(w(),T("div",mk,[j.value.length>0?(w(!0),T(He,{key:0},Et(j.value,(ne,Je)=>(w(),T("button",{key:ne.path,class:gt(["thread-composer-file-mention-row",{"is-active":Je===de.value}]),type:"button",onMousedown:tt(it=>V(ne),["prevent"])},[Se(ne.path)?(w(),T("span",{key:0,class:gt(["thread-composer-file-mention-icon-badge",`is-${Me(ne.path)}`])},ce(Se(ne.path)),3)):Ke(ne.path)?(w(),T("span",vk,"↓")):(w(),yt(Fo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",yk,[m("span",wk,ce(be(ne.path)),1),ae(ne.path)?(w(),T("span",bk,ce(ae(ne.path)),1)):se("",!0)])],42,gk))),128)):(w(),T("div",_k,"No matching files"))])):se("",!0),tr(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":K[0]||(K[0]=ne=>s.value=ne),class:"thread-composer-input",placeholder:$e.value,disabled:Re.value,onInput:H,onKeydown:F},null,40,kk),[[nr,s.value]]),Ce(sk,{skills:te.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:Pe,onClose:x},null,8,["skills","visible"])]),m("div",Tk,[m("div",{ref_key:"attachMenuRootRef",ref:h,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Re.value,onClick:ht}," + ",8,Ik),O.value?(w(),T("div",Sk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Rt}," Add photos & files ",8,Ek),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Ge}," Take photo ",8,Ck)])):se("",!0)],512),Ce(va,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Xe},null,8,["model-value","options","disabled"]),Ce(J_,{class:"thread-composer-control",options:Be.value,"selected-values":je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Ve},null,8,["options","selected-values","disabled"]),Ce(va,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"]),m("div",Ak,[ue(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:gt(["thread-composer-mic",{"thread-composer-mic--active":ue(l)!=="idle"}]),type:"button","aria-label":ue(l)==="recording"?"Stop dictation":"Hold to dictate",title:ue(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Re.value,onMousedown:K[1]||(K[1]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onMouseup:K[2]||(K[2]=(...ne)=>ue(f)&&ue(f)(...ne)),onMouseleave:K[3]||(K[3]=ne=>ue(l)==="recording"&&ue(f)()),onTouchstart:K[4]||(K[4]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onTouchend:K[5]||(K[5]=(...ne)=>ue(f)&&ue(f)(...ne))},[Ce(k_,{class:"thread-composer-mic-icon"})],42,Rk)):se("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(E_,{class:"thread-composer-stop-icon"})],8,xk)):se("",!0),m("button",{class:gt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Qe.value,onClick:K[6]||(K[6]=ne=>It(e.isTurnInProgress?Te.value:"steer"))},[Ce(y_,{class:"thread-composer-submit-icon"})],10,Pk)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Re.value,onChange:v},null,40,Mk),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Re.value,onChange:A},null,40,Ok)],32))}}),Dc=st(Nk,[["__scopeId","data-v-983e7906"]]),$k={key:0,class:"queued-messages"},Dk={class:"queued-messages-inner"},Lk={class:"queued-row-text"},jk={class:"queued-row-actions"},Bk=["onClick"],Uk=["onClick"],Fk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",$k,[m("div",Dk,[(w(!0),T(He,null,Et(e.messages,r=>(w(),T("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",Lk,ce(r.text),1),m("div",jk,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Bk),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,Uk)])]))),128))])])):se("",!0)}}),Hk=st(Fk,[["__scopeId","data-v-ea583733"]]),Vk={class:"runtime-dropdown-trigger-label"},Wk={key:0,class:"runtime-dropdown-menu-wrap"},zk={class:"runtime-dropdown-menu"},qk=["onClick"],Gk={class:"runtime-dropdown-option-label"},Kk={key:0,class:"runtime-dropdown-option-check"},Jk=Lt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:Qd},{value:"worktree",label:"New worktree",icon:Ao}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const h=c.target;h instanceof Node&&(f.contains(h)||(o.value=!1))}return ir(()=>{window.addEventListener("pointerdown",u)}),ar(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=h=>o.value=!o.value)},[(w(),yt(sa(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Vk,ce(a.value.label),1),Ce(ui,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",Wk,[m("div",zk,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Et(i,h=>m("button",{key:h.value,class:gt(["runtime-dropdown-option",{"is-selected":e.modelValue===h.value}]),type:"button",onClick:b=>l(h.value)},[(w(),yt(sa(h.icon),{class:"runtime-dropdown-option-icon"})),m("span",Gk,ce(h.label),1),e.modelValue===h.value?(w(),T("span",Kk,"✓")):se("",!0)],10,qk)),64))])])):se("",!0)],512))}}),Yk=st(Jk,[["__scopeId","data-v-9c9b71e5"]]),Qk={},Xk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Zk(e,t){return w(),T("svg",Xk,[...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 ya=st(Qk,[["render",Zk]]),e0={class:"skill-card-top"},t0=["src","alt"],n0={key:1,class:"skill-card-avatar-fallback"},r0={class:"skill-card-info"},s0={class:"skill-card-header"},o0={class:"skill-card-name"},i0={key:0,class:"skill-card-badge-disabled"},a0={key:1,class:"skill-card-badge"},l0={class:"skill-card-owner"},c0={key:0,class:"skill-card-desc"},u0={key:1,class:"skill-card-date"},d0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{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(),T("button",{class:gt(["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",e0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,t0)):(w(),T("div",n0,ce(e.skill.owner.charAt(0)),1)),m("div",r0,[m("div",s0,[m("span",o0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",i0,"Disabled")):e.skill.installed?(w(),T("span",a0,"Installed")):se("",!0)]),m("span",l0,ce(e.skill.owner),1)])]),e.skill.description?(w(),T("p",c0,ce(e.skill.description),1)):se("",!0),n.value?(w(),T("span",u0,ce(n.value),1)):se("",!0)],2))}}),Lc=st(d0,[["__scopeId","data-v-2a1e8196"]]),f0={class:"sdm-panel"},h0={class:"sdm-header"},p0={class:"sdm-title-area"},m0=["src","alt"],g0={class:"sdm-title-col"},v0={class:"sdm-title-row"},y0={class:"sdm-title"},w0={key:0,class:"sdm-badge-disabled"},b0={class:"sdm-owner"},_0={class:"sdm-body"},k0={key:0,class:"sdm-desc"},T0={key:1,class:"sdm-readme-loading"},I0=["innerHTML"],S0=["href"],E0={class:"sdm-footer"},C0={class:"sdm-footer-actions"},A0=["disabled"],R0=["disabled"],x0=["disabled"],P0=Lt({__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=L(null),o=L(""),i=L(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=pe(()=>{const I=o.value;if(!I)return"";const O=I.replace(/^---[\s\S]*?---\s*/,"");return c(O)});function c(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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}),O=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!O.ok)return;const Y=await O.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function h(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,O)=>(w(),yt(Do,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:O[1]||(O[1]=tt(Y=>I.$emit("close"),["self"]))},[m("div",f0,[m("div",h0,[m("div",p0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,m0)):se("",!0),m("div",g0,[m("div",v0,[m("h3",y0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",w0,"Disabled")):se("",!0)]),m("span",b0,ce(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:O[0]||(O[0]=Y=>I.$emit("close"))},[Ce(Xa,{class:"sdm-close-icon"})])]),m("div",_0,[e.skill.description?(w(),T("p",k0,ce(e.skill.description),1)):se("",!0),i.value?(w(),T("div",T0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,I0)):se("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,S0)]),m("div",E0,[m("div",C0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},ce(n.isUninstalling?"Uninstalling...":"Uninstall"),9,A0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:h},ce(n.isInstalling?"Installing...":"Install"),9,R0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},ce(a.value?"Disable":"Enable"),9,x0)):se("",!0)])])])])):se("",!0)]))}}),M0=st(P0,[["__scopeId","data-v-19a385ca"]]),O0=()=>{};var jc={};/**
42
+ `}async function Ni(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Qb(t,i)}];for(const f of n){const p=f.trim();p&&l.push({type:"image",url:p,image_url:p})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await nn("turn/start",c)}catch(a){throw ws(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Xb(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 nn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ws(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Zb(e){await nn("setDefaultModel",{model:e})}async function e_(){const e=await nn("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 t_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Ub(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function n_(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 pa(){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 n_(n.data)}async function r_(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 Nc(){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 s_(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 o_(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=Xa(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 i_(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=Xa(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 a_(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 u=Xa(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,p=typeof f=="string"?f.trim():"";p&&l.push({path:p})}return l}async function l_(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 Xa(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 c_(){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 $i(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 u_(e,t){var n;try{return((n=(await nn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function d_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await nn("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 f_(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 h_={},p_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function m_(e,t){return w(),T("svg",p_,[...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 g_=st(h_,[["render",m_]]),v_={},y_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function w_(e,t){return w(),T("svg",y_,[...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 b_=st(v_,[["render",w_]]),__={},k_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function T_(e,t){return w(),T("svg",k_,[...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 I_=st(__,[["render",T_]]),S_=["disabled"],E_={class:"composer-dropdown-value"},C_={class:"composer-dropdown-menu"},A_={key:0,class:"composer-dropdown-search-wrap"},R_=["placeholder","onKeydown"],P_={class:"composer-dropdown-options",role:"listbox"},x_=["onClick"],O_={key:0,class:"composer-dropdown-empty"},M_={key:1,class:"composer-dropdown-add-wrap"},N_=["placeholder","onKeydown"],$_=Lt({__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=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=pe(()=>{var ye;const ee=n.options.find(te=>te.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),p=pe(()=>n.openDirection??"down"),_=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),I=pe(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),M=pe(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=pe(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),j=pe(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function q(){n.disabled||(a.value=!a.value)}function B(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function oe(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const te=ee.target;te instanceof Node&&(ye.contains(te)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return mt(a,ee=>{if(!ee){u.value=!1,c.value="";return}_.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),ir(()=>{window.addEventListener("pointerdown",re)}),ar(()=>{window.removeEventListener("pointerdown",re)}),(ee,ye)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:q},[m("span",E_,ce(f.value),1),Ce(ci,{class:"composer-dropdown-chevron"})],8,S_),a.value?(w(),T("div",{key:0,class:gt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":p.value==="up","composer-dropdown-menu-wrap-down":p.value==="down"}])},[m("div",C_,[_.value?(w(),T("div",A_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Yt(tt(de,["prevent"]),["esc"])},null,40,R_),[[nr,l.value]])])):se("",!0),m("ul",P_,[(w(!0),T(He,null,Et(j.value,te=>(w(),T("li",{key:te.value},[m("button",{class:gt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:je=>B(te.value)},ce(te.label),11,x_)]))),128)),j.value.length===0?(w(),T("li",O_," No matching projects ")):se("",!0)]),N.value?(w(),T("div",M_,[u.value?(w(),T(He,{key:0},[tr(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Yt(tt(ve,["prevent"]),["enter"]),Yt(tt(Ie,["prevent"]),["esc"])]},null,40,N_),[[nr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},ce(M.value),1))])):se("",!0)])],2)):se("",!0)],512))}}),ma=st($_,[["__scopeId","data-v-7cfa2012"]]),D_=["disabled"],L_={class:"search-dropdown-value"},j_={class:"search-dropdown-search-wrap"},B_=["placeholder","onKeydown"],U_={key:0,class:"search-dropdown-list",role:"listbox"},F_=["onClick","onPointerenter"],H_={class:"search-dropdown-option-check"},V_={class:"search-dropdown-option-label"},W_={key:0,class:"search-dropdown-option-desc"},z_={key:1,class:"search-dropdown-empty"},q_=Lt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),u=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),f=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const j=n.options.find(q=>q.value===n.selectedValues[0]);return(j==null?void 0:j.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),p=pe(()=>{const j=a.value.toLowerCase().trim();return j?n.options.filter(q=>{var B;return q.label.toLowerCase().includes(j)||(((B=q.description)==null?void 0:B.toLowerCase().includes(j))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var j;return(j=o.value)==null?void 0:j.focus()})))}function N(j){r("toggle",j.value,!c.value.has(j.value))}function I(j){p.value.length!==0&&(l.value=(l.value+j+p.value.length)%p.value.length)}function M(){const j=p.value[l.value];j&&N(j)}function Y(j){if(!i.value)return;const q=s.value;if(!q)return;const B=j.target;B instanceof Node&&(q.contains(B)||(i.value=!1))}return mt(a,()=>{l.value=0}),ir(()=>window.addEventListener("pointerdown",Y)),ar(()=>window.removeEventListener("pointerdown",Y)),(j,q)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",L_,ce(f.value),1),Ce(ci,{class:"search-dropdown-chevron"})],8,D_),i.value?(w(),T("div",{key:0,class:gt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",j_,[tr(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":q[0]||(q[0]=B=>a.value=B),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[q[1]||(q[1]=Yt(tt(B=>i.value=!1,["prevent"]),["escape"])),Yt(tt(M,["prevent"]),["enter"]),q[2]||(q[2]=Yt(tt(B=>I(1),["prevent"]),["arrow-down"])),q[3]||(q[3]=Yt(tt(B=>I(-1),["prevent"]),["arrow-up"]))]},null,40,B_),[[nr,a.value]])]),p.value.length>0?(w(),T("ul",U_,[(w(!0),T(He,null,Et(p.value,(B,oe)=>(w(),T("li",{key:B.value},[m("button",{class:gt(["search-dropdown-option",{"is-selected":c.value.has(B.value),"is-highlighted":oe===l.value}]),type:"button",onClick:de=>N(B),onPointerenter:de=>l.value=oe},[m("span",H_,ce(c.value.has(B.value)?"✓":""),1),m("span",V_,ce(B.label),1),B.description?(w(),T("span",W_,ce(B.description),1)):se("",!0)],42,F_)]))),128))])):(w(),T("div",z_,"No results"))],2)):se("",!0)],512))}}),G_=st(q_,[["__scopeId","data-v-a0f2edd4"]]),K_={class:"skill-picker-header"},J_=["onKeydown"],Y_={key:0,class:"skill-picker-list",role:"listbox"},Q_=["onClick","onPointerenter"],X_={class:"skill-picker-name"},Z_={key:0,class:"skill-picker-desc"},ek={key:1,class:"skill-picker-empty"},tk=Lt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=pe(()=>{const p=i.value.toLowerCase().trim();return p?n.skills.filter(_=>_.name.toLowerCase().includes(p)||_.description.toLowerCase().includes(p)):n.skills}),u=pe(()=>{const p={};return n.anchorBottom!=null&&(p.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(p.left=`${n.anchorLeft}px`),p});function c(p){l.value.length!==0&&(a.value=(a.value+p+l.value.length)%l.value.length)}function f(){const p=l.value[a.value];p&&r("select",p)}return mt(()=>n.visible,p=>{p&&(i.value="",a.value=0,tn(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),mt(i,()=>{a.value=0}),(p,_)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:zr(u.value)},[m("div",K_,[tr(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]=Yt(tt(N=>p.$emit("close"),["prevent"]),["escape"])),Yt(tt(f,["prevent"]),["enter"]),_[2]||(_[2]=Yt(tt(N=>c(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Yt(tt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,J_),[[nr,i.value]])]),l.value.length>0?(w(),T("ul",Y_,[(w(!0),T(He,null,Et(l.value,(N,I)=>(w(),T("li",{key:N.path},[m("button",{class:gt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:M=>p.$emit("select",N),onPointerenter:M=>a.value=I},[m("span",X_,ce(N.name),1),N.description?(w(),T("span",Z_,ce(N.description),1)):se("",!0)],42,Q_)]))),128))])):(w(),T("div",ek,"No skills found"))],4)):se("",!0)}}),nk=st(tk,[["__scopeId","data-v-ff3fb7dc"]]),rk={key:0,class:"thread-composer-attachments"},sk=["src","alt"],ok=["aria-label","disabled","onClick"],ik={key:1,class:"thread-composer-file-chips"},ak=["title"],lk=["aria-label","disabled","onClick"],ck={key:2,class:"thread-composer-skill-chips"},uk={class:"thread-composer-skill-chip-name"},dk=["aria-label","onClick"],fk={class:"thread-composer-input-wrap"},hk={key:0,class:"thread-composer-file-mentions"},pk=["onMousedown"],mk={key:1,class:"thread-composer-file-mention-icon-markdown"},gk={class:"thread-composer-file-mention-text"},vk={class:"thread-composer-file-mention-name"},yk={key:0,class:"thread-composer-file-mention-dir"},wk={key:1,class:"thread-composer-file-mention-empty"},bk=["placeholder","disabled"],_k={class:"thread-composer-controls"},kk=["disabled"],Tk={key:0,class:"thread-composer-attach-menu"},Ik=["disabled"],Sk=["disabled"],Ek={class:"thread-composer-actions"},Ck=["aria-label","title","disabled"],Ak=["disabled"],Rk=["aria-label","title","disabled"],Pk=["disabled"],xk=["disabled"],Ok=Lt({__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=D(""),o=D([]),i=D([]),a=D([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=wb({onTranscript:U=>{s.value=s.value?`${s.value}
43
+ ${U}`:U}}),p=D(null),_=D(null),N=D(null),I=D(null),M=D(!1),Y=D(!1),j=D(null),q=D(""),B=D([]),oe=D(!1),de=D(0);let ve=0,Ie=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ye=pe(()=>n.models.map(U=>({value:U,label:U}))),te=pe(()=>n.skills??[]),je=pe(()=>i.value.map(U=>U.path)),Be=pe(()=>(n.skills??[]).map(U=>({value:U.path,label:U.name,description:U.description}))),Qe=pe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Re=pe(()=>n.disabled||!n.activeThreadId),Te=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=pe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function It(U="steer"){var ne;const K=s.value.trim();if(Qe.value){if(r("submit",{text:K,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:U}),s.value="",o.value=[],i.value=[],a.value=[],M.value=!1,Y.value=!1,$(),re){(ne=I.value)==null||ne.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function nt(){r("interrupt")}function Xe(U){r("update:selected-model",U)}function Ze(U){r("update:selected-reasoning-effort",U)}function ht(){Re.value||(M.value=!M.value)}function Rt(){var U;(U=_.value)==null||U.click()}function Ge(){var U;(U=N.value)==null||U.click()}function et(U){o.value=o.value.filter(K=>K.id!==U)}function W(U){i.value=i.value.filter(K=>K.path!==U)}function me(U){a.value=a.value.filter(K=>K.fsPath!==U)}function ie(U){const K=U.replace(/\\/g,"/");if(a.value.some(it=>it.fsPath===K))return;const ne=K.split("/").filter(Boolean),Je=ne[ne.length-1]??K;a.value=[...a.value,{label:Je,path:K,fsPath:K}]}function fe(U){return U.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(U.name)}function De(U){if(!(!U||U.length===0))for(const K of Array.from(U))if(fe(K)){const ne=new FileReader;ne.onload=()=>{typeof ne.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:ne.result})},ne.readAsDataURL(K)}else f_(K).then(ne=>{ne&&ie(ne)}).catch(()=>{})}function g(U){U&&(U.value="")}function v(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),M.value=!1}function A(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),M.value=!1}function H(){const K=s.value.startsWith("/");K!==Y.value&&(Y.value=K),L()}function F(U){if(oe.value){if(U.key==="Escape"){U.preventDefault(),$();return}if(U.key==="ArrowDown"){U.preventDefault(),B.value.length>0&&(de.value=(de.value+1)%B.value.length);return}if(U.key==="ArrowUp"){if(U.preventDefault(),B.value.length>0){const ne=B.value.length;de.value=(de.value+ne-1)%ne}return}if(U.key==="Enter"||U.key==="Tab"){U.preventDefault();const ne=B.value[de.value];ne?V(ne):$();return}}if(n.sendWithEnter!==!1?U.key==="Enter"&&!U.shiftKey:U.key==="Enter"&&(U.metaKey||U.ctrlKey)){U.preventDefault(),It(n.isTurnInProgress?Te.value:"steer");return}if(Y.value){if(U.key==="Escape"){U.preventDefault(),P();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();return}}}function P(){var U;Y.value=!1,(U=I.value)==null||U.focus()}function $(){oe.value=!1,j.value=null,q.value="",B.value=[],de.value=0}function L(){const U=I.value;if(!U){$();return}const K=U.selectionStart??s.value.length,Je=s.value.slice(0,K).match(/(^|\s)(@[^\s@]*)$/);if(!Je){$();return}const it=Je[2]??"",kt=it.length,Pt=K-kt;j.value=Pt,q.value=it.slice(1),oe.value=!0,G()}async function G(){if(!oe.value)return;const U=(n.cwd??"").trim();if(!U){B.value=[];return}Ie&&clearTimeout(Ie);const K=++ve;Ie=setTimeout(async()=>{try{const ne=await a_(U,q.value,20);if(!oe.value||K!==ve)return;B.value=ne,de.value=0}catch{if(!oe.value||K!==ve)return;B.value=[]}},120)}function V(U){const K=I.value,ne=j.value;if(ne!==null&&K){const Je=K.selectionStart??s.value.length;s.value=`${s.value.slice(0,ne)}${s.value.slice(Je)}`.trimEnd()}ie(U.path),$(),tn(()=>K==null?void 0:K.focus())}function be(U){const K=U.lastIndexOf("/");return K<0?U:U.slice(K+1)}function ae(U){const K=U.lastIndexOf("/");return K<=0?"":U.slice(0,K)}function he(U){const K=be(U),ne=K.lastIndexOf(".");return ne<=0?"":K.slice(ne+1).toLowerCase()}function Se(U){const K=he(U);return K==="ts"?"TS":K==="tsx"?"TSX":K==="js"?"JS":K==="jsx"?"JSX":K==="json"?"{}":""}function Oe(U){const K=he(U);return K.startsWith("ts")?"ts":K.startsWith("js")?"js":K==="json"?"json":"default"}function Ke(U){const K=he(U);return K==="md"||K==="mdx"}function xe(U){var K;i.value.some(ne=>ne.path===U.path)||(i.value=[...i.value,U]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(K=I.value)==null||K.focus()}function Ve(U,K){if(K){const ne=(n.skills??[]).find(Je=>Je.path===U);ne&&!i.value.some(Je=>Je.path===U)&&(i.value=[...i.value,ne])}else i.value=i.value.filter(ne=>ne.path!==U)}function _t(U){if(!M.value)return;const K=p.value;if(!K)return;const ne=U.target;!ne||K.contains(ne)||(M.value=!1)}return ir(()=>{document.addEventListener("click",_t)}),ar(()=>{document.removeEventListener("click",_t),Ie&&clearTimeout(Ie)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],M.value=!1,Y.value=!1,$()}),mt(()=>n.cwd,()=>{oe.value&&G()}),(U,K)=>(w(),T("form",{class:"thread-composer",onSubmit:K[7]||(K[7]=tt(ne=>It("steer"),["prevent"]))},[m("div",{class:gt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",rk,[(w(!0),T(He,null,Et(o.value,ne=>(w(),T("div",{key:ne.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:ne.url,alt:ne.name||"Selected image"},null,8,sk),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${ne.name||"image"}`,disabled:Re.value,onClick:Je=>et(ne.id)}," x ",8,ok)]))),128))])):se("",!0),a.value.length>0?(w(),T("div",ik,[(w(!0),T(He,null,Et(a.value,ne=>(w(),T("span",{key:ne.fsPath,class:"thread-composer-file-chip"},[Ce(Uo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:ne.fsPath},ce(ne.label),9,ak),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${ne.label}`,disabled:Re.value,onClick:Je=>me(ne.fsPath)},"×",8,lk)]))),128))])):se("",!0),i.value.length>0?(w(),T("div",ck,[(w(!0),T(He,null,Et(i.value,ne=>(w(),T("span",{key:ne.path,class:"thread-composer-skill-chip"},[m("span",uk,ce(ne.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${ne.name}`,onClick:Je=>W(ne.path)},"×",8,dk)]))),128))])):se("",!0),m("div",fk,[oe.value?(w(),T("div",hk,[B.value.length>0?(w(!0),T(He,{key:0},Et(B.value,(ne,Je)=>(w(),T("button",{key:ne.path,class:gt(["thread-composer-file-mention-row",{"is-active":Je===de.value}]),type:"button",onMousedown:tt(it=>V(ne),["prevent"])},[Se(ne.path)?(w(),T("span",{key:0,class:gt(["thread-composer-file-mention-icon-badge",`is-${Oe(ne.path)}`])},ce(Se(ne.path)),3)):Ke(ne.path)?(w(),T("span",mk,"↓")):(w(),yt(Uo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",gk,[m("span",vk,ce(be(ne.path)),1),ae(ne.path)?(w(),T("span",yk,ce(ae(ne.path)),1)):se("",!0)])],42,pk))),128)):(w(),T("div",wk,"No matching files"))])):se("",!0),tr(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":K[0]||(K[0]=ne=>s.value=ne),class:"thread-composer-input",placeholder:$e.value,disabled:Re.value,onInput:H,onKeydown:F},null,40,bk),[[nr,s.value]]),Ce(nk,{skills:te.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:xe,onClose:P},null,8,["skills","visible"])]),m("div",_k,[m("div",{ref_key:"attachMenuRootRef",ref:p,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Re.value,onClick:ht}," + ",8,kk),M.value?(w(),T("div",Tk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Rt}," Add photos & files ",8,Ik),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Ge}," Take photo ",8,Sk)])):se("",!0)],512),Ce(ma,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Xe},null,8,["model-value","options","disabled"]),Ce(G_,{class:"thread-composer-control",options:Be.value,"selected-values":je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Ve},null,8,["options","selected-values","disabled"]),Ce(ma,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"]),m("div",Ek,[ue(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:gt(["thread-composer-mic",{"thread-composer-mic--active":ue(l)!=="idle"}]),type:"button","aria-label":ue(l)==="recording"?"Stop dictation":"Hold to dictate",title:ue(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Re.value,onMousedown:K[1]||(K[1]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onMouseup:K[2]||(K[2]=(...ne)=>ue(f)&&ue(f)(...ne)),onMouseleave:K[3]||(K[3]=ne=>ue(l)==="recording"&&ue(f)()),onTouchstart:K[4]||(K[4]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onTouchend:K[5]||(K[5]=(...ne)=>ue(f)&&ue(f)(...ne))},[Ce(b_,{class:"thread-composer-mic-icon"})],42,Ck)):se("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(I_,{class:"thread-composer-stop-icon"})],8,Ak)):se("",!0),m("button",{class:gt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Qe.value,onClick:K[6]||(K[6]=ne=>It(e.isTurnInProgress?Te.value:"steer"))},[Ce(g_,{class:"thread-composer-submit-icon"})],10,Rk)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Re.value,onChange:v},null,40,Pk),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Re.value,onChange:A},null,40,xk)],32))}}),$c=st(Ok,[["__scopeId","data-v-983e7906"]]),Mk={key:0,class:"queued-messages"},Nk={class:"queued-messages-inner"},$k={class:"queued-row-text"},Dk={class:"queued-row-actions"},Lk=["onClick"],jk=["onClick"],Bk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",Mk,[m("div",Nk,[(w(!0),T(He,null,Et(e.messages,r=>(w(),T("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",$k,ce(r.text),1),m("div",Dk,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Lk),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,jk)])]))),128))])])):se("",!0)}}),Uk=st(Bk,[["__scopeId","data-v-ea583733"]]),Fk={class:"runtime-dropdown-trigger-label"},Hk={key:0,class:"runtime-dropdown-menu-wrap"},Vk={class:"runtime-dropdown-menu"},Wk=["onClick"],zk={class:"runtime-dropdown-option-label"},qk={key:0,class:"runtime-dropdown-option-check"},Gk=Lt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:Jd},{value:"worktree",label:"New worktree",icon:Co}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const p=c.target;p instanceof Node&&(f.contains(p)||(o.value=!1))}return ir(()=>{window.addEventListener("pointerdown",u)}),ar(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=p=>o.value=!o.value)},[(w(),yt(na(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Fk,ce(a.value.label),1),Ce(ci,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",Hk,[m("div",Vk,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Et(i,p=>m("button",{key:p.value,class:gt(["runtime-dropdown-option",{"is-selected":e.modelValue===p.value}]),type:"button",onClick:_=>l(p.value)},[(w(),yt(na(p.icon),{class:"runtime-dropdown-option-icon"})),m("span",zk,ce(p.label),1),e.modelValue===p.value?(w(),T("span",qk,"✓")):se("",!0)],10,Wk)),64))])])):se("",!0)],512))}}),Kk=st(Gk,[["__scopeId","data-v-9c9b71e5"]]),Jk={},Yk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Qk(e,t){return w(),T("svg",Yk,[...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 ga=st(Jk,[["render",Qk]]),Xk={class:"skill-card-top"},Zk=["src","alt"],e0={key:1,class:"skill-card-avatar-fallback"},t0={class:"skill-card-info"},n0={class:"skill-card-header"},r0={class:"skill-card-name"},s0={key:0,class:"skill-card-badge-disabled"},o0={key:1,class:"skill-card-badge"},i0={class:"skill-card-owner"},a0={key:0,class:"skill-card-desc"},l0={key:1,class:"skill-card-date"},c0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{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(),T("button",{class:gt(["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",Xk,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,Zk)):(w(),T("div",e0,ce(e.skill.owner.charAt(0)),1)),m("div",t0,[m("div",n0,[m("span",r0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",s0,"Disabled")):e.skill.installed?(w(),T("span",o0,"Installed")):se("",!0)]),m("span",i0,ce(e.skill.owner),1)])]),e.skill.description?(w(),T("p",a0,ce(e.skill.description),1)):se("",!0),n.value?(w(),T("span",l0,ce(n.value),1)):se("",!0)],2))}}),Dc=st(c0,[["__scopeId","data-v-2a1e8196"]]),u0={class:"sdm-panel"},d0={class:"sdm-header"},f0={class:"sdm-title-area"},h0=["src","alt"],p0={class:"sdm-title-col"},m0={class:"sdm-title-row"},g0={class:"sdm-title"},v0={key:0,class:"sdm-badge-disabled"},y0={class:"sdm-owner"},w0={class:"sdm-body"},b0={key:0,class:"sdm-desc"},_0={key:1,class:"sdm-readme-loading"},k0=["innerHTML"],T0=["href"],I0={class:"sdm-footer"},S0={class:"sdm-footer-actions"},E0=["disabled"],C0=["disabled"],A0=["disabled"],R0=Lt({__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=D(null),o=D(""),i=D(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=pe(()=>{const I=o.value;if(!I)return"";const M=I.replace(/^---[\s\S]*?---\s*/,"");return c(M)});function c(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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}),M=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!M.ok)return;const Y=await M.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function p(){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,M)=>(w(),yt($o,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:M[1]||(M[1]=tt(Y=>I.$emit("close"),["self"]))},[m("div",u0,[m("div",d0,[m("div",f0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,h0)):se("",!0),m("div",p0,[m("div",m0,[m("h3",g0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",v0,"Disabled")):se("",!0)]),m("span",y0,ce(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:M[0]||(M[0]=Y=>I.$emit("close"))},[Ce(Ya,{class:"sdm-close-icon"})])]),m("div",w0,[e.skill.description?(w(),T("p",b0,ce(e.skill.description),1)):se("",!0),i.value?(w(),T("div",_0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,k0)):se("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,T0)]),m("div",I0,[m("div",S0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},ce(n.isUninstalling?"Uninstalling...":"Uninstall"),9,E0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:p},ce(n.isInstalling?"Installing...":"Install"),9,C0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},ce(a.value?"Disable":"Enable"),9,A0)):se("",!0)])])])])):se("",!0)]))}}),P0=st(R0,[["__scopeId","data-v-19a385ca"]]),x0=()=>{};var Lc={};/**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  *
@@ -55,7 +55,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
55
55
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56
56
  * See the License for the specific language governing permissions and
57
57
  * limitations under the License.
58
- */const tf=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},N0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},nf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let h=(a&15)<<2|u>>6,b=u&63;l||(b=64,i||(h=64)),r.push(n[c],n[f],n[h],n[b])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(tf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):N0(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new $0;const h=o<<2|a>>4;if(r.push(h),u!==64){const b=a<<4&240|u>>2;if(r.push(b),f!==64){const N=u<<6&192|f;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class $0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const D0=function(e){const t=tf(e);return nf.encodeByteArray(t,!0)},rf=function(e){return D0(e).replace(/\./g,"")},sf=function(e){try{return nf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
58
+ */const Zd=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},O0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},ef={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let p=(a&15)<<2|u>>6,_=u&63;l||(_=64,i||(p=64)),r.push(n[c],n[f],n[p],n[_])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Zd(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):O0(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new M0;const p=o<<2|a>>4;if(r.push(p),u!==64){const _=a<<4&240|u>>2;if(r.push(_),f!==64){const N=u<<6&192|f;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class M0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const N0=function(e){const t=Zd(e);return ef.encodeByteArray(t,!0)},tf=function(e){return N0(e).replace(/\./g,"")},nf=function(e){try{return ef.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
59
59
  * @license
60
60
  * Copyright 2022 Google LLC
61
61
  *
@@ -70,7 +70,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
70
70
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
71
  * See the License for the specific language governing permissions and
72
72
  * limitations under the License.
73
- */function L0(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
73
+ */function $0(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
74
74
  * @license
75
75
  * Copyright 2022 Google LLC
76
76
  *
@@ -85,7 +85,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
85
85
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
86
  * See the License for the specific language governing permissions and
87
87
  * limitations under the License.
88
- */const j0=()=>L0().__FIREBASE_DEFAULTS__,B0=()=>{if(typeof process>"u"||typeof jc>"u")return;const e=jc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},U0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&sf(e[1]);return t&&JSON.parse(t)},tl=()=>{try{return O0()||j0()||B0()||U0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},F0=e=>{var t,n;return(n=(t=tl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},of=()=>{var e;return(e=tl())==null?void 0:e.config},af=e=>{var t;return(t=tl())==null?void 0:t[`_${e}`]};/**
88
+ */const D0=()=>$0().__FIREBASE_DEFAULTS__,L0=()=>{if(typeof process>"u"||typeof Lc>"u")return;const e=Lc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},j0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&nf(e[1]);return t&&JSON.parse(t)},Za=()=>{try{return x0()||D0()||L0()||j0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},B0=e=>{var t,n;return(n=(t=Za())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},rf=()=>{var e;return(e=Za())==null?void 0:e.config},sf=e=>{var t;return(t=Za())==null?void 0:t[`_${e}`]};/**
89
89
  * @license
90
90
  * Copyright 2017 Google LLC
91
91
  *
@@ -100,9 +100,9 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
100
100
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
101
101
  * See the License for the specific language governing permissions and
102
102
  * limitations under the License.
103
- */class H0{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
103
+ */class U0{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
104
104
  * @license
105
- * Copyright 2025 Google LLC
105
+ * Copyright 2017 Google LLC
106
106
  *
107
107
  * Licensed under the Apache License, Version 2.0 (the "License");
108
108
  * you may not use this file except in compliance with the License.
@@ -115,21 +115,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
115
115
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
116
  * See the License for the specific language governing permissions and
117
117
  * limitations under the License.
118
- */function di(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function V0(e){return(await fetch(e,{credentials:"include"})).ok}const Hs={};function W0(){const e={prod:[],emulator:[]};for(const t of Object.keys(Hs))Hs[t]?e.emulator.push(t):e.prod.push(t);return e}function z0(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Bc=!1;function q0(e,t){if(typeof window>"u"||typeof document>"u"||!di(window.location.host)||Hs[e]===t||Hs[e]||Bc)return;Hs[e]=t;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",o=W0().prod.length>0;function i(){const h=document.getElementById(r);h&&h.remove()}function a(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function l(h,b){h.setAttribute("width","24"),h.setAttribute("id",b),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" &times;",h.onclick=()=>{Bc=!0,i()},h}function c(h,b){h.setAttribute("id",b),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=z0(r),b=n("text"),N=document.getElementById(b)||document.createElement("span"),I=n("learnmore"),O=document.getElementById(I)||document.createElement("a"),Y=n("preprendIcon"),$=document.getElementById(Y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const z=h.element;a(z),c(O,I);const j=u();l($,Y),z.append($,N,O,j),document.body.appendChild(z)}o?(N.innerText="Preview backend disconnected.",$.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
119
- <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
120
- </g>
121
- <defs>
122
- <clipPath id="clip0_6013_33858">
123
- <rect width="24" height="24" fill="white"/>
124
- </clipPath>
125
- </defs>`):($.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
126
- <path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
127
- </g>
128
- <defs>
129
- <clipPath id="clip0_6083_34804">
130
- <rect width="24" height="24" fill="white"/>
131
- </clipPath>
132
- </defs>`,N.innerText="Preview backend running in this workspace."),N.setAttribute("id",b)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
118
+ */function Xt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function F0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xt())}function H0(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function V0(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function W0(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function z0(){const e=Xt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function q0(){try{return typeof indexedDB=="object"}catch{return!1}}function G0(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
133
119
  * @license
134
120
  * Copyright 2017 Google LLC
135
121
  *
@@ -144,7 +130,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
144
130
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145
131
  * See the License for the specific language governing permissions and
146
132
  * limitations under the License.
147
- */function Xt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function G0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xt())}function K0(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function J0(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function Y0(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Q0(){const e=Xt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function X0(){try{return typeof indexedDB=="object"}catch{return!1}}function Z0(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
133
+ */const K0="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=K0,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,oo.prototype.create)}}class oo{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?J0(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function J0(e,t){return e.replace(Y0,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const Y0=/\{\$([^}]+)}/g;function Q0(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function gs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(jc(o)&&jc(i)){if(!gs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function jc(e){return e!==null&&typeof e=="object"}/**
148
134
  * @license
149
135
  * Copyright 2017 Google LLC
150
136
  *
@@ -159,9 +145,9 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
159
145
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
146
  * See the License for the specific language governing permissions and
161
147
  * limitations under the License.
162
- */const eT="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=eT,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,io.prototype.create)}}class io{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?tT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function tT(e,t){return e.replace(nT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const nT=/\{\$([^}]+)}/g;function rT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function gs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Uc(o)&&Uc(i)){if(!gs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Uc(e){return e!==null&&typeof e=="object"}/**
148
+ */function io(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function X0(e,t){const n=new Z0(e,t);return n.subscribe.bind(n)}class Z0{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let s;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");eT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Di),s.error===void 0&&(s.error=Di),s.complete===void 0&&(s.complete=Di);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function eT(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function Di(){}/**
163
149
  * @license
164
- * Copyright 2017 Google LLC
150
+ * Copyright 2021 Google LLC
165
151
  *
166
152
  * Licensed under the Apache License, Version 2.0 (the "License");
167
153
  * you may not use this file except in compliance with the License.
@@ -174,9 +160,9 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
174
160
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
175
161
  * See the License for the specific language governing permissions and
176
162
  * limitations under the License.
177
- */function ao(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function sT(e,t){const n=new oT(e,t);return n.subscribe.bind(n)}class oT{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let s;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");iT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=ji),s.error===void 0&&(s.error=ji),s.complete===void 0&&(s.complete=ji);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function iT(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function ji(){}/**
163
+ */function bs(e){return e&&e._delegate?e._delegate:e}/**
178
164
  * @license
179
- * Copyright 2021 Google LLC
165
+ * Copyright 2025 Google LLC
180
166
  *
181
167
  * Licensed under the Apache License, Version 2.0 (the "License");
182
168
  * you may not use this file except in compliance with the License.
@@ -189,7 +175,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
189
175
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
176
  * See the License for the specific language governing permissions and
191
177
  * limitations under the License.
192
- */function bs(e){return e&&e._delegate?e._delegate:e}class vs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
178
+ */function el(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function tT(e){return(await fetch(e,{credentials:"include"})).ok}class vs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
193
179
  * @license
194
180
  * Copyright 2019 Google LLC
195
181
  *
@@ -219,7 +205,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
219
205
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
206
  * See the License for the specific language governing permissions and
221
207
  * limitations under the License.
222
- */class aT{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new H0;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),r=(t==null?void 0:t.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(cT(t))try{this.getOrInitializeService({instanceIdentifier:Lr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:s});r.resolve(o)}catch{}}}}clearInstance(t=Lr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Lr){return this.instances.has(t)}getOptions(t=Lr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,i]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&i.resolve(s)}return s}onInit(t,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(t),this.onInitCallbacks.set(r,s);const o=this.instances.get(r);return o&&t(o,r),()=>{s.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:lT(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Lr){return this.component?this.component.multipleInstances?t:Lr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function lT(e){return e===Lr?void 0:e}function cT(e){return e.instantiationMode==="EAGER"}/**
208
+ */class nT{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new U0;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),r=(t==null?void 0:t.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(sT(t))try{this.getOrInitializeService({instanceIdentifier:Lr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:s});r.resolve(o)}catch{}}}}clearInstance(t=Lr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Lr){return this.instances.has(t)}getOptions(t=Lr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,i]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&i.resolve(s)}return s}onInit(t,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(t),this.onInitCallbacks.set(r,s);const o=this.instances.get(r);return o&&t(o,r),()=>{s.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:rT(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Lr){return this.component?this.component.multipleInstances?t:Lr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function rT(e){return e===Lr?void 0:e}function sT(e){return e.instantiationMode==="EAGER"}/**
223
209
  * @license
224
210
  * Copyright 2019 Google LLC
225
211
  *
@@ -234,7 +220,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
234
220
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
235
221
  * See the License for the specific language governing permissions and
236
222
  * limitations under the License.
237
- */class uT{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new aT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
223
+ */class oT{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new nT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
238
224
  * @license
239
225
  * Copyright 2017 Google LLC
240
226
  *
@@ -249,7 +235,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
249
235
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
250
236
  * See the License for the specific language governing permissions and
251
237
  * limitations under the License.
252
- */var wt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(wt||(wt={}));const dT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},fT=wt.INFO,hT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},pT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=hT[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class lf{constructor(t){this.name=t,this._logLevel=fT,this._logHandler=pT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?dT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const mT=(e,t)=>t.some(n=>e instanceof n);let Fc,Hc;function gT(){return Fc||(Fc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function vT(){return Hc||(Hc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const cf=new WeakMap,wa=new WeakMap,uf=new WeakMap,Bi=new WeakMap,nl=new WeakMap;function yT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(br(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&cf.set(n,e)}).catch(()=>{}),nl.set(t,e),t}function wT(e){if(wa.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});wa.set(e,t)}let ba={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return wa.get(e);if(t==="objectStoreNames")return e.objectStoreNames||uf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return br(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function bT(e){ba=e(ba)}function _T(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Ui(this),t,...n);return uf.set(r,t.sort?t.sort():[t]),br(r)}:vT().includes(e)?function(...t){return e.apply(Ui(this),t),br(cf.get(this))}:function(...t){return br(e.apply(Ui(this),t))}}function kT(e){return typeof e=="function"?_T(e):(e instanceof IDBTransaction&&wT(e),mT(e,gT())?new Proxy(e,ba):e)}function br(e){if(e instanceof IDBRequest)return yT(e);if(Bi.has(e))return Bi.get(e);const t=kT(e);return t!==e&&(Bi.set(e,t),nl.set(t,e)),t}const Ui=e=>nl.get(e);function TT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=br(i);return r&&i.addEventListener("upgradeneeded",l=>{r(br(i.result),l.oldVersion,l.newVersion,br(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const IT=["get","getKey","getAll","getAllKeys","count"],ST=["put","add","delete","clear"],Fi=new Map;function Vc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Fi.get(t))return Fi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=ST.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||IT.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return Fi.set(t,o),o}bT(e=>({...e,get:(t,n,r)=>Vc(t,n)||e.get(t,n,r),has:(t,n)=>!!Vc(t,n)||e.has(t,n)}));/**
238
+ */var wt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(wt||(wt={}));const iT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},aT=wt.INFO,lT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},cT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=lT[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class of{constructor(t){this.name=t,this._logLevel=aT,this._logHandler=cT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?iT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const uT=(e,t)=>t.some(n=>e instanceof n);let Bc,Uc;function dT(){return Bc||(Bc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function fT(){return Uc||(Uc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const af=new WeakMap,va=new WeakMap,lf=new WeakMap,Li=new WeakMap,tl=new WeakMap;function hT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(br(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&af.set(n,e)}).catch(()=>{}),tl.set(t,e),t}function pT(e){if(va.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});va.set(e,t)}let ya={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return va.get(e);if(t==="objectStoreNames")return e.objectStoreNames||lf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return br(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function mT(e){ya=e(ya)}function gT(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ji(this),t,...n);return lf.set(r,t.sort?t.sort():[t]),br(r)}:fT().includes(e)?function(...t){return e.apply(ji(this),t),br(af.get(this))}:function(...t){return br(e.apply(ji(this),t))}}function vT(e){return typeof e=="function"?gT(e):(e instanceof IDBTransaction&&pT(e),uT(e,dT())?new Proxy(e,ya):e)}function br(e){if(e instanceof IDBRequest)return hT(e);if(Li.has(e))return Li.get(e);const t=vT(e);return t!==e&&(Li.set(e,t),tl.set(t,e)),t}const ji=e=>tl.get(e);function yT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=br(i);return r&&i.addEventListener("upgradeneeded",l=>{r(br(i.result),l.oldVersion,l.newVersion,br(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const wT=["get","getKey","getAll","getAllKeys","count"],bT=["put","add","delete","clear"],Bi=new Map;function Fc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Bi.get(t))return Bi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=bT.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||wT.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return Bi.set(t,o),o}mT(e=>({...e,get:(t,n,r)=>Fc(t,n)||e.get(t,n,r),has:(t,n)=>!!Fc(t,n)||e.has(t,n)}));/**
253
239
  * @license
254
240
  * Copyright 2019 Google LLC
255
241
  *
@@ -264,7 +250,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
264
250
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
265
251
  * See the License for the specific language governing permissions and
266
252
  * limitations under the License.
267
- */class ET{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(CT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function CT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const _a="@firebase/app",Wc="0.14.9";/**
253
+ */class _T{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(kT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function kT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const wa="@firebase/app",Hc="0.14.10";/**
268
254
  * @license
269
255
  * Copyright 2019 Google LLC
270
256
  *
@@ -279,7 +265,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
279
265
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
266
  * See the License for the specific language governing permissions and
281
267
  * limitations under the License.
282
- */const rr=new lf("@firebase/app"),AT="@firebase/app-compat",RT="@firebase/analytics-compat",xT="@firebase/analytics",PT="@firebase/app-check-compat",MT="@firebase/app-check",OT="@firebase/auth",NT="@firebase/auth-compat",$T="@firebase/database",DT="@firebase/data-connect",LT="@firebase/database-compat",jT="@firebase/functions",BT="@firebase/functions-compat",UT="@firebase/installations",FT="@firebase/installations-compat",HT="@firebase/messaging",VT="@firebase/messaging-compat",WT="@firebase/performance",zT="@firebase/performance-compat",qT="@firebase/remote-config",GT="@firebase/remote-config-compat",KT="@firebase/storage",JT="@firebase/storage-compat",YT="@firebase/firestore",QT="@firebase/ai",XT="@firebase/firestore-compat",ZT="firebase",e1="12.10.0";/**
268
+ */const rr=new of("@firebase/app"),TT="@firebase/app-compat",IT="@firebase/analytics-compat",ST="@firebase/analytics",ET="@firebase/app-check-compat",CT="@firebase/app-check",AT="@firebase/auth",RT="@firebase/auth-compat",PT="@firebase/database",xT="@firebase/data-connect",OT="@firebase/database-compat",MT="@firebase/functions",NT="@firebase/functions-compat",$T="@firebase/installations",DT="@firebase/installations-compat",LT="@firebase/messaging",jT="@firebase/messaging-compat",BT="@firebase/performance",UT="@firebase/performance-compat",FT="@firebase/remote-config",HT="@firebase/remote-config-compat",VT="@firebase/storage",WT="@firebase/storage-compat",zT="@firebase/firestore",qT="@firebase/ai",GT="@firebase/firestore-compat",KT="firebase",JT="12.11.0";/**
283
269
  * @license
284
270
  * Copyright 2019 Google LLC
285
271
  *
@@ -294,7 +280,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
294
280
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
281
  * See the License for the specific language governing permissions and
296
282
  * limitations under the License.
297
- */const ka="[DEFAULT]",t1={[_a]:"fire-core",[AT]:"fire-core-compat",[xT]:"fire-analytics",[RT]:"fire-analytics-compat",[MT]:"fire-app-check",[PT]:"fire-app-check-compat",[OT]:"fire-auth",[NT]:"fire-auth-compat",[$T]:"fire-rtdb",[DT]:"fire-data-connect",[LT]:"fire-rtdb-compat",[jT]:"fire-fn",[BT]:"fire-fn-compat",[UT]:"fire-iid",[FT]:"fire-iid-compat",[HT]:"fire-fcm",[VT]:"fire-fcm-compat",[WT]:"fire-perf",[zT]:"fire-perf-compat",[qT]:"fire-rc",[GT]:"fire-rc-compat",[KT]:"fire-gcs",[JT]:"fire-gcs-compat",[YT]:"fire-fst",[XT]:"fire-fst-compat",[QT]:"fire-vertex","fire-js":"fire-js",[ZT]:"fire-js-all"};/**
283
+ */const ba="[DEFAULT]",YT={[wa]:"fire-core",[TT]:"fire-core-compat",[ST]:"fire-analytics",[IT]:"fire-analytics-compat",[CT]:"fire-app-check",[ET]:"fire-app-check-compat",[AT]:"fire-auth",[RT]:"fire-auth-compat",[PT]:"fire-rtdb",[xT]:"fire-data-connect",[OT]:"fire-rtdb-compat",[MT]:"fire-fn",[NT]:"fire-fn-compat",[$T]:"fire-iid",[DT]:"fire-iid-compat",[LT]:"fire-fcm",[jT]:"fire-fcm-compat",[BT]:"fire-perf",[UT]:"fire-perf-compat",[FT]:"fire-rc",[HT]:"fire-rc-compat",[VT]:"fire-gcs",[WT]:"fire-gcs-compat",[zT]:"fire-fst",[GT]:"fire-fst-compat",[qT]:"fire-vertex","fire-js":"fire-js",[KT]:"fire-js-all"};/**
298
284
  * @license
299
285
  * Copyright 2019 Google LLC
300
286
  *
@@ -309,7 +295,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
309
295
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
310
296
  * See the License for the specific language governing permissions and
311
297
  * limitations under the License.
312
- */const Zs=new Map,n1=new Map,Ta=new Map;function zc(e,t){try{e.container.addComponent(t)}catch(n){rr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function eo(e){const t=e.name;if(Ta.has(t))return rr.debug(`There were multiple attempts to register component ${t}.`),!1;Ta.set(t,e);for(const n of Zs.values())zc(n,e);for(const n of n1.values())zc(n,e);return!0}function df(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function xn(e){return e==null?!1:e.settings!==void 0}/**
298
+ */const Xs=new Map,QT=new Map,_a=new Map;function Vc(e,t){try{e.container.addComponent(t)}catch(n){rr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Zs(e){const t=e.name;if(_a.has(t))return rr.debug(`There were multiple attempts to register component ${t}.`),!1;_a.set(t,e);for(const n of Xs.values())Vc(n,e);for(const n of QT.values())Vc(n,e);return!0}function cf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Pn(e){return e==null?!1:e.settings!==void 0}/**
313
299
  * @license
314
300
  * Copyright 2019 Google LLC
315
301
  *
@@ -324,7 +310,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
324
310
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
325
311
  * See the License for the specific language governing permissions and
326
312
  * limitations under the License.
327
- */const r1={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},_r=new io("app","Firebase",r1);/**
313
+ */const XT={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},_r=new oo("app","Firebase",XT);/**
328
314
  * @license
329
315
  * Copyright 2019 Google LLC
330
316
  *
@@ -339,7 +325,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
339
325
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
326
  * See the License for the specific language governing permissions and
341
327
  * limitations under the License.
342
- */class s1{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new vs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw _r.create("app-deleted",{appName:this._name})}}/**
328
+ */class ZT{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new vs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw _r.create("app-deleted",{appName:this._name})}}/**
343
329
  * @license
344
330
  * Copyright 2019 Google LLC
345
331
  *
@@ -354,7 +340,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
354
340
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
355
341
  * See the License for the specific language governing permissions and
356
342
  * limitations under the License.
357
- */const lo=e1;function ff(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:ka,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw _r.create("bad-app-name",{appName:String(s)});if(n||(n=of()),!n)throw _r.create("no-options");const o=Zs.get(s);if(o){if(gs(n,o.options)&&gs(r,o.config))return o;throw _r.create("duplicate-app",{appName:s})}const i=new uT(s);for(const l of Ta.values())i.addComponent(l);const a=new s1(n,r,i);return Zs.set(s,a),a}function hf(e=ka){const t=Zs.get(e);if(!t&&e===ka&&of())return ff();if(!t)throw _r.create("no-app",{appName:e});return t}function o1(){return Array.from(Zs.values())}function cs(e,t,n){let r=t1[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),rr.warn(i.join(" "));return}eo(new vs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
343
+ */const ao=JT;function uf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:ba,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw _r.create("bad-app-name",{appName:String(s)});if(n||(n=rf()),!n)throw _r.create("no-options");const o=Xs.get(s);if(o){if(gs(n,o.options)&&gs(r,o.config))return o;throw _r.create("duplicate-app",{appName:s})}const i=new oT(s);for(const l of _a.values())i.addComponent(l);const a=new ZT(n,r,i);return Xs.set(s,a),a}function df(e=ba){const t=Xs.get(e);if(!t&&e===ba&&rf())return uf();if(!t)throw _r.create("no-app",{appName:e});return t}function eI(){return Array.from(Xs.values())}function cs(e,t,n){let r=YT[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),rr.warn(i.join(" "));return}Zs(new vs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
358
344
  * @license
359
345
  * Copyright 2021 Google LLC
360
346
  *
@@ -369,7 +355,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
369
355
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
370
356
  * See the License for the specific language governing permissions and
371
357
  * limitations under the License.
372
- */const i1="firebase-heartbeat-database",a1=1,to="firebase-heartbeat-store";let Hi=null;function pf(){return Hi||(Hi=TT(i1,a1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(to)}catch(n){console.warn(n)}}}}).catch(e=>{throw _r.create("idb-open",{originalErrorMessage:e.message})})),Hi}async function l1(e){try{const n=(await pf()).transaction(to),r=await n.objectStore(to).get(mf(e));return await n.done,r}catch(t){if(t instanceof Ir)rr.warn(t.message);else{const n=_r.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});rr.warn(n.message)}}}async function qc(e,t){try{const r=(await pf()).transaction(to,"readwrite");await r.objectStore(to).put(t,mf(e)),await r.done}catch(n){if(n instanceof Ir)rr.warn(n.message);else{const r=_r.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});rr.warn(r.message)}}}function mf(e){return`${e.name}!${e.options.appId}`}/**
358
+ */const tI="firebase-heartbeat-database",nI=1,eo="firebase-heartbeat-store";let Ui=null;function ff(){return Ui||(Ui=yT(tI,nI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(eo)}catch(n){console.warn(n)}}}}).catch(e=>{throw _r.create("idb-open",{originalErrorMessage:e.message})})),Ui}async function rI(e){try{const n=(await ff()).transaction(eo),r=await n.objectStore(eo).get(hf(e));return await n.done,r}catch(t){if(t instanceof Ir)rr.warn(t.message);else{const n=_r.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});rr.warn(n.message)}}}async function Wc(e,t){try{const r=(await ff()).transaction(eo,"readwrite");await r.objectStore(eo).put(t,hf(e)),await r.done}catch(n){if(n instanceof Ir)rr.warn(n.message);else{const r=_r.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});rr.warn(r.message)}}}function hf(e){return`${e.name}!${e.options.appId}`}/**
373
359
  * @license
374
360
  * Copyright 2021 Google LLC
375
361
  *
@@ -384,7 +370,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
384
370
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
385
371
  * See the License for the specific language governing permissions and
386
372
  * limitations under the License.
387
- */const c1=1024,u1=30;class d1{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new h1(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Gc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>u1){const i=p1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){rr.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Gc(),{heartbeatsToSend:r,unsentEntries:s}=f1(this._heartbeatsCache.heartbeats),o=rf(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return rr.warn(n),""}}}function Gc(){return new Date().toISOString().substring(0,10)}function f1(e,t=c1){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),Kc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Kc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class h1{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return X0()?Z0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await l1(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Kc(e){return rf(JSON.stringify({version:2,heartbeats:e})).length}function p1(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
373
+ */const sI=1024,oI=30;class iI{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new lI(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=zc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>oI){const i=cI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){rr.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=zc(),{heartbeatsToSend:r,unsentEntries:s}=aI(this._heartbeatsCache.heartbeats),o=tf(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return rr.warn(n),""}}}function zc(){return new Date().toISOString().substring(0,10)}function aI(e,t=sI){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),qc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),qc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class lI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return q0()?G0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await rI(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Wc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Wc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function qc(e){return tf(JSON.stringify({version:2,heartbeats:e})).length}function cI(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
388
374
  * @license
389
375
  * Copyright 2019 Google LLC
390
376
  *
@@ -399,7 +385,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
399
385
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
386
  * See the License for the specific language governing permissions and
401
387
  * limitations under the License.
402
- */function m1(e){eo(new vs("platform-logger",t=>new ET(t),"PRIVATE")),eo(new vs("heartbeat",t=>new d1(t),"PRIVATE")),cs(_a,Wc,e),cs(_a,Wc,"esm2020"),cs("fire-js","")}m1("");var g1="firebase",v1="12.10.0";/**
388
+ */function uI(e){Zs(new vs("platform-logger",t=>new _T(t),"PRIVATE")),Zs(new vs("heartbeat",t=>new iI(t),"PRIVATE")),cs(wa,Hc,e),cs(wa,Hc,"esm2020"),cs("fire-js","")}uI("");var dI="firebase",fI="12.11.0";/**
403
389
  * @license
404
390
  * Copyright 2020 Google LLC
405
391
  *
@@ -414,7 +400,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
414
400
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
415
401
  * See the License for the specific language governing permissions and
416
402
  * limitations under the License.
417
- */cs(g1,v1,"app");function gf(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const y1=gf,vf=new io("auth","Firebase",gf());/**
403
+ */cs(dI,fI,"app");function pf(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const hI=pf,mf=new oo("auth","Firebase",pf());/**
418
404
  * @license
419
405
  * Copyright 2020 Google LLC
420
406
  *
@@ -429,7 +415,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
429
415
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430
416
  * See the License for the specific language governing permissions and
431
417
  * limitations under the License.
432
- */const Ho=new lf("@firebase/auth");function w1(e,...t){Ho.logLevel<=wt.WARN&&Ho.warn(`Auth (${lo}): ${e}`,...t)}function Ro(e,...t){Ho.logLevel<=wt.ERROR&&Ho.error(`Auth (${lo}): ${e}`,...t)}/**
418
+ */const Fo=new of("@firebase/auth");function pI(e,...t){Fo.logLevel<=wt.WARN&&Fo.warn(`Auth (${ao}): ${e}`,...t)}function Ao(e,...t){Fo.logLevel<=wt.ERROR&&Fo.error(`Auth (${ao}): ${e}`,...t)}/**
433
419
  * @license
434
420
  * Copyright 2020 Google LLC
435
421
  *
@@ -444,7 +430,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
444
430
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
445
431
  * See the License for the specific language governing permissions and
446
432
  * limitations under the License.
447
- */function $n(e,...t){throw sl(e,...t)}function gn(e,...t){return sl(e,...t)}function rl(e,t,n){const r={...y1(),[t]:n};return new io("auth","Firebase",r).create(t,{appName:e.name})}function Wr(e){return rl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function b1(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),rl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function sl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return vf.create(e,...t)}function Fe(e,t,...n){if(!e)throw sl(t,...n)}function Jn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ro(t),new Error(t)}function sr(e,t){e||Jn(t)}/**
433
+ */function $n(e,...t){throw rl(e,...t)}function gn(e,...t){return rl(e,...t)}function nl(e,t,n){const r={...hI(),[t]:n};return new oo("auth","Firebase",r).create(t,{appName:e.name})}function Wr(e){return nl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function mI(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),nl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function rl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return mf.create(e,...t)}function Fe(e,t,...n){if(!e)throw rl(t,...n)}function Jn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ao(t),new Error(t)}function sr(e,t){e||Jn(t)}/**
448
434
  * @license
449
435
  * Copyright 2020 Google LLC
450
436
  *
@@ -459,7 +445,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
459
445
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
446
  * See the License for the specific language governing permissions and
461
447
  * limitations under the License.
462
- */function Ia(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function _1(){return Jc()==="http:"||Jc()==="https:"}function Jc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
448
+ */function ka(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function gI(){return Gc()==="http:"||Gc()==="https:"}function Gc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
463
449
  * @license
464
450
  * Copyright 2020 Google LLC
465
451
  *
@@ -474,7 +460,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
474
460
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
475
461
  * See the License for the specific language governing permissions and
476
462
  * limitations under the License.
477
- */function k1(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(_1()||J0()||"connection"in navigator)?navigator.onLine:!0}function T1(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
463
+ */function vI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(gI()||V0()||"connection"in navigator)?navigator.onLine:!0}function yI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
478
464
  * @license
479
465
  * Copyright 2020 Google LLC
480
466
  *
@@ -489,7 +475,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
489
475
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
490
476
  * See the License for the specific language governing permissions and
491
477
  * limitations under the License.
492
- */class co{constructor(t,n){this.shortDelay=t,this.longDelay=n,sr(n>t,"Short delay should be less than long delay!"),this.isMobile=G0()||Y0()}get(){return k1()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
478
+ */class lo{constructor(t,n){this.shortDelay=t,this.longDelay=n,sr(n>t,"Short delay should be less than long delay!"),this.isMobile=F0()||W0()}get(){return vI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
493
479
  * @license
494
480
  * Copyright 2020 Google LLC
495
481
  *
@@ -504,7 +490,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
504
490
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505
491
  * See the License for the specific language governing permissions and
506
492
  * limitations under the License.
507
- */function ol(e,t){sr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
493
+ */function sl(e,t){sr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
508
494
  * @license
509
495
  * Copyright 2020 Google LLC
510
496
  *
@@ -519,7 +505,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
519
505
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
520
506
  * See the License for the specific language governing permissions and
521
507
  * limitations under the License.
522
- */class yf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
508
+ */class gf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
523
509
  * @license
524
510
  * Copyright 2020 Google LLC
525
511
  *
@@ -534,7 +520,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
534
520
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
535
521
  * See the License for the specific language governing permissions and
536
522
  * limitations under the License.
537
- */const I1={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
523
+ */const wI={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
538
524
  * @license
539
525
  * Copyright 2020 Google LLC
540
526
  *
@@ -549,7 +535,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
549
535
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
550
536
  * See the License for the specific language governing permissions and
551
537
  * limitations under the License.
552
- */const S1=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],E1=new co(3e4,6e4);function il(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function _s(e,t,n,r,s={}){return wf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ao({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const u={method:t,headers:l,...o};return K0()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&di(e.emulatorConfig.host)&&(u.credentials="include"),yf.fetch()(await bf(e,e.config.apiHost,n,a),u)})}async function wf(e,t,n){e._canInitEmulator=!1;const r={...I1,...t};try{const s=new A1(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw yo(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const a=o.ok?i.errorMessage:i.error.message,[l,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw yo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw yo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw yo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw rl(e,c,u);$n(e,c)}}catch(s){if(s instanceof Ir)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function C1(e,t,n,r,s={}){const o=await _s(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function bf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?ol(e.config,s):`${e.config.apiScheme}://${s}`;return S1.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class A1{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(gn(this.auth,"network-request-failed")),E1.get())})}}function yo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=gn(e,t,r);return s.customData._tokenResponse=n,s}/**
538
+ */const bI=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],_I=new lo(3e4,6e4);function ol(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function _s(e,t,n,r,s={}){return vf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=io({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const u={method:t,headers:l,...o};return H0()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&el(e.emulatorConfig.host)&&(u.credentials="include"),gf.fetch()(await yf(e,e.config.apiHost,n,a),u)})}async function vf(e,t,n){e._canInitEmulator=!1;const r={...wI,...t};try{const s=new TI(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw vo(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const a=o.ok?i.errorMessage:i.error.message,[l,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw vo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw vo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw vo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw nl(e,c,u);$n(e,c)}}catch(s){if(s instanceof Ir)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function kI(e,t,n,r,s={}){const o=await _s(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function yf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?sl(e.config,s):`${e.config.apiScheme}://${s}`;return bI.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class TI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(gn(this.auth,"network-request-failed")),_I.get())})}}function vo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=gn(e,t,r);return s.customData._tokenResponse=n,s}/**
553
539
  * @license
554
540
  * Copyright 2020 Google LLC
555
541
  *
@@ -564,7 +550,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
564
550
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
565
551
  * See the License for the specific language governing permissions and
566
552
  * limitations under the License.
567
- */async function R1(e,t){return _s(e,"POST","/v1/accounts:delete",t)}async function Vo(e,t){return _s(e,"POST","/v1/accounts:lookup",t)}/**
553
+ */async function II(e,t){return _s(e,"POST","/v1/accounts:delete",t)}async function Ho(e,t){return _s(e,"POST","/v1/accounts:lookup",t)}/**
568
554
  * @license
569
555
  * Copyright 2020 Google LLC
570
556
  *
@@ -579,7 +565,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
579
565
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
566
  * See the License for the specific language governing permissions and
581
567
  * limitations under the License.
582
- */function Vs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function x1(e,t=!1){const n=bs(e),r=await n.getIdToken(t),s=al(r);Fe(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Vs(Vi(s.auth_time)),issuedAtTime:Vs(Vi(s.iat)),expirationTime:Vs(Vi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Vi(e){return Number(e)*1e3}function al(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Ro("JWT malformed, contained fewer than 3 sections"),null;try{const s=sf(n);return s?JSON.parse(s):(Ro("Failed to decode base64 JWT payload"),null)}catch(s){return Ro("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Yc(e){const t=al(e);return Fe(t,"internal-error"),Fe(typeof t.exp<"u","internal-error"),Fe(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
568
+ */function Hs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function SI(e,t=!1){const n=bs(e),r=await n.getIdToken(t),s=il(r);Fe(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Hs(Fi(s.auth_time)),issuedAtTime:Hs(Fi(s.iat)),expirationTime:Hs(Fi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Fi(e){return Number(e)*1e3}function il(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Ao("JWT malformed, contained fewer than 3 sections"),null;try{const s=nf(n);return s?JSON.parse(s):(Ao("Failed to decode base64 JWT payload"),null)}catch(s){return Ao("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Kc(e){const t=il(e);return Fe(t,"internal-error"),Fe(typeof t.exp<"u","internal-error"),Fe(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
583
569
  * @license
584
570
  * Copyright 2020 Google LLC
585
571
  *
@@ -594,7 +580,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
594
580
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
595
581
  * See the License for the specific language governing permissions and
596
582
  * limitations under the License.
597
- */async function no(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&P1(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function P1({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
583
+ */async function to(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&EI(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function EI({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
598
584
  * @license
599
585
  * Copyright 2020 Google LLC
600
586
  *
@@ -609,7 +595,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
609
595
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
610
596
  * See the License for the specific language governing permissions and
611
597
  * limitations under the License.
612
- */class M1{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
598
+ */class CI{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
613
599
  * @license
614
600
  * Copyright 2020 Google LLC
615
601
  *
@@ -624,7 +610,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
624
610
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
625
611
  * See the License for the specific language governing permissions and
626
612
  * limitations under the License.
627
- */class Sa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Vs(this.lastLoginAt),this.creationTime=Vs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
613
+ */class Ta{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Hs(this.lastLoginAt),this.creationTime=Hs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
628
614
  * @license
629
615
  * Copyright 2019 Google LLC
630
616
  *
@@ -639,7 +625,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
639
625
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
626
  * See the License for the specific language governing permissions and
641
627
  * limitations under the License.
642
- */async function Wo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await no(e,Vo(t,{idToken:n}));Fe(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?_f(s.providerUserInfo):[],i=N1(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),u=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new Sa(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function O1(e){const t=bs(e);await Wo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function N1(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function _f(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
628
+ */async function Vo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await to(e,Ho(t,{idToken:n}));Fe(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?wf(s.providerUserInfo):[],i=RI(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),u=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new Ta(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function AI(e){const t=bs(e);await Vo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function RI(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function wf(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
643
629
  * @license
644
630
  * Copyright 2020 Google LLC
645
631
  *
@@ -654,7 +640,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
654
640
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
641
  * See the License for the specific language governing permissions and
656
642
  * limitations under the License.
657
- */async function $1(e,t){const n=await wf(e,{},async()=>{const r=ao({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await bf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&di(e.emulatorConfig.host)&&(l.credentials="include"),yf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function D1(e,t){return _s(e,"POST","/v2/accounts:revokeToken",il(e,t))}/**
643
+ */async function PI(e,t){const n=await vf(e,{},async()=>{const r=io({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await yf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&el(e.emulatorConfig.host)&&(l.credentials="include"),gf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function xI(e,t){return _s(e,"POST","/v2/accounts:revokeToken",ol(e,t))}/**
658
644
  * @license
659
645
  * Copyright 2020 Google LLC
660
646
  *
@@ -669,7 +655,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
669
655
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670
656
  * See the License for the specific language governing permissions and
671
657
  * limitations under the License.
672
- */class us{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Fe(t.idToken,"internal-error"),Fe(typeof t.idToken<"u","internal-error"),Fe(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Yc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=Yc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Fe(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:s,expiresIn:o}=await $1(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new us;return r&&(Fe(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Fe(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Fe(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new us,this.toJSON())}_performRefresh(){return Jn("not implemented")}}/**
658
+ */class us{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Fe(t.idToken,"internal-error"),Fe(typeof t.idToken<"u","internal-error"),Fe(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Kc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=Kc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Fe(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:s,expiresIn:o}=await PI(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new us;return r&&(Fe(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Fe(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Fe(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new us,this.toJSON())}_performRefresh(){return Jn("not implemented")}}/**
673
659
  * @license
674
660
  * Copyright 2020 Google LLC
675
661
  *
@@ -684,7 +670,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
684
670
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
685
671
  * See the License for the specific language governing permissions and
686
672
  * limitations under the License.
687
- */function fr(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class hn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new M1(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Sa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await no(this,this.stsTokenManager.getToken(this.auth,t));return Fe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return x1(this,t)}reload(){return O1(this)}_assign(t){this!==t&&(Fe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new hn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Fe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await Wo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(xn(this.auth.app))return Promise.reject(Wr(this.auth));const t=await this.getIdToken();return await no(this,R1(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:b,providerData:N,stsTokenManager:I}=n;Fe(f&&I,t,"internal-error");const O=us.fromJSON(this.name,I);Fe(typeof f=="string",t,"internal-error"),fr(r,t.name),fr(s,t.name),Fe(typeof h=="boolean",t,"internal-error"),Fe(typeof b=="boolean",t,"internal-error"),fr(o,t.name),fr(i,t.name),fr(a,t.name),fr(l,t.name),fr(u,t.name),fr(c,t.name);const Y=new hn({uid:f,auth:t,email:s,emailVerified:h,displayName:r,isAnonymous:b,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:O,createdAt:u,lastLoginAt:c});return N&&Array.isArray(N)&&(Y.providerData=N.map($=>({...$}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new us;s.updateFromServerResponse(n);const o=new hn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Wo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Fe(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?_f(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new us;a.updateFromIdToken(r);const l=new hn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Sa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
673
+ */function fr(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class hn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new CI(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ta(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await to(this,this.stsTokenManager.getToken(this.auth,t));return Fe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return SI(this,t)}reload(){return AI(this)}_assign(t){this!==t&&(Fe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new hn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Fe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await Vo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Pn(this.auth.app))return Promise.reject(Wr(this.auth));const t=await this.getIdToken();return await to(this,II(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:p,isAnonymous:_,providerData:N,stsTokenManager:I}=n;Fe(f&&I,t,"internal-error");const M=us.fromJSON(this.name,I);Fe(typeof f=="string",t,"internal-error"),fr(r,t.name),fr(s,t.name),Fe(typeof p=="boolean",t,"internal-error"),Fe(typeof _=="boolean",t,"internal-error"),fr(o,t.name),fr(i,t.name),fr(a,t.name),fr(l,t.name),fr(u,t.name),fr(c,t.name);const Y=new hn({uid:f,auth:t,email:s,emailVerified:p,displayName:r,isAnonymous:_,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:M,createdAt:u,lastLoginAt:c});return N&&Array.isArray(N)&&(Y.providerData=N.map(j=>({...j}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new us;s.updateFromServerResponse(n);const o=new hn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Vo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Fe(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?wf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new us;a.updateFromIdToken(r);const l=new hn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Ta(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
688
674
  * @license
689
675
  * Copyright 2020 Google LLC
690
676
  *
@@ -699,7 +685,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
699
685
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
700
686
  * See the License for the specific language governing permissions and
701
687
  * limitations under the License.
702
- */const Qc=new Map;function Yn(e){sr(e instanceof Function,"Expected a class definition");let t=Qc.get(e);return t?(sr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Qc.set(e,t),t)}/**
688
+ */const Jc=new Map;function Yn(e){sr(e instanceof Function,"Expected a class definition");let t=Jc.get(e);return t?(sr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Jc.set(e,t),t)}/**
703
689
  * @license
704
690
  * Copyright 2019 Google LLC
705
691
  *
@@ -714,7 +700,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
714
700
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
715
701
  * See the License for the specific language governing permissions and
716
702
  * limitations under the License.
717
- */class kf{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}kf.type="NONE";const Xc=kf;/**
703
+ */class bf{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}bf.type="NONE";const Yc=bf;/**
718
704
  * @license
719
705
  * Copyright 2019 Google LLC
720
706
  *
@@ -729,7 +715,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
729
715
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
730
716
  * See the License for the specific language governing permissions and
731
717
  * limitations under the License.
732
- */function xo(e,t,n){return`firebase:${e}:${t}:${n}`}class ds{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=xo(this.userKey,s.apiKey,o),this.fullPersistenceKey=xo("persistence",s.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const n=await Vo(this.auth,{idToken:t}).catch(()=>{});return n?hn._fromGetAccountInfoResponse(this.auth,n,t):null}return hn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new ds(Yn(Xc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Yn(Xc);const i=xo(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let f;if(typeof c=="string"){const h=await Vo(t,{idToken:c}).catch(()=>{});if(!h)break;f=await hn._fromGetAccountInfoResponse(t,h,c)}else f=hn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ds(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new ds(o,t,r))}}/**
718
+ */function Ro(e,t,n){return`firebase:${e}:${t}:${n}`}class ds{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Ro(this.userKey,s.apiKey,o),this.fullPersistenceKey=Ro("persistence",s.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const n=await Ho(this.auth,{idToken:t}).catch(()=>{});return n?hn._fromGetAccountInfoResponse(this.auth,n,t):null}return hn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new ds(Yn(Yc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Yn(Yc);const i=Ro(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let f;if(typeof c=="string"){const p=await Ho(t,{idToken:c}).catch(()=>{});if(!p)break;f=await hn._fromGetAccountInfoResponse(t,p,c)}else f=hn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ds(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new ds(o,t,r))}}/**
733
719
  * @license
734
720
  * Copyright 2020 Google LLC
735
721
  *
@@ -744,7 +730,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
744
730
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
745
731
  * See the License for the specific language governing permissions and
746
732
  * limitations under the License.
747
- */function Zc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Ef(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Tf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Af(t))return"Blackberry";if(Rf(t))return"Webos";if(If(t))return"Safari";if((t.includes("chrome/")||Sf(t))&&!t.includes("edge/"))return"Chrome";if(Cf(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Tf(e=Xt()){return/firefox\//i.test(e)}function If(e=Xt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Sf(e=Xt()){return/crios\//i.test(e)}function Ef(e=Xt()){return/iemobile/i.test(e)}function Cf(e=Xt()){return/android/i.test(e)}function Af(e=Xt()){return/blackberry/i.test(e)}function Rf(e=Xt()){return/webos/i.test(e)}function ll(e=Xt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function L1(e=Xt()){var t;return ll(e)&&!!((t=window.navigator)!=null&&t.standalone)}function j1(){return Q0()&&document.documentMode===10}function xf(e=Xt()){return ll(e)||Cf(e)||Rf(e)||Af(e)||/windows phone/i.test(e)||Ef(e)}/**
733
+ */function Qc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(If(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(_f(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ef(t))return"Blackberry";if(Cf(t))return"Webos";if(kf(t))return"Safari";if((t.includes("chrome/")||Tf(t))&&!t.includes("edge/"))return"Chrome";if(Sf(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function _f(e=Xt()){return/firefox\//i.test(e)}function kf(e=Xt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Tf(e=Xt()){return/crios\//i.test(e)}function If(e=Xt()){return/iemobile/i.test(e)}function Sf(e=Xt()){return/android/i.test(e)}function Ef(e=Xt()){return/blackberry/i.test(e)}function Cf(e=Xt()){return/webos/i.test(e)}function al(e=Xt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function OI(e=Xt()){var t;return al(e)&&!!((t=window.navigator)!=null&&t.standalone)}function MI(){return z0()&&document.documentMode===10}function Af(e=Xt()){return al(e)||Sf(e)||Cf(e)||Ef(e)||/windows phone/i.test(e)||If(e)}/**
748
734
  * @license
749
735
  * Copyright 2020 Google LLC
750
736
  *
@@ -759,7 +745,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
759
745
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
760
746
  * See the License for the specific language governing permissions and
761
747
  * limitations under the License.
762
- */function Pf(e,t=[]){let n;switch(e){case"Browser":n=Zc(Xt());break;case"Worker":n=`${Zc(Xt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${lo}/${r}`}/**
748
+ */function Rf(e,t=[]){let n;switch(e){case"Browser":n=Qc(Xt());break;case"Worker":n=`${Qc(Xt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${ao}/${r}`}/**
763
749
  * @license
764
750
  * Copyright 2022 Google LLC
765
751
  *
@@ -774,7 +760,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
774
760
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
775
761
  * See the License for the specific language governing permissions and
776
762
  * limitations under the License.
777
- */class B1{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((i,a)=>{try{const l=t(o);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
763
+ */class NI{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((i,a)=>{try{const l=t(o);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
778
764
  * @license
779
765
  * Copyright 2023 Google LLC
780
766
  *
@@ -789,7 +775,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
789
775
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
790
776
  * See the License for the specific language governing permissions and
791
777
  * limitations under the License.
792
- */async function U1(e,t={}){return _s(e,"GET","/v2/passwordPolicy",il(e,t))}/**
778
+ */async function $I(e,t={}){return _s(e,"GET","/v2/passwordPolicy",ol(e,t))}/**
793
779
  * @license
794
780
  * Copyright 2023 Google LLC
795
781
  *
@@ -804,7 +790,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
804
790
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
805
791
  * See the License for the specific language governing permissions and
806
792
  * limitations under the License.
807
- */const F1=6;class H1{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??F1,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=t.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,n),this.validatePasswordCharacterOptions(t,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),s&&(n.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<t.length;s++)r=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
793
+ */const DI=6;class LI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??DI,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=t.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,n),this.validatePasswordCharacterOptions(t,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),s&&(n.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<t.length;s++)r=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
808
794
  * @license
809
795
  * Copyright 2020 Google LLC
810
796
  *
@@ -819,7 +805,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
819
805
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
820
806
  * See the License for the specific language governing permissions and
821
807
  * limitations under the License.
822
- */class V1{constructor(t,n,r,s){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eu(this),this.idTokenSubscription=new eu(this),this.beforeStateQueue=new B1(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=vf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Yn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ds.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Vo(this,{idToken:t}),r=await hn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(xn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Fe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await Wo(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=T1()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(xn(this.app))return Promise.reject(Wr(this));const n=t?bs(t):null;return n&&Fe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Fe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return xn(this.app)?Promise.reject(Wr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return xn(this.app)?Promise.reject(Wr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Yn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await U1(this),n=new H1(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new io("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await D1(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Yn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await ds.create(this,[Yn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Fe(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Fe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Pf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(xn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&w1(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function fi(e){return bs(e)}class eu{constructor(t){this.auth=t,this.observer=null,this.addObserver=sT(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
808
+ */class jI{constructor(t,n,r,s){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Xc(this),this.idTokenSubscription=new Xc(this),this.beforeStateQueue=new NI(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=mf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Yn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ds.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Ho(this,{idToken:t}),r=await hn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(Pn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Fe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await Vo(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=yI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Pn(this.app))return Promise.reject(Wr(this));const n=t?bs(t):null;return n&&Fe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Fe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Pn(this.app)?Promise.reject(Wr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Pn(this.app)?Promise.reject(Wr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Yn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await $I(this),n=new LI(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new oo("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await xI(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Yn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await ds.create(this,[Yn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Fe(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Fe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Rf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(Pn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&pI(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ui(e){return bs(e)}class Xc{constructor(t){this.auth=t,this.observer=null,this.addObserver=X0(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
823
809
  * @license
824
810
  * Copyright 2020 Google LLC
825
811
  *
@@ -834,7 +820,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
834
820
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
835
821
  * See the License for the specific language governing permissions and
836
822
  * limitations under the License.
837
- */let cl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function W1(e){cl=e}function z1(e){return cl.loadJS(e)}function q1(){return cl.gapiScript}function G1(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
823
+ */let ll={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function BI(e){ll=e}function UI(e){return ll.loadJS(e)}function FI(){return ll.gapiScript}function HI(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
838
824
  * @license
839
825
  * Copyright 2020 Google LLC
840
826
  *
@@ -849,7 +835,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
849
835
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
850
836
  * See the License for the specific language governing permissions and
851
837
  * limitations under the License.
852
- */function K1(e,t){const n=df(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(gs(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function J1(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Yn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function Y1(e,t,n){const r=fi(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Mf(t),{host:i,port:a}=Q1(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Fe(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Fe(gs(u,r.config.emulator)&&gs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,di(i)?(V0(`${o}//${i}${l}`),q0("Auth",!0)):X1()}function Mf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Q1(e){const t=Mf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:tu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:tu(i)}}}function tu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function X1(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
838
+ */function VI(e,t){const n=cf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(gs(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function WI(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Yn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function zI(e,t,n){const r=ui(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Pf(t),{host:i,port:a}=qI(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Fe(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Fe(gs(u,r.config.emulator)&&gs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,el(i)?tT(`${o}//${i}${l}`):GI()}function Pf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function qI(e){const t=Pf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:Zc(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:Zc(i)}}}function Zc(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function GI(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
853
839
  * @license
854
840
  * Copyright 2020 Google LLC
855
841
  *
@@ -864,7 +850,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
864
850
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
865
851
  * See the License for the specific language governing permissions and
866
852
  * limitations under the License.
867
- */class Of{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Jn("not implemented")}_getIdTokenResponse(t){return Jn("not implemented")}_linkToIdToken(t,n){return Jn("not implemented")}_getReauthenticationResolver(t){return Jn("not implemented")}}/**
853
+ */class xf{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Jn("not implemented")}_getIdTokenResponse(t){return Jn("not implemented")}_linkToIdToken(t,n){return Jn("not implemented")}_getReauthenticationResolver(t){return Jn("not implemented")}}/**
868
854
  * @license
869
855
  * Copyright 2020 Google LLC
870
856
  *
@@ -879,7 +865,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
879
865
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880
866
  * See the License for the specific language governing permissions and
881
867
  * limitations under the License.
882
- */async function fs(e,t){return C1(e,"POST","/v1/accounts:signInWithIdp",il(e,t))}/**
868
+ */async function fs(e,t){return kI(e,"POST","/v1/accounts:signInWithIdp",ol(e,t))}/**
883
869
  * @license
884
870
  * Copyright 2020 Google LLC
885
871
  *
@@ -894,7 +880,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
894
880
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
895
881
  * See the License for the specific language governing permissions and
896
882
  * limitations under the License.
897
- */const Z1="http://localhost";class qr extends Of{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new qr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new qr(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return fs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,fs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,fs(t,n)}buildRequest(){const t={requestUri:Z1,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=ao(n)}return t}}/**
883
+ */const KI="http://localhost";class qr extends xf{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new qr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new qr(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return fs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,fs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,fs(t,n)}buildRequest(){const t={requestUri:KI,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=io(n)}return t}}/**
898
884
  * @license
899
885
  * Copyright 2020 Google LLC
900
886
  *
@@ -909,7 +895,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
909
895
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
910
896
  * See the License for the specific language governing permissions and
911
897
  * limitations under the License.
912
- */class ul{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
898
+ */class cl{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
913
899
  * @license
914
900
  * Copyright 2019 Google LLC
915
901
  *
@@ -924,7 +910,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
924
910
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
925
911
  * See the License for the specific language governing permissions and
926
912
  * limitations under the License.
927
- */class uo extends ul{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
913
+ */class co extends cl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
928
914
  * @license
929
915
  * Copyright 2020 Google LLC
930
916
  *
@@ -939,7 +925,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
939
925
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
940
926
  * See the License for the specific language governing permissions and
941
927
  * limitations under the License.
942
- */class vr extends uo{constructor(){super("facebook.com")}static credential(t){return qr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return vr.credentialFromTaggedObject(t)}static credentialFromError(t){return vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return vr.credential(t.oauthAccessToken)}catch{return null}}}vr.FACEBOOK_SIGN_IN_METHOD="facebook.com";vr.PROVIDER_ID="facebook.com";/**
928
+ */class vr extends co{constructor(){super("facebook.com")}static credential(t){return qr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return vr.credentialFromTaggedObject(t)}static credentialFromError(t){return vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return vr.credential(t.oauthAccessToken)}catch{return null}}}vr.FACEBOOK_SIGN_IN_METHOD="facebook.com";vr.PROVIDER_ID="facebook.com";/**
943
929
  * @license
944
930
  * Copyright 2020 Google LLC
945
931
  *
@@ -954,7 +940,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
954
940
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
955
941
  * See the License for the specific language governing permissions and
956
942
  * limitations under the License.
957
- */class yr extends uo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return qr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return yr.credential(n,r)}catch{return null}}}yr.GOOGLE_SIGN_IN_METHOD="google.com";yr.PROVIDER_ID="google.com";/**
943
+ */class yr extends co{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return qr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return yr.credential(n,r)}catch{return null}}}yr.GOOGLE_SIGN_IN_METHOD="google.com";yr.PROVIDER_ID="google.com";/**
958
944
  * @license
959
945
  * Copyright 2020 Google LLC
960
946
  *
@@ -969,7 +955,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
969
955
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
970
956
  * See the License for the specific language governing permissions and
971
957
  * limitations under the License.
972
- */class Pn extends uo{constructor(){super("github.com")}static credential(t){return qr._fromParams({providerId:Pn.PROVIDER_ID,signInMethod:Pn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Pn.credentialFromTaggedObject(t)}static credentialFromError(t){return Pn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Pn.credential(t.oauthAccessToken)}catch{return null}}}Pn.GITHUB_SIGN_IN_METHOD="github.com";Pn.PROVIDER_ID="github.com";/**
958
+ */class xn extends co{constructor(){super("github.com")}static credential(t){return qr._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return xn.credentialFromTaggedObject(t)}static credentialFromError(t){return xn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return xn.credential(t.oauthAccessToken)}catch{return null}}}xn.GITHUB_SIGN_IN_METHOD="github.com";xn.PROVIDER_ID="github.com";/**
973
959
  * @license
974
960
  * Copyright 2020 Google LLC
975
961
  *
@@ -984,7 +970,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
984
970
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
985
971
  * See the License for the specific language governing permissions and
986
972
  * limitations under the License.
987
- */class wr extends uo{constructor(){super("twitter.com")}static credential(t,n){return qr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.TWITTER_SIGN_IN_METHOD="twitter.com";wr.PROVIDER_ID="twitter.com";/**
973
+ */class wr extends co{constructor(){super("twitter.com")}static credential(t,n){return qr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.TWITTER_SIGN_IN_METHOD="twitter.com";wr.PROVIDER_ID="twitter.com";/**
988
974
  * @license
989
975
  * Copyright 2020 Google LLC
990
976
  *
@@ -999,7 +985,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
999
985
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1000
986
  * See the License for the specific language governing permissions and
1001
987
  * limitations under the License.
1002
- */class ys{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await hn._fromIdTokenResponse(t,r,s),i=nu(r);return new ys({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=nu(r);return new ys({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function nu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
988
+ */class ys{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await hn._fromIdTokenResponse(t,r,s),i=eu(r);return new ys({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=eu(r);return new ys({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function eu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1003
989
  * @license
1004
990
  * Copyright 2020 Google LLC
1005
991
  *
@@ -1014,7 +1000,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1014
1000
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1015
1001
  * See the License for the specific language governing permissions and
1016
1002
  * limitations under the License.
1017
- */class zo extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,zo.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,s){return new zo(t,n,r,s)}}function Nf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?zo._fromErrorAndOperation(e,o,t,r):o})}async function eI(e,t,n=!1){const r=await no(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ys._forOperation(e,"link",r)}/**
1003
+ */class Wo extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Wo.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,s){return new Wo(t,n,r,s)}}function Of(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Wo._fromErrorAndOperation(e,o,t,r):o})}async function JI(e,t,n=!1){const r=await to(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ys._forOperation(e,"link",r)}/**
1018
1004
  * @license
1019
1005
  * Copyright 2019 Google LLC
1020
1006
  *
@@ -1029,7 +1015,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1029
1015
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1030
1016
  * See the License for the specific language governing permissions and
1031
1017
  * limitations under the License.
1032
- */async function tI(e,t,n=!1){const{auth:r}=e;if(xn(r.app))return Promise.reject(Wr(r));const s="reauthenticate";try{const o=await no(e,Nf(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=al(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),ys._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1018
+ */async function YI(e,t,n=!1){const{auth:r}=e;if(Pn(r.app))return Promise.reject(Wr(r));const s="reauthenticate";try{const o=await to(e,Of(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=il(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),ys._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1033
1019
  * @license
1034
1020
  * Copyright 2020 Google LLC
1035
1021
  *
@@ -1044,7 +1030,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1044
1030
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1045
1031
  * See the License for the specific language governing permissions and
1046
1032
  * limitations under the License.
1047
- */async function nI(e,t,n=!1){if(xn(e.app))return Promise.reject(Wr(e));const r="signIn",s=await Nf(e,r,t),o=await ys._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function rI(e,t,n,r){return bs(e).onIdTokenChanged(t,n,r)}function sI(e,t,n){return bs(e).beforeAuthStateChanged(t,n)}const qo="__sak";/**
1033
+ */async function QI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r="signIn",s=await Of(e,r,t),o=await ys._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function XI(e,t,n,r){return bs(e).onIdTokenChanged(t,n,r)}function ZI(e,t,n){return bs(e).beforeAuthStateChanged(t,n)}const zo="__sak";/**
1048
1034
  * @license
1049
1035
  * Copyright 2019 Google LLC
1050
1036
  *
@@ -1059,7 +1045,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1059
1045
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1060
1046
  * See the License for the specific language governing permissions and
1061
1047
  * limitations under the License.
1062
- */class $f{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(qo,"1"),this.storage.removeItem(qo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1048
+ */class Mf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(zo,"1"),this.storage.removeItem(zo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1063
1049
  * @license
1064
1050
  * Copyright 2020 Google LLC
1065
1051
  *
@@ -1074,7 +1060,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1074
1060
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1075
1061
  * See the License for the specific language governing permissions and
1076
1062
  * limitations under the License.
1077
- */const oI=1e3,iI=10;class Df extends $f{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=xf(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);j1()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,iI):s()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},oI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}Df.type="LOCAL";const aI=Df;/**
1063
+ */const eS=1e3,tS=10;class Nf extends Mf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Af(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);MI()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,tS):s()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},eS)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}Nf.type="LOCAL";const nS=Nf;/**
1078
1064
  * @license
1079
1065
  * Copyright 2020 Google LLC
1080
1066
  *
@@ -1089,7 +1075,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1089
1075
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1090
1076
  * See the License for the specific language governing permissions and
1091
1077
  * limitations under the License.
1092
- */class Lf extends $f{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Lf.type="SESSION";const jf=Lf;/**
1078
+ */class $f extends Mf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}$f.type="SESSION";const Df=$f;/**
1093
1079
  * @license
1094
1080
  * Copyright 2019 Google LLC
1095
1081
  *
@@ -1104,7 +1090,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1104
1090
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1105
1091
  * See the License for the specific language governing permissions and
1106
1092
  * limitations under the License.
1107
- */function lI(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1093
+ */function rS(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1108
1094
  * @license
1109
1095
  * Copyright 2019 Google LLC
1110
1096
  *
@@ -1119,7 +1105,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1119
1105
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1120
1106
  * See the License for the specific language governing permissions and
1121
1107
  * limitations under the License.
1122
- */class hi{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(s=>s.isListeningto(t));if(n)return n;const r=new hi(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:s,data:o}=n.data,i=this.handlersMap[s];if(!(i!=null&&i.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(i).map(async u=>u(n.origin,o)),l=await lI(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}hi.receivers=[];/**
1108
+ */class di{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(s=>s.isListeningto(t));if(n)return n;const r=new di(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:s,data:o}=n.data,i=this.handlersMap[s];if(!(i!=null&&i.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(i).map(async u=>u(n.origin,o)),l=await rS(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}di.receivers=[];/**
1123
1109
  * @license
1124
1110
  * Copyright 2020 Google LLC
1125
1111
  *
@@ -1134,7 +1120,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1134
1120
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1135
1121
  * See the License for the specific language governing permissions and
1136
1122
  * limitations under the License.
1137
- */function dl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1123
+ */function ul(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1138
1124
  * @license
1139
1125
  * Copyright 2019 Google LLC
1140
1126
  *
@@ -1149,7 +1135,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1149
1135
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1150
1136
  * See the License for the specific language governing permissions and
1151
1137
  * limitations under the License.
1152
- */class cI{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const u=dl("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const h=f;if(h.data.eventId===u)switch(h.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(h.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:u,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1138
+ */class sS{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const u=ul("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const p=f;if(p.data.eventId===u)switch(p.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(p.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:u,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1153
1139
  * @license
1154
1140
  * Copyright 2020 Google LLC
1155
1141
  *
@@ -1164,7 +1150,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1164
1150
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1165
1151
  * See the License for the specific language governing permissions and
1166
1152
  * limitations under the License.
1167
- */function Nn(){return window}function uI(e){Nn().location.href=e}/**
1153
+ */function Nn(){return window}function oS(e){Nn().location.href=e}/**
1168
1154
  * @license
1169
1155
  * Copyright 2020 Google LLC.
1170
1156
  *
@@ -1179,7 +1165,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1179
1165
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1180
1166
  * See the License for the specific language governing permissions and
1181
1167
  * limitations under the License.
1182
- */function Bf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function dI(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function fI(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function hI(){return Bf()?self:null}/**
1168
+ */function Lf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function iS(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function aS(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function lS(){return Lf()?self:null}/**
1183
1169
  * @license
1184
1170
  * Copyright 2019 Google LLC
1185
1171
  *
@@ -1194,7 +1180,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1194
1180
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1195
1181
  * See the License for the specific language governing permissions and
1196
1182
  * limitations under the License.
1197
- */const Uf="firebaseLocalStorageDb",pI=1,Go="firebaseLocalStorage",Ff="fbase_key";class fo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function pi(e,t){return e.transaction([Go],t?"readwrite":"readonly").objectStore(Go)}function mI(){const e=indexedDB.deleteDatabase(Uf);return new fo(e).toPromise()}function Ea(){const e=indexedDB.open(Uf,pI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Go,{keyPath:Ff})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Go)?t(r):(r.close(),await mI(),t(await Ea()))})})}async function ru(e,t,n){const r=pi(e,!0).put({[Ff]:t,value:n});return new fo(r).toPromise()}async function gI(e,t){const n=pi(e,!1).get(t),r=await new fo(n).toPromise();return r===void 0?null:r.value}function su(e,t){const n=pi(e,!0).delete(t);return new fo(n).toPromise()}const vI=800,yI=3;class Hf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Ea(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>yI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Bf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=hi._getInstance(hI()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await dI(),!this.activeServiceWorker)return;this.sender=new cI(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(n=t[0])!=null&&n.fulfilled&&(r=t[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||fI()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Ea();return await ru(t,qo,"1"),await su(t,qo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>ru(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>gI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>su(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=pi(s,!1).getAll();return new fo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),vI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Hf.type="LOCAL";const wI=Hf;new co(3e4,6e4);/**
1183
+ */const jf="firebaseLocalStorageDb",cS=1,qo="firebaseLocalStorage",Bf="fbase_key";class uo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function fi(e,t){return e.transaction([qo],t?"readwrite":"readonly").objectStore(qo)}function uS(){const e=indexedDB.deleteDatabase(jf);return new uo(e).toPromise()}function Ia(){const e=indexedDB.open(jf,cS);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(qo,{keyPath:Bf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(qo)?t(r):(r.close(),await uS(),t(await Ia()))})})}async function tu(e,t,n){const r=fi(e,!0).put({[Bf]:t,value:n});return new uo(r).toPromise()}async function dS(e,t){const n=fi(e,!1).get(t),r=await new uo(n).toPromise();return r===void 0?null:r.value}function nu(e,t){const n=fi(e,!0).delete(t);return new uo(n).toPromise()}const fS=800,hS=3;class Uf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Ia(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>hS)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Lf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=di._getInstance(lS()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await iS(),!this.activeServiceWorker)return;this.sender=new sS(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(n=t[0])!=null&&n.fulfilled&&(r=t[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||aS()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Ia();return await tu(t,zo,"1"),await nu(t,zo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>tu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>dS(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>nu(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=fi(s,!1).getAll();return new uo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),fS)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Uf.type="LOCAL";const pS=Uf;new lo(3e4,6e4);/**
1198
1184
  * @license
1199
1185
  * Copyright 2021 Google LLC
1200
1186
  *
@@ -1209,7 +1195,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1209
1195
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1210
1196
  * See the License for the specific language governing permissions and
1211
1197
  * limitations under the License.
1212
- */function Vf(e,t){return t?Yn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1198
+ */function Ff(e,t){return t?Yn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1213
1199
  * @license
1214
1200
  * Copyright 2019 Google LLC
1215
1201
  *
@@ -1224,7 +1210,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1224
1210
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1225
1211
  * See the License for the specific language governing permissions and
1226
1212
  * limitations under the License.
1227
- */class fl extends Of{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return fs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return fs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return fs(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function bI(e){return nI(e.auth,new fl(e),e.bypassAuthState)}function _I(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),tI(n,new fl(e),e.bypassAuthState)}async function kI(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),eI(n,new fl(e),e.bypassAuthState)}/**
1213
+ */class dl extends xf{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return fs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return fs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return fs(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function mS(e){return QI(e.auth,new dl(e),e.bypassAuthState)}function gS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),YI(n,new dl(e),e.bypassAuthState)}async function vS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),JI(n,new dl(e),e.bypassAuthState)}/**
1228
1214
  * @license
1229
1215
  * Copyright 2020 Google LLC
1230
1216
  *
@@ -1239,7 +1225,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1239
1225
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1240
1226
  * See the License for the specific language governing permissions and
1241
1227
  * limitations under the License.
1242
- */class Wf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return bI;case"linkViaPopup":case"linkViaRedirect":return kI;case"reauthViaPopup":case"reauthViaRedirect":return _I;default:$n(this.auth,"internal-error")}}resolve(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1228
+ */class Hf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return mS;case"linkViaPopup":case"linkViaRedirect":return vS;case"reauthViaPopup":case"reauthViaRedirect":return gS;default:$n(this.auth,"internal-error")}}resolve(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1243
1229
  * @license
1244
1230
  * Copyright 2020 Google LLC
1245
1231
  *
@@ -1254,7 +1240,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1254
1240
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1255
1241
  * See the License for the specific language governing permissions and
1256
1242
  * limitations under the License.
1257
- */const TI=new co(2e3,1e4);async function II(e,t,n){if(xn(e.app))return Promise.reject(gn(e,"operation-not-supported-in-this-environment"));const r=fi(e);b1(e,t,ul);const s=Vf(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Wf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){sr(this.filter.length===1,"Popup operations only handle one event");const t=dl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(gn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(gn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,TI.get())};t()}}Fr.currentPopupAction=null;/**
1243
+ */const yS=new lo(2e3,1e4);async function wS(e,t,n){if(Pn(e.app))return Promise.reject(gn(e,"operation-not-supported-in-this-environment"));const r=ui(e);mI(e,t,cl);const s=Ff(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Hf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){sr(this.filter.length===1,"Popup operations only handle one event");const t=ul();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(gn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(gn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,yS.get())};t()}}Fr.currentPopupAction=null;/**
1258
1244
  * @license
1259
1245
  * Copyright 2020 Google LLC
1260
1246
  *
@@ -1269,7 +1255,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1269
1255
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1270
1256
  * See the License for the specific language governing permissions and
1271
1257
  * limitations under the License.
1272
- */const SI="pendingRedirect",Po=new Map;class EI extends Wf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Po.get(this.auth._key());if(!t){try{const r=await CI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Po.set(this.auth._key(),t)}return this.bypassAuthState||Po.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function CI(e,t){const n=xI(t),r=RI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function AI(e,t){Po.set(e._key(),t)}function RI(e){return Yn(e._redirectPersistence)}function xI(e){return xo(SI,e.config.apiKey,e.name)}async function PI(e,t,n=!1){if(xn(e.app))return Promise.reject(Wr(e));const r=fi(e),s=Vf(r,t),i=await new EI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1258
+ */const bS="pendingRedirect",Po=new Map;class _S extends Hf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Po.get(this.auth._key());if(!t){try{const r=await kS(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Po.set(this.auth._key(),t)}return this.bypassAuthState||Po.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function kS(e,t){const n=SS(t),r=IS(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function TS(e,t){Po.set(e._key(),t)}function IS(e){return Yn(e._redirectPersistence)}function SS(e){return Ro(bS,e.config.apiKey,e.name)}async function ES(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r=ui(e),s=Ff(r,t),i=await new _S(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1273
1259
  * @license
1274
1260
  * Copyright 2020 Google LLC
1275
1261
  *
@@ -1284,7 +1270,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1284
1270
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1285
1271
  * See the License for the specific language governing permissions and
1286
1272
  * limitations under the License.
1287
- */const MI=600*1e3;class OI{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!NI(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!zf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(gn(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=MI&&this.cachedEventUids.clear(),this.cachedEventUids.has(ou(t))}saveEventToCache(t){this.cachedEventUids.add(ou(t)),this.lastProcessedEventTime=Date.now()}}function ou(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function zf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function NI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return zf(e);default:return!1}}/**
1273
+ */const CS=600*1e3;class AS{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!RS(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Vf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(gn(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=CS&&this.cachedEventUids.clear(),this.cachedEventUids.has(ru(t))}saveEventToCache(t){this.cachedEventUids.add(ru(t)),this.lastProcessedEventTime=Date.now()}}function ru(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Vf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function RS(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Vf(e);default:return!1}}/**
1288
1274
  * @license
1289
1275
  * Copyright 2020 Google LLC
1290
1276
  *
@@ -1299,7 +1285,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1299
1285
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1300
1286
  * See the License for the specific language governing permissions and
1301
1287
  * limitations under the License.
1302
- */async function $I(e,t={}){return _s(e,"GET","/v1/projects",t)}/**
1288
+ */async function PS(e,t={}){return _s(e,"GET","/v1/projects",t)}/**
1303
1289
  * @license
1304
1290
  * Copyright 2020 Google LLC
1305
1291
  *
@@ -1314,7 +1300,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1314
1300
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315
1301
  * See the License for the specific language governing permissions and
1316
1302
  * limitations under the License.
1317
- */const DI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,LI=/^https?/;async function jI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await $I(e);for(const n of t)try{if(BI(n))return}catch{}$n(e,"unauthorized-domain")}function BI(e){const t=Ia(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return i.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&i.hostname===r}if(!LI.test(n))return!1;if(DI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1303
+ */const xS=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,OS=/^https?/;async function MS(e){if(e.config.emulator)return;const{authorizedDomains:t}=await PS(e);for(const n of t)try{if(NS(n))return}catch{}$n(e,"unauthorized-domain")}function NS(e){const t=ka(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return i.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&i.hostname===r}if(!OS.test(n))return!1;if(xS.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1318
1304
  * @license
1319
1305
  * Copyright 2020 Google LLC.
1320
1306
  *
@@ -1329,7 +1315,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1329
1315
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1330
1316
  * See the License for the specific language governing permissions and
1331
1317
  * limitations under the License.
1332
- */const UI=new co(3e4,6e4);function iu(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function FI(e){return new Promise((t,n)=>{var s,o,i;function r(){iu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{iu(),n(gn(e,"network-request-failed"))},timeout:UI.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=G1("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(gn(e,"network-request-failed"))},z1(`${q1()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Mo=null,t})}let Mo=null;function HI(e){return Mo=Mo||FI(e),Mo}/**
1318
+ */const $S=new lo(3e4,6e4);function su(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function DS(e){return new Promise((t,n)=>{var s,o,i;function r(){su(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{su(),n(gn(e,"network-request-failed"))},timeout:$S.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=HI("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(gn(e,"network-request-failed"))},UI(`${FI()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw xo=null,t})}let xo=null;function LS(e){return xo=xo||DS(e),xo}/**
1333
1319
  * @license
1334
1320
  * Copyright 2020 Google LLC.
1335
1321
  *
@@ -1344,7 +1330,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1344
1330
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1345
1331
  * See the License for the specific language governing permissions and
1346
1332
  * limitations under the License.
1347
- */const VI=new co(5e3,15e3),WI="__/auth/iframe",zI="emulator/auth/iframe",qI={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},GI=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function KI(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?ol(t,zI):`https://${e.config.authDomain}/${WI}`,r={apiKey:t.apiKey,appName:e.name,v:lo},s=GI.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ao(r).slice(1)}`}async function JI(e){const t=await HI(e),n=Nn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:KI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:qI,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=gn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},VI.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1333
+ */const jS=new lo(5e3,15e3),BS="__/auth/iframe",US="emulator/auth/iframe",FS={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},HS=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function VS(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?sl(t,US):`https://${e.config.authDomain}/${BS}`,r={apiKey:t.apiKey,appName:e.name,v:ao},s=HS.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${io(r).slice(1)}`}async function WS(e){const t=await LS(e),n=Nn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:VS(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:FS,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=gn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},jS.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1348
1334
  * @license
1349
1335
  * Copyright 2020 Google LLC.
1350
1336
  *
@@ -1359,7 +1345,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1359
1345
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1360
1346
  * See the License for the specific language governing permissions and
1361
1347
  * limitations under the License.
1362
- */const YI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},QI=500,XI=600,ZI="_blank",eS="http://localhost";class au{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function tS(e,t,n,r=QI,s=XI){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...YI,width:r.toString(),height:s.toString(),top:o,left:i},u=Xt().toLowerCase();n&&(a=Sf(u)?ZI:n),Tf(u)&&(t=t||eS,l.scrollbars="yes");const c=Object.entries(l).reduce((h,[b,N])=>`${h}${b}=${N},`,"");if(L1(u)&&a!=="_self")return nS(t||"",a),new au(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new au(f)}function nS(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1348
+ */const zS={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},qS=500,GS=600,KS="_blank",JS="http://localhost";class ou{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function YS(e,t,n,r=qS,s=GS){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...zS,width:r.toString(),height:s.toString(),top:o,left:i},u=Xt().toLowerCase();n&&(a=Tf(u)?KS:n),_f(u)&&(t=t||JS,l.scrollbars="yes");const c=Object.entries(l).reduce((p,[_,N])=>`${p}${_}=${N},`,"");if(OI(u)&&a!=="_self")return QS(t||"",a),new ou(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new ou(f)}function QS(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1363
1349
  * @license
1364
1350
  * Copyright 2021 Google LLC
1365
1351
  *
@@ -1374,7 +1360,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1374
1360
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1375
1361
  * See the License for the specific language governing permissions and
1376
1362
  * limitations under the License.
1377
- */const rS="__/auth/handler",sS="emulator/auth/handler",oS=encodeURIComponent("fac");async function lu(e,t,n,r,s,o){Fe(e.config.authDomain,e,"auth-domain-config-required"),Fe(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:lo,eventId:s};if(t instanceof ul){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",rT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof uo){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),u=l?`#${oS}=${encodeURIComponent(l)}`:"";return`${iS(e)}?${ao(a).slice(1)}${u}`}function iS({config:e}){return e.emulator?ol(e,sS):`https://${e.authDomain}/${rS}`}/**
1363
+ */const XS="__/auth/handler",ZS="emulator/auth/handler",eE=encodeURIComponent("fac");async function iu(e,t,n,r,s,o){Fe(e.config.authDomain,e,"auth-domain-config-required"),Fe(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:ao,eventId:s};if(t instanceof cl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",Q0(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof co){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),u=l?`#${eE}=${encodeURIComponent(l)}`:"";return`${tE(e)}?${io(a).slice(1)}${u}`}function tE({config:e}){return e.emulator?sl(e,ZS):`https://${e.authDomain}/${XS}`}/**
1378
1364
  * @license
1379
1365
  * Copyright 2020 Google LLC
1380
1366
  *
@@ -1389,7 +1375,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1389
1375
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1390
1376
  * See the License for the specific language governing permissions and
1391
1377
  * limitations under the License.
1392
- */const Wi="webStorageSupport";class aS{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=jf,this._completeRedirectFn=PI,this._overrideRedirectResult=AI}async _openPopup(t,n,r,s){var i;sr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await lu(t,n,r,Ia(),s);return tS(t,o,dl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await lu(t,n,r,Ia(),s);return uI(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(sr(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await JI(t),r=new OI(t);return n.register("authEvent",s=>(Fe(s==null?void 0:s.authEvent,t,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(Wi,{type:Wi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Wi];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=jI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return xf()||If()||ll()}}const lS=aS;var cu="@firebase/auth",uu="1.12.1";/**
1378
+ */const Hi="webStorageSupport";class nE{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Df,this._completeRedirectFn=ES,this._overrideRedirectResult=TS}async _openPopup(t,n,r,s){var i;sr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await iu(t,n,r,ka(),s);return YS(t,o,ul())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await iu(t,n,r,ka(),s);return oS(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(sr(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await WS(t),r=new AS(t);return n.register("authEvent",s=>(Fe(s==null?void 0:s.authEvent,t,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(Hi,{type:Hi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Hi];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=MS(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Af()||kf()||al()}}const rE=nE;var au="@firebase/auth",lu="1.12.2";/**
1393
1379
  * @license
1394
1380
  * Copyright 2020 Google LLC
1395
1381
  *
@@ -1404,7 +1390,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1404
1390
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1405
1391
  * See the License for the specific language governing permissions and
1406
1392
  * limitations under the License.
1407
- */class cS{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Fe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1393
+ */class sE{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Fe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1408
1394
  * @license
1409
1395
  * Copyright 2020 Google LLC
1410
1396
  *
@@ -1419,7 +1405,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1419
1405
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1420
1406
  * See the License for the specific language governing permissions and
1421
1407
  * limitations under the License.
1422
- */function uS(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function dS(e){eo(new vs("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Fe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Pf(e)},u=new V1(r,s,o,l);return J1(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),eo(new vs("auth-internal",t=>{const n=fi(t.getProvider("auth").getImmediate());return(r=>new cS(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),cs(cu,uu,uS(e)),cs(cu,uu,"esm2020")}/**
1408
+ */function oE(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function iE(e){Zs(new vs("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Fe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Rf(e)},u=new jI(r,s,o,l);return WI(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),Zs(new vs("auth-internal",t=>{const n=ui(t.getProvider("auth").getImmediate());return(r=>new sE(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),cs(au,lu,oE(e)),cs(au,lu,"esm2020")}/**
1423
1409
  * @license
1424
1410
  * Copyright 2021 Google LLC
1425
1411
  *
@@ -1434,11 +1420,11 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1434
1420
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1435
1421
  * See the License for the specific language governing permissions and
1436
1422
  * limitations under the License.
1437
- */const fS=300,hS=af("authIdTokenMaxAge")||fS;let du=null;const pS=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>hS)return;const s=n==null?void 0:n.token;du!==s&&(du=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function mS(e=hf()){const t=df(e,"auth");if(t.isInitialized())return t.getImmediate();const n=K1(e,{popupRedirectResolver:lS,persistence:[wI,aI,jf]}),r=af("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=pS(o.toString());sI(n,i,()=>i(n.currentUser)),rI(n,a=>i(a))}}const s=F0("auth");return s&&Y1(n,`http://${s}`),n}function gS(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}W1({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=gn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",gS().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});dS("Browser");const vS={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function yS(e){const t=L(null),n=L(""),r=L(""),s=L(""),o=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function u(){try{const I=await fetch("/codex-api/skills-sync/status");if(!I.ok)return;const O=await I.json();O.data&&(o.value=O.data)}catch{}}async function c(){try{const I=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),O=await I.json();if(!I.ok||!O.data)throw new Error("Failed to start GitHub login");t.value=O.data;const Y=30,$=Math.max((O.data.interval??5)*1e3,3e3);let z=!1;for(let j=0;j<Y;j++){await new Promise(ve=>setTimeout(ve,$));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:O.data.device_code})}),de=await oe.json();if(!oe.ok)throw new Error(de.error||"Failed to complete GitHub login");if(de.ok){z=!0;break}if(!de.pending)throw new Error(de.error||"Failed to complete GitHub login")}if(!z)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(I){e.showToast(I instanceof Error?I.message:"Failed GitHub login","error")}}async function f(){try{const I=o1().length>0?hf():ff(vS),O=mS(I),Y=new Pn;Y.addScope("repo");const $=await II(O,Y),z=Pn.credentialFromResult($),j=(z==null?void 0:z.accessToken)??"";if(!j)throw new Error("GitHub access token missing from Firebase login");const oe=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j})}),de=await oe.json();if(!oe.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(I){const O=I instanceof Error?I.message:"Failed Firebase GitHub login";e.showToast(O,"error")}}async function h(){r.value="",n.value="pull-started",s.value="pull";try{const I=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(I){const O=I instanceof Error?I.message:"Failed to pull sync";r.value=O,n.value="pull-failed",e.showToast(O,"error")}finally{s.value=""}}async function b(){r.value="",n.value="push-started",s.value="push";try{const I=await fetch("/codex-api/skills-sync/push",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(I){const O=I instanceof Error?I.message:"Failed to push sync";r.value=O,n.value="push-failed",e.showToast(O,"error")}finally{s.value=""}}async function N(){try{const I=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(I){e.showToast(I instanceof Error?I.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:N,pullSkillsSync:h,pushSkillsSync:b,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const wS={class:"skills-hub"},bS={class:"skills-sync-panel"},_S={class:"skills-sync-header"},kS={key:0,class:"skills-sync-badge"},TS={key:1,class:"skills-sync-badge"},IS={key:2,class:"skills-sync-badge"},SS={class:"skills-sync-meta"},ES={key:0,class:"skills-sync-error"},CS={key:1,class:"skills-sync-meta"},AS={key:2,class:"skills-sync-error"},RS={key:3,class:"skills-sync-device"},xS=["href"],PS={class:"skills-sync-actions"},MS=["disabled"],OS=["disabled"],NS=["disabled"],$S={key:1,class:"skills-hub-section"},DS={class:"skills-hub-section-title"},LS={key:0,class:"skills-hub-grid"},jS={class:"skills-hub-toolbar"},BS={class:"skills-hub-search-wrap"},US={key:0,class:"skills-hub-count"},FS={class:"skills-hub-section"},HS={key:0,class:"skills-hub-loading"},VS={key:1,class:"skills-hub-error"},WS={key:0,class:"skills-hub-grid"},zS={key:1,class:"skills-hub-empty"},wo="codex-web-local.skills-hub.cache.v1",qS=Lt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),u=L(!1),c=L(""),f=L(!0),h=L(!1),b=L(n),N=L(null),I=L(""),O=L(!1),Y=L(!1);let $=null,z=null;const j=t,oe=pe(()=>o.value==="date"?"Newest":"A-Z"),de=pe(()=>{var x;return((x=N.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=pe(()=>`${b.value.owner}/${b.value.name}`),Ie=pe(()=>O.value&&I.value===ve.value),re=pe(()=>Y.value&&I.value===ve.value),ee=pe(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter(D=>D.name.toLowerCase().includes(x)||D.owner.toLowerCase().includes(x)||(D.displayName??"").toLowerCase().includes(x)):a.value});function ye(x,D="success"){N.value={text:x,type:D},z&&clearTimeout(z),z=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",$e(s.value)}function je(x){return`${o.value}::${x.trim().toLowerCase()}`}function Be(x){var D;if(typeof window>"u")return null;try{const B=window.localStorage.getItem(wo);return B?((D=JSON.parse(B).byKey)==null?void 0:D[x])??null:null}catch{return null}}function Qe(x,D){if(!(typeof window>"u"))try{const B=window.localStorage.getItem(wo),V=(B?JSON.parse(B):{}).byKey??{};V[x]=D,window.localStorage.setItem(wo,JSON.stringify({byKey:V}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(wo)}catch{}}function Te(x){const D=x.installed??[];a.value=D;const B=new Set(D.map(G=>G.name));i.value=x.data.map(G=>{if(G.installed||B.has(G.name)){const V=D.find(be=>be.name===G.name);return{...G,installed:!0,path:(V==null?void 0:V.path)??G.path,enabled:(V==null?void 0:V.enabled)??G.enabled}}return G}).filter(G=>!G.installed),l.value=x.total}async function $e(x){const D=je(x),B=Be(D);B&&Te(B),u.value=!B,c.value="";try{const G=new URLSearchParams;x.trim()&&G.set("q",x.trim()),G.set("limit","100"),G.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${G}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const be=await V.json();Te(be),Qe(D,be)}catch(G){c.value=G instanceof Error?G.message:"Failed to load skills"}finally{u.value=!1}}function It(){$&&clearTimeout($),$=setTimeout(()=>$e(s.value),300)}function nt(x){b.value=x,h.value=!0}async function Xe(x){I.value=`${x.owner}/${x.name}`,O.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:x.owner,name:x.name})})).json();if(!B.ok)throw new Error(B.error||"Install failed");const G={...x,installed:!0,path:B.path,enabled:!0};a.value=[...a.value,G],i.value=i.value.filter(V=>V.name!==x.name),b.value=G,ye(`${x.displayName||x.name} skill installed`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to install skill","error")}finally{O.value=!1}}async function Ze(x){I.value=`${x.owner}/${x.name}`,Y.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x.name,path:x.path})})).json();if(!B.ok)throw new Error(B.error||"Uninstall failed");a.value=a.value.filter(G=>G.name!==x.name),x.owner!=="local"&&(i.value=[...i.value,{...x,installed:!1,path:void 0,enabled:void 0}]),ye(`${x.displayName||x.name} skill uninstalled`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ht(x,D){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:x.path,enabled:D}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ye(`${x.displayName||x.name} skill ${D?"enabled":"disabled"}`),await $e(s.value)}catch(B){ye(B instanceof Error?B.message:"Failed to update skill","error")}}const{deviceLogin:Rt,isPullInFlight:Ge,isPushInFlight:et,isSyncActionInFlight:W,loadSyncStatus:me,logoutGithub:ie,pullSkillsSync:fe,pushSkillsSync:De,startGithubFirebaseLogin:g,startGithubLogin:v,syncActionError:A,syncActionStatus:H,syncStatus:F}=yS({showToast:ye,onPulled:async()=>{await $e(s.value),j("skills-changed")}});return ir(()=>{$e(""),me()}),(x,D)=>(w(),T("div",wS,[D[11]||(D[11]=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",bS,[m("div",_S,[D[8]||(D[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ue(F).configured?(w(),T("span",kS,"Connected: "+ce(ue(F).repoOwner)+"/"+ce(ue(F).repoName),1)):ue(F).loggedIn?(w(),T("span",TS,"Logged in as "+ce(ue(F).githubUsername),1)):(w(),T("span",IS,"Not connected"))]),m("div",SS,[m("span",null,"Startup: "+ce(ue(F).startup.mode),1),m("span",null,"Branch: "+ce(ue(F).startup.branch),1),m("span",null,"Action: "+ce(ue(F).startup.lastAction),1)]),ue(F).startup.lastError?(w(),T("div",ES,ce(ue(F).startup.lastError),1)):se("",!0),ue(H)?(w(),T("div",CS,[m("span",null,"Manual sync: "+ce(ue(H)),1)])):se("",!0),ue(A)?(w(),T("div",AS,ce(ue(A)),1)):se("",!0),ue(Rt)?(w(),T("div",RS,[m("span",null,[D[9]||(D[9]=ca("Open ",-1)),m("a",{href:ue(Rt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,xS),D[10]||(D[10]=ca(" and enter code:",-1))]),m("code",null,ce(ue(Rt).user_code),1)])):se("",!0),m("div",PS,[ue(F).loggedIn?se("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:D[0]||(D[0]=(...B)=>ue(g)&&ue(g)(...B))},"Login with GitHub")),ue(F).loggedIn?se("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:D[1]||(D[1]=(...B)=>ue(v)&&ue(v)(...B))},"Device Login")),ue(F).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:D[2]||(D[2]=(...B)=>ue(ie)&&ue(ie)(...B)),disabled:ue(W)},"Logout GitHub",8,MS)):se("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:D[3]||(D[3]=(...B)=>ue(fe)&&ue(fe)(...B)),disabled:ue(W)},ce(ue(Ge)?"Pulling...":"Pull"),9,OS),ue(F).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:D[4]||(D[4]=(...B)=>ue(De)&&ue(De)(...B)),disabled:!ue(F).configured||ue(W)},ce(ue(et)?"Pushing...":"Push"),9,NS)):se("",!0)])]),N.value?(w(),T("div",{key:0,class:gt(["skills-hub-toast",de.value])},ce(N.value.text),3)):se("",!0),ee.value.length>0?(w(),T("div",$S,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:D[5]||(D[5]=B=>f.value=!f.value)},[m("span",DS,"Installed ("+ce(ee.value.length)+")",1),Ce(Yd,{class:gt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",LS,[(w(!0),T(He,null,Et(ee.value,B=>(w(),yt(Lc,{key:B.name,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):se("",!0)])):se("",!0),m("div",jS,[m("div",BS,[Ce(ya,{class:"skills-hub-search-icon"}),tr(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":D[6]||(D[6]=B=>s.value=B),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:It},null,544),[[nr,s.value]]),l.value>0?(w(),T("span",US,ce(l.value)+" skills",1)):se("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:te},ce(oe.value),1)]),m("div",FS,[u.value?(w(),T("div",HS,"Loading skills...")):c.value?(w(),T("div",VS,ce(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",WS,[(w(!0),T(He,null,Et(i.value,B=>(w(),yt(Lc,{key:B.url,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",zS,'No skills found for "'+ce(s.value)+'"',1)):se("",!0)],64))]),Ce(M0,{skill:b.value,visible:h.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:D[7]||(D[7]=B=>h.value=!1),onInstall:Xe,onUninstall:Ze,onToggleEnabled:ht},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),GS=st(qS,[["__scopeId","data-v-2f6920be"]]),KS={},JS={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 YS(e,t){return w(),T("svg",JS,[...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 QS=st(KS,[["render",YS]]),XS={},ZS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function eE(e,t){return w(),T("svg",ZS,[...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 tE=st(XS,[["render",eE]]),nE={class:"sidebar-thread-controls"},rE=["aria-label","title"],sE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",nE,[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(),yt(tE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),yt(QS,{key:1,class:"sidebar-thread-controls-icon"}))],8,rE),Mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ce(Fo,{class:"sidebar-thread-controls-icon"})])):se("",!0)]))}}),fu=st(sE,[["__scopeId","data-v-46a10052"]]),oE={},iE={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function aE(e,t){return w(),T("svg",iE,[...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 lE=st(oE,[["render",aE]]);function gr(e){return e.flatMap(t=>t.threads)}const qf="codex-web-local.thread-read-state.v1",Gf="codex-web-local.thread-scroll-state.v1",Ca="codex-web-local.selected-thread-id.v1",Kf="codex-web-local.project-order.v1",Jf="codex-web-local.project-display-name.v1",zi=220,hu=["none","minimal","low","medium","high","xhigh"],Ms="__global__",un="gpt-5.2-codex";function cE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function pu(e){typeof window>"u"||window.localStorage.setItem(qf,JSON.stringify(e))}function Yf(e,t,n){return Math.min(Math.max(e,t),n)}function uE(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=Yf(t.scrollRatio,0,1)),n}function dE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gf);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=uE(s);o&&(n[r]=o)}return n}catch{return{}}}function mu(e){typeof window>"u"||window.localStorage.setItem(Gf,JSON.stringify(e))}function fE(){return typeof window>"u"?"":window.localStorage.getItem(Ca)??""}function hE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ca);return}window.localStorage.setItem(Ca,e)}}function pE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Kf);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 es(e){typeof window>"u"||window.localStorage.setItem(Kf,JSON.stringify(e))}function mE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function qi(e){typeof window>"u"||window.localStorage.setItem(Jf,JSON.stringify(e))}function bo(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 Br(e,n)?e:n}function Gi(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 Br(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 gE(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 vE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function _o(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 Aa(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Br(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&vE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ko(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 yE(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&Aa(f,c)?f:c});if(n.preserveMissing!==!0)return Ko(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Aa(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Ko(e,u)?e:u}function Ra(e){return e.replace(/\s+/gu," ").trim()}function wE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ra(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=Ra(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function gu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Aa(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Qf="worked";function hr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function bE(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 _E(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function kE(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 TE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${bE(e.durationMs)}`,messageType:Qf}}function IE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function SE(e,t){const n=TE(t),r=e.filter(i=>i.messageType!==Qf),s=IE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Bt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function EE(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 CE(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 AE(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 Ft(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function ko(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 u=i.get(l.id);return u&&EE(u,l)?u:l});return o&&o.projectName===s.projectName&&CE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return AE(e,r)?e:r}function RE(e,t,n){const r=new Set(gr(t).map(a=>a.id)),s=gr(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 u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function xE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Ki(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function PE(e){const t=e.split(`
1438
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function ME(){const e=L([]),t=L([]),n=L(fE()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),u=L({}),c=L([]),f=L(""),h=L("medium"),b=L(cE()),N=L(dE()),I=L(pE()),O=L(mE()),Y=L({}),$=L({}),z=L({}),j=L({}),oe=L({}),de=L({}),ve=L({}),Ie=L({}),re=L({}),ee=L({}),ye=L([]),te=L(!1),je=L(!1),Be=L(!1),Qe=L(!1),Re=L(!1),Te=L(""),$e=L(!1),It=L(!1);let nt=null,Xe=null,Ze=!1;const ht=new Set;let Rt=!1,Ge=!1;const et=new Map,W=new Set,me=pe(()=>gr(e.value)),ie=pe(()=>me.value.find(d=>d.id===n.value)??null),fe=pe(()=>N.value[n.value]??null),De=pe(()=>{const d=[],p=n.value;return p&&Array.isArray(Ie.value[p])&&d.push(...Ie.value[p]),Array.isArray(Ie.value[Ms])&&d.push(...Ie.value[Ms]),d.sort((y,C)=>y.receivedAtIso.localeCompare(C.receivedAtIso))}),g=pe(()=>{var X;const d=n.value;if(!d)return null;const p=oe.value[d],y=(o.value[d]??"").trim(),C=(((X=de.value[d])==null?void 0:X.message)??"").trim();return!p&&!y&&!C?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:C}}),v=pe(()=>{const d=n.value;if(!d)return[];const p=r.value[d]??[],y=s.value[d]??[],C=i.value[d]??[],X=[...p,...C,...y],Q=j.value[d];return Q?SE(X,Q):X});function A(d){n.value!==d&&(n.value=d,hE(d),Ge=!1)}function H(d){f.value=d.trim()}async function F(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await t_(un)}catch{}}function x(d,p){re.value={...re.value,[d]:p}}function D(d){re.value[d]&&(re.value=Bt(re.value,d))}async function B(d){if(W.has(d))return;const p=re.value[d];if(!(!p||p.fallbackRetried)){W.add(d),x(d,{...p,fallbackRetried:!0});try{await F();try{const y=await Oc(d,1);it(d,y),kt(d,[]),rn(d),i.value[d]&&(i.value=Bt(i.value,d))}catch{}K(d,null),Te.value="",Pe(d,null),U(d,{label:"Thinking",details:V(un,p.effort)}),Ve(d,!0),z.value[d]!==!0&&await $i(d),await Di(d,p.text,p.imageUrls,un,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments),z.value={...z.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Unknown application error";K(d,C),Te.value=C,Ve(d,!1),U(d,null)}finally{W.delete(d)}}}function G(d){d&&!hu.includes(d)||(h.value=d)}function V(d,p){const y=d.trim()||"default",C=p||"default";return[`Model: ${y}`,`Thinking: ${C}`]}async function be(){try{const[d,p]=await Promise.all([n_(),r_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(p.model&&d.includes(p.model)?f.value=p.model:d.length>0?f.value=d[0]:f.value=""),p.reasoningEffort&&hu.includes(p.reasoningEffort)&&(h.value=p.reasoningEffort)}catch{}}function ae(d){const p=ee.value;return Object.keys(p).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=p[C.id];return X?{...C,title:X}:C})}))}function he(){const p=ae(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=a.value[C.id]===!0,Q=n.value===C.id,_e=b.value[C.id],xe=u.value[C.id]===!0,we=!Q&&!X&&(xe||_e!==C.updatedAtIso);return{...C,inProgress:X,unread:we}})}));e.value=ko(e.value,p)}function Se(d,p,y){const C=new Date().toISOString(),X=p.trim(),Q=xE(X),_e={id:d,title:PE(y),projectName:Q,cwd:X,hasWorktree:X.includes("/.codex/worktrees/")||X.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:y,unread:!1,inProgress:!1},xe=t.value.findIndex(ot=>ot.projectName===Q);if(xe>=0){const St=t.value[xe].threads.filter(cr=>cr.id!==d),Xr={projectName:Q,threads:[_e,...St]},Fn=[...t.value];Fn.splice(xe,1,Xr),t.value=Fn}else t.value=[{projectName:Q,threads:[_e]},...t.value];const we=bo(I.value,t.value);Br(I.value,we)||(I.value=we,es(I.value)),he()}function Me(d){const p=new Set(d.map(Q=>Q.id)),y=Ft(b.value,p);y!==b.value&&(b.value=y,pu(y));const C=Ft(N.value,p);C!==N.value&&(N.value=C,mu(C)),$.value=Ft($.value,p),Y.value=Ft(Y.value,p),z.value=Ft(z.value,p),r.value=Ft(r.value,p),s.value=Ft(s.value,p),o.value=Ft(o.value,p),i.value=Ft(i.value,p),j.value=Ft(j.value,p),oe.value=Ft(oe.value,p),de.value=Ft(de.value,p),ve.value=Ft(ve.value,p),u.value=Ft(u.value,p),a.value=Ft(a.value,p);const X={};for(const[Q,_e]of Object.entries(Ie.value))(Q===Ms||p.has(Q))&&(X[Q]=_e);Ie.value=X}function Ke(d){const p=gr(t.value).find(y=>y.id===d);p&&(b.value={...b.value,[d]:p.updatedAtIso},pu(b.value),u.value[d]&&(u.value=Bt(u.value,d)),he())}function Pe(d,p){if(!d)return;const y=j.value[d];if(p){if(_E(y,p))return;j.value={...j.value,[d]:p}}else y&&(j.value=Bt(j.value,d))}function Ve(d,p){!d||a.value[d]===!0===p||(p?a.value={...a.value,[d]:!0}:a.value=Bt(a.value,d),he())}function _t(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},he())}function U(d,p){if(!d)return;const y=oe.value[d];if(!p){y&&(oe.value=Bt(oe.value,d));return}const C=q(p.label)||"Thinking",X=p.details.map(xe=>q(xe)).filter(xe=>xe.length>0&&xe!==C),Q=Array.from(new Set([...(y==null?void 0:y.details)??[],...X])).slice(-3),_e={label:C,details:Q};kE(y,_e)||(oe.value={...oe.value,[d]:_e})}function K(d,p){if(!d)return;const y=de.value[d],C=p?Ra(p):"";if(!C){y&&(de.value=Bt(de.value,d));return}(y==null?void 0:y.message)!==C&&(de.value={...de.value,[d]:{message:C}})}function ne(d){const p=gr(t.value).find(y=>y.id===d);return(p==null?void 0:p.updatedAtIso)??""}function Je(d,p){if(!d)return;const y={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(y.scrollRatio=Yf(p.scrollRatio,0,1));const C=N.value[d];C&&C.scrollTop===y.scrollTop&&C.isAtBottom===y.isAtBottom&&C.scrollRatio===y.scrollRatio||(N.value={...N.value,[d]:y},mu(N.value))}function it(d,p){const y=r.value[d]??[];Ko(y,p)||(r.value={...r.value,[d]:p})}function kt(d,p){const y=s.value[d]??[];Ko(y,p)||(s.value={...s.value,[d]:p})}function xt(d,p){const y=s.value[d]??[],C=gu(y,p);kt(d,C)}function ln(d,p){if(!d)return;const y=p.trim(),C=o.value[d]??"";if(y.length===0){if(!C)return;o.value=Bt(o.value,d);return}C!==y&&(o.value={...o.value,[d]:y})}function Sr(d,p){if(!d)return;const y=o.value[d]??"";ln(d,`${y}${p}`)}function rn(d){d&&d in o.value&&(o.value=Bt(o.value,d))}function Ne(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Oe(d){return typeof d=="string"?d:""}function fn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function jt(d){const p=Ne(d.params);if(!p)return"";const y=Oe(p.threadId);if(y)return y;const C=Oe(p.thread_id);if(C)return C;const X=Oe(p.conversationId);if(X)return X;const Q=Oe(p.conversation_id);if(Q)return Q;const _e=Ne(p.thread),xe=Oe(_e==null?void 0:_e.id);if(xe)return xe;const we=Ne(p.turn),ot=Oe(we==null?void 0:we.threadId);if(ot)return ot;const St=Oe(we==null?void 0:we.thread_id);return St||""}function Er(d){if(d.method!=="turn/completed")return"";const p=Ne(d.params),y=Ne(p==null?void 0:p.turn);if(!y||y.status!=="failed")return"";const C=Ne(y.error);return Oe(C==null?void 0:C.message)}function _n(d){var y;if(d.method!=="error")return"";const p=Ne(d.params);return Oe(p==null?void 0:p.message)||Oe((y=Ne(p==null?void 0:p.error))==null?void 0:y.message)}function kn(d){const p=Ne(d);if(!p)return null;const y=p.id,C=Oe(p.method),X=p.params;if(typeof y!="number"||!Number.isInteger(y)||!C)return null;const Q=Ne(X),_e=Oe(Q==null?void 0:Q.threadId)||Ms,xe=Oe(Q==null?void 0:Q.turnId),we=Oe(Q==null?void 0:Q.itemId),ot=Oe(p.receivedAtIso)||new Date().toISOString();return{id:y,method:C,threadId:_e,turnId:xe,itemId:we,receivedAtIso:ot,params:X??null}}function _(d){const p=d.threadId||Ms,y=Ie.value[p]??[],C=y.findIndex(Q=>Q.id===d.id),X=[...y];C>=0?X.splice(C,1,d):X.push(d),Ie.value={...Ie.value,[p]:X.sort((Q,_e)=>Q.receivedAtIso.localeCompare(_e.receivedAtIso))}}function S(d){const p={};for(const[y,C]of Object.entries(Ie.value)){const X=C.filter(Q=>Q.id!==d);X.length>0&&(p[y]=X)}Ie.value=p}function E(d){if(d.method==="server/request"){const p=kn(d.params);return p&&_(p),!0}if(d.method==="server/request/resolved"){const p=Ne(d.params),y=p==null?void 0:p.id;return typeof y=="number"&&Number.isInteger(y)&&S(y),!0}return!1}function q(d){return d.replace(/\s+/gu," ").trim()}function ge(d){const p=jt(d);if(!p)return null;if(d.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Ne(d.params),C=Ne(y==null?void 0:y.item),X=Oe(C==null?void 0:C.type).toLowerCase();if(X==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(X==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(X==="commandexecution"){const Q=Oe(C==null?void 0:C.command);return{threadId:p,activity:{label:"Running command",details:Q?[Q]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function le(d){if(d.method!=="turn/started")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Oe(C==null?void 0:C.startedAt))??hr(Oe(p.startedAt))??hr(d.atIso)??Date.now();return{threadId:y,turnId:X,startedAtMs:Q}}function Ae(d){if(d.method!=="turn/completed")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Oe(C==null?void 0:C.completedAt))??hr(Oe(p.completedAt))??hr(d.atIso)??Date.now(),_e=hr(Oe(C==null?void 0:C.startedAt))??hr(Oe(p.startedAt))??void 0;return{threadId:y,turnId:X,completedAtMs:Q,startedAtMs:_e}}function ke(d){return`${d}:live-reasoning`}function We(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":Oe(y.id)}return""}function at(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:ke(y),delta:C}}return null}function lt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Oe(p.itemId);return y?ke(y):""}return""}function Pt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/completed"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":ke(Oe(y.id))}return""}function Mt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="agentMessage"?"":Oe(y.id)}return""}function sn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/agentMessage/delta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:y,delta:C}}return null}function Dn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/completed"){const y=Ne(p.item);if(!y||y.type!=="agentMessage")return null;const C=Oe(y.id),X=Oe(y.text);return!C||!X?null:{id:C,role:"assistant",text:X,messageType:"agentMessage.live"}}return null}function ks(d){if(d.method!=="item/started")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Cr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const p=Ne(d.params);if(!p)return null;const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{itemId:y,delta:C}}function Gr(d){if(d.method!=="item/completed")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null,_e=Oe(y.status),xe=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",ot=typeof y.exitCode=="number"?y.exitCode:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:xe,aggregatedOutput:we,exitCode:ot}}}function Ln(d,p){const y=i.value[d]??[],C=gu(y,p);C!==y&&(i.value={...i.value,[d]:C})}function Kr(d,p){const y=i.value[d];if(!y||y.length===0)return;const C=new Set(p.map(Q=>Q.id)),X=y.filter(Q=>!C.has(Q.id));X.length!==y.length&&(X.length===0?i.value=Bt(i.value,d):i.value={...i.value,[d]:X})}function Jr(d){if(d.method==="item/agentMessage/delta")return!0;const p=Ne(d.params);if(!p)return!1;if(d.method==="item/completed"){const y=Ne(p.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function jn(d){var ml,gl,vl,yl;if(E(d))return;if(d.method==="thread/name/updated"){const qe=Ne(d.params),Tn=Oe(qe==null?void 0:qe.threadId),xr=Oe(qe==null?void 0:qe.threadName);Tn&&xr&&(ee.value={...ee.value,[Tn]:xr},he(),Li(Tn,xr))}const p=ge(d);p&&U(p.threadId,p.activity);const y=le(d);y&&(et.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},Pe(y.threadId,null),K(y.threadId,null),Ve(y.threadId,!0),u.value[y.threadId]&&(u.value=Bt(u.value,y.threadId)));const C=Ae(d),X=Er(d),_e=!!((C==null?void 0:C.threadId)??jt(d))&&!!X&&f.value!==un&&_o(new Error(X));if(C){const qe=et.get(C.turnId);qe&&et.delete(C.turnId);const Tn=fn((ml=Ne(d.params))==null?void 0:ml.durationMs)??fn((vl=Ne((gl=Ne(d.params))==null?void 0:gl.turn))==null?void 0:vl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(qe?C.completedAtMs-qe.startedAtMs:null),xr=typeof Tn=="number"?Math.max(0,Tn):0;Pe(C.threadId,{turnId:C.turnId,durationMs:xr}),ve.value[C.threadId]&&(ve.value=Bt(ve.value,C.threadId)),Ve(C.threadId,!1),U(C.threadId,null),_t(C.threadId),_e||(D(C.threadId),on(C.threadId))}if(X){const qe=(C==null?void 0:C.threadId)||jt(d);qe&&K(qe,X),Te.value=X,qe&&_e&&B(qe)}else C&&K(C.threadId,null);const xe=_n(d);if(xe){const qe=jt(d);qe&&K(qe,xe),Te.value=xe,f.value!==un&&_o(new Error(xe))&&(qe?B(qe):F())}const we=jt(d);if(!we||we!==n.value)return;Mt(d);const ot=sn(d);if(ot){const qe=(s.value[we]??[]).find(xr=>xr.id===ot.messageId),Tn=`${(qe==null?void 0:qe.text)??""}${ot.delta}`;xt(we,{id:ot.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Dn(d);St&&xt(we,St),We(d);const Xr=at(d);if(Xr&&Sr(we,Xr.delta),lt(d)){const qe=o.value[we]??"";qe.trim().length>0&&!qe.endsWith(`
1423
+ */const aE=300,lE=sf("authIdTokenMaxAge")||aE;let cu=null;const cE=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>lE)return;const s=n==null?void 0:n.token;cu!==s&&(cu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function uE(e=df()){const t=cf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=VI(e,{popupRedirectResolver:rE,persistence:[pS,nS,Df]}),r=sf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=cE(o.toString());ZI(n,i,()=>i(n.currentUser)),XI(n,a=>i(a))}}const s=B0("auth");return s&&zI(n,`http://${s}`),n}function dE(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}BI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=gn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",dE().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});iE("Browser");const fE={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function hE(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function u(){try{const I=await fetch("/codex-api/skills-sync/status");if(!I.ok)return;const M=await I.json();M.data&&(o.value=M.data)}catch{}}async function c(){try{const I=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),M=await I.json();if(!I.ok||!M.data)throw new Error("Failed to start GitHub login");t.value=M.data;const Y=30,j=Math.max((M.data.interval??5)*1e3,3e3);let q=!1;for(let B=0;B<Y;B++){await new Promise(ve=>setTimeout(ve,j));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:M.data.device_code})}),de=await oe.json();if(!oe.ok)throw new Error(de.error||"Failed to complete GitHub login");if(de.ok){q=!0;break}if(!de.pending)throw new Error(de.error||"Failed to complete GitHub login")}if(!q)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(I){e.showToast(I instanceof Error?I.message:"Failed GitHub login","error")}}async function f(){try{const I=eI().length>0?df():uf(fE),M=uE(I),Y=new xn;Y.addScope("repo");const j=await wS(M,Y),q=xn.credentialFromResult(j),B=(q==null?void 0:q.accessToken)??"";if(!B)throw new Error("GitHub access token missing from Firebase login");const oe=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:B})}),de=await oe.json();if(!oe.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(I){const M=I instanceof Error?I.message:"Failed Firebase GitHub login";e.showToast(M,"error")}}async function p(){r.value="",n.value="pull-started",s.value="pull";try{const I=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(I){const M=I instanceof Error?I.message:"Failed to pull sync";r.value=M,n.value="pull-failed",e.showToast(M,"error")}finally{s.value=""}}async function _(){r.value="",n.value="push-started",s.value="push";try{const I=await fetch("/codex-api/skills-sync/push",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(I){const M=I instanceof Error?I.message:"Failed to push sync";r.value=M,n.value="push-failed",e.showToast(M,"error")}finally{s.value=""}}async function N(){try{const I=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(I){e.showToast(I instanceof Error?I.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:N,pullSkillsSync:p,pushSkillsSync:_,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const pE={class:"skills-hub"},mE={class:"skills-sync-panel"},gE={class:"skills-sync-header"},vE={key:0,class:"skills-sync-badge"},yE={key:1,class:"skills-sync-badge"},wE={key:2,class:"skills-sync-badge"},bE={class:"skills-sync-meta"},_E={key:0,class:"skills-sync-error"},kE={key:1,class:"skills-sync-meta"},TE={key:2,class:"skills-sync-error"},IE={key:3,class:"skills-sync-device"},SE=["href"],EE={class:"skills-sync-actions"},CE=["disabled"],AE=["disabled"],RE=["disabled"],PE={key:1,class:"skills-hub-section"},xE={class:"skills-hub-section-title"},OE={key:0,class:"skills-hub-grid"},ME={class:"skills-hub-toolbar"},NE={class:"skills-hub-search-wrap"},$E={key:0,class:"skills-hub-count"},DE={class:"skills-hub-section"},LE={key:0,class:"skills-hub-loading"},jE={key:1,class:"skills-hub-error"},BE={key:0,class:"skills-hub-grid"},UE={key:1,class:"skills-hub-empty"},yo="codex-web-local.skills-hub.cache.v1",FE=Lt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),u=D(!1),c=D(""),f=D(!0),p=D(!1),_=D(n),N=D(null),I=D(""),M=D(!1),Y=D(!1);let j=null,q=null;const B=t,oe=pe(()=>o.value==="date"?"Newest":"A-Z"),de=pe(()=>{var P;return((P=N.value)==null?void 0:P.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=pe(()=>`${_.value.owner}/${_.value.name}`),Ie=pe(()=>M.value&&I.value===ve.value),re=pe(()=>Y.value&&I.value===ve.value),ee=pe(()=>{const P=s.value.toLowerCase().trim();return P?a.value.filter($=>$.name.toLowerCase().includes(P)||$.owner.toLowerCase().includes(P)||($.displayName??"").toLowerCase().includes(P)):a.value});function ye(P,$="success"){N.value={text:P,type:$},q&&clearTimeout(q),q=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",$e(s.value)}function je(P){return`${o.value}::${P.trim().toLowerCase()}`}function Be(P){var $;if(typeof window>"u")return null;try{const L=window.localStorage.getItem(yo);return L?(($=JSON.parse(L).byKey)==null?void 0:$[P])??null:null}catch{return null}}function Qe(P,$){if(!(typeof window>"u"))try{const L=window.localStorage.getItem(yo),V=(L?JSON.parse(L):{}).byKey??{};V[P]=$,window.localStorage.setItem(yo,JSON.stringify({byKey:V}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(yo)}catch{}}function Te(P){const $=P.installed??[];a.value=$;const L=new Set($.map(G=>G.name));i.value=P.data.map(G=>{if(G.installed||L.has(G.name)){const V=$.find(be=>be.name===G.name);return{...G,installed:!0,path:(V==null?void 0:V.path)??G.path,enabled:(V==null?void 0:V.enabled)??G.enabled}}return G}).filter(G=>!G.installed),l.value=P.total}async function $e(P){const $=je(P),L=Be($);L&&Te(L),u.value=!L,c.value="";try{const G=new URLSearchParams;P.trim()&&G.set("q",P.trim()),G.set("limit","100"),G.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${G}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const be=await V.json();Te(be),Qe($,be)}catch(G){c.value=G instanceof Error?G.message:"Failed to load skills"}finally{u.value=!1}}function It(){j&&clearTimeout(j),j=setTimeout(()=>$e(s.value),300)}function nt(P){_.value=P,p.value=!0}async function Xe(P){I.value=`${P.owner}/${P.name}`,M.value=!0;try{const L=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:P.owner,name:P.name})})).json();if(!L.ok)throw new Error(L.error||"Install failed");const G={...P,installed:!0,path:L.path,enabled:!0};a.value=[...a.value,G],i.value=i.value.filter(V=>V.name!==P.name),_.value=G,ye(`${P.displayName||P.name} skill installed`),p.value=!1,Re(),B("skills-changed")}catch($){ye($ instanceof Error?$.message:"Failed to install skill","error")}finally{M.value=!1}}async function Ze(P){I.value=`${P.owner}/${P.name}`,Y.value=!0;try{const L=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,path:P.path})})).json();if(!L.ok)throw new Error(L.error||"Uninstall failed");a.value=a.value.filter(G=>G.name!==P.name),P.owner!=="local"&&(i.value=[...i.value,{...P,installed:!1,path:void 0,enabled:void 0}]),ye(`${P.displayName||P.name} skill uninstalled`),p.value=!1,Re(),B("skills-changed")}catch($){ye($ instanceof Error?$.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ht(P,$){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:P.path,enabled:$}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ye(`${P.displayName||P.name} skill ${$?"enabled":"disabled"}`),await $e(s.value)}catch(L){ye(L instanceof Error?L.message:"Failed to update skill","error")}}const{deviceLogin:Rt,isPullInFlight:Ge,isPushInFlight:et,isSyncActionInFlight:W,loadSyncStatus:me,logoutGithub:ie,pullSkillsSync:fe,pushSkillsSync:De,startGithubFirebaseLogin:g,startGithubLogin:v,syncActionError:A,syncActionStatus:H,syncStatus:F}=hE({showToast:ye,onPulled:async()=>{await $e(s.value),B("skills-changed")}});return ir(()=>{$e(""),me()}),(P,$)=>(w(),T("div",pE,[$[11]||($[11]=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",mE,[m("div",gE,[$[8]||($[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ue(F).configured?(w(),T("span",vE,"Connected: "+ce(ue(F).repoOwner)+"/"+ce(ue(F).repoName),1)):ue(F).loggedIn?(w(),T("span",yE,"Logged in as "+ce(ue(F).githubUsername),1)):(w(),T("span",wE,"Not connected"))]),m("div",bE,[m("span",null,"Startup: "+ce(ue(F).startup.mode),1),m("span",null,"Branch: "+ce(ue(F).startup.branch),1),m("span",null,"Action: "+ce(ue(F).startup.lastAction),1)]),ue(F).startup.lastError?(w(),T("div",_E,ce(ue(F).startup.lastError),1)):se("",!0),ue(H)?(w(),T("div",kE,[m("span",null,"Manual sync: "+ce(ue(H)),1)])):se("",!0),ue(A)?(w(),T("div",TE,ce(ue(A)),1)):se("",!0),ue(Rt)?(w(),T("div",IE,[m("span",null,[$[9]||($[9]=aa("Open ",-1)),m("a",{href:ue(Rt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,SE),$[10]||($[10]=aa(" and enter code:",-1))]),m("code",null,ce(ue(Rt).user_code),1)])):se("",!0),m("div",EE,[ue(F).loggedIn?se("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:$[0]||($[0]=(...L)=>ue(g)&&ue(g)(...L))},"Login with GitHub")),ue(F).loggedIn?se("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:$[1]||($[1]=(...L)=>ue(v)&&ue(v)(...L))},"Device Login")),ue(F).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:$[2]||($[2]=(...L)=>ue(ie)&&ue(ie)(...L)),disabled:ue(W)},"Logout GitHub",8,CE)):se("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:$[3]||($[3]=(...L)=>ue(fe)&&ue(fe)(...L)),disabled:ue(W)},ce(ue(Ge)?"Pulling...":"Pull"),9,AE),ue(F).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:$[4]||($[4]=(...L)=>ue(De)&&ue(De)(...L)),disabled:!ue(F).configured||ue(W)},ce(ue(et)?"Pushing...":"Push"),9,RE)):se("",!0)])]),N.value?(w(),T("div",{key:0,class:gt(["skills-hub-toast",de.value])},ce(N.value.text),3)):se("",!0),ee.value.length>0?(w(),T("div",PE,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:$[5]||($[5]=L=>f.value=!f.value)},[m("span",xE,"Installed ("+ce(ee.value.length)+")",1),Ce(Kd,{class:gt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",OE,[(w(!0),T(He,null,Et(ee.value,L=>(w(),yt(Dc,{key:L.name,skill:L,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):se("",!0)])):se("",!0),m("div",ME,[m("div",NE,[Ce(ga,{class:"skills-hub-search-icon"}),tr(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":$[6]||($[6]=L=>s.value=L),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:It},null,544),[[nr,s.value]]),l.value>0?(w(),T("span",$E,ce(l.value)+" skills",1)):se("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:te},ce(oe.value),1)]),m("div",DE,[u.value?(w(),T("div",LE,"Loading skills...")):c.value?(w(),T("div",jE,ce(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",BE,[(w(!0),T(He,null,Et(i.value,L=>(w(),yt(Dc,{key:L.url,skill:L,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",UE,'No skills found for "'+ce(s.value)+'"',1)):se("",!0)],64))]),Ce(P0,{skill:_.value,visible:p.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:$[7]||($[7]=L=>p.value=!1),onInstall:Xe,onUninstall:Ze,onToggleEnabled:ht},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),HE=st(FE,[["__scopeId","data-v-2f6920be"]]),VE={},WE={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 zE(e,t){return w(),T("svg",WE,[...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 qE=st(VE,[["render",zE]]),GE={},KE={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function JE(e,t){return w(),T("svg",KE,[...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 YE=st(GE,[["render",JE]]),QE={class:"sidebar-thread-controls"},XE=["aria-label","title"],ZE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",QE,[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(),yt(YE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),yt(qE,{key:1,class:"sidebar-thread-controls-icon"}))],8,XE),On(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ce(Uo,{class:"sidebar-thread-controls-icon"})])):se("",!0)]))}}),uu=st(ZE,[["__scopeId","data-v-46a10052"]]),eC={},tC={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function nC(e,t){return w(),T("svg",tC,[...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 rC=st(eC,[["render",nC]]);function gr(e){return e.flatMap(t=>t.threads)}const Wf="codex-web-local.thread-read-state.v1",zf="codex-web-local.thread-scroll-state.v1",Sa="codex-web-local.selected-thread-id.v1",qf="codex-web-local.project-order.v1",Gf="codex-web-local.project-display-name.v1",Vi=220,du=["none","minimal","low","medium","high","xhigh"],Os="__global__",un="gpt-5.2-codex";function sC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Wf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function fu(e){typeof window>"u"||window.localStorage.setItem(Wf,JSON.stringify(e))}function Kf(e,t,n){return Math.min(Math.max(e,t),n)}function oC(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=Kf(t.scrollRatio,0,1)),n}function iC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zf);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=oC(s);o&&(n[r]=o)}return n}catch{return{}}}function hu(e){typeof window>"u"||window.localStorage.setItem(zf,JSON.stringify(e))}function aC(){return typeof window>"u"?"":window.localStorage.getItem(Sa)??""}function lC(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Sa);return}window.localStorage.setItem(Sa,e)}}function cC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(qf);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 es(e){typeof window>"u"||window.localStorage.setItem(qf,JSON.stringify(e))}function uC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gf);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 Wi(e){typeof window>"u"||window.localStorage.setItem(Gf,JSON.stringify(e))}function wo(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 Br(e,n)?e:n}function zi(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 Br(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 dC(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 fC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function bo(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 Ea(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Br(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&fC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Go(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 hC(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&Ea(f,c)?f:c});if(n.preserveMissing!==!0)return Go(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Ea(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Go(e,u)?e:u}function Ca(e){return e.replace(/\s+/gu," ").trim()}function pC(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ca(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=Ca(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function pu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Ea(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Jf="worked";function hr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function mC(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 gC(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function vC(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 yC(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${mC(e.durationMs)}`,messageType:Jf}}function wC(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function bC(e,t){const n=yC(t),r=e.filter(i=>i.messageType!==Jf),s=wC(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Bt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function _C(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 kC(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 TC(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 Ft(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function _o(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 u=i.get(l.id);return u&&_C(u,l)?u:l});return o&&o.projectName===s.projectName&&kC(o.threads,a)?o:{projectName:s.projectName,threads:a}});return TC(e,r)?e:r}function IC(e,t,n){const r=new Set(gr(t).map(a=>a.id)),s=gr(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 u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function SC(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function qi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function EC(e){const t=e.split(`
1424
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function CC(){const e=D([]),t=D([]),n=D(aC()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D([]),f=D(""),p=D("medium"),_=D(sC()),N=D(iC()),I=D(cC()),M=D(uC()),Y=D({}),j=D({}),q=D({}),B=D({}),oe=D({}),de=D({}),ve=D({}),Ie=D({}),re=D({}),ee=D({}),ye=D([]),te=D(!1),je=D(!1),Be=D(!1),Qe=D(!1),Re=D(!1),Te=D(""),$e=D(!1),It=D(!1);let nt=null,Xe=null,Ze=!1;const ht=new Set;let Rt=!1,Ge=!1;const et=new Map,W=new Set,me=pe(()=>gr(e.value)),ie=pe(()=>me.value.find(d=>d.id===n.value)??null),fe=pe(()=>N.value[n.value]??null),De=pe(()=>{const d=[],h=n.value;return h&&Array.isArray(Ie.value[h])&&d.push(...Ie.value[h]),Array.isArray(Ie.value[Os])&&d.push(...Ie.value[Os]),d.sort((y,C)=>y.receivedAtIso.localeCompare(C.receivedAtIso))}),g=pe(()=>{var X;const d=n.value;if(!d)return null;const h=oe.value[d],y=(o.value[d]??"").trim(),C=(((X=de.value[d])==null?void 0:X.message)??"").trim();return!h&&!y&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:y,errorText:C}}),v=pe(()=>{const d=n.value;if(!d)return[];const h=r.value[d]??[],y=s.value[d]??[],C=i.value[d]??[],X=[...h,...C,...y],Q=B.value[d];return Q?bC(X,Q):X});function A(d){n.value!==d&&(n.value=d,lC(d),Ge=!1)}function H(d){f.value=d.trim()}async function F(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await Zb(un)}catch{}}function P(d,h){re.value={...re.value,[d]:h}}function $(d){re.value[d]&&(re.value=Bt(re.value,d))}async function L(d){if(W.has(d))return;const h=re.value[d];if(!(!h||h.fallbackRetried)){W.add(d),P(d,{...h,fallbackRetried:!0});try{await F();try{const y=await Oc(d,1);it(d,y),kt(d,[]),rn(d),i.value[d]&&(i.value=Bt(i.value,d))}catch{}K(d,null),Te.value="",xe(d,null),U(d,{label:"Thinking",details:V(un,h.effort)}),Ve(d,!0),q.value[d]!==!0&&await Mi(d),await Ni(d,h.text,h.imageUrls,un,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),q.value={...q.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Unknown application error";K(d,C),Te.value=C,Ve(d,!1),U(d,null)}finally{W.delete(d)}}}function G(d){d&&!du.includes(d)||(p.value=d)}function V(d,h){const y=d.trim()||"default",C=h||"default";return[`Model: ${y}`,`Thinking: ${C}`]}async function be(){try{const[d,h]=await Promise.all([e_(),t_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(h.model&&d.includes(h.model)?f.value=h.model:d.length>0?f.value=d[0]:f.value=""),h.reasoningEffort&&du.includes(h.reasoningEffort)&&(p.value=h.reasoningEffort)}catch{}}function ae(d){const h=ee.value;return Object.keys(h).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=h[C.id];return X?{...C,title:X}:C})}))}function he(){const h=ae(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=a.value[C.id]===!0,Q=n.value===C.id,_e=_.value[C.id],Pe=u.value[C.id]===!0,we=!Q&&!X&&(Pe||_e!==C.updatedAtIso);return{...C,inProgress:X,unread:we}})}));e.value=_o(e.value,h)}function Se(d,h,y){const C=new Date().toISOString(),X=h.trim(),Q=SC(X),_e={id:d,title:EC(y),projectName:Q,cwd:X,hasWorktree:X.includes("/.codex/worktrees/")||X.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:y,unread:!1,inProgress:!1},Pe=t.value.findIndex(ot=>ot.projectName===Q);if(Pe>=0){const St=t.value[Pe].threads.filter(cr=>cr.id!==d),Xr={projectName:Q,threads:[_e,...St]},Fn=[...t.value];Fn.splice(Pe,1,Xr),t.value=Fn}else t.value=[{projectName:Q,threads:[_e]},...t.value];const we=wo(I.value,t.value);Br(I.value,we)||(I.value=we,es(I.value)),he()}function Oe(d){const h=new Set(d.map(Q=>Q.id)),y=Ft(_.value,h);y!==_.value&&(_.value=y,fu(y));const C=Ft(N.value,h);C!==N.value&&(N.value=C,hu(C)),j.value=Ft(j.value,h),Y.value=Ft(Y.value,h),q.value=Ft(q.value,h),r.value=Ft(r.value,h),s.value=Ft(s.value,h),o.value=Ft(o.value,h),i.value=Ft(i.value,h),B.value=Ft(B.value,h),oe.value=Ft(oe.value,h),de.value=Ft(de.value,h),ve.value=Ft(ve.value,h),u.value=Ft(u.value,h),a.value=Ft(a.value,h);const X={};for(const[Q,_e]of Object.entries(Ie.value))(Q===Os||h.has(Q))&&(X[Q]=_e);Ie.value=X}function Ke(d){const h=gr(t.value).find(y=>y.id===d);h&&(_.value={..._.value,[d]:h.updatedAtIso},fu(_.value),u.value[d]&&(u.value=Bt(u.value,d)),he())}function xe(d,h){if(!d)return;const y=B.value[d];if(h){if(gC(y,h))return;B.value={...B.value,[d]:h}}else y&&(B.value=Bt(B.value,d))}function Ve(d,h){!d||a.value[d]===!0===h||(h?a.value={...a.value,[d]:!0}:a.value=Bt(a.value,d),he())}function _t(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},he())}function U(d,h){if(!d)return;const y=oe.value[d];if(!h){y&&(oe.value=Bt(oe.value,d));return}const C=z(h.label)||"Thinking",X=h.details.map(Pe=>z(Pe)).filter(Pe=>Pe.length>0&&Pe!==C),Q=Array.from(new Set([...(y==null?void 0:y.details)??[],...X])).slice(-3),_e={label:C,details:Q};vC(y,_e)||(oe.value={...oe.value,[d]:_e})}function K(d,h){if(!d)return;const y=de.value[d],C=h?Ca(h):"";if(!C){y&&(de.value=Bt(de.value,d));return}(y==null?void 0:y.message)!==C&&(de.value={...de.value,[d]:{message:C}})}function ne(d){const h=gr(t.value).find(y=>y.id===d);return(h==null?void 0:h.updatedAtIso)??""}function Je(d,h){if(!d)return;const y={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(y.scrollRatio=Kf(h.scrollRatio,0,1));const C=N.value[d];C&&C.scrollTop===y.scrollTop&&C.isAtBottom===y.isAtBottom&&C.scrollRatio===y.scrollRatio||(N.value={...N.value,[d]:y},hu(N.value))}function it(d,h){const y=r.value[d]??[];Go(y,h)||(r.value={...r.value,[d]:h})}function kt(d,h){const y=s.value[d]??[];Go(y,h)||(s.value={...s.value,[d]:h})}function Pt(d,h){const y=s.value[d]??[],C=pu(y,h);kt(d,C)}function ln(d,h){if(!d)return;const y=h.trim(),C=o.value[d]??"";if(y.length===0){if(!C)return;o.value=Bt(o.value,d);return}C!==y&&(o.value={...o.value,[d]:y})}function Sr(d,h){if(!d)return;const y=o.value[d]??"";ln(d,`${y}${h}`)}function rn(d){d&&d in o.value&&(o.value=Bt(o.value,d))}function Ne(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Me(d){return typeof d=="string"?d:""}function fn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function jt(d){const h=Ne(d.params);if(!h)return"";const y=Me(h.threadId);if(y)return y;const C=Me(h.thread_id);if(C)return C;const X=Me(h.conversationId);if(X)return X;const Q=Me(h.conversation_id);if(Q)return Q;const _e=Ne(h.thread),Pe=Me(_e==null?void 0:_e.id);if(Pe)return Pe;const we=Ne(h.turn),ot=Me(we==null?void 0:we.threadId);if(ot)return ot;const St=Me(we==null?void 0:we.thread_id);return St||""}function Er(d){if(d.method!=="turn/completed")return"";const h=Ne(d.params),y=Ne(h==null?void 0:h.turn);if(!y||y.status!=="failed")return"";const C=Ne(y.error);return Me(C==null?void 0:C.message)}function _n(d){var y;if(d.method!=="error")return"";const h=Ne(d.params);return Me(h==null?void 0:h.message)||Me((y=Ne(h==null?void 0:h.error))==null?void 0:y.message)}function kn(d){const h=Ne(d);if(!h)return null;const y=h.id,C=Me(h.method),X=h.params;if(typeof y!="number"||!Number.isInteger(y)||!C)return null;const Q=Ne(X),_e=Me(Q==null?void 0:Q.threadId)||Os,Pe=Me(Q==null?void 0:Q.turnId),we=Me(Q==null?void 0:Q.itemId),ot=Me(h.receivedAtIso)||new Date().toISOString();return{id:y,method:C,threadId:_e,turnId:Pe,itemId:we,receivedAtIso:ot,params:X??null}}function b(d){const h=d.threadId||Os,y=Ie.value[h]??[],C=y.findIndex(Q=>Q.id===d.id),X=[...y];C>=0?X.splice(C,1,d):X.push(d),Ie.value={...Ie.value,[h]:X.sort((Q,_e)=>Q.receivedAtIso.localeCompare(_e.receivedAtIso))}}function S(d){const h={};for(const[y,C]of Object.entries(Ie.value)){const X=C.filter(Q=>Q.id!==d);X.length>0&&(h[y]=X)}Ie.value=h}function E(d){if(d.method==="server/request"){const h=kn(d.params);return h&&b(h),!0}if(d.method==="server/request/resolved"){const h=Ne(d.params),y=h==null?void 0:h.id;return typeof y=="number"&&Number.isInteger(y)&&S(y),!0}return!1}function z(d){return d.replace(/\s+/gu," ").trim()}function ge(d){const h=jt(d);if(!h)return null;if(d.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Ne(d.params),C=Ne(y==null?void 0:y.item),X=Me(C==null?void 0:C.type).toLowerCase();if(X==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(X==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(X==="commandexecution"){const Q=Me(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:Q?[Q]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function le(d){if(d.method!=="turn/started")return null;const h=Ne(d.params);if(!h)return null;const y=jt(d);if(!y)return null;const C=Ne(h.turn),X=Me(C==null?void 0:C.id)||Me(h.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Me(C==null?void 0:C.startedAt))??hr(Me(h.startedAt))??hr(d.atIso)??Date.now();return{threadId:y,turnId:X,startedAtMs:Q}}function Ae(d){if(d.method!=="turn/completed")return null;const h=Ne(d.params);if(!h)return null;const y=jt(d);if(!y)return null;const C=Ne(h.turn),X=Me(C==null?void 0:C.id)||Me(h.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Me(C==null?void 0:C.completedAt))??hr(Me(h.completedAt))??hr(d.atIso)??Date.now(),_e=hr(Me(C==null?void 0:C.startedAt))??hr(Me(h.startedAt))??void 0;return{threadId:y,turnId:X,completedAtMs:Q,startedAtMs:_e}}function ke(d){return`${d}:live-reasoning`}function We(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/started"){const y=Ne(h.item);return!y||y.type!=="reasoning"?"":Me(y.id)}return""}function at(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{messageId:ke(y),delta:C}}return null}function lt(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Me(h.itemId);return y?ke(y):""}return""}function xt(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/completed"){const y=Ne(h.item);return!y||y.type!=="reasoning"?"":ke(Me(y.id))}return""}function Ot(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/started"){const y=Ne(h.item);return!y||y.type!=="agentMessage"?"":Me(y.id)}return""}function sn(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/agentMessage/delta"){const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{messageId:y,delta:C}}return null}function Dn(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/completed"){const y=Ne(h.item);if(!y||y.type!=="agentMessage")return null;const C=Me(y.id),X=Me(y.text);return!C||!X?null:{id:C,role:"assistant",text:X,messageType:"agentMessage.live"}}return null}function ks(d){if(d.method!=="item/started")return null;const h=Ne(d.params),y=Ne(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const C=Me(y.id),X=Me(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Cr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const h=Ne(d.params);if(!h)return null;const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{itemId:y,delta:C}}function Gr(d){if(d.method!=="item/completed")return null;const h=Ne(d.params),y=Ne(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const C=Me(y.id),X=Me(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null,_e=Me(y.status),Pe=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",ot=typeof y.exitCode=="number"?y.exitCode:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:Pe,aggregatedOutput:we,exitCode:ot}}}function Ln(d,h){const y=i.value[d]??[],C=pu(y,h);C!==y&&(i.value={...i.value,[d]:C})}function Kr(d,h){const y=i.value[d];if(!y||y.length===0)return;const C=new Set(h.map(Q=>Q.id)),X=y.filter(Q=>!C.has(Q.id));X.length!==y.length&&(X.length===0?i.value=Bt(i.value,d):i.value={...i.value,[d]:X})}function Jr(d){if(d.method==="item/agentMessage/delta")return!0;const h=Ne(d.params);if(!h)return!1;if(d.method==="item/completed"){const y=Ne(h.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function jn(d){var pl,ml,gl,vl;if(E(d))return;if(d.method==="thread/name/updated"){const qe=Ne(d.params),Tn=Me(qe==null?void 0:qe.threadId),Pr=Me(qe==null?void 0:qe.threadName);Tn&&Pr&&(ee.value={...ee.value,[Tn]:Pr},he(),$i(Tn,Pr))}const h=ge(d);h&&U(h.threadId,h.activity);const y=le(d);y&&(et.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},xe(y.threadId,null),K(y.threadId,null),Ve(y.threadId,!0),u.value[y.threadId]&&(u.value=Bt(u.value,y.threadId)));const C=Ae(d),X=Er(d),_e=!!((C==null?void 0:C.threadId)??jt(d))&&!!X&&f.value!==un&&bo(new Error(X));if(C){const qe=et.get(C.turnId);qe&&et.delete(C.turnId);const Tn=fn((pl=Ne(d.params))==null?void 0:pl.durationMs)??fn((gl=Ne((ml=Ne(d.params))==null?void 0:ml.turn))==null?void 0:gl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(qe?C.completedAtMs-qe.startedAtMs:null),Pr=typeof Tn=="number"?Math.max(0,Tn):0;xe(C.threadId,{turnId:C.turnId,durationMs:Pr}),ve.value[C.threadId]&&(ve.value=Bt(ve.value,C.threadId)),Ve(C.threadId,!1),U(C.threadId,null),_t(C.threadId),_e||($(C.threadId),on(C.threadId))}if(X){const qe=(C==null?void 0:C.threadId)||jt(d);qe&&K(qe,X),Te.value=X,qe&&_e&&L(qe)}else C&&K(C.threadId,null);const Pe=_n(d);if(Pe){const qe=jt(d);qe&&K(qe,Pe),Te.value=Pe,f.value!==un&&bo(new Error(Pe))&&(qe?L(qe):F())}const we=jt(d);if(!we||we!==n.value)return;Ot(d);const ot=sn(d);if(ot){const qe=(s.value[we]??[]).find(Pr=>Pr.id===ot.messageId),Tn=`${(qe==null?void 0:qe.text)??""}${ot.delta}`;Pt(we,{id:ot.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Dn(d);St&&Pt(we,St),We(d);const Xr=at(d);if(Xr&&Sr(we,Xr.delta),lt(d)){const qe=o.value[we]??"";qe.trim().length>0&&!qe.endsWith(`
1439
1425
 
1440
1426
  `)&&ln(we,`${qe}
1441
1427
 
1442
- `)}Pt(d);const cr=ks(d);cr&&(Ln(we,cr),U(we,{label:"Running command",details:[((yl=cr.commandExecution)==null?void 0:yl.command)??""]}));const gi=Cr(d);if(gi){const qe=(i.value[we]??[]).find(Tn=>Tn.id===gi.itemId);qe!=null&&qe.commandExecution&&Ln(we,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${gi.delta}`}})}const pl=Gr(d);if(pl&&Ln(we,pl),Jr(d)&&(Ge&&n.value&&Je(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(we)),d.method==="turn/completed"){Ge=!1,rn(we),i.value[we]&&(i.value=Bt(i.value,we));const qe=jt(d);qe&&(Ve(qe,!1),U(qe,null),_t(qe),_e||(D(qe),on(qe)))}}function Ts(d){const p=jt(d);p&&ht.add(p);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Ze=!0),!(Xe!==null||typeof window>"u")&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi))}async function Is(d){if(!Rt){Rt=!0;try{const p=await ga(),y=[];for(const C of p.order){const X=Ki(C);y.includes(X)||y.push(X)}if(y.length>0){const C=bo(y,d);Br(I.value,C)||(I.value=C,es(I.value))}if(Object.keys(p.labels).length>0){const C={...O.value};let X=!1;for(const[Q,_e]of Object.entries(p.labels)){const xe=Ki(Q);C[xe]!==_e&&(C[xe]=_e,X=!0)}X&&(O.value=C,qi(C))}}catch{}}}async function Ss(){if(!(Object.keys(ee.value).length>0))try{const d=await d_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Ar(d,p,y){if(ee.value[d])return;const C=p.trim();if(!C)return;const X=C.length>300?C.slice(0,300):C;try{const Q=await f_(X,y);if(!Q||ee.value[d])return;ee.value={...ee.value,[d]:Q},he(),Li(d,Q)}catch{}}async function Rr(){var d;It.value||(te.value=!0);try{const[p]=await Promise.all([zb(),Ss()]);await Is(p);const y=bo(I.value,p);Br(I.value,y)||(I.value=y,es(I.value));const C=Gi(p,I.value),X=RE(t.value,C,a.value);t.value=ko(t.value,X),a.value=Ft(a.value,new Set(gr(t.value).map(xe=>xe.id))),he(),It.value=!0;const Q=gr(e.value);Me(Q),Q.some(xe=>xe.id===n.value)||A(((d=Q[0])==null?void 0:d.id)??"")}finally{te.value=!1}}async function k(d,p={}){if(!d)return;const y=$.value[d]===!0,C=p.silent!==!0&&!y;C&&(je.value=!0);try{z.value[d]!==!0&&(await $i(d),z.value={...z.value,[d]:!0});const{messages:X,inProgress:Q}=await qb(d),_e=r.value[d]??[],xe=yE(_e,X,{preserveMissing:p.silent===!0});it(d,xe);const we=s.value[d]??[],ot=wE(we,X);kt(d,ot),Kr(d,X),$.value={...$.value,[d]:!0};const St=ne(d);St&&(Y.value={...Y.value,[d]:St}),Ve(d,Q),Ke(d)}finally{C&&(je.value=!1)}}async function P(){try{const d=t.value.flatMap(p=>p.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await h_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function M(){Te.value="";try{await Rr(),await Promise.all([be(),P()]),await k(n.value)}catch(d){Te.value=d instanceof Error?d.message:"Unknown application error"}}async function J(d){A(d);try{await k(d)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ue(d){try{await Yb(d),await Rr(),n.value===d&&await k(n.value)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ot(d,p){const y=p.trim();if(!(!d||!y))try{await Qb(d,y),ee.value={...ee.value,[d]:y},he(),Li(d,y)}catch(C){Te.value=C instanceof Error?C.message:"Unknown application error"}}async function Zt(d,p=[],y=[],C="steer",X=[]){const Q=n.value,_e=d.trim();if(!Q||!_e&&p.length===0&&X.length===0)return;const xe=a.value[Q]===!0;if(xe&&C==="queue"){const we=l.value[Q]??[],ot=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[Q]:[...we,{id:ot,text:_e,imageUrls:p,skills:y,fileAttachments:X}]};return}if(xe){Ge=!0,Un(Q,_e,p,y,X).catch(we=>{const ot=we instanceof Error?we.message:"Unknown application error";K(Q,ot),Te.value=ot});return}Te.value="",Ge=!0,Pe(Q,null),U(Q,{label:"Thinking",details:V(f.value,h.value)}),K(Q,null),Ve(Q,!0);try{await Un(Q,_e,p,y,X)}catch(we){Ge=!1,Ve(Q,!1),U(Q,null);const ot=we instanceof Error?we.message:"Unknown application error";throw K(Q,ot),Te.value=ot,we}}async function Bn(d,p,y=[],C=[],X=[]){const Q=d.trim(),_e=p.trim(),xe=f.value.trim();if(!Q&&y.length===0&&X.length===0)return"";Be.value=!0,Te.value="";let we="";try{try{we=await Nc(_e||void 0,xe||void 0)}catch(Fn){if(xe&&xe!==un&&_o(Fn))await F(),we=await Nc(_e||void 0,un);else throw Fn}if(!we)return"";Se(we,_e,Q||"[Image]"),z.value={...z.value,[we]:!0},A(we),Ge=!0,Pe(we,null),U(we,{label:"Thinking",details:V(f.value,h.value)}),K(we,null),Ve(we,!0);const ot=we,St=_e||null,Xr=Q;return Un(we,Q,y,C,X).catch(Fn=>{Ge=!1,Ve(we,!1),U(we,null);const cr=Fn instanceof Error?Fn.message:"Unknown application error";K(we,cr),Te.value=cr}).finally(()=>{Be.value=!1}),Ar(ot,Xr,St),we}catch(ot){Ge=!1,we&&(Ve(we,!1),U(we,null));const St=ot instanceof Error?ot.message:"Unknown application error";throw we&&K(we,St),Te.value=St,Be.value=!1,ot}}async function Un(d,p,y=[],C=[],X=[]){const Q=f.value.trim(),_e=h.value,xe=p.trim(),we=C.map(St=>({name:St.name,path:St.path})),ot=X.map(St=>({...St}));x(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!1});try{z.value[d]!==!0&&await $i(d);try{await Di(d,p,y,Q||void 0,_e||void 0,C.length>0?C:void 0,X)}catch(St){if(Q&&Q!==un&&_o(St))await F(),x(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!0}),await Di(d,p,y,un,_e||void 0,C.length>0?C:void 0,X);else throw St}z.value={...z.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(St){throw St}}async function on(d){const p=l.value[d];if(!p||p.length===0)return;const[y,...C]=p;l.value=C.length>0?{...l.value,[d]:C}:Bt(l.value,d),Be.value=!0,Te.value="",Ge=!0,Pe(d,null),U(d,{label:"Thinking",details:V(f.value,h.value)}),K(d,null),Ve(d,!0);try{await Un(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Ve(d,!1),U(d,null)}finally{Be.value=!1}}async function lr(){const d=n.value;if(!d||a.value[d]!==!0)return;const p=ve.value[d];Qe.value=!0,Te.value="";try{await e_(d,p),Ve(d,!1),U(d,null),K(d,null),ve.value[d]&&(ve.value=Bt(ve.value,d)),ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Failed to interrupt active turn";K(d,C),Te.value=C}finally{Qe.value=!1}}async function Yr(d){const p=n.value;if(!p||Re.value)return;const C=(r.value[p]??[]).reduce((Q,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>Q?_e.turnIndex:Q,-1);if(C<0||d>C)return;const X=C-d+1;if(!(X<1)){Re.value=!0,Te.value="";try{const Q=await Oc(p,X);it(p,Q),kt(p,[]),rn(p),i.value[p]&&(i.value=Bt(i.value,p)),Pe(p,null),U(p,null),K(p,null),Ze=!0,await rt()}catch(Q){Te.value=Q instanceof Error?Q.message:"Failed to rollback thread"}finally{Re.value=!1}}}function Qr(d,p){d.length===0||(O.value[d]??"")===p||(O.value={...O.value,[d]:p},qi(O.value))}function mi(d){var X;if(d.length===0)return;const p=I.value.filter(Q=>Q!==d);if(Br(I.value,p)||(I.value=p,es(I.value)),t.value=t.value.filter(Q=>Q.projectName!==d),O.value[d]!==void 0){const Q={...O.value};delete Q[d],O.value=Q,qi(Q)}he();const y=gr(e.value);Me(y),y.some(Q=>Q.id===n.value)||A(((X=y[0])==null?void 0:X.id)??""),Ee()}function R(d,p){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),C=y.indexOf(d);if(C===-1)return;const X=Math.max(0,Math.min(p,y.length-1)),Q=gE(y,C,X);if(Q===y)return;const _e=bo(Q,t.value);I.value=_e,es(I.value);const xe=Gi(t.value,I.value);t.value=ko(t.value,xe),he(),Ee()}function Z(d){const p=d.trim();if(!p)return;const y=[p,...I.value.filter(X=>X!==p)];if(Br(I.value,y))return;I.value=y,es(I.value);const C=Gi(t.value,I.value);t.value=ko(t.value,C),he(),Ee()}async function Ee(){var d,p;try{const y=await ga(),C=new Map;for(const _e of y.order){const xe=Ki(_e);C.has(xe)||C.set(xe,_e)}for(const _e of t.value){const xe=((p=(d=_e.threads[0])==null?void 0:d.cwd)==null?void 0:p.trim())??"";xe&&C.set(_e.projectName,xe)}const X=[];for(const _e of I.value){const xe=C.get(_e);xe&&!X.includes(xe)&&X.push(xe)}for(const _e of y.order)X.includes(_e)||X.push(_e);const Q=y.active.filter(_e=>X.includes(_e));Q.length===0&&X.length>0&&Q.push(X[0]),await i_({order:X,labels:y.labels,active:Q})}catch{}}async function rt(){if($e.value){typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi));return}$e.value=!0;const d=Ze,p=new Set(ht);Ze=!1,ht.clear();try{d&&await Rr();const y=n.value;if(!y)return;const C=p.has(y),X=a.value[y]===!0,Q=ne(y),_e=Y.value[y]??"",xe=Q.length>0&&Q!==_e;(C||X||xe||d)&&await k(y,{silent:!0})}catch{}finally{$e.value=!1,(Ze||ht.size>0)&&typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi))}}function vt(){typeof window>"u"||nt||(Ye(),nt=Gb(d=>{jn(d),Ts(d)}))}async function Ye(){try{const d=await Jb();for(const p of d){const y=kn(p);y&&_(y)}}catch{}}async function Dt(d){try{await Kb(d.id,{result:d.result,error:d.error}),S(d.id)}catch(p){Te.value=p instanceof Error?p.message:"Failed to reply to server request"}}function ho(){nt&&(nt(),nt=null),Ze=!1,ht.clear(),et.clear(),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},j.value={},de.value={},ve.value={},l.value={}}const Es=pe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function hl(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.filter(X=>X.id!==d);l.value=C.length>0?{...l.value,[p]:C}:Bt(l.value,p)}function Xf(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.find(X=>X.id===d);C&&(hl(d),Zt(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:O,selectedThread:ie,selectedThreadScrollState:fe,selectedThreadServerRequests:De,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:ye,messages:v,isLoadingThreads:te,isLoadingMessages:je,isSendingMessage:Be,isInterruptingTurn:Qe,error:Te,refreshAll:M,refreshSkills:P,selectThread:J,setThreadScrollState:Je,archiveThreadById:Ue,renameThreadById:Ot,sendMessageToSelectedThread:Zt,sendMessageToNewThread:Bn,interruptSelectedThreadTurn:lr,rollbackSelectedThread:Yr,isRollingBack:Re,selectedThreadQueuedMessages:Es,removeQueuedMessage:hl,steerQueuedMessage:Xf,setSelectedModelId:H,setSelectedReasoningEffort:G,respondToPendingServerRequest:Dt,renameProject:Qr,removeProject:mi,reorderProject:R,pinProjectToTop:Z,startPolling:vt,stopPolling:ho}}const OE={class:"sidebar-root"},NE={class:"sidebar-scrollable"},$E=["aria-pressed"],DE={key:1,class:"sidebar-search-bar"},LE={key:0,class:"sidebar-settings-area"},jE={key:0,class:"sidebar-settings-panel"},BE={class:"sidebar-settings-value"},UE={class:"sidebar-settings-value"},FE={class:"content-root"},HE={class:"content-body"},VE={key:1,class:"content-grid"},WE={class:"new-thread-empty"},zE={class:"worktree-init-status-title"},qE={class:"worktree-init-status-message"},GE={key:2,class:"content-grid"},KE={class:"content-thread"},JE={class:"composer-with-queue"},YE={class:"build-badge","aria-label":"Worktree name and version"},vu="codex-web-local.sidebar-collapsed.v1",yu="codex-web-local.send-with-enter.v1",wu="codex-web-local.in-progress-send-mode.v1",bu="codex-web-local.dark-mode.v1",QE=Lt({__name:"App",setup(e){const t="a65b",n="0.1.35",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:b,messages:N,isLoadingThreads:I,isLoadingMessages:O,isInterruptingTurn:Y,refreshAll:$,refreshSkills:z,selectThread:j,setThreadScrollState:oe,archiveThreadById:de,renameThreadById:ve,sendMessageToSelectedThread:Ie,sendMessageToNewThread:re,interruptSelectedThreadTurn:ee,rollbackSelectedThread:ye,isRollingBack:te,selectedThreadQueuedMessages:je,removeQueuedMessage:Be,steerQueuedMessage:Qe,setSelectedModelId:Re,setSelectedReasoningEffort:Te,respondToPendingServerRequest:$e,renameProject:It,removeProject:nt,reorderProject:Xe,pinProjectToTop:Ze,startPolling:ht,stopPolling:Rt}=ME(),Ge=$g(),et=Ng(),{isMobile:W}=Jd(),me=L(!1),ie=L(!1),fe=L(""),De=L("local"),g=L({order:[],labels:{}}),v=L({phase:"idle",title:"",message:""}),A=L(Un()),H=L(""),F=L(!1),x=L(null),D=L(null);let B=null;const G=L("New Project (1)"),V=L(""),be=L(!1),ae=L(P(yu,!0)),he=L(J()),Se=L(M()),Me=pe(()=>{const R=Ge.params.threadId;return typeof R=="string"?R:""}),Ke=pe(()=>{const R=new Set;for(const Z of r.value)for(const Ee of Z.threads)R.add(Ee.id);return R}),Pe=pe(()=>Ge.name==="home"),Ve=pe(()=>Ge.name==="skills"),_t=pe(()=>{var R;return Ve.value?"Skills":Pe.value?"New thread":((R=o.value)==null?void 0:R.title)??"Choose a thread"}),U=pe(()=>N.value.filter(R=>{const Z=lr(R.messageType,R.role);return Z==="worked"?!0:!(Z==="turnActivity.live"||Z==="turnError.live"||Z==="agentReasoning.live")})),K=pe(()=>l.value),ne=pe(()=>Pe.value?"__new-thread__":u.value),Je=pe(()=>{var R,Z;return Pe.value?fe.value.trim():((Z=(R=o.value)==null?void 0:R.cwd)==null?void 0:Z.trim())??""}),it=pe(()=>{var R;return!Pe.value&&((R=o.value)==null?void 0:R.inProgress)===!0}),kt=pe(()=>{var rt,vt;const R=[],Z=new Set;for(const Ye of g.value.order){const Dt=Ye.trim();!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:g.value.labels[Dt]||Ln(Dt)}))}for(const Ye of r.value){const Dt=((vt=(rt=Ye.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:s.value[Ye.projectName]??Ye.projectName}))}const Ee=fe.value.trim();return Ee&&!Z.has(Ee)&&R.unshift({value:Ee,label:Ln(Ee)}),R}),xt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;ir(()=>{window.addEventListener("keydown",ke),Bn(),xt==null||xt.addEventListener("change",Bn),Yr(),ks(),Cr(),sn()}),si(()=>{window.removeEventListener("keydown",ke),xt==null||xt.removeEventListener("change",Bn),B&&(clearTimeout(B),B=null),Rt()}),mt(H,R=>{const Z=R.trim();if(B&&(clearTimeout(B),B=null),!Z){D.value=null;return}B=setTimeout(()=>{u_(Z,1e3).then(Ee=>{H.value.trim()===Z&&(D.value=Ee.threadIds)}).catch(()=>{H.value.trim()===Z&&(D.value=null)})},220)});function ln(){z()}function Sr(){F.value=!F.value,F.value?tn(()=>{var R;return(R=x.value)==null?void 0:R.focus()}):H.value=""}function rn(){var R;H.value="",(R=x.value)==null||R.focus()}function Ne(R){R.key==="Escape"&&(F.value=!1,H.value="")}function Oe(R){R&&(Ge.name==="thread"&&Me.value===R||(et.push({name:"thread",params:{threadId:R}}),W.value&&Ae(!0)))}async function fn(R){R&&(u.value!==R&&(await j(R),await et.push({name:"thread",params:{threadId:R}})),await tn(),Ss())}function jt(R){de(R)}function Er(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";Ee&&(fe.value=Ee),W.value&&Ae(!0),!Pe.value&&et.push({name:"home"})}function _n(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Ee||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ee)}`,"_blank","noopener,noreferrer")}function kn(){var Z,Ee;const R=((Ee=(Z=o.value)==null?void 0:Z.cwd)==null?void 0:Ee.trim())??"";R&&(fe.value=R),W.value&&Ae(!0),!Pe.value&&et.push({name:"home"})}function _(R){It(R.projectName,R.displayName)}function S(R){ve(R.threadId,R.title)}function E(R){nt(R)}function q(R){Xe(R.projectName,R.toIndex)}function ge(R){oe(R.threadId,R.state)}function le(R){$e(R)}function Ae(R){A.value!==R&&(A.value=R,on(R))}function ke(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Ae(!A.value))}function We(R){const Z=R.text;if(Pe.value){mi(Z,R.imageUrls,R.skills,R.fileAttachments);return}Ie(Z,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function at(R){fe.value=R.trim()}async function lt(R){const Z=R.trim();if(!Z)return;const Ee=Mt(Z),rt=await Pt(),vt=Ee?Z:Kr(rt,Z);if(vt)try{const Ye=await a_(vt,{createIfMissing:!Ee,label:Ee?"":Z});Ye&&(fe.value=Ye,Ze(Ln(Ye)),Cr(),sn())}catch{}}async function Pt(){const R=Dn();if(R)return R;try{const Z=await $c();if(Z)return V.value=Z,Z}catch{}return""}function Mt(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function sn(){const R=Dn();if(!R){G.value="New Project (1)";return}try{const Z=await l_(R);G.value=Z.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Dn(){var Ee,rt;const R=fe.value.trim();if(R)return Gr(R);const Z=((rt=(Ee=kt.value[0])==null?void 0:Ee.value)==null?void 0:rt.trim())??"";return Z?Gr(Z):V.value.trim()}async function ks(){try{V.value=await $c()}catch{V.value=""}}async function Cr(){try{const R=await ga();g.value={order:[...R.order],labels:{...R.labels}}}catch{g.value={order:[],labels:{}}}}function Gr(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<=0?"":Z.slice(0,Ee)}function Ln(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<0?Z:Z.slice(Ee+1)}function Kr(R,Z){const Ee=R.trim().replace(/\/+$/,""),rt=Z.trim().replace(/^\/+/,"");return!Ee||!rt?"":`${Ee}/${rt}`}function Jr(R){Re(R)}function jn(R){Te(R)}function Ts(){ee()}function Is(R){ye(R.turnIndex)}function Ss(){if(Pe.value||Ve.value||typeof document>"u"||!o.value||U.value.length===0)return;const R=Ar(),Z=Rr(),Ee=new Blob([R],{type:"text/markdown;charset=utf-8"}),rt=URL.createObjectURL(Ee),vt=document.createElement("a");vt.href=rt,vt.download=Z,document.body.appendChild(vt),vt.click(),document.body.removeChild(vt),window.setTimeout(()=>URL.revokeObjectURL(rt),0)}function Ar(){var Ee,rt,vt;const R=[],Z=((rt=(Ee=o.value)==null?void 0:Ee.title)==null?void 0:rt.trim())||"Untitled thread";R.push(`# ${k(Z)}`),R.push(""),R.push(`- Exported: ${new Date().toISOString()}`),R.push(`- Thread ID: ${((vt=o.value)==null?void 0:vt.id)??""}`),R.push(""),R.push("---"),R.push("");for(const Ye of U.value){const Dt=Ye.role?Ye.role.toUpperCase():"MESSAGE";R.push(`## ${Dt}`),R.push("");const ho=Ye.text.trim();if(ho&&(R.push(ho),R.push("")),Ye.commandExecution&&(R.push("```text"),R.push(`command: ${Ye.commandExecution.command}`),R.push(`status: ${Ye.commandExecution.status}`),Ye.commandExecution.cwd&&R.push(`cwd: ${Ye.commandExecution.cwd}`),Ye.commandExecution.exitCode!==null&&R.push(`exitCode: ${Ye.commandExecution.exitCode}`),R.push(Ye.commandExecution.aggregatedOutput||"(no output)"),R.push("```"),R.push("")),Ye.fileAttachments&&Ye.fileAttachments.length>0){R.push("Attachments:");for(const Es of Ye.fileAttachments)R.push(`- ${Es.path}`);R.push("")}if(Ye.images&&Ye.images.length>0){R.push("Images:");for(const Es of Ye.images)R.push(`- ${Es}`);R.push("")}}return`${R.join(`
1428
+ `)}xt(d);const cr=ks(d);cr&&(Ln(we,cr),U(we,{label:"Running command",details:[((vl=cr.commandExecution)==null?void 0:vl.command)??""]}));const pi=Cr(d);if(pi){const qe=(i.value[we]??[]).find(Tn=>Tn.id===pi.itemId);qe!=null&&qe.commandExecution&&Ln(we,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${pi.delta}`}})}const hl=Gr(d);if(hl&&Ln(we,hl),Jr(d)&&(Ge&&n.value&&Je(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(we)),d.method==="turn/completed"){Ge=!1,rn(we),i.value[we]&&(i.value=Bt(i.value,we));const qe=jt(d);qe&&(Ve(qe,!1),U(qe,null),_t(qe),_e||($(qe),on(qe)))}}function Ts(d){const h=jt(d);h&&ht.add(h);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Ze=!0),!(Xe!==null||typeof window>"u")&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi))}async function Is(d){if(!Rt){Rt=!0;try{const h=await pa(),y=[];for(const C of h.order){const X=qi(C);y.includes(X)||y.push(X)}if(y.length>0){const C=wo(y,d);Br(I.value,C)||(I.value=C,es(I.value))}if(Object.keys(h.labels).length>0){const C={...M.value};let X=!1;for(const[Q,_e]of Object.entries(h.labels)){const Pe=qi(Q);C[Pe]!==_e&&(C[Pe]=_e,X=!0)}X&&(M.value=C,Wi(C))}}catch{}}}async function Ss(){if(!(Object.keys(ee.value).length>0))try{const d=await c_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Ar(d,h,y){if(ee.value[d])return;const C=h.trim();if(!C)return;const X=C.length>300?C.slice(0,300):C;try{const Q=await u_(X,y);if(!Q||ee.value[d])return;ee.value={...ee.value,[d]:Q},he(),$i(d,Q)}catch{}}async function Rr(){var d;It.value||(te.value=!0);try{const[h]=await Promise.all([Vb(),Ss()]);await Is(h);const y=wo(I.value,h);Br(I.value,y)||(I.value=y,es(I.value));const C=zi(h,I.value),X=IC(t.value,C,a.value);t.value=_o(t.value,X),a.value=Ft(a.value,new Set(gr(t.value).map(Pe=>Pe.id))),he(),It.value=!0;const Q=gr(e.value);Oe(Q),Q.some(Pe=>Pe.id===n.value)||A(((d=Q[0])==null?void 0:d.id)??"")}finally{te.value=!1}}async function k(d,h={}){if(!d)return;const y=j.value[d]===!0,C=h.silent!==!0&&!y;C&&(je.value=!0);try{q.value[d]!==!0&&(await Mi(d),q.value={...q.value,[d]:!0});const{messages:X,inProgress:Q}=await Wb(d),_e=r.value[d]??[],Pe=hC(_e,X,{preserveMissing:h.silent===!0});it(d,Pe);const we=s.value[d]??[],ot=pC(we,X);kt(d,ot),Kr(d,X),j.value={...j.value,[d]:!0};const St=ne(d);St&&(Y.value={...Y.value,[d]:St}),Ve(d,Q),Ke(d)}finally{C&&(je.value=!1)}}async function x(){try{const d=t.value.flatMap(h=>h.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await d_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function O(){Te.value="";try{await Rr(),await Promise.all([be(),x()]),await k(n.value)}catch(d){Te.value=d instanceof Error?d.message:"Unknown application error"}}async function J(d){A(d);try{await k(d)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Ue(d){try{await Kb(d),await Rr(),n.value===d&&await k(n.value)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Mt(d,h){const y=h.trim();if(!(!d||!y))try{await Jb(d,y),ee.value={...ee.value,[d]:y},he(),$i(d,y)}catch(C){Te.value=C instanceof Error?C.message:"Unknown application error"}}async function Zt(d,h=[],y=[],C="steer",X=[]){const Q=n.value,_e=d.trim();if(!Q||!_e&&h.length===0&&X.length===0)return;const Pe=a.value[Q]===!0;if(Pe&&C==="queue"){const we=l.value[Q]??[],ot=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[Q]:[...we,{id:ot,text:_e,imageUrls:h,skills:y,fileAttachments:X}]};return}if(Pe){Ge=!0,Un(Q,_e,h,y,X).catch(we=>{const ot=we instanceof Error?we.message:"Unknown application error";K(Q,ot),Te.value=ot});return}Te.value="",Ge=!0,xe(Q,null),U(Q,{label:"Thinking",details:V(f.value,p.value)}),K(Q,null),Ve(Q,!0);try{await Un(Q,_e,h,y,X)}catch(we){Ge=!1,Ve(Q,!1),U(Q,null);const ot=we instanceof Error?we.message:"Unknown application error";throw K(Q,ot),Te.value=ot,we}}async function Bn(d,h,y=[],C=[],X=[]){const Q=d.trim(),_e=h.trim(),Pe=f.value.trim();if(!Q&&y.length===0&&X.length===0)return"";Be.value=!0,Te.value="";let we="";try{try{we=await Mc(_e||void 0,Pe||void 0)}catch(Fn){if(Pe&&Pe!==un&&bo(Fn))await F(),we=await Mc(_e||void 0,un);else throw Fn}if(!we)return"";Se(we,_e,Q||"[Image]"),q.value={...q.value,[we]:!0},A(we),Ge=!0,xe(we,null),U(we,{label:"Thinking",details:V(f.value,p.value)}),K(we,null),Ve(we,!0);const ot=we,St=_e||null,Xr=Q;return Un(we,Q,y,C,X).catch(Fn=>{Ge=!1,Ve(we,!1),U(we,null);const cr=Fn instanceof Error?Fn.message:"Unknown application error";K(we,cr),Te.value=cr}).finally(()=>{Be.value=!1}),Ar(ot,Xr,St),we}catch(ot){Ge=!1,we&&(Ve(we,!1),U(we,null));const St=ot instanceof Error?ot.message:"Unknown application error";throw we&&K(we,St),Te.value=St,Be.value=!1,ot}}async function Un(d,h,y=[],C=[],X=[]){const Q=f.value.trim(),_e=p.value,Pe=h.trim(),we=C.map(St=>({name:St.name,path:St.path})),ot=X.map(St=>({...St}));P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!1});try{q.value[d]!==!0&&await Mi(d);try{await Ni(d,h,y,Q||void 0,_e||void 0,C.length>0?C:void 0,X)}catch(St){if(Q&&Q!==un&&bo(St))await F(),P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!0}),await Ni(d,h,y,un,_e||void 0,C.length>0?C:void 0,X);else throw St}q.value={...q.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(St){throw St}}async function on(d){const h=l.value[d];if(!h||h.length===0)return;const[y,...C]=h;l.value=C.length>0?{...l.value,[d]:C}:Bt(l.value,d),Be.value=!0,Te.value="",Ge=!0,xe(d,null),U(d,{label:"Thinking",details:V(f.value,p.value)}),K(d,null),Ve(d,!0);try{await Un(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Ve(d,!1),U(d,null)}finally{Be.value=!1}}async function lr(){const d=n.value;if(!d||a.value[d]!==!0)return;const h=ve.value[d];Qe.value=!0,Te.value="";try{await Xb(d,h),Ve(d,!1),U(d,null),K(d,null),ve.value[d]&&(ve.value=Bt(ve.value,d)),ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Failed to interrupt active turn";K(d,C),Te.value=C}finally{Qe.value=!1}}async function Yr(d){const h=n.value;if(!h||Re.value)return;const C=(r.value[h]??[]).reduce((Q,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>Q?_e.turnIndex:Q,-1);if(C<0||d>C)return;const X=C-d+1;if(!(X<1)){Re.value=!0,Te.value="";try{const Q=await Oc(h,X);it(h,Q),kt(h,[]),rn(h),i.value[h]&&(i.value=Bt(i.value,h)),xe(h,null),U(h,null),K(h,null),Ze=!0,await rt()}catch(Q){Te.value=Q instanceof Error?Q.message:"Failed to rollback thread"}finally{Re.value=!1}}}function Qr(d,h){d.length===0||(M.value[d]??"")===h||(M.value={...M.value,[d]:h},Wi(M.value))}function hi(d){var X;if(d.length===0)return;const h=I.value.filter(Q=>Q!==d);if(Br(I.value,h)||(I.value=h,es(I.value)),t.value=t.value.filter(Q=>Q.projectName!==d),M.value[d]!==void 0){const Q={...M.value};delete Q[d],M.value=Q,Wi(Q)}he();const y=gr(e.value);Oe(y),y.some(Q=>Q.id===n.value)||A(((X=y[0])==null?void 0:X.id)??""),Ee()}function R(d,h){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),C=y.indexOf(d);if(C===-1)return;const X=Math.max(0,Math.min(h,y.length-1)),Q=dC(y,C,X);if(Q===y)return;const _e=wo(Q,t.value);I.value=_e,es(I.value);const Pe=zi(t.value,I.value);t.value=_o(t.value,Pe),he(),Ee()}function Z(d){const h=d.trim();if(!h)return;const y=[h,...I.value.filter(X=>X!==h)];if(Br(I.value,y))return;I.value=y,es(I.value);const C=zi(t.value,I.value);t.value=_o(t.value,C),he(),Ee()}async function Ee(){var d,h;try{const y=await pa(),C=new Map;for(const _e of y.order){const Pe=qi(_e);C.has(Pe)||C.set(Pe,_e)}for(const _e of t.value){const Pe=((h=(d=_e.threads[0])==null?void 0:d.cwd)==null?void 0:h.trim())??"";Pe&&C.set(_e.projectName,Pe)}const X=[];for(const _e of I.value){const Pe=C.get(_e);Pe&&!X.includes(Pe)&&X.push(Pe)}for(const _e of y.order)X.includes(_e)||X.push(_e);const Q=y.active.filter(_e=>X.includes(_e));Q.length===0&&X.length>0&&Q.push(X[0]),await s_({order:X,labels:y.labels,active:Q})}catch{}}async function rt(){if($e.value){typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi));return}$e.value=!0;const d=Ze,h=new Set(ht);Ze=!1,ht.clear();try{d&&await Rr();const y=n.value;if(!y)return;const C=h.has(y),X=a.value[y]===!0,Q=ne(y),_e=Y.value[y]??"",Pe=Q.length>0&&Q!==_e;(C||X||Pe||d)&&await k(y,{silent:!0})}catch{}finally{$e.value=!1,(Ze||ht.size>0)&&typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi))}}function vt(){typeof window>"u"||nt||(Ye(),nt=zb(d=>{jn(d),Ts(d)}))}async function Ye(){try{const d=await Gb();for(const h of d){const y=kn(h);y&&b(y)}}catch{}}async function Dt(d){try{await qb(d.id,{result:d.result,error:d.error}),S(d.id)}catch(h){Te.value=h instanceof Error?h.message:"Failed to reply to server request"}}function fo(){nt&&(nt(),nt=null),Ze=!1,ht.clear(),et.clear(),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},B.value={},de.value={},ve.value={},l.value={}}const Es=pe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function fl(d){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const C=y.filter(X=>X.id!==d);l.value=C.length>0?{...l.value,[h]:C}:Bt(l.value,h)}function Yf(d){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const C=y.find(X=>X.id===d);C&&(fl(d),Zt(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:M,selectedThread:ie,selectedThreadScrollState:fe,selectedThreadServerRequests:De,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:p,installedSkills:ye,messages:v,isLoadingThreads:te,isLoadingMessages:je,isSendingMessage:Be,isInterruptingTurn:Qe,error:Te,refreshAll:O,refreshSkills:x,selectThread:J,setThreadScrollState:Je,archiveThreadById:Ue,renameThreadById:Mt,sendMessageToSelectedThread:Zt,sendMessageToNewThread:Bn,interruptSelectedThreadTurn:lr,rollbackSelectedThread:Yr,isRollingBack:Re,selectedThreadQueuedMessages:Es,removeQueuedMessage:fl,steerQueuedMessage:Yf,setSelectedModelId:H,setSelectedReasoningEffort:G,respondToPendingServerRequest:Dt,renameProject:Qr,removeProject:hi,reorderProject:R,pinProjectToTop:Z,startPolling:vt,stopPolling:fo}}const AC={class:"sidebar-root"},RC={class:"sidebar-scrollable"},PC=["aria-pressed"],xC={key:1,class:"sidebar-search-bar"},OC={key:0,class:"sidebar-settings-area"},MC={key:0,class:"sidebar-settings-panel"},NC={class:"sidebar-settings-value"},$C={class:"sidebar-settings-value"},DC={class:"content-root"},LC={class:"content-body"},jC={key:1,class:"content-grid"},BC={class:"new-thread-empty"},UC={class:"worktree-init-status-title"},FC={class:"worktree-init-status-message"},HC={key:2,class:"content-grid"},VC={class:"content-thread"},WC={class:"composer-with-queue"},zC={class:"build-badge","aria-label":"Worktree name and version"},mu="codex-web-local.sidebar-collapsed.v1",gu="codex-web-local.send-with-enter.v1",vu="codex-web-local.in-progress-send-mode.v1",yu="codex-web-local.dark-mode.v1",qC=Lt({__name:"App",setup(e){const t="850f",n="0.1.37",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:p,installedSkills:_,messages:N,isLoadingThreads:I,isLoadingMessages:M,isInterruptingTurn:Y,refreshAll:j,refreshSkills:q,selectThread:B,setThreadScrollState:oe,archiveThreadById:de,renameThreadById:ve,sendMessageToSelectedThread:Ie,sendMessageToNewThread:re,interruptSelectedThreadTurn:ee,rollbackSelectedThread:ye,isRollingBack:te,selectedThreadQueuedMessages:je,removeQueuedMessage:Be,steerQueuedMessage:Qe,setSelectedModelId:Re,setSelectedReasoningEffort:Te,respondToPendingServerRequest:$e,renameProject:It,removeProject:nt,reorderProject:Xe,pinProjectToTop:Ze,startPolling:ht,stopPolling:Rt}=CC(),Ge=Mg(),et=Og(),{isMobile:W}=Gd(),me=D(!1),ie=D(!1),fe=D(""),De=D("local"),g=D({order:[],labels:{}}),v=D({phase:"idle",title:"",message:""}),A=D(Un()),H=D(""),F=D(!1),P=D(null),$=D(null);let L=null;const G=D("New Project (1)"),V=D(""),be=D(!1),ae=D(x(gu,!0)),he=D(J()),Se=D(O()),Oe=pe(()=>{const R=Ge.params.threadId;return typeof R=="string"?R:""}),Ke=pe(()=>{const R=new Set;for(const Z of r.value)for(const Ee of Z.threads)R.add(Ee.id);return R}),xe=pe(()=>Ge.name==="home"),Ve=pe(()=>Ge.name==="skills"),_t=pe(()=>{var R;return Ve.value?"Skills":xe.value?"New thread":((R=o.value)==null?void 0:R.title)??"Choose a thread"}),U=pe(()=>N.value.filter(R=>{const Z=lr(R.messageType,R.role);return Z==="worked"?!0:!(Z==="turnActivity.live"||Z==="turnError.live"||Z==="agentReasoning.live")})),K=pe(()=>l.value),ne=pe(()=>xe.value?"__new-thread__":u.value),Je=pe(()=>{var R,Z;return xe.value?fe.value.trim():((Z=(R=o.value)==null?void 0:R.cwd)==null?void 0:Z.trim())??""}),it=pe(()=>{var R;return!xe.value&&((R=o.value)==null?void 0:R.inProgress)===!0}),kt=pe(()=>{var rt,vt;const R=[],Z=new Set;for(const Ye of g.value.order){const Dt=Ye.trim();!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:g.value.labels[Dt]||Ln(Dt)}))}for(const Ye of r.value){const Dt=((vt=(rt=Ye.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:s.value[Ye.projectName]??Ye.projectName}))}const Ee=fe.value.trim();return Ee&&!Z.has(Ee)&&R.unshift({value:Ee,label:Ln(Ee)}),R}),Pt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;ir(()=>{window.addEventListener("keydown",ke),Bn(),Pt==null||Pt.addEventListener("change",Bn),Yr(),ks(),Cr(),sn()}),ri(()=>{window.removeEventListener("keydown",ke),Pt==null||Pt.removeEventListener("change",Bn),L&&(clearTimeout(L),L=null),Rt()}),mt(H,R=>{const Z=R.trim();if(L&&(clearTimeout(L),L=null),!Z){$.value=null;return}L=setTimeout(()=>{l_(Z,1e3).then(Ee=>{H.value.trim()===Z&&($.value=Ee.threadIds)}).catch(()=>{H.value.trim()===Z&&($.value=null)})},220)});function ln(){q()}function Sr(){F.value=!F.value,F.value?tn(()=>{var R;return(R=P.value)==null?void 0:R.focus()}):H.value=""}function rn(){var R;H.value="",(R=P.value)==null||R.focus()}function Ne(R){R.key==="Escape"&&(F.value=!1,H.value="")}function Me(R){R&&(Ge.name==="thread"&&Oe.value===R||(et.push({name:"thread",params:{threadId:R}}),W.value&&Ae(!0)))}async function fn(R){R&&(u.value!==R&&(await B(R),await et.push({name:"thread",params:{threadId:R}})),await tn(),Ss())}function jt(R){de(R)}function Er(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";Ee&&(fe.value=Ee),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function _n(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Ee||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ee)}`,"_blank","noopener,noreferrer")}function kn(){var Z,Ee;const R=((Ee=(Z=o.value)==null?void 0:Z.cwd)==null?void 0:Ee.trim())??"";R&&(fe.value=R),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function b(R){It(R.projectName,R.displayName)}function S(R){ve(R.threadId,R.title)}function E(R){nt(R)}function z(R){Xe(R.projectName,R.toIndex)}function ge(R){oe(R.threadId,R.state)}function le(R){$e(R)}function Ae(R){A.value!==R&&(A.value=R,on(R))}function ke(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Ae(!A.value))}function We(R){const Z=R.text;if(xe.value){hi(Z,R.imageUrls,R.skills,R.fileAttachments);return}Ie(Z,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function at(R){fe.value=R.trim()}async function lt(R){const Z=R.trim();if(!Z)return;const Ee=Ot(Z),rt=await xt(),vt=Ee?Z:Kr(rt,Z);if(vt)try{const Ye=await o_(vt,{createIfMissing:!Ee,label:Ee?"":Z});Ye&&(fe.value=Ye,Ze(Ln(Ye)),Cr(),sn())}catch{}}async function xt(){const R=Dn();if(R)return R;try{const Z=await Nc();if(Z)return V.value=Z,Z}catch{}return""}function Ot(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function sn(){const R=Dn();if(!R){G.value="New Project (1)";return}try{const Z=await i_(R);G.value=Z.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Dn(){var Ee,rt;const R=fe.value.trim();if(R)return Gr(R);const Z=((rt=(Ee=kt.value[0])==null?void 0:Ee.value)==null?void 0:rt.trim())??"";return Z?Gr(Z):V.value.trim()}async function ks(){try{V.value=await Nc()}catch{V.value=""}}async function Cr(){try{const R=await pa();g.value={order:[...R.order],labels:{...R.labels}}}catch{g.value={order:[],labels:{}}}}function Gr(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<=0?"":Z.slice(0,Ee)}function Ln(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<0?Z:Z.slice(Ee+1)}function Kr(R,Z){const Ee=R.trim().replace(/\/+$/,""),rt=Z.trim().replace(/^\/+/,"");return!Ee||!rt?"":`${Ee}/${rt}`}function Jr(R){Re(R)}function jn(R){Te(R)}function Ts(){ee()}function Is(R){ye(R.turnIndex)}function Ss(){if(xe.value||Ve.value||typeof document>"u"||!o.value||U.value.length===0)return;const R=Ar(),Z=Rr(),Ee=new Blob([R],{type:"text/markdown;charset=utf-8"}),rt=URL.createObjectURL(Ee),vt=document.createElement("a");vt.href=rt,vt.download=Z,document.body.appendChild(vt),vt.click(),document.body.removeChild(vt),window.setTimeout(()=>URL.revokeObjectURL(rt),0)}function Ar(){var Ee,rt,vt;const R=[],Z=((rt=(Ee=o.value)==null?void 0:Ee.title)==null?void 0:rt.trim())||"Untitled thread";R.push(`# ${k(Z)}`),R.push(""),R.push(`- Exported: ${new Date().toISOString()}`),R.push(`- Thread ID: ${((vt=o.value)==null?void 0:vt.id)??""}`),R.push(""),R.push("---"),R.push("");for(const Ye of U.value){const Dt=Ye.role?Ye.role.toUpperCase():"MESSAGE";R.push(`## ${Dt}`),R.push("");const fo=Ye.text.trim();if(fo&&(R.push(fo),R.push("")),Ye.commandExecution&&(R.push("```text"),R.push(`command: ${Ye.commandExecution.command}`),R.push(`status: ${Ye.commandExecution.status}`),Ye.commandExecution.cwd&&R.push(`cwd: ${Ye.commandExecution.cwd}`),Ye.commandExecution.exitCode!==null&&R.push(`exitCode: ${Ye.commandExecution.exitCode}`),R.push(Ye.commandExecution.aggregatedOutput||"(no output)"),R.push("```"),R.push("")),Ye.fileAttachments&&Ye.fileAttachments.length>0){R.push("Attachments:");for(const Es of Ye.fileAttachments)R.push(`- ${Es.path}`);R.push("")}if(Ye.images&&Ye.images.length>0){R.push("Images:");for(const Es of Ye.images)R.push(`- ${Es}`);R.push("")}}return`${R.join(`
1443
1429
  `).trimEnd()}
1444
- `}function Rr(){var vt,Ye;const Ee=(((Ye=(vt=o.value)==null?void 0:vt.title)==null?void 0:Ye.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",rt=new Date().toISOString().replace(/[:.]/g,"-");return`${Ee}-${rt}.md`}function k(R){return R.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function P(R,Z){if(typeof window>"u")return Z;const Ee=window.localStorage.getItem(R);return Ee===null?Z:Ee==="1"}function M(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(bu);return R==="light"||R==="dark"?R:"system"}function J(){return typeof window>"u"?"queue":window.localStorage.getItem(wu)==="steer"?"steer":"queue"}function Ue(){ae.value=!ae.value,window.localStorage.setItem(yu,ae.value?"1":"0")}function Ot(){he.value=he.value==="steer"?"queue":"steer",window.localStorage.setItem(wu,he.value)}function Zt(){const R=["system","light","dark"],Z=R.indexOf(Se.value);Se.value=R[(Z+1)%R.length],window.localStorage.setItem(bu,Se.value),Bn()}function Bn(){const R=document.documentElement;if(Se.value==="dark")R.classList.add("dark");else if(Se.value==="light")R.classList.remove("dark");else{const Z=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",Z)}}function Un(){return typeof window>"u"?!1:window.localStorage.getItem(vu)==="1"}function on(R){typeof window>"u"||window.localStorage.setItem(vu,R?"1":"0")}function lr(R,Z){const Ee=(R??"").trim();return Ee.length>0?Ee:Z.trim()||"message"}async function Yr(){await $(),ie.value=!0,await Qr(),ht()}async function Qr(){if(!me.value){me.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await j("");return}if(Ge.name==="thread"){const R=Me.value;if(!R)return;if(!Ke.value.has(R)){await et.replace({name:"home"});return}u.value!==R&&await j(R);return}}finally{me.value=!1}}}mt(()=>[Ge.name,Me.value,I.value,Ke.value.has(Me.value),u.value],async()=>{ie.value&&await Qr()}),mt(()=>u.value,async R=>{if(ie.value&&!me.value&&!(Pe.value||Ve.value)){if(!R){Ge.name!=="home"&&await et.replace({name:"home"});return}Ge.name==="thread"&&Me.value===R||await et.replace({name:"thread",params:{threadId:R}})}}),mt(()=>kt.value,R=>{if(R.length===0){fe.value="";return}R.some(Ee=>Ee.value===fe.value)||(fe.value=R[0].value),sn()},{immediate:!0}),mt(()=>fe.value,()=>{v.value={phase:"idle",title:"",message:""},sn()}),mt(()=>De.value,R=>{R==="local"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>Ge.name,R=>{R!=="home"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),mt(W,R=>{R&&!A.value&&Ae(!0)});async function mi(R,Z=[],Ee=[],rt=[]){try{v.value={phase:"idle",title:"",message:""};let vt=fe.value;if(De.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await o_(fe.value);vt=Dt.cwd,fe.value=Dt.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ye=await re(R,vt,Z,Ee,rt);if(!Ye)return;await et.replace({name:"thread",params:{threadId:Ye}})}catch{}}return(R,Z)=>(w(),T(He,null,[Ce(Fg,{"is-sidebar-collapsed":A.value,onCloseSidebar:Z[6]||(Z[6]=Ee=>Ae(!0))},{sidebar:pt(()=>[m("section",OE,[m("div",NE,[A.value?se("",!0):(w(),yt(fu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[0]||(Z[0]=Ee=>Ae(!A.value)),onStartNewThread:kn},{default:pt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":F.value,"aria-label":"Search threads",title:"Search threads",onClick:Sr},[Ce(ya,{class:"sidebar-search-toggle-icon"})],8,$E)]),_:1},8,["is-sidebar-collapsed"])),!A.value&&F.value?(w(),T("div",DE,[Ce(ya,{class:"sidebar-search-bar-icon"}),tr(m("input",{ref_key:"sidebarSearchInputRef",ref:x,"onUpdate:modelValue":Z[1]||(Z[1]=Ee=>H.value=Ee),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ne},null,544),[[nr,H.value]]),H.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[Ce(Xa,{class:"sidebar-search-clear-icon"})])):se("",!0)])):se("",!0),A.value?se("",!0):(w(),T("button",{key:2,class:gt(["sidebar-skills-link",{"is-active":Ve.value}]),type:"button",onClick:Z[2]||(Z[2]=Ee=>{ue(et).push({name:"skills"}),ue(W)&&Ae(!0)})}," Skills Hub ",2)),A.value?se("",!0):(w(),yt(xy,{key:3,groups:ue(r),"project-display-name-by-id":ue(s),"selected-thread-id":ue(u),"is-loading":ue(I),"search-query":H.value,"search-matched-thread-ids":D.value,onSelect:Oe,onArchive:jt,onStartNewThread:Er,onRenameProject:_,onBrowseProjectFiles:_n,onRenameThread:S,onRemoveProject:E,onReorderProject:q,onExportThread:fn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),A.value?se("",!0):(w(),T("div",LE,[Ce(Dd,{name:"settings-panel"},{default:pt(()=>[be.value?(w(),T("div",jE,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Ue},[Z[7]||(Z[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:gt(["sidebar-settings-toggle",{"is-on":!ae.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Ot},[Z[8]||(Z[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",BE,ce(he.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Zt},[Z[9]||(Z[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",UE,ce(Se.value==="system"?"System":Se.value==="dark"?"Dark":"Light"),1)])])):se("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:Z[3]||(Z[3]=Ee=>be.value=!be.value)},[Ce(lE,{class:"sidebar-settings-icon"}),Z[10]||(Z[10]=m("span",null,"Settings",-1))])]))])]),content:pt(()=>[m("section",FE,[Ce(Dy,{title:_t.value},{leading:pt(()=>[A.value||ue(W)?(w(),yt(fu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[4]||(Z[4]=Ee=>Ae(!A.value)),onStartNewThread:kn},null,8,["is-sidebar-collapsed"])):se("",!0)]),_:1},8,["title"]),m("section",HE,[Ve.value?(w(),yt(GS,{key:0,onSkillsChanged:ln})):Pe.value?(w(),T("div",VE,[m("div",WE,[Z[11]||(Z[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(va,{class:"new-thread-folder-dropdown","model-value":fe.value,options:kt.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":G.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":at,onAdd:lt},null,8,["model-value","options","default-add-value"]),Ce(Yk,{class:"new-thread-runtime-dropdown",modelValue:De.value,"onUpdate:modelValue":Z[5]||(Z[5]=Ee=>De.value=Ee)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:gt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",zE,ce(v.value.title),1),m("span",qE,ce(v.value.message),1)],2)):se("",!0)]),Ce(Dc,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",GE,[m("div",KE,[Ce(bb,{messages:U.value,"is-loading":ue(O),"active-thread-id":ne.value,cwd:Je.value,"scroll-state":ue(i),"live-overlay":K.value,"pending-requests":ue(a),"is-turn-in-progress":it.value,"is-rolling-back":ue(te),onUpdateScrollState:ge,onRespondServerRequest:le,onRollback:Is},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",JE,[Ce(Hk,{messages:ue(je),onSteer:ue(Qe),onDelete:ue(Be)},null,8,["messages","onSteer","onDelete"]),Ce(Dc,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":it.value,"is-interrupting-turn":ue(Y),"has-queue-above":ue(je).length>0,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn,onInterrupt:Ts},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",YE," WT "+ce(ue(t))+" · v"+ce(ue(n)),1)],64))}}),XE=st(QE,[["__scopeId","data-v-f2b7f06b"]]),Ji={render:()=>null},ZE=Og({history:dg(),routes:[{path:"/",name:"home",component:Ji},{path:"/thread/:threadId",name:"thread",component:Ji},{path:"/skills",name:"skills",component:Ji},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Im(XE).use(ZE).mount("#app");
1430
+ `}function Rr(){var vt,Ye;const Ee=(((Ye=(vt=o.value)==null?void 0:vt.title)==null?void 0:Ye.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",rt=new Date().toISOString().replace(/[:.]/g,"-");return`${Ee}-${rt}.md`}function k(R){return R.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function x(R,Z){if(typeof window>"u")return Z;const Ee=window.localStorage.getItem(R);return Ee===null?Z:Ee==="1"}function O(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(yu);return R==="light"||R==="dark"?R:"system"}function J(){return typeof window>"u"?"queue":window.localStorage.getItem(vu)==="steer"?"steer":"queue"}function Ue(){ae.value=!ae.value,window.localStorage.setItem(gu,ae.value?"1":"0")}function Mt(){he.value=he.value==="steer"?"queue":"steer",window.localStorage.setItem(vu,he.value)}function Zt(){const R=["system","light","dark"],Z=R.indexOf(Se.value);Se.value=R[(Z+1)%R.length],window.localStorage.setItem(yu,Se.value),Bn()}function Bn(){const R=document.documentElement;if(Se.value==="dark")R.classList.add("dark");else if(Se.value==="light")R.classList.remove("dark");else{const Z=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",Z)}}function Un(){return typeof window>"u"?!1:window.localStorage.getItem(mu)==="1"}function on(R){typeof window>"u"||window.localStorage.setItem(mu,R?"1":"0")}function lr(R,Z){const Ee=(R??"").trim();return Ee.length>0?Ee:Z.trim()||"message"}async function Yr(){await j(),ie.value=!0,await Qr(),ht()}async function Qr(){if(!me.value){me.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await B("");return}if(Ge.name==="thread"){const R=Oe.value;if(!R)return;if(!Ke.value.has(R)){await et.replace({name:"home"});return}u.value!==R&&await B(R);return}}finally{me.value=!1}}}mt(()=>[Ge.name,Oe.value,I.value,Ke.value.has(Oe.value),u.value],async()=>{ie.value&&await Qr()}),mt(()=>u.value,async R=>{if(ie.value&&!me.value&&!(xe.value||Ve.value)){if(!R){Ge.name!=="home"&&await et.replace({name:"home"});return}Ge.name==="thread"&&Oe.value===R||await et.replace({name:"thread",params:{threadId:R}})}}),mt(()=>kt.value,R=>{if(R.length===0){fe.value="";return}R.some(Ee=>Ee.value===fe.value)||(fe.value=R[0].value),sn()},{immediate:!0}),mt(()=>fe.value,()=>{v.value={phase:"idle",title:"",message:""},sn()}),mt(()=>De.value,R=>{R==="local"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>Ge.name,R=>{R!=="home"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),mt(W,R=>{R&&!A.value&&Ae(!0)});async function hi(R,Z=[],Ee=[],rt=[]){try{v.value={phase:"idle",title:"",message:""};let vt=fe.value;if(De.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await r_(fe.value);vt=Dt.cwd,fe.value=Dt.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ye=await re(R,vt,Z,Ee,rt);if(!Ye)return;await et.replace({name:"thread",params:{threadId:Ye}})}catch{}}return(R,Z)=>(w(),T(He,null,[Ce(Bg,{"is-sidebar-collapsed":A.value,onCloseSidebar:Z[6]||(Z[6]=Ee=>Ae(!0))},{sidebar:pt(()=>[m("section",AC,[m("div",RC,[A.value?se("",!0):(w(),yt(uu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[0]||(Z[0]=Ee=>Ae(!A.value)),onStartNewThread:kn},{default:pt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":F.value,"aria-label":"Search threads",title:"Search threads",onClick:Sr},[Ce(ga,{class:"sidebar-search-toggle-icon"})],8,PC)]),_:1},8,["is-sidebar-collapsed"])),!A.value&&F.value?(w(),T("div",xC,[Ce(ga,{class:"sidebar-search-bar-icon"}),tr(m("input",{ref_key:"sidebarSearchInputRef",ref:P,"onUpdate:modelValue":Z[1]||(Z[1]=Ee=>H.value=Ee),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ne},null,544),[[nr,H.value]]),H.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[Ce(Ya,{class:"sidebar-search-clear-icon"})])):se("",!0)])):se("",!0),A.value?se("",!0):(w(),T("button",{key:2,class:gt(["sidebar-skills-link",{"is-active":Ve.value}]),type:"button",onClick:Z[2]||(Z[2]=Ee=>{ue(et).push({name:"skills"}),ue(W)&&Ae(!0)})}," Skills Hub ",2)),A.value?se("",!0):(w(),yt(Ay,{key:3,groups:ue(r),"project-display-name-by-id":ue(s),"selected-thread-id":ue(u),"is-loading":ue(I),"search-query":H.value,"search-matched-thread-ids":$.value,onSelect:Me,onArchive:jt,onStartNewThread:Er,onRenameProject:b,onBrowseProjectFiles:_n,onRenameThread:S,onRemoveProject:E,onReorderProject:z,onExportThread:fn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),A.value?se("",!0):(w(),T("div",OC,[Ce(Nd,{name:"settings-panel"},{default:pt(()=>[be.value?(w(),T("div",MC,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Ue},[Z[7]||(Z[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:gt(["sidebar-settings-toggle",{"is-on":!ae.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Mt},[Z[8]||(Z[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",NC,ce(he.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Zt},[Z[9]||(Z[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",$C,ce(Se.value==="system"?"System":Se.value==="dark"?"Dark":"Light"),1)])])):se("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:Z[3]||(Z[3]=Ee=>be.value=!be.value)},[Ce(rC,{class:"sidebar-settings-icon"}),Z[10]||(Z[10]=m("span",null,"Settings",-1))])]))])]),content:pt(()=>[m("section",DC,[Ce(Ny,{title:_t.value},{leading:pt(()=>[A.value||ue(W)?(w(),yt(uu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[4]||(Z[4]=Ee=>Ae(!A.value)),onStartNewThread:kn},null,8,["is-sidebar-collapsed"])):se("",!0)]),_:1},8,["title"]),m("section",LC,[Ve.value?(w(),yt(HE,{key:0,onSkillsChanged:ln})):xe.value?(w(),T("div",jC,[m("div",BC,[Z[11]||(Z[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ma,{class:"new-thread-folder-dropdown","model-value":fe.value,options:kt.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":G.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":at,onAdd:lt},null,8,["model-value","options","default-add-value"]),Ce(Kk,{class:"new-thread-runtime-dropdown",modelValue:De.value,"onUpdate:modelValue":Z[5]||(Z[5]=Ee=>De.value=Ee)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:gt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",UC,ce(v.value.title),1),m("span",FC,ce(v.value.message),1)],2)):se("",!0)]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(p),skills:ue(_),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",HC,[m("div",VC,[Ce(yb,{messages:U.value,"is-loading":ue(M),"active-thread-id":ne.value,cwd:Je.value,"scroll-state":ue(i),"live-overlay":K.value,"pending-requests":ue(a),"is-turn-in-progress":it.value,"is-rolling-back":ue(te),onUpdateScrollState:ge,onRespondServerRequest:le,onRollback:Is},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",WC,[Ce(Uk,{messages:ue(je),onSteer:ue(Qe),onDelete:ue(Be)},null,8,["messages","onSteer","onDelete"]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(p),skills:ue(_),"is-turn-in-progress":it.value,"is-interrupting-turn":ue(Y),"has-queue-above":ue(je).length>0,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn,onInterrupt:Ts},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",zC," WT "+ce(ue(t))+" · v"+ce(ue(n)),1)],64))}}),GC=st(qC,[["__scopeId","data-v-f2b7f06b"]]),Gi={render:()=>null},KC=xg({history:cg(),routes:[{path:"/",name:"home",component:Gi},{path:"/thread/:threadId",name:"thread",component:Gi},{path:"/skills",name:"skills",component:Gi},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");km(GC).use(KC).mount("#app");