codexapp 0.1.53 → 0.1.56

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.
@@ -1,1425 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
- * @vue/shared v3.5.31
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function Oa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const yt={},es=[],Dn=()=>{},Pu=()=>!1,qo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Go=e=>e.startsWith("onUpdate:"),Rt=Object.assign,Na=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ih=Object.prototype.hasOwnProperty,ut=(e,t)=>ih.call(e,t),Ue=Array.isArray,ts=e=>eo(e)==="[object Map]",xu=e=>eo(e)==="[object Set]",kl=e=>eo(e)==="[object Date]",Ge=e=>typeof e=="function",kt=e=>typeof e=="string",_n=e=>typeof e=="symbol",ht=e=>e!==null&&typeof e=="object",Mu=e=>(ht(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Ou=Object.prototype.toString,eo=e=>Ou.call(e),ah=e=>eo(e).slice(8,-1),Nu=e=>eo(e)==="[object Object]",$a=e=>kt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xs=Oa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ko=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},lh=/-\w/g,Xt=Ko(e=>e.replace(lh,t=>t.slice(1).toUpperCase())),ch=/\B([A-Z])/g,Ir=Ko(e=>e.replace(ch,"-$1").toLowerCase()),Jo=Ko(e=>e.charAt(0).toUpperCase()+e.slice(1)),_i=Ko(e=>e?`on${Jo(e)}`:""),Mn=(e,t)=>!Object.is(e,t),wo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},$u=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Da=e=>{const t=parseFloat(e);return isNaN(t)?e:t},uh=e=>{const t=kt(e)?Number(e):NaN;return isNaN(t)?e:t};let Tl;const Yo=()=>Tl||(Tl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Wr(e){if(Ue(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=kt(r)?ph(r):Wr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(kt(e)||ht(e))return e}const dh=/;(?![^(]*\))/g,fh=/:([^]+)/,hh=/\/\*[^]*?\*\//g;function ph(e){const t={};return e.replace(hh,"").split(dh).forEach(n=>{if(n){const r=n.split(fh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(kt(e))t=e;else if(Ue(e))for(let n=0;n<e.length;n++){const r=it(e[n]);r&&(t+=r+" ")}else if(ht(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const mh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",gh=Oa(mh);function Du(e){return!!e||e===""}function vh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=La(e[r],t[r]);return n}function La(e,t){if(e===t)return!0;let n=kl(e),r=kl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=_n(e),r=_n(t),n||r)return e===t;if(n=Ue(e),r=Ue(t),n||r)return n&&r?vh(e,t):!1;if(n=ht(e),r=ht(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||!La(e[i],t[i]))return!1}}return String(e)===String(t)}const Lu=e=>!!(e&&e.__v_isRef===!0),se=e=>kt(e)?e:e==null?"":Ue(e)||ht(e)&&(e.toString===Ou||!Ge(e.toString))?Lu(e)?se(e.value):JSON.stringify(e,ju,2):String(e),ju=(e,t)=>Lu(t)?ju(e,t.value):ts(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[ki(r,o)+" =>"]=s,n),{})}:xu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ki(n))}:_n(t)?ki(t):ht(t)&&!Ue(t)&&!Nu(t)?String(t):t,ki=(e,t="")=>{var n;return _n(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
- * @vue/reactivity v3.5.31
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let tn;class yh{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=tn,!t&&tn&&(this.index=(tn.scopes||(tn.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=tn;try{return tn=this,t()}finally{tn=n}}}on(){++this._on===1&&(this.prevScope=tn,tn=this)}off(){this._on>0&&--this._on===0&&(tn=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 wh(){return tn}let wt;const Ti=new WeakSet;class Uu{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,tn&&tn.active&&tn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ti.has(this)&&(Ti.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Fu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Sl(this),Hu(this);const t=wt,n=yn;wt=this,yn=!0;try{return this.fn()}finally{Vu(this),wt=t,yn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ba(t);this.deps=this.depsTail=void 0,Sl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ti.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ta(this)&&this.run()}get dirty(){return ta(this)}}let Bu=0,Ms,Os;function Fu(e,t=!1){if(e.flags|=8,t){e.next=Os,Os=e;return}e.next=Ms,Ms=e}function ja(){Bu++}function Ua(){if(--Bu>0)return;if(Os){let t=Os;for(Os=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ms;){let t=Ms;for(Ms=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Hu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Vu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Ba(r),bh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ta(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Wu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Wu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Bs)||(e.globalVersion=Bs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ta(e))))return;e.flags|=2;const t=e.dep,n=wt,r=yn;wt=e,yn=!0;try{Hu(e);const s=e.fn(e._value);(t.version===0||Mn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{wt=n,yn=r,Vu(e),e.flags&=-3}}function Ba(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)Ba(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function bh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let yn=!0;const zu=[];function Qn(){zu.push(yn),yn=!1}function Zn(){const e=zu.pop();yn=e===void 0?!0:e}function Sl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=wt;wt=void 0;try{t()}finally{wt=n}}}let Bs=0;class _h{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fa{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(!wt||!yn||wt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==wt)n=this.activeLink=new _h(wt,this),wt.deps?(n.prevDep=wt.depsTail,wt.depsTail.nextDep=n,wt.depsTail=n):wt.deps=wt.depsTail=n,qu(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=wt.depsTail,n.nextDep=void 0,wt.depsTail.nextDep=n,wt.depsTail=n,wt.deps===n&&(wt.deps=r)}return n}trigger(t){this.version++,Bs++,this.notify(t)}notify(t){ja();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ua()}}}function qu(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)qu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const na=new WeakMap,Fr=Symbol(""),ra=Symbol(""),Fs=Symbol("");function Vt(e,t,n){if(yn&&wt){let r=na.get(e);r||na.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Fa),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=na.get(e);if(!i){Bs++;return}const a=l=>{l&&l.trigger()};if(ja(),t==="clear")i.forEach(a);else{const l=Ue(e),u=l&&$a(n);if(l&&n==="length"){const c=Number(r);i.forEach((h,y)=>{(y==="length"||y===Fs||!_n(y)&&y>=c)&&a(h)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Fs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Fr)),ts(e)&&a(i.get(ra)));break;case"delete":l||(a(i.get(Fr)),ts(e)&&a(i.get(ra)));break;case"set":ts(e)&&a(i.get(Fr));break}}Ua()}function Jr(e){const t=lt(e);return t===e?t:(Vt(t,"iterate",Fs),pn(e)?t:t.map(kn))}function Xo(e){return Vt(e=lt(e),"iterate",Fs),e}function Pn(e,t){return er(e)?cs(Hr(e)?kn(t):t):kn(t)}const kh={__proto__:null,[Symbol.iterator](){return Si(this,Symbol.iterator,e=>Pn(this,e))},concat(...e){return Jr(this).concat(...e.map(t=>Ue(t)?Jr(t):t))},entries(){return Si(this,"entries",e=>(e[1]=Pn(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=>Pn(this,r)),arguments)},find(e,t){return Hn(this,"find",e,t,n=>Pn(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=>Pn(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 Ii(this,"includes",e)},indexOf(...e){return Ii(this,"indexOf",e)},join(e){return Jr(this).join(e)},lastIndexOf(...e){return Ii(this,"lastIndexOf",e)},map(e,t){return Hn(this,"map",e,t,void 0,arguments)},pop(){return Ts(this,"pop")},push(...e){return Ts(this,"push",e)},reduce(e,...t){return Il(this,"reduce",e,t)},reduceRight(e,...t){return Il(this,"reduceRight",e,t)},shift(){return Ts(this,"shift")},some(e,t){return Hn(this,"some",e,t,void 0,arguments)},splice(...e){return Ts(this,"splice",e)},toReversed(){return Jr(this).toReversed()},toSorted(e){return Jr(this).toSorted(e)},toSpliced(...e){return Jr(this).toSpliced(...e)},unshift(...e){return Ts(this,"unshift",e)},values(){return Si(this,"values",e=>Pn(this,e))}};function Si(e,t,n){const r=Xo(e),s=r[t]();return r!==e&&!pn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Th=Array.prototype;function Hn(e,t,n,r,s,o){const i=Xo(e),a=i!==e&&!pn(e),l=i[t];if(l!==Th[t]){const h=l.apply(e,o);return a?kn(h):h}let u=n;i!==e&&(a?u=function(h,y){return n.call(this,Pn(e,h),y,e)}:n.length>2&&(u=function(h,y){return n.call(this,h,y,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function Il(e,t,n,r){const s=Xo(e),o=s!==e&&!pn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,h){return a&&(a=!1,u=Pn(e,u)),n.call(this,u,Pn(e,c),h,e)}):n.length>3&&(i=function(u,c,h){return n.call(this,u,c,h,e)}));const l=s[t](i,...r);return a?Pn(e,l):l}function Ii(e,t,n){const r=lt(e);Vt(r,"iterate",Fs);const s=r[t](...n);return(s===-1||s===!1)&&Wa(n[0])?(n[0]=lt(n[0]),r[t](...n)):s}function Ts(e,t,n=[]){Qn(),ja();const r=lt(e)[t].apply(e,n);return Ua(),Zn(),r}const Sh=Oa("__proto__,__v_isRef,__isVue"),Gu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(_n));function Ih(e){_n(e)||(e=String(e));const t=lt(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Ku{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?$h:Qu:o?Xu:Yu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ue(t);if(!s){let l;if(i&&(l=kh[n]))return l;if(n==="hasOwnProperty")return Ih}const a=Reflect.get(t,n,qt(t)?t:r);if((_n(n)?Gu.has(n):Sh(n))||(s||Vt(t,"get",n),o))return a;if(qt(a)){const l=i&&$a(n)?a:a.value;return s&&ht(l)?oa(l):l}return ht(a)?s?oa(a):Qo(a):a}}class Ju extends Ku{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Ue(t)&&$a(n);if(!this._isShallow){const u=er(o);if(!pn(r)&&!er(r)&&(o=lt(o),r=lt(r)),!i&&qt(o)&&!qt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:ut(t,n),l=Reflect.set(t,n,r,qt(t)?t:s);return t===lt(s)&&(a?Mn(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=ut(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(!_n(n)||!Gu.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Ue(t)?"length":Fr),Reflect.ownKeys(t)}}class Eh extends Ku{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Ch=new Ju,Ah=new Eh,Rh=new Ju(!0);const sa=e=>e,co=e=>Reflect.getPrototypeOf(e);function Ph(e,t,n){return function(...r){const s=this.__v_raw,o=lt(s),i=ts(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?sa:t?cs:kn;return!t&&Vt(o,"iterate",l?ra:Fr),Rt(Object.create(u),{next(){const{value:h,done:y}=u.next();return y?{value:h,done:y}:{value:a?[c(h[0]),c(h[1])]:c(h),done:y}}})}}function uo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function xh(e,t){const n={get(s){const o=this.__v_raw,i=lt(o),a=lt(s);e||(Mn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=co(i),u=t?sa:e?cs:kn;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(lt(s),"iterate",Fr),s.size},has(s){const o=this.__v_raw,i=lt(o),a=lt(s);return e||(Mn(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=lt(a),u=t?sa:e?cs:kn;return!e&&Vt(l,"iterate",Fr),a.forEach((c,h)=>s.call(o,u(c),u(h),i))}};return Rt(n,e?{add:uo("add"),set:uo("set"),delete:uo("delete"),clear:uo("clear")}:{add(s){const o=lt(this),i=co(o),a=lt(s),l=!t&&!pn(s)&&!er(s)?a:s;return i.has.call(o,l)||Mn(s,l)&&i.has.call(o,s)||Mn(a,l)&&i.has.call(o,a)||(o.add(l),Gn(o,"add",l,l)),this},set(s,o){!t&&!pn(o)&&!er(o)&&(o=lt(o));const i=lt(this),{has:a,get:l}=co(i);let u=a.call(i,s);u||(s=lt(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Mn(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=lt(this),{has:i,get:a}=co(o);let l=i.call(o,s);l||(s=lt(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=lt(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]=Ph(s,e,t)}),n}function Ha(e,t){const n=xh(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(ut(n,s)&&s in r?n:r,s,o)}const Mh={get:Ha(!1,!1)},Oh={get:Ha(!1,!0)},Nh={get:Ha(!0,!1)};const Yu=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,$h=new WeakMap;function Dh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Lh(e){return e.__v_skip||!Object.isExtensible(e)?0:Dh(ah(e))}function Qo(e){return er(e)?e:Va(e,!1,Ch,Mh,Yu)}function Zu(e){return Va(e,!1,Rh,Oh,Xu)}function oa(e){return Va(e,!0,Ah,Nh,Qu)}function Va(e,t,n,r,s){if(!ht(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Lh(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 Hr(e){return er(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function er(e){return!!(e&&e.__v_isReadonly)}function pn(e){return!!(e&&e.__v_isShallow)}function Wa(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function jh(e){return!ut(e,"__v_skip")&&Object.isExtensible(e)&&$u(e,"__v_skip",!0),e}const kn=e=>ht(e)?Qo(e):e,cs=e=>ht(e)?oa(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function N(e){return ed(e,!1)}function Uh(e){return ed(e,!0)}function ed(e,t){return qt(e)?e:new Bh(e,t)}class Bh{constructor(t,n){this.dep=new Fa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:kn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||pn(t)||er(t);t=r?t:lt(t),Mn(t,n)&&(this._rawValue=t,this._value=r?t:kn(t),this.dep.trigger())}}function ge(e){return qt(e)?e.value:e}const Fh={get:(e,t,n)=>t==="__v_raw"?e:ge(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 td(e){return Hr(e)?e:new Proxy(e,Fh)}class Hh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Fa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Bs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&wt!==this)return Fu(this,!0),!0}get value(){const t=this.dep.track();return Wu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Vh(e,t,n=!1){let r,s;return Ge(e)?r=e:(r=e.get,s=e.set),new Hh(r,s,n)}const fo={},Ro=new WeakMap;let $r;function Wh(e,t=!1,n=$r){if(n){let r=Ro.get(n);r||Ro.set(n,r=[]),r.push(e)}}function zh(e,t,n=yt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=G=>s?G:pn(G)||s===!1||s===0?Kn(G,1):Kn(G);let c,h,y,S,L=!1,R=!1;if(qt(e)?(h=()=>e.value,L=pn(e)):Hr(e)?(h=()=>u(e),L=!0):Ue(e)?(R=!0,L=e.some(G=>Hr(G)||pn(G)),h=()=>e.map(G=>{if(qt(G))return G.value;if(Hr(G))return u(G);if(Ge(G))return l?l(G,2):G()})):Ge(e)?t?h=l?()=>l(e,2):e:h=()=>{if(y){Qn();try{y()}finally{Zn()}}const G=$r;$r=c;try{return l?l(e,3,[S]):e(S)}finally{$r=G}}:h=Dn,t&&s){const G=h,ce=s===!0?1/0:s;h=()=>Kn(G(),ce)}const q=wh(),Y=()=>{c.stop(),q&&q.active&&Na(q.effects,c)};if(o&&t){const G=t;t=(...ce)=>{G(...ce),Y()}}let F=R?new Array(e.length).fill(fo):fo;const J=G=>{if(!(!(c.flags&1)||!c.dirty&&!G))if(t){const ce=c.run();if(s||L||(R?ce.some((ue,me)=>Mn(ue,F[me])):Mn(ce,F))){y&&y();const ue=$r;$r=c;try{const me=[ce,F===fo?void 0:R&&F[0]===fo?[]:F,S];F=ce,l?l(t,3,me):t(...me)}finally{$r=ue}}}else c.run()};return a&&a(J),c=new Uu(h),c.scheduler=i?()=>i(J,!1):J,S=G=>Wh(G,!1,c),y=c.onStop=()=>{const G=Ro.get(c);if(G){if(l)l(G,4);else for(const ce of G)ce();Ro.delete(c)}},t?r?J(!0):F=c.run():i?i(J.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||!ht(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(Ue(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(xu(e)||ts(e))e.forEach(r=>{Kn(r,t,n)});else if(Nu(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
- * @vue/runtime-core v3.5.31
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/function to(e,t,n,r){try{return r?e(...r):e()}catch(s){Zo(s,t,n)}}function Tn(e,t,n,r){if(Ge(e)){const s=to(e,t,n,r);return s&&Mu(s)&&s.catch(o=>{Zo(o,t,n)}),s}if(Ue(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Tn(e[o],t,n,r));return s}}function Zo(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||yt;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 h=0;h<c.length;h++)if(c[h](e,l,u)===!1)return}a=a.parent}if(o){Qn(),to(o,null,10,[e,l,u]),Zn();return}}qh(e,n,s,r,i)}function qh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let An=-1;const ns=[];let gr=null,Xr=0;const nd=Promise.resolve();let Po=null;function $t(e){const t=Po||nd;return e?t.then(this?e.bind(this):e):t}function Gh(e){let t=An+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=Hs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function za(e){if(!(e.flags&1)){const t=Hs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=Hs(n)?Jt.push(e):Jt.splice(Gh(t),0,e),e.flags|=1,rd()}}function rd(){Po||(Po=nd.then(od))}function Kh(e){Ue(e)?ns.push(...e):gr&&e.id===-1?gr.splice(Xr+1,0,e):e.flags&1||(ns.push(e),e.flags|=1),rd()}function El(e,t,n=An+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 sd(e){if(ns.length){const t=[...new Set(ns)].sort((n,r)=>Hs(n)-Hs(r));if(ns.length=0,gr){gr.push(...t);return}for(gr=t,Xr=0;Xr<gr.length;Xr++){const n=gr[Xr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}gr=null,Xr=0}}const Hs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function od(e){try{for(An=0;An<Jt.length;An++){const t=Jt[An];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),to(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;An<Jt.length;An++){const t=Jt[An];t&&(t.flags&=-2)}An=-1,Jt.length=0,sd(),Po=null,(Jt.length||ns.length)&&od()}}let Dt=null,id=null;function xo(e){const t=Dt;return Dt=e,id=e&&e.type.__scopeId||null,t}function mt(e,t=Dt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&$o(-1);const o=xo(t);let i;try{i=e(...s)}finally{xo(o),r._d&&$o(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Dt===null)return e;const n=oi(Dt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=yt]=t[s];o&&(Ge(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&&(Qn(),Tn(l,n,8,[e.el,a,e,t]),Zn())}}function bo(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 wn(e,t,n=!1){const r=Ya();if(r||ss){let s=ss?ss._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&&Ge(t)?t.call(r&&r.proxy):t}}const Jh=Symbol.for("v-scx"),Yh=()=>wn(Jh);function ft(e,t,n){return ad(e,t,n)}function ad(e,t,n=yt){const{immediate:r,deep:s,flush:o,once:i}=n,a=Rt({},n),l=t&&r||!t&&o!=="post";let u;if(Gs){if(o==="sync"){const S=Yh();u=S.__watcherHandles||(S.__watcherHandles=[])}else if(!l){const S=()=>{};return S.stop=Dn,S.resume=Dn,S.pause=Dn,S}}const c=zt;a.call=(S,L,R)=>Tn(S,c,L,R);let h=!1;o==="post"?a.scheduler=S=>{Ht(S,c&&c.suspense)}:o!=="sync"&&(h=!0,a.scheduler=(S,L)=>{L?S():za(S)}),a.augmentJob=S=>{t&&(S.flags|=4),h&&(S.flags|=2,c&&(S.id=c.uid,S.i=c))};const y=zh(e,t,a);return Gs&&(u?u.push(y):l&&y()),y}function Xh(e,t,n){const r=this.proxy,s=kt(e)?e.includes(".")?ld(r,e):()=>r[e]:e.bind(r,r);let o;Ge(t)?o=t:(o=t.handler,n=t);const i=no(this),a=ad(s,o.bind(r),n);return i(),a}function ld(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 cd=Symbol("_vte"),ud=e=>e.__isTeleport,Ns=e=>e&&(e.disabled||e.disabled===""),Qh=e=>e&&(e.defer||e.defer===""),Cl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Al=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ia=(e,t)=>{const n=e&&e.to;return kt(n)?t?t(n):null:n},dd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:h,pbc:y,o:{insert:S,querySelector:L,createText:R,createComment:q}}=u,Y=Ns(t.props);let{shapeFlag:F,children:J,dynamicChildren:G}=t;if(e==null){const ce=t.el=R(""),ue=t.anchor=R("");S(ce,n,r),S(ue,n,r);const me=(le,ee)=>{F&16&&c(J,le,ee,s,o,i,a,l)},Se=()=>{const le=t.target=ia(t.props,L),ee=aa(le,t,R,S);le&&(i!=="svg"&&Cl(le)?i="svg":i!=="mathml"&&Al(le)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(le),Y||(me(le,ee),_o(t,!1)))};Y&&(me(n,ue),_o(t,!0)),Qh(t.props)||o&&o.pendingBranch?(t.el.__isMounted=!1,Ht(()=>{t.el.__isMounted===!1&&(Se(),delete t.el.__isMounted)},o)):Se()}else{t.el=e.el,t.targetStart=e.targetStart;const ce=t.anchor=e.anchor,ue=t.target=e.target,me=t.targetAnchor=e.targetAnchor;if(e.el.__isMounted===!1){Ht(()=>{dd.process(e,t,n,r,s,o,i,a,l,u)},o);return}const Se=Ns(e.props),le=Se?n:ue,ee=Se?ce:me;if(i==="svg"||Cl(ue)?i="svg":(i==="mathml"||Al(ue))&&(i="mathml"),G?(y(e.dynamicChildren,G,le,s,o,i,a),Ka(e,t,!0)):l||h(e,t,le,ee,s,o,i,a,!1),Y)Se?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ho(t,n,ce,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ne=t.target=ia(t.props,L);ne&&ho(t,ne,null,u,0)}else Se&&ho(t,ue,me,u,1);_o(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:h,props:y}=e;if(h&&(s(u),s(c)),o&&s(l),i&16){const S=o||!Ns(y);for(let L=0;L<a.length;L++){const R=a[L];r(R,t,n,S,!!R.dynamicChildren)}}},move:ho,hydrate:Zh};function ho(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,h=o===2;if(h&&r(i,t,n),(!h||Ns(c))&&l&16)for(let y=0;y<u.length;y++)s(u[y],t,n,2);h&&r(a,t,n)}function Zh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},h){function y(q,Y){let F=Y;for(;F;){if(F&&F.nodeType===8){if(F.data==="teleport start anchor")t.targetStart=F;else if(F.data==="teleport anchor"){t.targetAnchor=F,q._lpa=t.targetAnchor&&i(t.targetAnchor);break}}F=i(F)}}function S(q,Y){Y.anchor=h(i(q),Y,a(q),n,r,s,o)}const L=t.target=ia(t.props,l),R=Ns(t.props);if(L){const q=L._lpa||L.firstChild;t.shapeFlag&16&&(R?(S(e,t),y(L,q),t.targetAnchor||aa(L,t,c,u,a(e)===L?e:null)):(t.anchor=i(e),y(L,q),t.targetAnchor||aa(L,t,c,u),h(q&&i(q),t,L,n,r,s,o))),_o(t,R)}else R&&t.shapeFlag&16&&(S(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Mo=dd;function _o(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 aa(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[cd]=i,e&&(r(o,e,s),r(i,e,s)),i}const Rn=Symbol("_leaveCb"),Ss=Symbol("_enterCb");function ep(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ir(()=>{e.isMounted=!0}),ar(()=>{e.isUnmounting=!0}),e}const fn=[Function,Array],fd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},hd=e=>{const t=e.subTree;return t.component?hd(t.component):t},tp={name:"BaseTransition",props:fd,setup(e,{slots:t}){const n=Ya(),r=ep();return()=>{const s=t.default&&gd(t.default(),!0);if(!s||!s.length)return;const o=pd(s),i=lt(e),{mode:a}=i;if(r.isLeaving)return Ei(o);const l=Rl(o);if(!l)return Ei(o);let u=la(l,i,r,n,h=>u=h);l.type!==Wt&&Vs(l,u);let c=n.subTree&&Rl(n.subTree);if(c&&c.type!==Wt&&!Lr(c,l)&&hd(n).type!==Wt){let h=la(c,i,r,n);if(Vs(c,h),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,h.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete h.afterLeave,c=void 0},Ei(o);a==="in-out"&&l.type!==Wt?h.delayLeave=(y,S,L)=>{const R=md(r,c);R[String(c.key)]=c,y[Rn]=()=>{S(),y[Rn]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{L(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function pd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const np=tp;function md(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 la(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:h,onBeforeLeave:y,onLeave:S,onAfterLeave:L,onLeaveCancelled:R,onBeforeAppear:q,onAppear:Y,onAfterAppear:F,onAppearCancelled:J}=t,G=String(e.key),ce=md(n,e),ue=(le,ee)=>{le&&Tn(le,r,9,ee)},me=(le,ee)=>{const ne=ee[1];ue(le,ee),Ue(le)?le.every(X=>X.length<=1)&&ne():le.length<=1&&ne()},Se={mode:i,persisted:a,beforeEnter(le){let ee=l;if(!n.isMounted)if(o)ee=q||l;else return;le[Rn]&&le[Rn](!0);const ne=ce[G];ne&&Lr(e,ne)&&ne.el[Rn]&&ne.el[Rn](),ue(ee,[le])},enter(le){if(ce[G]===e)return;let ee=u,ne=c,X=h;if(!n.isMounted)if(o)ee=Y||u,ne=F||c,X=J||h;else return;let Ee=!1;le[Ss]=$e=>{Ee||(Ee=!0,$e?ue(X,[le]):ue(ne,[le]),Se.delayedLeave&&Se.delayedLeave(),le[Ss]=void 0)};const we=le[Ss].bind(null,!1);ee?me(ee,[le,we]):we()},leave(le,ee){const ne=String(e.key);if(le[Ss]&&le[Ss](!0),n.isUnmounting)return ee();ue(y,[le]);let X=!1;le[Rn]=we=>{X||(X=!0,ee(),we?ue(R,[le]):ue(L,[le]),le[Rn]=void 0,ce[ne]===e&&delete ce[ne])};const Ee=le[Rn].bind(null,!1);ce[ne]=e,S?me(S,[le,Ee]):Ee()},clone(le){const ee=la(le,t,n,r,s);return s&&s(ee),ee}};return Se}function Ei(e){if(ei(e))return e=Sr(e),e.children=null,e}function Rl(e){if(!ei(e))return ud(e.type)&&e.children?pd(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ge(n.default))return n.default()}}function Vs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vs(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 gd(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===je?(i.patchFlag&128&&s++,r=r.concat(gd(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?Sr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function xt(e,t){return Ge(e)?Rt({name:e.name},t,{setup:e}):e}function vd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Pl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Oo=new WeakMap;function $s(e,t,n,r,s=!1){if(Ue(e)){e.forEach((R,q)=>$s(R,t&&(Ue(t)?t[q]:t),n,r,s));return}if(rs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&$s(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?oi(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===yt?a.refs={}:a.refs,h=a.setupState,y=lt(h),S=h===yt?Pu:R=>Pl(c,R)?!1:ut(y,R),L=(R,q)=>!(q&&Pl(c,q));if(u!=null&&u!==l){if(xl(t),kt(u))c[u]=null,S(u)&&(h[u]=null);else if(qt(u)){const R=t;L(u,R.k)&&(u.value=null),R.k&&(c[R.k]=null)}}if(Ge(l))to(l,a,12,[i,c]);else{const R=kt(l),q=qt(l);if(R||q){const Y=()=>{if(e.f){const F=R?S(l)?h[l]:c[l]:L()||!e.k?l.value:c[e.k];if(s)Ue(F)&&Na(F,o);else if(Ue(F))F.includes(o)||F.push(o);else if(R)c[l]=[o],S(l)&&(h[l]=c[l]);else{const J=[o];L(l,e.k)&&(l.value=J),e.k&&(c[e.k]=J)}}else R?(c[l]=i,S(l)&&(h[l]=i)):q&&(L(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const F=()=>{Y(),Oo.delete(e)};F.id=-1,Oo.set(e,F),Ht(F,n)}else xl(e),Y()}}}function xl(e){const t=Oo.get(e);t&&(t.flags|=8,Oo.delete(e))}Yo().requestIdleCallback;Yo().cancelIdleCallback;const rs=e=>!!e.type.__asyncLoader,ei=e=>e.type.__isKeepAlive;function rp(e,t){yd(e,"a",t)}function sp(e,t){yd(e,"da",t)}function yd(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(ti(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ei(s.parent.vnode)&&op(r,t,n,s),s=s.parent}}function op(e,t,n,r){const s=ti(t,e,r,!0);ni(()=>{Na(r[t],s)},n)}function ti(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Qn();const a=no(n),l=Tn(t,n,e,i);return a(),Zn(),l});return r?s.unshift(o):s.push(o),o}}const or=e=>(t,n=zt)=>{(!Gs||e==="sp")&&ti(e,(...r)=>t(...r),n)},ip=or("bm"),ir=or("m"),ap=or("bu"),lp=or("u"),ar=or("bum"),ni=or("um"),cp=or("sp"),up=or("rtg"),dp=or("rtc");function fp(e,t=zt){ti("ec",e,t)}const hp="components",wd=Symbol.for("v-ndc");function ca(e){return kt(e)?pp(hp,e,!1)||e:e||wd}function pp(e,t,n=!0,r=!1){const s=Dt||zt;if(s){const o=s.type;{const a=Qp(o,!1);if(a&&(a===t||a===Xt(t)||a===Jo(Xt(t))))return o}const i=Ml(s[e]||o[e],t)||Ml(s.appContext[e],t);return!i&&r?o:i}}function Ml(e,t){return e&&(e[t]||e[Xt(t)]||e[Jo(Xt(t))])}function bt(e,t,n,r){let s;const o=n,i=Ue(e);if(i||kt(e)){const a=i&&Hr(e);let l=!1,u=!1;a&&(l=!pn(e),u=er(e),e=Xo(e)),s=new Array(e.length);for(let c=0,h=e.length;c<h;c++)s[c]=t(l?u?cs(kn(e[c])):kn(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(ht(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 $n(e,t,n={},r,s){if(Dt.ce||Dt.parent&&rs(Dt.parent)&&Dt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),_(),dt(je,null,[Re("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),_();const i=o&&bd(o(n)),a=n.key||i&&i.key,l=dt(je,{key:(a&&!_n(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function bd(e){return e.some(t=>zs(t)?!(t.type===Wt||t.type===je&&!bd(t.children)):!0)?e:null}const ua=e=>e?Bd(e)?oi(e):ua(e.parent):null,Ds=Rt(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=>ua(e.parent),$root:e=>ua(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>kd(e),$forceUpdate:e=>e.f||(e.f=()=>{za(e.update)}),$nextTick:e=>e.n||(e.n=$t.bind(e.proxy)),$watch:e=>Xh.bind(e)}),Ci=(e,t)=>e!==yt&&!e.__isScriptSetup&&ut(e,t),mp={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 y=i[t];if(y!==void 0)switch(y){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ci(r,t))return i[t]=1,r[t];if(s!==yt&&ut(s,t))return i[t]=2,s[t];if(ut(o,t))return i[t]=3,o[t];if(n!==yt&&ut(n,t))return i[t]=4,n[t];da&&(i[t]=0)}}const u=Ds[t];let c,h;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==yt&&ut(n,t))return i[t]=4,n[t];if(h=l.config.globalProperties,ut(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ci(s,t)?(s[t]=n,!0):r!==yt&&ut(r,t)?(r[t]=n,!0):ut(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!==yt&&a[0]!=="$"&&ut(e,a)||Ci(t,a)||ut(o,a)||ut(r,a)||ut(Ds,a)||ut(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ut(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function gp(){return vp().slots}function vp(e){const t=Ya();return t.setupContext||(t.setupContext=Hd(t))}function Ol(e){return Ue(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let da=!0;function yp(e){const t=kd(e),n=e.proxy,r=e.ctx;da=!1,t.beforeCreate&&Nl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:h,mounted:y,beforeUpdate:S,updated:L,activated:R,deactivated:q,beforeDestroy:Y,beforeUnmount:F,destroyed:J,unmounted:G,render:ce,renderTracked:ue,renderTriggered:me,errorCaptured:Se,serverPrefetch:le,expose:ee,inheritAttrs:ne,components:X,directives:Ee,filters:we}=t;if(u&&wp(u,r,null),i)for(const ve in i){const Me=i[ve];Ge(Me)&&(r[ve]=Me.bind(n))}if(s){const ve=s.call(n,n);ht(ve)&&(e.data=Qo(ve))}if(da=!0,o)for(const ve in o){const Me=o[ve],at=Ge(Me)?Me.bind(n,n):Ge(Me.get)?Me.get.bind(n,n):Dn,Qe=!Ge(Me)&&Ge(Me.set)?Me.set.bind(n):Dn,Je=ae({get:at,set:Qe});Object.defineProperty(r,ve,{enumerable:!0,configurable:!0,get:()=>Je.value,set:Ze=>Je.value=Ze})}if(a)for(const ve in a)_d(a[ve],r,n,ve);if(l){const ve=Ge(l)?l.call(n):l;Reflect.ownKeys(ve).forEach(Me=>{bo(Me,ve[Me])})}c&&Nl(c,e,"c");function Pe(ve,Me){Ue(Me)?Me.forEach(at=>ve(at.bind(n))):Me&&ve(Me.bind(n))}if(Pe(ip,h),Pe(ir,y),Pe(ap,S),Pe(lp,L),Pe(rp,R),Pe(sp,q),Pe(fp,Se),Pe(dp,ue),Pe(up,me),Pe(ar,F),Pe(ni,G),Pe(cp,le),Ue(ee))if(ee.length){const ve=e.exposed||(e.exposed={});ee.forEach(Me=>{Object.defineProperty(ve,Me,{get:()=>n[Me],set:at=>n[Me]=at,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===Dn&&(e.render=ce),ne!=null&&(e.inheritAttrs=ne),X&&(e.components=X),Ee&&(e.directives=Ee),le&&vd(e)}function wp(e,t,n=Dn){Ue(e)&&(e=fa(e));for(const r in e){const s=e[r];let o;ht(s)?"default"in s?o=wn(s.from||r,s.default,!0):o=wn(s.from||r):o=wn(s),qt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Nl(e,t,n){Tn(Ue(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function _d(e,t,n,r){let s=r.includes(".")?ld(n,r):()=>n[r];if(kt(e)){const o=t[e];Ge(o)&&ft(s,o)}else if(Ge(e))ft(s,e.bind(n));else if(ht(e))if(Ue(e))e.forEach(o=>_d(o,t,n,r));else{const o=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(o)&&ft(s,o,e)}}function kd(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=>No(l,u,i,!0)),No(l,t,i)),ht(t)&&o.set(t,l),l}function No(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&No(e,o,n,!0),s&&s.forEach(i=>No(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=bp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const bp={data:$l,props:Dl,emits:Dl,methods:Ps,computed:Ps,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:Ps,directives:Ps,watch:kp,provide:$l,inject:_p};function $l(e,t){return t?e?function(){return Rt(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function _p(e,t){return Ps(fa(e),fa(t))}function fa(e){if(Ue(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 Ps(e,t){return e?Rt(Object.create(null),e,t):t}function Dl(e,t){return e?Ue(e)&&Ue(t)?[...new Set([...e,...t])]:Rt(Object.create(null),Ol(e),Ol(t??{})):t}function kp(e,t){if(!e)return t;if(!t)return e;const n=Rt(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function Td(){return{app:null,config:{isNativeTag:Pu,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 Tp=0;function Sp(e,t){return function(r,s=null){Ge(r)||(r=Rt({},r)),s!=null&&!ht(s)&&(s=null);const o=Td(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:Tp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:em,get config(){return o.config},set config(c){},use(c,...h){return i.has(c)||(c&&Ge(c.install)?(i.add(c),c.install(u,...h)):Ge(c)&&(i.add(c),c(u,...h))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,h){return h?(o.components[c]=h,u):o.components[c]},directive(c,h){return h?(o.directives[c]=h,u):o.directives[c]},mount(c,h,y){if(!l){const S=u._ceVNode||Re(r,s);return S.appContext=o,y===!0?y="svg":y===!1&&(y=void 0),e(S,c,y),l=!0,u._container=c,c.__vue_app__=u,oi(S.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Tn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,h){return o.provides[c]=h,u},runWithContext(c){const h=ss;ss=u;try{return c()}finally{ss=h}}};return u}}let ss=null;const Ip=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xt(t)}Modifiers`]||e[`${Ir(t)}Modifiers`];function Ep(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||yt;let s=n;const o=t.startsWith("update:"),i=o&&Ip(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>kt(c)?c.trim():c)),i.number&&(s=n.map(Da)));let a,l=r[a=_i(t)]||r[a=_i(Xt(t))];!l&&o&&(l=r[a=_i(Ir(t))]),l&&Tn(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,Tn(u,e,6,s)}}const Cp=new WeakMap;function Sd(e,t,n=!1){const r=n?Cp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ge(e)){const l=u=>{const c=Sd(u,t,!0);c&&(a=!0,Rt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ht(e)&&r.set(e,null),null):(Ue(o)?o.forEach(l=>i[l]=null):Rt(i,o),ht(e)&&r.set(e,i),i)}function ri(e,t){return!e||!qo(t)?!1:(t=t.slice(2).replace(/Once$/,""),ut(e,t[0].toLowerCase()+t.slice(1))||ut(e,Ir(t))||ut(e,t))}function Ll(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:h,data:y,setupState:S,ctx:L,inheritAttrs:R}=e,q=xo(e);let Y,F;try{if(n.shapeFlag&4){const G=s||r,ce=G;Y=xn(u.call(ce,G,c,h,S,y,L)),F=a}else{const G=t;Y=xn(G.length>1?G(h,{attrs:a,slots:i,emit:l}):G(h,null)),F=t.props?a:Ap(a)}}catch(G){Ls.length=0,Zo(G,e,1),Y=Re(Wt)}let J=Y;if(F&&R!==!1){const G=Object.keys(F),{shapeFlag:ce}=J;G.length&&ce&7&&(o&&G.some(Go)&&(F=Rp(F,o)),J=Sr(J,F,!1,!0))}return n.dirs&&(J=Sr(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(n.dirs):n.dirs),n.transition&&Vs(J,n.transition),Y=J,xo(q),Y}const Ap=e=>{let t;for(const n in e)(n==="class"||n==="style"||qo(n))&&((t||(t={}))[n]=e[n]);return t},Rp=(e,t)=>{const n={};for(const r in e)(!Go(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Pp(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?jl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let h=0;h<c.length;h++){const y=c[h];if(Id(i,r,y)&&!ri(u,y))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?jl(r,i,u):!0:!!i;return!1}function jl(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(Id(t,e,o)&&!ri(n,o))return!0}return!1}function Id(e,t,n){const r=e[n],s=t[n];return n==="style"&&ht(r)&&ht(s)?!La(r,s):r!==s}function xp({vnode:e,parent:t,suspense:n},r){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=r,e=s),s===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Ed={},Cd=()=>Object.create(Ed),Ad=e=>Object.getPrototypeOf(e)===Ed;function Mp(e,t,n,r=!1){const s={},o=Cd();e.propsDefaults=Object.create(null),Rd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Zu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Op(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=lt(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h<c.length;h++){let y=c[h];if(ri(e.emitsOptions,y))continue;const S=t[y];if(l)if(ut(o,y))S!==o[y]&&(o[y]=S,u=!0);else{const L=Xt(y);s[L]=ha(l,a,L,S,e,!1)}else S!==o[y]&&(o[y]=S,u=!0)}}}else{Rd(e,t,s,o)&&(u=!0);let c;for(const h in a)(!t||!ut(t,h)&&((c=Ir(h))===h||!ut(t,c)))&&(l?n&&(n[h]!==void 0||n[c]!==void 0)&&(s[h]=ha(l,a,h,void 0,e,!0)):delete s[h]);if(o!==a)for(const h in o)(!t||!ut(t,h))&&(delete o[h],u=!0)}u&&Gn(e.attrs,"set","")}function Rd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(xs(l))continue;const u=t[l];let c;s&&ut(s,c=Xt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:ri(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=lt(n),u=a||yt;for(let c=0;c<o.length;c++){const h=o[c];n[h]=ha(s,l,h,u[h],e,!ut(u,h))}}return i}function ha(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=ut(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ge(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=no(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===Ir(n))&&(r=!0))}return r}const Np=new WeakMap;function Pd(e,t,n=!1){const r=n?Np:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ge(e)){const c=h=>{l=!0;const[y,S]=Pd(h,t,!0);Rt(i,y),S&&a.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ht(e)&&r.set(e,es),es;if(Ue(o))for(let c=0;c<o.length;c++){const h=Xt(o[c]);Ul(h)&&(i[h]=yt)}else if(o)for(const c in o){const h=Xt(c);if(Ul(h)){const y=o[c],S=i[h]=Ue(y)||Ge(y)?{type:y}:Rt({},y),L=S.type;let R=!1,q=!0;if(Ue(L))for(let Y=0;Y<L.length;++Y){const F=L[Y],J=Ge(F)&&F.name;if(J==="Boolean"){R=!0;break}else J==="String"&&(q=!1)}else R=Ge(L)&&L.name==="Boolean";S[0]=R,S[1]=q,(R||ut(S,"default"))&&a.push(h)}}const u=[i,a];return ht(e)&&r.set(e,u),u}function Ul(e){return e[0]!=="$"&&!xs(e)}const qa=e=>e==="_"||e==="_ctx"||e==="$stable",Ga=e=>Ue(e)?e.map(xn):[xn(e)],$p=(e,t,n)=>{if(t._n)return t;const r=mt((...s)=>Ga(t(...s)),n);return r._c=!1,r},xd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(qa(s))continue;const o=e[s];if(Ge(o))t[s]=$p(s,o,r);else if(o!=null){const i=Ga(o);t[s]=()=>i}}},Md=(e,t)=>{const n=Ga(t);e.slots.default=()=>n},Od=(e,t,n)=>{for(const r in t)(n||!qa(r))&&(e[r]=t[r])},Dp=(e,t,n)=>{const r=e.slots=Cd();if(e.vnode.shapeFlag&32){const s=t._;s?(Od(r,t,n),n&&$u(r,"_",s,!0)):xd(t,r)}else t&&Md(e,t)},Lp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=yt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Od(s,t,n):(o=!t.$stable,xd(t,s)),i=t}else t&&(Md(e,t),i={default:1});if(o)for(const a in s)!qa(a)&&i[a]==null&&delete s[a]},Ht=Hp;function jp(e){return Up(e)}function Up(e,t){const n=Yo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:h,nextSibling:y,setScopeId:S=Dn,insertStaticContent:L}=e,R=(w,k,P,j=null,U=null,x=null,$=void 0,W=null,K=!!k.dynamicChildren)=>{if(w===k)return;w&&!Lr(w,k)&&(j=H(w),Ze(w,U,x,!0),w=null),k.patchFlag===-2&&(K=!1,k.dynamicChildren=null);const{type:V,ref:ke,shapeFlag:pe}=k;switch(V){case si:q(w,k,P,j);break;case Wt:Y(w,k,P,j);break;case Ri:w==null&&F(k,P,j,$);break;case je:X(w,k,P,j,U,x,$,W,K);break;default:pe&1?ce(w,k,P,j,U,x,$,W,K):pe&6?Ee(w,k,P,j,U,x,$,W,K):(pe&64||pe&128)&&V.process(w,k,P,j,U,x,$,W,K,_e)}ke!=null&&U?$s(ke,w&&w.ref,x,k||w,!k):ke==null&&w&&w.ref!=null&&$s(w.ref,null,x,w,!0)},q=(w,k,P,j)=>{if(w==null)r(k.el=a(k.children),P,j);else{const U=k.el=w.el;k.children!==w.children&&u(U,k.children)}},Y=(w,k,P,j)=>{w==null?r(k.el=l(k.children||""),P,j):k.el=w.el},F=(w,k,P,j)=>{[w.el,w.anchor]=L(w.children,k,P,j,w.el,w.anchor)},J=({el:w,anchor:k},P,j)=>{let U;for(;w&&w!==k;)U=y(w),r(w,P,j),w=U;r(k,P,j)},G=({el:w,anchor:k})=>{let P;for(;w&&w!==k;)P=y(w),s(w),w=P;s(k)},ce=(w,k,P,j,U,x,$,W,K)=>{if(k.type==="svg"?$="svg":k.type==="math"&&($="mathml"),w==null)ue(k,P,j,U,x,$,W,K);else{const V=w.el&&w.el._isVueCE?w.el:null;try{V&&V._beginPatch(),le(w,k,U,x,$,W,K)}finally{V&&V._endPatch()}}},ue=(w,k,P,j,U,x,$,W)=>{let K,V;const{props:ke,shapeFlag:pe,transition:fe,dirs:Ae}=w;if(K=w.el=i(w.type,x,ke&&ke.is,ke),pe&8?c(K,w.children):pe&16&&Se(w.children,K,null,j,U,Ai(w,x),$,W),Ae&&Pr(w,null,j,"created"),me(K,w,w.scopeId,$,j),ke){for(const qe in ke)qe!=="value"&&!xs(qe)&&o(K,qe,null,ke[qe],x,j);"value"in ke&&o(K,"value",null,ke.value,x),(V=ke.onVnodeBeforeMount)&&Cn(V,j,w)}Ae&&Pr(w,null,j,"beforeMount");const Le=Bp(U,fe);Le&&fe.beforeEnter(K),r(K,k,P),((V=ke&&ke.onVnodeMounted)||Le||Ae)&&Ht(()=>{try{V&&Cn(V,j,w),Le&&fe.enter(K),Ae&&Pr(w,null,j,"mounted")}finally{}},U)},me=(w,k,P,j,U)=>{if(P&&S(w,P),j)for(let x=0;x<j.length;x++)S(w,j[x]);if(U){let x=U.subTree;if(k===x||Dd(x.type)&&(x.ssContent===k||x.ssFallback===k)){const $=U.vnode;me(w,$,$.scopeId,$.slotScopeIds,U.parent)}}},Se=(w,k,P,j,U,x,$,W,K=0)=>{for(let V=K;V<w.length;V++){const ke=w[V]=W?qn(w[V]):xn(w[V]);R(null,ke,k,P,j,U,x,$,W)}},le=(w,k,P,j,U,x,$)=>{const W=k.el=w.el;let{patchFlag:K,dynamicChildren:V,dirs:ke}=k;K|=w.patchFlag&16;const pe=w.props||yt,fe=k.props||yt;let Ae;if(P&&xr(P,!1),(Ae=fe.onVnodeBeforeUpdate)&&Cn(Ae,P,k,w),ke&&Pr(k,w,P,"beforeUpdate"),P&&xr(P,!0),(pe.innerHTML&&fe.innerHTML==null||pe.textContent&&fe.textContent==null)&&c(W,""),V?ee(w.dynamicChildren,V,W,P,j,Ai(k,U),x):$||Me(w,k,W,null,P,j,Ai(k,U),x,!1),K>0){if(K&16)ne(W,pe,fe,P,U);else if(K&2&&pe.class!==fe.class&&o(W,"class",null,fe.class,U),K&4&&o(W,"style",pe.style,fe.style,U),K&8){const Le=k.dynamicProps;for(let qe=0;qe<Le.length;qe++){const We=Le[qe],He=pe[We],tt=fe[We];(tt!==He||We==="value")&&o(W,We,He,tt,U,P)}}K&1&&w.children!==k.children&&c(W,k.children)}else!$&&V==null&&ne(W,pe,fe,P,U);((Ae=fe.onVnodeUpdated)||ke)&&Ht(()=>{Ae&&Cn(Ae,P,k,w),ke&&Pr(k,w,P,"updated")},j)},ee=(w,k,P,j,U,x,$)=>{for(let W=0;W<k.length;W++){const K=w[W],V=k[W],ke=K.el&&(K.type===je||!Lr(K,V)||K.shapeFlag&198)?h(K.el):P;R(K,V,ke,null,j,U,x,$,!0)}},ne=(w,k,P,j,U)=>{if(k!==P){if(k!==yt)for(const x in k)!xs(x)&&!(x in P)&&o(w,x,k[x],null,U,j);for(const x in P){if(xs(x))continue;const $=P[x],W=k[x];$!==W&&x!=="value"&&o(w,x,W,$,U,j)}"value"in P&&o(w,"value",k.value,P.value,U)}},X=(w,k,P,j,U,x,$,W,K)=>{const V=k.el=w?w.el:a(""),ke=k.anchor=w?w.anchor:a("");let{patchFlag:pe,dynamicChildren:fe,slotScopeIds:Ae}=k;Ae&&(W=W?W.concat(Ae):Ae),w==null?(r(V,P,j),r(ke,P,j),Se(k.children||[],P,ke,U,x,$,W,K)):pe>0&&pe&64&&fe&&w.dynamicChildren&&w.dynamicChildren.length===fe.length?(ee(w.dynamicChildren,fe,P,U,x,$,W),(k.key!=null||U&&k===U.subTree)&&Ka(w,k,!0)):Me(w,k,P,ke,U,x,$,W,K)},Ee=(w,k,P,j,U,x,$,W,K)=>{k.slotScopeIds=W,w==null?k.shapeFlag&512?U.ctx.activate(k,P,j,$,K):we(k,P,j,U,x,$,K):$e(w,k,K)},we=(w,k,P,j,U,x,$)=>{const W=w.component=Kp(w,j,U);if(ei(w)&&(W.ctx.renderer=_e),Jp(W,!1,$),W.asyncDep){if(U&&U.registerDep(W,Pe,$),!w.el){const K=W.subTree=Re(Wt);Y(null,K,k,P),w.placeholder=K.el}}else Pe(W,w,k,P,U,x,$)},$e=(w,k,P)=>{const j=k.component=w.component;if(Pp(w,k,P))if(j.asyncDep&&!j.asyncResolved){ve(j,k,P);return}else j.next=k,j.update();else k.el=w.el,j.vnode=k},Pe=(w,k,P,j,U,x,$)=>{const W=()=>{if(w.isMounted){let{next:pe,bu:fe,u:Ae,parent:Le,vnode:qe}=w;{const et=Nd(w);if(et){pe&&(pe.el=qe.el,ve(w,pe,$)),et.asyncDep.then(()=>{Ht(()=>{w.isUnmounted||V()},U)});return}}let We=pe,He;xr(w,!1),pe?(pe.el=qe.el,ve(w,pe,$)):pe=qe,fe&&wo(fe),(He=pe.props&&pe.props.onVnodeBeforeUpdate)&&Cn(He,Le,pe,qe),xr(w,!0);const tt=Ll(w),ze=w.subTree;w.subTree=tt,R(ze,tt,h(ze.el),H(ze),w,U,x),pe.el=tt.el,We===null&&xp(w,tt.el),Ae&&Ht(Ae,U),(He=pe.props&&pe.props.onVnodeUpdated)&&Ht(()=>Cn(He,Le,pe,qe),U)}else{let pe;const{el:fe,props:Ae}=k,{bm:Le,m:qe,parent:We,root:He,type:tt}=w,ze=rs(k);xr(w,!1),Le&&wo(Le),!ze&&(pe=Ae&&Ae.onVnodeBeforeMount)&&Cn(pe,We,k),xr(w,!0);{He.ce&&He.ce._hasShadowRoot()&&He.ce._injectChildStyle(tt,w.parent?w.parent.type:void 0);const et=w.subTree=Ll(w);R(null,et,P,j,w,U,x),k.el=et.el}if(qe&&Ht(qe,U),!ze&&(pe=Ae&&Ae.onVnodeMounted)){const et=k;Ht(()=>Cn(pe,We,et),U)}(k.shapeFlag&256||We&&rs(We.vnode)&&We.vnode.shapeFlag&256)&&w.a&&Ht(w.a,U),w.isMounted=!0,k=P=j=null}};w.scope.on();const K=w.effect=new Uu(W);w.scope.off();const V=w.update=K.run.bind(K),ke=w.job=K.runIfDirty.bind(K);ke.i=w,ke.id=w.uid,K.scheduler=()=>za(ke),xr(w,!0),V()},ve=(w,k,P)=>{k.component=w;const j=w.vnode.props;w.vnode=k,w.next=null,Op(w,k.props,j,P),Lp(w,k.children,P),Qn(),El(w),Zn()},Me=(w,k,P,j,U,x,$,W,K=!1)=>{const V=w&&w.children,ke=w?w.shapeFlag:0,pe=k.children,{patchFlag:fe,shapeFlag:Ae}=k;if(fe>0){if(fe&128){Qe(V,pe,P,j,U,x,$,W,K);return}else if(fe&256){at(V,pe,P,j,U,x,$,W,K);return}}Ae&8?(ke&16&&De(V,U,x),pe!==V&&c(P,pe)):ke&16?Ae&16?Qe(V,pe,P,j,U,x,$,W,K):De(V,U,x,!0):(ke&8&&c(P,""),Ae&16&&Se(pe,P,j,U,x,$,W,K))},at=(w,k,P,j,U,x,$,W,K)=>{w=w||es,k=k||es;const V=w.length,ke=k.length,pe=Math.min(V,ke);let fe;for(fe=0;fe<pe;fe++){const Ae=k[fe]=K?qn(k[fe]):xn(k[fe]);R(w[fe],Ae,P,null,U,x,$,W,K)}V>ke?De(w,U,x,!0,!1,pe):Se(k,P,j,U,x,$,W,K,pe)},Qe=(w,k,P,j,U,x,$,W,K)=>{let V=0;const ke=k.length;let pe=w.length-1,fe=ke-1;for(;V<=pe&&V<=fe;){const Ae=w[V],Le=k[V]=K?qn(k[V]):xn(k[V]);if(Lr(Ae,Le))R(Ae,Le,P,null,U,x,$,W,K);else break;V++}for(;V<=pe&&V<=fe;){const Ae=w[pe],Le=k[fe]=K?qn(k[fe]):xn(k[fe]);if(Lr(Ae,Le))R(Ae,Le,P,null,U,x,$,W,K);else break;pe--,fe--}if(V>pe){if(V<=fe){const Ae=fe+1,Le=Ae<ke?k[Ae].el:j;for(;V<=fe;)R(null,k[V]=K?qn(k[V]):xn(k[V]),P,Le,U,x,$,W,K),V++}}else if(V>fe)for(;V<=pe;)Ze(w[V],U,x,!0),V++;else{const Ae=V,Le=V,qe=new Map;for(V=Le;V<=fe;V++){const nt=k[V]=K?qn(k[V]):xn(k[V]);nt.key!=null&&qe.set(nt.key,V)}let We,He=0;const tt=fe-Le+1;let ze=!1,et=0;const It=new Array(tt);for(V=0;V<tt;V++)It[V]=0;for(V=Ae;V<=pe;V++){const nt=w[V];if(He>=tt){Ze(nt,U,x,!0);continue}let gt;if(nt.key!=null)gt=qe.get(nt.key);else for(We=Le;We<=fe;We++)if(It[We-Le]===0&&Lr(nt,k[We])){gt=We;break}gt===void 0?Ze(nt,U,x,!0):(It[gt-Le]=V+1,gt>=et?et=gt:ze=!0,R(nt,k[gt],P,null,U,x,$,W,K),He++)}const Zt=ze?Fp(It):es;for(We=Zt.length-1,V=tt-1;V>=0;V--){const nt=Le+V,gt=k[nt],Lt=k[nt+1],jt=nt+1<ke?Lt.el||$d(Lt):j;It[V]===0?R(null,gt,P,jt,U,x,$,W,K):ze&&(We<0||V!==Zt[We]?Je(gt,P,jt,2):We--)}}},Je=(w,k,P,j,U=null)=>{const{el:x,type:$,transition:W,children:K,shapeFlag:V}=w;if(V&6){Je(w.component.subTree,k,P,j);return}if(V&128){w.suspense.move(k,P,j);return}if(V&64){$.move(w,k,P,_e);return}if($===je){r(x,k,P);for(let pe=0;pe<K.length;pe++)Je(K[pe],k,P,j);r(w.anchor,k,P);return}if($===Ri){J(w,k,P);return}if(j!==2&&V&1&&W)if(j===0)W.beforeEnter(x),r(x,k,P),Ht(()=>W.enter(x),U);else{const{leave:pe,delayLeave:fe,afterLeave:Ae}=W,Le=()=>{w.ctx.isUnmounted?s(x):r(x,k,P)},qe=()=>{x._isLeaving&&x[Rn](!0),pe(x,()=>{Le(),Ae&&Ae()})};fe?fe(x,Le,qe):qe()}else r(x,k,P)},Ze=(w,k,P,j=!1,U=!1)=>{const{type:x,props:$,ref:W,children:K,dynamicChildren:V,shapeFlag:ke,patchFlag:pe,dirs:fe,cacheIndex:Ae,memo:Le}=w;if(pe===-2&&(U=!1),W!=null&&(Qn(),$s(W,null,P,w,!0),Zn()),Ae!=null&&(k.renderCache[Ae]=void 0),ke&256){k.ctx.deactivate(w);return}const qe=ke&1&&fe,We=!rs(w);let He;if(We&&(He=$&&$.onVnodeBeforeUnmount)&&Cn(He,k,w),ke&6)Ne(w.component,P,j);else{if(ke&128){w.suspense.unmount(P,j);return}qe&&Pr(w,null,k,"beforeUnmount"),ke&64?w.type.remove(w,k,P,_e,j):V&&!V.hasOnce&&(x!==je||pe>0&&pe&64)?De(V,k,P,!1,!0):(x===je&&pe&384||!U&&ke&16)&&De(K,k,P),j&&Ye(w)}const tt=Le!=null&&Ae==null;(We&&(He=$&&$.onVnodeUnmounted)||qe||tt)&&Ht(()=>{He&&Cn(He,k,w),qe&&Pr(w,null,k,"unmounted"),tt&&(w.el=null)},P)},Ye=w=>{const{type:k,el:P,anchor:j,transition:U}=w;if(k===je){pt(P,j);return}if(k===Ri){G(w);return}const x=()=>{s(P),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(w.shapeFlag&1&&U&&!U.persisted){const{leave:$,delayLeave:W}=U,K=()=>$(P,x);W?W(w.el,x,K):K()}else x()},pt=(w,k)=>{let P;for(;w!==k;)P=y(w),s(w),w=P;s(k)},Ne=(w,k,P)=>{const{bum:j,scope:U,job:x,subTree:$,um:W,m:K,a:V}=w;Bl(K),Bl(V),j&&wo(j),U.stop(),x&&(x.flags|=8,Ze($,w,k,P)),W&&Ht(W,k),Ht(()=>{w.isUnmounted=!0},k)},De=(w,k,P,j=!1,U=!1,x=0)=>{for(let $=x;$<w.length;$++)Ze(w[$],k,P,j,U)},H=w=>{if(w.shapeFlag&6)return H(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const k=y(w.anchor||w.el),P=k&&k[cd];return P?y(P):k};let he=!1;const de=(w,k,P)=>{let j;w==null?k._vnode&&(Ze(k._vnode,null,null,!0),j=k._vnode.component):R(k._vnode||null,w,k,null,null,null,P),k._vnode=w,he||(he=!0,El(j),sd(),he=!1)},_e={p:R,um:Ze,m:Je,r:Ye,mt:we,mc:Se,pc:Me,pbc:ee,n:H,o:e};return{render:de,hydrate:void 0,createApp:Sp(de)}}function Ai({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 xr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Bp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ka(e,t,n=!1){const r=e.children,s=t.children;if(Ue(r)&&Ue(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&&Ka(i,a)),a.type===si&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Fp(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 Nd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Nd(t)}function Bl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function $d(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?$d(t.subTree):null}const Dd=e=>e.__isSuspense;function Hp(e,t){t&&t.pendingBranch?Ue(e)?t.effects.push(...e):t.effects.push(e):Kh(e)}const je=Symbol.for("v-fgt"),si=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Ri=Symbol.for("v-stc"),Ls=[];let on=null;function _(e=!1){Ls.push(on=e?null:[])}function Vp(){Ls.pop(),on=Ls[Ls.length-1]||null}let Ws=1;function $o(e,t=!1){Ws+=e,e<0&&on&&t&&(on.hasOnce=!0)}function Ld(e){return e.dynamicChildren=Ws>0?on||es:null,Vp(),Ws>0&&on&&on.push(e),e}function I(e,t,n,r,s,o){return Ld(m(e,t,n,r,s,o,!0))}function dt(e,t,n,r,s){return Ld(Re(e,t,n,r,s,!0))}function zs(e){return e?e.__v_isVNode===!0:!1}function Lr(e,t){return e.type===t.type&&e.key===t.key}const jd=({key:e})=>e??null,ko=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?kt(e)||qt(e)||Ge(e)?{i:Dt,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===je?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&jd(t),ref:t&&ko(t),scopeId:id,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:Dt};return a?(Ja(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=kt(n)?8:16),Ws>0&&!i&&on&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&on.push(l),l}const Re=Wp;function Wp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===wd)&&(e=Wt),zs(e)){const a=Sr(e,t,!0);return n&&Ja(a,n),Ws>0&&!o&&on&&(a.shapeFlag&6?on[on.indexOf(e)]=a:on.push(a)),a.patchFlag=-2,a}if(Zp(e)&&(e=e.__vccOpts),t){t=zp(t);let{class:a,style:l}=t;a&&!kt(a)&&(t.class=it(a)),ht(l)&&(Wa(l)&&!Ue(l)&&(l=Rt({},l)),t.style=Wr(l))}const i=kt(e)?1:Dd(e)?128:ud(e)?64:ht(e)?4:Ge(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function zp(e){return e?Wa(e)||Ad(e)?Rt({},e):e:null}function Sr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?Ud(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&jd(u),ref:t&&t.ref?n&&o?Ue(o)?o.concat(ko(t)):[o,ko(t)]:ko(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!==je?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Sr(e.ssContent),ssFallback:e.ssFallback&&Sr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Vs(c,l.clone(c)),c}function qs(e=" ",t=0){return Re(si,null,e,t)}function oe(e="",t=!1){return t?(_(),dt(Wt,null,e)):Re(Wt,null,e)}function xn(e){return e==null||typeof e=="boolean"?Re(Wt):Ue(e)?Re(je,null,e.slice()):zs(e)?qn(e):Re(si,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Sr(e)}function Ja(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ue(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ja(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Ad(t)?t._ctx=Dt:s===3&&Dt&&(Dt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ge(t)?(t={default:t,_ctx:Dt},n=32):(t=String(t),r&64?(n=16,t=[qs(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ud(...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=it([t.class,r.class]));else if(s==="style")t.style=Wr([t.style,r.style]);else if(qo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Ue(o)&&o.includes(i))?t[s]=o?[].concat(o,i):i:i==null&&o==null&&!Go(s)&&(t[s]=i)}else s!==""&&(t[s]=r[s])}return t}function Cn(e,t,n,r=null){Tn(e,t,7,[n,r])}const qp=Td();let Gp=0;function Kp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||qp,o={uid:Gp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new yh(!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:Pd(r,s),emitsOptions:Sd(r,s),emit:null,emitted:null,propsDefaults:yt,inheritAttrs:r.inheritAttrs,ctx:yt,data:yt,props:yt,attrs:yt,slots:yt,refs:yt,setupState:yt,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=Ep.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const Ya=()=>zt||Dt;let Do,pa;{const e=Yo(),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)}};Do=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),pa=t("__VUE_SSR_SETTERS__",n=>Gs=n)}const no=e=>{const t=zt;return Do(e),e.scope.on(),()=>{e.scope.off(),Do(t)}},Fl=()=>{zt&&zt.scope.off(),Do(null)};function Bd(e){return e.vnode.shapeFlag&4}let Gs=!1;function Jp(e,t=!1,n=!1){t&&pa(t);const{props:r,children:s}=e.vnode,o=Bd(e);Mp(e,r,o,t),Dp(e,s,n||t);const i=o?Yp(e,t):void 0;return t&&pa(!1),i}function Yp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mp);const{setup:r}=n;if(r){Qn();const s=e.setupContext=r.length>1?Hd(e):null,o=no(e),i=to(r,e,0,[e.props,s]),a=Mu(i);if(Zn(),o(),(a||e.sp)&&!rs(e)&&vd(e),a){if(i.then(Fl,Fl),t)return i.then(l=>{Hl(e,l)}).catch(l=>{Zo(l,e,0)});e.asyncDep=i}else Hl(e,i)}else Fd(e)}function Hl(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ht(t)&&(e.setupState=td(t)),Fd(e)}function Fd(e,t,n){const r=e.type;e.render||(e.render=r.render||Dn);{const s=no(e);Qn();try{yp(e)}finally{Zn(),s()}}}const Xp={get(e,t){return Vt(e,"get",""),e[t]}};function Hd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Xp),slots:e.slots,emit:e.emit,expose:t}}function oi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(td(jh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ds)return Ds[n](e)},has(t,n){return n in t||n in Ds}})):e.proxy}function Qp(e,t=!0){return Ge(e)?e.displayName||e.name:e.name||t&&e.__name}function Zp(e){return Ge(e)&&"__vccOpts"in e}const ae=(e,t)=>Vh(e,t,Gs);function Xa(e,t,n){try{$o(-1);const r=arguments.length;return r===2?ht(t)&&!Ue(t)?zs(t)?Re(e,null,[t]):Re(e,t):Re(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&zs(n)&&(n=[n]),Re(e,t,n))}finally{$o(1)}}const em="3.5.31";/**
14
- * @vue/runtime-dom v3.5.31
15
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
- * @license MIT
17
- **/let ma;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ma=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Vd=ma?e=>ma.createHTML(e):e=>e,tm="http://www.w3.org/2000/svg",nm="http://www.w3.org/1998/Math/MathML",zn=typeof document<"u"?document:null,Wl=zn&&zn.createElement("template"),rm={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(tm,e):t==="mathml"?zn.createElementNS(nm,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{Wl.innerHTML=Vd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Wl.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]}},fr="transition",Is="animation",Ks=Symbol("_vtc"),Wd={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},sm=Rt({},fd,Wd),om=e=>(e.displayName="Transition",e.props=sm,e),zd=om((e,{slots:t})=>Xa(np,im(e),t)),Mr=(e,t=[])=>{Ue(e)?e.forEach(n=>n(...t)):e&&e(...t)},zl=e=>e?Ue(e)?e.some(t=>t.length>1):e.length>1:!1;function im(e){const t={};for(const X in e)X in Wd||(t[X]=e[X]);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:h=`${n}-leave-from`,leaveActiveClass:y=`${n}-leave-active`,leaveToClass:S=`${n}-leave-to`}=e,L=am(s),R=L&&L[0],q=L&&L[1],{onBeforeEnter:Y,onEnter:F,onEnterCancelled:J,onLeave:G,onLeaveCancelled:ce,onBeforeAppear:ue=Y,onAppear:me=F,onAppearCancelled:Se=J}=t,le=(X,Ee,we,$e)=>{X._enterCancelled=$e,Or(X,Ee?c:a),Or(X,Ee?u:i),we&&we()},ee=(X,Ee)=>{X._isLeaving=!1,Or(X,h),Or(X,S),Or(X,y),Ee&&Ee()},ne=X=>(Ee,we)=>{const $e=X?me:F,Pe=()=>le(Ee,X,we);Mr($e,[Ee,Pe]),ql(()=>{Or(Ee,X?l:o),Vn(Ee,X?c:a),zl($e)||Gl(Ee,r,R,Pe)})};return Rt(t,{onBeforeEnter(X){Mr(Y,[X]),Vn(X,o),Vn(X,i)},onBeforeAppear(X){Mr(ue,[X]),Vn(X,l),Vn(X,u)},onEnter:ne(!1),onAppear:ne(!0),onLeave(X,Ee){X._isLeaving=!0;const we=()=>ee(X,Ee);Vn(X,h),X._enterCancelled?(Vn(X,y),Yl(X)):(Yl(X),Vn(X,y)),ql(()=>{X._isLeaving&&(Or(X,h),Vn(X,S),zl(G)||Gl(X,r,q,we))}),Mr(G,[X,we])},onEnterCancelled(X){le(X,!1,void 0,!0),Mr(J,[X])},onAppearCancelled(X){le(X,!0,void 0,!0),Mr(Se,[X])},onLeaveCancelled(X){ee(X),Mr(ce,[X])}})}function am(e){if(e==null)return null;if(ht(e))return[Pi(e.enter),Pi(e.leave)];{const t=Pi(e);return[t,t]}}function Pi(e){return uh(e)}function Vn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ks]||(e[Ks]=new Set)).add(t)}function Or(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ks];n&&(n.delete(t),n.size||(e[Ks]=void 0))}function ql(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let lm=0;function Gl(e,t,n,r){const s=e._endId=++lm,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=cm(e,t);if(!i)return r();const u=i+"end";let c=0;const h=()=>{e.removeEventListener(u,y),o()},y=S=>{S.target===e&&++c>=l&&h()};setTimeout(()=>{c<l&&h()},a+1),e.addEventListener(u,y)}function cm(e,t){const n=window.getComputedStyle(e),r=L=>(n[L]||"").split(", "),s=r(`${fr}Delay`),o=r(`${fr}Duration`),i=Kl(s,o),a=r(`${Is}Delay`),l=r(`${Is}Duration`),u=Kl(a,l);let c=null,h=0,y=0;t===fr?i>0&&(c=fr,h=i,y=o.length):t===Is?u>0&&(c=Is,h=u,y=l.length):(h=Math.max(i,u),c=h>0?i>u?fr:Is:null,y=c?c===fr?o.length:l.length:0);const S=c===fr&&/\b(?:transform|all)(?:,|$)/.test(r(`${fr}Property`).toString());return{type:c,timeout:h,propCount:y,hasTransform:S}}function Kl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Jl(n)+Jl(e[r])))}function Jl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Yl(e){return(e?e.ownerDocument:document).body.offsetHeight}function um(e,t,n){const r=e[Ks];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Xl=Symbol("_vod"),dm=Symbol("_vsh"),fm=Symbol(""),hm=/(?:^|;)\s*display\s*:/;function pm(e,t,n){const r=e.style,s=kt(n);let o=!1;if(n&&!s){if(t)if(kt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&To(r,a,"")}else for(const i in t)n[i]==null&&To(r,i,"");for(const i in n)i==="display"&&(o=!0),To(r,i,n[i])}else if(s){if(t!==n){const i=r[fm];i&&(n+=";"+i),r.cssText=n,o=hm.test(n)}}else t&&e.removeAttribute("style");Xl in e&&(e[Xl]=o?r.display:"",e[dm]&&(r.display="none"))}const Ql=/\s*!important$/;function To(e,t,n){if(Ue(n))n.forEach(r=>To(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=mm(e,t);Ql.test(n)?e.setProperty(Ir(r),n.replace(Ql,""),"important"):e[r]=n}}const Zl=["Webkit","Moz","ms"],xi={};function mm(e,t){const n=xi[t];if(n)return n;let r=Xt(t);if(r!=="filter"&&r in e)return xi[t]=r;r=Jo(r);for(let s=0;s<Zl.length;s++){const o=Zl[s]+r;if(o in e)return xi[t]=o}return t}const ec="http://www.w3.org/1999/xlink";function tc(e,t,n,r,s,o=gh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ec,t.slice(6,t.length)):e.setAttributeNS(ec,t,n):n==null||o&&!Du(n)?e.removeAttribute(t):e.setAttribute(t,o?"":_n(n)?String(n):n)}function nc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Vd(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=Du(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 Qr(e,t,n,r){e.addEventListener(t,n,r)}function gm(e,t,n,r){e.removeEventListener(t,n,r)}const rc=Symbol("_vei");function vm(e,t,n,r,s=null){const o=e[rc]||(e[rc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=ym(t);if(r){const u=o[t]=_m(r,s);Qr(e,a,u,l)}else i&&(gm(e,a,i,l),o[t]=void 0)}}const sc=/(?:Once|Passive|Capture)$/;function ym(e){let t;if(sc.test(e)){t={};let r;for(;r=e.match(sc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ir(e.slice(2)),t]}let Mi=0;const wm=Promise.resolve(),bm=()=>Mi||(wm.then(()=>Mi=0),Mi=Date.now());function _m(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Tn(km(r,n.value),t,5,[r])};return n.value=e,n.attached=bm(),n}function km(e,t){if(Ue(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 oc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Tm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?um(e,r,i):t==="style"?pm(e,n,r):qo(t)?Go(t)||vm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Sm(e,t,r,i))?(nc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&tc(e,t,r,i,o,t!=="value")):e._isVueCE&&(Im(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!kt(r)))?nc(e,Xt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),tc(e,t,r,i))};function Sm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&oc(t)&&Ge(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return oc(t)&&kt(n)?!1:t in e}function Im(e,t){const n=e._def.props;if(!n)return!1;const r=Xt(t);return Array.isArray(n)?n.some(s=>Xt(s)===r):Object.keys(n).some(s=>Xt(s)===r)}const ic=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ue(t)?n=>wo(t,n):t};function Em(e){e.target.composing=!0}function ac(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Oi=Symbol("_assign");function lc(e,t,n){return t&&(e=e.trim()),n&&(e=Da(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Oi]=ic(s);const o=r||s.props&&s.props.type==="number";Qr(e,t?"change":"input",i=>{i.target.composing||e[Oi](lc(e.value,n,o))}),(n||o)&&Qr(e,"change",()=>{e.value=lc(e.value,n,o)}),t||(Qr(e,"compositionstart",Em),Qr(e,"compositionend",ac),Qr(e,"change",ac))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Oi]=ic(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Da(e.value):e.value,l=t??"";if(a===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l)}},Cm=["ctrl","shift","alt","meta"],Am={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)=>Cm.some(n=>e[`${n}Key`]&&!t.includes(n))},ot=(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=Am[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Rm={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=Ir(s.key);if(t.some(i=>i===o||Rm[i]===o))return e(s)}))},Pm=Rt({patchProp:Tm},rm);let cc;function xm(){return cc||(cc=jp(Pm))}const Mm=((...e)=>{const t=xm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Nm(r);if(!s)return;const o=t._component;!Ge(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Om(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Om(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nm(e){return kt(e)?document.querySelector(e):e}/*!
18
- * vue-router v4.6.4
19
- * (c) 2025 Eduardo San Martin Morote
20
- * @license MIT
21
- */const Zr=typeof document<"u";function qd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function $m(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&qd(e.default)}const ct=Object.assign;function Ni(e,t){const n={};for(const r in t){const s=t[r];n[r]=Sn(s)?s.map(e):e(s)}return n}const js=()=>{},Sn=Array.isArray;function uc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Gd=/#/g,Dm=/&/g,Lm=/\//g,jm=/=/g,Um=/\?/g,Kd=/\+/g,Bm=/%5B/g,Fm=/%5D/g,Jd=/%5E/g,Hm=/%60/g,Yd=/%7B/g,Vm=/%7C/g,Xd=/%7D/g,Wm=/%20/g;function Qa(e){return e==null?"":encodeURI(""+e).replace(Vm,"|").replace(Bm,"[").replace(Fm,"]")}function zm(e){return Qa(e).replace(Yd,"{").replace(Xd,"}").replace(Jd,"^")}function ga(e){return Qa(e).replace(Kd,"%2B").replace(Wm,"+").replace(Gd,"%23").replace(Dm,"%26").replace(Hm,"`").replace(Yd,"{").replace(Xd,"}").replace(Jd,"^")}function qm(e){return ga(e).replace(jm,"%3D")}function Gm(e){return Qa(e).replace(Gd,"%23").replace(Um,"%3F")}function Km(e){return Gm(e).replace(Lm,"%2F")}function Js(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Jm=/\/$/,Ym=e=>e.replace(Jm,"");function $i(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=eg(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Js(i)}}function Xm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function dc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Qm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&us(t.matched[r],n.matched[s])&&Qd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function us(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Qd(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 Sn(e)?fc(e,t):Sn(t)?fc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function fc(e,t){return Sn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function eg(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 hr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let va=(function(e){return e.pop="pop",e.push="push",e})({}),Di=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function tg(e){if(!e)if(Zr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ym(e)}const ng=/^[^#]+#/;function rg(e,t){return e.replace(ng,"#")+t}function sg(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 ii=()=>({left:window.scrollX,top:window.scrollY});function og(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=sg(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 hc(e,t){return(history.state?history.state.position-t:-1)+e}const ya=new Map;function ig(e,t){ya.set(e,t)}function ag(e){const t=ya.get(e);return ya.delete(e),t}function lg(e){return typeof e=="string"||e&&typeof e=="object"}function Zd(e){return typeof e=="string"||typeof e=="symbol"}let St=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const ef=Symbol("");St.MATCHER_NOT_FOUND+"",St.NAVIGATION_GUARD_REDIRECT+"",St.NAVIGATION_ABORTED+"",St.NAVIGATION_CANCELLED+"",St.NAVIGATION_DUPLICATED+"";function ds(e,t){return ct(new Error,{type:e,[ef]:!0},t)}function Wn(e,t){return e instanceof Error&&ef in e&&(t==null||!!(e.type&t))}const cg=["params","query","hash"];function ug(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of cg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function dg(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(Kd," "),o=s.indexOf("="),i=Js(o<0?s:s.slice(0,o)),a=o<0?null:Js(s.slice(o+1));if(i in t){let l=t[i];Sn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function pc(e){let t="";for(let n in e){const r=e[n];if(n=qm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Sn(r)?r.map(s=>s&&ga(s)):[r&&ga(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function fg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Sn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const hg=Symbol(""),mc=Symbol(""),ai=Symbol(""),Za=Symbol(""),wa=Symbol("");function Es(){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 vr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=y=>{y===!1?l(ds(St.NAVIGATION_ABORTED,{from:n,to:t})):y instanceof Error?l(y):lg(y)?l(ds(St.NAVIGATION_GUARD_REDIRECT,{from:t,to:y})):(i&&r.enterCallbacks[s]===i&&typeof y=="function"&&i.push(y),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let h=Promise.resolve(c);e.length<3&&(h=h.then(u)),h.catch(y=>l(y))})}function Li(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(qd(l)){const u=(l.__vccOpts||l)[t];u&&o.push(vr(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 h=$m(c)?c.default:c;i.mods[a]=c,i.components[a]=h;const y=(h.__vccOpts||h)[t];return y&&vr(y,n,r,i,a,s)()}))}}return o}function pg(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=>us(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>us(u,l))||s.push(l))}return[n,r,s]}/*!
22
- * vue-router v4.6.4
23
- * (c) 2025 Eduardo San Martin Morote
24
- * @license MIT
25
- */let mg=()=>location.protocol+"//"+location.host;function tf(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),dc(a,"")}return dc(n,e)+r+s}function gg(e,t,n,r){let s=[],o=[],i=null;const a=({state:y})=>{const S=tf(e,location),L=n.value,R=t.value;let q=0;if(y){if(n.value=S,t.value=y,i&&i===L){i=null;return}q=R?y.position-R.position:0}else r(S);s.forEach(Y=>{Y(n.value,L,{delta:q,type:va.pop,direction:q?q>0?Di.forward:Di.back:Di.unknown})})};function l(){i=n.value}function u(y){s.push(y);const S=()=>{const L=s.indexOf(y);L>-1&&s.splice(L,1)};return o.push(S),S}function c(){if(document.visibilityState==="hidden"){const{history:y}=window;if(!y.state)return;y.replaceState(ct({},y.state,{scroll:ii()}),"")}}function h(){for(const y of o)y();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:h}}function gc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ii():null}}function vg(e){const{history:t,location:n}=window,r={value:tf(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 h=e.indexOf("#"),y=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+l:mg()+e+l;try{t[c?"replaceState":"pushState"](u,"",y),s.value=u}catch(S){console.error(S),n[c?"replace":"assign"](y)}}function i(l,u){o(l,ct({},t.state,gc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ct({},s.value,t.state,{forward:l,scroll:ii()});o(c.current,c,!0),o(l,ct({},gc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function yg(e){e=tg(e);const t=vg(e),n=gg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ct({location:"",base:e,go:r,createHref:rg.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 wg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),yg(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var At=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(At||{});const bg={type:Ur.Static,value:""},_g=/[a-zA-Z0-9_]/;function kg(e){if(!e)return[[]];if(e==="/")return[[bg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(S){throw new Error(`ERR (${n})/"${u}": ${S}`)}let n=At.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function h(){u&&(n===At.Static?o.push({type:Ur.Static,value:u}):n===At.Param||n===At.ParamRegExp||n===At.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 y(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==At.ParamRegExp){r=n,n=At.EscapeNext;continue}switch(n){case At.Static:l==="/"?(u&&h(),i()):l===":"?(h(),n=At.Param):y();break;case At.EscapeNext:y(),n=r;break;case At.Param:l==="("?n=At.ParamRegExp:_g.test(l)?y():(h(),n=At.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case At.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=At.ParamRegExpEnd:c+=l;break;case At.ParamRegExpEnd:h(),n=At.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===At.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),h(),i(),s}const vc="[^/]+?",Tg={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 Sg=/[.+*?^${}()[\]/\\]/g;function Ig(e,t){const n=ct({},Tg,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 h=0;h<u.length;h++){const y=u[h];let S=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(y.type===Ur.Static)h||(s+="/"),s+=y.value.replace(Sg,"\\$&"),S+=Kt.Static;else if(y.type===Ur.Param){const{value:L,repeatable:R,optional:q,regexp:Y}=y;o.push({name:L,repeatable:R,optional:q});const F=Y||vc;if(F!==vc){S+=Kt.BonusCustomRegExp;try{`${F}`}catch(G){throw new Error(`Invalid custom RegExp for param "${L}" (${F}): `+G.message)}}let J=R?`((?:${F})(?:/(?:${F}))*)`:`(${F})`;h||(J=q&&u.length<2?`(?:/${J})`:"/"+J),q&&(J+="?"),s+=J,S+=Kt.Dynamic,q&&(S+=Kt.BonusOptional),R&&(S+=Kt.BonusRepeatable),F===".*"&&(S+=Kt.BonusWildcard)}c.push(S)}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),h={};if(!c)return null;for(let y=1;y<c.length;y++){const S=c[y]||"",L=o[y-1];h[L.name]=S&&L.repeatable?S.split("/"):S}return h}function l(u){let c="",h=!1;for(const y of e){(!h||!c.endsWith("/"))&&(c+="/"),h=!1;for(const S of y)if(S.type===Ur.Static)c+=S.value;else if(S.type===Ur.Param){const{value:L,repeatable:R,optional:q}=S,Y=L in u?u[L]:"";if(Sn(Y)&&!R)throw new Error(`Provided param "${L}" is an array but it is not repeatable (* or + modifiers)`);const F=Sn(Y)?Y.join("/"):Y;if(!F)if(q)y.length<2&&(c.endsWith("/")?c=c.slice(0,-1):h=!0);else throw new Error(`Missing required param "${L}"`);c+=F}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Eg(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 nf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Eg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(yc(r))return 1;if(yc(s))return-1}return s.length-r.length}function yc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Cg={strict:!1,end:!0,sensitive:!1};function Ag(e,t,n){const r=Ig(kg(e.path),n),s=ct(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Rg(e,t){const n=[],r=new Map;t=uc(Cg,t);function s(h){return r.get(h)}function o(h,y,S){const L=!S,R=bc(h);R.aliasOf=S&&S.record;const q=uc(t,h),Y=[R];if("alias"in h){const G=typeof h.alias=="string"?[h.alias]:h.alias;for(const ce of G)Y.push(bc(ct({},R,{components:S?S.record.components:R.components,path:ce,aliasOf:S?S.record:R})))}let F,J;for(const G of Y){const{path:ce}=G;if(y&&ce[0]!=="/"){const ue=y.record.path,me=ue[ue.length-1]==="/"?"":"/";G.path=y.record.path+(ce&&me+ce)}if(F=Ag(G,y,q),S?S.alias.push(F):(J=J||F,J!==F&&J.alias.push(F),L&&h.name&&!_c(F)&&i(h.name)),rf(F)&&l(F),R.children){const ue=R.children;for(let me=0;me<ue.length;me++)o(ue[me],F,S&&S.children[me])}S=S||F}return J?()=>{i(J)}:js}function i(h){if(Zd(h)){const y=r.get(h);y&&(r.delete(h),n.splice(n.indexOf(y),1),y.children.forEach(i),y.alias.forEach(i))}else{const y=n.indexOf(h);y>-1&&(n.splice(y,1),h.record.name&&r.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function a(){return n}function l(h){const y=Mg(h,n);n.splice(y,0,h),h.record.name&&!_c(h)&&r.set(h.record.name,h)}function u(h,y){let S,L={},R,q;if("name"in h&&h.name){if(S=r.get(h.name),!S)throw ds(St.MATCHER_NOT_FOUND,{location:h});q=S.record.name,L=ct(wc(y.params,S.keys.filter(J=>!J.optional).concat(S.parent?S.parent.keys.filter(J=>J.optional):[]).map(J=>J.name)),h.params&&wc(h.params,S.keys.map(J=>J.name))),R=S.stringify(L)}else if(h.path!=null)R=h.path,S=n.find(J=>J.re.test(R)),S&&(L=S.parse(R),q=S.record.name);else{if(S=y.name?r.get(y.name):n.find(J=>J.re.test(y.path)),!S)throw ds(St.MATCHER_NOT_FOUND,{location:h,currentLocation:y});q=S.record.name,L=ct({},y.params,h.params),R=S.stringify(L)}const Y=[];let F=S;for(;F;)Y.unshift(F.record),F=F.parent;return{name:q,path:R,params:L,matched:Y,meta:xg(Y)}}e.forEach(h=>o(h));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function wc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function bc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Pg(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 Pg(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 _c(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xg(e){return e.reduce((t,n)=>ct(t,n.meta),{})}function Mg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;nf(e,t[o])<0?r=o:n=o+1}const s=Og(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Og(e){let t=e;for(;t=t.parent;)if(rf(t)&&nf(e,t)===0)return t}function rf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function kc(e){const t=wn(ai),n=wn(Za),r=ae(()=>{const l=ge(e.to);return t.resolve(l)}),s=ae(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],h=n.matched;if(!c||!h.length)return-1;const y=h.findIndex(us.bind(null,c));if(y>-1)return y;const S=Tc(l[u-2]);return u>1&&Tc(c)===S&&h[h.length-1].path!==S?h.findIndex(us.bind(null,l[u-2])):y}),o=ae(()=>s.value>-1&&jg(n.params,r.value.params)),i=ae(()=>s.value>-1&&s.value===n.matched.length-1&&Qd(n.params,r.value.params));function a(l={}){if(Lg(l)){const u=t[ge(e.replace)?"replace":"push"](ge(e.to)).catch(js);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:ae(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Ng(e){return e.length===1?e[0]:e}const $g=xt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:kc,setup(e,{slots:t}){const n=Qo(kc(e)),{options:r}=wn(ai),s=ae(()=>({[Sc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Sc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Ng(t.default(n));return e.custom?o:Xa("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Dg=$g;function Lg(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 jg(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(!Sn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Tc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Sc=(e,t,n)=>e??t??n,Ug=xt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=wn(wa),s=ae(()=>e.route||r.value),o=wn(mc,0),i=ae(()=>{let u=ge(o);const{matched:c}=s.value;let h;for(;(h=c[u])&&!h.components;)u++;return u}),a=ae(()=>s.value.matched[i.value]);bo(mc,ae(()=>i.value+1)),bo(hg,a),bo(wa,s);const l=N();return ft(()=>[l.value,a.value,e.name],([u,c,h],[y,S,L])=>{c&&(c.instances[h]=u,S&&S!==c&&u&&u===y&&(c.leaveGuards.size||(c.leaveGuards=S.leaveGuards),c.updateGuards.size||(c.updateGuards=S.updateGuards))),u&&c&&(!S||!us(c,S)||!y)&&(c.enterCallbacks[h]||[]).forEach(R=>R(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,h=a.value,y=h&&h.components[c];if(!y)return Ic(n.default,{Component:y,route:u});const S=h.props[c],L=S?S===!0?u.params:typeof S=="function"?S(u):S:null,q=Xa(y,ct({},L,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(h.instances[c]=null)},ref:l}));return Ic(n.default,{Component:q,route:u})||q}}});function Ic(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Bg=Ug;function Fg(e){const t=Rg(e.routes,e),n=e.parseQuery||dg,r=e.stringifyQuery||pc,s=e.history,o=Es(),i=Es(),a=Es(),l=Uh(hr);let u=hr;Zr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ni.bind(null,H=>""+H),h=Ni.bind(null,Km),y=Ni.bind(null,Js);function S(H,he){let de,_e;return Zd(H)?(de=t.getRecordMatcher(H),_e=he):_e=H,t.addRoute(_e,de)}function L(H){const he=t.getRecordMatcher(H);he&&t.removeRoute(he)}function R(){return t.getRoutes().map(H=>H.record)}function q(H){return!!t.getRecordMatcher(H)}function Y(H,he){if(he=ct({},he||l.value),typeof H=="string"){const P=$i(n,H,he.path),j=t.resolve({path:P.path},he),U=s.createHref(P.fullPath);return ct(P,j,{params:y(j.params),hash:Js(P.hash),redirectedFrom:void 0,href:U})}let de;if(H.path!=null)de=ct({},H,{path:$i(n,H.path,he.path).path});else{const P=ct({},H.params);for(const j in P)P[j]==null&&delete P[j];de=ct({},H,{params:h(P)}),he.params=h(he.params)}const _e=t.resolve(de,he),Ce=H.hash||"";_e.params=c(y(_e.params));const w=Xm(r,ct({},H,{hash:zm(Ce),path:_e.path})),k=s.createHref(w);return ct({fullPath:w,hash:Ce,query:r===pc?fg(H.query):H.query||{}},_e,{redirectedFrom:void 0,href:k})}function F(H){return typeof H=="string"?$i(n,H,l.value.path):ct({},H)}function J(H,he){if(u!==H)return ds(St.NAVIGATION_CANCELLED,{from:he,to:H})}function G(H){return me(H)}function ce(H){return G(ct(F(H),{replace:!0}))}function ue(H,he){const de=H.matched[H.matched.length-1];if(de&&de.redirect){const{redirect:_e}=de;let Ce=typeof _e=="function"?_e(H,he):_e;return typeof Ce=="string"&&(Ce=Ce.includes("?")||Ce.includes("#")?Ce=F(Ce):{path:Ce},Ce.params={}),ct({query:H.query,hash:H.hash,params:Ce.path!=null?{}:H.params},Ce)}}function me(H,he){const de=u=Y(H),_e=l.value,Ce=H.state,w=H.force,k=H.replace===!0,P=ue(de,_e);if(P)return me(ct(F(P),{state:typeof P=="object"?ct({},Ce,P.state):Ce,force:w,replace:k}),he||de);const j=de;j.redirectedFrom=he;let U;return!w&&Qm(r,_e,de)&&(U=ds(St.NAVIGATION_DUPLICATED,{to:j,from:_e}),Je(_e,_e,!0,!1)),(U?Promise.resolve(U):ee(j,_e)).catch(x=>Wn(x)?Wn(x,St.NAVIGATION_GUARD_REDIRECT)?x:Qe(x):Me(x,j,_e)).then(x=>{if(x){if(Wn(x,St.NAVIGATION_GUARD_REDIRECT))return me(ct({replace:k},F(x.to),{state:typeof x.to=="object"?ct({},Ce,x.to.state):Ce,force:w}),he||j)}else x=X(j,_e,!0,k,Ce);return ne(j,_e,x),x})}function Se(H,he){const de=J(H,he);return de?Promise.reject(de):Promise.resolve()}function le(H){const he=pt.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(H):H()}function ee(H,he){let de;const[_e,Ce,w]=pg(H,he);de=Li(_e.reverse(),"beforeRouteLeave",H,he);for(const P of _e)P.leaveGuards.forEach(j=>{de.push(vr(j,H,he))});const k=Se.bind(null,H,he);return de.push(k),De(de).then(()=>{de=[];for(const P of o.list())de.push(vr(P,H,he));return de.push(k),De(de)}).then(()=>{de=Li(Ce,"beforeRouteUpdate",H,he);for(const P of Ce)P.updateGuards.forEach(j=>{de.push(vr(j,H,he))});return de.push(k),De(de)}).then(()=>{de=[];for(const P of w)if(P.beforeEnter)if(Sn(P.beforeEnter))for(const j of P.beforeEnter)de.push(vr(j,H,he));else de.push(vr(P.beforeEnter,H,he));return de.push(k),De(de)}).then(()=>(H.matched.forEach(P=>P.enterCallbacks={}),de=Li(w,"beforeRouteEnter",H,he,le),de.push(k),De(de))).then(()=>{de=[];for(const P of i.list())de.push(vr(P,H,he));return de.push(k),De(de)}).catch(P=>Wn(P,St.NAVIGATION_CANCELLED)?P:Promise.reject(P))}function ne(H,he,de){a.list().forEach(_e=>le(()=>_e(H,he,de)))}function X(H,he,de,_e,Ce){const w=J(H,he);if(w)return w;const k=he===hr,P=Zr?history.state:{};de&&(_e||k?s.replace(H.fullPath,ct({scroll:k&&P&&P.scroll},Ce)):s.push(H.fullPath,Ce)),l.value=H,Je(H,he,de,k),Qe()}let Ee;function we(){Ee||(Ee=s.listen((H,he,de)=>{if(!Ne.listening)return;const _e=Y(H),Ce=ue(_e,Ne.currentRoute.value);if(Ce){me(ct(Ce,{replace:!0,force:!0}),_e).catch(js);return}u=_e;const w=l.value;Zr&&ig(hc(w.fullPath,de.delta),ii()),ee(_e,w).catch(k=>Wn(k,St.NAVIGATION_ABORTED|St.NAVIGATION_CANCELLED)?k:Wn(k,St.NAVIGATION_GUARD_REDIRECT)?(me(ct(F(k.to),{force:!0}),_e).then(P=>{Wn(P,St.NAVIGATION_ABORTED|St.NAVIGATION_DUPLICATED)&&!de.delta&&de.type===va.pop&&s.go(-1,!1)}).catch(js),Promise.reject()):(de.delta&&s.go(-de.delta,!1),Me(k,_e,w))).then(k=>{k=k||X(_e,w,!1),k&&(de.delta&&!Wn(k,St.NAVIGATION_CANCELLED)?s.go(-de.delta,!1):de.type===va.pop&&Wn(k,St.NAVIGATION_ABORTED|St.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ne(_e,w,k)}).catch(js)}))}let $e=Es(),Pe=Es(),ve;function Me(H,he,de){Qe(H);const _e=Pe.list();return _e.length?_e.forEach(Ce=>Ce(H,he,de)):console.error(H),Promise.reject(H)}function at(){return ve&&l.value!==hr?Promise.resolve():new Promise((H,he)=>{$e.add([H,he])})}function Qe(H){return ve||(ve=!H,we(),$e.list().forEach(([he,de])=>H?de(H):he()),$e.reset()),H}function Je(H,he,de,_e){const{scrollBehavior:Ce}=e;if(!Zr||!Ce)return Promise.resolve();const w=!de&&ag(hc(H.fullPath,0))||(_e||!de)&&history.state&&history.state.scroll||null;return $t().then(()=>Ce(H,he,w)).then(k=>k&&og(k)).catch(k=>Me(k,H,he))}const Ze=H=>s.go(H);let Ye;const pt=new Set,Ne={currentRoute:l,listening:!0,addRoute:S,removeRoute:L,clearRoutes:t.clearRoutes,hasRoute:q,getRoutes:R,resolve:Y,options:e,push:G,replace:ce,go:Ze,back:()=>Ze(-1),forward:()=>Ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Pe.add,isReady:at,install(H){H.component("RouterLink",Dg),H.component("RouterView",Bg),H.config.globalProperties.$router=Ne,Object.defineProperty(H.config.globalProperties,"$route",{enumerable:!0,get:()=>ge(l)}),Zr&&!Ye&&l.value===hr&&(Ye=!0,G(s.location).catch(_e=>{}));const he={};for(const _e in hr)Object.defineProperty(he,_e,{get:()=>l.value[_e],enumerable:!0});H.provide(ai,Ne),H.provide(Za,Zu(he)),H.provide(wa,l);const de=H.unmount;pt.add(H),H.unmount=function(){pt.delete(H),pt.size<1&&(u=hr,Ee&&Ee(),Ee=null,l.value=hr,Ye=!1,ve=!1),de()}}};function De(H){return H.reduce((he,de)=>he.then(()=>le(de)),Promise.resolve())}return Ne}function Hg(){return wn(ai)}function Vg(e){return wn(Za)}const Ec=768;function sf(){const e=N(typeof window<"u"?window.innerWidth<Ec:!1);let t=null;function n(r){e.value=r.matches}return ir(()=>{t=window.matchMedia(`(max-width: ${Ec-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ni(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Wg={key:0,class:"desktop-sidebar"},zg={class:"desktop-main"},Cc="codex-web-local.sidebar-width.v1",qg=260,Gg=620,Ac=320,Kg=xt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=sf();function r(u){return Math.min(Gg,Math.max(qg,u))}function s(){if(typeof window>"u")return Ac;const u=window.localStorage.getItem(Cc),c=Number(u);return Number.isFinite(c)?r(c):Ac}const o=N(s()),i=ae(()=>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(Cc,String(u))}function l(u){u.preventDefault();const c=u.clientX,h=o.value,y=L=>{const R=L.clientX-c;o.value=r(h+R)},S=()=>{a(o.value),window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",y),window.addEventListener("mouseup",S)}return(u,c)=>(_(),I("div",{class:it(["desktop-layout",{"is-mobile":ge(n)}]),style:Wr(i.value)},[ge(n)?(_(),dt(Mo,{key:0,to:"body"},[Re(zd,{name:"drawer"},{default:mt(()=>[e.isSidebarCollapsed?oe("",!0):(_(),I("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=h=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=ot(()=>{},["stop"]))},[$n(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):oe("",!0),ge(n)?oe("",!0):(_(),I(je,{key:1},[e.isSidebarCollapsed?oe("",!0):(_(),I("aside",Wg,[$n(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?oe("",!0):(_(),I("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",zg,[$n(u.$slots,"content",{},void 0)])],6))}}),rt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Jg=rt(Kg,[["__scopeId","data-v-df29c633"]]),Yg={},Xg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qg(e,t){return _(),I("svg",Xg,[...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 li=rt(Yg,[["render",Qg]]),Zg={},ev={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function tv(e,t){return _(),I("svg",ev,[...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 of=rt(Zg,[["render",tv]]),nv={},rv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sv(e,t){return _(),I("svg",rv,[...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 Cs=rt(nv,[["render",sv]]),ov={},iv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function av(e,t){return _(),I("svg",iv,[...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 Lo=rt(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 _(),I("svg",cv,[...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 el=rt(lv,[["render",uv]]),dv={},fv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function hv(e,t){return _(),I("svg",fv,[...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 pv=rt(dv,[["render",hv]]),mv={},gv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vv(e,t){return _(),I("svg",gv,[...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 So=rt(mv,[["render",vv]]),yv={},wv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function bv(e,t){return _(),I("svg",wv,[...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 ji=rt(yv,[["render",bv]]),_v={key:0,class:"sidebar-menu-row-left"},kv={class:"sidebar-menu-row-main"},Tv={key:1,class:"sidebar-menu-row-right"},Sv={key:0,class:"sidebar-menu-row-right-default"},Iv={key:1,class:"sidebar-menu-row-right-hover"},Ev=xt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=gp(),r=ae(()=>!!n.left),s=ae(()=>!!n.right),o=ae(()=>!!n["right-hover"]),i=ae(()=>s.value||o.value);return(a,l)=>(_(),dt(ca(t.as),Ud({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:mt(()=>[r.value?(_(),I("span",_v,[$n(a.$slots,"left",{},void 0,!0)])):oe("",!0),m("span",kv,[$n(a.$slots,"default",{},void 0,!0)]),i.value?(_(),I("span",Tv,[s.value?(_(),I("span",Sv,[$n(a.$slots,"right",{},void 0,!0)])):oe("",!0),o.value?(_(),I("span",Iv,[$n(a.$slots,"right-hover",{},void 0,!0)])):oe("",!0)])):oe("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Nr=rt(Ev,[["__scopeId","data-v-daeca4df"]]),Cv={class:"thread-tree-root"},Av={key:0,class:"pinned-section"},Rv={class:"thread-list"},Pv={class:"thread-left-stack"},xv=["data-state"],Mv=["onClick"],Ov=["onClick"],Nv={class:"thread-row-title-wrap"},$v={class:"thread-row-title"},Dv={class:"thread-row-time"},Lv=["onClick"],jv=["onClick"],Uv=["onClick"],Bv=["onClick"],Fv=["aria-expanded"],Hv=["data-active"],Vv={key:0},Wv=["data-active"],zv={key:0},qv={key:1,class:"thread-tree-no-results"},Gv={key:2,class:"thread-tree-loading"},Kv={key:3,class:"thread-list thread-list-global"},Jv={class:"thread-left-stack"},Yv=["data-state"],Xv=["onClick"],Qv=["onClick"],Zv={class:"thread-row-title-wrap"},ey={class:"thread-row-title"},ty={class:"thread-row-time"},ny=["onClick"],ry=["onClick"],sy=["onClick"],oy=["onClick"],iy=["data-project-name","data-expanded","data-dragging"],ay={class:"project-icon-stack"},ly={class:"project-icon-folder"},cy={class:"project-icon-chevron"},uy=["data-dragging-handle","onMousedown"],dy={class:"project-title"},fy={class:"project-hover-controls"},hy=["onClick"],py=["onClick"],my=["onClick"],gy=["onClick"],vy=["onInput"],yy=["aria-label","title","onClick"],wy={key:0,class:"thread-list"},by={class:"thread-left-stack"},_y=["data-state"],ky=["onClick"],Ty=["onClick"],Sy={class:"thread-row-title-wrap"},Iy={class:"thread-row-title"},Ey={class:"thread-row-time"},Cy=["onClick"],Ay=["onClick"],Ry=["onClick"],Py=["onClick"],xy=["onClick"],My={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Oy=["onKeydown"],Ny={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},$y={class:"rename-thread-subtitle"},Dy=4,Rc=6,Pc="codex-web-local.thread-view-mode.v1",xc="codex-web-local.collapsed-projects.v1",Ly=xt({__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=N({}),o=N({}),i=N([]),a=N(""),l=N(""),u=N("actions"),c=N(""),h=N(!1),y=N(""),S=N(""),L=N(null),R=N(!1),q=N(""),Y=N(""),F=N(null),J=N(null),G=N(null);let ce=null,ue=null;const me=N(""),Se=N({}),le=new Map,ee=new Map,ne=new Map,X=new WeakMap,Ee=N(null),we=N(!1),$e=N(Me()),Pe=typeof window<"u"?new ResizeObserver(E=>{for(const M of E){const O=M.target,Q=X.get(O);Q&&g(Q,O)}}):null;function ve(){if(typeof window>"u")return{};try{const E=window.localStorage.getItem(xc);if(!E)return{};const M=JSON.parse(E);return!M||typeof M!="object"||Array.isArray(M)?{}:M}catch{return{}}}function Me(){return typeof window>"u"?"project":window.localStorage.getItem(Pc)==="chronological"?"chronological":"project"}o.value=ve(),ft(o,E=>{typeof window>"u"||window.localStorage.setItem(xc,JSON.stringify(E))},{deep:!0}),ft($e,E=>{typeof window>"u"||window.localStorage.setItem(Pc,E)});const at=ae(()=>n.searchQuery.trim().toLowerCase()),Qe=ae(()=>at.value.length>0),Je=ae(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ze(E){if(!Qe.value)return!0;if(Je.value)return Je.value.has(E.id);const M=at.value;return E.title.toLowerCase().includes(M)||E.preview.toLowerCase().includes(M)}const Ye=ae(()=>Qe.value?n.groups.map(E=>({...E,threads:E.threads.filter(Ze)})).filter(E=>E.threads.length>0):n.groups),pt=ae(()=>$e.value==="chronological"),Ne=ae(()=>{const E=Ye.value,M=[];for(const O of E)for(const Q of O.threads)k(Q.id)||M.push(Q);return M.sort((O,Q)=>{const Fe=new Date(O.updatedAtIso||O.createdAtIso).getTime();return new Date(Q.updatedAtIso||Q.createdAtIso).getTime()-Fe})}),De=ae(()=>{const E=new Map;for(const M of n.groups)for(const O of M.threads)E.set(O.id,O);return E}),H=ae(()=>i.value.map(E=>De.value.get(E)??null).filter(E=>E!==null).filter(Ze)),he=ae(()=>{const E=G.value;if(!E||E.dropTargetIndexFull===null||n.groups.length===0)return null;const M=Math.max(0,Math.min(E.dropTargetIndexFull,n.groups.length)),O=M>E.fromIndex?M-1:M,Q=Math.max(0,Math.min(O,n.groups.length-1));return Q===E.fromIndex?null:Q}),de=ae(()=>{const M=(Qe.value?Ye.value:n.groups).map(en=>en.projectName),O=G.value,Q=he.value;if(!O||Q===null)return M;const Fe=[...M],[Ct]=Fe.splice(O.fromIndex,1);return Ct?(Fe.splice(Q,0,Ct),Fe):M}),_e=ae(()=>{const E={};let M=0;for(const O of de.value)E[O]=M,M+=Tt(O);return E}),Ce=ae(()=>{let E=0;for(const M of de.value)E+=Tt(M);return{height:`${Math.max(0,E)}px`}});function w(E){const M=new Date(E).getTime();if(Number.isNaN(M))return"n/a";const O=Math.abs(Date.now()-M);if(O<6e4)return"now";const Q=Math.floor(O/6e4);if(Q<60)return`${Q}m`;const Fe=Math.floor(Q/60);return Fe<24?`${Fe}h`:`${Math.floor(Fe/24)}d`}function k(E){return i.value.includes(E)}function P(E){if(k(E)){i.value=i.value.filter(M=>M!==E);return}i.value=[E,...i.value]}function j(E){r("select",E)}function U(E){r("export-thread",E),V()}function x(E){return`start new thread ${He(E)}`}function $(E){r("start-new-thread",E)}function W(E){l.value===E&&V()}function K(E){return l.value===E}function V(){l.value=""}function ke(E){if(l.value===E){V();return}l.value=E}function pe(E,M){y.value=E,S.value=M,h.value=!0,V(),$t(()=>{var O,Q;(O=L.value)==null||O.focus(),(Q=L.value)==null||Q.select()})}function fe(){h.value=!1,y.value="",S.value=""}function Ae(){const E=y.value,M=S.value.trim();!E||!M||(r("rename-thread",{threadId:E,title:M}),fe())}function Le(E,M){q.value=E,Y.value=M,R.value=!0,V()}function qe(){R.value=!1,q.value="",Y.value=""}function We(){const E=q.value;E&&(i.value=i.value.filter(M=>M!==E),r("archive",E),qe())}function He(E){return n.projectDisplayNameById[E]??E}function tt(E){return a.value===E}function ze(){a.value="",u.value="actions",c.value=""}function et(){we.value=!we.value}function It(E){$e.value=E,we.value=!1}function Zt(E){if(a.value===E){ze();return}a.value=E,u.value="actions",c.value=He(E)}function nt(E){a.value=E,u.value="rename",c.value=He(E)}function gt(E){r("rename-project",{projectName:E,displayName:c.value})}function Lt(E){r("remove-project",E),ze()}function jt(E){r("browse-project-files",E),ze()}function Mt(E,M){if(!E.altKey||E.key!=="ArrowUp"&&E.key!=="ArrowDown")return;const O=n.groups.findIndex(Ct=>Ct.projectName===M);if(O<0)return;const Q=E.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(O+Q,n.groups.length-1));Fe!==O&&(E.preventDefault(),r("reorder-project",{projectName:M,toIndex:Fe}))}function Ut(E){return s.value[E]===!0}function Oe(E){return o.value[E]===!0}function xe(E){s.value={...s.value,[E]:!Ut(E)}}function Bt(E){if(me.value===E){me.value="";return}o.value={...o.value,[E]:!Oe(E)}}function Tt(E){const M=Se.value[E]??0,O=G.value,Fe=((O==null?void 0:O.projectName)===E?O.groupHeight:null)??M,Ct=Oe(E)?0:Rc;return Math.max(0,Fe+Ct)}function Ot(E,M){const O=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(O){ee.set(E,O);return}ee.delete(E)}function an(E,M){const O=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(O){ne.set(E,O);return}ne.delete(E)}function ln(E){const M=a.value;if(!M)return!1;const O=ee.get(M);if(!O)return!1;if((typeof E.composedPath=="function"?E.composedPath():[]).includes(O))return!0;const Fe=E.target;return Fe instanceof Node?O.contains(Fe):!1}function cn(E){const M=l.value;if(!M)return!1;const O=ne.get(M);if(!O)return!1;if((typeof E.composedPath=="function"?E.composedPath():[]).includes(O))return!0;const Fe=E.target;return Fe instanceof Node?O.contains(Fe):!1}function mn(E){if(we.value){const M=Ee.value,O=typeof E.composedPath=="function"?E.composedPath():[];!!M&&(O.includes(M)||E.target instanceof Node&&M.contains(E.target))||(we.value=!1)}a.value&&(ln(E)||ze(),l.value&&(cn(E)||V()))}function In(E){a.value&&!ln(E)&&ze(),l.value&&!cn(E)&&V()}function rn(){we.value&&(we.value=!1),a.value&&ze(),l.value&&V()}function D(){window.addEventListener("pointerdown",mn,{capture:!0}),window.addEventListener("focusin",In,{capture:!0}),window.addEventListener("blur",rn)}function f(){window.removeEventListener("pointerdown",mn,{capture:!0}),window.removeEventListener("focusin",In,{capture:!0}),window.removeEventListener("blur",rn)}function g(E,M){const O=M.getBoundingClientRect().height;if(!Number.isFinite(O)||O<=0)return;const Q=Se.value[E];Q!==void 0&&Math.abs(Q-O)<.5||(Se.value={...Se.value,[E]:O})}function T(E,M){const O=le.get(E);O&&O!==M&&Pe&&Pe.unobserve(O);const Q=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(Q){le.set(E,Q),X.set(Q,E),g(E,Q),Pe==null||Pe.observe(Q);return}O&&(Pe==null||Pe.unobserve(O)),le.delete(E)}function B(E,M){if(E.button!==0||J.value||G.value)return;const O=n.groups.findIndex(en=>en.projectName===M),Q=le.get(M);if(O<0||!Q)return;const Fe=Q.getBoundingClientRect(),Ct=Oe(M)?0:Rc;J.value={projectName:M,fromIndex:O,startClientX:E.clientX,startClientY:E.clientY,pointerOffsetY:E.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+Ct},E.preventDefault(),ie()}function ie(){window.addEventListener("mousemove",Ie),window.addEventListener("mouseup",Te),window.addEventListener("keydown",Be)}function re(){window.removeEventListener("mousemove",Ie),window.removeEventListener("mouseup",Te),window.removeEventListener("keydown",Be)}function Ie(E){ce={clientX:E.clientX,clientY:E.clientY},st()}function Te(E){Et({clientX:E.clientX,clientY:E.clientY});const M=G.value;if(M&&he.value!==null){const O=n.groups.findIndex(Q=>Q.projectName===M.projectName);if(O>=0){const Q=he.value;Q!==O&&r("reorder-project",{projectName:M.projectName,toIndex:Q})}}Ke()}function Be(E){E.key==="Escape"&&(!J.value&&!G.value||(E.preventDefault(),Ke()))}function Ke(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ce=null,J.value=null,G.value=null,me.value="",re()}function st(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ce)return;const E=ce;ce=null,Et(E)}))}function Et(E){const M=J.value;if(!G.value&&M){const O=E.clientX-M.startClientX,Q=E.clientY-M.startClientY;if(Math.hypot(O,Q)<Dy)return;ze(),me.value=M.projectName,G.value={projectName:M.projectName,fromIndex:M.fromIndex,pointerOffsetY:M.pointerOffsetY,groupLeft:M.groupLeft,groupWidth:M.groupWidth,groupHeight:M.groupHeight,groupOuterHeight:M.groupOuterHeight,ghostTop:E.clientY-M.pointerOffsetY,dropTargetIndexFull:null}}G.value&&Pt(E)}function Pt(E){const M=G.value;if(!M)return;if(M.ghostTop=E.clientY-M.pointerOffsetY,!gn(E)){M.dropTargetIndexFull=null;return}const O=E.clientY,Q=F.value;if(!Q){M.dropTargetIndexFull=null;return}const Fe=Q.getBoundingClientRect(),Ct=new Map(n.groups.map((sn,ur)=>[sn.projectName,ur])),en=n.groups.map(sn=>sn.projectName).filter(sn=>sn!==M.projectName);let Kr=0,Bn=n.groups.length;for(const sn of en){const ur=Ct.get(sn);if(ur===void 0)continue;const dr=Tt(sn),bs=Fe.top+Kr+dr/2;if(O<bs){Bn=ur;break}Kr+=dr}M.dropTargetIndexFull=Bn}function gn(E){const M=F.value;if(!M)return!1;const O=M.getBoundingClientRect(),Q=E.clientX>=O.left&&E.clientX<=O.right,Fe=E.clientY>=O.top-32&&E.clientY<=O.bottom+32;return Q&&Fe}function qr(E){var M;return((M=G.value)==null?void 0:M.projectName)===E}function ys(E){const M=G.value,O=_e.value[E]??0,Q=a.value===E;return!M||M.projectName!==E?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Q?"40":"1",transform:`translate3d(0, ${O}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${M.groupLeft}px`,width:`${M.groupWidth}px`,height:`${M.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${M.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function lr(E){return E.threads.filter(M=>!k(M.id))}function ws(E){if(Qe.value)return lr(E);if(Oe(E.projectName))return[];const M=lr(E);return Ut(E.projectName)?M:M.slice(0,10)}function cr(E){return Qe.value?!1:!Oe(E.projectName)&&lr(E).length>10}function Gr(E){return lr(E).length>0}function Cr(E){return E.inProgress?"working":E.unread?"unread":"idle"}ft(()=>n.groups.map(E=>E.projectName),E=>{var Fe,Ct;const M=((Fe=G.value)==null?void 0:Fe.projectName)??((Ct=J.value)==null?void 0:Ct.projectName)??"";M&&!n.groups.some(en=>en.projectName===M)&&Ke();const O=new Set(E),Q=Object.fromEntries(Object.entries(Se.value).filter(([en])=>O.has(en)));Object.keys(Q).length!==Object.keys(Se.value).length&&(Se.value=Q)});const Un=ae(()=>we.value||a.value!=="");return ft(Un,E=>{if(E){D();return}f()}),ar(()=>{for(const E of le.values())Pe==null||Pe.unobserve(E);le.clear(),ee.clear(),f(),Ke()}),(E,M)=>(_(),I("section",Cv,[H.value.length>0?(_(),I("section",Av,[m("ul",Rv,[(_(!0),I(je,null,bt(H.value,O=>(_(),I("li",{key:O.id,class:"thread-row-item"},[Re(Nr,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":k(O.id),onMouseleave:Q=>W(O.id)},{left:mt(()=>[m("span",Pv,[O.inProgress||O.unread?(_(),I("span",{key:0,class:"thread-status-indicator","data-state":Cr(O)},null,8,xv)):oe("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>P(O.id)},[Re(ji,{class:"thread-icon"})],8,Mv)])]),right:mt(()=>[m("span",Dv,se(w(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":mt(()=>[m("div",{ref_for:!0,ref:Q=>an(O.id,Q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ot(Q=>ke(O.id),["stop"])},[Re(Cs,{class:"thread-icon"})],8,Lv),K(O.id)?(_(),I("div",{key:0,class:"thread-menu-panel",onClick:M[0]||(M[0]=ot(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Q=>U(O.id)}," Export chat ",8,jv),m("button",{class:"thread-menu-item",type:"button",onClick:Q=>pe(O.id,O.title)}," Rename thread ",8,Uv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Le(O.id,O.title)}," Delete thread ",8,Bv)])):oe("",!0)],512)]),default:mt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Q=>j(O.id)},[m("span",Nv,[m("span",$v,se(O.title),1),O.hasWorktree?(_(),dt(So,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):oe("",!0)])],8,Ov)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):oe("",!0),Re(Nr,{as:"header",class:"thread-tree-header-row"},{right:mt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Ee,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":we.value,"aria-label":"Organize threads",title:"Organize threads",onClick:et},[Re(Cs,{class:"thread-icon"})],8,Fv),we.value?(_(),I("div",{key:0,class:"organize-menu-panel",onClick:M[3]||(M[3]=ot(()=>{},["stop"]))},[M[11]||(M[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":$e.value==="project",type:"button",onClick:M[1]||(M[1]=O=>It("project"))},[M[9]||(M[9]=m("span",null,"By project",-1)),$e.value==="project"?(_(),I("span",Vv,"✓")):oe("",!0)],8,Hv),m("button",{class:"organize-menu-item","data-active":$e.value==="chronological",type:"button",onClick:M[2]||(M[2]=O=>It("chronological"))},[M[10]||(M[10]=m("span",null,"Chronological list",-1)),$e.value==="chronological"?(_(),I("span",zv,"✓")):oe("",!0)],8,Wv)])):oe("",!0)],512)]),default:mt(()=>[M[12]||(M[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Qe.value&&Ye.value.length===0?(_(),I("p",qv,"No matching threads")):e.isLoading&&e.groups.length===0?(_(),I("p",Gv,"Loading threads...")):pt.value?(_(),I("ul",Kv,[(_(!0),I(je,null,bt(Ne.value,O=>(_(),I("li",{key:O.id,class:"thread-row-item"},[Re(Nr,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":k(O.id),onMouseleave:Q=>W(O.id)},{left:mt(()=>[m("span",Jv,[O.inProgress||O.unread?(_(),I("span",{key:0,class:"thread-status-indicator","data-state":Cr(O)},null,8,Yv)):oe("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>P(O.id)},[Re(ji,{class:"thread-icon"})],8,Xv)])]),right:mt(()=>[m("span",ty,se(w(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":mt(()=>[m("div",{ref_for:!0,ref:Q=>an(O.id,Q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ot(Q=>ke(O.id),["stop"])},[Re(Cs,{class:"thread-icon"})],8,ny),K(O.id)?(_(),I("div",{key:0,class:"thread-menu-panel",onClick:M[4]||(M[4]=ot(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Q=>U(O.id)}," Export chat ",8,ry),m("button",{class:"thread-menu-item",type:"button",onClick:Q=>pe(O.id,O.title)}," Rename thread ",8,sy),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Le(O.id,O.title)}," Delete thread ",8,oy)])):oe("",!0)],512)]),default:mt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Q=>j(O.id)},[m("span",Zv,[m("span",ey,se(O.title),1),O.hasWorktree?(_(),dt(So,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):oe("",!0)])],8,Qv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),I("div",{key:4,ref_key:"groupsContainerRef",ref:F,class:"thread-tree-groups",style:Wr(Ce.value)},[(_(!0),I(je,null,bt(Ye.value,O=>(_(),I("article",{key:O.projectName,ref_for:!0,ref:Q=>T(O.projectName,Q),class:"project-group","data-project-name":O.projectName,"data-expanded":!Oe(O.projectName),"data-dragging":qr(O.projectName),style:Wr(ys(O.projectName))},[Re(Nr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Q=>Bt(O.projectName),onKeydown:[Q=>Mt(Q,O.projectName),Yt(ot(Q=>Bt(O.projectName),["prevent"]),["enter"]),Yt(ot(Q=>Bt(O.projectName),["prevent"]),["space"])]},{left:mt(()=>[m("span",ay,[m("span",ly,[Oe(O.projectName)?(_(),dt(el,{key:0,class:"thread-icon"})):(_(),dt(pv,{key:1,class:"thread-icon"}))]),m("span",cy,[Oe(O.projectName)?(_(),dt(of,{key:0,class:"thread-icon"})):(_(),dt(li,{key:1,class:"thread-icon"}))])])]),right:mt(()=>[m("div",fy,[m("div",{ref_for:!0,ref:Q=>Ot(O.projectName,Q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ot(Q=>Zt(O.projectName),["stop"])},[Re(Cs,{class:"thread-icon"})],8,hy),tt(O.projectName)?(_(),I("div",{key:0,class:"project-menu-panel",onClick:M[6]||(M[6]=ot(()=>{},["stop"]))},[u.value==="actions"?(_(),I(je,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:Q=>jt(O.projectName)}," Browse files ",8,py),m("button",{class:"project-menu-item",type:"button",onClick:Q=>nt(O.projectName)}," Edit name ",8,my),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Q=>Lt(O.projectName)}," Remove ",8,gy)],64)):(_(),I(je,{key:1},[M[13]||(M[13]=m("label",{class:"project-menu-label"},"Project name",-1)),tr(m("input",{"onUpdate:modelValue":M[5]||(M[5]=Q=>c.value=Q),class:"project-menu-input",type:"text",onInput:Q=>gt(O.projectName)},null,40,vy),[[nr,c.value]])],64))])):oe("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":x(O.projectName),title:x(O.projectName),onClick:ot(Q=>$(O.projectName),["stop"])},[Re(Lo,{class:"thread-icon"})],8,yy)])]),default:mt(()=>[m("span",{class:"project-main-button","data-dragging-handle":qr(O.projectName),onMousedown:ot(Q=>B(Q,O.projectName),["left"])},[m("span",dy,se(He(O.projectName)),1)],40,uy)]),_:2},1032,["onClick","onKeydown"]),Gr(O)?(_(),I("ul",wy,[(_(!0),I(je,null,bt(ws(O),Q=>(_(),I("li",{key:Q.id,class:"thread-row-item"},[Re(Nr,{class:"thread-row","data-active":Q.id===e.selectedThreadId,"data-pinned":k(Q.id),onMouseleave:Fe=>W(Q.id)},{left:mt(()=>[m("span",by,[Q.inProgress||Q.unread?(_(),I("span",{key:0,class:"thread-status-indicator","data-state":Cr(Q)},null,8,_y)):oe("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>P(Q.id)},[Re(ji,{class:"thread-icon"})],8,ky)])]),right:mt(()=>[m("span",Ey,se(w(Q.createdAtIso||Q.updatedAtIso)),1)]),"right-hover":mt(()=>[m("div",{ref_for:!0,ref:Fe=>an(Q.id,Fe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ot(Fe=>ke(Q.id),["stop"])},[Re(Cs,{class:"thread-icon"})],8,Cy),K(Q.id)?(_(),I("div",{key:0,class:"thread-menu-panel",onClick:M[7]||(M[7]=ot(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Fe=>U(Q.id)}," Export chat ",8,Ay),m("button",{class:"thread-menu-item",type:"button",onClick:Fe=>pe(Q.id,Q.title)}," Rename thread ",8,Ry),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>Le(Q.id,Q.title)}," Delete thread ",8,Py)])):oe("",!0)],512)]),default:mt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Fe=>j(Q.id)},[m("span",Sy,[m("span",Iy,se(Q.title),1),Q.hasWorktree?(_(),dt(So,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):oe("",!0)])],8,Ty)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),dt(Nr,{key:1,as:"p",class:"project-empty-row"},{left:mt(()=>[...M[14]||(M[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:mt(()=>[M[15]||(M[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),cr(O)?(_(),dt(Nr,{key:2,class:"thread-show-more-row"},{left:mt(()=>[...M[16]||(M[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:mt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:Q=>xe(O.projectName)},se(Ut(O.projectName)?"Show less":"Show more"),9,xy)]),_:2},1024)):oe("",!0)],12,iy))),128))],4)),(_(),dt(Mo,{to:"body"},[h.value?(_(),I("div",{key:0,class:"rename-thread-overlay",onClick:ot(fe,["self"])},[m("div",My,[M[17]||(M[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),M[18]||(M[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),tr(m("input",{ref_key:"renameThreadInputRef",ref:L,"onUpdate:modelValue":M[8]||(M[8]=O=>S.value=O),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(ot(Ae,["prevent"]),["enter"]),Yt(ot(fe,["prevent"]),["esc"])]},null,40,Oy),[[nr,S.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:fe},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Ae},"Save")])])])):oe("",!0)])),(_(),dt(Mo,{to:"body"},[R.value?(_(),I("div",{key:0,class:"rename-thread-overlay",onClick:ot(qe,["self"])},[m("div",Ny,[M[19]||(M[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",$y,' This will archive the thread "'+se(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:qe},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:We},"Delete")])])])):oe("",!0)]))]))}}),jy=rt(Ly,[["__scopeId","data-v-e2f8a8e1"]]),Uy={class:"content-header"},By={class:"content-leading"},Fy={class:"content-title"},Hy={class:"content-actions"},Vy=xt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(_(),I("header",Uy,[m("div",By,[$n(t.$slots,"leading",{},void 0)]),m("h1",Fy,se(e.title),1),m("div",Hy,[$n(t.$slots,"actions",{},void 0)])]))}}),Wy=rt(Vy,[["__scopeId","data-v-66ee223c"]]),zy={},qy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gy(e,t){return _(),I("svg",qy,[...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 tl=rt(zy,[["render",Gy]]),Ky={},Jy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Yy(e,t){return _(),I("svg",Jy,[...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 Xy=rt(Ky,[["render",Yy]]),Qy={},Zy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ew(e,t){return _(),I("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 tw=rt(Qy,[["render",ew]]),nw={class:"conversation-root"},rw={key:0,class:"conversation-loading"},sw={key:1,class:"conversation-empty"},ow={class:"message-row"},iw={class:"message-stack"},aw={class:"request-card"},lw={class:"request-title"},cw={class:"request-meta"},uw={key:0,class:"request-reason"},dw={key:1,class:"request-actions"},fw=["onClick"],hw=["onClick"],pw=["onClick"],mw=["onClick"],gw={key:2,class:"request-actions"},vw=["onClick"],yw=["onClick"],ww=["onClick"],bw=["onClick"],_w={key:3,class:"request-user-input"},kw={class:"request-question-title"},Tw={key:0,class:"request-question-text"},Sw=["value","onChange"],Iw=["value"],Ew=["value","onInput"],Cw=["onClick"],Aw={key:4,class:"request-actions"},Rw=["onClick"],Pw=["onClick"],xw={key:5,class:"request-actions"},Mw=["onClick"],Ow=["onClick"],Nw={key:0,class:"conversation-item conversation-item-load-older"},$w={class:"message-row"},Dw={class:"message-stack"},Lw={class:"conversation-load-older-hint"},jw=["data-role","data-message-type"],Uw={key:0,class:"message-row","data-role":"system"},Bw={class:"message-stack","data-role":"system"},Fw=["onClick"],Hw={class:"cmd-label"},Vw={class:"cmd-status"},Ww={class:"cmd-output-inner"},zw={class:"cmd-output"},qw=["data-role","data-message-type"],Gw=["data-role"],Kw=["data-role"],Jw=["data-role"],Yw=["onClick"],Xw=["src"],Qw={key:1,class:"message-file-attachments"},Zw=["href","title"],eb=["data-role"],tb={key:0,class:"worked-separator-wrap","aria-live":"polite"},nb=["onClick"],rb={class:"worked-separator-text"},sb={key:0,class:"worked-details"},ob=["onClick"],ib={class:"cmd-label"},ab={class:"cmd-status"},lb={class:"cmd-output-inner"},cb={class:"cmd-output"},ub={key:1,class:"message-text-flow"},db={key:0,class:"message-text"},fb={key:0},hb={key:1,class:"message-bold-text"},pb=["href","title"],mb=["href","title"],gb={key:4,class:"message-inline-code"},vb={key:1,class:"message-text"},yb=["onClick"],wb=["src","alt","onError"],bb={key:0,class:"message-actions"},_b=["onClick"],kb=["onClick"],Tb={key:1,class:"conversation-item conversation-item-overlay"},Sb={class:"message-row"},Ib={class:"message-stack"},Eb={class:"live-overlay-inline","aria-live":"polite"},Cb={class:"live-overlay-label"},Ab={key:1,class:"live-overlay-error"},Rb=["src"],Pb=16,As=10,xb=xt({__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=N(new Set),r=N(new Set),s=N(new Set),o=N({});function i(f){return f.messageType==="commandExecution"&&!!f.commandExecution}function a(f){var g;return((g=f.commandExecution)==null?void 0:g.status)==="inProgress"||r.value.has(f.id)?!0:n.value.has(f.id)}function l(f){return r.value.has(f.id)}function u(f){var T;if(((T=f.commandExecution)==null?void 0:T.status)==="inProgress")return;const g=new Set(n.value);g.has(f.id)?g.delete(f.id):g.add(f.id),n.value=g}function c(f){const g=new Set(s.value);g.has(f.id)?g.delete(f.id):g.add(f.id),s.value=g}function h(f){return s.value.has(f.id)}function y(f){const g=f.commandExecution;if(!g)return"";switch(g.status){case"inProgress":return"⟳ Running";case"completed":return g.exitCode===0?"✓ Completed":`✗ Exit ${g.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function S(f){var T,B;const g=(T=f.commandExecution)==null?void 0:T.status;return g==="inProgress"?"cmd-status-running":g==="completed"&&((B=f.commandExecution)==null?void 0:B.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function L(f){const g=new Set(r.value);g.add(f),r.value=g,setTimeout(()=>{const T=new Set(r.value);T.delete(f),r.value=T},1e3)}function R(f,g){const T=[];for(let B=g-1;B>=0;B--){const ie=f[B];if(ie.messageType==="commandExecution")T.unshift(ie);else if(ie.role==="user"||ie.messageType==="worked")break}return T}async function q(){const f=J.value;if(!f||$e.value||!ve.value)return;$e.value=!0;const g=f.scrollHeight,T=Math.min(Y.messages.length,we.value+As);we.value=T,await $t();const B=f.scrollHeight,ie=Math.max(0,B-g);f.scrollTop=f.scrollTop+ie,Lt(f),$e.value=!1}const Y=e,F=t,J=N(null),G=N(null),ce=N(null),ue=N(""),me=N({}),Se=N({});let le=0,ee=0,ne=0;const X=new WeakSet,Ee=N(new Set),we=N(As),$e=N(!1),Pe=ae(()=>{const f=Math.max(0,we.value);return f===0?[]:Y.messages.slice(-f)}),ve=ae(()=>Pe.value.length<Y.messages.length);function Me(f){if(!f||/\s/u.test(f)||f.endsWith("/")||f.endsWith("\\"))return!1;if(f.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(f))return!1;const g=f.startsWith("/"),T=/^[A-Za-z]:[\\/]/u.test(f),B=f.startsWith("./")||f.startsWith("../")||f.startsWith("~/"),ie=f.includes("/")||f.includes("\\");return g||T||B||ie}function at(f){return f.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||f}function Qe(f){return f.replace(/\\/gu,"/")}function Je(f){if(!f.startsWith("file://"))return f;let g=f.replace(/^file:\/\//u,"");try{g=decodeURIComponent(g)}catch{}return/^\/[A-Za-z]:\//u.test(g)&&(g=g.slice(1)),g}function Ze(f){const g=Qe(f),T=g.match(/^\/Users\/([^/]+)/u);if(T)return`/Users/${T[1]}`;const B=g.match(/^\/home\/([^/]+)/u);return B?`/home/${B[1]}`:""}function Ye(f){const g=Qe(f);if(!g)return g;let T="",B=g;const ie=B.match(/^([A-Za-z]:)(\/.*)?$/u);ie?(T=`${ie[1]}/`,B=(ie[2]??"").replace(/^\/+/u,"")):B.startsWith("/")&&(T="/",B=B.slice(1));const re=B.split("/").filter(Boolean),Ie=[];for(const Be of re)if(Be!=="."){if(Be===".."){Ie.length>0&&Ie.pop();continue}Ie.push(Be)}const Te=Ie.join("/");return T?`${T}${Te}`.replace(/\/+$/u,"")||T:Te||g}function pt(f,g){const T=Qe(Je(f.trim()));if(!T)return"";if(T.startsWith("/")||/^[A-Za-z]:\//u.test(T))return Ye(T);if(T.startsWith("~/")){const re=Ze(g);if(re)return Ye(`${re}/${T.slice(2)}`)}const ie=Qe(g.trim());return Ye(ie?`${ie.replace(/\/+$/u,"")}/${T}`:T)}function Ne(f){if(!f)return null;let g=f.trim();g=De(g).core.trim();let B=null;const ie=g.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ie)g=ie[1],B=Number(ie[2]);else{const re=g.match(/^(.*):(\d+)(?::\d+)?$/u);re&&(g=re[1],B=Number(re[2]))}return g=Je(g),Me(g)?{path:g,line:B}:null}function De(f){let g=f,T="",B="";for(;/^[('"`[{<“‘]/u.test(g);)T+=g[0],g=g.slice(1);for(;/[)"'`\]}>”’]$/u.test(g);)B=g.slice(-1)+B,g=g.slice(0,-1);return{core:g,leading:T,trailing:B}}function H(f){const T=f.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!T)return null;const B=(T[1]??"").trim(),ie=(T[2]??"").trim(),re=De(B).core.trim()||B,Ie=De(ie).core.trim();return Ie?{label:re,target:Ie}:null}function he(f){const g=[],T=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let B=0;for(const ie of f.matchAll(T)){if(typeof ie.index!="number")continue;const re=ie.index,Ie=re+ie[0].length;re>B&&g.push({kind:"text",value:f.slice(B,re)});let Te=ie[0],Be="";for(;/[.,;:]$/u.test(Te);)Be=Te.slice(-1)+Be,Te=Te.slice(0,-1);const Ke=De(Te);Te=Ke.core;const st=Ke.leading,Et=Ke.trailing+Be;if(st&&g.push({kind:"text",value:st}),Te.startsWith("**")&&Te.endsWith("**")&&Te.length>4)g.push({kind:"bold",value:Te.slice(2,-2)}),Et&&g.push({kind:"text",value:Et});else if(/^https?:\/\//u.test(Te))g.push({kind:"url",value:Te,href:Te}),Et&&g.push({kind:"text",value:Et});else{const Pt=Ne(Te);Pt?(g.push({kind:"file",value:Te,path:Pt.path,displayPath:Te,downloadName:at(Pt.path)}),Et&&g.push({kind:"text",value:Et})):g.push({kind:"text",value:ie[0]})}B=Ie}return B<f.length&&g.push({kind:"text",value:f.slice(B)}),de(g)}function de(f){const g=[];let T=!1,B="";const ie=re=>{re&&g.push({kind:"text",value:re})};for(const re of f){if(re.kind!=="text"){T&&(ie(`**${B}`),T=!1,B=""),g.push(re);continue}let Ie=re.value;for(;Ie.length>0;){const Te=Ie.indexOf("**");if(Te<0){T?B+=Ie:ie(Ie);break}const Be=Ie.slice(0,Te);T?B+=Be:ie(Be),Ie=Ie.slice(Te+2),T?(B.length>0?g.push({kind:"bold",value:B}):ie("****"),B="",T=!1):T=!0}}return T&&ie(`**${B}`),g}function _e(f){const g=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,T=[];let B=0;for(const ie of f.matchAll(g)){if(typeof ie.index!="number")continue;const[re,Ie,Te]=ie,Be=ie.index,Ke=Be+re.length;Be>B&&T.push(...he(f.slice(B,Be)));const st=H(`[${Ie??""}](${Te??""})`),Et=(st==null?void 0:st.label)??(Ie??"").trim(),Pt=(st==null?void 0:st.target)??(Te??"").trim();if(/^https?:\/\//u.test(Pt))T.push({kind:"url",value:Et||Pt,href:Pt});else{const gn=Ne(Pt);gn?T.push({kind:"file",value:Pt,path:gn.path,displayPath:Et||Pt,downloadName:at(gn.path)}):T.push({kind:"text",value:re})}B=Ke}return B<f.length&&T.push(...he(f.slice(B))),T}function Ce(f){if(!f.includes("`"))return _e(f);const g=[];let T=0,B=0;for(;T<f.length;){if(f[T]!=="`"){T+=1;continue}let ie=1;for(;T+ie<f.length&&f[T+ie]==="`";)ie+=1;const re="`".repeat(ie);let Ie=T+ie,Te=-1;for(;Ie<f.length;){const Ke=f.indexOf(re,Ie);if(Ke<0)break;const st=Ke>0&&f[Ke-1]==="`",Et=Ke+ie<f.length&&f[Ke+ie]==="`",Pt=f.slice(T+ie,Ke).includes(`
26
- `);if(!st&&!Et&&!Pt){Te=Ke;break}Ie=Ke+1}if(Te<0){T+=ie;continue}T>B&&g.push(..._e(f.slice(B,T)));const Be=f.slice(T+ie,Te);if(Be.length>0){const Ke=H(Be);if(Ke)if(/^https?:\/\//u.test(Ke.target))g.push({kind:"url",value:Ke.label||Ke.target,href:Ke.target});else{const st=Ne(Ke.target);st?g.push({kind:"file",value:Ke.target,path:st.path,displayPath:Ke.label||Ke.target,downloadName:at(st.path)}):g.push({kind:"code",value:Be})}else{const st=Ne(Be);if(st){const Et=st.line?`${st.path}:${String(st.line)}`:st.path;g.push({kind:"file",value:Be,path:st.path,displayPath:Et,downloadName:at(st.path)})}else g.push({kind:"code",value:Be})}}else g.push({kind:"text",value:`${re}${re}`});T=Te+ie,B=T}return B<f.length&&g.push(..._e(f.slice(B))),g}function w(f){const g=f.trim();if(!g)return"";if(g.startsWith("data:")||g.startsWith("blob:")||g.startsWith("http://")||g.startsWith("https://")||g.startsWith("/codex-local-image?"))return g;if(g.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(g)}`;const T=g.startsWith("/"),B=/^[A-Za-z]:[\\/]/u.test(g);return T||B?`/codex-local-image?path=${encodeURIComponent(g)}`:g}function k(f){const g=f.trim();if(!g)return"#";const T=Ie=>Ie.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ie),B=Ne(g),ie=(B==null?void 0:B.path)??g,re=pt(ie,Y.cwd);if(T(re)){const Ie=re.startsWith("/")?re:`/${re}`;return`/codex-local-browse${encodeURI(Ie)}`}return"#"}function P(f){if(!f.includes("![")||!f.includes("]("))return[{kind:"text",value:f}];const g=[],T=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let B=0;for(const ie of f.matchAll(T)){const[re,Ie,Te]=ie;if(typeof ie.index!="number")continue;const Be=ie.index,Ke=Be+re.length,st=w(Te.trim());st&&(Be>B&&g.push({kind:"text",value:f.slice(B,Be)}),g.push({kind:"image",url:st,alt:Ie.trim(),markdown:re}),B=Ke)}return B<f.length&&g.push({kind:"text",value:f.slice(B)}),g.length>0?g:[{kind:"text",value:f}]}function j(f){return f!==null&&typeof f=="object"&&!Array.isArray(f)?f:null}function U(f){const g=new Date(f);return Number.isNaN(g.getTime())?f:g.toLocaleTimeString()}function x(f){const g=j(f.params),T=g==null?void 0:g.reason;return typeof T=="string"?T.trim():""}function $(f,g){return`${String(f)}:${g}`}function W(f){const g=j(f.params),T=Array.isArray(g==null?void 0:g.questions)?g.questions:[],B=[];for(const ie of T){const re=j(ie);if(!re)continue;const Ie=typeof re.id=="string"?re.id:"";if(!Ie)continue;const Te=Array.isArray(re.options)?re.options.map(Be=>j(Be)).map(Be=>Be==null?void 0:Be.label).filter(Be=>typeof Be=="string"&&Be.length>0):[];B.push({id:Ie,header:typeof re.header=="string"?re.header:"",question:typeof re.question=="string"?re.question:"",isOther:re.isOther===!0,options:Te})}return B}function K(f,g,T){const B=$(f,g),ie=me.value[B];return typeof ie=="string"&&ie.length>0?ie:T}function V(f,g){const T=$(f,g);return Se.value[T]??""}function ke(f,g,T){const B=T.target;if(!(B instanceof HTMLSelectElement))return;const ie=$(f,g);me.value={...me.value,[ie]:B.value}}function pe(f,g,T){const B=T.target;if(!(B instanceof HTMLInputElement))return;const ie=$(f,g);Se.value={...Se.value,[ie]:B.value}}function fe(f,g){F("respondServerRequest",{id:f,result:{decision:g}})}function Ae(f){const g=W(f),T={};for(const B of g){const ie=K(f.id,B.id,B.options[0]||""),re=V(f.id,B.id).trim(),Ie=[ie,re].map(Te=>Te.trim()).filter(Te=>Te.length>0);T[B.id]={answers:Ie}}F("respondServerRequest",{id:f.id,result:{answers:T}})}function Le(f){F("respondServerRequest",{id:f,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function qe(f){F("respondServerRequest",{id:f,result:{success:!0,contentItems:[]}})}function We(f){F("respondServerRequest",{id:f,result:{}})}function He(f){F("respondServerRequest",{id:f,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function tt(f){return!(f.role!=="user"&&f.role!=="assistant"||typeof f.turnIndex!="number"||Y.isTurnInProgress||Y.isRollingBack)}function ze(f){return f.role!=="user"&&f.role!=="assistant"?!1:f.text.trim().length>0}function et(f){return ze(f)||tt(f)}async function It(f){if(!ze(f))return;const g=f.text.trim();try{await navigator.clipboard.writeText(g)}catch{const T=document.createElement("textarea");T.value=g,T.setAttribute("readonly","true"),T.style.position="fixed",T.style.opacity="0",document.body.appendChild(T),T.select(),document.execCommand("copy"),document.body.removeChild(T)}}function Zt(f){if(!tt(f))return;const g=f.role==="user"?f.text.trim():"";F("rollback",{turnIndex:f.turnIndex,prependText:g.length>0?g:void 0})}function nt(){const f=J.value,g=G.value;!f||!g||(f.scrollTop=f.scrollHeight,g.scrollIntoView({block:"end"}))}function gt(f){return f.scrollHeight-(f.scrollTop+f.clientHeight)<=Pb}function Lt(f){if(!Y.activeThreadId)return;const g=Math.max(f.scrollHeight-f.clientHeight,0),T=g>0?Math.min(Math.max(f.scrollTop/g,0),1):1;F("updateScrollState",{threadId:Y.activeThreadId,state:{scrollTop:f.scrollTop,isAtBottom:gt(f),scrollRatio:T}})}function jt(){const f=J.value;if(!f)return;const g=Y.scrollState;if(!g||g.isAtBottom){Mt();return}const T=Math.max(f.scrollHeight-f.clientHeight,0),B=typeof g.scrollRatio=="number"?g.scrollRatio*T:g.scrollTop;f.scrollTop=Math.min(Math.max(B,0),T),Lt(f)}function Mt(){const f=J.value;f&&(nt(),Lt(f))}function Ut(){const f=Y.scrollState;return!f||f.isAtBottom===!0}function Oe(){if(!Ut()){ne=0,ee=0;return}if(Mt(),ne-=1,ne<=0){ee=0;return}ee=requestAnimationFrame(Oe)}function xe(f=6){Ut()&&(ee&&(cancelAnimationFrame(ee),ee=0),ne=Math.max(f,1),ee=requestAnimationFrame(Oe))}function Bt(){xe(3)}function Tt(){if(!Ut())return;const f=J.value;if(!f)return;const g=f.querySelectorAll("img.message-image-preview");for(const T of g)T.complete||X.has(T)||(X.add(T),T.addEventListener("load",Bt,{once:!0}),T.addEventListener("error",Bt,{once:!0}))}async function Ot(){await $t(),le&&cancelAnimationFrame(le),le=requestAnimationFrame(()=>{le=0,jt(),Tt(),xe()})}ft(()=>Y.messages,async f=>{if(we.value<As&&(we.value=As),we.value>f.length&&(we.value=f.length),!Y.isLoading){for(const g of f){if(g.messageType!=="commandExecution"||!g.commandExecution)continue;const T=o.value[g.id],B=g.commandExecution.status;T==="inProgress"&&B!=="inProgress"&&L(g.id),o.value[g.id]=B}await Ot()}}),ft(()=>Y.liveOverlay,async f=>{f&&(await $t(),Mt(),xe(8))},{deep:!0}),ft(()=>Y.isLoading,async f=>{f||await Ot()}),ft(()=>Y.activeThreadId,()=>{ue.value="",Ee.value=new Set,we.value=As},{flush:"post"});async function an(){const f=J.value;!f||Y.isLoading||(f.scrollTop<=24&&await q(),Lt(f))}function ln(f){ue.value=w(f)}function cn(f,g){return`${f}:${String(g)}`}function mn(f,g){const T=new Set(Ee.value);T.add(cn(f,g)),Ee.value=T}function In(f,g){return Ee.value.has(cn(f,g))}function rn(){ue.value=""}function D(){const f=ce.value;f&&(f.scrollTop=f.scrollHeight)}return ft(()=>{var f;return(f=Y.liveOverlay)==null?void 0:f.reasoningText},async f=>{f&&(await $t(),D())}),ar(()=>{le&&cancelAnimationFrame(le),ee&&cancelAnimationFrame(ee)}),(f,g)=>(_(),I("section",nw,[e.isLoading?(_(),I("p",rw,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(_(),I("p",sw," No messages in this thread yet. ")):(_(),I("ul",{key:2,ref_key:"conversationListRef",ref:J,class:"conversation-list",onScroll:an},[(_(!0),I(je,null,bt(e.pendingRequests,T=>(_(),I("li",{key:`server-request:${T.id}`,class:"conversation-item conversation-item-request"},[m("div",ow,[m("div",iw,[m("article",aw,[m("p",lw,se(T.method),1),m("p",cw,"Request #"+se(T.id)+" · "+se(U(T.receivedAtIso)),1),x(T)?(_(),I("p",uw,se(x(T)),1)):oe("",!0),T.method==="item/commandExecution/requestApproval"?(_(),I("section",dw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:B=>fe(T.id,"accept")},"Accept",8,fw),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"acceptForSession")},"Accept for Session",8,hw),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"decline")},"Decline",8,pw),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"cancel")},"Cancel",8,mw)])):T.method==="item/fileChange/requestApproval"?(_(),I("section",gw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:B=>fe(T.id,"accept")},"Accept",8,vw),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"acceptForSession")},"Accept for Session",8,yw),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"decline")},"Decline",8,ww),m("button",{type:"button",class:"request-button",onClick:B=>fe(T.id,"cancel")},"Cancel",8,bw)])):T.method==="item/tool/requestUserInput"?(_(),I("section",_w,[(_(!0),I(je,null,bt(W(T),B=>(_(),I("div",{key:`${T.id}:${B.id}`,class:"request-question"},[m("p",kw,se(B.header||B.question),1),B.header&&B.question?(_(),I("p",Tw,se(B.question),1)):oe("",!0),m("select",{class:"request-select",value:K(T.id,B.id,B.options[0]||""),onChange:ie=>ke(T.id,B.id,ie)},[(_(!0),I(je,null,bt(B.options,ie=>(_(),I("option",{key:`${T.id}:${B.id}:${ie}`,value:ie},se(ie),9,Iw))),128))],40,Sw),B.isOther?(_(),I("input",{key:1,class:"request-input",type:"text",value:V(T.id,B.id),placeholder:"Other answer",onInput:ie=>pe(T.id,B.id,ie)},null,40,Ew)):oe("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:B=>Ae(T)}," Submit Answers ",8,Cw)])):T.method==="item/tool/call"?(_(),I("section",Aw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:B=>Le(T.id)},"Fail Tool Call",8,Rw),m("button",{type:"button",class:"request-button",onClick:B=>qe(T.id)},"Success (Empty)",8,Pw)])):(_(),I("section",xw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:B=>We(T.id)},"Return Empty Result",8,Mw),m("button",{type:"button",class:"request-button",onClick:B=>He(T.id)},"Reject Request",8,Ow)]))])])])]))),128)),ve.value?(_(),I("li",Nw,[m("div",$w,[m("div",Dw,[m("p",Lw,se($e.value?"Loading older messages...":"Scroll up to load older messages"),1)])])])):oe("",!0),(_(!0),I(je,null,bt(Pe.value,T=>{var B,ie;return _(),I("li",{key:T.id,class:it(["conversation-item",{"conversation-item-actionable":et(T)}]),"data-role":T.role,"data-message-type":T.messageType||""},[i(T)?(_(),I("div",Uw,[m("div",Bw,[m("button",{type:"button",class:it(["cmd-row",[S(T),{"cmd-expanded":a(T)}]]),onClick:re=>u(T)},[m("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(T)}])},"▶",2),m("code",Hw,se(((B=T.commandExecution)==null?void 0:B.command)||"(command)"),1),m("span",Vw,se(y(T)),1)],10,Fw),m("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(T),"cmd-output-collapsing":l(T)}])},[m("div",Ww,[m("pre",zw,se(((ie=T.commandExecution)==null?void 0:ie.aggregatedOutput)||"(no output)"),1)])],2)])])):(_(),I("div",{key:1,class:"message-row","data-role":T.role,"data-message-type":T.messageType||""},[m("div",{class:"message-stack","data-role":T.role},[m("article",{class:"message-body","data-role":T.role},[T.images&&T.images.length>0?(_(),I("ul",{key:0,class:"message-image-list","data-role":T.role},[(_(!0),I(je,null,bt(T.images,re=>(_(),I("li",{key:re,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ie=>ln(re)},[m("img",{class:"message-image-preview",src:w(re),alt:"Message image preview",loading:"lazy"},null,8,Xw)],8,Yw)]))),128))],8,Jw)):oe("",!0),T.fileAttachments&&T.fileAttachments.length>0?(_(),I("div",Qw,[(_(!0),I(je,null,bt(T.fileAttachments,re=>(_(),I("span",{key:re.path,class:"message-file-chip"},[g[1]||(g[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:k(re.path),target:"_blank",rel:"noopener noreferrer",title:re.path},se(re.path),9,Zw)]))),128))])):oe("",!0),T.text.length>0?(_(),I("article",{key:2,class:"message-card","data-role":T.role},[T.messageType==="worked"?(_(),I("div",tb,[m("button",{type:"button",class:"worked-separator",onClick:re=>c(T)},[g[2]||(g[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:it(["worked-chevron",{"worked-chevron-open":h(T)}])},"▶",2),m("p",rb,se(T.text),1),g[3]||(g[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,nb),h(T)?(_(),I("div",sb,[(_(!0),I(je,null,bt(R(Y.messages,Y.messages.findIndex(re=>re.id===T.id)),re=>{var Ie,Te;return _(),I("div",{key:`worked-cmd-${re.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:it(["cmd-row",[S(re),{"cmd-expanded":a(re)}]]),onClick:Be=>u(re)},[m("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(re)}])},"▶",2),m("code",ib,se(((Ie=re.commandExecution)==null?void 0:Ie.command)||"(command)"),1),m("span",ab,se(y(re)),1)],10,ob),m("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(re),"cmd-output-collapsing":l(re)}])},[m("div",lb,[m("pre",cb,se(((Te=re.commandExecution)==null?void 0:Te.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):oe("",!0)])):(_(),I("div",ub,[(_(!0),I(je,null,bt(P(T.text),(re,Ie)=>(_(),I(je,{key:`block-${Ie}`},[re.kind==="text"?(_(),I("p",db,[(_(!0),I(je,null,bt(Ce(re.value),(Te,Be)=>(_(),I(je,{key:`seg-${Ie}-${Be}`},[Te.kind==="text"?(_(),I("span",fb,se(Te.value),1)):Te.kind==="bold"?(_(),I("strong",hb,se(Te.value),1)):Te.kind==="file"?(_(),I("a",{key:2,class:"message-file-link",href:k(Te.path),target:"_blank",rel:"noopener noreferrer",title:Te.path},se(Te.displayPath),9,pb)):Te.kind==="url"?(_(),I("a",{key:3,class:"message-file-link",href:Te.href,target:"_blank",rel:"noopener noreferrer",title:Te.href},se(Te.value),9,mb)):(_(),I("code",gb,se(Te.value),1))],64))),128))])):In(T.id,Ie)?(_(),I("p",vb,se(re.markdown),1)):(_(),I("button",{key:2,class:"message-image-button",type:"button",onClick:Te=>ln(re.url)},[m("img",{class:"message-image-preview message-markdown-image",src:re.url,alt:re.alt||"Embedded message image",loading:"lazy",onError:Te=>mn(T.id,Ie)},null,40,wb)],8,yb))],64))),128))]))],8,eb)):oe("",!0)],8,Kw),et(T)?(_(),I("div",bb,[ze(T)?(_(),I("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:re=>It(T)},[Re(tw,{class:"message-action-icon"}),g[4]||(g[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,_b)):oe("",!0),tt(T)?(_(),I("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:re=>Zt(T)},[Re(Xy,{class:"message-action-icon"}),g[5]||(g[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,kb)):oe("",!0)])):oe("",!0)],8,Gw)],8,qw))],10,jw)}),128)),e.liveOverlay?(_(),I("li",Tb,[m("div",Sb,[m("div",Ib,[m("article",Eb,[m("p",Cb,se(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(_(),I("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:ce},se(e.liveOverlay.reasoningText),513)):oe("",!0),e.liveOverlay.errorText?(_(),I("p",Ab,se(e.liveOverlay.errorText),1)):oe("",!0)])])])])):oe("",!0),m("li",{ref_key:"bottomAnchorRef",ref:G,class:"conversation-bottom-anchor"},null,512)],544)),ue.value.length>0?(_(),I("div",{key:3,class:"image-modal-backdrop",onClick:rn},[m("div",{class:"image-modal-content",onClick:g[0]||(g[0]=ot(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:rn},[Re(tl,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ue.value,alt:"Expanded message image"},null,8,Rb)])])):oe("",!0)]))}}),Mb=rt(xb,[["__scopeId","data-v-ab09c865"]]),Mc=.0025,Ui=3,Oc=2,Ob=256;function Nb(e){var ee;const t=N("idle"),n=N(typeof navigator<"u"&&!!((ee=navigator.mediaDevices)!=null&&ee.getUserMedia)),r=N(0),s=N(null);let o=null,i=null,a=[],l=null,u=null,c=null,h=null,y=[],S=!1,L=!1,R=null;function q(){R&&(R.abort(),R=null),t.value==="transcribing"&&(t.value="idle")}function Y(){const ne=s.value;if(!ne||typeof window>"u")return;const X=ne.getContext("2d");if(!X)return;const Ee=Math.max(1,Math.floor(ne.clientWidth)),we=Math.max(1,Math.floor(ne.clientHeight||36)),$e=window.devicePixelRatio||1,Pe=Math.max(1,Math.floor(Ee*$e)),ve=Math.max(1,Math.floor(we*$e));(ne.width!==Pe||ne.height!==ve)&&(ne.width=Pe,ne.height=ve),X.setTransform($e,0,0,$e,0,0),X.clearRect(0,0,Ee,we);const Me=Math.max(12,Math.floor(Ee/(Ui+Oc))),at=y.slice(-Me),Qe=Math.max(0,Me-at.length),Je=we/2,Ze=getComputedStyle(ne).color||"#000000";for(let Ye=0;Ye<Me;Ye+=1){const pt=at[Ye-Qe]??0,De=Math.max(.08,Math.min(1,pt*18))*Je,H=Ye*(Ui+Oc);X.globalAlpha=pt<=Mc?.35:1,X.fillStyle=Ze,X.fillRect(H,Je-De,Ui,De*2)}X.globalAlpha=1}function F(){y=[],r.value=0,Y()}function J(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),h=null}function G(ne){if(typeof window>"u")return;const X=window.webkitAudioContext,Ee=window.AudioContext??X;Ee&&(J(),F(),l=new Ee,u=l.createMediaStreamSource(ne),c=l.createScriptProcessor(2048,1,1),h=performance.now(),c.onaudioprocess=we=>{const $e=we.inputBuffer.getChannelData(0);let Pe=0;for(let ve=0;ve<$e.length;ve+=1){const Me=Math.abs($e[ve]??0);Pe+=Me<Mc?0:Me}y.push(Pe/$e.length),y.length>Ob&&y.shift(),h!==null&&(r.value=Math.max(0,performance.now()-h)),Y()},u.connect(c),c.connect(l.destination),Y())}async function ce(){var ne;if(t.value==="transcribing"&&q(),!(t.value!=="idle"||!n.value||S)){S=!0,L=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=X=>{X.data.size>0&&a.push(X.data)},o.onstop=()=>{var we;const X=a,Ee=(o==null?void 0:o.mimeType)||((we=X[0])==null?void 0:we.type)||"audio/webm";Se(),me(X,Ee)},G(i),o.start(250),t.value="recording",L&&ue()}catch(X){Se(),t.value="idle",(ne=e.onError)==null||ne.call(e,X)}finally{S=!1}}}function ue(){if(S&&t.value==="idle"){L=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function me(ne,X){var $e,Pe,ve,Me,at;if(ne.length===0){($e=e.onEmpty)==null||$e.call(e),t.value="idle";return}const Ee=new Blob(ne,{type:X});t.value="transcribing";let we=null;try{const Qe=X.split(/[/;]/)[1]??"webm",Je=new FormData;Je.append("file",Ee,`codex.${Qe}`);const Ze=((Pe=e.getLanguage)==null?void 0:Pe.call(e).trim())??"";Ze&&Ze.toLowerCase()!=="auto"&&Je.append("language",Ze),we=new AbortController,R=we;const Ye=await fetch("/codex-api/transcribe",{method:"POST",body:Je,signal:we.signal}),pt=await Ye.text();let Ne=null;try{Ne=pt.trim()?JSON.parse(pt):null}catch{Ne=null}if(!Ye.ok){const H=(ve=Ne==null?void 0:Ne.error)==null?void 0:ve.trim(),he=pt.trim();throw new Error(H||he||`Transcription failed: ${Ye.status}`)}const De=((Ne==null?void 0:Ne.text)??"").trim();De.length>0?e.onTranscript(De):(Me=e.onEmpty)==null||Me.call(e)}catch(Qe){if(Qe instanceof DOMException&&Qe.name==="AbortError")return;(at=e.onError)==null||at.call(e,Qe)}finally{we&&R===we&&(R=null),t.value==="transcribing"&&(t.value="idle")}}function Se(){J(),F(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ne=>ne.stop()),i=null),a=[]}ar(()=>{q(),Se()});function le(){if(t.value==="recording"){ue();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:ce,stopRecording:ue,toggleRecording:le}}function Nc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Xn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function nl(e,t){const n=Nc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Nc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ms(e,t,n){return e instanceof Xn?e:e instanceof Error?new Xn(e.message||t,{code:"unknown_error",method:n}):new Xn(t,{code:"unknown_error",method:n})}function af(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function $b(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 Xn(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 Xn(nl(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 Xn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function $c(e){const t=af(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 Db(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=$c(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=$c(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 Lb(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 Xn(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 Xn(nl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function jb(){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 Xn(nl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=af(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Dc(e){return new Date(e*1e3).toISOString()}function Ub(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Bb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Fb=/^##\s+(.+?):\s+(.+?)\s*$/,Hb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Vb(e){var s,o;const t=e.split(`
27
- `).findIndex(i=>Hb.test(i.trim()));if(t<0)return[];const n=e.split(`
28
- `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Fb);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 Wb(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 zb(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:Bb(l),isUnhandled:!0});const o=n.join(`
29
- `),i=Vb(o);return{text:Wb(o),images:r,fileAttachments:i,rawBlocks:s}}function qb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=zb(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=Gb(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 Gb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Kb(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Jb(e){const t=Kb(e);return t.length>0?t:"Untitled thread"}function lf(e){return(e==null?void 0:e.status)==="inProgress"}function Yb(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 lf(r)}function Xb(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:Jb(e),projectName:Ub(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Dc(e.createdAt),updatedAtIso:Dc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Yb(e)}}function Qb(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 Zb(e){const t=e.data.map(Xb);return Qb(t)}function cf(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 qb(i))n.push({...a,turnIndex:r})}return n}function e_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return lf(t.at(-1))}async function nn(e,t){try{return await $b(e,t)}catch(n){throw ms(n,`RPC ${e} failed`,e)}}function t_(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function n_(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Zb(e)}async function r_(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:cf(t),inProgress:e_(t)}}async function s_(){try{return await n_()}catch(e){throw ms(e,"Failed to load thread groups","thread/list")}}async function o_(e){try{return await r_(e)}catch(t){throw ms(t,`Failed to load thread ${e}`,"thread/read")}}function i_(e){return Db(e)}async function a_(e,t){await Lb({id:e,...t})}async function l_(){return jb()}async function Bi(e){await nn("thread/resume",{threadId:e})}async function c_(e){await nn("thread/archive",{threadId:e})}async function u_(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Lc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return cf(n)}function d_(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 jc(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=d_(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ms(n,"Failed to start a new thread","thread/start")}}function f_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
30
- `;for(const r of t)n+=`
31
- ## ${r.label}: ${r.path}
32
- `;return`${n}
33
- ## My request for Codex:
34
-
35
- ${e}
36
- `}async function Fi(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:f_(t,i)}];for(const h of n){const y=h.trim();y&&l.push({type:"image",url:y,image_url:y})}if(o)for(const h of o)l.push({type:"skill",name:h.name,path:h.path});const u=i.map(h=>({label:h.label,path:h.path,fsPath:h.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 ms(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function h_(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 ms(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function p_(e){await nn("setDefaultModel",{model:e})}async function m_(){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 g_(){const e=await nn("config/read",{}),t=e.config.model??"",n=t_(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function v_(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 ba(){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 v_(n.data)}async function y_(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 Uc(){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 w_(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 Bc(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=rl(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 b_(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=rl(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 __(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=rl(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 h=u.path,y=typeof h=="string"?h.trim():"";y&&l.push({path:y})}return l}async function k_(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 rl(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 T_(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function Hi(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function S_(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 I_(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 Fc(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 E_={},C_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function A_(e,t){return _(),I("svg",C_,[...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 R_=rt(E_,[["render",A_]]),P_={},x_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function M_(e,t){return _(),I("svg",x_,[...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 O_=rt(P_,[["render",M_]]),N_={},$_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function D_(e,t){return _(),I("svg",$_,[...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 Hc=rt(N_,[["render",D_]]),L_=["disabled"],j_={class:"composer-dropdown-value"},U_={class:"composer-dropdown-menu"},B_={key:0,class:"composer-dropdown-search-wrap"},F_=["placeholder","onKeydown"],H_={class:"composer-dropdown-options",role:"listbox"},V_=["onClick"],W_={key:0,class:"composer-dropdown-empty"},z_={key:1,class:"composer-dropdown-add-wrap"},q_=["placeholder","onKeydown"],G_=xt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(null),a=N(!1),l=N(""),u=N(!1),c=N(""),h=ae(()=>{var ne;const ee=n.options.find(X=>X.value===n.modelValue);return ee?ee.label:((ne=n.placeholder)==null?void 0:ne.trim())||""}),y=ae(()=>n.openDirection??"down"),S=ae(()=>n.enableSearch===!0),L=ae(()=>n.showAddAction===!0),R=ae(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),q=ae(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=ae(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),F=ae(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ne=>ne.label.toLowerCase().includes(ee)||ne.value.toLowerCase().includes(ee)):n.options});function J(){n.disabled||(a.value=!a.value)}function G(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function ce(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",$t(()=>{var ne;return(ne=i.value)==null?void 0:ne.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function me(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Se(){u.value=!1,c.value="",a.value=!1,l.value=""}function le(ee){if(!a.value)return;const ne=s.value;if(!ne)return;const X=ee.target;X instanceof Node&&(ne.contains(X)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return ft(a,ee=>{if(!ee){u.value=!1,c.value="";return}S.value&&$t(()=>{var ne;return(ne=o.value)==null?void 0:ne.focus()})}),ir(()=>{window.addEventListener("pointerdown",le)}),ar(()=>{window.removeEventListener("pointerdown",le)}),(ee,ne)=>(_(),I("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:J},[m("span",j_,se(h.value),1),Re(li,{class:"composer-dropdown-chevron"})],8,L_),a.value?(_(),I("div",{key:0,class:it(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":y.value==="up","composer-dropdown-menu-wrap-down":y.value==="down"}])},[m("div",U_,[S.value?(_(),I("div",B_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ne[0]||(ne[0]=X=>l.value=X),class:"composer-dropdown-search-input",type:"text",placeholder:R.value,onKeydown:Yt(ot(ue,["prevent"]),["esc"])},null,40,F_),[[nr,l.value]])])):oe("",!0),m("ul",H_,[(_(!0),I(je,null,bt(F.value,X=>(_(),I("li",{key:X.value},[m("button",{class:it(["composer-dropdown-option",{"is-selected":X.value===e.modelValue}]),type:"button",onClick:Ee=>G(X.value)},se(X.label),11,V_)]))),128)),F.value.length===0?(_(),I("li",W_," No matching projects ")):oe("",!0)]),L.value?(_(),I("div",z_,[u.value?(_(),I(je,{key:0},[tr(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ne[1]||(ne[1]=X=>c.value=X),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Yt(ot(me,["prevent"]),["enter"]),Yt(ot(Se,["prevent"]),["esc"])]},null,40,q_),[[nr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:me},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Se},"Cancel")])],64)):(_(),I("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ce},se(q.value),1))])):oe("",!0)])],2)):oe("",!0)],512))}}),jo=rt(G_,[["__scopeId","data-v-7cfa2012"]]),K_=["disabled"],J_={class:"search-dropdown-value"},Y_={class:"search-dropdown-search-wrap"},X_=["placeholder","onKeydown"],Q_={key:0,class:"search-dropdown-list",role:"listbox"},Z_=["onClick","onPointerenter"],ek={class:"search-dropdown-option-check"},tk={class:"search-dropdown-option-label"},nk={key:0,class:"search-dropdown-option-desc"},rk={key:1,class:"search-dropdown-empty"},sk=xt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(!1),a=N(""),l=N(0),u=ae(()=>n.openDirection??"down"),c=ae(()=>new Set(n.selectedValues)),h=ae(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const F=n.options.find(J=>J.value===n.selectedValues[0]);return(F==null?void 0:F.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),y=ae(()=>{const F=a.value.toLowerCase().trim();return F?n.options.filter(J=>{var G;return J.label.toLowerCase().includes(F)||(((G=J.description)==null?void 0:G.toLowerCase().includes(F))??!1)}):n.options});function S(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,$t(()=>{var F;return(F=o.value)==null?void 0:F.focus()})))}function L(F){r("toggle",F.value,!c.value.has(F.value))}function R(F){y.value.length!==0&&(l.value=(l.value+F+y.value.length)%y.value.length)}function q(){const F=y.value[l.value];F&&L(F)}function Y(F){if(!i.value)return;const J=s.value;if(!J)return;const G=F.target;G instanceof Node&&(J.contains(G)||(i.value=!1))}return ft(a,()=>{l.value=0}),ir(()=>window.addEventListener("pointerdown",Y)),ar(()=>window.removeEventListener("pointerdown",Y)),(F,J)=>(_(),I("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:S},[m("span",J_,se(h.value),1),Re(li,{class:"search-dropdown-chevron"})],8,K_),i.value?(_(),I("div",{key:0,class:it(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",Y_,[tr(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":J[0]||(J[0]=G=>a.value=G),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[J[1]||(J[1]=Yt(ot(G=>i.value=!1,["prevent"]),["escape"])),Yt(ot(q,["prevent"]),["enter"]),J[2]||(J[2]=Yt(ot(G=>R(1),["prevent"]),["arrow-down"])),J[3]||(J[3]=Yt(ot(G=>R(-1),["prevent"]),["arrow-up"]))]},null,40,X_),[[nr,a.value]])]),y.value.length>0?(_(),I("ul",Q_,[(_(!0),I(je,null,bt(y.value,(G,ce)=>(_(),I("li",{key:G.value},[m("button",{class:it(["search-dropdown-option",{"is-selected":c.value.has(G.value),"is-highlighted":ce===l.value}]),type:"button",onClick:ue=>L(G),onPointerenter:ue=>l.value=ce},[m("span",ek,se(c.value.has(G.value)?"✓":""),1),m("span",tk,se(G.label),1),G.description?(_(),I("span",nk,se(G.description),1)):oe("",!0)],42,Z_)]))),128))])):(_(),I("div",rk,"No results"))],2)):oe("",!0)],512))}}),ok=rt(sk,[["__scopeId","data-v-a0f2edd4"]]),ik={class:"skill-picker-header"},ak=["onKeydown"],lk={key:0,class:"skill-picker-list",role:"listbox"},ck=["onClick","onPointerenter"],uk={class:"skill-picker-name"},dk={key:0,class:"skill-picker-desc"},fk={key:1,class:"skill-picker-empty"},hk=xt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(null),i=N(""),a=N(0),l=ae(()=>{const y=i.value.toLowerCase().trim();return y?n.skills.filter(S=>S.name.toLowerCase().includes(y)||S.description.toLowerCase().includes(y)):n.skills}),u=ae(()=>{const y={};return n.anchorBottom!=null&&(y.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(y.left=`${n.anchorLeft}px`),y});function c(y){l.value.length!==0&&(a.value=(a.value+y+l.value.length)%l.value.length)}function h(){const y=l.value[a.value];y&&r("select",y)}return ft(()=>n.visible,y=>{y&&(i.value="",a.value=0,$t(()=>{var S;return(S=o.value)==null?void 0:S.focus()}))}),ft(i,()=>{a.value=0}),(y,S)=>e.visible?(_(),I("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Wr(u.value)},[m("div",ik,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":S[0]||(S[0]=L=>i.value=L),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[S[1]||(S[1]=Yt(ot(L=>y.$emit("close"),["prevent"]),["escape"])),Yt(ot(h,["prevent"]),["enter"]),S[2]||(S[2]=Yt(ot(L=>c(1),["prevent"]),["arrow-down"])),S[3]||(S[3]=Yt(ot(L=>c(-1),["prevent"]),["arrow-up"]))]},null,40,ak),[[nr,i.value]])]),l.value.length>0?(_(),I("ul",lk,[(_(!0),I(je,null,bt(l.value,(L,R)=>(_(),I("li",{key:L.path},[m("button",{class:it(["skill-picker-item",{"is-highlighted":R===a.value}]),type:"button",onClick:q=>y.$emit("select",L),onPointerenter:q=>a.value=R},[m("span",uk,se(L.name),1),L.description?(_(),I("span",dk,se(L.description),1)):oe("",!0)],42,ck)]))),128))])):(_(),I("div",fk,"No skills found"))],4)):oe("",!0)}}),pk=rt(hk,[["__scopeId","data-v-ff3fb7dc"]]),mk={key:0,class:"thread-composer-dictation-error"},gk={key:0,class:"thread-composer-attachments"},vk=["src","alt"],yk=["aria-label","disabled","onClick"],wk={key:1,class:"thread-composer-folder-chips"},bk=["title"],_k={class:"thread-composer-folder-chip-meta"},kk=["aria-label","disabled","onClick"],Tk={key:2,class:"thread-composer-file-chips"},Sk=["title"],Ik=["aria-label","disabled","onClick"],Ek={key:3,class:"thread-composer-skill-chips"},Ck={class:"thread-composer-skill-chip-name"},Ak=["aria-label","onClick"],Rk={class:"thread-composer-input-wrap"},Pk={key:0,class:"thread-composer-file-mentions"},xk=["onMousedown"],Mk={key:1,class:"thread-composer-file-mention-icon-markdown"},Ok={class:"thread-composer-file-mention-text"},Nk={class:"thread-composer-file-mention-name"},$k={key:0,class:"thread-composer-file-mention-dir"},Dk={key:1,class:"thread-composer-file-mention-empty"},Lk=["placeholder","disabled"],jk=["disabled"],Uk={key:0,class:"thread-composer-attach-menu"},Bk=["disabled"],Fk=["disabled"],Hk=["disabled"],Vk={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},Wk={key:1,class:"thread-composer-dictation-timer"},zk=["aria-label","title","disabled"],qk=["disabled"],Gk=["aria-label","title","disabled"],Kk=["disabled"],Jk=["disabled"],Yk=["disabled"],Xk=xt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},prependDraftRequest:{},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=N(""),o=N([]),i=N([]),a=N([]),l=N([]),u=N(""),{state:c,isSupported:h,recordingDurationMs:y,waveformCanvasRef:S,startRecording:L,stopRecording:R,toggleRecording:q}=Nb({getLanguage:()=>n.dictationLanguage??"auto",onTranscript:D=>{if(s.value=s.value?`${s.value}
37
- ${D}`:D,u.value="",n.dictationAutoSend!==!1){const f=n.isTurnInProgress?De.value:"steer";w(f,{rollbackLatestUserTurn:f==="steer"&&Pe}),Pe=!1;return}$t(()=>{var f;return(f=ce.value)==null?void 0:f.focus()})},onEmpty:()=>{u.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:D=>{if(D instanceof DOMException&&D.name==="NotAllowedError"){u.value="Microphone access was denied.";return}u.value=D instanceof Error?D.message:"Dictation failed."}}),Y=N(null),F=N(null),J=N(null),G=N(null),ce=N(null),ue=N(!1),me=N(!1),Se=N(null),le=N(""),ee=N([]),ne=N(!1),X=N(0);let Ee=0,we=null,$e=!1,Pe=!1;const ve=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Me=[{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"}],at=ae(()=>n.models.map(D=>({value:D,label:D}))),Qe=ae(()=>n.skills??[]),Je=ae(()=>i.value.map(D=>D.path)),Ze=ae(()=>(n.skills??[]).map(D=>({value:D.path,label:D.name,description:D.description}))),Ye=ae(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),pt=ae(()=>{const D=new Set;for(const f of l.value)for(const g of f.filePaths)D.add(g);return a.value.filter(f=>!D.has(f.fsPath))}),Ne=ae(()=>n.disabled||!n.activeThreadId),De=ae(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),H=ae(()=>c.value==="recording"),he=ae(()=>c.value==="recording"?"Stop dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),de=ae(()=>c.value==="idle"?u.value.trim():""),_e=ae(()=>{const D=Math.max(0,Math.floor(y.value/1e3)),f=Math.floor(D/60),g=D%60;return`${f}:${String(g).padStart(2,"0")}`}),Ce=ae(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function w(D="steer",f){var T;const g=s.value.trim();if(Ye.value){if(r("submit",{text:g,imageUrls:o.value.map(B=>B.url),fileAttachments:[...a.value],skills:i.value.map(B=>({name:B.name,path:B.path})),mode:D,rollbackLatestUserTurn:(f==null?void 0:f.rollbackLatestUserTurn)===!0}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],ue.value=!1,me.value=!1,Mt(),ve){(T=ce.value)==null||T.blur();return}$t(()=>{var B;return(B=ce.value)==null?void 0:B.focus()})}}function k(){r("interrupt")}function P(D){r("update:selected-model",D)}function j(D){r("update:selected-reasoning-effort",D)}function U(){n.dictationClickToToggle&&(u.value&&(u.value=""),c.value==="idle"&&(Pe=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer"),q())}function x(D){if(n.dictationClickToToggle||(D.preventDefault(),$e))return;$e=!0;const f=D.currentTarget;if(f)try{f.setPointerCapture(D.pointerId)}catch{}u.value&&(u.value=""),Pe=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer",window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$),window.addEventListener("blur",$),L()}function $(){n.dictationClickToToggle||$e&&($e=!1,window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),window.removeEventListener("blur",$),R())}function W(){Ne.value||(ue.value=!ue.value)}function K(){var D;(D=F.value)==null||D.click()}function V(){var D;(D=J.value)==null||D.click()}function ke(){var D;(D=G.value)==null||D.click()}function pe(D){o.value=o.value.filter(f=>f.id!==D)}function fe(D){i.value=i.value.filter(f=>f.path!==D)}function Ae(D){a.value=a.value.filter(f=>f.fsPath!==D)}function Le(D){const f=l.value.find(T=>T.id===D);if(!f)return;const g=new Set(f.filePaths);a.value=a.value.filter(T=>!g.has(T.fsPath)),l.value=l.value.filter(T=>T.id!==D)}function qe(D){return D.total<=0?0:Math.round(D.processed/D.total*100)}function We(D,f){const g=D.replace(/\\/g,"/");if(a.value.some(ie=>ie.fsPath===g))return;const T=g.split("/").filter(Boolean),B=(f==null?void 0:f.trim())||T[T.length-1]||g;a.value=[...a.value,{label:B,path:g,fsPath:g}]}function He(D){return D.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(D.name)}function tt(D){if(!(!D||D.length===0))for(const f of Array.from(D))if(He(f)){const g=new FileReader;g.onload=()=>{typeof g.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:f.name,url:g.result})},g.readAsDataURL(f)}else Fc(f).then(g=>{g&&We(g)}).catch(()=>{})}async function ze(D){if(!D||D.length===0)return;const f=Array.from(D),T=(f[0].webkitRelativePath||f[0].name).split("/").filter(Boolean)[0]||"Folder",B=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:B,name:T,total:f.length,processed:0,filePaths:[],isUploading:!0}];const ie=re=>{l.value=l.value.map(Ie=>Ie.id===B?re(Ie):Ie)};for(const re of f)try{const Ie=await Fc(re);if(Ie){const Te=re.webkitRelativePath||re.name;We(Ie,Te),ie(Be=>({...Be,processed:Be.processed+1,filePaths:[...Be.filePaths,Ie]}));continue}ie(Te=>({...Te,processed:Te.processed+1}))}catch{ie(Ie=>({...Ie,processed:Ie.processed+1}))}ie(re=>({...re,isUploading:!1}))}function et(D){D&&(D.value="")}function It(D){const f=D.target;tt((f==null?void 0:f.files)??null),et(f),ue.value=!1}function Zt(D){const f=D.target;tt((f==null?void 0:f.files)??null),et(f),ue.value=!1}function nt(D){const f=D.target;ze((f==null?void 0:f.files)??null),et(f),ue.value=!1}function gt(){u.value&&(u.value="");const f=s.value.startsWith("/");f!==me.value&&(me.value=f),Ut()}function Lt(D){if(ne.value){if(D.key==="Escape"){D.preventDefault(),Mt();return}if(D.key==="ArrowDown"){D.preventDefault(),ee.value.length>0&&(X.value=(X.value+1)%ee.value.length);return}if(D.key==="ArrowUp"){if(D.preventDefault(),ee.value.length>0){const g=ee.value.length;X.value=(X.value+g-1)%g}return}if(D.key==="Enter"||D.key==="Tab"){D.preventDefault();const g=ee.value[X.value];g?xe(g):Mt();return}}if(n.sendWithEnter!==!1?D.key==="Enter"&&!D.shiftKey:D.key==="Enter"&&(D.metaKey||D.ctrlKey)){D.preventDefault(),w(n.isTurnInProgress?De.value:"steer");return}if(me.value){if(D.key==="Escape"){D.preventDefault(),jt();return}if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();return}}}function jt(){var D;me.value=!1,(D=ce.value)==null||D.focus()}function Mt(){ne.value=!1,Se.value=null,le.value="",ee.value=[],X.value=0}function Ut(){const D=ce.value;if(!D){Mt();return}const f=D.selectionStart??s.value.length,T=s.value.slice(0,f).match(/(^|\s)(@[^\s@]*)$/);if(!T){Mt();return}const B=T[2]??"",ie=B.length,re=f-ie;Se.value=re,le.value=B.slice(1),ne.value=!0,Oe()}async function Oe(){if(!ne.value)return;const D=(n.cwd??"").trim();if(!D){ee.value=[];return}we&&clearTimeout(we);const f=++Ee;we=setTimeout(async()=>{try{const g=await __(D,le.value,20);if(!ne.value||f!==Ee)return;ee.value=g,X.value=0}catch{if(!ne.value||f!==Ee)return;ee.value=[]}},120)}function xe(D){const f=ce.value,g=Se.value;if(g!==null&&f){const T=f.selectionStart??s.value.length;s.value=`${s.value.slice(0,g)}${s.value.slice(T)}`.trimEnd()}We(D.path),Mt(),$t(()=>f==null?void 0:f.focus())}function Bt(D){const f=D.lastIndexOf("/");return f<0?D:D.slice(f+1)}function Tt(D){const f=D.lastIndexOf("/");return f<=0?"":D.slice(0,f)}function Ot(D){const f=Bt(D),g=f.lastIndexOf(".");return g<=0?"":f.slice(g+1).toLowerCase()}function an(D){const f=Ot(D);return f==="ts"?"TS":f==="tsx"?"TSX":f==="js"?"JS":f==="jsx"?"JSX":f==="json"?"{}":""}function ln(D){const f=Ot(D);return f.startsWith("ts")?"ts":f.startsWith("js")?"js":f==="json"?"json":"default"}function cn(D){const f=Ot(D);return f==="md"||f==="mdx"}function mn(D){var f;i.value.some(g=>g.path===D.path)||(i.value=[...i.value,D]),s.value=s.value.startsWith("/")?"":s.value,me.value=!1,(f=ce.value)==null||f.focus()}function In(D,f){if(f){const g=(n.skills??[]).find(T=>T.path===D);g&&!i.value.some(T=>T.path===D)&&(i.value=[...i.value,g])}else i.value=i.value.filter(g=>g.path!==D)}function rn(D){if(!ue.value)return;const f=Y.value;if(!f)return;const g=D.target;!g||f.contains(g)||(ue.value=!1)}return ir(()=>{document.addEventListener("click",rn)}),ar(()=>{document.removeEventListener("click",rn),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),window.removeEventListener("blur",$),we&&clearTimeout(we)}),ft(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],u.value="",ue.value=!1,me.value=!1,Mt()}),ft(()=>n.cwd,()=>{ne.value&&Oe()}),ft(()=>{var D;return(D=n.prependDraftRequest)==null?void 0:D.id},()=>{var f,g;const D=((g=(f=n.prependDraftRequest)==null?void 0:f.text)==null?void 0:g.trim())??"";D&&(s.value=s.value?`${D}
38
- ${s.value}`:D,gt(),$t(()=>{var T;return(T=ce.value)==null?void 0:T.focus()}))}),(D,f)=>(_(),I("form",{class:"thread-composer",onSubmit:f[2]||(f[2]=ot(g=>w("steer"),["prevent"]))},[de.value?(_(),I("p",mk,se(de.value),1)):oe("",!0),m("div",{class:it(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(_(),I("div",gk,[(_(!0),I(je,null,bt(o.value,g=>(_(),I("div",{key:g.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:g.url,alt:g.name||"Selected image"},null,8,vk),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${g.name||"image"}`,disabled:Ne.value,onClick:T=>pe(g.id)}," x ",8,yk)]))),128))])):oe("",!0),l.value.length>0?(_(),I("div",wk,[(_(!0),I(je,null,bt(l.value,g=>(_(),I("span",{key:g.id,class:"thread-composer-folder-chip"},[Re(el,{class:"thread-composer-folder-chip-icon"}),m("span",{class:"thread-composer-folder-chip-name",title:g.name},se(g.name),9,bk),m("span",_k,[g.isUploading?(_(),I(je,{key:0},[qs(se(qe(g))+"% uploading ("+se(g.processed)+"/"+se(g.total)+") ",1)],64)):(_(),I(je,{key:1},[qs(se(g.filePaths.length)+" file"+se(g.filePaths.length===1?"":"s"),1)],64))]),m("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${g.name}`,disabled:Ne.value,onClick:T=>Le(g.id)},"×",8,kk)]))),128))])):oe("",!0),pt.value.length>0?(_(),I("div",Tk,[(_(!0),I(je,null,bt(pt.value,g=>(_(),I("span",{key:g.fsPath,class:"thread-composer-file-chip"},[Re(Lo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:g.fsPath},se(g.label),9,Sk),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${g.label}`,disabled:Ne.value,onClick:T=>Ae(g.fsPath)},"×",8,Ik)]))),128))])):oe("",!0),i.value.length>0?(_(),I("div",Ek,[(_(!0),I(je,null,bt(i.value,g=>(_(),I("span",{key:g.path,class:"thread-composer-skill-chip"},[m("span",Ck,se(g.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${g.name}`,onClick:T=>fe(g.path)},"×",8,Ak)]))),128))])):oe("",!0),m("div",Rk,[ne.value?(_(),I("div",Pk,[ee.value.length>0?(_(!0),I(je,{key:0},bt(ee.value,(g,T)=>(_(),I("button",{key:g.path,class:it(["thread-composer-file-mention-row",{"is-active":T===X.value}]),type:"button",onMousedown:ot(B=>xe(g),["prevent"])},[an(g.path)?(_(),I("span",{key:0,class:it(["thread-composer-file-mention-icon-badge",`is-${ln(g.path)}`])},se(an(g.path)),3)):cn(g.path)?(_(),I("span",Mk,"↓")):(_(),dt(Lo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",Ok,[m("span",Nk,se(Bt(g.path)),1),Tt(g.path)?(_(),I("span",$k,se(Tt(g.path)),1)):oe("",!0)])],42,xk))),128)):(_(),I("div",Dk,"No matching files"))])):oe("",!0),tr(m("textarea",{ref_key:"inputRef",ref:ce,"onUpdate:modelValue":f[0]||(f[0]=g=>s.value=g),class:"thread-composer-input",placeholder:Ce.value,disabled:Ne.value,onInput:gt,onKeydown:Lt},null,40,Lk),[[nr,s.value]]),Re(pk,{skills:Qe.value,visible:me.value,"anchor-bottom":44,"anchor-left":0,onSelect:mn,onClose:jt},null,8,["skills","visible"])]),m("div",{class:it(["thread-composer-controls",{"thread-composer-controls--recording":H.value}])},[m("div",{ref_key:"attachMenuRootRef",ref:Y,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ne.value,onClick:W}," + ",8,jk),ue.value?(_(),I("div",Uk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:K}," Add photos & files ",8,Bk),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:ke}," Add folder ",8,Fk),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:V}," Take photo ",8,Hk)])):oe("",!0)],512),H.value?oe("",!0):(_(),I(je,{key:0},[Re(jo,{class:"thread-composer-control","model-value":e.selectedModel,options:at.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":P},null,8,["model-value","options","disabled"]),Re(ok,{class:"thread-composer-control",options:Ze.value,"selected-values":Je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:In},null,8,["options","selected-values","disabled"]),Re(jo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Me,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":j},null,8,["model-value","disabled"])],64)),m("div",{class:it(["thread-composer-actions",{"thread-composer-actions--recording":H.value}])},[ge(c)==="recording"?(_(),I("div",Vk,[m("canvas",{ref_key:"dictationWaveformCanvasRef",ref:S,class:"thread-composer-dictation-waveform"},null,512)])):oe("",!0),ge(c)==="recording"?(_(),I("span",Wk,se(_e.value),1)):oe("",!0),ge(h)?(_(),I("button",{key:2,class:it(["thread-composer-mic",{"thread-composer-mic--active":ge(c)==="recording"}]),type:"button","aria-label":he.value,title:he.value,disabled:Ne.value,onClick:U,onPointerdown:x,onPointerup:$,onPointercancel:$},[ge(c)==="recording"?(_(),dt(Hc,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(_(),dt(O_,{key:1,class:"thread-composer-mic-icon"}))],42,zk)):oe("",!0),e.isTurnInProgress?(_(),I("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:k},[Re(Hc,{class:"thread-composer-stop-icon"})],8,qk)):(_(),I("button",{key:4,class:it(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&De.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&De.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${De.value}`:"Send",disabled:!Ye.value,onClick:f[1]||(f[1]=g=>w(e.isTurnInProgress?De.value:"steer"))},[Re(R_,{class:"thread-composer-submit-icon"})],10,Gk))],2)],2)],2),m("input",{ref_key:"photoLibraryInputRef",ref:F,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ne.value,onChange:It},null,40,Kk),m("input",{ref_key:"cameraCaptureInputRef",ref:J,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ne.value,onChange:Zt},null,40,Jk),m("input",{ref_key:"folderPickerInputRef",ref:G,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:Ne.value,onChange:nt},null,40,Yk)],32))}}),Vc=rt(Xk,[["__scopeId","data-v-c1acf67b"]]),Qk={key:0,class:"queued-messages"},Zk={class:"queued-messages-inner"},e0={class:"queued-row-text"},t0={class:"queued-row-actions"},n0=["onClick"],r0=["onClick"],s0=xt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(_(),I("div",Qk,[m("div",Zk,[(_(!0),I(je,null,bt(e.messages,r=>(_(),I("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",e0,se(r.text),1),m("div",t0,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,n0),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,r0)])]))),128))])])):oe("",!0)}}),o0=rt(s0,[["__scopeId","data-v-ea583733"]]),i0={class:"runtime-dropdown-trigger-label"},a0={key:0,class:"runtime-dropdown-menu-wrap"},l0={class:"runtime-dropdown-menu"},c0=["onClick"],u0={class:"runtime-dropdown-option-label"},d0={key:0,class:"runtime-dropdown-option-check"},f0=xt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(!1),i=[{value:"local",label:"Local project",icon:el},{value:"worktree",label:"New worktree",icon:So}],a=ae(()=>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 h=s.value;if(!h)return;const y=c.target;y instanceof Node&&(h.contains(y)||(o.value=!1))}return ir(()=>{window.addEventListener("pointerdown",u)}),ar(()=>{window.removeEventListener("pointerdown",u)}),(c,h)=>(_(),I("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:h[0]||(h[0]=y=>o.value=!o.value)},[(_(),dt(ca(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",i0,se(a.value.label),1),Re(li,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(_(),I("div",a0,[m("div",l0,[h[1]||(h[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(_(),I(je,null,bt(i,y=>m("button",{key:y.value,class:it(["runtime-dropdown-option",{"is-selected":e.modelValue===y.value}]),type:"button",onClick:S=>l(y.value)},[(_(),dt(ca(y.icon),{class:"runtime-dropdown-option-icon"})),m("span",u0,se(y.label),1),e.modelValue===y.value?(_(),I("span",d0,"✓")):oe("",!0)],10,c0)),64))])])):oe("",!0)],512))}}),h0=rt(f0,[["__scopeId","data-v-9c9b71e5"]]),p0={},m0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function g0(e,t){return _(),I("svg",m0,[...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 _a=rt(p0,[["render",g0]]),v0={class:"skill-card-top"},y0=["src","alt"],w0={key:1,class:"skill-card-avatar-fallback"},b0={class:"skill-card-info"},_0={class:"skill-card-header"},k0={class:"skill-card-name"},T0={key:0,class:"skill-card-badge-disabled"},S0={key:1,class:"skill-card-badge"},I0={class:"skill-card-owner"},E0={key:0,class:"skill-card-desc"},C0={key:1,class:"skill-card-date"},A0=xt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ae(()=>{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)=>(_(),I("button",{class:it(["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",v0,[e.skill.avatarUrl?(_(),I("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,y0)):(_(),I("div",w0,se(e.skill.owner.charAt(0)),1)),m("div",b0,[m("div",_0,[m("span",k0,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(_(),I("span",T0,"Disabled")):e.skill.installed?(_(),I("span",S0,"Installed")):oe("",!0)]),m("span",I0,se(e.skill.owner),1)])]),e.skill.description?(_(),I("p",E0,se(e.skill.description),1)):oe("",!0),n.value?(_(),I("span",C0,se(n.value),1)):oe("",!0)],2))}}),Wc=rt(A0,[["__scopeId","data-v-2a1e8196"]]),R0={class:"sdm-panel"},P0={class:"sdm-header"},x0={class:"sdm-title-area"},M0=["src","alt"],O0={class:"sdm-title-col"},N0={class:"sdm-title-row"},$0={class:"sdm-title"},D0={key:0,class:"sdm-badge-disabled"},L0={class:"sdm-owner"},j0={class:"sdm-body"},U0={key:0,class:"sdm-desc"},B0={key:1,class:"sdm-readme-loading"},F0=["innerHTML"],H0=["href"],V0={class:"sdm-footer"},W0={class:"sdm-footer-actions"},z0=["disabled"],q0=["disabled"],G0=["disabled"],K0=xt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=N(null),o=N(""),i=N(!1),a=ae(()=>s.value??n.skill.enabled??!0),l=ae(()=>n.isInstalling===!0||n.isUninstalling===!0),u=ae(()=>{const R=o.value;if(!R)return"";const q=R.replace(/^---[\s\S]*?---\s*/,"");return c(q)});function c(R){return R.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 h(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const R=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),q=await fetch(`/codex-api/skills-hub/readme?${R}`);if(!q.ok)return;const Y=await q.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}ft(()=>n.visible,R=>{R&&(s.value=null,o.value="",h())});function y(){r("install",n.skill)}function S(){r("uninstall",n.skill)}function L(){const R=!a.value;s.value=R,r("toggle-enabled",n.skill,R)}return(R,q)=>(_(),dt(Mo,{to:"body"},[e.visible?(_(),I("div",{key:0,class:"sdm-overlay",onClick:q[1]||(q[1]=ot(Y=>R.$emit("close"),["self"]))},[m("div",R0,[m("div",P0,[m("div",x0,[e.skill.avatarUrl?(_(),I("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,M0)):oe("",!0),m("div",O0,[m("div",N0,[m("h3",$0,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(_(),I("span",D0,"Disabled")):oe("",!0)]),m("span",L0,se(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:q[0]||(q[0]=Y=>R.$emit("close"))},[Re(tl,{class:"sdm-close-icon"})])]),m("div",j0,[e.skill.description?(_(),I("p",U0,se(e.skill.description),1)):oe("",!0),i.value?(_(),I("div",B0,"Loading skill contents...")):o.value?(_(),I("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,F0)):oe("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,H0)]),m("div",V0,[m("div",W0,[e.skill.installed?(_(),I("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:S},se(n.isUninstalling?"Uninstalling...":"Uninstall"),9,z0)):(_(),I("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:y},se(n.isInstalling?"Installing...":"Install"),9,q0)),e.skill.installed?(_(),I("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:L},se(a.value?"Disable":"Enable"),9,G0)):oe("",!0)])])])])):oe("",!0)]))}}),J0=rt(K0,[["__scopeId","data-v-19a385ca"]]),Y0=()=>{};var zc={};/**
39
- * @license
40
- * Copyright 2017 Google LLC
41
- *
42
- * Licensed under the Apache License, Version 2.0 (the "License");
43
- * you may not use this file except in compliance with the License.
44
- * You may obtain a copy of the License at
45
- *
46
- * http://www.apache.org/licenses/LICENSE-2.0
47
- *
48
- * Unless required by applicable law or agreed to in writing, software
49
- * distributed under the License is distributed on an "AS IS" BASIS,
50
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51
- * See the License for the specific language governing permissions and
52
- * limitations under the License.
53
- */const uf=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},X0=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("")},df={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,h=(o&3)<<4|a>>4;let y=(a&15)<<2|u>>6,S=u&63;l||(S=64,i||(y=64)),r.push(n[c],n[h],n[y],n[S])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(uf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):X0(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 h=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||h==null)throw new Q0;const y=o<<2|a>>4;if(r.push(y),u!==64){const S=a<<4&240|u>>2;if(r.push(S),h!==64){const L=u<<6&192|h;r.push(L)}}}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 Q0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Z0=function(e){const t=uf(e);return df.encodeByteArray(t,!0)},ff=function(e){return Z0(e).replace(/\./g,"")},hf=function(e){try{return df.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
54
- * @license
55
- * Copyright 2022 Google LLC
56
- *
57
- * Licensed under the Apache License, Version 2.0 (the "License");
58
- * you may not use this file except in compliance with the License.
59
- * You may obtain a copy of the License at
60
- *
61
- * http://www.apache.org/licenses/LICENSE-2.0
62
- *
63
- * Unless required by applicable law or agreed to in writing, software
64
- * distributed under the License is distributed on an "AS IS" BASIS,
65
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
- * See the License for the specific language governing permissions and
67
- * limitations under the License.
68
- */function eT(){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.")}/**
69
- * @license
70
- * Copyright 2022 Google LLC
71
- *
72
- * Licensed under the Apache License, Version 2.0 (the "License");
73
- * you may not use this file except in compliance with the License.
74
- * You may obtain a copy of the License at
75
- *
76
- * http://www.apache.org/licenses/LICENSE-2.0
77
- *
78
- * Unless required by applicable law or agreed to in writing, software
79
- * distributed under the License is distributed on an "AS IS" BASIS,
80
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81
- * See the License for the specific language governing permissions and
82
- * limitations under the License.
83
- */const tT=()=>eT().__FIREBASE_DEFAULTS__,nT=()=>{if(typeof process>"u"||typeof zc>"u")return;const e=zc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},rT=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&hf(e[1]);return t&&JSON.parse(t)},sl=()=>{try{return Y0()||tT()||nT()||rT()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},sT=e=>{var t,n;return(n=(t=sl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},pf=()=>{var e;return(e=sl())==null?void 0:e.config},mf=e=>{var t;return(t=sl())==null?void 0:t[`_${e}`]};/**
84
- * @license
85
- * Copyright 2017 Google LLC
86
- *
87
- * Licensed under the Apache License, Version 2.0 (the "License");
88
- * you may not use this file except in compliance with the License.
89
- * You may obtain a copy of the License at
90
- *
91
- * http://www.apache.org/licenses/LICENSE-2.0
92
- *
93
- * Unless required by applicable law or agreed to in writing, software
94
- * distributed under the License is distributed on an "AS IS" BASIS,
95
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
- * See the License for the specific language governing permissions and
97
- * limitations under the License.
98
- */class oT{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))}}}/**
99
- * @license
100
- * Copyright 2017 Google LLC
101
- *
102
- * Licensed under the Apache License, Version 2.0 (the "License");
103
- * you may not use this file except in compliance with the License.
104
- * You may obtain a copy of the License at
105
- *
106
- * http://www.apache.org/licenses/LICENSE-2.0
107
- *
108
- * Unless required by applicable law or agreed to in writing, software
109
- * distributed under the License is distributed on an "AS IS" BASIS,
110
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111
- * See the License for the specific language governing permissions and
112
- * limitations under the License.
113
- */function Qt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function iT(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Qt())}function aT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function lT(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function cT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function uT(){const e=Qt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function dT(){try{return typeof indexedDB=="object"}catch{return!1}}function fT(){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)}})}/**
114
- * @license
115
- * Copyright 2017 Google LLC
116
- *
117
- * Licensed under the Apache License, Version 2.0 (the "License");
118
- * you may not use this file except in compliance with the License.
119
- * You may obtain a copy of the License at
120
- *
121
- * http://www.apache.org/licenses/LICENSE-2.0
122
- *
123
- * Unless required by applicable law or agreed to in writing, software
124
- * distributed under the License is distributed on an "AS IS" BASIS,
125
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126
- * See the License for the specific language governing permissions and
127
- * limitations under the License.
128
- */const hT="FirebaseError";class Er extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=hT,Object.setPrototypeOf(this,Er.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ro.prototype.create)}}class ro{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?pT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Er(s,a,r)}}function pT(e,t){return e.replace(mT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const mT=/\{\$([^}]+)}/g;function gT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function fs(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(qc(o)&&qc(i)){if(!fs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function qc(e){return e!==null&&typeof e=="object"}/**
129
- * @license
130
- * Copyright 2017 Google LLC
131
- *
132
- * Licensed under the Apache License, Version 2.0 (the "License");
133
- * you may not use this file except in compliance with the License.
134
- * You may obtain a copy of the License at
135
- *
136
- * http://www.apache.org/licenses/LICENSE-2.0
137
- *
138
- * Unless required by applicable law or agreed to in writing, software
139
- * distributed under the License is distributed on an "AS IS" BASIS,
140
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141
- * See the License for the specific language governing permissions and
142
- * limitations under the License.
143
- */function so(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 vT(e,t){const n=new yT(e,t);return n.subscribe.bind(n)}class yT{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.");wT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Vi),s.error===void 0&&(s.error=Vi),s.complete===void 0&&(s.complete=Vi);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 wT(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 Vi(){}/**
144
- * @license
145
- * Copyright 2021 Google LLC
146
- *
147
- * Licensed under the Apache License, Version 2.0 (the "License");
148
- * you may not use this file except in compliance with the License.
149
- * You may obtain a copy of the License at
150
- *
151
- * http://www.apache.org/licenses/LICENSE-2.0
152
- *
153
- * Unless required by applicable law or agreed to in writing, software
154
- * distributed under the License is distributed on an "AS IS" BASIS,
155
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
- * See the License for the specific language governing permissions and
157
- * limitations under the License.
158
- */function gs(e){return e&&e._delegate?e._delegate:e}/**
159
- * @license
160
- * Copyright 2025 Google LLC
161
- *
162
- * Licensed under the Apache License, Version 2.0 (the "License");
163
- * you may not use this file except in compliance with the License.
164
- * You may obtain a copy of the License at
165
- *
166
- * http://www.apache.org/licenses/LICENSE-2.0
167
- *
168
- * Unless required by applicable law or agreed to in writing, software
169
- * distributed under the License is distributed on an "AS IS" BASIS,
170
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
171
- * See the License for the specific language governing permissions and
172
- * limitations under the License.
173
- */function ol(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function bT(e){return(await fetch(e,{credentials:"include"})).ok}class hs{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}}/**
174
- * @license
175
- * Copyright 2019 Google LLC
176
- *
177
- * Licensed under the Apache License, Version 2.0 (the "License");
178
- * you may not use this file except in compliance with the License.
179
- * You may obtain a copy of the License at
180
- *
181
- * http://www.apache.org/licenses/LICENSE-2.0
182
- *
183
- * Unless required by applicable law or agreed to in writing, software
184
- * distributed under the License is distributed on an "AS IS" BASIS,
185
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
186
- * See the License for the specific language governing permissions and
187
- * limitations under the License.
188
- */const Dr="[DEFAULT]";/**
189
- * @license
190
- * Copyright 2019 Google LLC
191
- *
192
- * Licensed under the Apache License, Version 2.0 (the "License");
193
- * you may not use this file except in compliance with the License.
194
- * You may obtain a copy of the License at
195
- *
196
- * http://www.apache.org/licenses/LICENSE-2.0
197
- *
198
- * Unless required by applicable law or agreed to in writing, software
199
- * distributed under the License is distributed on an "AS IS" BASIS,
200
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- * See the License for the specific language governing permissions and
202
- * limitations under the License.
203
- */class _T{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 oT;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(TT(t))try{this.getOrInitializeService({instanceIdentifier:Dr})}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=Dr){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=Dr){return this.instances.has(t)}getOptions(t=Dr){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:kT(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=Dr){return this.component?this.component.multipleInstances?t:Dr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function kT(e){return e===Dr?void 0:e}function TT(e){return e.instantiationMode==="EAGER"}/**
204
- * @license
205
- * Copyright 2019 Google LLC
206
- *
207
- * Licensed under the Apache License, Version 2.0 (the "License");
208
- * you may not use this file except in compliance with the License.
209
- * You may obtain a copy of the License at
210
- *
211
- * http://www.apache.org/licenses/LICENSE-2.0
212
- *
213
- * Unless required by applicable law or agreed to in writing, software
214
- * distributed under the License is distributed on an "AS IS" BASIS,
215
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
- * See the License for the specific language governing permissions and
217
- * limitations under the License.
218
- */class ST{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 _T(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
219
- * @license
220
- * Copyright 2017 Google LLC
221
- *
222
- * Licensed under the Apache License, Version 2.0 (the "License");
223
- * you may not use this file except in compliance with the License.
224
- * You may obtain a copy of the License at
225
- *
226
- * http://www.apache.org/licenses/LICENSE-2.0
227
- *
228
- * Unless required by applicable law or agreed to in writing, software
229
- * distributed under the License is distributed on an "AS IS" BASIS,
230
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
231
- * See the License for the specific language governing permissions and
232
- * limitations under the License.
233
- */var vt;(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"})(vt||(vt={}));const IT={debug:vt.DEBUG,verbose:vt.VERBOSE,info:vt.INFO,warn:vt.WARN,error:vt.ERROR,silent:vt.SILENT},ET=vt.INFO,CT={[vt.DEBUG]:"log",[vt.VERBOSE]:"log",[vt.INFO]:"info",[vt.WARN]:"warn",[vt.ERROR]:"error"},AT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=CT[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 gf{constructor(t){this.name=t,this._logLevel=ET,this._logHandler=AT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in vt))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,vt.DEBUG,...t),this._logHandler(this,vt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,vt.VERBOSE,...t),this._logHandler(this,vt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,vt.INFO,...t),this._logHandler(this,vt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,vt.WARN,...t),this._logHandler(this,vt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,vt.ERROR,...t),this._logHandler(this,vt.ERROR,...t)}}const RT=(e,t)=>t.some(n=>e instanceof n);let Gc,Kc;function PT(){return Gc||(Gc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function xT(){return Kc||(Kc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const vf=new WeakMap,ka=new WeakMap,yf=new WeakMap,Wi=new WeakMap,il=new WeakMap;function MT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(kr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&vf.set(n,e)}).catch(()=>{}),il.set(t,e),t}function OT(e){if(ka.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)});ka.set(e,t)}let Ta={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return ka.get(e);if(t==="objectStoreNames")return e.objectStoreNames||yf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return kr(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 NT(e){Ta=e(Ta)}function $T(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(zi(this),t,...n);return yf.set(r,t.sort?t.sort():[t]),kr(r)}:xT().includes(e)?function(...t){return e.apply(zi(this),t),kr(vf.get(this))}:function(...t){return kr(e.apply(zi(this),t))}}function DT(e){return typeof e=="function"?$T(e):(e instanceof IDBTransaction&&OT(e),RT(e,PT())?new Proxy(e,Ta):e)}function kr(e){if(e instanceof IDBRequest)return MT(e);if(Wi.has(e))return Wi.get(e);const t=DT(e);return t!==e&&(Wi.set(e,t),il.set(t,e)),t}const zi=e=>il.get(e);function LT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=kr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(kr(i.result),l.oldVersion,l.newVersion,kr(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 jT=["get","getKey","getAll","getAllKeys","count"],UT=["put","add","delete","clear"],qi=new Map;function Jc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(qi.get(t))return qi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=UT.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||jT.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 qi.set(t,o),o}NT(e=>({...e,get:(t,n,r)=>Jc(t,n)||e.get(t,n,r),has:(t,n)=>!!Jc(t,n)||e.has(t,n)}));/**
234
- * @license
235
- * Copyright 2019 Google LLC
236
- *
237
- * Licensed under the Apache License, Version 2.0 (the "License");
238
- * you may not use this file except in compliance with the License.
239
- * You may obtain a copy of the License at
240
- *
241
- * http://www.apache.org/licenses/LICENSE-2.0
242
- *
243
- * Unless required by applicable law or agreed to in writing, software
244
- * distributed under the License is distributed on an "AS IS" BASIS,
245
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
246
- * See the License for the specific language governing permissions and
247
- * limitations under the License.
248
- */class BT{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(FT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function FT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Sa="@firebase/app",Yc="0.14.10";/**
249
- * @license
250
- * Copyright 2019 Google LLC
251
- *
252
- * Licensed under the Apache License, Version 2.0 (the "License");
253
- * you may not use this file except in compliance with the License.
254
- * You may obtain a copy of the License at
255
- *
256
- * http://www.apache.org/licenses/LICENSE-2.0
257
- *
258
- * Unless required by applicable law or agreed to in writing, software
259
- * distributed under the License is distributed on an "AS IS" BASIS,
260
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
261
- * See the License for the specific language governing permissions and
262
- * limitations under the License.
263
- */const rr=new gf("@firebase/app"),HT="@firebase/app-compat",VT="@firebase/analytics-compat",WT="@firebase/analytics",zT="@firebase/app-check-compat",qT="@firebase/app-check",GT="@firebase/auth",KT="@firebase/auth-compat",JT="@firebase/database",YT="@firebase/data-connect",XT="@firebase/database-compat",QT="@firebase/functions",ZT="@firebase/functions-compat",eS="@firebase/installations",tS="@firebase/installations-compat",nS="@firebase/messaging",rS="@firebase/messaging-compat",sS="@firebase/performance",oS="@firebase/performance-compat",iS="@firebase/remote-config",aS="@firebase/remote-config-compat",lS="@firebase/storage",cS="@firebase/storage-compat",uS="@firebase/firestore",dS="@firebase/ai",fS="@firebase/firestore-compat",hS="firebase",pS="12.11.0";/**
264
- * @license
265
- * Copyright 2019 Google LLC
266
- *
267
- * Licensed under the Apache License, Version 2.0 (the "License");
268
- * you may not use this file except in compliance with the License.
269
- * You may obtain a copy of the License at
270
- *
271
- * http://www.apache.org/licenses/LICENSE-2.0
272
- *
273
- * Unless required by applicable law or agreed to in writing, software
274
- * distributed under the License is distributed on an "AS IS" BASIS,
275
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
276
- * See the License for the specific language governing permissions and
277
- * limitations under the License.
278
- */const Ia="[DEFAULT]",mS={[Sa]:"fire-core",[HT]:"fire-core-compat",[WT]:"fire-analytics",[VT]:"fire-analytics-compat",[qT]:"fire-app-check",[zT]:"fire-app-check-compat",[GT]:"fire-auth",[KT]:"fire-auth-compat",[JT]:"fire-rtdb",[YT]:"fire-data-connect",[XT]:"fire-rtdb-compat",[QT]:"fire-fn",[ZT]:"fire-fn-compat",[eS]:"fire-iid",[tS]:"fire-iid-compat",[nS]:"fire-fcm",[rS]:"fire-fcm-compat",[sS]:"fire-perf",[oS]:"fire-perf-compat",[iS]:"fire-rc",[aS]:"fire-rc-compat",[lS]:"fire-gcs",[cS]:"fire-gcs-compat",[uS]:"fire-fst",[fS]:"fire-fst-compat",[dS]:"fire-vertex","fire-js":"fire-js",[hS]:"fire-js-all"};/**
279
- * @license
280
- * Copyright 2019 Google LLC
281
- *
282
- * Licensed under the Apache License, Version 2.0 (the "License");
283
- * you may not use this file except in compliance with the License.
284
- * You may obtain a copy of the License at
285
- *
286
- * http://www.apache.org/licenses/LICENSE-2.0
287
- *
288
- * Unless required by applicable law or agreed to in writing, software
289
- * distributed under the License is distributed on an "AS IS" BASIS,
290
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
291
- * See the License for the specific language governing permissions and
292
- * limitations under the License.
293
- */const Ys=new Map,gS=new Map,Ea=new Map;function Xc(e,t){try{e.container.addComponent(t)}catch(n){rr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Xs(e){const t=e.name;if(Ea.has(t))return rr.debug(`There were multiple attempts to register component ${t}.`),!1;Ea.set(t,e);for(const n of Ys.values())Xc(n,e);for(const n of gS.values())Xc(n,e);return!0}function wf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function On(e){return e==null?!1:e.settings!==void 0}/**
294
- * @license
295
- * Copyright 2019 Google LLC
296
- *
297
- * Licensed under the Apache License, Version 2.0 (the "License");
298
- * you may not use this file except in compliance with the License.
299
- * You may obtain a copy of the License at
300
- *
301
- * http://www.apache.org/licenses/LICENSE-2.0
302
- *
303
- * Unless required by applicable law or agreed to in writing, software
304
- * distributed under the License is distributed on an "AS IS" BASIS,
305
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
306
- * See the License for the specific language governing permissions and
307
- * limitations under the License.
308
- */const vS={"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."},Tr=new ro("app","Firebase",vS);/**
309
- * @license
310
- * Copyright 2019 Google LLC
311
- *
312
- * Licensed under the Apache License, Version 2.0 (the "License");
313
- * you may not use this file except in compliance with the License.
314
- * You may obtain a copy of the License at
315
- *
316
- * http://www.apache.org/licenses/LICENSE-2.0
317
- *
318
- * Unless required by applicable law or agreed to in writing, software
319
- * distributed under the License is distributed on an "AS IS" BASIS,
320
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
321
- * See the License for the specific language governing permissions and
322
- * limitations under the License.
323
- */class yS{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 hs("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 Tr.create("app-deleted",{appName:this._name})}}/**
324
- * @license
325
- * Copyright 2019 Google LLC
326
- *
327
- * Licensed under the Apache License, Version 2.0 (the "License");
328
- * you may not use this file except in compliance with the License.
329
- * You may obtain a copy of the License at
330
- *
331
- * http://www.apache.org/licenses/LICENSE-2.0
332
- *
333
- * Unless required by applicable law or agreed to in writing, software
334
- * distributed under the License is distributed on an "AS IS" BASIS,
335
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336
- * See the License for the specific language governing permissions and
337
- * limitations under the License.
338
- */const oo=pS;function bf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:Ia,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw Tr.create("bad-app-name",{appName:String(s)});if(n||(n=pf()),!n)throw Tr.create("no-options");const o=Ys.get(s);if(o){if(fs(n,o.options)&&fs(r,o.config))return o;throw Tr.create("duplicate-app",{appName:s})}const i=new ST(s);for(const l of Ea.values())i.addComponent(l);const a=new yS(n,r,i);return Ys.set(s,a),a}function _f(e=Ia){const t=Ys.get(e);if(!t&&e===Ia&&pf())return bf();if(!t)throw Tr.create("no-app",{appName:e});return t}function wS(){return Array.from(Ys.values())}function os(e,t,n){let r=mS[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}Xs(new hs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
339
- * @license
340
- * Copyright 2021 Google LLC
341
- *
342
- * Licensed under the Apache License, Version 2.0 (the "License");
343
- * you may not use this file except in compliance with the License.
344
- * You may obtain a copy of the License at
345
- *
346
- * http://www.apache.org/licenses/LICENSE-2.0
347
- *
348
- * Unless required by applicable law or agreed to in writing, software
349
- * distributed under the License is distributed on an "AS IS" BASIS,
350
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
- * See the License for the specific language governing permissions and
352
- * limitations under the License.
353
- */const bS="firebase-heartbeat-database",_S=1,Qs="firebase-heartbeat-store";let Gi=null;function kf(){return Gi||(Gi=LT(bS,_S,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Qs)}catch(n){console.warn(n)}}}}).catch(e=>{throw Tr.create("idb-open",{originalErrorMessage:e.message})})),Gi}async function kS(e){try{const n=(await kf()).transaction(Qs),r=await n.objectStore(Qs).get(Tf(e));return await n.done,r}catch(t){if(t instanceof Er)rr.warn(t.message);else{const n=Tr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});rr.warn(n.message)}}}async function Qc(e,t){try{const r=(await kf()).transaction(Qs,"readwrite");await r.objectStore(Qs).put(t,Tf(e)),await r.done}catch(n){if(n instanceof Er)rr.warn(n.message);else{const r=Tr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});rr.warn(r.message)}}}function Tf(e){return`${e.name}!${e.options.appId}`}/**
354
- * @license
355
- * Copyright 2021 Google LLC
356
- *
357
- * Licensed under the Apache License, Version 2.0 (the "License");
358
- * you may not use this file except in compliance with the License.
359
- * You may obtain a copy of the License at
360
- *
361
- * http://www.apache.org/licenses/LICENSE-2.0
362
- *
363
- * Unless required by applicable law or agreed to in writing, software
364
- * distributed under the License is distributed on an "AS IS" BASIS,
365
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
366
- * See the License for the specific language governing permissions and
367
- * limitations under the License.
368
- */const TS=1024,SS=30;class IS{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new CS(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>SS){const i=AS(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}=ES(this._heartbeatsCache.heartbeats),o=ff(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 ES(e,t=TS){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),eu(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),eu(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class CS{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return dT()?fT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await kS(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 eu(e){return ff(JSON.stringify({version:2,heartbeats:e})).length}function AS(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}/**
369
- * @license
370
- * Copyright 2019 Google LLC
371
- *
372
- * Licensed under the Apache License, Version 2.0 (the "License");
373
- * you may not use this file except in compliance with the License.
374
- * You may obtain a copy of the License at
375
- *
376
- * http://www.apache.org/licenses/LICENSE-2.0
377
- *
378
- * Unless required by applicable law or agreed to in writing, software
379
- * distributed under the License is distributed on an "AS IS" BASIS,
380
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
381
- * See the License for the specific language governing permissions and
382
- * limitations under the License.
383
- */function RS(e){Xs(new hs("platform-logger",t=>new BT(t),"PRIVATE")),Xs(new hs("heartbeat",t=>new IS(t),"PRIVATE")),os(Sa,Yc,e),os(Sa,Yc,"esm2020"),os("fire-js","")}RS("");var PS="firebase",xS="12.11.0";/**
384
- * @license
385
- * Copyright 2020 Google LLC
386
- *
387
- * Licensed under the Apache License, Version 2.0 (the "License");
388
- * you may not use this file except in compliance with the License.
389
- * You may obtain a copy of the License at
390
- *
391
- * http://www.apache.org/licenses/LICENSE-2.0
392
- *
393
- * Unless required by applicable law or agreed to in writing, software
394
- * distributed under the License is distributed on an "AS IS" BASIS,
395
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
396
- * See the License for the specific language governing permissions and
397
- * limitations under the License.
398
- */os(PS,xS,"app");function Sf(){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 MS=Sf,If=new ro("auth","Firebase",Sf());/**
399
- * @license
400
- * Copyright 2020 Google LLC
401
- *
402
- * Licensed under the Apache License, Version 2.0 (the "License");
403
- * you may not use this file except in compliance with the License.
404
- * You may obtain a copy of the License at
405
- *
406
- * http://www.apache.org/licenses/LICENSE-2.0
407
- *
408
- * Unless required by applicable law or agreed to in writing, software
409
- * distributed under the License is distributed on an "AS IS" BASIS,
410
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
411
- * See the License for the specific language governing permissions and
412
- * limitations under the License.
413
- */const Uo=new gf("@firebase/auth");function OS(e,...t){Uo.logLevel<=vt.WARN&&Uo.warn(`Auth (${oo}): ${e}`,...t)}function Io(e,...t){Uo.logLevel<=vt.ERROR&&Uo.error(`Auth (${oo}): ${e}`,...t)}/**
414
- * @license
415
- * Copyright 2020 Google LLC
416
- *
417
- * Licensed under the Apache License, Version 2.0 (the "License");
418
- * you may not use this file except in compliance with the License.
419
- * You may obtain a copy of the License at
420
- *
421
- * http://www.apache.org/licenses/LICENSE-2.0
422
- *
423
- * Unless required by applicable law or agreed to in writing, software
424
- * distributed under the License is distributed on an "AS IS" BASIS,
425
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
426
- * See the License for the specific language governing permissions and
427
- * limitations under the License.
428
- */function jn(e,...t){throw ll(e,...t)}function bn(e,...t){return ll(e,...t)}function al(e,t,n){const r={...MS(),[t]:n};return new ro("auth","Firebase",r).create(t,{appName:e.name})}function Vr(e){return al(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function NS(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&jn(e,"argument-error"),al(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ll(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 If.create(e,...t)}function Ve(e,t,...n){if(!e)throw ll(t,...n)}function Jn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Io(t),new Error(t)}function sr(e,t){e||Jn(t)}/**
429
- * @license
430
- * Copyright 2020 Google LLC
431
- *
432
- * Licensed under the Apache License, Version 2.0 (the "License");
433
- * you may not use this file except in compliance with the License.
434
- * You may obtain a copy of the License at
435
- *
436
- * http://www.apache.org/licenses/LICENSE-2.0
437
- *
438
- * Unless required by applicable law or agreed to in writing, software
439
- * distributed under the License is distributed on an "AS IS" BASIS,
440
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
441
- * See the License for the specific language governing permissions and
442
- * limitations under the License.
443
- */function Ca(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function $S(){return tu()==="http:"||tu()==="https:"}function tu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
444
- * @license
445
- * Copyright 2020 Google LLC
446
- *
447
- * Licensed under the Apache License, Version 2.0 (the "License");
448
- * you may not use this file except in compliance with the License.
449
- * You may obtain a copy of the License at
450
- *
451
- * http://www.apache.org/licenses/LICENSE-2.0
452
- *
453
- * Unless required by applicable law or agreed to in writing, software
454
- * distributed under the License is distributed on an "AS IS" BASIS,
455
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
456
- * See the License for the specific language governing permissions and
457
- * limitations under the License.
458
- */function DS(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&($S()||lT()||"connection"in navigator)?navigator.onLine:!0}function LS(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
459
- * @license
460
- * Copyright 2020 Google LLC
461
- *
462
- * Licensed under the Apache License, Version 2.0 (the "License");
463
- * you may not use this file except in compliance with the License.
464
- * You may obtain a copy of the License at
465
- *
466
- * http://www.apache.org/licenses/LICENSE-2.0
467
- *
468
- * Unless required by applicable law or agreed to in writing, software
469
- * distributed under the License is distributed on an "AS IS" BASIS,
470
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
471
- * See the License for the specific language governing permissions and
472
- * limitations under the License.
473
- */class io{constructor(t,n){this.shortDelay=t,this.longDelay=n,sr(n>t,"Short delay should be less than long delay!"),this.isMobile=iT()||cT()}get(){return DS()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
474
- * @license
475
- * Copyright 2020 Google LLC
476
- *
477
- * Licensed under the Apache License, Version 2.0 (the "License");
478
- * you may not use this file except in compliance with the License.
479
- * You may obtain a copy of the License at
480
- *
481
- * http://www.apache.org/licenses/LICENSE-2.0
482
- *
483
- * Unless required by applicable law or agreed to in writing, software
484
- * distributed under the License is distributed on an "AS IS" BASIS,
485
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
486
- * See the License for the specific language governing permissions and
487
- * limitations under the License.
488
- */function cl(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}/**
489
- * @license
490
- * Copyright 2020 Google LLC
491
- *
492
- * Licensed under the Apache License, Version 2.0 (the "License");
493
- * you may not use this file except in compliance with the License.
494
- * You may obtain a copy of the License at
495
- *
496
- * http://www.apache.org/licenses/LICENSE-2.0
497
- *
498
- * Unless required by applicable law or agreed to in writing, software
499
- * distributed under the License is distributed on an "AS IS" BASIS,
500
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
501
- * See the License for the specific language governing permissions and
502
- * limitations under the License.
503
- */class Ef{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")}}/**
504
- * @license
505
- * Copyright 2020 Google LLC
506
- *
507
- * Licensed under the Apache License, Version 2.0 (the "License");
508
- * you may not use this file except in compliance with the License.
509
- * You may obtain a copy of the License at
510
- *
511
- * http://www.apache.org/licenses/LICENSE-2.0
512
- *
513
- * Unless required by applicable law or agreed to in writing, software
514
- * distributed under the License is distributed on an "AS IS" BASIS,
515
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
516
- * See the License for the specific language governing permissions and
517
- * limitations under the License.
518
- */const jS={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"};/**
519
- * @license
520
- * Copyright 2020 Google LLC
521
- *
522
- * Licensed under the Apache License, Version 2.0 (the "License");
523
- * you may not use this file except in compliance with the License.
524
- * You may obtain a copy of the License at
525
- *
526
- * http://www.apache.org/licenses/LICENSE-2.0
527
- *
528
- * Unless required by applicable law or agreed to in writing, software
529
- * distributed under the License is distributed on an "AS IS" BASIS,
530
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
531
- * See the License for the specific language governing permissions and
532
- * limitations under the License.
533
- */const US=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],BS=new io(3e4,6e4);function ul(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function vs(e,t,n,r,s={}){return Cf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=so({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 aT()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&ol(e.emulatorConfig.host)&&(u.credentials="include"),Ef.fetch()(await Af(e,e.config.apiHost,n,a),u)})}async function Cf(e,t,n){e._canInitEmulator=!1;const r={...jS,...t};try{const s=new HS(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw po(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 po(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw po(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw po(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw al(e,c,u);jn(e,c)}}catch(s){if(s instanceof Er)throw s;jn(e,"network-request-failed",{message:String(s)})}}async function FS(e,t,n,r,s={}){const o=await vs(e,t,n,r,s);return"mfaPendingCredential"in o&&jn(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function Af(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?cl(e.config,s):`${e.config.apiScheme}://${s}`;return US.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class HS{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(bn(this.auth,"network-request-failed")),BS.get())})}}function po(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=bn(e,t,r);return s.customData._tokenResponse=n,s}/**
534
- * @license
535
- * Copyright 2020 Google LLC
536
- *
537
- * Licensed under the Apache License, Version 2.0 (the "License");
538
- * you may not use this file except in compliance with the License.
539
- * You may obtain a copy of the License at
540
- *
541
- * http://www.apache.org/licenses/LICENSE-2.0
542
- *
543
- * Unless required by applicable law or agreed to in writing, software
544
- * distributed under the License is distributed on an "AS IS" BASIS,
545
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546
- * See the License for the specific language governing permissions and
547
- * limitations under the License.
548
- */async function VS(e,t){return vs(e,"POST","/v1/accounts:delete",t)}async function Bo(e,t){return vs(e,"POST","/v1/accounts:lookup",t)}/**
549
- * @license
550
- * Copyright 2020 Google LLC
551
- *
552
- * Licensed under the Apache License, Version 2.0 (the "License");
553
- * you may not use this file except in compliance with the License.
554
- * You may obtain a copy of the License at
555
- *
556
- * http://www.apache.org/licenses/LICENSE-2.0
557
- *
558
- * Unless required by applicable law or agreed to in writing, software
559
- * distributed under the License is distributed on an "AS IS" BASIS,
560
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
561
- * See the License for the specific language governing permissions and
562
- * limitations under the License.
563
- */function Us(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function WS(e,t=!1){const n=gs(e),r=await n.getIdToken(t),s=dl(r);Ve(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:Us(Ki(s.auth_time)),issuedAtTime:Us(Ki(s.iat)),expirationTime:Us(Ki(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Ki(e){return Number(e)*1e3}function dl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Io("JWT malformed, contained fewer than 3 sections"),null;try{const s=hf(n);return s?JSON.parse(s):(Io("Failed to decode base64 JWT payload"),null)}catch(s){return Io("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function nu(e){const t=dl(e);return Ve(t,"internal-error"),Ve(typeof t.exp<"u","internal-error"),Ve(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
564
- * @license
565
- * Copyright 2020 Google LLC
566
- *
567
- * Licensed under the Apache License, Version 2.0 (the "License");
568
- * you may not use this file except in compliance with the License.
569
- * You may obtain a copy of the License at
570
- *
571
- * http://www.apache.org/licenses/LICENSE-2.0
572
- *
573
- * Unless required by applicable law or agreed to in writing, software
574
- * distributed under the License is distributed on an "AS IS" BASIS,
575
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
576
- * See the License for the specific language governing permissions and
577
- * limitations under the License.
578
- */async function Zs(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Er&&zS(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function zS({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
579
- * @license
580
- * Copyright 2020 Google LLC
581
- *
582
- * Licensed under the Apache License, Version 2.0 (the "License");
583
- * you may not use this file except in compliance with the License.
584
- * You may obtain a copy of the License at
585
- *
586
- * http://www.apache.org/licenses/LICENSE-2.0
587
- *
588
- * Unless required by applicable law or agreed to in writing, software
589
- * distributed under the License is distributed on an "AS IS" BASIS,
590
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
591
- * See the License for the specific language governing permissions and
592
- * limitations under the License.
593
- */class qS{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()}}/**
594
- * @license
595
- * Copyright 2020 Google LLC
596
- *
597
- * Licensed under the Apache License, Version 2.0 (the "License");
598
- * you may not use this file except in compliance with the License.
599
- * You may obtain a copy of the License at
600
- *
601
- * http://www.apache.org/licenses/LICENSE-2.0
602
- *
603
- * Unless required by applicable law or agreed to in writing, software
604
- * distributed under the License is distributed on an "AS IS" BASIS,
605
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
606
- * See the License for the specific language governing permissions and
607
- * limitations under the License.
608
- */class Aa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Us(this.lastLoginAt),this.creationTime=Us(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
609
- * @license
610
- * Copyright 2019 Google LLC
611
- *
612
- * Licensed under the Apache License, Version 2.0 (the "License");
613
- * you may not use this file except in compliance with the License.
614
- * You may obtain a copy of the License at
615
- *
616
- * http://www.apache.org/licenses/LICENSE-2.0
617
- *
618
- * Unless required by applicable law or agreed to in writing, software
619
- * distributed under the License is distributed on an "AS IS" BASIS,
620
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
621
- * See the License for the specific language governing permissions and
622
- * limitations under the License.
623
- */async function Fo(e){var h;const t=e.auth,n=await e.getIdToken(),r=await Zs(e,Bo(t,{idToken:n}));Ve(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(h=s.providerUserInfo)!=null&&h.length?Rf(s.providerUserInfo):[],i=KS(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 Aa(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function GS(e){const t=gs(e);await Fo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function KS(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function Rf(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}))}/**
624
- * @license
625
- * Copyright 2020 Google LLC
626
- *
627
- * Licensed under the Apache License, Version 2.0 (the "License");
628
- * you may not use this file except in compliance with the License.
629
- * You may obtain a copy of the License at
630
- *
631
- * http://www.apache.org/licenses/LICENSE-2.0
632
- *
633
- * Unless required by applicable law or agreed to in writing, software
634
- * distributed under the License is distributed on an "AS IS" BASIS,
635
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636
- * See the License for the specific language governing permissions and
637
- * limitations under the License.
638
- */async function JS(e,t){const n=await Cf(e,{},async()=>{const r=so({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await Af(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&&ol(e.emulatorConfig.host)&&(l.credentials="include"),Ef.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function YS(e,t){return vs(e,"POST","/v2/accounts:revokeToken",ul(e,t))}/**
639
- * @license
640
- * Copyright 2020 Google LLC
641
- *
642
- * Licensed under the Apache License, Version 2.0 (the "License");
643
- * you may not use this file except in compliance with the License.
644
- * You may obtain a copy of the License at
645
- *
646
- * http://www.apache.org/licenses/LICENSE-2.0
647
- *
648
- * Unless required by applicable law or agreed to in writing, software
649
- * distributed under the License is distributed on an "AS IS" BASIS,
650
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
651
- * See the License for the specific language governing permissions and
652
- * limitations under the License.
653
- */class is{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ve(t.idToken,"internal-error"),Ve(typeof t.idToken<"u","internal-error"),Ve(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):nu(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Ve(t.length!==0,"internal-error");const n=nu(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Ve(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 JS(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 is;return r&&(Ve(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Ve(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Ve(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 is,this.toJSON())}_performRefresh(){return Jn("not implemented")}}/**
654
- * @license
655
- * Copyright 2020 Google LLC
656
- *
657
- * Licensed under the Apache License, Version 2.0 (the "License");
658
- * you may not use this file except in compliance with the License.
659
- * You may obtain a copy of the License at
660
- *
661
- * http://www.apache.org/licenses/LICENSE-2.0
662
- *
663
- * Unless required by applicable law or agreed to in writing, software
664
- * distributed under the License is distributed on an "AS IS" BASIS,
665
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
666
- * See the License for the specific language governing permissions and
667
- * limitations under the License.
668
- */function pr(e,t){Ve(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class vn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new qS(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 Aa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await Zs(this,this.stsTokenManager.getToken(this.auth,t));return Ve(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return WS(this,t)}reload(){return GS(this)}_assign(t){this!==t&&(Ve(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 vn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Ve(!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 Fo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(On(this.auth.app))return Promise.reject(Vr(this.auth));const t=await this.getIdToken();return await Zs(this,VS(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:h,emailVerified:y,isAnonymous:S,providerData:L,stsTokenManager:R}=n;Ve(h&&R,t,"internal-error");const q=is.fromJSON(this.name,R);Ve(typeof h=="string",t,"internal-error"),pr(r,t.name),pr(s,t.name),Ve(typeof y=="boolean",t,"internal-error"),Ve(typeof S=="boolean",t,"internal-error"),pr(o,t.name),pr(i,t.name),pr(a,t.name),pr(l,t.name),pr(u,t.name),pr(c,t.name);const Y=new vn({uid:h,auth:t,email:s,emailVerified:y,displayName:r,isAnonymous:S,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:q,createdAt:u,lastLoginAt:c});return L&&Array.isArray(L)&&(Y.providerData=L.map(F=>({...F}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new is;s.updateFromServerResponse(n);const o=new vn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Fo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Ve(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Rf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new is;a.updateFromIdToken(r);const l=new vn({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 Aa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
669
- * @license
670
- * Copyright 2020 Google LLC
671
- *
672
- * Licensed under the Apache License, Version 2.0 (the "License");
673
- * you may not use this file except in compliance with the License.
674
- * You may obtain a copy of the License at
675
- *
676
- * http://www.apache.org/licenses/LICENSE-2.0
677
- *
678
- * Unless required by applicable law or agreed to in writing, software
679
- * distributed under the License is distributed on an "AS IS" BASIS,
680
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
681
- * See the License for the specific language governing permissions and
682
- * limitations under the License.
683
- */const ru=new Map;function Yn(e){sr(e instanceof Function,"Expected a class definition");let t=ru.get(e);return t?(sr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,ru.set(e,t),t)}/**
684
- * @license
685
- * Copyright 2019 Google LLC
686
- *
687
- * Licensed under the Apache License, Version 2.0 (the "License");
688
- * you may not use this file except in compliance with the License.
689
- * You may obtain a copy of the License at
690
- *
691
- * http://www.apache.org/licenses/LICENSE-2.0
692
- *
693
- * Unless required by applicable law or agreed to in writing, software
694
- * distributed under the License is distributed on an "AS IS" BASIS,
695
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
696
- * See the License for the specific language governing permissions and
697
- * limitations under the License.
698
- */class Pf{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){}}Pf.type="NONE";const su=Pf;/**
699
- * @license
700
- * Copyright 2019 Google LLC
701
- *
702
- * Licensed under the Apache License, Version 2.0 (the "License");
703
- * you may not use this file except in compliance with the License.
704
- * You may obtain a copy of the License at
705
- *
706
- * http://www.apache.org/licenses/LICENSE-2.0
707
- *
708
- * Unless required by applicable law or agreed to in writing, software
709
- * distributed under the License is distributed on an "AS IS" BASIS,
710
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
711
- * See the License for the specific language governing permissions and
712
- * limitations under the License.
713
- */function Eo(e,t,n){return`firebase:${e}:${t}:${n}`}class as{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Eo(this.userKey,s.apiKey,o),this.fullPersistenceKey=Eo("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 Bo(this.auth,{idToken:t}).catch(()=>{});return n?vn._fromGetAccountInfoResponse(this.auth,n,t):null}return vn._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 as(Yn(su),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(su);const i=Eo(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let h;if(typeof c=="string"){const y=await Bo(t,{idToken:c}).catch(()=>{});if(!y)break;h=await vn._fromGetAccountInfoResponse(t,y,c)}else h=vn._fromJSON(t,c);u!==o&&(a=h),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new as(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 as(o,t,r))}}/**
714
- * @license
715
- * Copyright 2020 Google LLC
716
- *
717
- * Licensed under the Apache License, Version 2.0 (the "License");
718
- * you may not use this file except in compliance with the License.
719
- * You may obtain a copy of the License at
720
- *
721
- * http://www.apache.org/licenses/LICENSE-2.0
722
- *
723
- * Unless required by applicable law or agreed to in writing, software
724
- * distributed under the License is distributed on an "AS IS" BASIS,
725
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
726
- * See the License for the specific language governing permissions and
727
- * limitations under the License.
728
- */function ou(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Nf(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(xf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Df(t))return"Blackberry";if(Lf(t))return"Webos";if(Mf(t))return"Safari";if((t.includes("chrome/")||Of(t))&&!t.includes("edge/"))return"Chrome";if($f(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 xf(e=Qt()){return/firefox\//i.test(e)}function Mf(e=Qt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Of(e=Qt()){return/crios\//i.test(e)}function Nf(e=Qt()){return/iemobile/i.test(e)}function $f(e=Qt()){return/android/i.test(e)}function Df(e=Qt()){return/blackberry/i.test(e)}function Lf(e=Qt()){return/webos/i.test(e)}function fl(e=Qt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function XS(e=Qt()){var t;return fl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function QS(){return uT()&&document.documentMode===10}function jf(e=Qt()){return fl(e)||$f(e)||Lf(e)||Df(e)||/windows phone/i.test(e)||Nf(e)}/**
729
- * @license
730
- * Copyright 2020 Google LLC
731
- *
732
- * Licensed under the Apache License, Version 2.0 (the "License");
733
- * you may not use this file except in compliance with the License.
734
- * You may obtain a copy of the License at
735
- *
736
- * http://www.apache.org/licenses/LICENSE-2.0
737
- *
738
- * Unless required by applicable law or agreed to in writing, software
739
- * distributed under the License is distributed on an "AS IS" BASIS,
740
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
741
- * See the License for the specific language governing permissions and
742
- * limitations under the License.
743
- */function Uf(e,t=[]){let n;switch(e){case"Browser":n=ou(Qt());break;case"Worker":n=`${ou(Qt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${oo}/${r}`}/**
744
- * @license
745
- * Copyright 2022 Google LLC
746
- *
747
- * Licensed under the Apache License, Version 2.0 (the "License");
748
- * you may not use this file except in compliance with the License.
749
- * You may obtain a copy of the License at
750
- *
751
- * http://www.apache.org/licenses/LICENSE-2.0
752
- *
753
- * Unless required by applicable law or agreed to in writing, software
754
- * distributed under the License is distributed on an "AS IS" BASIS,
755
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
756
- * See the License for the specific language governing permissions and
757
- * limitations under the License.
758
- */class ZS{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})}}}/**
759
- * @license
760
- * Copyright 2023 Google LLC
761
- *
762
- * Licensed under the Apache License, Version 2.0 (the "License");
763
- * you may not use this file except in compliance with the License.
764
- * You may obtain a copy of the License at
765
- *
766
- * http://www.apache.org/licenses/LICENSE-2.0
767
- *
768
- * Unless required by applicable law or agreed to in writing, software
769
- * distributed under the License is distributed on an "AS IS" BASIS,
770
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
771
- * See the License for the specific language governing permissions and
772
- * limitations under the License.
773
- */async function eI(e,t={}){return vs(e,"GET","/v2/passwordPolicy",ul(e,t))}/**
774
- * @license
775
- * Copyright 2023 Google LLC
776
- *
777
- * Licensed under the Apache License, Version 2.0 (the "License");
778
- * you may not use this file except in compliance with the License.
779
- * You may obtain a copy of the License at
780
- *
781
- * http://www.apache.org/licenses/LICENSE-2.0
782
- *
783
- * Unless required by applicable law or agreed to in writing, software
784
- * distributed under the License is distributed on an "AS IS" BASIS,
785
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
786
- * See the License for the specific language governing permissions and
787
- * limitations under the License.
788
- */const tI=6;class nI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??tI,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))}}/**
789
- * @license
790
- * Copyright 2020 Google LLC
791
- *
792
- * Licensed under the Apache License, Version 2.0 (the "License");
793
- * you may not use this file except in compliance with the License.
794
- * You may obtain a copy of the License at
795
- *
796
- * http://www.apache.org/licenses/LICENSE-2.0
797
- *
798
- * Unless required by applicable law or agreed to in writing, software
799
- * distributed under the License is distributed on an "AS IS" BASIS,
800
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
801
- * See the License for the specific language governing permissions and
802
- * limitations under the License.
803
- */class rI{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 iu(this),this.idTokenSubscription=new iu(this),this.beforeStateQueue=new ZS(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=If,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 as.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 Bo(this,{idToken:t}),r=await vn._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(On(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 Ve(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 Fo(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=LS()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(On(this.app))return Promise.reject(Vr(this));const n=t?gs(t):null;return n&&Ve(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&&Ve(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 On(this.app)?Promise.reject(Vr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return On(this.app)?Promise.reject(Vr(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 eI(this),n=new nI(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 ro("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 YS(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;Ve(n,this,"argument-error"),this.redirectPersistenceManager=await as.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(Ve(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 Ve(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Uf(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(On(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&&OS(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ci(e){return gs(e)}class iu{constructor(t){this.auth=t,this.observer=null,this.addObserver=vT(n=>this.observer=n)}get next(){return Ve(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
804
- * @license
805
- * Copyright 2020 Google LLC
806
- *
807
- * Licensed under the Apache License, Version 2.0 (the "License");
808
- * you may not use this file except in compliance with the License.
809
- * You may obtain a copy of the License at
810
- *
811
- * http://www.apache.org/licenses/LICENSE-2.0
812
- *
813
- * Unless required by applicable law or agreed to in writing, software
814
- * distributed under the License is distributed on an "AS IS" BASIS,
815
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
816
- * See the License for the specific language governing permissions and
817
- * limitations under the License.
818
- */let hl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function sI(e){hl=e}function oI(e){return hl.loadJS(e)}function iI(){return hl.gapiScript}function aI(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
819
- * @license
820
- * Copyright 2020 Google LLC
821
- *
822
- * Licensed under the Apache License, Version 2.0 (the "License");
823
- * you may not use this file except in compliance with the License.
824
- * You may obtain a copy of the License at
825
- *
826
- * http://www.apache.org/licenses/LICENSE-2.0
827
- *
828
- * Unless required by applicable law or agreed to in writing, software
829
- * distributed under the License is distributed on an "AS IS" BASIS,
830
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
831
- * See the License for the specific language governing permissions and
832
- * limitations under the License.
833
- */function lI(e,t){const n=wf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(fs(o,t??{}))return s;jn(s,"already-initialized")}return n.initialize({options:t})}function cI(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 uI(e,t,n){const r=ci(e);Ve(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Bf(t),{host:i,port:a}=dI(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){Ve(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Ve(fs(u,r.config.emulator)&&fs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,ol(i)?bT(`${o}//${i}${l}`):fI()}function Bf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function dI(e){const t=Bf(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:au(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:au(i)}}}function au(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function fI(){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())}/**
834
- * @license
835
- * Copyright 2020 Google LLC
836
- *
837
- * Licensed under the Apache License, Version 2.0 (the "License");
838
- * you may not use this file except in compliance with the License.
839
- * You may obtain a copy of the License at
840
- *
841
- * http://www.apache.org/licenses/LICENSE-2.0
842
- *
843
- * Unless required by applicable law or agreed to in writing, software
844
- * distributed under the License is distributed on an "AS IS" BASIS,
845
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
846
- * See the License for the specific language governing permissions and
847
- * limitations under the License.
848
- */class Ff{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")}}/**
849
- * @license
850
- * Copyright 2020 Google LLC
851
- *
852
- * Licensed under the Apache License, Version 2.0 (the "License");
853
- * you may not use this file except in compliance with the License.
854
- * You may obtain a copy of the License at
855
- *
856
- * http://www.apache.org/licenses/LICENSE-2.0
857
- *
858
- * Unless required by applicable law or agreed to in writing, software
859
- * distributed under the License is distributed on an "AS IS" BASIS,
860
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
861
- * See the License for the specific language governing permissions and
862
- * limitations under the License.
863
- */async function ls(e,t){return FS(e,"POST","/v1/accounts:signInWithIdp",ul(e,t))}/**
864
- * @license
865
- * Copyright 2020 Google LLC
866
- *
867
- * Licensed under the Apache License, Version 2.0 (the "License");
868
- * you may not use this file except in compliance with the License.
869
- * You may obtain a copy of the License at
870
- *
871
- * http://www.apache.org/licenses/LICENSE-2.0
872
- *
873
- * Unless required by applicable law or agreed to in writing, software
874
- * distributed under the License is distributed on an "AS IS" BASIS,
875
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
876
- * See the License for the specific language governing permissions and
877
- * limitations under the License.
878
- */const hI="http://localhost";class zr extends Ff{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new zr(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):jn("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 zr(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 ls(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,ls(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,ls(t,n)}buildRequest(){const t={requestUri:hI,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=so(n)}return t}}/**
879
- * @license
880
- * Copyright 2020 Google LLC
881
- *
882
- * Licensed under the Apache License, Version 2.0 (the "License");
883
- * you may not use this file except in compliance with the License.
884
- * You may obtain a copy of the License at
885
- *
886
- * http://www.apache.org/licenses/LICENSE-2.0
887
- *
888
- * Unless required by applicable law or agreed to in writing, software
889
- * distributed under the License is distributed on an "AS IS" BASIS,
890
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
891
- * See the License for the specific language governing permissions and
892
- * limitations under the License.
893
- */class pl{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}}/**
894
- * @license
895
- * Copyright 2019 Google LLC
896
- *
897
- * Licensed under the Apache License, Version 2.0 (the "License");
898
- * you may not use this file except in compliance with the License.
899
- * You may obtain a copy of the License at
900
- *
901
- * http://www.apache.org/licenses/LICENSE-2.0
902
- *
903
- * Unless required by applicable law or agreed to in writing, software
904
- * distributed under the License is distributed on an "AS IS" BASIS,
905
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
906
- * See the License for the specific language governing permissions and
907
- * limitations under the License.
908
- */class ao extends pl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
909
- * @license
910
- * Copyright 2020 Google LLC
911
- *
912
- * Licensed under the Apache License, Version 2.0 (the "License");
913
- * you may not use this file except in compliance with the License.
914
- * You may obtain a copy of the License at
915
- *
916
- * http://www.apache.org/licenses/LICENSE-2.0
917
- *
918
- * Unless required by applicable law or agreed to in writing, software
919
- * distributed under the License is distributed on an "AS IS" BASIS,
920
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
921
- * See the License for the specific language governing permissions and
922
- * limitations under the License.
923
- */class wr extends ao{constructor(){super("facebook.com")}static credential(t){return zr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return wr.credential(t.oauthAccessToken)}catch{return null}}}wr.FACEBOOK_SIGN_IN_METHOD="facebook.com";wr.PROVIDER_ID="facebook.com";/**
924
- * @license
925
- * Copyright 2020 Google LLC
926
- *
927
- * Licensed under the Apache License, Version 2.0 (the "License");
928
- * you may not use this file except in compliance with the License.
929
- * You may obtain a copy of the License at
930
- *
931
- * http://www.apache.org/licenses/LICENSE-2.0
932
- *
933
- * Unless required by applicable law or agreed to in writing, software
934
- * distributed under the License is distributed on an "AS IS" BASIS,
935
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
936
- * See the License for the specific language governing permissions and
937
- * limitations under the License.
938
- */class br extends ao{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return zr._fromParams({providerId:br.PROVIDER_ID,signInMethod:br.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return br.credentialFromTaggedObject(t)}static credentialFromError(t){return br.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return br.credential(n,r)}catch{return null}}}br.GOOGLE_SIGN_IN_METHOD="google.com";br.PROVIDER_ID="google.com";/**
939
- * @license
940
- * Copyright 2020 Google LLC
941
- *
942
- * Licensed under the Apache License, Version 2.0 (the "License");
943
- * you may not use this file except in compliance with the License.
944
- * You may obtain a copy of the License at
945
- *
946
- * http://www.apache.org/licenses/LICENSE-2.0
947
- *
948
- * Unless required by applicable law or agreed to in writing, software
949
- * distributed under the License is distributed on an "AS IS" BASIS,
950
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
951
- * See the License for the specific language governing permissions and
952
- * limitations under the License.
953
- */class Nn extends ao{constructor(){super("github.com")}static credential(t){return zr._fromParams({providerId:Nn.PROVIDER_ID,signInMethod:Nn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Nn.credentialFromTaggedObject(t)}static credentialFromError(t){return Nn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Nn.credential(t.oauthAccessToken)}catch{return null}}}Nn.GITHUB_SIGN_IN_METHOD="github.com";Nn.PROVIDER_ID="github.com";/**
954
- * @license
955
- * Copyright 2020 Google LLC
956
- *
957
- * Licensed under the Apache License, Version 2.0 (the "License");
958
- * you may not use this file except in compliance with the License.
959
- * You may obtain a copy of the License at
960
- *
961
- * http://www.apache.org/licenses/LICENSE-2.0
962
- *
963
- * Unless required by applicable law or agreed to in writing, software
964
- * distributed under the License is distributed on an "AS IS" BASIS,
965
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
966
- * See the License for the specific language governing permissions and
967
- * limitations under the License.
968
- */class _r extends ao{constructor(){super("twitter.com")}static credential(t,n){return zr._fromParams({providerId:_r.PROVIDER_ID,signInMethod:_r.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return _r.credentialFromTaggedObject(t)}static credentialFromError(t){return _r.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return _r.credential(n,r)}catch{return null}}}_r.TWITTER_SIGN_IN_METHOD="twitter.com";_r.PROVIDER_ID="twitter.com";/**
969
- * @license
970
- * Copyright 2020 Google LLC
971
- *
972
- * Licensed under the Apache License, Version 2.0 (the "License");
973
- * you may not use this file except in compliance with the License.
974
- * You may obtain a copy of the License at
975
- *
976
- * http://www.apache.org/licenses/LICENSE-2.0
977
- *
978
- * Unless required by applicable law or agreed to in writing, software
979
- * distributed under the License is distributed on an "AS IS" BASIS,
980
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
981
- * See the License for the specific language governing permissions and
982
- * limitations under the License.
983
- */class ps{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 vn._fromIdTokenResponse(t,r,s),i=lu(r);return new ps({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=lu(r);return new ps({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function lu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
984
- * @license
985
- * Copyright 2020 Google LLC
986
- *
987
- * Licensed under the Apache License, Version 2.0 (the "License");
988
- * you may not use this file except in compliance with the License.
989
- * You may obtain a copy of the License at
990
- *
991
- * http://www.apache.org/licenses/LICENSE-2.0
992
- *
993
- * Unless required by applicable law or agreed to in writing, software
994
- * distributed under the License is distributed on an "AS IS" BASIS,
995
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
996
- * See the License for the specific language governing permissions and
997
- * limitations under the License.
998
- */class Ho extends Er{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Ho.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 Ho(t,n,r,s)}}function Hf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Ho._fromErrorAndOperation(e,o,t,r):o})}async function pI(e,t,n=!1){const r=await Zs(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ps._forOperation(e,"link",r)}/**
999
- * @license
1000
- * Copyright 2019 Google LLC
1001
- *
1002
- * Licensed under the Apache License, Version 2.0 (the "License");
1003
- * you may not use this file except in compliance with the License.
1004
- * You may obtain a copy of the License at
1005
- *
1006
- * http://www.apache.org/licenses/LICENSE-2.0
1007
- *
1008
- * Unless required by applicable law or agreed to in writing, software
1009
- * distributed under the License is distributed on an "AS IS" BASIS,
1010
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1011
- * See the License for the specific language governing permissions and
1012
- * limitations under the License.
1013
- */async function mI(e,t,n=!1){const{auth:r}=e;if(On(r.app))return Promise.reject(Vr(r));const s="reauthenticate";try{const o=await Zs(e,Hf(r,s,t,e),n);Ve(o.idToken,r,"internal-error");const i=dl(o.idToken);Ve(i,r,"internal-error");const{sub:a}=i;return Ve(e.uid===a,r,"user-mismatch"),ps._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&jn(r,"user-mismatch"),o}}/**
1014
- * @license
1015
- * Copyright 2020 Google LLC
1016
- *
1017
- * Licensed under the Apache License, Version 2.0 (the "License");
1018
- * you may not use this file except in compliance with the License.
1019
- * You may obtain a copy of the License at
1020
- *
1021
- * http://www.apache.org/licenses/LICENSE-2.0
1022
- *
1023
- * Unless required by applicable law or agreed to in writing, software
1024
- * distributed under the License is distributed on an "AS IS" BASIS,
1025
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1026
- * See the License for the specific language governing permissions and
1027
- * limitations under the License.
1028
- */async function gI(e,t,n=!1){if(On(e.app))return Promise.reject(Vr(e));const r="signIn",s=await Hf(e,r,t),o=await ps._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function vI(e,t,n,r){return gs(e).onIdTokenChanged(t,n,r)}function yI(e,t,n){return gs(e).beforeAuthStateChanged(t,n)}const Vo="__sak";/**
1029
- * @license
1030
- * Copyright 2019 Google LLC
1031
- *
1032
- * Licensed under the Apache License, Version 2.0 (the "License");
1033
- * you may not use this file except in compliance with the License.
1034
- * You may obtain a copy of the License at
1035
- *
1036
- * http://www.apache.org/licenses/LICENSE-2.0
1037
- *
1038
- * Unless required by applicable law or agreed to in writing, software
1039
- * distributed under the License is distributed on an "AS IS" BASIS,
1040
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1041
- * See the License for the specific language governing permissions and
1042
- * limitations under the License.
1043
- */class Vf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Vo,"1"),this.storage.removeItem(Vo),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()}}/**
1044
- * @license
1045
- * Copyright 2020 Google LLC
1046
- *
1047
- * Licensed under the Apache License, Version 2.0 (the "License");
1048
- * you may not use this file except in compliance with the License.
1049
- * You may obtain a copy of the License at
1050
- *
1051
- * http://www.apache.org/licenses/LICENSE-2.0
1052
- *
1053
- * Unless required by applicable law or agreed to in writing, software
1054
- * distributed under the License is distributed on an "AS IS" BASIS,
1055
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1056
- * See the License for the specific language governing permissions and
1057
- * limitations under the License.
1058
- */const wI=1e3,bI=10;class Wf extends Vf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=jf(),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);QS()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,bI):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)})},wI)}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]}}Wf.type="LOCAL";const _I=Wf;/**
1059
- * @license
1060
- * Copyright 2020 Google LLC
1061
- *
1062
- * Licensed under the Apache License, Version 2.0 (the "License");
1063
- * you may not use this file except in compliance with the License.
1064
- * You may obtain a copy of the License at
1065
- *
1066
- * http://www.apache.org/licenses/LICENSE-2.0
1067
- *
1068
- * Unless required by applicable law or agreed to in writing, software
1069
- * distributed under the License is distributed on an "AS IS" BASIS,
1070
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1071
- * See the License for the specific language governing permissions and
1072
- * limitations under the License.
1073
- */class zf extends Vf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}zf.type="SESSION";const qf=zf;/**
1074
- * @license
1075
- * Copyright 2019 Google LLC
1076
- *
1077
- * Licensed under the Apache License, Version 2.0 (the "License");
1078
- * you may not use this file except in compliance with the License.
1079
- * You may obtain a copy of the License at
1080
- *
1081
- * http://www.apache.org/licenses/LICENSE-2.0
1082
- *
1083
- * Unless required by applicable law or agreed to in writing, software
1084
- * distributed under the License is distributed on an "AS IS" BASIS,
1085
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1086
- * See the License for the specific language governing permissions and
1087
- * limitations under the License.
1088
- */function kI(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1089
- * @license
1090
- * Copyright 2019 Google LLC
1091
- *
1092
- * Licensed under the Apache License, Version 2.0 (the "License");
1093
- * you may not use this file except in compliance with the License.
1094
- * You may obtain a copy of the License at
1095
- *
1096
- * http://www.apache.org/licenses/LICENSE-2.0
1097
- *
1098
- * Unless required by applicable law or agreed to in writing, software
1099
- * distributed under the License is distributed on an "AS IS" BASIS,
1100
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1101
- * See the License for the specific language governing permissions and
1102
- * limitations under the License.
1103
- */class ui{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 ui(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 kI(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)}}ui.receivers=[];/**
1104
- * @license
1105
- * Copyright 2020 Google LLC
1106
- *
1107
- * Licensed under the Apache License, Version 2.0 (the "License");
1108
- * you may not use this file except in compliance with the License.
1109
- * You may obtain a copy of the License at
1110
- *
1111
- * http://www.apache.org/licenses/LICENSE-2.0
1112
- *
1113
- * Unless required by applicable law or agreed to in writing, software
1114
- * distributed under the License is distributed on an "AS IS" BASIS,
1115
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1116
- * See the License for the specific language governing permissions and
1117
- * limitations under the License.
1118
- */function ml(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1119
- * @license
1120
- * Copyright 2019 Google LLC
1121
- *
1122
- * Licensed under the Apache License, Version 2.0 (the "License");
1123
- * you may not use this file except in compliance with the License.
1124
- * You may obtain a copy of the License at
1125
- *
1126
- * http://www.apache.org/licenses/LICENSE-2.0
1127
- *
1128
- * Unless required by applicable law or agreed to in writing, software
1129
- * distributed under the License is distributed on an "AS IS" BASIS,
1130
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1131
- * See the License for the specific language governing permissions and
1132
- * limitations under the License.
1133
- */class TI{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=ml("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(h){const y=h;if(y.data.eventId===u)switch(y.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(y.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)})}}/**
1134
- * @license
1135
- * Copyright 2020 Google LLC
1136
- *
1137
- * Licensed under the Apache License, Version 2.0 (the "License");
1138
- * you may not use this file except in compliance with the License.
1139
- * You may obtain a copy of the License at
1140
- *
1141
- * http://www.apache.org/licenses/LICENSE-2.0
1142
- *
1143
- * Unless required by applicable law or agreed to in writing, software
1144
- * distributed under the License is distributed on an "AS IS" BASIS,
1145
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1146
- * See the License for the specific language governing permissions and
1147
- * limitations under the License.
1148
- */function Ln(){return window}function SI(e){Ln().location.href=e}/**
1149
- * @license
1150
- * Copyright 2020 Google LLC.
1151
- *
1152
- * Licensed under the Apache License, Version 2.0 (the "License");
1153
- * you may not use this file except in compliance with the License.
1154
- * You may obtain a copy of the License at
1155
- *
1156
- * http://www.apache.org/licenses/LICENSE-2.0
1157
- *
1158
- * Unless required by applicable law or agreed to in writing, software
1159
- * distributed under the License is distributed on an "AS IS" BASIS,
1160
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1161
- * See the License for the specific language governing permissions and
1162
- * limitations under the License.
1163
- */function Gf(){return typeof Ln().WorkerGlobalScope<"u"&&typeof Ln().importScripts=="function"}async function II(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function EI(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function CI(){return Gf()?self:null}/**
1164
- * @license
1165
- * Copyright 2019 Google LLC
1166
- *
1167
- * Licensed under the Apache License, Version 2.0 (the "License");
1168
- * you may not use this file except in compliance with the License.
1169
- * You may obtain a copy of the License at
1170
- *
1171
- * http://www.apache.org/licenses/LICENSE-2.0
1172
- *
1173
- * Unless required by applicable law or agreed to in writing, software
1174
- * distributed under the License is distributed on an "AS IS" BASIS,
1175
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1176
- * See the License for the specific language governing permissions and
1177
- * limitations under the License.
1178
- */const Kf="firebaseLocalStorageDb",AI=1,Wo="firebaseLocalStorage",Jf="fbase_key";class lo{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 di(e,t){return e.transaction([Wo],t?"readwrite":"readonly").objectStore(Wo)}function RI(){const e=indexedDB.deleteDatabase(Kf);return new lo(e).toPromise()}function Ra(){const e=indexedDB.open(Kf,AI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Wo,{keyPath:Jf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Wo)?t(r):(r.close(),await RI(),t(await Ra()))})})}async function cu(e,t,n){const r=di(e,!0).put({[Jf]:t,value:n});return new lo(r).toPromise()}async function PI(e,t){const n=di(e,!1).get(t),r=await new lo(n).toPromise();return r===void 0?null:r.value}function uu(e,t){const n=di(e,!0).delete(t);return new lo(n).toPromise()}const xI=800,MI=3;class Yf{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 Ra(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>MI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Gf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ui._getInstance(CI()),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 II(),!this.activeServiceWorker)return;this.sender=new TI(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||EI()!==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 Ra();return await cu(t,Vo,"1"),await uu(t,Vo),!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=>cu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>PI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>uu(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=di(s,!1).getAll();return new lo(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(),xI)}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()}}Yf.type="LOCAL";const OI=Yf;new io(3e4,6e4);/**
1179
- * @license
1180
- * Copyright 2021 Google LLC
1181
- *
1182
- * Licensed under the Apache License, Version 2.0 (the "License");
1183
- * you may not use this file except in compliance with the License.
1184
- * You may obtain a copy of the License at
1185
- *
1186
- * http://www.apache.org/licenses/LICENSE-2.0
1187
- *
1188
- * Unless required by applicable law or agreed to in writing, software
1189
- * distributed under the License is distributed on an "AS IS" BASIS,
1190
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1191
- * See the License for the specific language governing permissions and
1192
- * limitations under the License.
1193
- */function Xf(e,t){return t?Yn(t):(Ve(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1194
- * @license
1195
- * Copyright 2019 Google LLC
1196
- *
1197
- * Licensed under the Apache License, Version 2.0 (the "License");
1198
- * you may not use this file except in compliance with the License.
1199
- * You may obtain a copy of the License at
1200
- *
1201
- * http://www.apache.org/licenses/LICENSE-2.0
1202
- *
1203
- * Unless required by applicable law or agreed to in writing, software
1204
- * distributed under the License is distributed on an "AS IS" BASIS,
1205
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206
- * See the License for the specific language governing permissions and
1207
- * limitations under the License.
1208
- */class gl extends Ff{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return ls(t,this._buildIdpRequest())}_linkToIdToken(t,n){return ls(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return ls(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 NI(e){return gI(e.auth,new gl(e),e.bypassAuthState)}function $I(e){const{auth:t,user:n}=e;return Ve(n,t,"internal-error"),mI(n,new gl(e),e.bypassAuthState)}async function DI(e){const{auth:t,user:n}=e;return Ve(n,t,"internal-error"),pI(n,new gl(e),e.bypassAuthState)}/**
1209
- * @license
1210
- * Copyright 2020 Google LLC
1211
- *
1212
- * Licensed under the Apache License, Version 2.0 (the "License");
1213
- * you may not use this file except in compliance with the License.
1214
- * You may obtain a copy of the License at
1215
- *
1216
- * http://www.apache.org/licenses/LICENSE-2.0
1217
- *
1218
- * Unless required by applicable law or agreed to in writing, software
1219
- * distributed under the License is distributed on an "AS IS" BASIS,
1220
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1221
- * See the License for the specific language governing permissions and
1222
- * limitations under the License.
1223
- */class Qf{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 NI;case"linkViaPopup":case"linkViaRedirect":return DI;case"reauthViaPopup":case"reauthViaRedirect":return $I;default:jn(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()}}/**
1224
- * @license
1225
- * Copyright 2020 Google LLC
1226
- *
1227
- * Licensed under the Apache License, Version 2.0 (the "License");
1228
- * you may not use this file except in compliance with the License.
1229
- * You may obtain a copy of the License at
1230
- *
1231
- * http://www.apache.org/licenses/LICENSE-2.0
1232
- *
1233
- * Unless required by applicable law or agreed to in writing, software
1234
- * distributed under the License is distributed on an "AS IS" BASIS,
1235
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1236
- * See the License for the specific language governing permissions and
1237
- * limitations under the License.
1238
- */const LI=new io(2e3,1e4);async function jI(e,t,n){if(On(e.app))return Promise.reject(bn(e,"operation-not-supported-in-this-environment"));const r=ci(e);NS(e,t,pl);const s=Xf(r,n);return new Br(r,"signInViaPopup",t,s).executeNotNull()}class Br extends Qf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Br.currentPopupAction&&Br.currentPopupAction.cancel(),Br.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ve(t,this.auth,"internal-error"),t}async onExecution(){sr(this.filter.length===1,"Popup operations only handle one event");const t=ml();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(bn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(bn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Br.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(bn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,LI.get())};t()}}Br.currentPopupAction=null;/**
1239
- * @license
1240
- * Copyright 2020 Google LLC
1241
- *
1242
- * Licensed under the Apache License, Version 2.0 (the "License");
1243
- * you may not use this file except in compliance with the License.
1244
- * You may obtain a copy of the License at
1245
- *
1246
- * http://www.apache.org/licenses/LICENSE-2.0
1247
- *
1248
- * Unless required by applicable law or agreed to in writing, software
1249
- * distributed under the License is distributed on an "AS IS" BASIS,
1250
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1251
- * See the License for the specific language governing permissions and
1252
- * limitations under the License.
1253
- */const UI="pendingRedirect",Co=new Map;class BI extends Qf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Co.get(this.auth._key());if(!t){try{const r=await FI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Co.set(this.auth._key(),t)}return this.bypassAuthState||Co.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 FI(e,t){const n=WI(t),r=VI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function HI(e,t){Co.set(e._key(),t)}function VI(e){return Yn(e._redirectPersistence)}function WI(e){return Eo(UI,e.config.apiKey,e.name)}async function zI(e,t,n=!1){if(On(e.app))return Promise.reject(Vr(e));const r=ci(e),s=Xf(r,t),i=await new BI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1254
- * @license
1255
- * Copyright 2020 Google LLC
1256
- *
1257
- * Licensed under the Apache License, Version 2.0 (the "License");
1258
- * you may not use this file except in compliance with the License.
1259
- * You may obtain a copy of the License at
1260
- *
1261
- * http://www.apache.org/licenses/LICENSE-2.0
1262
- *
1263
- * Unless required by applicable law or agreed to in writing, software
1264
- * distributed under the License is distributed on an "AS IS" BASIS,
1265
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1266
- * See the License for the specific language governing permissions and
1267
- * limitations under the License.
1268
- */const qI=600*1e3;class GI{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||!KI(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(bn(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>=qI&&this.cachedEventUids.clear(),this.cachedEventUids.has(du(t))}saveEventToCache(t){this.cachedEventUids.add(du(t)),this.lastProcessedEventTime=Date.now()}}function du(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 KI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Zf(e);default:return!1}}/**
1269
- * @license
1270
- * Copyright 2020 Google LLC
1271
- *
1272
- * Licensed under the Apache License, Version 2.0 (the "License");
1273
- * you may not use this file except in compliance with the License.
1274
- * You may obtain a copy of the License at
1275
- *
1276
- * http://www.apache.org/licenses/LICENSE-2.0
1277
- *
1278
- * Unless required by applicable law or agreed to in writing, software
1279
- * distributed under the License is distributed on an "AS IS" BASIS,
1280
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1281
- * See the License for the specific language governing permissions and
1282
- * limitations under the License.
1283
- */async function JI(e,t={}){return vs(e,"GET","/v1/projects",t)}/**
1284
- * @license
1285
- * Copyright 2020 Google LLC
1286
- *
1287
- * Licensed under the Apache License, Version 2.0 (the "License");
1288
- * you may not use this file except in compliance with the License.
1289
- * You may obtain a copy of the License at
1290
- *
1291
- * http://www.apache.org/licenses/LICENSE-2.0
1292
- *
1293
- * Unless required by applicable law or agreed to in writing, software
1294
- * distributed under the License is distributed on an "AS IS" BASIS,
1295
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296
- * See the License for the specific language governing permissions and
1297
- * limitations under the License.
1298
- */const YI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,XI=/^https?/;async function QI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await JI(e);for(const n of t)try{if(ZI(n))return}catch{}jn(e,"unauthorized-domain")}function ZI(e){const t=Ca(),{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(!XI.test(n))return!1;if(YI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1299
- * @license
1300
- * Copyright 2020 Google LLC.
1301
- *
1302
- * Licensed under the Apache License, Version 2.0 (the "License");
1303
- * you may not use this file except in compliance with the License.
1304
- * You may obtain a copy of the License at
1305
- *
1306
- * http://www.apache.org/licenses/LICENSE-2.0
1307
- *
1308
- * Unless required by applicable law or agreed to in writing, software
1309
- * distributed under the License is distributed on an "AS IS" BASIS,
1310
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
- * See the License for the specific language governing permissions and
1312
- * limitations under the License.
1313
- */const eE=new io(3e4,6e4);function fu(){const e=Ln().___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 tE(e){return new Promise((t,n)=>{var s,o,i;function r(){fu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{fu(),n(bn(e,"network-request-failed"))},timeout:eE.get()})}if((o=(s=Ln().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Ln().gapi)!=null&&i.load)r();else{const a=aI("iframefcb");return Ln()[a]=()=>{gapi.load?r():n(bn(e,"network-request-failed"))},oI(`${iI()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Ao=null,t})}let Ao=null;function nE(e){return Ao=Ao||tE(e),Ao}/**
1314
- * @license
1315
- * Copyright 2020 Google LLC.
1316
- *
1317
- * Licensed under the Apache License, Version 2.0 (the "License");
1318
- * you may not use this file except in compliance with the License.
1319
- * You may obtain a copy of the License at
1320
- *
1321
- * http://www.apache.org/licenses/LICENSE-2.0
1322
- *
1323
- * Unless required by applicable law or agreed to in writing, software
1324
- * distributed under the License is distributed on an "AS IS" BASIS,
1325
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1326
- * See the License for the specific language governing permissions and
1327
- * limitations under the License.
1328
- */const rE=new io(5e3,15e3),sE="__/auth/iframe",oE="emulator/auth/iframe",iE={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},aE=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function lE(e){const t=e.config;Ve(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?cl(t,oE):`https://${e.config.authDomain}/${sE}`,r={apiKey:t.apiKey,appName:e.name,v:oo},s=aE.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${so(r).slice(1)}`}async function cE(e){const t=await nE(e),n=Ln().gapi;return Ve(n,e,"internal-error"),t.open({where:document.body,url:lE(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:iE,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=bn(e,"network-request-failed"),a=Ln().setTimeout(()=>{o(i)},rE.get());function l(){Ln().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1329
- * @license
1330
- * Copyright 2020 Google LLC.
1331
- *
1332
- * Licensed under the Apache License, Version 2.0 (the "License");
1333
- * you may not use this file except in compliance with the License.
1334
- * You may obtain a copy of the License at
1335
- *
1336
- * http://www.apache.org/licenses/LICENSE-2.0
1337
- *
1338
- * Unless required by applicable law or agreed to in writing, software
1339
- * distributed under the License is distributed on an "AS IS" BASIS,
1340
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1341
- * See the License for the specific language governing permissions and
1342
- * limitations under the License.
1343
- */const uE={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},dE=500,fE=600,hE="_blank",pE="http://localhost";class hu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function mE(e,t,n,r=dE,s=fE){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={...uE,width:r.toString(),height:s.toString(),top:o,left:i},u=Qt().toLowerCase();n&&(a=Of(u)?hE:n),xf(u)&&(t=t||pE,l.scrollbars="yes");const c=Object.entries(l).reduce((y,[S,L])=>`${y}${S}=${L},`,"");if(XS(u)&&a!=="_self")return gE(t||"",a),new hu(null);const h=window.open(t||"",a,c);Ve(h,e,"popup-blocked");try{h.focus()}catch{}return new hu(h)}function gE(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)}/**
1344
- * @license
1345
- * Copyright 2021 Google LLC
1346
- *
1347
- * Licensed under the Apache License, Version 2.0 (the "License");
1348
- * you may not use this file except in compliance with the License.
1349
- * You may obtain a copy of the License at
1350
- *
1351
- * http://www.apache.org/licenses/LICENSE-2.0
1352
- *
1353
- * Unless required by applicable law or agreed to in writing, software
1354
- * distributed under the License is distributed on an "AS IS" BASIS,
1355
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1356
- * See the License for the specific language governing permissions and
1357
- * limitations under the License.
1358
- */const vE="__/auth/handler",yE="emulator/auth/handler",wE=encodeURIComponent("fac");async function pu(e,t,n,r,s,o){Ve(e.config.authDomain,e,"auth-domain-config-required"),Ve(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:oo,eventId:s};if(t instanceof pl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",gT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,h]of Object.entries({}))i[c]=h}if(t instanceof ao){const c=t.getScopes().filter(h=>h!=="");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?`#${wE}=${encodeURIComponent(l)}`:"";return`${bE(e)}?${so(a).slice(1)}${u}`}function bE({config:e}){return e.emulator?cl(e,yE):`https://${e.authDomain}/${vE}`}/**
1359
- * @license
1360
- * Copyright 2020 Google LLC
1361
- *
1362
- * Licensed under the Apache License, Version 2.0 (the "License");
1363
- * you may not use this file except in compliance with the License.
1364
- * You may obtain a copy of the License at
1365
- *
1366
- * http://www.apache.org/licenses/LICENSE-2.0
1367
- *
1368
- * Unless required by applicable law or agreed to in writing, software
1369
- * distributed under the License is distributed on an "AS IS" BASIS,
1370
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1371
- * See the License for the specific language governing permissions and
1372
- * limitations under the License.
1373
- */const Ji="webStorageSupport";class _E{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=qf,this._completeRedirectFn=zI,this._overrideRedirectResult=HI}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 pu(t,n,r,Ca(),s);return mE(t,o,ml())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await pu(t,n,r,Ca(),s);return SI(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 cE(t),r=new GI(t);return n.register("authEvent",s=>(Ve(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(Ji,{type:Ji},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Ji];o!==void 0&&n(!!o),jn(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=QI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return jf()||Mf()||fl()}}const kE=_E;var mu="@firebase/auth",gu="1.12.2";/**
1374
- * @license
1375
- * Copyright 2020 Google LLC
1376
- *
1377
- * Licensed under the Apache License, Version 2.0 (the "License");
1378
- * you may not use this file except in compliance with the License.
1379
- * You may obtain a copy of the License at
1380
- *
1381
- * http://www.apache.org/licenses/LICENSE-2.0
1382
- *
1383
- * Unless required by applicable law or agreed to in writing, software
1384
- * distributed under the License is distributed on an "AS IS" BASIS,
1385
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1386
- * See the License for the specific language governing permissions and
1387
- * limitations under the License.
1388
- */class TE{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(){Ve(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1389
- * @license
1390
- * Copyright 2020 Google LLC
1391
- *
1392
- * Licensed under the Apache License, Version 2.0 (the "License");
1393
- * you may not use this file except in compliance with the License.
1394
- * You may obtain a copy of the License at
1395
- *
1396
- * http://www.apache.org/licenses/LICENSE-2.0
1397
- *
1398
- * Unless required by applicable law or agreed to in writing, software
1399
- * distributed under the License is distributed on an "AS IS" BASIS,
1400
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1401
- * See the License for the specific language governing permissions and
1402
- * limitations under the License.
1403
- */function SE(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){Xs(new hs("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;Ve(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:Uf(e)},u=new rI(r,s,o,l);return cI(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),Xs(new hs("auth-internal",t=>{const n=ci(t.getProvider("auth").getImmediate());return(r=>new TE(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),os(mu,gu,SE(e)),os(mu,gu,"esm2020")}/**
1404
- * @license
1405
- * Copyright 2021 Google LLC
1406
- *
1407
- * Licensed under the Apache License, Version 2.0 (the "License");
1408
- * you may not use this file except in compliance with the License.
1409
- * You may obtain a copy of the License at
1410
- *
1411
- * http://www.apache.org/licenses/LICENSE-2.0
1412
- *
1413
- * Unless required by applicable law or agreed to in writing, software
1414
- * distributed under the License is distributed on an "AS IS" BASIS,
1415
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1416
- * See the License for the specific language governing permissions and
1417
- * limitations under the License.
1418
- */const EE=300,CE=mf("authIdTokenMaxAge")||EE;let vu=null;const AE=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>CE)return;const s=n==null?void 0:n.token;vu!==s&&(vu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function RE(e=_f()){const t=wf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=lI(e,{popupRedirectResolver:kE,persistence:[OI,_I,qf]}),r=mf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=AE(o.toString());yI(n,i,()=>i(n.currentUser)),vI(n,a=>i(a))}}const s=sT("auth");return s&&uI(n,`http://${s}`),n}function PE(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}sI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=bn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",PE().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 xE={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 ME(e){const t=N(null),n=N(""),r=N(""),s=N(""),o=N({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=ae(()=>s.value==="pull"),a=ae(()=>s.value==="push"),l=ae(()=>s.value!=="");async function u(){try{const R=await fetch("/codex-api/skills-sync/status");if(!R.ok)return;const q=await R.json();q.data&&(o.value=q.data)}catch{}}async function c(){try{const R=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),q=await R.json();if(!R.ok||!q.data)throw new Error("Failed to start GitHub login");t.value=q.data;const Y=30,F=Math.max((q.data.interval??5)*1e3,3e3);let J=!1;for(let G=0;G<Y;G++){await new Promise(me=>setTimeout(me,F));const ce=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:q.data.device_code})}),ue=await ce.json();if(!ce.ok)throw new Error(ue.error||"Failed to complete GitHub login");if(ue.ok){J=!0;break}if(!ue.pending)throw new Error(ue.error||"Failed to complete GitHub login")}if(!J)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(R){e.showToast(R instanceof Error?R.message:"Failed GitHub login","error")}}async function h(){try{const R=wS().length>0?_f():bf(xE),q=RE(R),Y=new Nn;Y.addScope("repo");const F=await jI(q,Y),J=Nn.credentialFromResult(F),G=(J==null?void 0:J.accessToken)??"";if(!G)throw new Error("GitHub access token missing from Firebase login");const ce=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:G})}),ue=await ce.json();if(!ce.ok||!ue.ok)throw new Error(ue.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(R){const q=R instanceof Error?R.message:"Failed Firebase GitHub login";e.showToast(q,"error")}}async function y(){r.value="",n.value="pull-started",s.value="pull";try{const R=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),q=await R.json();if(!R.ok||!q.ok)throw new Error(q.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(R){const q=R instanceof Error?R.message:"Failed to pull sync";r.value=q,n.value="pull-failed",e.showToast(q,"error")}finally{s.value=""}}async function S(){r.value="",n.value="push-started",s.value="push";try{const R=await fetch("/codex-api/skills-sync/push",{method:"POST"}),q=await R.json();if(!R.ok||!q.ok)throw new Error(q.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(R){const q=R instanceof Error?R.message:"Failed to push sync";r.value=q,n.value="push-failed",e.showToast(q,"error")}finally{s.value=""}}async function L(){try{const R=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),q=await R.json();if(!R.ok||!q.ok)throw new Error(q.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(R){e.showToast(R instanceof Error?R.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:L,pullSkillsSync:y,pushSkillsSync:S,startGithubFirebaseLogin:h,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const OE={class:"skills-hub"},NE={class:"skills-sync-panel"},$E={class:"skills-sync-header"},DE={key:0,class:"skills-sync-badge"},LE={key:1,class:"skills-sync-badge"},jE={key:2,class:"skills-sync-badge"},UE={class:"skills-sync-meta"},BE={key:0,class:"skills-sync-error"},FE={key:1,class:"skills-sync-meta"},HE={key:2,class:"skills-sync-error"},VE={key:3,class:"skills-sync-device"},WE=["href"],zE={class:"skills-sync-actions"},qE=["disabled"],GE=["disabled"],KE=["disabled"],JE={key:1,class:"skills-hub-section"},YE={class:"skills-hub-section-title"},XE={key:0,class:"skills-hub-grid"},QE={class:"skills-hub-toolbar"},ZE={class:"skills-hub-search-wrap"},eC={key:0,class:"skills-hub-count"},tC={class:"skills-hub-section"},nC={key:0,class:"skills-hub-loading"},rC={key:1,class:"skills-hub-error"},sC={key:0,class:"skills-hub-grid"},oC={key:1,class:"skills-hub-empty"},mo="codex-web-local.skills-hub.cache.v1",iC=xt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=N(null),s=N(""),o=N("date"),i=N([]),a=N([]),l=N(0),u=N(!1),c=N(""),h=N(!0),y=N(!1),S=N(n),L=N(null),R=N(""),q=N(!1),Y=N(!1);let F=null,J=null;const G=t,ce=ae(()=>o.value==="date"?"Newest":"A-Z"),ue=ae(()=>{var x;return((x=L.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),me=ae(()=>`${S.value.owner}/${S.value.name}`),Se=ae(()=>q.value&&R.value===me.value),le=ae(()=>Y.value&&R.value===me.value),ee=ae(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter($=>$.name.toLowerCase().includes(x)||$.owner.toLowerCase().includes(x)||($.displayName??"").toLowerCase().includes(x)):a.value});function ne(x,$="success"){L.value={text:x,type:$},J&&clearTimeout(J),J=setTimeout(()=>{L.value=null},3e3)}function X(){o.value=o.value==="date"?"name":"date",Me(s.value)}function Ee(x){return`${o.value}::${x.trim().toLowerCase()}`}function we(x){var $;if(typeof window>"u")return null;try{const W=window.localStorage.getItem(mo);return W?(($=JSON.parse(W).byKey)==null?void 0:$[x])??null:null}catch{return null}}function $e(x,$){if(!(typeof window>"u"))try{const W=window.localStorage.getItem(mo),V=(W?JSON.parse(W):{}).byKey??{};V[x]=$,window.localStorage.setItem(mo,JSON.stringify({byKey:V}))}catch{}}function Pe(){if(!(typeof window>"u"))try{window.localStorage.removeItem(mo)}catch{}}function ve(x){const $=x.installed??[];a.value=$;const W=new Set($.map(K=>K.name));i.value=x.data.map(K=>{if(K.installed||W.has(K.name)){const V=$.find(ke=>ke.name===K.name);return{...K,installed:!0,path:(V==null?void 0:V.path)??K.path,enabled:(V==null?void 0:V.enabled)??K.enabled}}return K}).filter(K=>!K.installed),l.value=x.total}async function Me(x){const $=Ee(x),W=we($);W&&ve(W),u.value=!W,c.value="";try{const K=new URLSearchParams;x.trim()&&K.set("q",x.trim()),K.set("limit","100"),K.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${K}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const ke=await V.json();ve(ke),$e($,ke)}catch(K){c.value=K instanceof Error?K.message:"Failed to load skills"}finally{u.value=!1}}function at(){F&&clearTimeout(F),F=setTimeout(()=>Me(s.value),300)}function Qe(x){S.value=x,y.value=!0}async function Je(x){R.value=`${x.owner}/${x.name}`,q.value=!0;try{const W=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(!W.ok)throw new Error(W.error||"Install failed");const K={...x,installed:!0,path:W.path,enabled:!0};a.value=[...a.value,K],i.value=i.value.filter(V=>V.name!==x.name),S.value=K,ne(`${x.displayName||x.name} skill installed`),y.value=!1,Pe(),G("skills-changed")}catch($){ne($ instanceof Error?$.message:"Failed to install skill","error")}finally{q.value=!1}}async function Ze(x){R.value=`${x.owner}/${x.name}`,Y.value=!0;try{const W=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(!W.ok)throw new Error(W.error||"Uninstall failed");a.value=a.value.filter(K=>K.name!==x.name),x.owner!=="local"&&(i.value=[...i.value,{...x,installed:!1,path:void 0,enabled:void 0}]),ne(`${x.displayName||x.name} skill uninstalled`),y.value=!1,Pe(),G("skills-changed")}catch($){ne($ instanceof Error?$.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function Ye(x,$){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:$}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ne(`${x.displayName||x.name} skill ${$?"enabled":"disabled"}`),await Me(s.value)}catch(W){ne(W instanceof Error?W.message:"Failed to update skill","error")}}const{deviceLogin:pt,isPullInFlight:Ne,isPushInFlight:De,isSyncActionInFlight:H,loadSyncStatus:he,logoutGithub:de,pullSkillsSync:_e,pushSkillsSync:Ce,startGithubFirebaseLogin:w,startGithubLogin:k,syncActionError:P,syncActionStatus:j,syncStatus:U}=ME({showToast:ne,onPulled:async()=>{await Me(s.value),G("skills-changed")}});return ir(()=>{Me(""),he()}),(x,$)=>(_(),I("div",OE,[$[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",NE,[m("div",$E,[$[8]||($[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ge(U).configured?(_(),I("span",DE,"Connected: "+se(ge(U).repoOwner)+"/"+se(ge(U).repoName),1)):ge(U).loggedIn?(_(),I("span",LE,"Logged in as "+se(ge(U).githubUsername),1)):(_(),I("span",jE,"Not connected"))]),m("div",UE,[m("span",null,"Startup: "+se(ge(U).startup.mode),1),m("span",null,"Branch: "+se(ge(U).startup.branch),1),m("span",null,"Action: "+se(ge(U).startup.lastAction),1)]),ge(U).startup.lastError?(_(),I("div",BE,se(ge(U).startup.lastError),1)):oe("",!0),ge(j)?(_(),I("div",FE,[m("span",null,"Manual sync: "+se(ge(j)),1)])):oe("",!0),ge(P)?(_(),I("div",HE,se(ge(P)),1)):oe("",!0),ge(pt)?(_(),I("div",VE,[m("span",null,[$[9]||($[9]=qs("Open ",-1)),m("a",{href:ge(pt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,WE),$[10]||($[10]=qs(" and enter code:",-1))]),m("code",null,se(ge(pt).user_code),1)])):oe("",!0),m("div",zE,[ge(U).loggedIn?oe("",!0):(_(),I("button",{key:0,class:"skills-hub-sort",type:"button",onClick:$[0]||($[0]=(...W)=>ge(w)&&ge(w)(...W))},"Login with GitHub")),ge(U).loggedIn?oe("",!0):(_(),I("button",{key:1,class:"skills-hub-sort",type:"button",onClick:$[1]||($[1]=(...W)=>ge(k)&&ge(k)(...W))},"Device Login")),ge(U).loggedIn?(_(),I("button",{key:2,class:"skills-hub-sort",type:"button",onClick:$[2]||($[2]=(...W)=>ge(de)&&ge(de)(...W)),disabled:ge(H)},"Logout GitHub",8,qE)):oe("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:$[3]||($[3]=(...W)=>ge(_e)&&ge(_e)(...W)),disabled:ge(H)},se(ge(Ne)?"Pulling...":"Pull"),9,GE),ge(U).loggedIn?(_(),I("button",{key:3,class:"skills-hub-sort",type:"button",onClick:$[4]||($[4]=(...W)=>ge(Ce)&&ge(Ce)(...W)),disabled:!ge(U).configured||ge(H)},se(ge(De)?"Pushing...":"Push"),9,KE)):oe("",!0)])]),L.value?(_(),I("div",{key:0,class:it(["skills-hub-toast",ue.value])},se(L.value.text),3)):oe("",!0),ee.value.length>0?(_(),I("div",JE,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:$[5]||($[5]=W=>h.value=!h.value)},[m("span",YE,"Installed ("+se(ee.value.length)+")",1),Re(of,{class:it(["skills-hub-section-chevron",{"is-open":h.value}])},null,8,["class"])]),h.value?(_(),I("div",XE,[(_(!0),I(je,null,bt(ee.value,W=>(_(),dt(Wc,{key:W.name,skill:W,onSelect:K=>Qe(K)},null,8,["skill","onSelect"]))),128))])):oe("",!0)])):oe("",!0),m("div",QE,[m("div",ZE,[Re(_a,{class:"skills-hub-search-icon"}),tr(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":$[6]||($[6]=W=>s.value=W),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:at},null,544),[[nr,s.value]]),l.value>0?(_(),I("span",eC,se(l.value)+" skills",1)):oe("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:X},se(ce.value),1)]),m("div",tC,[u.value?(_(),I("div",nC,"Loading skills...")):c.value?(_(),I("div",rC,se(c.value),1)):(_(),I(je,{key:2},[i.value.length>0?(_(),I("div",sC,[(_(!0),I(je,null,bt(i.value,W=>(_(),dt(Wc,{key:W.url,skill:W,onSelect:K=>Qe(K)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(_(),I("div",oC,'No skills found for "'+se(s.value)+'"',1)):oe("",!0)],64))]),Re(J0,{skill:S.value,visible:y.value,"is-installing":Se.value,"is-uninstalling":le.value,onClose:$[7]||($[7]=W=>y.value=!1),onInstall:Je,onUninstall:Ze,onToggleEnabled:Ye},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),aC=rt(iC,[["__scopeId","data-v-2f6920be"]]),lC={},cC={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 uC(e,t){return _(),I("svg",cC,[...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 dC=rt(lC,[["render",uC]]),fC={},hC={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function pC(e,t){return _(),I("svg",hC,[...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 mC=rt(fC,[["render",pC]]),gC={class:"sidebar-thread-controls"},vC=["aria-label","title"],yC=xt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(_(),I("div",gC,[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?(_(),dt(mC,{key:0,class:"sidebar-thread-controls-icon"})):(_(),dt(dC,{key:1,class:"sidebar-thread-controls-icon"}))],8,vC),$n(t.$slots,"default",{},void 0),e.showNewThreadButton?(_(),I("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"))},[Re(Lo,{class:"sidebar-thread-controls-icon"})])):oe("",!0)]))}}),yu=rt(yC,[["__scopeId","data-v-46a10052"]]),wC={},bC={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function _C(e,t){return _(),I("svg",bC,[...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 kC=rt(wC,[["render",_C]]);function yr(e){return e.flatMap(t=>t.threads)}const eh="codex-web-local.thread-read-state.v1",th="codex-web-local.thread-scroll-state.v1",Pa="codex-web-local.selected-thread-id.v1",nh="codex-web-local.project-order.v1",rh="codex-web-local.project-display-name.v1",Yi=220,wu=["none","minimal","low","medium","high","xhigh"],Rs="__global__",hn="gpt-5.2-codex";function TC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(eh);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function bu(e){typeof window>"u"||window.localStorage.setItem(eh,JSON.stringify(e))}function sh(e,t,n){return Math.min(Math.max(e,t),n)}function SC(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=sh(t.scrollRatio,0,1)),n}function IC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(th);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=SC(s);o&&(n[r]=o)}return n}catch{return{}}}function _u(e){typeof window>"u"||window.localStorage.setItem(th,JSON.stringify(e))}function EC(){return typeof window>"u"?"":window.localStorage.getItem(Pa)??""}function CC(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Pa);return}window.localStorage.setItem(Pa,e)}}function AC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(nh);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 Yr(e){typeof window>"u"||window.localStorage.setItem(nh,JSON.stringify(e))}function RC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(rh);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 Xi(e){typeof window>"u"||window.localStorage.setItem(rh,JSON.stringify(e))}function go(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 jr(e,n)?e:n}function Qi(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 jr(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 PC(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 xC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function vo(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 xa(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&jr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&xC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function zo(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 MC(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 h=r.get(c.id);return h&&xa(h,c)?h:c});if(n.preserveMissing!==!0)return zo(e,o)?e:o;const i=e.map(c=>{const h=s.get(c.id);return!h||xa(c,h)?c:h}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return zo(e,u)?e:u}function Ma(e){return e.replace(/\s+/gu," ").trim()}function OC(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ma(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=Ma(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function ku(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(xa(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const oh="worked";function mr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function NC(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 $C(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function DC(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 LC(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${NC(e.durationMs)}`,messageType:oh}}function jC(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function UC(e,t){const n=LC(t),r=e.filter(i=>i.messageType!==oh),s=jC(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Nt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function BC(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 FC(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){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 yo(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&&BC(u,l)?u:l});return o&&o.projectName===s.projectName&&FC(o.threads,a)?o:{projectName:s.projectName,threads:a}});return HC(e,r)?e:r}function VC(e,t,n){const r=new Set(yr(t).map(a=>a.id)),s=yr(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 WC(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Zi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function zC(e){const t=e.split(`
1419
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function qC(){const e=N([]),t=N([]),n=N(EC()),r=N({}),s=N({}),o=N({}),i=N({}),a=N({}),l=N({}),u=N({}),c=N([]),h=N(""),y=N("medium"),S=N(TC()),L=N(IC()),R=N(AC()),q=N(RC()),Y=N({}),F=N({}),J=N({}),G=N({}),ce=N({}),ue=N({}),me=N({}),Se=N({}),le=N({}),ee=N({}),ne=N([]),X=N(!1),Ee=N(!1),we=N(!1),$e=N(!1),Pe=N(!1),ve=N(""),Me=N(!1),at=N(!1);let Qe=null,Je=null,Ze=!1;const Ye=new Set;let pt=!1,Ne=!1;const De=new Map,H=new Set,he=ae(()=>yr(e.value)),de=ae(()=>he.value.find(d=>d.id===n.value)??null),_e=ae(()=>L.value[n.value]??null),Ce=ae(()=>{const d=[],v=n.value;return v&&Array.isArray(Se.value[v])&&d.push(...Se.value[v]),Array.isArray(Se.value[Rs])&&d.push(...Se.value[Rs]),d.sort((b,A)=>b.receivedAtIso.localeCompare(A.receivedAtIso))}),w=ae(()=>{var Z;const d=n.value;if(!d)return null;const v=ce.value[d],b=(o.value[d]??"").trim(),A=(((Z=ue.value[d])==null?void 0:Z.message)??"").trim();return!v&&!b&&!A?null:{activityLabel:(v==null?void 0:v.label)||"Thinking",activityDetails:(v==null?void 0:v.details)??[],reasoningText:b,errorText:A}}),k=ae(()=>{const d=n.value;if(!d)return[];const v=r.value[d]??[],b=s.value[d]??[],A=i.value[d]??[],Z=[...v,...A,...b],p=G.value[d];return p?UC(Z,p):Z});function P(d){n.value!==d&&(n.value=d,CC(d),Ne=!1)}function j(d){h.value=d.trim()}async function U(){h.value=hn,c.value.includes(hn)||(c.value=[...c.value,hn]);try{await p_(hn)}catch{}}function x(d,v){le.value={...le.value,[d]:v}}function $(d){le.value[d]&&(le.value=Nt(le.value,d))}async function W(d){if(H.has(d))return;const v=le.value[d];if(!(!v||v.fallbackRetried)){H.add(d),x(d,{...v,fallbackRetried:!0});try{await U();try{const b=await Lc(d,1);nt(d,b),gt(d,[]),Ut(d),i.value[d]&&(i.value=Nt(i.value,d))}catch{}et(d,null),ve.value="",We(d,null),ze(d,{label:"Thinking",details:V(hn,v.effort)}),He(d,!0),J.value[d]!==!0&&await Bi(d),await Fi(d,v.text,v.imageUrls,hn,v.effort||void 0,v.skills.length>0?v.skills:void 0,v.fileAttachments),J.value={...J.value,[d]:!0},Ye.add(d),Ze=!0,await Fn()}catch(b){const A=b instanceof Error?b.message:"Unknown application error";et(d,A),ve.value=A,He(d,!1),ze(d,null)}finally{H.delete(d)}}}function K(d){d&&!wu.includes(d)||(y.value=d)}function V(d,v){const b=d.trim()||"default",A=v||"default";return[`Model: ${b}`,`Thinking: ${A}`]}async function ke(){try{const[d,v]=await Promise.all([m_(),g_()]);c.value=d,h.value.length>0&&d.includes(h.value)||(v.model&&d.includes(v.model)?h.value=v.model:d.length>0?h.value=d[0]:h.value=""),v.reasoningEffort&&wu.includes(v.reasoningEffort)&&(y.value=v.reasoningEffort)}catch{}}function pe(d){const v=ee.value;return Object.keys(v).length===0?d:d.map(b=>({projectName:b.projectName,threads:b.threads.map(A=>{const Z=v[A.id];return Z?{...A,title:Z}:A})}))}function fe(){const v=pe(t.value).map(b=>({projectName:b.projectName,threads:b.threads.map(A=>{const Z=a.value[A.id]===!0,p=n.value===A.id,C=S.value[A.id],z=u.value[A.id]===!0,te=!p&&!Z&&(z||C!==A.updatedAtIso);return{...A,inProgress:Z,unread:te}})}));e.value=yo(e.value,v)}function Ae(d,v,b){const A=new Date().toISOString(),Z=v.trim(),p=WC(Z),C={id:d,title:zC(b),projectName:p,cwd:Z,hasWorktree:Z.includes("/.codex/worktrees/")||Z.includes("/.git/worktrees/"),createdAtIso:A,updatedAtIso:A,preview:b,unread:!1,inProgress:!1},z=t.value.findIndex(be=>be.projectName===p);if(z>=0){const ye=t.value[z].threads.filter(dn=>dn.id!==d),_t={projectName:p,threads:[C,...ye]},un=[...t.value];un.splice(z,1,_t),t.value=un}else t.value=[{projectName:p,threads:[C]},...t.value];const te=go(R.value,t.value);jr(R.value,te)||(R.value=te,Yr(R.value)),fe()}function Le(d){const v=new Set(d.map(p=>p.id)),b=Ft(S.value,v);b!==S.value&&(S.value=b,bu(b));const A=Ft(L.value,v);A!==L.value&&(L.value=A,_u(A)),F.value=Ft(F.value,v),Y.value=Ft(Y.value,v),J.value=Ft(J.value,v),r.value=Ft(r.value,v),s.value=Ft(s.value,v),o.value=Ft(o.value,v),i.value=Ft(i.value,v),G.value=Ft(G.value,v),ce.value=Ft(ce.value,v),ue.value=Ft(ue.value,v),me.value=Ft(me.value,v),u.value=Ft(u.value,v),a.value=Ft(a.value,v);const Z={};for(const[p,C]of Object.entries(Se.value))(p===Rs||v.has(p))&&(Z[p]=C);Se.value=Z}function qe(d){const v=yr(t.value).find(b=>b.id===d);v&&(S.value={...S.value,[d]:v.updatedAtIso},bu(S.value),u.value[d]&&(u.value=Nt(u.value,d)),fe())}function We(d,v){if(!d)return;const b=G.value[d];if(v){if($C(b,v))return;G.value={...G.value,[d]:v}}else b&&(G.value=Nt(G.value,d))}function He(d,v){!d||a.value[d]===!0===v||(v?a.value={...a.value,[d]:!0}:a.value=Nt(a.value,d),fe())}function tt(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},fe())}function ze(d,v){if(!d)return;const b=ce.value[d];if(!v){b&&(ce.value=Nt(ce.value,d));return}const A=rn(v.label)||"Thinking",Z=v.details.map(z=>rn(z)).filter(z=>z.length>0&&z!==A),p=Array.from(new Set([...(b==null?void 0:b.details)??[],...Z])).slice(-3),C={label:A,details:p};DC(b,C)||(ce.value={...ce.value,[d]:C})}function et(d,v){if(!d)return;const b=ue.value[d],A=v?Ma(v):"";if(!A){b&&(ue.value=Nt(ue.value,d));return}(b==null?void 0:b.message)!==A&&(ue.value={...ue.value,[d]:{message:A}})}function It(d){const v=yr(t.value).find(b=>b.id===d);return(v==null?void 0:v.updatedAtIso)??""}function Zt(d,v){if(!d)return;const b={scrollTop:Math.max(0,v.scrollTop),isAtBottom:v.isAtBottom===!0};typeof v.scrollRatio=="number"&&Number.isFinite(v.scrollRatio)&&(b.scrollRatio=sh(v.scrollRatio,0,1));const A=L.value[d];A&&A.scrollTop===b.scrollTop&&A.isAtBottom===b.isAtBottom&&A.scrollRatio===b.scrollRatio||(L.value={...L.value,[d]:b},_u(L.value))}function nt(d,v){const b=r.value[d]??[];zo(b,v)||(r.value={...r.value,[d]:v})}function gt(d,v){const b=s.value[d]??[];zo(b,v)||(s.value={...s.value,[d]:v})}function Lt(d,v){const b=s.value[d]??[],A=ku(b,v);gt(d,A)}function jt(d,v){if(!d)return;const b=v.trim(),A=o.value[d]??"";if(b.length===0){if(!A)return;o.value=Nt(o.value,d);return}A!==b&&(o.value={...o.value,[d]:b})}function Mt(d,v){if(!d)return;const b=o.value[d]??"";jt(d,`${b}${v}`)}function Ut(d){d&&d in o.value&&(o.value=Nt(o.value,d))}function Oe(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function xe(d){return typeof d=="string"?d:""}function Bt(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function Tt(d){const v=Oe(d.params);if(!v)return"";const b=xe(v.threadId);if(b)return b;const A=xe(v.thread_id);if(A)return A;const Z=xe(v.conversationId);if(Z)return Z;const p=xe(v.conversation_id);if(p)return p;const C=Oe(v.thread),z=xe(C==null?void 0:C.id);if(z)return z;const te=Oe(v.turn),be=xe(te==null?void 0:te.threadId);if(be)return be;const ye=xe(te==null?void 0:te.thread_id);return ye||""}function Ot(d){if(d.method!=="turn/completed")return"";const v=Oe(d.params),b=Oe(v==null?void 0:v.turn);if(!b||b.status!=="failed")return"";const A=Oe(b.error);return xe(A==null?void 0:A.message)}function an(d){var b;if(d.method!=="error")return"";const v=Oe(d.params);return xe(v==null?void 0:v.message)||xe((b=Oe(v==null?void 0:v.error))==null?void 0:b.message)}function ln(d){const v=Oe(d);if(!v)return null;const b=v.id,A=xe(v.method),Z=v.params;if(typeof b!="number"||!Number.isInteger(b)||!A)return null;const p=Oe(Z),C=xe(p==null?void 0:p.threadId)||Rs,z=xe(p==null?void 0:p.turnId),te=xe(p==null?void 0:p.itemId),be=xe(v.receivedAtIso)||new Date().toISOString();return{id:b,method:A,threadId:C,turnId:z,itemId:te,receivedAtIso:be,params:Z??null}}function cn(d){const v=d.threadId||Rs,b=Se.value[v]??[],A=b.findIndex(p=>p.id===d.id),Z=[...b];A>=0?Z.splice(A,1,d):Z.push(d),Se.value={...Se.value,[v]:Z.sort((p,C)=>p.receivedAtIso.localeCompare(C.receivedAtIso))}}function mn(d){const v={};for(const[b,A]of Object.entries(Se.value)){const Z=A.filter(p=>p.id!==d);Z.length>0&&(v[b]=Z)}Se.value=v}function In(d){if(d.method==="server/request"){const v=ln(d.params);return v&&cn(v),!0}if(d.method==="server/request/resolved"){const v=Oe(d.params),b=v==null?void 0:v.id;return typeof b=="number"&&Number.isInteger(b)&&mn(b),!0}return!1}function rn(d){return d.replace(/\s+/gu," ").trim()}function D(d){const v=Tt(d);if(!v)return null;if(d.method==="turn/started")return{threadId:v,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const b=Oe(d.params),A=Oe(b==null?void 0:b.item),Z=xe(A==null?void 0:A.type).toLowerCase();if(Z==="reasoning")return{threadId:v,activity:{label:"Thinking",details:[]}};if(Z==="agentmessage")return{threadId:v,activity:{label:"Writing response",details:[]}};if(Z==="commandexecution"){const p=xe(A==null?void 0:A.command);return{threadId:v,activity:{label:"Running command",details:p?[p]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:v,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:v,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:v,activity:{label:"Writing response",details:[]}}:null}function f(d){if(d.method!=="turn/started")return null;const v=Oe(d.params);if(!v)return null;const b=Tt(d);if(!b)return null;const A=Oe(v.turn),Z=xe(A==null?void 0:A.id)||xe(v.turnId)||`${b}:unknown`;if(!Z)return null;const p=mr(xe(A==null?void 0:A.startedAt))??mr(xe(v.startedAt))??mr(d.atIso)??Date.now();return{threadId:b,turnId:Z,startedAtMs:p}}function g(d){if(d.method!=="turn/completed")return null;const v=Oe(d.params);if(!v)return null;const b=Tt(d);if(!b)return null;const A=Oe(v.turn),Z=xe(A==null?void 0:A.id)||xe(v.turnId)||`${b}:unknown`;if(!Z)return null;const p=mr(xe(A==null?void 0:A.completedAt))??mr(xe(v.completedAt))??mr(d.atIso)??Date.now(),C=mr(xe(A==null?void 0:A.startedAt))??mr(xe(v.startedAt))??void 0;return{threadId:b,turnId:Z,completedAtMs:p,startedAtMs:C}}function T(d){return`${d}:live-reasoning`}function B(d){const v=Oe(d.params);if(!v)return"";if(d.method==="item/started"){const b=Oe(v.item);return!b||b.type!=="reasoning"?"":xe(b.id)}return""}function ie(d){const v=Oe(d.params);if(!v)return null;if(d.method==="item/reasoning/summaryTextDelta"){const b=xe(v.itemId),A=xe(v.delta);return!b||!A?null:{messageId:T(b),delta:A}}return null}function re(d){const v=Oe(d.params);if(!v)return"";if(d.method==="item/reasoning/summaryPartAdded"){const b=xe(v.itemId);return b?T(b):""}return""}function Ie(d){const v=Oe(d.params);if(!v)return"";if(d.method==="item/completed"){const b=Oe(v.item);return!b||b.type!=="reasoning"?"":T(xe(b.id))}return""}function Te(d){const v=Oe(d.params);if(!v)return"";if(d.method==="item/started"){const b=Oe(v.item);return!b||b.type!=="agentMessage"?"":xe(b.id)}return""}function Be(d){const v=Oe(d.params);if(!v)return null;if(d.method==="item/agentMessage/delta"){const b=xe(v.itemId),A=xe(v.delta);return!b||!A?null:{messageId:b,delta:A}}return null}function Ke(d){const v=Oe(d.params);if(!v)return null;if(d.method==="item/completed"){const b=Oe(v.item);if(!b||b.type!=="agentMessage")return null;const A=xe(b.id),Z=xe(b.text);return!A||!Z?null:{id:A,role:"assistant",text:Z,messageType:"agentMessage.live"}}return null}function st(d){if(d.method!=="item/started")return null;const v=Oe(d.params),b=Oe(v==null?void 0:v.item);if(!b||b.type!=="commandExecution")return null;const A=xe(b.id),Z=xe(b.command);if(!A)return null;const p=typeof b.cwd=="string"?b.cwd:null;return{id:A,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:p,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Et(d){if(d.method!=="item/commandExecution/outputDelta")return null;const v=Oe(d.params);if(!v)return null;const b=xe(v.itemId),A=xe(v.delta);return!b||!A?null:{itemId:b,delta:A}}function Pt(d){if(d.method!=="item/completed")return null;const v=Oe(d.params),b=Oe(v==null?void 0:v.item);if(!b||b.type!=="commandExecution")return null;const A=xe(b.id),Z=xe(b.command);if(!A)return null;const p=typeof b.cwd=="string"?b.cwd:null,C=xe(b.status),z=C==="failed"?"failed":C==="declined"?"declined":C==="interrupted"?"interrupted":"completed",te=typeof b.aggregatedOutput=="string"?b.aggregatedOutput:"",be=typeof b.exitCode=="number"?b.exitCode:null;return{id:A,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:p,status:z,aggregatedOutput:te,exitCode:be}}}function gn(d,v){const b=i.value[d]??[],A=ku(b,v);A!==b&&(i.value={...i.value,[d]:A})}function qr(d,v){const b=i.value[d];if(!b||b.length===0)return;const A=new Set(v.map(p=>p.id)),Z=b.filter(p=>!A.has(p.id));Z.length!==b.length&&(Z.length===0?i.value=Nt(i.value,d):i.value={...i.value,[d]:Z})}function ys(d){if(d.method==="item/agentMessage/delta")return!0;const v=Oe(d.params);if(!v)return!1;if(d.method==="item/completed"){const b=Oe(v.item);return(b==null?void 0:b.type)==="agentMessage"}return!1}function lr(d){var yl,wl,bl,_l;if(In(d))return;if(d.method==="thread/name/updated"){const Xe=Oe(d.params),En=xe(Xe==null?void 0:Xe.threadId),Rr=xe(Xe==null?void 0:Xe.threadName);En&&Rr&&(ee.value={...ee.value,[En]:Rr},fe(),Hi(En,Rr))}const v=D(d);v&&ze(v.threadId,v.activity);const b=f(d);b&&(De.set(b.turnId,b),me.value={...me.value,[b.threadId]:b.turnId},We(b.threadId,null),et(b.threadId,null),He(b.threadId,!0),u.value[b.threadId]&&(u.value=Nt(u.value,b.threadId)));const A=g(d),Z=Ot(d),C=!!((A==null?void 0:A.threadId)??Tt(d))&&!!Z&&h.value!==hn&&vo(new Error(Z));if(A){const Xe=De.get(A.turnId);Xe&&De.delete(A.turnId);const En=Bt((yl=Oe(d.params))==null?void 0:yl.durationMs)??Bt((bl=Oe((wl=Oe(d.params))==null?void 0:wl.turn))==null?void 0:bl.durationMs)??(typeof A.startedAtMs=="number"?A.completedAtMs-A.startedAtMs:null)??(Xe?A.completedAtMs-Xe.startedAtMs:null),Rr=typeof En=="number"?Math.max(0,En):0;We(A.threadId,{turnId:A.turnId,durationMs:Rr}),me.value[A.threadId]&&(me.value=Nt(me.value,A.threadId)),He(A.threadId,!1),ze(A.threadId,null),tt(A.threadId),C||($(A.threadId),sn(A.threadId))}if(Z){const Xe=(A==null?void 0:A.threadId)||Tt(d);Xe&&et(Xe,Z),ve.value=Z,Xe&&C&&W(Xe)}else A&&et(A.threadId,null);const z=an(d);if(z){const Xe=Tt(d);Xe&&et(Xe,z),ve.value=z,h.value!==hn&&vo(new Error(z))&&(Xe?W(Xe):U())}const te=Tt(d);if(!te||te!==n.value)return;Te(d);const be=Be(d);if(be){const Xe=(s.value[te]??[]).find(Rr=>Rr.id===be.messageId),En=`${(Xe==null?void 0:Xe.text)??""}${be.delta}`;Lt(te,{id:be.messageId,role:"assistant",text:En,messageType:"agentMessage.live"})}const ye=Ke(d);ye&&Lt(te,ye),B(d);const _t=ie(d);if(_t&&Mt(te,_t.delta),re(d)){const Xe=o.value[te]??"";Xe.trim().length>0&&!Xe.endsWith(`
1420
-
1421
- `)&&jt(te,`${Xe}
1422
-
1423
- `)}Ie(d);const dn=st(d);dn&&(gn(te,dn),ze(te,{label:"Running command",details:[((_l=dn.commandExecution)==null?void 0:_l.command)??""]}));const bi=Et(d);if(bi){const Xe=(i.value[te]??[]).find(En=>En.id===bi.itemId);Xe!=null&&Xe.commandExecution&&gn(te,{...Xe,commandExecution:{...Xe.commandExecution,aggregatedOutput:`${Xe.commandExecution.aggregatedOutput}${bi.delta}`}})}const vl=Pt(d);if(vl&&gn(te,vl),ys(d)&&(Ne&&n.value&&Zt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ut(te)),d.method==="turn/completed"){Ne=!1,Ut(te),i.value[te]&&(i.value=Nt(i.value,te));const Xe=Tt(d);Xe&&(He(Xe,!1),ze(Xe,null),tt(Xe),C||($(Xe),sn(Xe)))}}function ws(d){const v=Tt(d);v&&Ye.add(v);const b=d.method;(b.startsWith("thread/")||b.startsWith("turn/")||b.startsWith("item/"))&&(Ze=!0),!(Je!==null||typeof window>"u")&&(Je=window.setTimeout(()=>{Je=null,Fn()},Yi))}async function cr(d){if(!pt){pt=!0;try{const v=await ba(),b=[];for(const A of v.order){const Z=Zi(A);b.includes(Z)||b.push(Z)}if(b.length>0){const A=go(b,d);jr(R.value,A)||(R.value=A,Yr(R.value))}if(Object.keys(v.labels).length>0){const A={...q.value};let Z=!1;for(const[p,C]of Object.entries(v.labels)){const z=Zi(p);A[z]!==C&&(A[z]=C,Z=!0)}Z&&(q.value=A,Xi(A))}}catch{}}}async function Gr(){if(!(Object.keys(ee.value).length>0))try{const d=await T_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Cr(d,v,b){if(ee.value[d])return;const A=v.trim();if(!A)return;const Z=A.length>300?A.slice(0,300):A;try{const p=await S_(Z,b);if(!p||ee.value[d])return;ee.value={...ee.value,[d]:p},fe(),Hi(d,p)}catch{}}async function Un(){var d;at.value||(X.value=!0);try{const[v]=await Promise.all([s_(),Gr()]);await cr(v);const b=go(R.value,v);jr(R.value,b)||(R.value=b,Yr(R.value));const A=Qi(v,R.value),Z=VC(t.value,A,a.value);t.value=yo(t.value,Z),a.value=Ft(a.value,new Set(yr(t.value).map(z=>z.id))),fe(),at.value=!0;const p=yr(e.value);Le(p),p.some(z=>z.id===n.value)||P(((d=p[0])==null?void 0:d.id)??"")}finally{X.value=!1}}async function E(d,v={}){if(!d)return;const b=F.value[d]===!0,A=v.silent!==!0&&!b;A&&(Ee.value=!0);try{J.value[d]!==!0&&(await Bi(d),J.value={...J.value,[d]:!0});const{messages:Z,inProgress:p}=await o_(d),C=r.value[d]??[],z=MC(C,Z,{preserveMissing:v.silent===!0});nt(d,z);const te=s.value[d]??[],be=OC(te,Z);gt(d,be),qr(d,Z),F.value={...F.value,[d]:!0};const ye=It(d);ye&&(Y.value={...Y.value,[d]:ye}),He(d,p),qe(d)}finally{A&&(Ee.value=!1)}}async function M(){try{const d=t.value.flatMap(v=>v.threads.map(b=>b.cwd)).filter(Boolean);ne.value=await I_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function O(){ve.value="";try{await Un(),await Promise.all([ke(),M()]),await E(n.value)}catch(d){ve.value=d instanceof Error?d.message:"Unknown application error"}}async function Q(d){P(d);try{await E(d)}catch(v){ve.value=v instanceof Error?v.message:"Unknown application error"}}async function Fe(d){try{await c_(d),await Un(),n.value===d&&await E(n.value)}catch(v){ve.value=v instanceof Error?v.message:"Unknown application error"}}async function Ct(d,v){const b=v.trim();if(!(!d||!b))try{await u_(d,b),ee.value={...ee.value,[d]:b},fe(),Hi(d,b)}catch(A){ve.value=A instanceof Error?A.message:"Unknown application error"}}async function en(d,v=[],b=[],A="steer",Z=[]){const p=n.value,C=d.trim();if(!p||!C&&v.length===0&&Z.length===0)return;const z=a.value[p]===!0;if(z&&A==="queue"){const te=l.value[p]??[],be=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[p]:[...te,{id:be,text:C,imageUrls:v,skills:b,fileAttachments:Z}]};return}if(z){Ne=!0,Bn(p,C,v,b,Z).catch(te=>{const be=te instanceof Error?te.message:"Unknown application error";et(p,be),ve.value=be});return}ve.value="",Ne=!0,We(p,null),ze(p,{label:"Thinking",details:V(h.value,y.value)}),et(p,null),He(p,!0);try{await Bn(p,C,v,b,Z)}catch(te){Ne=!1,He(p,!1),ze(p,null);const be=te instanceof Error?te.message:"Unknown application error";throw et(p,be),ve.value=be,te}}async function Kr(d,v,b=[],A=[],Z=[]){const p=d.trim(),C=v.trim(),z=h.value.trim();if(!p&&b.length===0&&Z.length===0)return"";we.value=!0,ve.value="";let te="";try{try{te=await jc(C||void 0,z||void 0)}catch(un){if(z&&z!==hn&&vo(un))await U(),te=await jc(C||void 0,hn);else throw un}if(!te)return"";Ae(te,C,p||"[Image]"),J.value={...J.value,[te]:!0},P(te),Ne=!0,We(te,null),ze(te,{label:"Thinking",details:V(h.value,y.value)}),et(te,null),He(te,!0);const be=te,ye=C||null,_t=p;return Bn(te,p,b,A,Z).catch(un=>{Ne=!1,He(te,!1),ze(te,null);const dn=un instanceof Error?un.message:"Unknown application error";et(te,dn),ve.value=dn}).finally(()=>{we.value=!1}),Cr(be,_t,ye),te}catch(be){Ne=!1,te&&(He(te,!1),ze(te,null));const ye=be instanceof Error?be.message:"Unknown application error";throw te&&et(te,ye),ve.value=ye,we.value=!1,be}}async function Bn(d,v,b=[],A=[],Z=[]){const p=h.value.trim(),C=y.value,z=v.trim(),te=A.map(ye=>({name:ye.name,path:ye.path})),be=Z.map(ye=>({...ye}));x(d,{text:z,imageUrls:[...b],skills:te,fileAttachments:be,effort:C,fallbackRetried:!1});try{J.value[d]!==!0&&await Bi(d);try{await Fi(d,v,b,p||void 0,C||void 0,A.length>0?A:void 0,Z)}catch(ye){if(p&&p!==hn&&vo(ye))await U(),x(d,{text:z,imageUrls:[...b],skills:te,fileAttachments:be,effort:C,fallbackRetried:!0}),await Fi(d,v,b,hn,C||void 0,A.length>0?A:void 0,Z);else throw ye}J.value={...J.value,[d]:!0},Ye.add(d),Ze=!0,await Fn()}catch(ye){throw ye}}async function sn(d){const v=l.value[d];if(!v||v.length===0)return;const[b,...A]=v;l.value=A.length>0?{...l.value,[d]:A}:Nt(l.value,d),we.value=!0,ve.value="",Ne=!0,We(d,null),ze(d,{label:"Thinking",details:V(h.value,y.value)}),et(d,null),He(d,!0);try{await Bn(d,b.text,b.imageUrls,b.skills,b.fileAttachments)}catch{He(d,!1),ze(d,null)}finally{we.value=!1}}async function ur(){const d=n.value;if(!d||a.value[d]!==!0)return;const v=me.value[d];$e.value=!0,ve.value="";try{await h_(d,v),He(d,!1),ze(d,null),et(d,null),me.value[d]&&(me.value=Nt(me.value,d)),Ye.add(d),Ze=!0,await Fn()}catch(b){const A=b instanceof Error?b.message:"Failed to interrupt active turn";et(d,A),ve.value=A}finally{$e.value=!1}}async function dr(d){const v=n.value;if(!v||Pe.value)return;const A=(r.value[v]??[]).reduce((p,C)=>typeof C.turnIndex=="number"&&C.turnIndex>p?C.turnIndex:p,-1);if(A<0||d>A)return;const Z=A-d+1;if(!(Z<1)){Pe.value=!0,ve.value="";try{const p=await Lc(v,Z);nt(v,p),gt(v,[]),Ut(v),i.value[v]&&(i.value=Nt(i.value,v)),We(v,null),ze(v,null),et(v,null),Ze=!0,await Fn()}catch(p){ve.value=p instanceof Error?p.message:"Failed to rollback thread"}finally{Pe.value=!1}}}function bs(d,v){d.length===0||(q.value[d]??"")===v||(q.value={...q.value,[d]:v},Xi(q.value))}function fi(d){var Z;if(d.length===0)return;const v=R.value.filter(p=>p!==d);if(jr(R.value,v)||(R.value=v,Yr(R.value)),t.value=t.value.filter(p=>p.projectName!==d),q.value[d]!==void 0){const p={...q.value};delete p[d],q.value=p,Xi(p)}fe();const b=yr(e.value);Le(b),b.some(p=>p.id===n.value)||P(((Z=b[0])==null?void 0:Z.id)??""),_s()}function hi(d,v){if(d.length===0||t.value.length===0)return;const b=t.value.map(te=>te.projectName),A=b.indexOf(d);if(A===-1)return;const Z=Math.max(0,Math.min(v,b.length-1)),p=PC(b,A,Z);if(p===b)return;const C=go(p,t.value);R.value=C,Yr(R.value);const z=Qi(t.value,R.value);t.value=yo(t.value,z),fe(),_s()}function pi(d){const v=d.trim();if(!v)return;const b=[v,...R.value.filter(Z=>Z!==v)];if(jr(R.value,b))return;R.value=b,Yr(R.value);const A=Qi(t.value,R.value);t.value=yo(t.value,A),fe(),_s()}async function _s(){var d,v;try{const b=await ba(),A=new Map;for(const C of b.order){const z=Zi(C);A.has(z)||A.set(z,C)}for(const C of t.value){const z=((v=(d=C.threads[0])==null?void 0:d.cwd)==null?void 0:v.trim())??"";z&&A.set(C.projectName,z)}const Z=[];for(const C of R.value){const z=A.get(C);z&&!Z.includes(z)&&Z.push(z)}for(const C of b.order)Z.includes(C)||Z.push(C);const p=b.active.filter(C=>Z.includes(C));p.length===0&&Z.length>0&&p.push(Z[0]),await w_({order:Z,labels:b.labels,active:p})}catch{}}async function Fn(){if(Me.value){typeof window<"u"&&Je===null&&(Je=window.setTimeout(()=>{Je=null,Fn()},Yi));return}Me.value=!0;const d=Ze,v=new Set(Ye);Ze=!1,Ye.clear();try{d&&await Un();const b=n.value;if(!b)return;const A=v.has(b),Z=a.value[b]===!0,p=It(b),C=Y.value[b]??"",z=p.length>0&&p!==C;(A||Z||z||d)&&await E(b,{silent:!0})}catch{}finally{Me.value=!1,(Ze||Ye.size>0)&&typeof window<"u"&&Je===null&&(Je=window.setTimeout(()=>{Je=null,Fn()},Yi))}}function mi(){typeof window>"u"||Qe||(gi(),Qe=i_(d=>{lr(d),ws(d)}))}async function gi(){try{const d=await l_();for(const v of d){const b=ln(v);b&&cn(b)}}catch{}}async function vi(d){try{await a_(d.id,{result:d.result,error:d.error}),mn(d.id)}catch(v){ve.value=v instanceof Error?v.message:"Failed to reply to server request"}}function yi(){Qe&&(Qe(),Qe=null),Ze=!1,Ye.clear(),De.clear(),Je!==null&&typeof window<"u"&&(window.clearTimeout(Je),Je=null),Ne=!1,r.value={},s.value={},o.value={},i.value={},ce.value={},G.value={},ue.value={},me.value={},l.value={}}const ks=ae(()=>{const d=n.value;return d?l.value[d]??[]:[]});function Ar(d){const v=n.value;if(!v)return;const b=l.value[v];if(!b)return;const A=b.filter(Z=>Z.id!==d);l.value=A.length>0?{...l.value,[v]:A}:Nt(l.value,v)}function wi(d){const v=n.value;if(!v)return;const b=l.value[v];if(!b)return;const A=b.find(Z=>Z.id===d);A&&(Ar(d),en(A.text,A.imageUrls,A.skills,"steer",A.fileAttachments))}return{projectGroups:e,projectDisplayNameById:q,selectedThread:de,selectedThreadScrollState:_e,selectedThreadServerRequests:Ce,selectedLiveOverlay:w,selectedThreadId:n,availableModelIds:c,selectedModelId:h,selectedReasoningEffort:y,installedSkills:ne,messages:k,isLoadingThreads:X,isLoadingMessages:Ee,isSendingMessage:we,isInterruptingTurn:$e,error:ve,refreshAll:O,refreshSkills:M,selectThread:Q,setThreadScrollState:Zt,archiveThreadById:Fe,renameThreadById:Ct,sendMessageToSelectedThread:en,sendMessageToNewThread:Kr,interruptSelectedThreadTurn:ur,rollbackSelectedThread:dr,isRollingBack:Pe,selectedThreadQueuedMessages:ks,removeQueuedMessage:Ar,steerQueuedMessage:wi,setSelectedModelId:j,setSelectedReasoningEffort:K,respondToPendingServerRequest:vi,renameProject:bs,removeProject:fi,reorderProject:hi,pinProjectToTop:pi,startPolling:mi,stopPolling:yi}}const GC={class:"sidebar-root"},KC={class:"sidebar-scrollable"},JC=["aria-pressed"],YC={key:1,class:"sidebar-search-bar"},XC={key:0,class:"sidebar-settings-area"},QC={key:0,class:"sidebar-settings-panel"},ZC={class:"sidebar-settings-value"},eA={class:"sidebar-settings-value"},tA={class:"sidebar-settings-row sidebar-settings-row--select"},nA={class:"content-root"},rA={class:"content-body"},sA={key:1,class:"content-grid"},oA={class:"new-thread-empty"},iA={class:"worktree-init-status-title"},aA={class:"worktree-init-status-message"},lA={key:2,class:"content-grid"},cA={class:"content-thread"},uA={class:"composer-with-queue"},dA={class:"build-badge","aria-label":"Worktree name and version"},Tu="codex-web-local.sidebar-collapsed.v1",Su="codex-web-local.send-with-enter.v1",Iu="codex-web-local.in-progress-send-mode.v1",Eu="codex-web-local.dark-mode.v1",Cu="codex-web-local.dictation-click-to-toggle.v1",Au="codex-web-local.dictation-auto-send.v1",Ru="codex-web-local.dictation-language.v1",fA=xt({__name:"App",setup(e){const t="c599",n="0.1.53",r={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:s,projectDisplayNameById:o,selectedThread:i,selectedThreadScrollState:a,selectedThreadServerRequests:l,selectedLiveOverlay:u,selectedThreadId:c,availableModelIds:h,selectedModelId:y,selectedReasoningEffort:S,installedSkills:L,messages:R,isLoadingThreads:q,isLoadingMessages:Y,isInterruptingTurn:F,refreshAll:J,refreshSkills:G,selectThread:ce,setThreadScrollState:ue,archiveThreadById:me,renameThreadById:Se,sendMessageToSelectedThread:le,sendMessageToNewThread:ee,interruptSelectedThreadTurn:ne,rollbackSelectedThread:X,isRollingBack:Ee,selectedThreadQueuedMessages:we,removeQueuedMessage:$e,steerQueuedMessage:Pe,setSelectedModelId:ve,setSelectedReasoningEffort:Me,respondToPendingServerRequest:at,renameProject:Qe,removeProject:Je,reorderProject:Ze,pinProjectToTop:Ye,startPolling:pt,stopPolling:Ne}=qC(),De=Vg(),H=Hg(),{isMobile:he}=sf(),de=N(!1),_e=N(!1),Ce=N(""),w=N("local"),k=N({order:[],labels:{}}),P=N({phase:"idle",title:"",message:""}),j=N(wi()),U=N(""),x=N(!1),$=N(null),W=N(null);let K=null;const V=N("New Project (1)"),ke=N(""),pe=N(!1),fe=N(dr(Su,!0)),Ae=N(fi()),Le=N(bs()),qe=N(dr(Cu,!1)),We=N(null);let He=0;const tt=N(dr(Au,!0)),ze=N(vi()),et=ae(()=>yi()),It=ae(()=>{const p=De.params.threadId;return typeof p=="string"?p:""}),Zt=ae(()=>{const p=new Set;for(const C of s.value)for(const z of C.threads)p.add(z.id);return p}),nt=ae(()=>De.name==="home"),gt=ae(()=>De.name==="skills"),Lt=ae(()=>{var p;return gt.value?"Skills":nt.value?"New thread":((p=i.value)==null?void 0:p.title)??"Choose a thread"}),jt=ae(()=>R.value.filter(p=>{const C=v(p.messageType,p.role);return C==="worked"?!0:!(C==="turnActivity.live"||C==="turnError.live"||C==="agentReasoning.live")})),Mt=ae(()=>{let p=-1;for(const C of R.value)C.role==="user"&&typeof C.turnIndex=="number"&&C.turnIndex>p&&(p=C.turnIndex);return p}),Ut=ae(()=>u.value),Oe=ae(()=>nt.value?"__new-thread__":c.value),xe=ae(()=>{var p,C;return nt.value?Ce.value.trim():((C=(p=i.value)==null?void 0:p.cwd)==null?void 0:C.trim())??""}),Bt=ae(()=>{var p;return!nt.value&&((p=i.value)==null?void 0:p.inProgress)===!0}),Tt=ae(()=>{var te,be;const p=[],C=new Set;for(const ye of k.value.order){const _t=ye.trim();!_t||C.has(_t)||(C.add(_t),p.push({value:_t,label:k.value.labels[_t]||M(_t)}))}for(const ye of s.value){const _t=((be=(te=ye.threads[0])==null?void 0:te.cwd)==null?void 0:be.trim())??"";!_t||C.has(_t)||(C.add(_t),p.push({value:_t,label:o.value[ye.projectName]??ye.projectName}))}const z=Ce.value.trim();return z&&!C.has(z)&&p.unshift({value:z,label:M(z)}),p}),Ot=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;ir(()=>{window.addEventListener("keydown",st),Ar(),Ot==null||Ot.addEventListener("change",Ar),b(),ys(),Cr(),Un(),cr()}),ni(()=>{window.removeEventListener("keydown",st),Ot==null||Ot.removeEventListener("change",Ar),K&&(clearTimeout(K),K=null),Ne()}),ft(U,p=>{const C=p.trim();if(K&&(clearTimeout(K),K=null),!C){W.value=null;return}K=setTimeout(()=>{k_(C,1e3).then(z=>{U.value.trim()===C&&(W.value=z.threadIds)}).catch(()=>{U.value.trim()===C&&(W.value=null)})},220)});function an(){G()}function ln(){x.value=!x.value,x.value?$t(()=>{var p;return(p=$.value)==null?void 0:p.focus()}):U.value=""}function cn(){var p;U.value="",(p=$.value)==null||p.focus()}function mn(p){p.key==="Escape"&&(x.value=!1,U.value="")}function In(p){p&&(De.name==="thread"&&It.value===p||(H.push({name:"thread",params:{threadId:p}}),he.value&&Ke(!0)))}async function rn(p){p&&(c.value!==p&&(await ce(p),await H.push({name:"thread",params:{threadId:p}})),await $t(),Kr())}function D(p){me(p)}function f(p){var te,be;const C=s.value.find(ye=>ye.projectName===p),z=((be=(te=C==null?void 0:C.threads[0])==null?void 0:te.cwd)==null?void 0:be.trim())??"";z&&(Ce.value=z),he.value&&Ke(!0),!nt.value&&H.push({name:"home"})}function g(p){var te,be;const C=s.value.find(ye=>ye.projectName===p),z=((be=(te=C==null?void 0:C.threads[0])==null?void 0:te.cwd)==null?void 0:be.trim())??"";!z||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(z)}`,"_blank","noopener,noreferrer")}function T(){var C,z;const p=((z=(C=i.value)==null?void 0:C.cwd)==null?void 0:z.trim())??"";p&&(Ce.value=p),he.value&&Ke(!0),!nt.value&&H.push({name:"home"})}function B(p){Qe(p.projectName,p.displayName)}function ie(p){Se(p.threadId,p.title)}function re(p){Je(p)}function Ie(p){Ze(p.projectName,p.toIndex)}function Te(p){ue(p.threadId,p.state)}function Be(p){at(p)}function Ke(p){j.value!==p&&(j.value=p,d(p))}function st(p){p.defaultPrevented||!p.ctrlKey&&!p.metaKey||p.shiftKey||p.altKey||p.key.toLowerCase()==="b"&&(p.preventDefault(),Ke(!j.value))}function Et(p){const C=p.text;if(nt.value){Z(C,p.imageUrls,p.skills,p.fileAttachments);return}if(p.rollbackLatestUserTurn===!0){Pt(p);return}le(C,p.imageUrls,p.skills,p.mode,p.fileAttachments)}async function Pt(p){Bt.value&&await ne();const C=Mt.value;C>=0&&await X(C),await le(p.text,p.imageUrls,p.skills,"steer",p.fileAttachments)}function gn(p){Ce.value=p.trim()}async function qr(p){const C=p.trim();if(!C)return;const z=ws(C),te=await lr(),be=z?C:O(te,C);if(be)try{const ye=await Bc(be,{createIfMissing:!z,label:z?"":C});ye&&(Ce.value=ye,Ye(M(ye)),Un(),cr())}catch{}}async function ys(){var C;if(typeof window>"u")return;const p=((C=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:C.trim())??"";if(p)try{const z=await Bc(p,{createIfMissing:!1,label:""});if(!z)return;Ce.value=z,Ye(M(z)),await H.replace({name:"home"}),await Un();const te=new URL(window.location.href);te.searchParams.delete("openProjectPath"),window.history.replaceState({},"",te.toString())}catch{}}async function lr(){const p=Gr();if(p)return p;try{const C=await Uc();if(C)return ke.value=C,C}catch{}return""}function ws(p){return p?p.startsWith("~/")||p.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(p):!1}async function cr(){const p=Gr();if(!p){V.value="New Project (1)";return}try{const C=await b_(p);V.value=C.name||"New Project (1)"}catch{V.value="New Project (1)"}}function Gr(){var z,te;const p=Ce.value.trim();if(p)return E(p);const C=((te=(z=Tt.value[0])==null?void 0:z.value)==null?void 0:te.trim())??"";return C?E(C):ke.value.trim()}async function Cr(){try{ke.value=await Uc()}catch{ke.value=""}}async function Un(){try{const p=await ba();k.value={order:[...p.order],labels:{...p.labels}}}catch{k.value={order:[],labels:{}}}}function E(p){const C=p.trim().replace(/\/+$/,"");if(!C)return"";const z=C.lastIndexOf("/");return z<=0?"":C.slice(0,z)}function M(p){const C=p.trim().replace(/\/+$/,"");if(!C)return"";const z=C.lastIndexOf("/");return z<0?C:C.slice(z+1)}function O(p,C){const z=p.trim().replace(/\/+$/,""),te=C.trim().replace(/^\/+/,"");return!z||!te?"":`${z}/${te}`}function Q(p){ve(p)}function Fe(p){Me(p)}function Ct(){ne()}function en(p){var z;const C=((z=p.prependText)==null?void 0:z.trim())??"";C.length>0&&(He+=1,We.value={id:He,text:C}),X(p.turnIndex)}function Kr(){if(nt.value||gt.value||typeof document>"u"||!i.value||jt.value.length===0)return;const p=Bn(),C=sn(),z=new Blob([p],{type:"text/markdown;charset=utf-8"}),te=URL.createObjectURL(z),be=document.createElement("a");be.href=te,be.download=C,document.body.appendChild(be),be.click(),document.body.removeChild(be),window.setTimeout(()=>URL.revokeObjectURL(te),0)}function Bn(){var z,te,be;const p=[],C=((te=(z=i.value)==null?void 0:z.title)==null?void 0:te.trim())||"Untitled thread";p.push(`# ${ur(C)}`),p.push(""),p.push(`- Exported: ${new Date().toISOString()}`),p.push(`- Thread ID: ${((be=i.value)==null?void 0:be.id)??""}`),p.push(""),p.push("---"),p.push("");for(const ye of jt.value){const _t=ye.role?ye.role.toUpperCase():"MESSAGE";p.push(`## ${_t}`),p.push("");const un=ye.text.trim();if(un&&(p.push(un),p.push("")),ye.commandExecution&&(p.push("```text"),p.push(`command: ${ye.commandExecution.command}`),p.push(`status: ${ye.commandExecution.status}`),ye.commandExecution.cwd&&p.push(`cwd: ${ye.commandExecution.cwd}`),ye.commandExecution.exitCode!==null&&p.push(`exitCode: ${ye.commandExecution.exitCode}`),p.push(ye.commandExecution.aggregatedOutput||"(no output)"),p.push("```"),p.push("")),ye.fileAttachments&&ye.fileAttachments.length>0){p.push("Attachments:");for(const dn of ye.fileAttachments)p.push(`- ${dn.path}`);p.push("")}if(ye.images&&ye.images.length>0){p.push("Images:");for(const dn of ye.images)p.push(`- ${dn}`);p.push("")}}return`${p.join(`
1424
- `).trimEnd()}
1425
- `}function sn(){var be,ye;const z=(((ye=(be=i.value)==null?void 0:be.title)==null?void 0:ye.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",te=new Date().toISOString().replace(/[:.]/g,"-");return`${z}-${te}.md`}function ur(p){return p.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function dr(p,C){if(typeof window>"u")return C;const z=window.localStorage.getItem(p);return z===null?C:z==="1"}function bs(){if(typeof window>"u")return"system";const p=window.localStorage.getItem(Eu);return p==="light"||p==="dark"?p:"system"}function fi(){return typeof window>"u"?"steer":window.localStorage.getItem(Iu)==="queue"?"queue":"steer"}function hi(){fe.value=!fe.value,window.localStorage.setItem(Su,fe.value?"1":"0")}function pi(){Ae.value=Ae.value==="steer"?"queue":"steer",window.localStorage.setItem(Iu,Ae.value)}function _s(){const p=["system","light","dark"],C=p.indexOf(Le.value);Le.value=p[(C+1)%p.length],window.localStorage.setItem(Eu,Le.value),Ar()}function Fn(){qe.value=!qe.value,window.localStorage.setItem(Cu,qe.value?"1":"0")}function mi(){tt.value=!tt.value,window.localStorage.setItem(Au,tt.value?"1":"0")}function gi(p){const z=ks(p.trim())||"auto";ze.value=z,window.localStorage.setItem(Ru,z)}function vi(){var z;if(typeof window>"u")return"auto";const p=((z=window.localStorage.getItem(Ru))==null?void 0:z.trim())||"auto";return ks(p)||"auto"}function yi(){const p=[{value:"auto",label:"Auto-detect"}],C=new Set(["auto"]);function z(be){const ye=r[be]||be;return`${ye.charAt(0).toUpperCase()+ye.slice(1)} (${be})`}for(const be of typeof navigator<"u"?navigator.languages??[]:[]){const ye=ks(be);!ye||C.has(ye)||(C.add(ye),p.push({value:ye,label:`Preferred: ${z(ye)}`}))}for(const be of Object.keys(r))C.has(be)||(C.add(be),p.push({value:be,label:z(be)}));const te=ze.value.trim();return te&&!C.has(te)&&p.push({value:te,label:z(te)}),p}function ks(p){const C=p.trim().toLowerCase();if(!C||C==="auto")return"";if(C in r)return C;const z=C.split("-")[0]??C;return z in r?z:""}function Ar(){const p=document.documentElement;if(Le.value==="dark")p.classList.add("dark");else if(Le.value==="light")p.classList.remove("dark");else{const C=window.matchMedia("(prefers-color-scheme: dark)").matches;p.classList.toggle("dark",C)}}function wi(){return typeof window>"u"?!1:window.localStorage.getItem(Tu)==="1"}function d(p){typeof window>"u"||window.localStorage.setItem(Tu,p?"1":"0")}function v(p,C){const z=(p??"").trim();return z.length>0?z:C.trim()||"message"}async function b(){await J(),_e.value=!0,await A(),pt()}async function A(){if(!de.value){de.value=!0;try{if(De.name==="home"||De.name==="skills"){c.value!==""&&await ce("");return}if(De.name==="thread"){const p=It.value;if(!p)return;if(!Zt.value.has(p)){await H.replace({name:"home"});return}c.value!==p&&await ce(p);return}}finally{de.value=!1}}}ft(()=>[De.name,It.value,q.value,Zt.value.has(It.value),c.value],async()=>{_e.value&&await A()}),ft(()=>c.value,async p=>{if(_e.value&&!de.value&&!(nt.value||gt.value)){if(!p){De.name!=="home"&&await H.replace({name:"home"});return}De.name==="thread"&&It.value===p||await H.replace({name:"thread",params:{threadId:p}})}}),ft(()=>Tt.value,p=>{if(p.length===0){Ce.value="";return}p.some(z=>z.value===Ce.value)||(Ce.value=p[0].value),cr()},{immediate:!0}),ft(()=>Ce.value,()=>{P.value={phase:"idle",title:"",message:""},cr()}),ft(()=>w.value,p=>{p==="local"&&(P.value={phase:"idle",title:"",message:""})}),ft(()=>De.name,p=>{p!=="home"&&(P.value={phase:"idle",title:"",message:""})}),ft(()=>c.value,()=>{P.value={phase:"idle",title:"",message:""}}),ft(he,p=>{p&&!j.value&&Ke(!0)});async function Z(p,C=[],z=[],te=[]){try{P.value={phase:"idle",title:"",message:""};let be=Ce.value;if(w.value==="worktree"){P.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const _t=await y_(Ce.value);be=_t.cwd,Ce.value=_t.cwd,P.value={phase:"idle",title:"",message:""}}catch{P.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const ye=await ee(p,be,C,z,te);if(!ye)return;await H.replace({name:"thread",params:{threadId:ye}})}catch{}}return(p,C)=>(_(),I(je,null,[Re(Jg,{"is-sidebar-collapsed":j.value,onCloseSidebar:C[6]||(C[6]=z=>Ke(!0))},{sidebar:mt(()=>[m("section",GC,[m("div",KC,[j.value?oe("",!0):(_(),dt(yu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":j.value,"show-new-thread-button":!0,onToggleSidebar:C[0]||(C[0]=z=>Ke(!j.value)),onStartNewThread:T},{default:mt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":x.value,"aria-label":"Search threads",title:"Search threads",onClick:ln},[Re(_a,{class:"sidebar-search-toggle-icon"})],8,JC)]),_:1},8,["is-sidebar-collapsed"])),!j.value&&x.value?(_(),I("div",YC,[Re(_a,{class:"sidebar-search-bar-icon"}),tr(m("input",{ref_key:"sidebarSearchInputRef",ref:$,"onUpdate:modelValue":C[1]||(C[1]=z=>U.value=z),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:mn},null,544),[[nr,U.value]]),U.value.length>0?(_(),I("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:cn},[Re(tl,{class:"sidebar-search-clear-icon"})])):oe("",!0)])):oe("",!0),j.value?oe("",!0):(_(),I("button",{key:2,class:it(["sidebar-skills-link",{"is-active":gt.value}]),type:"button",onClick:C[2]||(C[2]=z=>{ge(H).push({name:"skills"}),ge(he)&&Ke(!0)})}," Skills Hub ",2)),j.value?oe("",!0):(_(),dt(jy,{key:3,groups:ge(s),"project-display-name-by-id":ge(o),"selected-thread-id":ge(c),"is-loading":ge(q),"search-query":U.value,"search-matched-thread-ids":W.value,onSelect:In,onArchive:D,onStartNewThread:f,onRenameProject:B,onBrowseProjectFiles:g,onRenameThread:ie,onRemoveProject:re,onReorderProject:Ie,onExportThread:rn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),j.value?oe("",!0):(_(),I("div",XC,[Re(zd,{name:"settings-panel"},{default:mt(()=>[pe.value?(_(),I("div",QC,[m("button",{class:"sidebar-settings-row",type:"button",onClick:hi},[C[7]||(C[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:it(["sidebar-settings-toggle",{"is-on":!fe.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:pi},[C[8]||(C[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",ZC,se(Ae.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:_s},[C[9]||(C[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",eA,se(Le.value==="system"?"System":Le.value==="dark"?"Dark":"Light"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Fn},[C[10]||(C[10]=m("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),m("span",{class:it(["sidebar-settings-toggle",{"is-on":qe.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:mi},[C[11]||(C[11]=m("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),m("span",{class:it(["sidebar-settings-toggle",{"is-on":tt.value}])},null,2)]),m("div",tA,[C[12]||(C[12]=m("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Re(jo,{class:"sidebar-settings-language-dropdown","model-value":ze.value,options:et.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":gi},null,8,["model-value","options"])])])):oe("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:C[3]||(C[3]=z=>pe.value=!pe.value)},[Re(kC,{class:"sidebar-settings-icon"}),C[13]||(C[13]=m("span",null,"Settings",-1))])]))])]),content:mt(()=>[m("section",nA,[Re(Wy,{title:Lt.value},{leading:mt(()=>[j.value||ge(he)?(_(),dt(yu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":j.value,"show-new-thread-button":!0,onToggleSidebar:C[4]||(C[4]=z=>Ke(!j.value)),onStartNewThread:T},null,8,["is-sidebar-collapsed"])):oe("",!0)]),_:1},8,["title"]),m("section",rA,[gt.value?(_(),dt(aC,{key:0,onSkillsChanged:an})):nt.value?(_(),I("div",sA,[m("div",oA,[C[14]||(C[14]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Re(jo,{class:"new-thread-folder-dropdown","model-value":Ce.value,options:Tt.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":V.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":gn,onAdd:qr},null,8,["model-value","options","default-add-value"]),Re(h0,{class:"new-thread-runtime-dropdown",modelValue:w.value,"onUpdate:modelValue":C[5]||(C[5]=z=>w.value=z)},null,8,["modelValue"]),P.value.phase!=="idle"?(_(),I("div",{key:0,class:it(["worktree-init-status",{"is-running":P.value.phase==="running","is-error":P.value.phase==="error"}])},[m("strong",iA,se(P.value.title),1),m("span",aA,se(P.value.message),1)],2)):oe("",!0)]),Re(Vc,{"active-thread-id":Oe.value,cwd:xe.value,models:ge(h),"selected-model":ge(y),"selected-reasoning-effort":ge(S),skills:ge(L),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":fe.value,"in-progress-submit-mode":Ae.value,"dictation-click-to-toggle":qe.value,"dictation-auto-send":tt.value,"prepend-draft-request":We.value,"dictation-language":ze.value,onSubmit:Et,"onUpdate:selectedModel":Q,"onUpdate:selectedReasoningEffort":Fe},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])):(_(),I("div",lA,[m("div",cA,[Re(Mb,{messages:jt.value,"is-loading":ge(Y),"active-thread-id":Oe.value,cwd:xe.value,"scroll-state":ge(a),"live-overlay":Ut.value,"pending-requests":ge(l),"is-turn-in-progress":Bt.value,"is-rolling-back":ge(Ee),onUpdateScrollState:Te,onRespondServerRequest:Be,onRollback:en},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",uA,[Re(o0,{messages:ge(we),onSteer:ge(Pe),onDelete:ge($e)},null,8,["messages","onSteer","onDelete"]),Re(Vc,{"active-thread-id":Oe.value,cwd:xe.value,models:ge(h),"selected-model":ge(y),"selected-reasoning-effort":ge(S),skills:ge(L),"is-turn-in-progress":Bt.value,"is-interrupting-turn":ge(F),"has-queue-above":ge(we).length>0,"send-with-enter":fe.value,"in-progress-submit-mode":Ae.value,"dictation-click-to-toggle":qe.value,"dictation-auto-send":tt.value,"prepend-draft-request":We.value,"dictation-language":ze.value,onSubmit:Et,"onUpdate:selectedModel":Q,"onUpdate:selectedReasoningEffort":Fe,onInterrupt:Ct},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","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",dA," WT "+se(ge(t))+" · v"+se(ge(n)),1)],64))}}),hA=rt(fA,[["__scopeId","data-v-e811e1c5"]]),ea={render:()=>null},pA=Fg({history:wg(),routes:[{path:"/",name:"home",component:ea},{path:"/thread/:threadId",name:"thread",component:ea},{path:"/skills",name:"skills",component:ea},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Mm(hA).use(pA).mount("#app");